mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-19 21:19:29 +00:00
Compare commits
175 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 688f815178 | |||
| 273b1d3fe4 | |||
| de60d0d09e | |||
| 6565399633 | |||
| 245b724314 | |||
| 10a5aaf9b4 | |||
| 544c6e7319 | |||
| a7ddc0d348 | |||
| 1e2cafef1d | |||
| 4205e490ef | |||
| 55ba874bb0 | |||
| 72692812ff | |||
| 90eb25716d | |||
| 80dabf5ce6 | |||
| bc7fc9611b | |||
| e4a1264072 | |||
| 517f1a9d93 | |||
| 1ecf011ba2 | |||
| e62848c773 | |||
| 2f90112e4d | |||
| 774eb90bcc | |||
| bccaf72399 | |||
| 1def930147 | |||
| 30b8a406a5 | |||
| 093842274e | |||
| 64b6e4a009 | |||
| 40c18d3603 | |||
| fd2f4187fa | |||
| d948251736 | |||
| 9ac9804563 | |||
| b2bebb7fa3 | |||
| e32cce57fe | |||
| af3d96abc7 | |||
| dc05d16545 | |||
| 24a0e74281 | |||
| cb7a0f7669 | |||
| 68d97a5e97 | |||
| d27071528f | |||
| 17772c3738 | |||
| bbb4f8a01c | |||
| bf5ab6b7dd | |||
| fdbb93a5c5 | |||
| b7e48633ab | |||
| 04dc1eb07b | |||
| 50b229090b | |||
| 2d27a998c4 | |||
| 090e535466 | |||
| c4d35181db | |||
| 0ac6ef4599 | |||
| 7f13c128f1 | |||
| cb60ddcc94 | |||
| bd4ced9559 | |||
| a04d2acb86 | |||
| de2aabf00b | |||
| 685fc69e5d | |||
| 58a921b500 | |||
| 57597dac29 | |||
| 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 | |||
| 7240b0c798 | |||
| b2538075ee | |||
| 5c463c0866 | |||
| 423bbd95a6 | |||
| 386cc779bf | |||
| 08c6d58a50 | |||
| 3f53c5feba | |||
| 298dbbf400 | |||
| 2c057aad58 | |||
| ab5294de2f | |||
| 8dd42361a0 | |||
| c2ce831bca | |||
| 21c1f13b28 | |||
| e0079bb812 | |||
| 966d1d10f6 | |||
| 76936ad74f | |||
| 6fbb09eb6e | |||
| cfe1307018 | |||
| 5139c3e44e | |||
| 229de14f9c | |||
| e990bb3d81 | |||
| 627a52e3d1 | |||
| 1951cd6fa8 | |||
| e3093bdf3f | |||
| b11d8d056a | |||
| 3a4015eced | |||
| aeb5d40840 | |||
| 49c712a5b6 | |||
| 46817b846a | |||
| 8c75608eaf | |||
| 2720ed9ffb | |||
| 2fc392c084 | |||
| ca630e94ae | |||
| 9cff50fa3b | |||
| 3d7a6b1ad3 | |||
| f15fd40636 | |||
| 054cf2f258 | |||
| dc067a619b | |||
| 2a762fa4ab | |||
| ccade6ae0e | |||
| 6971aed030 | |||
| 60e556b2a8 | |||
| 42fbbc5257 | |||
| d01dedb79c | |||
| 1972b461e7 | |||
| e957926a4d | |||
| bac2c13da3 | |||
| b90c26412a | |||
| 65c7ad2aac | |||
| 126a2d3b7b | |||
| 60734f708e | |||
| 14a8e2f001 | |||
| 059b13938e | |||
| a4f2502fe6 | |||
| 7c1762d467 | |||
| 36beb927f1 | |||
| ee41b2b68d | |||
| c3d20bb181 | |||
| 6b816def31 | |||
| 5fbcf588ed | |||
| fc4e79c1f5 | |||
| 41b2a6d1d4 | |||
| e054f1222b | |||
| c57eb1b8de | |||
| f1dbc6ab7d | |||
| d1015956d1 | |||
| 726fce9fac | |||
| 27a91de5f6 | |||
| 7ccc26c878 | |||
| 9ebc847e8e | |||
| 511b04c1f8 | |||
| ec90d35e02 | |||
| 43a1d163a3 | |||
| 4f104523ff | |||
| 02153e469f | |||
| 38e8f91fdf | |||
| 93388ff06c | |||
| 352fc53e74 | |||
| ba6224bc78 | |||
| d542cf7720 |
@@ -33,5 +33,27 @@ Events::on('loadRenderers', function ($renderers) {
|
||||
);
|
||||
});
|
||||
|
||||
//Tempus Renderers:
|
||||
Events::on('loadTempusRenderers', function ($renderers) {
|
||||
$fhc_core_renderers =& $renderers();
|
||||
$fhc_core_renderers["reservierung"] = array(
|
||||
'calendarEvent' => absoluteJsImportUrl('public/js/components/Tempus/Renderer/Reservierungen/calendarEvent.js'),
|
||||
'modalTitle' => absoluteJsImportUrl('public/js/components/Tempus/Renderer/Reservierungen/modalTitle.js'),
|
||||
'modalContent' => absoluteJsImportUrl('public/js/components/Tempus/Renderer/Reservierungen/modalContent.js'),
|
||||
'calendarEventStyles' => APP_ROOT . 'public/css/Cis4/CoreCalendarEvents.css'
|
||||
);
|
||||
});
|
||||
|
||||
Events::on('loadTempusRenderers', function ($renderers) {
|
||||
$fhc_core_renderers =& $renderers();
|
||||
$fhc_core_renderers["lehreinheit"] = array(
|
||||
'calendarEvent' => absoluteJsImportUrl('public/js/components/Tempus/Renderer/Lehreinheit/calendarEvent.js'),
|
||||
'modalTitle' => absoluteJsImportUrl('public/js/components/Tempus/Renderer/Lehreinheit/modalTitle.js'),
|
||||
'modalContent' => absoluteJsImportUrl('public/js/components/Tempus/Renderer/Lehreinheit/modalContent.js'),
|
||||
'calendarEventStyles' => APP_ROOT . 'public/css/Cis4/CoreCalendarEvents.css'
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -208,7 +208,14 @@ $config['navigation_header'] = array(
|
||||
'expand' => true,
|
||||
'sort' => 30,
|
||||
'requiredPermissions' => 'lehre/anrechnungszeitfenster:rw'
|
||||
)
|
||||
),
|
||||
'dashboardadmin' => array(
|
||||
'link' => site_url('dashboard/Admin'),
|
||||
'description' => 'Dashboard Admin',
|
||||
'expand' => true,
|
||||
'sort' => 40,
|
||||
'requiredPermissions' => 'dashboard/admin:r'
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -0,0 +1,5 @@
|
||||
<?php
|
||||
|
||||
$config['send_update_mails'] = false;
|
||||
$config['calendar_start'] = 7;
|
||||
$config['calendar_end'] = 23;
|
||||
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class Tempus extends Auth_Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
$permissions = [];
|
||||
$router = load_class('Router');
|
||||
$permissions[$router->method] = ['admin:r', 'assistenz:r'];
|
||||
parent::__construct($permissions);
|
||||
|
||||
// Load Libraries
|
||||
$this->load->library('VariableLib', ['uid' => getAuthUID()]);
|
||||
|
||||
// Load Config
|
||||
$this->load->config('calendar');
|
||||
}
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function _remap()
|
||||
{
|
||||
|
||||
$this->load->view('Tempus', [
|
||||
'permissions' => [
|
||||
'admin' => $this->permissionlib->isBerechtigt('admin')
|
||||
],
|
||||
'variables' => [
|
||||
'semester_aktuell' => $this->variablelib->getVar('semester_aktuell'),
|
||||
'timezone' => $this->config->item('timezone')
|
||||
]
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -31,7 +31,7 @@ class RendererLoader extends FHCAPI_Controller
|
||||
|
||||
parent::__construct([
|
||||
'GetRenderers' => self::PERM_LOGGED,
|
||||
|
||||
'GetTempusRenderers' => self::PERM_LOGGED,
|
||||
]);
|
||||
|
||||
$this->load->library('LogLib');
|
||||
@@ -66,6 +66,26 @@ class RendererLoader extends FHCAPI_Controller
|
||||
$this->terminateWithSuccess($renderer_paths);
|
||||
}
|
||||
|
||||
public function GetTempusRenderers(){
|
||||
$renderer_paths = [];
|
||||
Events::trigger(
|
||||
'loadRenderers',
|
||||
function & () use (&$renderer_paths)
|
||||
{
|
||||
return $renderer_paths;
|
||||
}
|
||||
);
|
||||
|
||||
Events::trigger(
|
||||
'loadTempusRenderers',
|
||||
function & () use (&$renderer_paths)
|
||||
{
|
||||
return $renderer_paths;
|
||||
}
|
||||
);
|
||||
$this->terminateWithSuccess($renderer_paths);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,121 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2026 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/>.
|
||||
*/
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* This controller operates between (interface) the JS (GUI) and the back-end
|
||||
* Provides data to the ajax get calls about addresses
|
||||
* This controller works with JSON calls on the HTTP GET or POST and the output is always JSON
|
||||
*/
|
||||
class Board extends FHCAPI_Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'list' => 'dashboard/admin:r',
|
||||
'create' => 'dashboard/admin:rw',
|
||||
'update' => 'dashboard/admin:rw',
|
||||
'delete' => 'dashboard/admin:rw'
|
||||
]);
|
||||
|
||||
// Models
|
||||
$this->load->model('dashboard/Dashboard_model', 'DashboardModel');
|
||||
}
|
||||
|
||||
public function list()
|
||||
{
|
||||
$result = $this->DashboardModel->load();
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($result);
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
$dashboard_kurzbz = $this->input->post('dashboard_kurzbz');
|
||||
|
||||
$result = $this->DashboardModel->insert([
|
||||
'dashboard_kurzbz' => $dashboard_kurzbz
|
||||
]);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
public function update()
|
||||
{
|
||||
$this->load->library('form_validation');
|
||||
|
||||
$this->form_validation->set_rules('dashboard_id', 'Dashboard ID', 'required');
|
||||
|
||||
if (!$this->form_validation->run())
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
$dashboard_id = $this->input->post('dashboard_id');
|
||||
$dashboard_kurzbz = $this->input->post('dashboard_kurzbz');
|
||||
$beschreibung = $this->input->post('beschreibung');
|
||||
|
||||
$result = $this->DashboardModel->update([
|
||||
'dashboard_id' => $dashboard_id
|
||||
], [
|
||||
'dashboard_kurzbz' => $dashboard_kurzbz,
|
||||
'beschreibung' => $beschreibung
|
||||
]);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($result);
|
||||
}
|
||||
|
||||
public function delete()
|
||||
{
|
||||
$this->load->library('form_validation');
|
||||
|
||||
$this->form_validation->set_rules('dashboard_id', 'Dashboard ID', 'required');
|
||||
|
||||
if (!$this->form_validation->run())
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
$dashboard_id = $this->input->post('dashboard_id');
|
||||
|
||||
//delete all presets
|
||||
$this->load->model('dashboard/Dashboard_Preset_model', 'DashboardPresetModel');
|
||||
|
||||
$result = $this->DashboardPresetModel->delete([
|
||||
'dashboard_id' => $dashboard_id
|
||||
]);
|
||||
$this->getDataOrTerminateWithError($result);
|
||||
|
||||
//delete all widgets
|
||||
$this->load->model('dashboard/Dashboard_Widget_model', 'DashboardWidgetModel');
|
||||
|
||||
$result = $this->DashboardWidgetModel->delete([
|
||||
'dashboard_id' => $dashboard_id
|
||||
]);
|
||||
$this->getDataOrTerminateWithError($result);
|
||||
|
||||
$result = $this->DashboardModel->delete($dashboard_id);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($result);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,200 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2026 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/>.
|
||||
*/
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* This controller operates between (interface) the JS (GUI) and the back-end
|
||||
* Provides data to the ajax get calls about addresses
|
||||
* This controller works with JSON calls on the HTTP GET or POST and the output is always JSON
|
||||
*/
|
||||
class Preset extends FHCAPI_Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'list' => 'dashboard/admin:r',
|
||||
'getBatch' => 'dashboard/admin:r',
|
||||
'addWidget' => 'dashboard/admin:rw',
|
||||
'removeWidget' => 'dashboard/admin:rw'
|
||||
]);
|
||||
|
||||
// Load language phrases
|
||||
$this->loadPhrases([
|
||||
'ui'
|
||||
]);
|
||||
|
||||
// Libraries
|
||||
$this->load->library('dashboard/DashboardLib');
|
||||
|
||||
// Models
|
||||
$this->load->model('ressource/Funktion_model', 'FunktionModel');
|
||||
}
|
||||
|
||||
public function list($dashboard_kurzbz)
|
||||
{
|
||||
$sql = "
|
||||
WITH
|
||||
dashboard_presets AS (
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
dashboard.tbl_dashboard_preset dp
|
||||
JOIN
|
||||
dashboard.tbl_dashboard d ON d.dashboard_id = dp.dashboard_id
|
||||
WHERE
|
||||
d.dashboard_kurzbz = {$this->db->escape($dashboard_kurzbz)}
|
||||
),
|
||||
general AS (
|
||||
SELECT
|
||||
'general' AS funktion_kurzbz,
|
||||
'Allgemein' AS beschreibung
|
||||
)
|
||||
|
||||
(
|
||||
SELECT
|
||||
f.funktion_kurzbz,
|
||||
f.beschreibung,
|
||||
COUNT(p.preset_id) AS has_preset
|
||||
FROM
|
||||
general f
|
||||
LEFT JOIN
|
||||
dashboard_presets p ON p.funktion_kurzbz IS NULL
|
||||
GROUP BY
|
||||
f.funktion_kurzbz, f.beschreibung
|
||||
)
|
||||
UNION ALL
|
||||
(
|
||||
SELECT
|
||||
f.funktion_kurzbz,
|
||||
f.beschreibung,
|
||||
COUNT(p.preset_id) AS has_preset
|
||||
FROM
|
||||
public.tbl_funktion f
|
||||
LEFT JOIN
|
||||
dashboard_presets p ON p.funktion_kurzbz = f.funktion_kurzbz
|
||||
GROUP BY
|
||||
f.funktion_kurzbz, f.beschreibung
|
||||
ORDER BY
|
||||
f.beschreibung ASC
|
||||
)
|
||||
";
|
||||
|
||||
$result = $this->FunktionModel->execReadOnlyQuery($sql);
|
||||
|
||||
$funktionen = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($funktionen);
|
||||
}
|
||||
|
||||
public function getBatch()
|
||||
{
|
||||
$this->load->library('form_validation');
|
||||
|
||||
$this->form_validation->set_rules('db', 'Dashboard', 'required');
|
||||
|
||||
if (!$this->form_validation->run())
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
$db = $this->input->post('db');
|
||||
$funktionen = $this->input->post('funktionen') ?: [];
|
||||
|
||||
$result = [];
|
||||
|
||||
foreach ($funktionen as $funktion) {
|
||||
$conf = $this->dashboardlib->getPreset($db, $funktion);
|
||||
if ($conf) {
|
||||
$preset = json_decode($conf->preset, true);
|
||||
if (!isset($preset[$funktion]) || !isset($preset[$funktion]['widgets']))
|
||||
$result[$funktion] = [];
|
||||
else
|
||||
$result[$funktion] = $preset[$funktion]['widgets'];
|
||||
} else {
|
||||
$result[$funktion] = [];
|
||||
}
|
||||
}
|
||||
|
||||
return $this->terminateWithSuccess($result);
|
||||
}
|
||||
|
||||
public function addWidget()
|
||||
{
|
||||
$this->load->library('form_validation');
|
||||
|
||||
$this->form_validation->set_rules('dashboard', 'Dashboard', 'required');
|
||||
$this->form_validation->set_rules('funktion_kurzbz', 'Funktion', 'required');
|
||||
$this->form_validation->set_rules('widget[widget]', 'Widget', 'required');
|
||||
|
||||
if (!$this->form_validation->run())
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
$dashboard_kurzbz = $this->input->post('dashboard');
|
||||
$funktion_kurzbz = $this->input->post('funktion_kurzbz');
|
||||
$widget = $this->input->post('widget');
|
||||
|
||||
if (!isset($widget['widgetid']))
|
||||
$widget['widgetid'] = $this->dashboardlib->generateWidgetId($dashboard_kurzbz);
|
||||
|
||||
$preset = $this->dashboardlib->getPresetOrCreateEmptyPreset($dashboard_kurzbz, $funktion_kurzbz);
|
||||
|
||||
$preset_decoded = json_decode($preset->preset, true);
|
||||
|
||||
$this->dashboardlib->addWidgetsToWidgets($preset_decoded, $dashboard_kurzbz, $funktion_kurzbz, [$widget]);
|
||||
|
||||
$preset->preset = json_encode($preset_decoded);
|
||||
|
||||
$result = $this->dashboardlib->insertOrUpdatePreset($preset);
|
||||
|
||||
$this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($widget['widgetid']);
|
||||
}
|
||||
|
||||
public function removeWidget()
|
||||
{
|
||||
$this->load->library('form_validation');
|
||||
|
||||
$this->form_validation->set_rules('db', 'Dashboard', 'required');
|
||||
$this->form_validation->set_rules('funktion_kurzbz', 'Funktion', 'required');
|
||||
$this->form_validation->set_rules('widgetid', 'Widget', 'required');
|
||||
|
||||
if (!$this->form_validation->run())
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
$dashboard_kurzbz = $this->input->post('db');
|
||||
$funktion_kurzbz = $this->input->post('funktion_kurzbz');
|
||||
$widgetid = $this->input->post('widgetid');
|
||||
|
||||
$preset = $this->dashboardlib->getPreset($dashboard_kurzbz, $funktion_kurzbz);
|
||||
if (!$preset)
|
||||
show_404();
|
||||
|
||||
$preset_decoded = json_decode($preset->preset, true);
|
||||
|
||||
if (!$this->dashboardlib->removeWidgetFromWidgets($preset_decoded, $funktion_kurzbz, $widgetid))
|
||||
show_404();
|
||||
|
||||
$preset->preset = json_encode($preset_decoded);
|
||||
|
||||
$result = $this->dashboardlib->insertOrUpdatePreset($preset);
|
||||
|
||||
$this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess(array('msg' => $this->p->t('dashboard', 'success_savePreset')));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,159 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2026 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/>.
|
||||
*/
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* This controller operates between (interface) the JS (GUI) and the back-end
|
||||
* Provides data to the ajax get calls about the users dashboard
|
||||
* This controller works with JSON calls on the HTTP GET or POST and the output is always JSON
|
||||
*/
|
||||
class User extends FHCAPI_Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'get' => 'dashboard/benutzer:r',
|
||||
'addWidget' => 'dashboard/benutzer:rw',
|
||||
'removeWidget' => 'dashboard/benutzer:rw'
|
||||
]);
|
||||
|
||||
// Libraries
|
||||
$this->load->library('dashboard/DashboardLib');
|
||||
|
||||
// Models
|
||||
$this->load->model('ressource/Funktion_model', 'FunktionModel');
|
||||
}
|
||||
|
||||
public function get($dashboard_kurzbz)
|
||||
{
|
||||
$dashboard = $this->dashboardlib->getDashboardByKurzbz($dashboard_kurzbz);
|
||||
if (!$dashboard)
|
||||
show_404();
|
||||
|
||||
$uid = $this->authlib->getAuthObj()->username;
|
||||
|
||||
/*$mergedconfig = $this->dashboardlib->getMergedConfig($dashboard->dashboard_id, $uid);
|
||||
|
||||
$this->terminateWithSuccess([
|
||||
'general' => call_user_func_array(
|
||||
'array_merge_recursive',
|
||||
$mergedconfig
|
||||
)
|
||||
]);*/
|
||||
$defaultconfig = $this->dashboardlib->getDefaultConfig($dashboard->dashboard_id);
|
||||
$userconfig = $this->dashboardlib->getUserConfig($dashboard->dashboard_id, $uid);
|
||||
|
||||
$defaultconfig_squashed = $defaultconfig ? call_user_func_array('array_replace_recursive', $defaultconfig) : [];
|
||||
$userconfig_squashed = $userconfig ? call_user_func_array('array_replace_recursive', $userconfig) : [];
|
||||
|
||||
$mergedconfig = array_replace_recursive($defaultconfig_squashed, $userconfig_squashed);
|
||||
|
||||
$this->terminateWithSuccess([
|
||||
DashboardLib::SECTION_IF_FUNKTION_KURZBZ_IS_NULL => $mergedconfig
|
||||
]);
|
||||
}
|
||||
|
||||
public function addWidget()
|
||||
{
|
||||
$this->load->library('form_validation');
|
||||
|
||||
$this->form_validation->set_rules('dashboard', 'Dashboard', 'required');
|
||||
$this->form_validation->set_rules('widget[widget]', 'Widget', 'required');
|
||||
|
||||
if (!$this->form_validation->run())
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
$widget = $this->input->post('widget');
|
||||
$dashboard_kurzbz = $this->input->post('dashboard');
|
||||
$uid = $this->authlib->getAuthObj()->username;
|
||||
|
||||
if (!isset($widget['widgetid']))
|
||||
$widget['widgetid'] = $this->dashboardlib->generateWidgetId($dashboard_kurzbz);
|
||||
|
||||
$override = $this->dashboardlib->getOverrideOrCreateEmptyOverride($dashboard_kurzbz, $uid);
|
||||
|
||||
$override_decoded = json_decode($override->override, true);
|
||||
|
||||
if (!isset($override_decoded['general']) || !is_array($override_decoded['general']))
|
||||
$override_decoded['general'] = [];
|
||||
|
||||
if (!isset($override_decoded['general']['widgets']))
|
||||
$override_decoded['general']['widgets'] = [];
|
||||
|
||||
$override_decoded['general']['widgets'][$widget['widgetid']] = $widget;
|
||||
|
||||
// NOTE(chris): remove doubles in other funktionen
|
||||
foreach ($override_decoded as $funktion => $array) {
|
||||
if ($funktion == 'general')
|
||||
continue;
|
||||
if (isset($array['widgets']) && isset($array['widgets'][$widget['widgetid']]))
|
||||
unset($override_decoded[$funktion]['widgets'][$widget['widgetid']]);
|
||||
}
|
||||
|
||||
$override->override = json_encode($override_decoded);
|
||||
|
||||
$result = $this->dashboardlib->insertOrUpdateOverride($override);
|
||||
|
||||
$this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($widget['widgetid']);
|
||||
}
|
||||
|
||||
public function removeWidget()
|
||||
{
|
||||
$this->load->library('form_validation');
|
||||
|
||||
$this->form_validation->set_rules('dashboard', 'Dashboard', 'required');
|
||||
$this->form_validation->set_rules('widget', 'Widget', 'required');
|
||||
|
||||
if (!$this->form_validation->run())
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
$widget_id = $this->input->post('widget');
|
||||
$dashboard_kurzbz = $this->input->post('dashboard');
|
||||
$uid = $this->authlib->getAuthObj()->username;
|
||||
|
||||
$override = $this->dashboardlib->getOverride($dashboard_kurzbz, $uid);
|
||||
if (!$override)
|
||||
show_404();
|
||||
|
||||
$override_decoded = json_decode($override->override, true);
|
||||
|
||||
foreach (array_keys($override_decoded) as $k) {
|
||||
if (!isset($override_decoded[$k]["widgets"])) {
|
||||
unset($override_decoded[$k]);
|
||||
continue;
|
||||
}
|
||||
if (isset($override_decoded[$k]["widgets"][$widget_id])) {
|
||||
unset($override_decoded[$k]["widgets"][$widget_id]);
|
||||
}
|
||||
if (!$override_decoded[$k]["widgets"]) {
|
||||
unset($override_decoded[$k]);
|
||||
}
|
||||
}
|
||||
|
||||
$override->override = json_encode($override_decoded);
|
||||
|
||||
$result = $this->dashboardlib->insertOrUpdateOverride($override);
|
||||
|
||||
$this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,137 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2026 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/>.
|
||||
*/
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* This controller operates between (interface) the JS (GUI) and the back-end
|
||||
* Provides data to the ajax get calls about the users dashboard
|
||||
* This controller works with JSON calls on the HTTP GET or POST and the output is always JSON
|
||||
*/
|
||||
class Widget extends FHCAPI_Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'get' => ['dashboard/benutzer:r', 'dashboard/admin:r'],
|
||||
'list' => 'dashboard/admin:r',
|
||||
'listAllowed' => ['dashboard/benutzer:rw', 'dashboard/admin:r'],
|
||||
'setAllowed' => 'dashboard/admin:rw'
|
||||
]);
|
||||
|
||||
// Libraries
|
||||
$this->load->library('dashboard/DashboardLib');
|
||||
|
||||
// Models
|
||||
$this->load->model('dashboard/Widget_model', 'WidgetModel');
|
||||
}
|
||||
|
||||
public function get($id)
|
||||
{
|
||||
$result = $this->WidgetModel->load($id);
|
||||
|
||||
$widget = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
if (!$widget)
|
||||
return $this->terminateWithSuccess([
|
||||
"widget_id" => 0,
|
||||
"widget_kurzbz" => "notfound",
|
||||
"arguments" => [
|
||||
"className" => 'alert-danger',
|
||||
"title" => 'Widget Not Found',
|
||||
"msg" => 'The widget with the id ' . $id . ' could not be found'
|
||||
],
|
||||
"setup" => [
|
||||
"name" => 'Widget Not Found',
|
||||
"file" => absoluteJsImportUrl('public/js/components/DashboardWidget/Default.js'),
|
||||
"width" => 1,
|
||||
"height" => 1
|
||||
]
|
||||
]);
|
||||
|
||||
$widget = current($widget);
|
||||
$widget->arguments = json_decode($widget->arguments);
|
||||
$tmpsetup = json_decode($widget->setup);
|
||||
$tmpsetup->file = absoluteJsImportUrl($tmpsetup->file);
|
||||
$widget->setup = $tmpsetup;
|
||||
|
||||
$this->terminateWithSuccess($widget);
|
||||
}
|
||||
|
||||
public function list($dashboard)
|
||||
{
|
||||
$result = $this->WidgetModel->getWithAllowedForDashboard($dashboard);
|
||||
|
||||
$widgets = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$widgets = array_map(function ($widget) {
|
||||
$widget->arguments = json_decode($widget->arguments);
|
||||
$tmpsetup = json_decode($widget->setup);
|
||||
$tmpsetup->file = absoluteJsImportUrl($tmpsetup->file);
|
||||
$widget->setup = $tmpsetup;
|
||||
return $widget;
|
||||
}, $widgets);
|
||||
|
||||
$this->terminateWithSuccess($widgets);
|
||||
}
|
||||
|
||||
public function listAllowed($dashboard)
|
||||
{
|
||||
$result = $this->WidgetModel->getForDashboard($dashboard);
|
||||
|
||||
$widgets = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$widgets = array_map(function ($widget) {
|
||||
$widget->arguments = json_decode($widget->arguments);
|
||||
$tmpsetup = json_decode($widget->setup);
|
||||
$tmpsetup->file = absoluteJsImportUrl($tmpsetup->file);
|
||||
$widget->setup = $tmpsetup;
|
||||
return $widget;
|
||||
}, $widgets);
|
||||
|
||||
$this->terminateWithSuccess($widgets);
|
||||
}
|
||||
|
||||
public function setAllowed()
|
||||
{
|
||||
$this->load->library('form_validation');
|
||||
|
||||
$this->form_validation->set_rules('dashboard_id', 'Dashboard', 'required');
|
||||
$this->form_validation->set_rules('widget_id', 'Widget', 'required');
|
||||
$this->form_validation->set_rules('allowed', 'Allowed', 'is_bool');
|
||||
|
||||
if (!$this->form_validation->run())
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
$data = [
|
||||
'dashboard_id' => $this->input->post('dashboard_id'),
|
||||
'widget_id' => $this->input->post('widget_id')
|
||||
];
|
||||
|
||||
$this->load->model('dashboard/Dashboard_Widget_model', 'DashboardWidgetModel');
|
||||
|
||||
if ($this->input->post('allowed'))
|
||||
$result = $this->DashboardWidgetModel->insert($data);
|
||||
else
|
||||
$result = $this->DashboardWidgetModel->delete($data);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
}
|
||||
@@ -118,54 +118,17 @@ class Gruppe extends FHCAPI_Controller
|
||||
|
||||
$query_words = explode(' ', $query);
|
||||
|
||||
$this->_ci->GruppeModel->addSelect('gruppe_kurzbz,
|
||||
studiengang_kz,
|
||||
semester,
|
||||
bezeichnung,
|
||||
gid,
|
||||
\'false\' as lehrverband');
|
||||
$this->_ci->GruppeModel->db->where(array('sichtbar' => true, 'aktiv' => true, 'lehre' => true, 'direktinskription' => false, 'semester IS NOT NULL' => null));
|
||||
$this->_ci->GruppeModel->db->group_start();
|
||||
foreach ($query_words as $word)
|
||||
{
|
||||
$this->_ci->GruppeModel->db->group_start();
|
||||
$this->_ci->GruppeModel->db->where('gruppe_kurzbz ILIKE', "%" . $word . "%");
|
||||
$this->_ci->GruppeModel->db->or_where('bezeichnung ILIKE', "%" . $word . "%");
|
||||
$this->_ci->GruppeModel->db->group_end();
|
||||
}
|
||||
$this->_ci->GruppeModel->db->group_end();
|
||||
|
||||
$gruppen_result = $this->_ci->GruppeModel->load();
|
||||
|
||||
$gruppen_array = array();
|
||||
$gruppen_result = $this->_ci->GruppeModel->search($query_words);
|
||||
|
||||
if (isError($gruppen_result))
|
||||
$this->terminateWithError(getError($gruppen_result), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$gruppen_array = array();
|
||||
|
||||
if (hasData($gruppen_result))
|
||||
$gruppen_array = getData($gruppen_result);
|
||||
|
||||
$this->_ci->LehrverbandModel->addSelect('CONCAT(UPPER(CONCAT(typ, kurzbz)), \'\', semester, verband, COALESCE(gruppe,\'\')) as gruppe_kurzbz,
|
||||
studiengang_kz,
|
||||
semester,
|
||||
tbl_lehrverband.bezeichnung,
|
||||
gid,
|
||||
\'true\' as lehrverband');
|
||||
$this->_ci->LehrverbandModel->addJoin('public.tbl_studiengang', 'studiengang_kz');
|
||||
$this->_ci->LehrverbandModel->addOrder('verband');
|
||||
$this->_ci->LehrverbandModel->addOrder('gruppe');
|
||||
$this->_ci->LehrverbandModel->db->where(array('tbl_lehrverband.aktiv' => true));
|
||||
|
||||
$this->_ci->LehrverbandModel->db->group_start();
|
||||
foreach ($query_words as $word)
|
||||
{
|
||||
$this->_ci->LehrverbandModel->db->group_start();
|
||||
$this->_ci->LehrverbandModel->db->where('CONCAT(CONCAT(typ, kurzbz), \'\', semester, verband, COALESCE(gruppe,\'\')) ILIKE', "%" . $word . "%");
|
||||
$this->_ci->LehrverbandModel->db->or_where('tbl_lehrverband.bezeichnung ILIKE', "%" . $word . "%");
|
||||
$this->_ci->LehrverbandModel->db->group_end();
|
||||
}
|
||||
$this->_ci->LehrverbandModel->db->group_end();
|
||||
$lehrverband_result = $this->_ci->LehrverbandModel->load();
|
||||
$lehrverband_result = $this->_ci->LehrverbandModel->search($query_words);
|
||||
|
||||
$lehrverband_array = array();
|
||||
|
||||
|
||||
@@ -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');
|
||||
|
||||
@@ -0,0 +1,125 @@
|
||||
<?php
|
||||
|
||||
if (!defined('BASEPATH'))
|
||||
exit('No direct script access allowed');
|
||||
|
||||
|
||||
class Config extends FHCAPI_Controller
|
||||
{
|
||||
private $_ci;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'get' => ['admin:r', 'assistenz:r'],
|
||||
'getHeader' => ['admin:r', 'assistenz:r'],
|
||||
'set' => ['admin:r', 'assistenz:r'],
|
||||
]);
|
||||
|
||||
// Load Phrases
|
||||
$this->loadPhrases([
|
||||
'ui',
|
||||
]);
|
||||
|
||||
$this->_ci = &get_instance();
|
||||
$this->_ci->load->model('ressource/Kalenderstatus_model', 'KalenderStatusModel');
|
||||
}
|
||||
|
||||
public function get()
|
||||
{
|
||||
$this->_ci->load->model('system/Variable_model', 'VariableModel');
|
||||
|
||||
$config = [];
|
||||
|
||||
$result = $this->_ci->VariableModel->getVariables(getAuthUID(), ['ignore_kollision', 'kollision_student', 'ignore_reservierung', 'ignore_zeitsperre', 'ignore_resources_collisions']);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
$config['ignore_kollision'] = [
|
||||
"type" => "checkbox",
|
||||
"label" => $this->p->t('ui', 'ignore_kollision'),
|
||||
"value" => ($data['ignore_kollision'] ?? 'false') === 'true'
|
||||
|
||||
];
|
||||
|
||||
$config['kollision_student'] = [
|
||||
"type" => "checkbox",
|
||||
"label" => $this->p->t('ui', 'kollision_student'),
|
||||
"value" => ($data['kollision_student'] ?? 'false') === 'true'
|
||||
];
|
||||
|
||||
$config['ignore_reservierung'] = [
|
||||
"type" => "checkbox",
|
||||
"label" => $this->p->t('ui', 'ignore_reservierung'),
|
||||
"value" => ($data['ignore_reservierung'] ?? 'false') === 'true'
|
||||
|
||||
];
|
||||
|
||||
$config['ignore_zeitsperre'] = [
|
||||
"type" => "checkbox",
|
||||
"label" => $this->p->t('ui', 'ignore_zeitsperre'),
|
||||
"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);
|
||||
}
|
||||
public function getHeader()
|
||||
{
|
||||
$language = getUserLanguage() == 'German' ? 0 : 1;
|
||||
|
||||
$this->_ci->KalenderStatusModel->addSelect('*, array_to_json(bezeichnung_mehrsprachig::varchar[])->>' . $language .' AS status');
|
||||
$this->_ci->KalenderStatusModel->addOrder('sort');
|
||||
$this->_ci->KalenderStatusModel->db->where_not_in('status_kurzbz', array('archived', 'deleted'));
|
||||
$visible_status = $this->_ci->KalenderStatusModel->load();
|
||||
|
||||
$visible_status = getData($visible_status);
|
||||
|
||||
$config['visible_status']['all'] = 'Alle';
|
||||
|
||||
foreach ($visible_status as $status)
|
||||
{
|
||||
$config['visible_status'][$status->status_kurzbz] = $status->status;
|
||||
}
|
||||
|
||||
$this->terminateWithSuccess($config);
|
||||
}
|
||||
|
||||
public function set()
|
||||
{
|
||||
$this->_ci->load->model('system/Variable_model', 'VariableModel');
|
||||
|
||||
$this->_ci->VariableModel->setVariable(
|
||||
getAuthUID(),
|
||||
'ignore_kollision',
|
||||
$this->input->post('ignore_kollision') === true ? 'true' : 'false'
|
||||
);
|
||||
$this->_ci->VariableModel->setVariable(
|
||||
getAuthUID(),
|
||||
'kollision_student',
|
||||
$this->input->post('kollision_student') === true ? 'true' : 'false'
|
||||
);
|
||||
$this->_ci->VariableModel->setVariable(
|
||||
getAuthUID(),
|
||||
'ignore_reservierung',
|
||||
$this->input->post('ignore_reservierung') === true ? 'true' : 'false'
|
||||
);
|
||||
$this->_ci->VariableModel->setVariable(
|
||||
getAuthUID(),
|
||||
'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();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,254 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class Coursepicker extends FHCAPI_Controller
|
||||
{
|
||||
private $_ci;
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'search' => self::PERM_LOGGED,
|
||||
'getByStg' => self::PERM_LOGGED
|
||||
]);
|
||||
|
||||
$this->_ci = &get_instance();
|
||||
$this->load->library('form_validation');
|
||||
|
||||
$this->_ci->load->model('education/lehreinheit_model', 'LehreinheitModel');
|
||||
$this->_ci->load->model('education/Lehreinheitmitarbeiter_model', 'LehreinheitmitarbeiterModel');
|
||||
|
||||
|
||||
$this->loadPhrases(['ui']);
|
||||
}
|
||||
|
||||
public function search()
|
||||
{
|
||||
$query = $this->input->get('query');
|
||||
if (is_null($query))
|
||||
$this->terminateWithError($this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$query_words = explode(' ', $query);
|
||||
|
||||
//TODO Where weiter anpassen z.B. Fachbereich
|
||||
$this->_ci->LehreinheitModel->addSelect('tbl_lehreinheit.lehreinheit_id,
|
||||
tbl_lehreinheit.unr,
|
||||
tbl_lehreinheit.lvnr,
|
||||
tbl_lehreinheit.lehrfach_id,
|
||||
lehrfach.kurzbz AS lehrfach,
|
||||
lehrfach.bezeichnung AS lehrfach_bez,
|
||||
lehrfach.farbe AS lehrfach_farbe,
|
||||
tbl_lehreinheit.lehrform_kurzbz AS lehrform,
|
||||
lema.mitarbeiter_uid AS lektor_uid,
|
||||
tbl_mitarbeiter.kurzbz AS lektor,
|
||||
tbl_studiengang.studiengang_kz,
|
||||
upper(tbl_studiengang.typ::character varying::text || tbl_studiengang.kurzbz::text) AS studiengang,
|
||||
lvb.semester,
|
||||
lvb.verband,
|
||||
lvb.gruppe,
|
||||
lvb.gruppe_kurzbz,
|
||||
tbl_lehreinheit.raumtyp,
|
||||
tbl_lehreinheit.raumtypalternativ,
|
||||
tbl_lehreinheit.stundenblockung,
|
||||
tbl_lehreinheit.wochenrythmus,
|
||||
lema.semesterstunden,
|
||||
lema.planstunden,
|
||||
tbl_lehreinheit.start_kw,
|
||||
tbl_lehreinheit.anmerkung,
|
||||
tbl_lehreinheit.studiensemester_kurzbz');
|
||||
|
||||
$this->_ci->LehreinheitModel->addJoin('lehre.tbl_lehreinheitmitarbeiter lema', 'tbl_lehreinheit.lehreinheit_id = lema.lehreinheit_id');
|
||||
$this->_ci->LehreinheitModel->addJoin('lehre.tbl_lehreinheitgruppe lvb', 'tbl_lehreinheit.lehreinheit_id = lvb.lehreinheit_id');
|
||||
$this->_ci->LehreinheitModel->addJoin('public.tbl_studiengang', 'lvb.studiengang_kz = tbl_studiengang.studiengang_kz');
|
||||
$this->_ci->LehreinheitModel->addJoin('lehre.tbl_lehrveranstaltung lehrfach', 'tbl_lehreinheit.lehrfach_id = lehrfach.lehrveranstaltung_id');
|
||||
$this->_ci->LehreinheitModel->addJoin('public.tbl_mitarbeiter', 'lema.mitarbeiter_uid = tbl_mitarbeiter.mitarbeiter_uid');
|
||||
$this->_ci->LehreinheitModel->addJoin('lehre.tbl_lehrform', 'tbl_lehrform.lehrform_kurzbz = tbl_lehreinheit.lehrform_kurzbz');
|
||||
|
||||
$this->_ci->MitarbeiterModel->db->group_start();
|
||||
|
||||
foreach ($query_words as $word)
|
||||
{
|
||||
$this->_ci->LehreinheitModel->db->group_start();
|
||||
$this->_ci->LehreinheitModel->db->where('lema.mitarbeiter_uid ILIKE', "%" . $word . "%");
|
||||
$this->_ci->LehreinheitModel->db->or_where('lvb.gruppe_kurzbz ILIKE', "%" . $word . "%");
|
||||
$this->_ci->LehreinheitModel->db->or_where('tbl_studiengang.kurzbzlang ILIKE', "%" . $word . "%");
|
||||
$this->_ci->LehreinheitModel->db->or_where('lvb.verband ILIKE', "%" . $word . "%");
|
||||
$this->_ci->LehreinheitModel->db->or_where('lvb.gruppe ILIKE', "%" . $word . "%");
|
||||
$this->_ci->LehreinheitModel->db->or_where('lehrfach.bezeichnung ILIKE', "%" . $word . "%");
|
||||
|
||||
if (is_numeric($word))
|
||||
{
|
||||
$this->_ci->LehreinheitModel->db->or_where('tbl_studiengang.studiengang_kz', $word);
|
||||
$this->_ci->LehreinheitModel->db->or_where('lvb.semester', $word);
|
||||
}
|
||||
$this->_ci->LehreinheitModel->db->group_end();
|
||||
|
||||
}
|
||||
$this->_ci->LehreinheitModel->db->group_end();
|
||||
$this->_ci->LehreinheitModel->db->where('tbl_lehreinheit.studiensemester_kurzbz = \'SS2025\'');
|
||||
$this->_ci->LehreinheitModel->db->where(array('tbl_lehrform.verplanen' => true));
|
||||
|
||||
$result = $this->_ci->LehreinheitModel->load();
|
||||
|
||||
$this->terminateWithSuccess(hasData($result) ? getData($result) : array());
|
||||
}
|
||||
|
||||
public function getByStg()
|
||||
{
|
||||
//TODO check einbauen ob studiensemester und stg vorhanden ist
|
||||
$stg = $this->input->get('stg');
|
||||
$studiensemester_kurzbz = $this->input->get('studiensemester_kurzbz');
|
||||
if (is_null($stg) || is_null($studiensemester_kurzbz))
|
||||
$this->terminateWithError($this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$this->_ci->LehreinheitModel->addSelect('
|
||||
tbl_lehreinheit.lehreinheit_id,
|
||||
tbl_lehreinheit.unr,
|
||||
tbl_lehreinheit.lvnr,
|
||||
tbl_lehreinheit.lehrfach_id,
|
||||
lehrfach.kurzbz AS lehrfach,
|
||||
lehrfach.bezeichnung AS lehrfach_bez,
|
||||
lehrfach.farbe AS lehrfach_farbe,
|
||||
tbl_lehreinheit.lehrform_kurzbz AS lehrform,
|
||||
lema.mitarbeiter_uid AS lektor_uid,
|
||||
ma.kurzbz AS lektor,
|
||||
tbl_person.vorname,
|
||||
tbl_person.nachname,
|
||||
tbl_studiengang.studiengang_kz,
|
||||
upper(tbl_studiengang.typ::character varying::text || tbl_studiengang.kurzbz::text) AS studiengang,
|
||||
lvb.semester,
|
||||
lvb.verband,
|
||||
lvb.gruppe,
|
||||
lvb.gruppe_kurzbz,
|
||||
tbl_lehreinheit.raumtyp,
|
||||
tbl_lehreinheit.raumtypalternativ,
|
||||
tbl_lehreinheit.stundenblockung,
|
||||
tbl_lehreinheit.wochenrythmus,
|
||||
lema.semesterstunden,
|
||||
lema.planstunden,
|
||||
tbl_lehreinheit.start_kw,
|
||||
tbl_lehreinheit.anmerkung,
|
||||
tbl_lehreinheit.studiensemester_kurzbz
|
||||
');
|
||||
$this->_ci->LehreinheitModel->addJoin('lehre.tbl_lehreinheitmitarbeiter lema', 'tbl_lehreinheit.lehreinheit_id = lema.lehreinheit_id');
|
||||
$this->_ci->LehreinheitModel->addJoin('lehre.tbl_lehreinheitgruppe lvb', 'tbl_lehreinheit.lehreinheit_id = lvb.lehreinheit_id');
|
||||
$this->_ci->LehreinheitModel->addJoin('public.tbl_studiengang', 'lvb.studiengang_kz = tbl_studiengang.studiengang_kz');
|
||||
$this->_ci->LehreinheitModel->addJoin('lehre.tbl_lehrveranstaltung lehrfach', 'tbl_lehreinheit.lehrfach_id = lehrfach.lehrveranstaltung_id');
|
||||
$this->_ci->LehreinheitModel->addJoin('public.tbl_mitarbeiter ma', 'lema.mitarbeiter_uid = ma.mitarbeiter_uid');
|
||||
$this->_ci->LehreinheitModel->addJoin('lehre.tbl_lehrform', 'tbl_lehrform.lehrform_kurzbz = tbl_lehreinheit.lehrform_kurzbz');
|
||||
$this->_ci->LehreinheitModel->addJoin('public.tbl_benutzer', 'ma.mitarbeiter_uid = tbl_benutzer.uid');
|
||||
$this->_ci->LehreinheitModel->addJoin('public.tbl_person', 'tbl_benutzer.person_id = tbl_person.person_id');
|
||||
|
||||
$result = $this->_ci->LehreinheitModel->loadWhere(array(
|
||||
'tbl_lehrform.verplanen' => true,
|
||||
'tbl_studiengang.studiengang_kz' => $stg,
|
||||
'tbl_lehreinheit.studiensemester_kurzbz' => $studiensemester_kurzbz
|
||||
));
|
||||
|
||||
$result = hasData($result) ? getData($result) : array();
|
||||
$grouped = array();
|
||||
|
||||
foreach ($result as $row)
|
||||
{
|
||||
$unr = $row->unr;
|
||||
if (!isset($grouped[$unr]))
|
||||
{
|
||||
$grouped[$unr] = (object)array(
|
||||
'unr' => $row->unr,
|
||||
'lehrfach_id' => $row->lehrfach_id,
|
||||
'lehrfach_bez' => $row->lehrfach_bez,
|
||||
'lehrfach_farbe' => $row->lehrfach_farbe,
|
||||
'studiengang_kz' => $row->studiengang_kz,
|
||||
'studiengang' => $row->studiengang,
|
||||
'semester' => $row->semester,
|
||||
'verband' => $row->verband,
|
||||
'gruppe' => $row->gruppe,
|
||||
'gruppe_kurzbz' => $row->gruppe_kurzbz,
|
||||
'raumtyp' => $row->raumtyp,
|
||||
'raumtypalternativ' => $row->raumtypalternativ,
|
||||
'anmerkung' => $row->anmerkung,
|
||||
'studiensemester_kurzbz' => $row->studiensemester_kurzbz,
|
||||
'fachbereich_kurzbz' => isset($row->fachbereich_kurzbz) ? $row->fachbereich_kurzbz : null,
|
||||
'lektoren' => array(),
|
||||
'lehreinheit_id' => array(),
|
||||
'lvnr' => array(),
|
||||
'lehrfach' => array(),
|
||||
'lehrform' => array(),
|
||||
'stundenblockung' => array(),
|
||||
'wochenrythmus' => array(),
|
||||
'planstunden' => array(),
|
||||
'start_kw' => array(),
|
||||
'verplant' => array(),
|
||||
'offenestunden' => array(),
|
||||
'lehrverband' => array(),
|
||||
'lem' => array(),
|
||||
'verplant_gesamt' => 0,
|
||||
);
|
||||
}
|
||||
|
||||
$group = $grouped[$unr];
|
||||
|
||||
$group->lektoren[$row->lektor_uid] = (object)array(
|
||||
'uid' => $row->lektor_uid,
|
||||
'kurzbz' => trim($row->lektor),
|
||||
'name' => $row->vorname . ' ' . $row->nachname,
|
||||
);
|
||||
|
||||
$group->lehreinheit_id[] = $row->lehreinheit_id;
|
||||
$group->lvnr[] = $row->lvnr;
|
||||
$group->lehrfach[] = $row->lehrfach;
|
||||
$group->lehrform[] = $row->lehrform;
|
||||
$group->stundenblockung[] = $row->stundenblockung;
|
||||
$group->wochenrythmus[] = $row->wochenrythmus;
|
||||
$group->planstunden[] = $row->planstunden;
|
||||
$group->start_kw[] = $row->start_kw;
|
||||
$group->verplant[] = isset($row->verplant) ? $row->verplant : 0;
|
||||
$group->offenestunden[] = isset($row->offenestunden) ? $row->offenestunden : 0;
|
||||
$group->verplant_gesamt += isset($row->verplant) ? $row->verplant : 0;
|
||||
|
||||
$lvb = $row->studiengang . '-' . $row->semester;
|
||||
|
||||
if ($row->verband != '' && $row->verband != ' ' && $row->verband != '0' && $row->verband != null)
|
||||
$lvb .= $row->verband;
|
||||
|
||||
if ($row->gruppe != '' && $row->gruppe != ' ' && $row->gruppe != '0' && $row->gruppe != null)
|
||||
$lvb .= $row->gruppe;
|
||||
|
||||
$group->lehrverband[] = ($row->gruppe_kurzbz != '' && $row->gruppe_kurzbz != null) ? $row->gruppe_kurzbz : $lvb;
|
||||
|
||||
$group->lem[] = array(
|
||||
'lehreinheit_id' => $row->lehreinheit_id,
|
||||
'mitarbeiter_uid' => $row->lektor_uid,
|
||||
);
|
||||
}
|
||||
|
||||
foreach ($grouped as $group)
|
||||
{
|
||||
$group->lektoren = array_values($group->lektoren);
|
||||
$group->lehrverband = array_values(array_unique($group->lehrverband));
|
||||
$group->lehrfach = $this->_formatArr($group->lehrfach);
|
||||
$group->lehrform = $this->_formatArr($group->lehrform);
|
||||
$group->stundenblockung = $this->_formatArr($group->stundenblockung);
|
||||
$group->wochenrythmus = $this->_formatArr($group->wochenrythmus);
|
||||
$group->planstunden = $this->_formatArr($group->planstunden);
|
||||
$group->start_kw = $this->_formatArr($group->start_kw);
|
||||
$group->verplant = $this->_formatArr($group->verplant);
|
||||
$group->offenestunden = $this->_formatArr($group->offenestunden);
|
||||
}
|
||||
|
||||
$this->terminateWithSuccess(array_values($grouped));
|
||||
}
|
||||
|
||||
private function _formatArr($arr)
|
||||
{
|
||||
$values = array_values(array_unique($arr));
|
||||
$formatted = implode(' ', $values);
|
||||
|
||||
if (count($formatted) > 1)
|
||||
$formatted .= ' ?';
|
||||
|
||||
return $formatted;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,400 @@
|
||||
<?php
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class Kalender extends FHCAPI_Controller
|
||||
{
|
||||
|
||||
private $_ci;
|
||||
const ALLOWED_PLAN_FILTER = ['ort', 'uid', 'stg'];
|
||||
const ALLOWED_ROOM_FILTER = ['lehreinheit_id', 'kalender_id'];
|
||||
|
||||
const ALLOWED_TO_UPDATE = ['start_time', 'end_time', 'ort_kurzbz'];
|
||||
/**
|
||||
* Object initialization
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'getStunden' => self::PERM_LOGGED,
|
||||
'getCalendarHours' => self::PERM_LOGGED,
|
||||
'getPlan' => self::PERM_LOGGED,
|
||||
'getPlanByOrt' => self::PERM_LOGGED,
|
||||
'getRaumvorschlag' => self::PERM_LOGGED,
|
||||
'getHistory' => 'lehre/lvplan:rw',
|
||||
'deleteEntry' => 'lehre/lvplan:rw',
|
||||
'syncToLecturer' => 'lehre/lvplan:rw',
|
||||
'syncToStudent' => 'lehre/lvplan:rw',
|
||||
'getPlanLecturer' =>'lehre/lvplan:rw',
|
||||
'getPlanStudent' => 'lehre/lvplan:rw',
|
||||
'getZeitwuensche' => self::PERM_LOGGED,
|
||||
'getZeitsperren' => self::PERM_LOGGED,
|
||||
'updateKalenderEvent' => 'lehre/lvplan:rw',
|
||||
'addKalenderEvent' => 'lehre/lvplan:rw',
|
||||
'addReservierung' => 'lehre/lvplan:rw',
|
||||
'sync' => 'lehre/lvplan:rw',
|
||||
]);
|
||||
|
||||
$this->_ci =& get_instance();
|
||||
|
||||
$this->_ci->load->library('LogLib');
|
||||
$this->_ci->load->library('form_validation');
|
||||
$this->_ci->load->library('KalenderLib');
|
||||
$this->_ci->load->library('RaumvorschlagLib');
|
||||
$this->loadPhrases([
|
||||
'ui'
|
||||
]);
|
||||
$this->_ci->load->config('tempus');
|
||||
|
||||
|
||||
$this->_ci->loglib->setConfigs(array(
|
||||
'classIndex' => 5,
|
||||
'functionIndex' => 5,
|
||||
'lineIndex' => 4,
|
||||
'dbLogType' => 'API', // required
|
||||
'dbExecuteUser' => 'RESTful API'
|
||||
));
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
/**
|
||||
* fetches Stunden layout from database
|
||||
* @access public
|
||||
*
|
||||
*/
|
||||
public function getStunden()
|
||||
{
|
||||
$this->load->model('ressource/Stunde_model', 'StundeModel');
|
||||
|
||||
$this->_ci->StundeModel->addOrder('stunde', 'ASC');
|
||||
$stunden = $this->_ci->StundeModel->load();
|
||||
|
||||
$stunden = $this->getDataOrTerminateWithError($stunden);
|
||||
|
||||
$this->terminateWithSuccess($stunden);
|
||||
}
|
||||
|
||||
public function getCalendarHours()
|
||||
{
|
||||
$calender_start = $this->_ci->config->item('calendar_start') ?? 7;
|
||||
$calender_end = $this->_ci->config->item('calendar_end') ?? 23;
|
||||
|
||||
$this->terminateWithSuccess(array(
|
||||
'start' => $calender_start,
|
||||
'end' => $calender_end
|
||||
));
|
||||
}
|
||||
|
||||
public function getPlan()
|
||||
{
|
||||
$this->_ci->form_validation->set_data($_GET);
|
||||
$this->_ci->form_validation->set_rules('start_date',"start_date","required");
|
||||
$this->_ci->form_validation->set_rules('end_date',"end_date","required");
|
||||
|
||||
if($this->_ci->form_validation->run() === FALSE)
|
||||
$this->terminateWithValidationErrors($this->_ci->form_validation->error_array());
|
||||
|
||||
$start_date = $this->_ci->input->get('start_date', TRUE);
|
||||
$end_date = $this->_ci->input->get('end_date', TRUE);
|
||||
|
||||
$filter = $this->_checkFilter(self::ALLOWED_PLAN_FILTER);
|
||||
|
||||
$stundenplan_data = $this->_ci->kalenderlib->getPlanForPlanner(
|
||||
$start_date,
|
||||
$end_date,
|
||||
isset($filter->ort) ? $filter->ort : null,
|
||||
isset($filter->uid) ? $filter->uid : null,
|
||||
isset($filter->stg) ? $filter->stg : null
|
||||
);
|
||||
|
||||
$this->terminateWithSuccess($stundenplan_data);
|
||||
}
|
||||
|
||||
public function getPlanStudent()
|
||||
{
|
||||
$this->_ci->form_validation->set_data($_GET);
|
||||
$this->_ci->form_validation->set_rules('start_date',"start_date","required");
|
||||
$this->_ci->form_validation->set_rules('end_date',"end_date","required");
|
||||
|
||||
if($this->_ci->form_validation->run() === FALSE)
|
||||
$this->terminateWithValidationErrors($this->_ci->form_validation->error_array());
|
||||
|
||||
$start_date = $this->_ci->input->get('start_date', TRUE);
|
||||
$end_date = $this->_ci->input->get('end_date', TRUE);
|
||||
|
||||
$stundenplan_data = $this->_ci->kalenderlib->getPlanForStudent(
|
||||
$start_date,
|
||||
$end_date
|
||||
);
|
||||
|
||||
$this->terminateWithSuccess($stundenplan_data);
|
||||
}
|
||||
|
||||
public function getPlanLecturer()
|
||||
{
|
||||
$this->_ci->form_validation->set_data($_GET);
|
||||
$this->_ci->form_validation->set_rules('start_date',"start_date","required");
|
||||
$this->_ci->form_validation->set_rules('end_date',"end_date","required");
|
||||
|
||||
if($this->_ci->form_validation->run() === FALSE)
|
||||
$this->terminateWithValidationErrors($this->_ci->form_validation->error_array());
|
||||
|
||||
$start_date = $this->_ci->input->get('start_date', TRUE);
|
||||
$end_date = $this->_ci->input->get('end_date', TRUE);
|
||||
|
||||
$stundenplan_data = $this->_ci->kalenderlib->getPlanForLecturer(
|
||||
$start_date,
|
||||
$end_date
|
||||
);
|
||||
|
||||
$this->terminateWithSuccess($stundenplan_data);
|
||||
}
|
||||
|
||||
public function getPlanByOrt($start_date = null, $end_date = null, $ort = null)
|
||||
{
|
||||
if (!isset($start_date) || !isset($end_date) || !isset($ort))
|
||||
{
|
||||
$this->_ci->form_validation->set_data($_GET);
|
||||
$this->_ci->form_validation->set_rules('start_date',"start_date","required");
|
||||
$this->_ci->form_validation->set_rules('end_date',"end_date","required");
|
||||
$this->_ci->form_validation->set_rules('ort',"ort","required");
|
||||
if($this->_ci->form_validation->run() === FALSE)
|
||||
$this->terminateWithValidationErrors($this->_ci->form_validation->error_array());
|
||||
|
||||
$start_date = $this->_ci->input->get('start_date', TRUE);
|
||||
$end_date = $this->_ci->input->get('end_date', TRUE);
|
||||
$ort = $this->_ci->input->get('ort', TRUE);
|
||||
}
|
||||
|
||||
$this->terminateWithSuccess($this->_ci->kalenderlib->getPlanByOrt($start_date, $end_date, $ort));
|
||||
}
|
||||
|
||||
public function getZeitsperren()
|
||||
{
|
||||
$this->_ci->form_validation->set_data($_GET);
|
||||
$this->_ci->form_validation->set_rules('start_date',"start_date","required");
|
||||
$this->_ci->form_validation->set_rules('end_date',"end_date","required");
|
||||
$this->_ci->form_validation->set_rules('emp',"emp","required");
|
||||
if($this->_ci->form_validation->run() === FALSE)
|
||||
$this->terminateWithValidationErrors($this->_ci->form_validation->error_array());
|
||||
|
||||
$start_date = $this->_ci->input->get('start_date', TRUE);
|
||||
$end_date = $this->_ci->input->get('end_date', TRUE);
|
||||
$emp = $this->_ci->input->get('emp', TRUE);
|
||||
|
||||
$stundenplan_data = $this->_ci->kalenderlib->getZeitsperren($start_date, $end_date, $emp);
|
||||
|
||||
$this->terminateWithSuccess($stundenplan_data);
|
||||
}
|
||||
|
||||
public function getZeitwuensche()
|
||||
{
|
||||
$this->_ci->form_validation->set_data($_GET);
|
||||
$this->_ci->form_validation->set_rules('start_date',"start_date","required");
|
||||
$this->_ci->form_validation->set_rules('end_date',"end_date","required");
|
||||
$this->_ci->form_validation->set_rules('emp',"emp","required");
|
||||
|
||||
if($this->_ci->form_validation->run() === FALSE)
|
||||
$this->terminateWithValidationErrors($this->_ci->form_validation->error_array());
|
||||
|
||||
$start_date = $this->_ci->input->get('start_date', TRUE);
|
||||
$end_date = $this->_ci->input->get('end_date', TRUE);
|
||||
$emp = $this->_ci->input->get('emp', TRUE);
|
||||
|
||||
$stundenplan_data = $this->_ci->kalenderlib->getZeitwuensche($start_date, $end_date, $emp);
|
||||
|
||||
$this->terminateWithSuccess($stundenplan_data);
|
||||
}
|
||||
|
||||
public function updateKalenderEvent()
|
||||
{
|
||||
$this->_ci->form_validation->set_data($_POST);
|
||||
$this->_ci->form_validation->set_rules('kalender_id',"kalender_id","required");
|
||||
|
||||
if($this->_ci->form_validation->run() === FALSE)
|
||||
$this->terminateWithValidationErrors($this->_ci->form_validation->error_array());
|
||||
|
||||
$updateFields = $this->_checkUpdate($this->_ci->input->post('updatedInfos', TRUE));
|
||||
$kalender_id = $this->_ci->input->post('kalender_id', TRUE);
|
||||
|
||||
$result = $this->_ci->kalenderlib->updateKalenderEvent($kalender_id, $updateFields->ort_kurzbz ?? null, $updateFields->start_time ?? null, $updateFields->end_time ?? null);
|
||||
|
||||
if (isError($result))
|
||||
$this->terminateWithError(getError($result), $result->code);
|
||||
|
||||
$this->terminateWithSuccess(getData($result));
|
||||
}
|
||||
|
||||
public function getRaumvorschlag()
|
||||
{
|
||||
$this->_ci->form_validation->set_data($_GET);
|
||||
|
||||
$filter = $this->_checkFilter(self::ALLOWED_ROOM_FILTER);
|
||||
$this->terminateWithSuccess($this->_ci->raumvorschlaglib->getVorschlaege($filter->kalender_id));
|
||||
}
|
||||
|
||||
public function getHistory()
|
||||
{
|
||||
$this->_ci->form_validation->set_data($_GET);
|
||||
$this->_ci->form_validation->set_rules('kalender_id',"kalender_id","required");
|
||||
|
||||
if($this->_ci->form_validation->run() === FALSE)
|
||||
$this->terminateWithValidationErrors($this->_ci->form_validation->error_array());
|
||||
|
||||
$kalender_id = $this->_ci->input->get('kalender_id', TRUE);
|
||||
|
||||
$result = $this->_ci->kalenderlib->getHistory($kalender_id);
|
||||
|
||||
if (isError($result))
|
||||
$this->terminateWithError(getError($result));
|
||||
|
||||
$this->terminateWithSuccess(getData($result));
|
||||
}
|
||||
|
||||
public function deleteEntry()
|
||||
{
|
||||
$this->_ci->form_validation->set_data($_POST);
|
||||
$this->_ci->form_validation->set_rules('kalender_id', "kalender_id", "required");
|
||||
|
||||
if($this->_ci->form_validation->run() === FALSE)
|
||||
$this->terminateWithValidationErrors($this->_ci->form_validation->error_array());
|
||||
|
||||
$kalender_id = $this->_ci->input->post('kalender_id', TRUE);
|
||||
|
||||
$result = $this->_ci->kalenderlib->deleteEntry($kalender_id);
|
||||
|
||||
if (isError($result))
|
||||
$this->terminateWithError(getError($result));
|
||||
|
||||
$this->terminateWithSuccess(getData($result));
|
||||
}
|
||||
|
||||
public function sync()
|
||||
{
|
||||
$result = $this->_ci->kalenderlib->sync();
|
||||
$this->terminateWithSuccess(getData($result));
|
||||
}
|
||||
public function syncToLecturer()
|
||||
{
|
||||
$this->_ci->form_validation->set_data($_POST);
|
||||
$this->_ci->form_validation->set_rules('kalender_id', "kalender_id", "required");
|
||||
|
||||
if($this->_ci->form_validation->run() === FALSE)
|
||||
$this->terminateWithValidationErrors($this->_ci->form_validation->error_array());
|
||||
|
||||
$kalender_id = $this->_ci->input->post('kalender_id', TRUE);
|
||||
|
||||
$result = $this->_ci->kalenderlib->updateStatus($kalender_id, 'sync_preview');
|
||||
|
||||
if (isError($result))
|
||||
$this->terminateWithError(getError($result));
|
||||
|
||||
$this->terminateWithSuccess(getData($result));
|
||||
}
|
||||
public function syncToStudent()
|
||||
{
|
||||
$this->_ci->form_validation->set_data($_POST);
|
||||
$this->_ci->form_validation->set_rules('kalender_id', "kalender_id", "required");
|
||||
|
||||
if($this->_ci->form_validation->run() === FALSE)
|
||||
$this->terminateWithValidationErrors($this->_ci->form_validation->error_array());
|
||||
|
||||
$kalender_id = $this->_ci->input->post('kalender_id', TRUE);
|
||||
|
||||
$result = $this->_ci->kalenderlib->updateStatus($kalender_id, 'sync_live');
|
||||
|
||||
if (isError($result))
|
||||
$this->terminateWithError(getError($result));
|
||||
|
||||
$this->terminateWithSuccess(getData($result));
|
||||
}
|
||||
public function addKalenderEvent()
|
||||
{
|
||||
$this->_ci->form_validation->set_data($_POST);
|
||||
$this->_ci->form_validation->set_rules('lehreinheit_id',"lehreinheit_id","required");
|
||||
$this->_ci->form_validation->set_rules('start_date',"start_date","required");
|
||||
$this->_ci->form_validation->set_rules('end_date',"end_date","required");
|
||||
|
||||
if($this->_ci->form_validation->run() === FALSE)
|
||||
$this->terminateWithValidationErrors($this->_ci->form_validation->error_array());
|
||||
|
||||
$lehreinheit_id = $this->_ci->input->post('lehreinheit_id', TRUE);
|
||||
$ort_kurzbz = $this->_ci->input->post('ort_kurzbz', TRUE);
|
||||
$start_date = $this->_ci->input->post('start_date', TRUE);
|
||||
$end_date = $this->_ci->input->post('end_date', TRUE);
|
||||
|
||||
|
||||
$result = $this->_ci->kalenderlib->addKalenderEvent($start_date, $end_date, $lehreinheit_id, $ort_kurzbz);
|
||||
|
||||
if (isError($result))
|
||||
$this->terminateWithError(getError($result));
|
||||
|
||||
$this->terminateWithSuccess(getData($result));
|
||||
}
|
||||
|
||||
public function addReservierung()
|
||||
{
|
||||
$this->_ci->form_validation->set_data($_POST);
|
||||
$this->_ci->form_validation->set_rules('titel',"titel","required");
|
||||
$this->_ci->form_validation->set_rules('beschreibung',"beschreibung","required");
|
||||
$this->_ci->form_validation->set_rules('ort_kurzbz',"ort_kurzbz","required");
|
||||
$this->_ci->form_validation->set_rules('start_date',"start_date","required");
|
||||
$this->_ci->form_validation->set_rules('end_date',"end_date","required");
|
||||
|
||||
if($this->_ci->form_validation->run() === FALSE)
|
||||
$this->terminateWithValidationErrors($this->_ci->form_validation->error_array());
|
||||
|
||||
$titel = $this->_ci->input->post('titel', TRUE);
|
||||
$beschreibung = $this->_ci->input->post('beschreibung', TRUE);
|
||||
$ort_kurzbz = $this->_ci->input->post('ort_kurzbz', TRUE);
|
||||
$start_date = $this->_ci->input->post('start_date', TRUE);
|
||||
$end_date = $this->_ci->input->post('end_date', TRUE);
|
||||
|
||||
|
||||
$result = $this->_ci->kalenderlib->addReservierung($titel, $beschreibung, $ort_kurzbz, $start_date, $end_date);
|
||||
|
||||
if (isError($result))
|
||||
$this->terminateWithError(getError($result));
|
||||
|
||||
$this->terminateWithSuccess(getData($result));
|
||||
}
|
||||
|
||||
private function _checkFilter($filters)
|
||||
{
|
||||
$filter_valid = true;
|
||||
$filter_object = new stdClass();
|
||||
foreach ($filters as $filter)
|
||||
{
|
||||
if ($this->_ci->input->get($filter))
|
||||
{
|
||||
$filter_valid = true;
|
||||
$filter_object->$filter = $this->_ci->input->get($filter);
|
||||
}
|
||||
}
|
||||
|
||||
if (!$filter_valid)
|
||||
$this->terminateWithError($this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
return $filter_object;
|
||||
}
|
||||
|
||||
private function _checkUpdate($updateInfos)
|
||||
{
|
||||
$update_valid = false;
|
||||
$update_object = new stdClass();
|
||||
foreach (self::ALLOWED_TO_UPDATE as $filter)
|
||||
{
|
||||
if (isset($updateInfos[$filter]))
|
||||
{
|
||||
$update_valid = true;
|
||||
$update_object->$filter = $updateInfos[$filter];
|
||||
}
|
||||
}
|
||||
|
||||
if (!$update_valid)
|
||||
$this->terminateWithError($this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
|
||||
return $update_object;
|
||||
}
|
||||
}
|
||||
@@ -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([
|
||||
'getAssignedResourcesByCalenderId' => ['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->load->library('CollisionChecker');
|
||||
$this->load->library('KalenderLib');
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// 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 getAssignedResourcesByCalenderId($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']);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,231 @@
|
||||
<?php
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class Reservierung extends FHCAPI_Controller
|
||||
{
|
||||
private $_ci;
|
||||
|
||||
/**
|
||||
* Object initialization
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'addReservierung' => 'lehre/lvplan:rw',
|
||||
'getRollen' => 'lehre/lvplan:rw',
|
||||
'getInformation' => 'lehre/lvplan:rw',
|
||||
'getLektor' => 'lehre/lvplan:rw',
|
||||
'searchGroup' => 'lehre/lvplan:rw',
|
||||
]);
|
||||
|
||||
$this->_ci =& get_instance();
|
||||
|
||||
$this->_ci->load->library('LogLib');
|
||||
$this->_ci->load->library('form_validation');
|
||||
$this->_ci->load->library('KalenderLib');
|
||||
|
||||
$this->_ci->load->model('ressource/Ort_model', 'OrtModel');
|
||||
$this->_ci->load->model('ressource/Kalender_Event_Rolle_model', 'KalenderEventRolleModel');
|
||||
$this->_ci->load->model('organisation/Studiengang_model', 'StudiengangModel');
|
||||
$this->_ci->load->model('organisation/Studiensemester_model', 'StudiensemesterModel');
|
||||
$this->_ci->load->model('organisation/gruppe_model', 'GruppeModel');
|
||||
|
||||
|
||||
$this->loadPhrases([
|
||||
'ui'
|
||||
]);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
public function getInformation()
|
||||
{
|
||||
$return_array = array('berechtigt' => false, 'studiengaenge' => []);
|
||||
|
||||
$this->_ci->OrtModel->db->join("
|
||||
(select ort,standort_id,strasse, plz
|
||||
FROM public.tbl_standort
|
||||
LEFT JOIN public.tbl_adresse USING(adresse_id)
|
||||
) standort", "standort_id", "LEFT", false);
|
||||
|
||||
$raeume = $this->_ci->OrtModel->loadWhere(array('aktiv' => true, 'reservieren' => true));
|
||||
$return_array['raeume'] = hasData($raeume) ? getData($raeume) : [];
|
||||
|
||||
if (!$this->_ci->permissionlib->isBerechtigt('lehre/reservierung'))
|
||||
$this->terminateWithSuccess($return_array);
|
||||
|
||||
$stg_berechtigungen = $this->_ci->permissionlib->getSTG_isEntitledFor('lehre/reservierung');
|
||||
if (isEmptyArray($stg_berechtigungen))
|
||||
$this->terminateWithSuccess($return_array);
|
||||
|
||||
$this->_ci->StudiengangModel->addSelect('studiengang_kz, UPPER(CONCAT(typ, kurzbz)) as kuerzel, kurzbzlang');
|
||||
$this->_ci->StudiengangModel->addOrder('typ, kurzbz');
|
||||
$this->_ci->StudiengangModel->db->where_in('studiengang_kz', $stg_berechtigungen);
|
||||
$studiengaenge = $this->_ci->StudiengangModel->loadWhere(array('aktiv' => true));
|
||||
|
||||
if (isError($studiengaenge))
|
||||
$this->terminateWithError(getError($studiengaenge));
|
||||
$language = getUserLanguage() == 'German' ? 0 : 1;
|
||||
$this->_ci->KalenderEventRolleModel->addOrder('sort');
|
||||
$this->_ci->KalenderEventRolleModel->addSelect('rolle_kurzbz, array_to_json(bezeichnung_mehrsprachig::varchar[])->>'. $language. ' as bezeichnung');
|
||||
|
||||
$rollen = $this->_ci->KalenderEventRolleModel->load();
|
||||
|
||||
$this->_ci->StudiensemesterModel->addOrder('start', 'DESC');
|
||||
$studiensemester = $this->_ci->StudiensemesterModel->load();
|
||||
|
||||
$return_array['studiengaenge'] = hasData($studiengaenge) ? getData($studiengaenge) : [];
|
||||
$return_array['berechtigt'] = true;
|
||||
$return_array['rollen'] = hasData($rollen) ? getData($rollen) : [];
|
||||
$return_array['studiensemester'] = hasData($studiensemester) ? getData($studiensemester) : [];
|
||||
|
||||
|
||||
$this->terminateWithSuccess($return_array);
|
||||
}
|
||||
public function getRaeume()
|
||||
{
|
||||
|
||||
$this->_ci->OrtModel->db->join("
|
||||
(select ort,standort_id,strasse, plz
|
||||
FROM public.tbl_standort
|
||||
LEFT JOIN public.tbl_adresse USING(adresse_id)
|
||||
) standort", "standort_id", "LEFT", false);
|
||||
|
||||
$result = $this->_ci->OrtModel->loadWhere(array('aktiv' => true, 'reservieren' => true));
|
||||
|
||||
$this->terminateWithSuccess(hasData($result) ? getData($result) : []);
|
||||
}
|
||||
|
||||
public function searchGroup()
|
||||
{
|
||||
$query = $this->input->get('query');
|
||||
if (is_null($query))
|
||||
$this->terminateWithError($this->_ci->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$stg_berechtigungen = $this->_ci->permissionlib->getSTG_isEntitledFor('lehre/reservierung');
|
||||
|
||||
if (isEmptyArray($stg_berechtigungen))
|
||||
$this->terminateWithSuccess([]);
|
||||
|
||||
|
||||
$query_words = explode(' ', urldecode($query));
|
||||
|
||||
$gruppen_result = $this->_ci->GruppeModel->search($query_words);
|
||||
|
||||
if (isError($gruppen_result))
|
||||
$this->terminateWithError(getError($gruppen_result), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$gruppen_array = array();
|
||||
|
||||
if (hasData($gruppen_result))
|
||||
$gruppen_array = getData($gruppen_result);
|
||||
|
||||
$lehrverband_result = $this->_ci->LehrverbandModel->search($query_words);
|
||||
|
||||
$lehrverband_array = array();
|
||||
|
||||
if (isError($lehrverband_result))
|
||||
$this->terminateWithError(getError($lehrverband_result), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
if (hasData($lehrverband_result))
|
||||
$lehrverband_array = getData($lehrverband_result);
|
||||
|
||||
$all_gruppen = array_merge($gruppen_array, $lehrverband_array);
|
||||
|
||||
$gefilterte_gruppen = array_filter($all_gruppen, function($gruppe) use ($stg_berechtigungen)
|
||||
{
|
||||
return in_array($gruppe->studiengang_kz, $stg_berechtigungen);
|
||||
});
|
||||
|
||||
$this->terminateWithSuccess($gefilterte_gruppen);
|
||||
}
|
||||
|
||||
public function getRollen()
|
||||
{
|
||||
$language = getUserLanguage() == 'German' ? 0 : 1;
|
||||
|
||||
$this->_ci->KalenderEventRolleModel->addOrder('sort');
|
||||
$this->_ci->KalenderEventRolleModel->addSelect('rolle_kurzbz, array_to_json(bezeichnung_mehrsprachig::varchar[])->>'. $language. ' as bezeichnung');
|
||||
|
||||
$result = $this->_ci->KalenderEventRolleModel->load();
|
||||
|
||||
$this->terminateWithSuccess(hasData($result) ? getData($result) : []);
|
||||
}
|
||||
public function addReservierung()
|
||||
{
|
||||
|
||||
$this->_ci->form_validation->set_data($_POST);
|
||||
$this->_ci->form_validation->set_rules('titel',"titel","required");
|
||||
$this->_ci->form_validation->set_rules('beschreibung',"beschreibung","required");
|
||||
$this->_ci->form_validation->set_rules('ort_kurzbz',"ort_kurzbz","required");
|
||||
$this->_ci->form_validation->set_rules('start_date',"start_date","required");
|
||||
$this->_ci->form_validation->set_rules('end_date',"end_date","required");
|
||||
|
||||
|
||||
if($this->_ci->form_validation->run() === FALSE)
|
||||
$this->terminateWithValidationErrors($this->_ci->form_validation->error_array());
|
||||
|
||||
$titel = $this->_ci->input->post('titel', TRUE);
|
||||
$beschreibung = $this->_ci->input->post('beschreibung', TRUE);
|
||||
$ort_kurzbz = $this->_ci->input->post('ort_kurzbz', TRUE);
|
||||
$start_date = $this->_ci->input->post('start_date', TRUE);
|
||||
$end_date = $this->_ci->input->post('end_date', TRUE);
|
||||
$teilnehmer = $this->_ci->input->post('teilnehmer', TRUE);
|
||||
$specialGroups = $this->_ci->input->post('specialGroups', TRUE);
|
||||
$specialFinalGroups = $this->_ci->input->post('specialFinalGroups', TRUE);
|
||||
$groups = $this->_ci->input->post('groups', TRUE);
|
||||
|
||||
if ($this->_ci->permissionlib->isBerechtigt('lehre/reservierung'))
|
||||
{
|
||||
if (empty($teilnehmer) || !is_array($teilnehmer))
|
||||
{
|
||||
$teilnehmer[] = array('uid' => getAuthUID(), 'rolle' => 'organisator');
|
||||
}
|
||||
}
|
||||
else
|
||||
$teilnehmer[] = array('uid' => getAuthUID(), 'rolle' => 'organisator');
|
||||
|
||||
|
||||
$result = $this->_ci->kalenderlib->addReservierung($titel, $beschreibung, $ort_kurzbz, $start_date, $end_date, $teilnehmer, $specialFinalGroups, $specialGroups, $groups);
|
||||
|
||||
|
||||
if (isError($result))
|
||||
$this->terminateWithError(getError($result));
|
||||
|
||||
$this->terminateWithSuccess($result);
|
||||
}
|
||||
|
||||
|
||||
public function getLektor()
|
||||
{
|
||||
$query = $this->input->get('query');
|
||||
|
||||
if (is_null($query))
|
||||
$this->terminateWithError($this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$query_words = explode(' ', $query);
|
||||
|
||||
$this->_ci->MitarbeiterModel->addSelect('uid, person_id, vorname, nachname');
|
||||
$this->_ci->MitarbeiterModel->addJoin('public.tbl_benutzer', 'uid = mitarbeiter_uid');
|
||||
$this->_ci->MitarbeiterModel->addJoin('public.tbl_person', 'person_id');
|
||||
|
||||
$this->_ci->MitarbeiterModel->db->where('public.tbl_benutzer.aktiv', true);
|
||||
|
||||
$this->_ci->MitarbeiterModel->db->group_start();
|
||||
foreach ($query_words as $word)
|
||||
{
|
||||
$this->_ci->MitarbeiterModel->db->group_start();
|
||||
$this->_ci->MitarbeiterModel->db->where('tbl_person.vorname ILIKE', "%" . $word . "%");
|
||||
$this->_ci->MitarbeiterModel->db->or_where('tbl_person.nachname ILIKE', "%" . $word . "%");
|
||||
$this->_ci->MitarbeiterModel->db->or_where('uid ILIKE', "%" . $word . "%");
|
||||
$this->_ci->MitarbeiterModel->db->group_end();
|
||||
}
|
||||
$this->_ci->MitarbeiterModel->db->group_end();
|
||||
$this->_ci->MitarbeiterModel->addOrder('nachname');
|
||||
$this->_ci->MitarbeiterModel->addOrder('vorname');
|
||||
$result = $this->_ci->MitarbeiterModel->load();
|
||||
$this->terminateWithSuccess(hasData($result) ? getData($result) : array());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2026 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/>.
|
||||
*/
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
*/
|
||||
class Admin extends Auth_Controller
|
||||
{
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
// Set required permissions
|
||||
parent::__construct(
|
||||
array(
|
||||
'index' => 'dashboard/admin:rw',
|
||||
'preview' => 'dashboard/admin:r',
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
public function index()
|
||||
{
|
||||
$this->load->view('dashboard/admin.php', []);
|
||||
}
|
||||
|
||||
public function preview($dashboard_kurzbz = 'CIS')
|
||||
{
|
||||
$this->load->view('dashboard/preview.php', [
|
||||
'dashboard_kurzbz' => $dashboard_kurzbz
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -1,76 +0,0 @@
|
||||
<?php
|
||||
defined('BASEPATH') || exit('No direct script access allowed');
|
||||
|
||||
class Api extends Auth_Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct(
|
||||
array(
|
||||
'index' => 'dashboard/admin:rw',
|
||||
'getNews' => 'dashboard/benutzer:r',
|
||||
'getAmpeln' => 'dashboard/benutzer:r',
|
||||
)
|
||||
);
|
||||
|
||||
$this->load->library('AuthLib', null, 'AuthLib');
|
||||
|
||||
$this->_setAuthUID();
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
echo 'Dashboard API Controller';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get News.
|
||||
*/
|
||||
public function getNews()
|
||||
{
|
||||
$limit = $this->input->get('limit');
|
||||
|
||||
$this->load->model('content/News_model', 'NewsModel');
|
||||
|
||||
$result = $this->NewsModel->getAll($limit);
|
||||
|
||||
if (hasData($result))
|
||||
{
|
||||
$this->outputJson(getData($result), REST_Controller::HTTP_OK);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->terminateWithJsonError('fehler entdeckt');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get Ampeln.
|
||||
*/
|
||||
public function getAmpeln()
|
||||
{
|
||||
|
||||
$this->load->model('content/Ampel_model', 'AmpelModel');
|
||||
$result = $this->AmpelModel->getByUser($this->_uid);
|
||||
|
||||
if (hasData($result))
|
||||
{
|
||||
$this->outputJson(getData($result), REST_Controller::HTTP_OK);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->terminateWithJsonError('fehler entdeckt');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve the UID of the logged user and checks if it is valid
|
||||
*/
|
||||
private function _setAuthUID()
|
||||
{
|
||||
$this->_uid = getAuthUID();
|
||||
|
||||
if (!$this->_uid) show_error('User authentification failed');
|
||||
}
|
||||
}
|
||||
@@ -1,216 +0,0 @@
|
||||
<?php
|
||||
defined('BASEPATH') || exit('No direct script access allowed');
|
||||
/**
|
||||
* Description of Config
|
||||
*
|
||||
* @author bambi
|
||||
*/
|
||||
class Config extends Auth_Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct(
|
||||
array(
|
||||
'index' => 'dashboard/benutzer:r',
|
||||
'dummy' => 'dashboard/benutzer:r',
|
||||
'genWidgetId' => 'dashboard/benutzer:rw',
|
||||
'addWidgetsToPreset' => 'dashboard/admin:rw',
|
||||
'removeWidgetFromPreset' => 'dashboard/admin:rw',
|
||||
'addWidgetsToUserOverride' => 'dashboard/benutzer:rw',
|
||||
'removeWidgetFromUserOverride' => 'dashboard/benutzer:rw',
|
||||
'funktionen' => 'dashboard/admin:r',
|
||||
'preset' => 'dashboard/admin:r',
|
||||
'presetBatch' => 'dashboard/admin:r'
|
||||
)
|
||||
);
|
||||
|
||||
$this->load->library('dashboard/DashboardLib', null, 'DashboardLib');
|
||||
$this->load->library('AuthLib', null, 'AuthLib');
|
||||
$this->load->model('ressource/Funktion_model', 'FunktionModel');
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
$dashboard_kurzbz = $this->input->get('db');
|
||||
$uid = $this->AuthLib->getAuthObj()->username;
|
||||
|
||||
$dashboard = $this->DashboardLib->getDashboardByKurzbz($dashboard_kurzbz);
|
||||
if(!$dashboard) {
|
||||
http_response_code(404);
|
||||
$this->terminateWithJsonError(array(
|
||||
'error' => 'Dashboard ' . $dashboard_kurzbz . ' not found.'
|
||||
));
|
||||
}
|
||||
|
||||
$mergedconfig = $this->DashboardLib->getMergedConfig($dashboard->dashboard_id, $uid);
|
||||
$this->outputJsonSuccess($mergedconfig);
|
||||
}
|
||||
|
||||
public function genWidgetId()
|
||||
{
|
||||
$dashboard_kurzbz = $this->input->get('db');
|
||||
$widgetid = $this->DashboardLib->generateWidgetId($dashboard_kurzbz);
|
||||
$this->outputJsonSuccess(array(
|
||||
'widgetid' => $widgetid
|
||||
));
|
||||
}
|
||||
|
||||
public function addWidgetsToPreset()
|
||||
{
|
||||
$input = json_decode($this->input->raw_input_stream);
|
||||
$dashboard_kurzbz = $input->db;
|
||||
$funktion_kurzbz = $input->funktion_kurzbz;
|
||||
|
||||
$preset = $this->DashboardLib->getPresetOrCreateEmptyPreset($dashboard_kurzbz, $funktion_kurzbz);
|
||||
|
||||
$preset_decoded = json_decode($preset->preset, true);
|
||||
|
||||
$this->DashboardLib->addWidgetsToWidgets($preset_decoded, $dashboard_kurzbz, $funktion_kurzbz, $input->widgets);
|
||||
|
||||
$preset->preset = json_encode($preset_decoded);
|
||||
|
||||
$result = $this->DashboardLib->insertOrUpdatePreset($preset);
|
||||
if (isError($result)) {
|
||||
http_response_code(500);
|
||||
$this->terminateWithJsonError('preset could not be saved');
|
||||
}
|
||||
|
||||
$this->outputJsonSuccess(array('msg' => 'preset successfully stored.', 'data' => $preset_decoded));
|
||||
}
|
||||
|
||||
public function removeWidgetFromPreset()
|
||||
{
|
||||
$input = json_decode($this->input->raw_input_stream);
|
||||
$dashboard_kurzbz = $input->db;
|
||||
$funktion_kurzbz = $input->funktion_kurzbz;
|
||||
$widgetid = $input->widgetid;
|
||||
|
||||
$preset = $this->DashboardLib->getPreset($dashboard_kurzbz, $funktion_kurzbz);
|
||||
if ($preset === null) {
|
||||
http_response_code(404);
|
||||
$this->terminateWithJsonError('preset for dashboard ' . $dashboard_kurzbz . ' and funktion ' . $funktion_kurzbz . ' not found.');
|
||||
}
|
||||
|
||||
$preset_decoded = json_decode($preset->preset, true);
|
||||
if (!$this->DashboardLib->removeWidgetFromWidgets($preset_decoded, $funktion_kurzbz, $widgetid))
|
||||
{
|
||||
http_response_code(404);
|
||||
$this->terminateWithJsonError('widgetid ' . $widgetid . ' not found');
|
||||
}
|
||||
|
||||
$preset->preset = json_encode($preset_decoded);
|
||||
$result = $this->DashboardLib->insertOrUpdatePreset($preset);
|
||||
if (isError($result))
|
||||
{
|
||||
http_response_code(500);
|
||||
$this->terminateWithJsonError('failed to remove widget');
|
||||
}
|
||||
$this->outputJsonSuccess(array('msg' => 'preset successfully updated.'));
|
||||
}
|
||||
|
||||
public function addWidgetsToUserOverride()
|
||||
{
|
||||
$input = json_decode($this->input->raw_input_stream);
|
||||
$dashboard_kurzbz = $input->db;
|
||||
$funktion_kurzbz = $input->funktion_kurzbz;
|
||||
$uid = $this->AuthLib->getAuthObj()->username;
|
||||
|
||||
$override = $this->DashboardLib->getOverrideOrCreateEmptyOverride($dashboard_kurzbz, $uid);
|
||||
|
||||
$override_decoded = json_decode($override->override, true);
|
||||
|
||||
$this->DashboardLib->addWidgetsToWidgets($override_decoded, $dashboard_kurzbz, $funktion_kurzbz, $input->widgets);
|
||||
|
||||
$override->override = json_encode($override_decoded);
|
||||
|
||||
$result = $this->DashboardLib->insertOrUpdateOverride($override);
|
||||
if (isError($result)) {
|
||||
http_response_code(500);
|
||||
$this->terminateWithJsonError('override could not be saved');
|
||||
}
|
||||
|
||||
$this->outputJsonSuccess(array('msg' => 'override successfully stored.', 'data' => $override_decoded));
|
||||
}
|
||||
|
||||
public function removeWidgetFromUserOverride()
|
||||
{
|
||||
$input = json_decode($this->input->raw_input_stream);
|
||||
$dashboard_kurzbz = $input->db;
|
||||
$funktion_kurzbz = $input->funktion_kurzbz;
|
||||
$uid = $this->AuthLib->getAuthObj()->username;
|
||||
$widgetid = $input->widgetid;
|
||||
|
||||
$override = $this->DashboardLib->getOverride($dashboard_kurzbz, $uid);
|
||||
if (empty($override)) {
|
||||
http_response_code(404);
|
||||
$this->terminateWithJsonError('userconfig for dashboard ' . $dashboard_kurzbz . ' not found.');
|
||||
}
|
||||
|
||||
$override_decoded = json_decode($override->override, true);
|
||||
|
||||
if (!$this->DashboardLib->removeWidgetFromWidgets($override_decoded, $funktion_kurzbz, $widgetid))
|
||||
{
|
||||
http_response_code(404);
|
||||
$this->terminateWithJsonError('widgetid ' . $widgetid . ' not found');
|
||||
}
|
||||
|
||||
$override->override = json_encode($override_decoded);
|
||||
$result = $this->DashboardLib->insertOrUpdateOverride($override, $uid);
|
||||
if (isError($result))
|
||||
{
|
||||
http_response_code(500);
|
||||
$this->terminateWithJsonError('failed to remove widget');
|
||||
}
|
||||
$this->outputJsonSuccess(array('msg' => 'override successfully updated.'));
|
||||
}
|
||||
|
||||
public function funktionen()
|
||||
{
|
||||
$funktionen = $this->FunktionModel->load();
|
||||
|
||||
if (isError($funktionen)) {
|
||||
http_response_code(404);
|
||||
$this->terminateWithJsonError([
|
||||
'error' => getError($funktionen)
|
||||
]);
|
||||
}
|
||||
|
||||
return $this->outputJsonSuccess(getData($funktionen) ?: []);
|
||||
}
|
||||
|
||||
public function preset()
|
||||
{
|
||||
$db = $this->input->get('db');
|
||||
$funktion = $this->input->get('funktion');
|
||||
|
||||
$conf = $this->DashboardLib->getPreset($db, $funktion);
|
||||
|
||||
if (!$conf)
|
||||
return $this->outputJsonSuccess(['widgets' => [$funktion => []]]);
|
||||
|
||||
return $this->outputJsonSuccess(json_decode($conf->preset, true));
|
||||
}
|
||||
|
||||
public function presetBatch()
|
||||
{
|
||||
$db = $this->input->get('db');
|
||||
$funktionen = $this->input->get('funktionen');
|
||||
$result = [];
|
||||
|
||||
foreach ($funktionen as $funktion) {
|
||||
$conf = $this->DashboardLib->getPreset($db, $funktion);
|
||||
if ($conf)
|
||||
{
|
||||
$preset = json_decode($conf->preset, true);
|
||||
if (!isset($preset[$funktion]) || !isset($preset[$funktion]['widgets']))
|
||||
$result[$funktion] = [];
|
||||
else
|
||||
$result[$funktion] = $preset[$funktion]['widgets'];
|
||||
}
|
||||
else
|
||||
$result[$funktion] = [];
|
||||
}
|
||||
|
||||
return $this->outputJsonSuccess($result);
|
||||
}
|
||||
}
|
||||
@@ -1,86 +0,0 @@
|
||||
<?php
|
||||
defined('BASEPATH') || exit('No direct script access allowed');
|
||||
/**
|
||||
* Description of Widget
|
||||
*
|
||||
* @author chris
|
||||
*/
|
||||
class Dashboard extends Auth_Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct(
|
||||
array(
|
||||
'index' => 'dashboard/admin:r',
|
||||
'create' => 'dashboard/admin:rw',
|
||||
'update' => 'dashboard/admin:rw',
|
||||
'delete' => 'dashboard/admin:rw'
|
||||
)
|
||||
);
|
||||
|
||||
$this->load->library('dashboard/DashboardLib', null, 'DashboardLib');
|
||||
$this->load->model('dashboard/Dashboard_model', 'DashboardModel');
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
$result = $this->DashboardModel->load();
|
||||
|
||||
if (isError($result)) {
|
||||
http_response_code(404);
|
||||
$this->terminateWithJsonError([
|
||||
'error' => getError($result)
|
||||
]);
|
||||
}
|
||||
|
||||
return $this->outputJsonSuccess(getData($result) ?: []);
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
$input = $this->getPostJSON();
|
||||
|
||||
$result = $this->DashboardModel->insert($input);
|
||||
|
||||
if (isError($result)) {
|
||||
http_response_code(404);
|
||||
$this->terminateWithJsonError([
|
||||
'error' => getError($result)
|
||||
]);
|
||||
}
|
||||
|
||||
return $this->outputJsonSuccess(getData($result) ?: []);
|
||||
}
|
||||
|
||||
public function update()
|
||||
{
|
||||
$input = $this->getPostJSON();
|
||||
|
||||
$result = $this->DashboardModel->update($input->dashboard_id, $input);
|
||||
|
||||
if (isError($result)) {
|
||||
http_response_code(404);
|
||||
$this->terminateWithJsonError([
|
||||
'error' => getError($result)
|
||||
]);
|
||||
}
|
||||
|
||||
return $this->outputJsonSuccess(getData($result) ?: []);
|
||||
}
|
||||
|
||||
public function delete()
|
||||
{
|
||||
$input = $this->getPostJSON();
|
||||
|
||||
$result = $this->DashboardModel->delete($input->dashboard_id);
|
||||
|
||||
if (isError($result)) {
|
||||
http_response_code(404);
|
||||
$this->terminateWithJsonError([
|
||||
'error' => getError($result)
|
||||
]);
|
||||
}
|
||||
|
||||
return $this->outputJsonSuccess(getData($result) ?: []);
|
||||
}
|
||||
}
|
||||
@@ -1,58 +0,0 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
*/
|
||||
class DashboardDemo extends Auth_Controller
|
||||
{
|
||||
private $_uid; // uid of the logged user
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
// Set required permissions
|
||||
parent::__construct(
|
||||
array(
|
||||
'index' => 'dashboard/benutzer:r',
|
||||
'admin' => 'dashboard/admin:rw'
|
||||
)
|
||||
);
|
||||
|
||||
$this->load->library('AuthLib');
|
||||
$this->load->library('WidgetLib');
|
||||
|
||||
$this->_setAuthUID(); // sets property uid
|
||||
|
||||
$this->setControllerId(); // sets the controller id
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
public function index()
|
||||
{
|
||||
$this->load->view('dashboard/dashboard_demo.php', []);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
public function admin()
|
||||
{
|
||||
$this->load->view('dashboard/dashboard_demo_admin.php', []);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
// Private methods
|
||||
|
||||
/**
|
||||
* Retrieve the UID of the logged user and checks if it is valid
|
||||
*/
|
||||
private function _setAuthUID()
|
||||
{
|
||||
$this->_uid = getAuthUID();
|
||||
|
||||
if (!$this->_uid) show_error('User authentification failed');
|
||||
}
|
||||
}
|
||||
@@ -1,134 +0,0 @@
|
||||
<?php
|
||||
defined('BASEPATH') || exit('No direct script access allowed');
|
||||
/**
|
||||
* Description of Widget
|
||||
*
|
||||
* @author chris
|
||||
*/
|
||||
class Widget extends Auth_Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct(
|
||||
array(
|
||||
'index' => ['dashboard/benutzer:r', 'dashboard/admin:r'],
|
||||
'getAll' => 'dashboard/admin:r',
|
||||
'getWidgetsForDashboard' => ['dashboard/benutzer:rw', 'dashboard/admin:r'],
|
||||
'setAllowed' => 'dashboard/admin:rw'
|
||||
)
|
||||
);
|
||||
|
||||
$this->load->library('dashboard/DashboardLib', null, 'DashboardLib');
|
||||
$this->load->model('dashboard/Widget_model', 'WidgetModel');
|
||||
$this->load->model('dashboard/Dashboard_Widget_model', 'DashboardWidgetModel');
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
$widget_id = $this->input->get('id');
|
||||
|
||||
$widget = $this->WidgetModel->load($widget_id);
|
||||
|
||||
if (isError($widget) || !getData($widget))
|
||||
return $this->outputJsonSuccess([
|
||||
"widget_id" => 0,
|
||||
"widget_kurzbz" => "notfound",
|
||||
"arguments" => [
|
||||
"className" => 'alert-danger',
|
||||
"title" => 'Widget Not Found',
|
||||
"msg" => 'The widget with the id ' . $widget_id . ' could not be found'
|
||||
],
|
||||
"setup" => [
|
||||
"name" => 'Widget Not Found',
|
||||
"file" => absoluteJsImportUrl('public/js/components/DashboardWidget/Default.js'),
|
||||
"width" => 1,
|
||||
"height" => 1
|
||||
]
|
||||
]);
|
||||
|
||||
$widget = current(getData($widget));
|
||||
$widget->arguments = json_decode($widget->arguments);
|
||||
$tmpsetup = json_decode($widget->setup);
|
||||
$tmpsetup->file = absoluteJsImportUrl($tmpsetup->file);
|
||||
$widget->setup = $tmpsetup;
|
||||
|
||||
return $this->outputJsonSuccess($widget);
|
||||
}
|
||||
|
||||
public function getAll()
|
||||
{
|
||||
$dashboard_id = $this->input->get('dashboard_id');
|
||||
$result = $this->WidgetModel->getWithAllowedForDashboard($dashboard_id);
|
||||
|
||||
if (isError($result))
|
||||
return $this->outputJsonError(getError($result));
|
||||
|
||||
$tmpwidgets = getData($result) ?: [];
|
||||
$widgets = array_map(function($widget) {
|
||||
$widget->arguments = json_decode($widget->arguments);
|
||||
$tmpsetup = json_decode($widget->setup);
|
||||
$tmpsetup->file = absoluteJsImportUrl($tmpsetup->file);
|
||||
$widget->setup = $tmpsetup;
|
||||
return $widget;
|
||||
}, $tmpwidgets);
|
||||
|
||||
$this->outputJsonSuccess($widgets);
|
||||
}
|
||||
|
||||
public function getWidgetsForDashboard()
|
||||
{
|
||||
$db = $this->input->get('db');
|
||||
$result = $this->WidgetModel->getForDashboard($db);
|
||||
|
||||
if (isError($result)) {
|
||||
http_response_code(404);
|
||||
$this->terminateWithJsonError([
|
||||
'error' => getError($result)
|
||||
]);
|
||||
}
|
||||
|
||||
$tmpwidgets = getData($result) ?: [];
|
||||
$widgets = array_map(function($widget) {
|
||||
$widget->arguments = json_decode($widget->arguments);
|
||||
$tmpsetup = json_decode($widget->setup);
|
||||
$tmpsetup->file = absoluteJsImportUrl($tmpsetup->file);
|
||||
$widget->setup = $tmpsetup;
|
||||
return $widget;
|
||||
}, $tmpwidgets);
|
||||
|
||||
$this->outputJsonSuccess($widgets);
|
||||
}
|
||||
|
||||
public function setAllowed()
|
||||
{
|
||||
$input = $this->getPostJSON();
|
||||
|
||||
$dashboard_id = $input->dashboard_id;
|
||||
$widget_id = $input->widget_id;
|
||||
$action = $input->action;
|
||||
|
||||
if ($action == 'add') {
|
||||
$result = $this->DashboardWidgetModel->insert([
|
||||
'dashboard_id' => $dashboard_id,
|
||||
'widget_id' => $widget_id
|
||||
]);
|
||||
} elseif ($action == 'delete') {
|
||||
$result = $this->DashboardWidgetModel->delete([
|
||||
'dashboard_id' => $dashboard_id,
|
||||
'widget_id' => $widget_id
|
||||
]);
|
||||
} else {
|
||||
http_response_code(404); // TODO(chris): 400?
|
||||
$this->terminateWithJsonError([
|
||||
'error' => 'action value invalid'
|
||||
]);
|
||||
}
|
||||
if (isError($result)) {
|
||||
http_response_code(404);
|
||||
$this->terminateWithJsonError([
|
||||
'error' => getError($result)
|
||||
]);
|
||||
}
|
||||
return $this->outputJsonSuccess(getData($result));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
|
||||
if (!defined("BASEPATH")) exit("No direct script access allowed");
|
||||
|
||||
class TempusJob extends JOB_Controller
|
||||
{
|
||||
private $_ci;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
$this->_ci =& get_instance();
|
||||
|
||||
$this->_ci->load->helper('hlp_sancho_helper');
|
||||
$this->_ci->load->library('KalenderLib');
|
||||
}
|
||||
|
||||
|
||||
public function sync()
|
||||
{
|
||||
$this->_ci->logInfo('Start job FHC-Core->Tempus->sync');
|
||||
$this->_ci->kalenderlib->sync();
|
||||
$this->_ci->logInfo('End job FHC-Core->Tempus->sync');
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,559 @@
|
||||
<?php
|
||||
/*
|
||||
* Job zur einmaligen Migration des Stundenplans
|
||||
*
|
||||
* Aufruf
|
||||
* php index.ci.php system/MigrateKalender
|
||||
*/
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class MigrateKalender extends Auth_Controller
|
||||
{
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
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');
|
||||
$this->load->model('ressource/Kalender_Ort_model', 'KalenderOrtModel');
|
||||
$this->load->model('ressource/Stundenplandev_Kalender_model', 'SyncModel');
|
||||
$this->load->model('ressource/Reservierung_Kalender_model', 'SyncReservierungModel');
|
||||
$this->load->model('ressource/Kalender_Event_Teilnehmer_model', 'KalenderEventTeilnehmerModel');
|
||||
$this->load->model('ressource/Kalender_Event_model', 'KalenderEventModel');
|
||||
$this->load->model('organisation/Studiensemester_model', 'StudiensemesterModel');
|
||||
$this->load->model('person/Benutzer_model', 'BenutzerModel');
|
||||
}
|
||||
|
||||
/**
|
||||
* Everything has a beginning
|
||||
*/
|
||||
public function migrateStundenplan($von = null, $bis = null, $studiengang_kz = null)
|
||||
{
|
||||
$db = new DB_Model();
|
||||
|
||||
$stpldevsql = '
|
||||
WITH eindeutige_stunden AS (
|
||||
SELECT DISTINCT unr, datum, stunde
|
||||
FROM lehre.tbl_stundenplandev
|
||||
WHERE datum >= ? AND datum <= ?';
|
||||
|
||||
$params = [$von, $bis];
|
||||
|
||||
if (!is_null($studiengang_kz))
|
||||
{
|
||||
$stpldevsql .= ' AND studiengang_kz = ?';
|
||||
|
||||
$params[] = $studiengang_kz;
|
||||
}
|
||||
|
||||
$stpldevsql .= '),
|
||||
|
||||
block_keys AS (
|
||||
SELECT
|
||||
unr,
|
||||
datum,
|
||||
stunde,
|
||||
stunde - ROW_NUMBER() OVER (PARTITION BY unr, datum ORDER BY stunde) AS block_nr
|
||||
FROM eindeutige_stunden
|
||||
),
|
||||
blocks AS (
|
||||
SELECT
|
||||
bk.unr,
|
||||
bk.datum,
|
||||
bk.block_nr,
|
||||
MIN(bk.stunde) AS stunde_von,
|
||||
MAX(bk.stunde) AS stunde_bis,
|
||||
MIN(sp.lehreinheit_id) AS lehreinheit_id,
|
||||
MIN(sp.ort_kurzbz) AS ort_kurzbz,
|
||||
array_agg(sp.stundenplandev_id ORDER BY bk.stunde) AS stundenplandev_ids,
|
||||
MIN(sp.insertamum) AS insertamum,
|
||||
(array_agg(sp.insertvon ORDER BY sp.insertamum ASC))[1] AS insertvon,
|
||||
MAX(sp.updateamum) AS updateamum,
|
||||
(array_agg(sp.updatevon ORDER BY sp.updateamum DESC))[1] AS updatevon
|
||||
FROM block_keys bk JOIN lehre.tbl_stundenplandev sp ON sp.unr = bk.unr AND sp.datum = bk.datum AND sp.stunde = bk.stunde
|
||||
WHERE sp.datum >= ? AND sp.datum <= ?
|
||||
GROUP BY bk.unr, bk.datum, bk.block_nr
|
||||
)
|
||||
SELECT
|
||||
b.stundenplandev_ids,
|
||||
b.unr,
|
||||
b.datum,
|
||||
b.block_nr,
|
||||
b.lehreinheit_id,
|
||||
b.ort_kurzbz,
|
||||
b.datum + stundevon.beginn AS von,
|
||||
b.datum + stundebis.ende AS bis,
|
||||
b.insertamum,
|
||||
b.insertvon,
|
||||
b.updateamum,
|
||||
b.updatevon
|
||||
FROM blocks b
|
||||
JOIN lehre.tbl_stunde stundevon ON stundevon.stunde = b.stunde_von
|
||||
JOIN lehre.tbl_stunde stundebis ON stundebis.stunde = b.stunde_bis
|
||||
ORDER BY b.datum, b.unr, b.block_nr;';
|
||||
|
||||
array_push($params, $von, $bis);
|
||||
$stpldev = $db->execReadOnlyQuery($stpldevsql, $params);
|
||||
|
||||
if (hasData($stpldev))
|
||||
{
|
||||
// Pruefen ob der Eintrag schon in Sync Tabelle vorhanden ist
|
||||
// Wenn neuere Änderungen vorhanden dann Update
|
||||
// Wenn keine Änderungen seit leztem Sync dann Ueberspringen
|
||||
// Wenn noch nicht vorhanden neu anlegen
|
||||
// Danach ggf pruefen welceh Eintraege in der zwischenzeit geloescht wurden und
|
||||
// in der neuen Tabelle auch archivieren oder loeschen
|
||||
|
||||
$data = getData($stpldev);
|
||||
foreach($data as $block)
|
||||
{
|
||||
$ids = is_array($block->stundenplandev_ids) ? $block->stundenplandev_ids : explode(',', $block->stundenplandev_ids);
|
||||
/*$ids = array_map('intval', $ids);*/
|
||||
|
||||
$this->SyncModel->db->where('stundenplandev_id IN (' . implode(',', $ids) . ')');
|
||||
$sync_result = $this->SyncModel->load();
|
||||
|
||||
if (!hasData($sync_result))
|
||||
{
|
||||
$kalender_id = $this->_insertKalender($block, 'lehreinheit');
|
||||
if ($kalender_id)
|
||||
{
|
||||
$this->_insertSync($block->stundenplandev_ids, $kalender_id);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$syncData = getData($sync_result);
|
||||
$kalender_id = $syncData[0]->kalender_id;
|
||||
$last_sync = $syncData[0]->lastupdate;
|
||||
$synced_ids = array_column($syncData, 'stundenplandev_id');
|
||||
|
||||
if ($block->updateamum > $last_sync)
|
||||
{
|
||||
$this->_updateKalender($kalender_id, $block);
|
||||
$this->_updateSync($synced_ids, $kalender_id);
|
||||
}
|
||||
|
||||
$fehlende = array_diff($block->stundenplandev_ids, $synced_ids);
|
||||
if (!empty($fehlende))
|
||||
{
|
||||
$this->_insertSync($fehlende, $kalender_id);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function migrateReservierung($von = null, $bis = null, $ort_kurzbz = null)
|
||||
{
|
||||
$db = new DB_Model();
|
||||
|
||||
$qry = "WITH eindeutige_stunden AS (
|
||||
SELECT DISTINCT titel, beschreibung, datum, stunde
|
||||
FROM campus.tbl_reservierung
|
||||
WHERE datum >= ? AND datum <= ?";
|
||||
|
||||
$params = array($von, $bis);
|
||||
|
||||
if (!is_null($ort_kurzbz))
|
||||
{
|
||||
$qry .= " AND ort_kurzbz = ?";
|
||||
$params[] = $ort_kurzbz;
|
||||
}
|
||||
|
||||
$qry .= "),
|
||||
block_keys AS (
|
||||
SELECT
|
||||
titel, beschreibung, datum, stunde,
|
||||
stunde - ROW_NUMBER() OVER (PARTITION BY titel, beschreibung, datum ORDER BY stunde) AS block_nr
|
||||
FROM eindeutige_stunden
|
||||
),
|
||||
blocks AS (
|
||||
SELECT
|
||||
bk.titel,
|
||||
bk.beschreibung,
|
||||
bk.datum,
|
||||
bk.block_nr,
|
||||
MIN(bk.stunde) AS stunde_von,
|
||||
MAX(bk.stunde) AS stunde_bis,
|
||||
array_agg(DISTINCT r.reservierung_id::text) AS reservierung_ids,
|
||||
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,
|
||||
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,
|
||||
MAX(r.insertamum) AS insertamum,
|
||||
(array_agg(r.insertvon ORDER BY r.insertamum ASC))[1] AS insertvon
|
||||
FROM block_keys bk
|
||||
JOIN campus.tbl_reservierung r
|
||||
ON r.titel = bk.titel AND r.beschreibung = bk.beschreibung AND r.datum = bk.datum AND r.stunde = bk.stunde
|
||||
WHERE r.datum >= ? AND r.datum <= ?
|
||||
GROUP BY bk.titel, bk.beschreibung, bk.datum, bk.block_nr
|
||||
)
|
||||
SELECT
|
||||
b.*,
|
||||
(b.datum + s_von.beginn) AS von,
|
||||
(b.datum + s_bis.ende) AS bis
|
||||
FROM blocks b
|
||||
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;";
|
||||
|
||||
array_push($params, $von, $bis);
|
||||
$reservierung_data = $db->execReadOnlyQuery($qry, $params);
|
||||
|
||||
|
||||
if (hasData($reservierung_data))
|
||||
{
|
||||
$data = getData($reservierung_data);
|
||||
|
||||
foreach($data as $block)
|
||||
{
|
||||
|
||||
$ids = is_array($block->reservierung_ids) ? $block->reservierung_ids : explode(',', $block->reservierung_ids);
|
||||
|
||||
$this->SyncReservierungModel->db->where('reservierung_id IN (' . implode(',', $ids) . ')');
|
||||
$sync_result = $this->SyncReservierungModel->load();
|
||||
|
||||
if (!hasData($sync_result))
|
||||
{
|
||||
$kalender_id = $this->_insertKalender($block, 'reservierung');
|
||||
if ($kalender_id)
|
||||
{
|
||||
$this->_insertReservierungSync($block->reservierung_ids, $kalender_id);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$syncData = getData($sync_result);
|
||||
$kalender_id = $syncData[0]->kalender_id;
|
||||
$last_sync = $syncData[0]->lastupdate;
|
||||
$synced_ids = array_column($syncData, 'reservierung_id');
|
||||
|
||||
if ($block->insertamum > $last_sync)
|
||||
{
|
||||
$this->_updateKalender($kalender_id, $block);
|
||||
$this->_updateReservierungSync($synced_ids, $kalender_id);
|
||||
}
|
||||
|
||||
$fehlende = array_diff($block->reservierung_ids, $synced_ids);
|
||||
if (!empty($fehlende))
|
||||
{
|
||||
$this->_insertReservierungSync($fehlende, $kalender_id);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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)
|
||||
{
|
||||
$result = $this->KalenderModel->insert(
|
||||
array (
|
||||
'von' => $block->von,
|
||||
'bis' => $block->bis,
|
||||
'typ' => $typ,
|
||||
'status_kurzbz'=> 'live',
|
||||
'insertamum' => $block->insertamum,
|
||||
'insertvon' => $block->insertvon,
|
||||
'updateamum' => $block->updateamum ?? null,
|
||||
'updatevon' => $block->updatevon ?? null
|
||||
)
|
||||
);
|
||||
if(!isSuccess($result))
|
||||
return null;
|
||||
|
||||
$kalender_id = getData($result);
|
||||
|
||||
if ($typ === 'lehreinheit')
|
||||
{
|
||||
$this->KalenderLehreinheitModel->insert(
|
||||
array (
|
||||
'kalender_id' => $kalender_id,
|
||||
'lehreinheit_id'=> $block->lehreinheit_id
|
||||
)
|
||||
);
|
||||
}
|
||||
else if ($typ === 'reservierung')
|
||||
{
|
||||
$this->KalenderEventModel->insert(array(
|
||||
'kalender_id' => $kalender_id,
|
||||
'titel' => $block->titel,
|
||||
'beschreibung' => $block->beschreibung
|
||||
));
|
||||
|
||||
|
||||
if ($block->insertvon)
|
||||
{
|
||||
$user = $this->BenutzerModel->load(array('uid' => $block->insertvon));
|
||||
|
||||
if (hasData($user))
|
||||
{
|
||||
$this->KalenderEventTeilnehmerModel->insert(array(
|
||||
'kalender_id' => $kalender_id,
|
||||
'uid' => getData($user)[0]->uid,
|
||||
'rolle_kurzbz' => 'organisator'
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
$uids = is_array($block->uids) ? $block->uids : explode(',', $block->uids);
|
||||
foreach ($uids as $uid)
|
||||
{
|
||||
$this->KalenderEventTeilnehmerModel->insert(array(
|
||||
'kalender_id' => $kalender_id,
|
||||
'uid' => $uid,
|
||||
'rolle_kurzbz' => 'teilnehmer'
|
||||
));
|
||||
}
|
||||
|
||||
$semester_range = $this->StudiensemesterModel->getByDateRange($block->von, $block->bis);
|
||||
if (isError($semester_range)) return $semester_range;
|
||||
$studiensemester_kurzbz = getData($semester_range)[0]->studiensemester_kurzbz ?? null;
|
||||
|
||||
$gruppen = is_array($block->gruppen_kurzbz) ? $block->gruppen_kurzbz : explode(',', $block->gruppen_kurzbz ?? '');
|
||||
|
||||
foreach ($gruppen as $gruppe_kurzbz)
|
||||
{
|
||||
$gruppe_kurzbz = trim($gruppe_kurzbz);
|
||||
if (!empty($gruppe_kurzbz))
|
||||
{
|
||||
$this->KalenderEventTeilnehmerModel->insert(array(
|
||||
'kalender_id' => $kalender_id,
|
||||
'gruppe_kurzbz' => $gruppe_kurzbz,
|
||||
'studiengang_kz' => $block->studiengang_kz,
|
||||
'studiensemester_kurzbz' => $studiensemester_kurzbz,
|
||||
'rolle_kurzbz' => 'teilnehmer'
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
$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, '()');
|
||||
list($sem, $verb, $grp) = explode(',', $kombi_str);
|
||||
|
||||
$sem = trim($sem) === '' ? null : trim($sem);
|
||||
$verb = trim($verb) === '' ? null : trim($verb);
|
||||
$grp = trim($grp) === '' ? null : trim($grp);
|
||||
|
||||
if (is_null($sem) && is_null($verb) && is_null($grp))
|
||||
continue;
|
||||
|
||||
$this->KalenderEventTeilnehmerModel->insert(array(
|
||||
'kalender_id' => $kalender_id,
|
||||
'studiengang_kz' => $block->studiengang_kz,
|
||||
'semester' => $sem,
|
||||
'verband' => $verb,
|
||||
'gruppe' => $grp,
|
||||
'studiensemester_kurzbz' => $studiensemester_kurzbz,
|
||||
'rolle_kurzbz' => 'teilnehmer'
|
||||
));
|
||||
}
|
||||
}
|
||||
|
||||
return $kalender_id;
|
||||
}
|
||||
|
||||
private function _insertSync($ids, $kalender_id)
|
||||
{
|
||||
foreach($ids as $id)
|
||||
{
|
||||
$this->SyncModel->insert(
|
||||
array (
|
||||
'stundenplandev_id' => $id,
|
||||
'kalender_id' => $kalender_id,
|
||||
'lastupdate' => date('Y-m-d H:i:s')
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
private function _insertReservierungSync($ids, $kalender_id)
|
||||
{
|
||||
|
||||
foreach($ids as $id)
|
||||
{
|
||||
$this->SyncReservierungModel->insert(
|
||||
array (
|
||||
'reservierung_id' => $id,
|
||||
'kalender_id' => $kalender_id,
|
||||
'lastupdate' => date('Y-m-d H:i:s')
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
private function _updateKalender($kalender_id, $block)
|
||||
{
|
||||
$this->KalenderModel->update(
|
||||
array (
|
||||
'kalender_id' => $kalender_id
|
||||
),
|
||||
array (
|
||||
'von' => $block->von,
|
||||
'bis' => $block->bis,
|
||||
'updateamum'=> $block->updateamum,
|
||||
'updatevon' => $block->updatevon
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
private function _updateSync($ids, $kalender_id)
|
||||
{
|
||||
foreach($ids as $id)
|
||||
{
|
||||
$this->SyncModel->update(
|
||||
array (
|
||||
'stundenplandev_id' => $id,
|
||||
'kalender_id' => $kalender_id
|
||||
),
|
||||
array (
|
||||
'lastupdate' => date('Y-m-d H:i:s')
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
private function _updateReservierungSync($ids, $kalender_id)
|
||||
{
|
||||
foreach($ids as $id)
|
||||
{
|
||||
$this->SyncReservierungModel->update(
|
||||
array (
|
||||
'reservierung_id' => $id,
|
||||
'kalender_id' => $kalender_id
|
||||
),
|
||||
array (
|
||||
'lastupdate' => date('Y-m-d H:i:s')
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
<?php
|
||||
interface ICollisionCheck
|
||||
{
|
||||
public function getName();
|
||||
|
||||
public function check($data);
|
||||
|
||||
public function checkAll($kalender_ids);
|
||||
|
||||
}
|
||||
@@ -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,
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
<?php
|
||||
|
||||
defined('BASEPATH') || exit('No direct script access allowed');
|
||||
|
||||
use CI3_Events as Events;
|
||||
|
||||
class CollisionChecker
|
||||
{
|
||||
private $_checks = [];
|
||||
|
||||
private $_ci;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$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');
|
||||
$this->_ci->load->library('collision/checks/ResourcesCollisionCheck');
|
||||
$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);
|
||||
}
|
||||
|
||||
public function register(ICollisionCheck $check)
|
||||
{
|
||||
$this->_checks[$check->getName()] = $check;
|
||||
}
|
||||
|
||||
public function run($data)
|
||||
{
|
||||
$errors = [];
|
||||
|
||||
foreach ($this->_checks as $check)
|
||||
{
|
||||
$result = $check->check($data);
|
||||
|
||||
if (!empty($result))
|
||||
{
|
||||
$errors = array_merge($errors, $result);
|
||||
}
|
||||
}
|
||||
|
||||
return $errors;
|
||||
}
|
||||
|
||||
public function runAll($kalender_ids)
|
||||
{
|
||||
$results = array_fill_keys($kalender_ids, []);
|
||||
|
||||
foreach ($this->_checks as $check)
|
||||
{
|
||||
$batchResult = $check->checkAll($kalender_ids);
|
||||
foreach ($batchResult as $kalender_id => $errors)
|
||||
{
|
||||
$results[$kalender_id] = array_merge($results[$kalender_id], $errors);
|
||||
}
|
||||
}
|
||||
|
||||
return $results;
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,170 @@
|
||||
<?php
|
||||
|
||||
if (! defined("BASEPATH")) exit("No direct script access allowed");
|
||||
|
||||
class KalenderNotificationLib
|
||||
{
|
||||
private $_ci;
|
||||
public function __construct()
|
||||
{
|
||||
$this->_ci =& get_instance();
|
||||
$this->_ci->load->library('MailLib');
|
||||
$this->_ci->load->config('tempus');
|
||||
|
||||
}
|
||||
|
||||
public function sendMails($mail_infos)
|
||||
{
|
||||
if (!$this->_ci->config->item('send_update_mails'))
|
||||
return true;
|
||||
|
||||
$lektor_added = array();
|
||||
$lektor_changed = array();
|
||||
$lektor_deleted = array();
|
||||
|
||||
$student_added = array();
|
||||
$student_changed = array();
|
||||
$student_deleted = array();
|
||||
|
||||
foreach ($mail_infos as $info)
|
||||
{
|
||||
$entry = $info['entry'];
|
||||
$new_status = $info['new_status'];
|
||||
$notify = $info['notify'];
|
||||
|
||||
$old_entry = null;
|
||||
if ($entry->vorgaenger_kalender_id)
|
||||
{
|
||||
$this->_ci->KalenderModel->addJoin('lehre.tbl_kalender_ort', 'tbl_kalender.kalender_id = tbl_kalender_ort.kalender_id', 'LEFT');
|
||||
$vorgaenger = $this->_ci->KalenderModel->load(array('tbl_kalender.kalender_id' => $entry->vorgaenger_kalender_id));
|
||||
if (hasData($vorgaenger))
|
||||
$old_entry = getData($vorgaenger)[0];
|
||||
}
|
||||
|
||||
if ($new_status === 'deleted')
|
||||
$row = $this->_buildMailDeleted($entry);
|
||||
else if ($old_entry)
|
||||
$row = $this->_buildMailChanged($old_entry, $entry);
|
||||
else
|
||||
$row = $this->_buildMailNew($entry);
|
||||
|
||||
if (in_array('lektor', $notify))
|
||||
{
|
||||
if ($new_status === 'deleted')
|
||||
$lektor_deleted[] = $row;
|
||||
else if ($old_entry)
|
||||
$lektor_changed[] = $row;
|
||||
else
|
||||
$lektor_added[] = $row;
|
||||
}
|
||||
|
||||
if (in_array('student', $notify))
|
||||
{
|
||||
if ($new_status === 'deleted')
|
||||
$student_deleted[] = $row;
|
||||
else if ($old_entry)
|
||||
$student_changed[] = $row;
|
||||
else
|
||||
$student_added[] = $row;
|
||||
}
|
||||
}
|
||||
|
||||
$lektor_entries = '';
|
||||
$student_entries = '';
|
||||
|
||||
if (!empty($lektor_added))
|
||||
$lektor_entries .= $this->_addToList($lektor_added, 'hinzugefügt') . '<hr/>';
|
||||
|
||||
if (!empty($lektor_changed))
|
||||
$lektor_entries .= $this->_addToList($lektor_changed, 'geändert') . '<hr/>';
|
||||
|
||||
if (!empty($lektor_deleted))
|
||||
$lektor_entries .= $this->_addToList($lektor_deleted, 'gelöscht') . '<hr/>';
|
||||
|
||||
if (!empty($student_added))
|
||||
$student_entries .= $this->_addToList($student_added, 'hinzugefügt') . '<hr/>';
|
||||
|
||||
if (!empty($student_changed))
|
||||
$student_entries .= $this->_addToList($student_changed, 'geändert') . '<hr/>';
|
||||
|
||||
if (!empty($student_deleted))
|
||||
$student_entries .= $this->_addToList($student_deleted, 'gelöscht') . '<hr/>';
|
||||
|
||||
if (!empty($lektor_entries))
|
||||
$this->_ci->maillib->send('', 'ma0048@technikum-wien.at', 'Lektor Tempus Update', $lektor_entries);
|
||||
if (!empty($student_entries))
|
||||
$this->_ci->maillib->send('', 'ma0048@technikum-wien.at', 'Student Tempus Update', $student_entries);
|
||||
}
|
||||
|
||||
private function _addToList($entries, $status)
|
||||
{
|
||||
return 'Folgende Einträge wurden <b>'. $status .'</b>: <ul>' . implode('', $entries) . '</ul>';
|
||||
|
||||
}
|
||||
private function _buildMailNew($entry)
|
||||
{
|
||||
$von = date('d.m.Y H:i', strtotime($entry->von));
|
||||
$bis = date('H:i', strtotime($entry->bis));
|
||||
|
||||
return '<li>
|
||||
<b>Kalender ID ' . ($entry->kalender_id ?? '-') . '</b>
|
||||
<ul>
|
||||
<li><b>Uhrzeit:</b> ' . $von . ' - ' . $bis . '</li>
|
||||
<li><b>Ort:</b> ' . ($entry->ort_kurzbz ?? '-') . '</li>
|
||||
</ul>
|
||||
</li>';
|
||||
}
|
||||
|
||||
private function _buildMailChanged($old_entry, $new_entry)
|
||||
{
|
||||
$old_von = date('d.m.Y H:i', strtotime($old_entry->von));
|
||||
$old_bis = date('H:i', strtotime($old_entry->bis));
|
||||
$new_von = date('d.m.Y H:i', strtotime($new_entry->von));
|
||||
$new_bis = date('H:i', strtotime($new_entry->bis));
|
||||
|
||||
$old_ort = $old_entry->ort_kurzbz ?? '-';
|
||||
$new_ort = $new_entry->ort_kurzbz ?? '-';
|
||||
|
||||
$uhrzeit_changed = ($old_von . $old_bis) !== ($new_von . $new_bis);
|
||||
$ort_changed = $old_ort !== $new_ort;
|
||||
|
||||
$changes = '';
|
||||
|
||||
if ($uhrzeit_changed)
|
||||
{
|
||||
$changes .= '<li>
|
||||
<b>Uhrzeit:</b>
|
||||
<s style="color:red;">' . $old_von . ' - ' . $old_bis . '</s>
|
||||
<span style="color:green;">' . $new_von . ' - ' . $new_bis . '</span>
|
||||
</li>';
|
||||
}
|
||||
|
||||
if ($ort_changed)
|
||||
{
|
||||
$changes .= '<li>
|
||||
<b>Ort:</b>
|
||||
<s style="color:red;">' . $old_ort . '</s>
|
||||
<span style="color:green;">' . $new_ort . '</span>
|
||||
</li>';
|
||||
}
|
||||
|
||||
return '<li>
|
||||
<b>Kalender ID ' . ($new_entry->kalender_id ?? '-') . '</b>
|
||||
<ul>' . $changes . '</ul>
|
||||
</li>';
|
||||
}
|
||||
|
||||
private function _buildMailDeleted($entry)
|
||||
{
|
||||
$von = date('d.m.Y H:i', strtotime($entry->von));
|
||||
$bis = date('H:i', strtotime($entry->bis));
|
||||
|
||||
return '<li style="color:red;">
|
||||
<b><s>Kalender ID ' . ($entry->kalender_id ?? '-') . '</s></b>
|
||||
<ul>
|
||||
<li><s>' . $von . ' - ' . $bis . '</s></li>
|
||||
<li><s>' . ($entry->ort_kurzbz ?? '-') . '</s></li>
|
||||
</ul>
|
||||
</li>';
|
||||
}
|
||||
}
|
||||
@@ -50,6 +50,7 @@ class PermissionLib
|
||||
const LOGINAS_PERSONIDS_BLACKLIST = 'permission_loginas_personids_blacklist';
|
||||
|
||||
private $_ci; // CI instance
|
||||
private $access_rights; // current users access rights
|
||||
private static $bb; // benutzerberechtigung
|
||||
|
||||
/**
|
||||
@@ -61,6 +62,8 @@ class PermissionLib
|
||||
// Loads CI instance
|
||||
$this->_ci =& get_instance();
|
||||
|
||||
$this->access_rights = null;
|
||||
|
||||
$this->_ci->config->load('permission'); // Loads permission configuration
|
||||
|
||||
// If it's NOT called from command line
|
||||
@@ -69,8 +72,10 @@ class PermissionLib
|
||||
// API Caller rights initialization
|
||||
$authObj = $this->_ci->authlib->getAuthObj();
|
||||
self::$bb = new benutzerberechtigung();
|
||||
if ($authObj)
|
||||
if ($authObj) {
|
||||
self::$bb->getBerechtigungen($authObj->{AuthLib::AO_USERNAME});
|
||||
$this->access_rights = self::$bb->berechtigungen;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -340,6 +345,16 @@ class PermissionLib
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the access rights for the current user
|
||||
*
|
||||
* @return array|null
|
||||
*/
|
||||
public function getAccessRights()
|
||||
{
|
||||
return $this->access_rights;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Private methods
|
||||
|
||||
|
||||
@@ -0,0 +1,242 @@
|
||||
<?php
|
||||
|
||||
if (! defined("BASEPATH")) exit("No direct script access allowed");
|
||||
|
||||
use CI3_Events as Events;
|
||||
|
||||
class RaumvorschlagLib
|
||||
{
|
||||
private $_ci;
|
||||
public function __construct()
|
||||
{
|
||||
$this->_ci =& get_instance();
|
||||
|
||||
$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('education/Lehreinheit_model', 'LehreinheitModel');
|
||||
$this->_ci->load->model('education/Lehrveranstaltung_model', 'LehrveranstaltungModel');
|
||||
$this->_ci->load->model('education/LehreinheitMitarbeiter_model', 'LehreinheitMitarbeiterModel');
|
||||
$this->_ci->load->model('ressource/Ort_model', 'OrtModel');
|
||||
$this->_ci->load->model('organisation/gruppe_model', 'GruppeModel');
|
||||
$this->_ci->load->model('organisation/Lehrverband_model', 'LehrverbandModel');
|
||||
|
||||
$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('PhrasesLib', array('ui'));
|
||||
}
|
||||
|
||||
|
||||
public function getVorschlaege($kalender_id)
|
||||
{
|
||||
$event = $this->_ci->kalenderlib->getByKalenderId($kalender_id);
|
||||
$event = $event[0];
|
||||
|
||||
$lektor_uids = array_column($event->lektor, 'mitarbeiter_uid');
|
||||
$gruppen_kurzbz = array_values(array_filter(array_column($event->gruppe, 'gruppe_kurzbz')));
|
||||
|
||||
$lehrverband_gruppen = array_values(array_filter($event->gruppe, function($gruppe)
|
||||
{
|
||||
return empty($gruppe['gruppe_kurzbz']);
|
||||
}));
|
||||
|
||||
$tages_events = $this->_ci->kalenderlib->getForRaumvorschlag(
|
||||
$event->datum,
|
||||
$event->datum,
|
||||
$lektor_uids,
|
||||
$gruppen_kurzbz,
|
||||
$lehrverband_gruppen
|
||||
);
|
||||
|
||||
$lektor_davor = $this->_getEventDavor($tages_events, $event->isostart, $lektor_uids, 'lektor');
|
||||
$gruppen_davor = $this->_getEventDavor($tages_events, $event->isostart, $gruppen_kurzbz, 'gruppe');
|
||||
|
||||
$lektor_davor_ort = $lektor_davor ? $this->_getOrtDetails($lektor_davor->ort_kurzbz) : null;
|
||||
$gruppen_davor_ort = $gruppen_davor ? $this->_getOrtDetails($gruppen_davor->ort_kurzbz) : null;
|
||||
|
||||
$kandidaten = $this->_getRaumkandidaten($event);
|
||||
if (empty($kandidaten)) return [];
|
||||
|
||||
|
||||
$ratings = [];
|
||||
foreach ($kandidaten as $raum)
|
||||
{
|
||||
$rating = ['ort_kurzbz' => $raum->ort_kurzbz, 'score' => 100, 'details' => []];
|
||||
$this->_rateLektor($rating, $raum, $lektor_davor_ort);
|
||||
$this->_rateGruppen($rating, $raum, $gruppen_davor_ort);
|
||||
|
||||
Events::trigger('room_rating',
|
||||
function & () use (&$rating) {
|
||||
return $rating;
|
||||
},
|
||||
$raum,
|
||||
$event
|
||||
);
|
||||
$ratings[] = $rating;
|
||||
}
|
||||
|
||||
usort($ratings, function($a, $b)
|
||||
{
|
||||
return $b['score'] - $a['score'];
|
||||
});
|
||||
|
||||
return $ratings;
|
||||
|
||||
}
|
||||
|
||||
private function _getOrtDetails($ort_kurzbz)
|
||||
{
|
||||
$this->_ci->OrtModel->addSelect('ort_kurzbz, stockwerk, standort_id');
|
||||
$this->_ci->OrtModel->db->where('ort_kurzbz', $ort_kurzbz);
|
||||
$result = $this->_ci->OrtModel->load();
|
||||
return hasData($result) ? getData($result)[0] : null;
|
||||
}
|
||||
|
||||
private function _rateLektor(&$rating, $raum, $lektor_davor_ort)
|
||||
{
|
||||
if (!$lektor_davor_ort) return;
|
||||
|
||||
if ($lektor_davor_ort->ort_kurzbz === $raum->ort_kurzbz)
|
||||
{
|
||||
$rating['score'] += 20;
|
||||
$rating['details'][] = '+20 ' . $this->_ci->phraseslib->t('ui', 'lecturer_already_here');
|
||||
return;
|
||||
}
|
||||
|
||||
if ($lektor_davor_ort->standort_id !== $raum->standort_id)
|
||||
{
|
||||
$rating['score'] -= 20;
|
||||
$rating['details'][] = '-20 '. $this->_ci->phraseslib->t('ui', 'lecturer_building_change');
|
||||
}
|
||||
elseif ($lektor_davor_ort->stockwerk !== $raum->stockwerk)
|
||||
{
|
||||
$diff = abs($lektor_davor_ort->stockwerk - $raum->stockwerk);
|
||||
$rating['score'] -= $diff * 5;
|
||||
$rating['details'][] = '-' . ($diff * 5) . ' ' . $this->_ci->phraseslib->t('ui', 'lecturer_floor_change');
|
||||
}
|
||||
}
|
||||
|
||||
private function _rateGruppen(&$rating, $raum, $gruppen_davor_ort)
|
||||
{
|
||||
if (!$gruppen_davor_ort) return;
|
||||
|
||||
if ($gruppen_davor_ort->ort_kurzbz === $raum->ort_kurzbz)
|
||||
{
|
||||
$rating['score'] += 10;
|
||||
$rating['details'][] = '+10 ' . $this->_ci->phraseslib->t('ui', 'student_already_here');
|
||||
return;
|
||||
}
|
||||
|
||||
if ($gruppen_davor_ort->standort_id !== $raum->standort_id)
|
||||
{
|
||||
$rating['score'] -= 20;
|
||||
$rating['details'][] = '-20 '. $this->_ci->phraseslib->t('ui', 'student_building_change');
|
||||
}
|
||||
elseif ($gruppen_davor_ort->stockwerk !== $raum->stockwerk)
|
||||
{
|
||||
$diff = abs($gruppen_davor_ort->stockwerk - $raum->stockwerk);
|
||||
$rating['score'] -= $diff * 5;
|
||||
$rating['details'][] = '-' . ($diff * 5) . ' '. $this->_ci->phraseslib->t('ui', 'student_floor_change');
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
private function _getEventDavor($events, $von, $uids, $type)
|
||||
{
|
||||
$kandidat = null;
|
||||
|
||||
foreach ($events as $event)
|
||||
{
|
||||
if ($event->isoend > $von)
|
||||
continue;
|
||||
|
||||
//Wenn zwischen zwei Events eine 30+ Minuten Pause liegt, wird das Event davor nicht berücksichtigt
|
||||
if ((strtotime($von) - strtotime($event->isoend)) > 30 * 60)
|
||||
continue;
|
||||
|
||||
if (empty($event->ort_kurzbz))
|
||||
continue;
|
||||
|
||||
if ($type === 'lektor')
|
||||
$event_uids = array_column($event->lektor, 'mitarbeiter_uid');
|
||||
else
|
||||
$event_uids = array_column($event->gruppe, 'gruppe_kurzbz');
|
||||
|
||||
if (empty(array_intersect($event_uids, $uids)))
|
||||
continue;
|
||||
|
||||
if ($kandidat === null || $event->isoend > $kandidat->isoend)
|
||||
$kandidat = $event;
|
||||
}
|
||||
|
||||
return $kandidat;
|
||||
}
|
||||
|
||||
private function _getRaumkandidaten($event)
|
||||
{
|
||||
$lehreinheit = $this->_ci->LehreinheitModel->load($event->lehreinheit_id[0]);
|
||||
if (!hasData($lehreinheit)) return [];
|
||||
$lehreinheit = getData($lehreinheit)[0];
|
||||
|
||||
$this->_ci->KalenderModel->addSelect('tbl_kalender_ort.ort_kurzbz');
|
||||
$this->_ci->KalenderModel->addJoin('lehre.tbl_kalender_ort', 'tbl_kalender.kalender_id = tbl_kalender_ort.kalender_id');
|
||||
$this->_ci->KalenderModel->db->where('tbl_kalender.von <', $event->isoend);
|
||||
$this->_ci->KalenderModel->db->where('tbl_kalender.bis >', $event->isostart);
|
||||
$this->_ci->KalenderModel->db->where_not_in('tbl_kalender.status_kurzbz', ['deleted']);
|
||||
$this->_ci->KalenderModel->db->where('tbl_kalender_ort.ort_kurzbz IS NOT NULL', null, false);
|
||||
$belegte = $this->_ci->KalenderModel->load();
|
||||
|
||||
$belegte_orte = hasData($belegte) ? array_column(getData($belegte), 'ort_kurzbz') : [];
|
||||
|
||||
if (empty($lehreinheit->raumtyp))
|
||||
{
|
||||
$raeume = $this->_getFreieRaeume(null, $belegte_orte);
|
||||
return hasData($raeume) ? getData($raeume) : [];
|
||||
}
|
||||
|
||||
$vorschlaege = [];
|
||||
|
||||
$raeume = $this->_getFreieRaeume($lehreinheit->raumtyp, $belegte_orte);
|
||||
if (hasData($raeume))
|
||||
$vorschlaege = getData($raeume);
|
||||
|
||||
if (count($vorschlaege) < 5 && !empty($lehreinheit->raumtypalternativ))
|
||||
{
|
||||
$bereits_gefunden = array_merge($belegte_orte, array_column($vorschlaege, 'ort_kurzbz'));
|
||||
$alternativ = $this->_getFreieRaeume($lehreinheit->raumtypalternativ, $bereits_gefunden);
|
||||
|
||||
if (!isError($alternativ) && hasData($alternativ))
|
||||
$vorschlaege = array_merge($vorschlaege, getData($alternativ));
|
||||
}
|
||||
|
||||
return $vorschlaege;
|
||||
}
|
||||
|
||||
private function _getFreieRaeume($raumtyp, $belegte_orte)
|
||||
{
|
||||
$this->_ci->OrtModel->addSelect('ort_kurzbz, stockwerk, standort_id');
|
||||
$this->_ci->OrtModel->addJoin('public.tbl_ortraumtyp', 'ort_kurzbz');
|
||||
$this->_ci->OrtModel->db->where('raumtyp_kurzbz', $raumtyp);
|
||||
$this->_ci->OrtModel->db->where('aktiv', true);
|
||||
$this->_ci->OrtModel->db->where("ort_kurzbz NOT LIKE '\_%'", null, false);
|
||||
|
||||
if (!empty($belegte_orte))
|
||||
$this->_ci->OrtModel->db->where_not_in('ort_kurzbz', $belegte_orte);
|
||||
$this->_ci->OrtModel->addOrder('hierarchie, ort_kurzbz');
|
||||
|
||||
return $this->_ci->OrtModel->load();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,258 @@
|
||||
<?php
|
||||
|
||||
class LectureCollisionCheck implements ICollisionCheck
|
||||
{
|
||||
|
||||
private $_ci;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->_ci =& get_instance();
|
||||
$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('PhrasesLib', array('ui'));
|
||||
|
||||
}
|
||||
|
||||
public function getName()
|
||||
{
|
||||
return 'lecture';
|
||||
}
|
||||
|
||||
public function check($data)
|
||||
{
|
||||
if (!isset($data->von, $data->bis, $data->kalender_id)) return [];
|
||||
|
||||
if ($this->_ci->variablelib->getVar('ignore_kollision') === 'true') return [];
|
||||
|
||||
$uids = $this->_getUids($data->kalender_id);
|
||||
|
||||
if (empty($uids)) return [];
|
||||
|
||||
$collisions = [];
|
||||
|
||||
$collisions = array_merge($collisions, $this->_checkLehreinheit($uids, $data));
|
||||
$collisions = array_merge($collisions, $this->_checkReservierung($uids, $data));
|
||||
$collisions = array_merge($collisions, $this->_checkZeitsperre($uids, $data));
|
||||
|
||||
return $collisions;
|
||||
}
|
||||
|
||||
public function checkAll($kalender_ids)
|
||||
{
|
||||
if (empty($kalender_ids)) return [];
|
||||
|
||||
$kollisionsfreie_user = unserialize(KOLLISIONSFREIE_USER);
|
||||
$grouped = [];
|
||||
|
||||
$this->_ci->KalenderModel->addSelect('DISTINCT ON (tbl_kalender.kalender_id) tbl_kalender.kalender_id');
|
||||
$this->_ci->KalenderModel->addJoin('lehre.tbl_kalender_lehreinheit current_kalender_le', 'current_kalender_le.kalender_id = tbl_kalender.kalender_id');
|
||||
$this->_ci->KalenderModel->addJoin('lehre.tbl_lehreinheit current_lehreinheit', 'current_lehreinheit.lehreinheit_id = current_kalender_le.lehreinheit_id');
|
||||
$this->_ci->KalenderModel->addJoin('lehre.tbl_lehreinheitmitarbeiter current_lehreinheit_ma', 'current_lehreinheit_ma.lehreinheit_id = current_lehreinheit.lehreinheit_id');
|
||||
$this->_ci->KalenderModel->addJoin('lehre.tbl_lehreinheitmitarbeiter other_lehreinheithreinheit_ma', 'other_lehreinheithreinheit_ma.mitarbeiter_uid = current_lehreinheit_ma.mitarbeiter_uid');
|
||||
$this->_ci->KalenderModel->addJoin('lehre.tbl_lehreinheit other_lehreinheit', 'other_lehreinheit.lehreinheit_id = other_lehreinheithreinheit_ma.lehreinheit_id');
|
||||
$this->_ci->KalenderModel->addJoin('lehre.tbl_kalender_lehreinheit other_kalender_le', 'other_kalender_le.lehreinheit_id = other_lehreinheit.lehreinheit_id');
|
||||
$this->_ci->KalenderModel->addJoin('lehre.tbl_kalender other_kalender', 'other_kalender.kalender_id = other_kalender_le.kalender_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_not_in('current_lehreinheit_ma.mitarbeiter_uid', $kollisionsfreie_user);
|
||||
$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))
|
||||
{
|
||||
foreach (getData($result) as $row)
|
||||
{
|
||||
$grouped[$row->kalender_id][] = true;
|
||||
}
|
||||
}
|
||||
|
||||
$this->_ci->KalenderModel->addSelect('DISTINCT ON (tbl_kalender.kalender_id) tbl_kalender.kalender_id');
|
||||
$this->_ci->KalenderModel->addJoin('lehre.tbl_kalender_lehreinheit current_kalender_le', 'current_kalender_le.kalender_id = tbl_kalender.kalender_id');
|
||||
$this->_ci->KalenderModel->addJoin('lehre.tbl_lehreinheit current_lehreinheit', 'current_lehreinheit.lehreinheit_id = current_kalender_le.lehreinheit_id');
|
||||
$this->_ci->KalenderModel->addJoin('lehre.tbl_lehreinheitmitarbeiter current_lehreinheit_ma', 'current_lehreinheit_ma.lehreinheit_id = current_lehreinheit.lehreinheit_id');
|
||||
$this->_ci->KalenderModel->addJoin('lehre.tbl_kalender_event_teilnehmer other_t', 'other_t.uid = current_lehreinheit_ma.mitarbeiter_uid');
|
||||
$this->_ci->KalenderModel->addJoin('lehre.tbl_kalender_event other_e', 'other_e.kalender_id = other_t.kalender_id');
|
||||
$this->_ci->KalenderModel->addJoin('lehre.tbl_kalender other_kalender', 'other_kalender.kalender_id = other_e.kalender_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_not_in('current_lehreinheit_ma.mitarbeiter_uid', $kollisionsfreie_user);
|
||||
$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))
|
||||
{
|
||||
foreach (getData($result) as $row)
|
||||
{
|
||||
$grouped[$row->kalender_id][] = true;
|
||||
}
|
||||
}
|
||||
|
||||
$this->_ci->KalenderModel->addSelect('DISTINCT ON (tbl_kalender.kalender_id) tbl_kalender.kalender_id');
|
||||
$this->_ci->KalenderModel->addJoin('lehre.tbl_kalender_lehreinheit current_kalender_le', 'current_kalender_le.kalender_id = tbl_kalender.kalender_id');
|
||||
$this->_ci->KalenderModel->addJoin('lehre.tbl_lehreinheit current_lehreinheit', 'current_lehreinheit.lehreinheit_id = current_kalender_le.lehreinheit_id');
|
||||
$this->_ci->KalenderModel->addJoin('lehre.tbl_lehreinheitmitarbeiter current_lehreinheit_ma', 'current_lehreinheit_ma.lehreinheit_id = current_lehreinheit.lehreinheit_id');
|
||||
$this->_ci->KalenderModel->addJoin('campus.tbl_zeitsperre z',
|
||||
"z.mitarbeiter_uid = current_lehreinheit_ma.mitarbeiter_uid
|
||||
AND z.zeitsperretyp_kurzbz != 'ZVerfueg'");
|
||||
$this->_ci->KalenderModel->addJoin('lehre.tbl_stunde vonstunde_z', 'vonstunde_z.stunde = z.vonstunde', 'LEFT');
|
||||
$this->_ci->KalenderModel->addJoin('lehre.tbl_stunde bisstunde_z', 'bisstunde_z.stunde = z.bisstunde', 'LEFT');
|
||||
|
||||
$this->_ci->KalenderModel->db->where('(z.vondatum + COALESCE(vonstunde_z.beginn, \'00:00\'))::timestamp < tbl_kalender.bis', null, false);
|
||||
$this->_ci->KalenderModel->db->where('(z.bisdatum + COALESCE(bisstunde_z.ende, \'23:59\'))::timestamp > tbl_kalender.von', null, false);
|
||||
$this->_ci->KalenderModel->db->where_not_in('current_lehreinheit_ma.mitarbeiter_uid', $kollisionsfreie_user);
|
||||
$this->_ci->KalenderModel->db->where_in('tbl_kalender.kalender_id', $kalender_ids);
|
||||
$result = $this->_ci->KalenderModel->load();
|
||||
|
||||
|
||||
if (!isError($result) && hasData($result))
|
||||
{
|
||||
foreach (getData($result) as $row)
|
||||
{
|
||||
$grouped[$row->kalender_id][] = true;
|
||||
}
|
||||
}
|
||||
|
||||
return $grouped;
|
||||
}
|
||||
|
||||
private function _getUids($kalender_id)
|
||||
{
|
||||
$kollisionsfreie_user = unserialize(KOLLISIONSFREIE_USER);
|
||||
|
||||
$this->_ci->KalenderModel->addDistinct('mitarbeiter_uid, tbl_kalender_event_teilnehmer.uid');
|
||||
$this->_ci->KalenderModel->addSelect('mitarbeiter_uid, tbl_kalender_event_teilnehmer.uid');
|
||||
$this->_ci->KalenderModel->addJoin('lehre.tbl_kalender_lehreinheit', 'kalender_id', 'LEFT');
|
||||
$this->_ci->KalenderModel->addJoin('lehre.tbl_lehreinheit', 'lehreinheit_id', 'LEFT');
|
||||
$this->_ci->KalenderModel->addJoin('lehre.tbl_lehreinheitmitarbeiter', 'lehreinheit_id', 'LEFT');
|
||||
$this->_ci->KalenderModel->addJoin('lehre.tbl_kalender_event', 'kalender_id', 'LEFT');
|
||||
$this->_ci->KalenderModel->addJoin('lehre.tbl_kalender_event_teilnehmer', 'tbl_kalender_event.kalender_id = tbl_kalender_event_teilnehmer.kalender_id', 'LEFT');
|
||||
|
||||
$this->_ci->KalenderModel->db->group_start();
|
||||
$this->_ci->KalenderModel->db->where_not_in('mitarbeiter_uid', $kollisionsfreie_user);
|
||||
$this->_ci->KalenderModel->db->or_where('mitarbeiter_uid IS NULL', null, false);
|
||||
$this->_ci->KalenderModel->db->group_end();
|
||||
|
||||
$result = $this->_ci->KalenderModel->loadWhere(array(
|
||||
'tbl_kalender.kalender_id' => $kalender_id
|
||||
));
|
||||
|
||||
if (isError($result) || !hasData($result)) return [];
|
||||
|
||||
$data = getData($result);
|
||||
$mitarbeiter_uids = array_filter(array_column($data, 'mitarbeiter_uid'));
|
||||
$event_teilnehmer = array_filter(array_column($data, 'uid'));
|
||||
|
||||
return array_unique(array_merge($mitarbeiter_uids, $event_teilnehmer));
|
||||
}
|
||||
|
||||
private function _checkLehreinheit($uids, $data)
|
||||
{
|
||||
$kollisionsfreie_user = unserialize(KOLLISIONSFREIE_USER);
|
||||
|
||||
$this->_ci->KalenderModel->addDistinct('mitarbeiter_uid, tbl_kalender.von, tbl_kalender.bis');
|
||||
$this->_ci->KalenderModel->addSelect('mitarbeiter_uid, tbl_kalender.von, tbl_kalender.bis');
|
||||
$this->_ci->KalenderModel->addJoin('lehre.tbl_kalender_lehreinheit', 'kalender_id', 'LEFT');
|
||||
$this->_ci->KalenderModel->addJoin('lehre.tbl_lehreinheit', 'lehreinheit_id', 'LEFT');
|
||||
$this->_ci->KalenderModel->addJoin('lehre.tbl_lehreinheitmitarbeiter', 'lehreinheit_id', 'LEFT');
|
||||
|
||||
$this->_ci->KalenderModel->db->where_in('mitarbeiter_uid', $uids);
|
||||
$this->_ci->KalenderModel->db->where('tbl_kalender.kalender_id !=', $data->kalender_id);
|
||||
$this->_ci->KalenderModel->db->where_not_in('tbl_kalender.status_kurzbz', array('archived', 'deleted', 'to_delete'));
|
||||
$this->_ci->KalenderModel->db->where_not_in('mitarbeiter_uid', $kollisionsfreie_user);
|
||||
$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
|
||||
);
|
||||
|
||||
$result = $this->_ci->KalenderModel->loadWhere(array(
|
||||
'von <' => $data->bis,
|
||||
'bis >' => $data->von,
|
||||
));
|
||||
|
||||
if (isError($result) || !hasData($result)) return [];
|
||||
|
||||
return array_map(function($row)
|
||||
{
|
||||
return [
|
||||
'message' => $this->_ci->phraseslib->t('ui', 'ma_le_kollision') . ': ' . $row->mitarbeiter_uid . ' (' . date('d.m.Y H:i', strtotime($row->von)) . ' - ' . date('d.m.Y H:i', strtotime($row->bis)) . ')',
|
||||
'errorCode' => 'lector_collision',
|
||||
];
|
||||
}, getData($result));
|
||||
}
|
||||
|
||||
private function _checkReservierung($uids, $data)
|
||||
{
|
||||
if ($this->_ci->variablelib->getVar('ignore_reservierung') === 'true') return [];
|
||||
|
||||
$kollisionsfreie_user = unserialize(KOLLISIONSFREIE_USER);
|
||||
|
||||
|
||||
$this->_ci->KalenderModel->addDistinct('tbl_kalender_event_teilnehmer.uid, tbl_kalender.von, tbl_kalender.bis');
|
||||
$this->_ci->KalenderModel->addSelect('tbl_kalender_event_teilnehmer.uid, tbl_kalender.von, tbl_kalender.bis');
|
||||
$this->_ci->KalenderModel->addJoin('lehre.tbl_kalender_event', 'kalender_id', 'LEFT');
|
||||
$this->_ci->KalenderModel->addJoin('lehre.tbl_kalender_event_teilnehmer', 'tbl_kalender_event.kalender_id = tbl_kalender_event_teilnehmer.kalender_id', 'LEFT');
|
||||
|
||||
$this->_ci->KalenderModel->db->where_in('tbl_kalender_event_teilnehmer.uid', $uids);
|
||||
$this->_ci->KalenderModel->db->where('tbl_kalender.kalender_id !=', $data->kalender_id);
|
||||
$this->_ci->KalenderModel->db->where_not_in('tbl_kalender.status_kurzbz', array('archived', 'deleted', 'to_delete'));
|
||||
$this->_ci->KalenderModel->db->where_not_in('uid', $kollisionsfreie_user);
|
||||
$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
|
||||
);
|
||||
$result = $this->_ci->KalenderModel->loadWhere(array(
|
||||
'von <' => $data->bis,
|
||||
'bis >' => $data->von,
|
||||
));
|
||||
|
||||
if (isError($result) || !hasData($result)) return [];
|
||||
|
||||
return array_map(function($row)
|
||||
{
|
||||
return [
|
||||
'message' => $this->_ci->phraseslib->t('ui', 'reservierung_kollision') . ': ' . $row->uid . ' (' . date('d.m.Y H:i', strtotime($row->von)) . ' - ' . date('d.m.Y H:i', strtotime($row->bis)) . ')',
|
||||
'errorCode' => 'reservation_collision',
|
||||
];
|
||||
}, getData($result));
|
||||
}
|
||||
|
||||
private function _checkZeitsperre($uids, $data)
|
||||
{
|
||||
if ($this->_ci->variablelib->getVar('ignore_zeitsperre') === 'true') return [];
|
||||
|
||||
$this->_ci->ZeitsperreModel->addSelect('mitarbeiter_uid, vondatum, vonstunde_z.beginn as von_beginn, bisdatum, bisstunde_z.ende as bis_ende');
|
||||
$this->_ci->ZeitsperreModel->addJoin('lehre.tbl_stunde vonstunde_z', 'vonstunde_z.stunde = tbl_zeitsperre.vonstunde', 'LEFT');
|
||||
$this->_ci->ZeitsperreModel->addJoin('lehre.tbl_stunde bisstunde_z', 'bisstunde_z.stunde = tbl_zeitsperre.bisstunde', 'LEFT');
|
||||
$this->_ci->ZeitsperreModel->db->where('zeitsperretyp_kurzbz !=', 'ZVerfueg');
|
||||
$this->_ci->ZeitsperreModel->db->where('(tbl_zeitsperre.vondatum + COALESCE(vonstunde_z.beginn, \'00:00\'))::timestamp <', $data->bis);
|
||||
$this->_ci->ZeitsperreModel->db->where('(tbl_zeitsperre.bisdatum + COALESCE(bisstunde_z.ende, \'23:59\'))::timestamp >', $data->von);
|
||||
|
||||
$this->_ci->ZeitsperreModel->db->where_in('mitarbeiter_uid', $uids);
|
||||
$result = $this->_ci->ZeitsperreModel->load();
|
||||
|
||||
if (isError($result) || !hasData($result)) return [];
|
||||
|
||||
return array_map(function($row)
|
||||
{
|
||||
return [
|
||||
'message' => $this->_ci->phraseslib->t('ui', 'ma_zeitsperre_kollision') . ': ' . $row->mitarbeiter_uid . ' (' . date('d.m.Y H:i', strtotime($row->vondatum . ' ' . $row->von_beginn)) . ' - ' . date('d.m.Y H:i', strtotime($row->bisdatum . ' ' . $row->bis_ende)) . ')',
|
||||
'errorCode' => 'absences_collision',
|
||||
];
|
||||
}, getData($result));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
<?php
|
||||
|
||||
class ResourcesCollisionCheck implements ICollisionCheck
|
||||
{
|
||||
|
||||
private $_ci;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->_ci =& get_instance();
|
||||
$this->_ci->load->model('ressource/Kalender_model', 'KalenderModel');
|
||||
$this->_ci->load->library('VariableLib', array('uid' => getAuthUID()));
|
||||
$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;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,80 @@
|
||||
<?php
|
||||
|
||||
class RoomCollisionCheck implements ICollisionCheck
|
||||
{
|
||||
|
||||
private $_ci;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->_ci =& get_instance();
|
||||
$this->_ci->load->model('ressource/Kalender_model', 'KalenderModel');
|
||||
$this->_ci->load->library('VariableLib', array('uid' => getAuthUID()));
|
||||
$this->_ci->load->library('PhrasesLib', array('ui'));
|
||||
}
|
||||
|
||||
public function getName()
|
||||
{
|
||||
return 'room';
|
||||
}
|
||||
|
||||
public function check($data)
|
||||
{
|
||||
if (!isset($data->ort_kurzbz, $data->von, $data->bis, $data->kalender_id)) return [];
|
||||
|
||||
if ($this->_ci->variablelib->getVar('ignore_kollision') === 'true') return [];
|
||||
|
||||
$this->_ci->KalenderModel->addSelect('kalender_id, ort_kurzbz, von, bis');
|
||||
$this->_ci->KalenderModel->addJoin('lehre.tbl_kalender_ort', 'kalender_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']);
|
||||
|
||||
$result = $this->_ci->KalenderModel->loadWhere(array(
|
||||
'von <' => $data->bis,
|
||||
'bis >' => $data->von,
|
||||
'ort_kurzbz' => $data->ort_kurzbz,
|
||||
));
|
||||
|
||||
if (isError($result)) return [];
|
||||
if (!hasData($result)) return [];
|
||||
|
||||
return array_map(function($row)
|
||||
{
|
||||
return [
|
||||
'errorCode' => 'room_collision',
|
||||
'message' => $this->_ci->phraseslib->t('ui', 'raum_kollision') . ': ' . $row->ort_kurzbz . ' (' . 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_kalender_ort current_ort', 'current_ort.kalender_id = tbl_kalender.kalender_id');
|
||||
$this->_ci->KalenderModel->addJoin('lehre.tbl_kalender_ort other_ort', 'other_ort.ort_kurzbz = current_ort.ort_kurzbz');
|
||||
$this->_ci->KalenderModel->addJoin('lehre.tbl_kalender other_kalender', 'other_kalender.kalender_id = other_ort.kalender_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;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,247 @@
|
||||
<?php
|
||||
|
||||
class StudentCollisionCheck implements ICollisionCheck
|
||||
{
|
||||
private $_ci;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->_ci =& get_instance();
|
||||
$this->_ci->load->model('ressource/Kalender_model', 'KalenderModel');
|
||||
$this->_ci->load->library('VariableLib', array('uid' => getAuthUID()));
|
||||
$this->_ci->load->library('PhrasesLib', array('ui'));
|
||||
}
|
||||
|
||||
public function getName()
|
||||
{
|
||||
return 'student';
|
||||
}
|
||||
|
||||
public function check($data)
|
||||
{
|
||||
if (!isset($data->von, $data->bis, $data->kalender_id)) return [];
|
||||
|
||||
if ($this->_ci->variablelib->getVar('ignore_kollision') === 'true') return [];
|
||||
if ($this->_ci->variablelib->getVar('kollision_student') !== 'true') return [];
|
||||
|
||||
$kollisionsfreie_user = unserialize(KOLLISIONSFREIE_USER);
|
||||
$placeholders = implode(',', array_fill(0, count($kollisionsfreie_user), '?'));
|
||||
|
||||
|
||||
$dbModel = new DB_Model();
|
||||
|
||||
$qry1 = "
|
||||
SELECT DISTINCT tbl_benutzergruppe.uid
|
||||
FROM lehre.tbl_kalender
|
||||
JOIN lehre.tbl_kalender_lehreinheit USING(kalender_id)
|
||||
JOIN lehre.tbl_lehreinheit ON tbl_lehreinheit.lehreinheit_id = tbl_kalender_lehreinheit.lehreinheit_id
|
||||
JOIN lehre.tbl_lehreinheitgruppe ON tbl_lehreinheitgruppe.lehreinheit_id = tbl_lehreinheit.lehreinheit_id
|
||||
JOIN public.tbl_gruppe
|
||||
ON tbl_gruppe.studiengang_kz = tbl_lehreinheitgruppe.studiengang_kz
|
||||
AND tbl_gruppe.semester = tbl_lehreinheitgruppe.semester
|
||||
AND tbl_gruppe.gruppe_kurzbz = tbl_lehreinheitgruppe.gruppe_kurzbz
|
||||
JOIN public.tbl_benutzergruppe ON tbl_benutzergruppe.gruppe_kurzbz = tbl_gruppe.gruppe_kurzbz
|
||||
AND tbl_benutzergruppe.studiensemester_kurzbz = tbl_lehreinheit.studiensemester_kurzbz
|
||||
|
||||
WHERE tbl_kalender.kalender_id = ?
|
||||
AND tbl_benutzergruppe.uid NOT IN ($placeholders)
|
||||
UNION ALL
|
||||
|
||||
SELECT DISTINCT tbl_studentlehrverband.student_uid AS uid
|
||||
FROM lehre.tbl_kalender
|
||||
JOIN lehre.tbl_kalender_lehreinheit USING(kalender_id)
|
||||
JOIN lehre.tbl_lehreinheit ON tbl_lehreinheit.lehreinheit_id = tbl_kalender_lehreinheit.lehreinheit_id
|
||||
JOIN lehre.tbl_lehreinheitgruppe ON tbl_lehreinheitgruppe.lehreinheit_id = tbl_lehreinheit.lehreinheit_id
|
||||
JOIN public.tbl_studentlehrverband
|
||||
ON tbl_studentlehrverband.studiengang_kz = tbl_lehreinheitgruppe.studiengang_kz
|
||||
AND tbl_studentlehrverband.semester = tbl_lehreinheitgruppe.semester
|
||||
AND tbl_studentlehrverband.studiensemester_kurzbz = tbl_lehreinheit.studiensemester_kurzbz
|
||||
AND (tbl_lehreinheitgruppe.verband = tbl_studentlehrverband.verband OR tbl_lehreinheitgruppe.verband IS NULL OR btrim(tbl_lehreinheitgruppe.verband::text) = '' OR tbl_studentlehrverband.verband IS NULL)
|
||||
AND (tbl_lehreinheitgruppe.gruppe = tbl_studentlehrverband.gruppe OR tbl_lehreinheitgruppe.gruppe IS NULL OR btrim(tbl_lehreinheitgruppe.gruppe::text) = '' OR tbl_studentlehrverband.gruppe IS NULL)
|
||||
WHERE tbl_kalender.kalender_id = ?
|
||||
AND tbl_studentlehrverband.student_uid NOT IN ($placeholders)
|
||||
|
||||
";
|
||||
|
||||
$result1 = $dbModel->execReadOnlyQuery($qry1, array_merge(
|
||||
[$data->kalender_id],
|
||||
$kollisionsfreie_user,
|
||||
[$data->kalender_id],
|
||||
$kollisionsfreie_user
|
||||
));
|
||||
|
||||
if (isError($result1) || !hasData($result1)) return [];
|
||||
|
||||
$curUids = array_flip(array_column(getData($result1), 'uid'));
|
||||
|
||||
$qry2 = "
|
||||
SELECT DISTINCT tbl_kalender.kalender_id, tbl_kalender.von, tbl_kalender.bis, tbl_benutzergruppe.uid
|
||||
FROM lehre.tbl_kalender
|
||||
JOIN lehre.tbl_kalender_lehreinheit ON tbl_kalender_lehreinheit.kalender_id = tbl_kalender.kalender_id
|
||||
JOIN lehre.tbl_lehreinheit ON tbl_lehreinheit.lehreinheit_id = tbl_kalender_lehreinheit.lehreinheit_id
|
||||
JOIN lehre.tbl_lehreinheitgruppe ON tbl_lehreinheitgruppe.lehreinheit_id = tbl_lehreinheit.lehreinheit_id
|
||||
JOIN public.tbl_gruppe
|
||||
ON tbl_gruppe.studiengang_kz = tbl_lehreinheitgruppe.studiengang_kz
|
||||
AND tbl_gruppe.semester = tbl_lehreinheitgruppe.semester
|
||||
AND tbl_gruppe.gruppe_kurzbz = tbl_lehreinheitgruppe.gruppe_kurzbz
|
||||
JOIN public.tbl_benutzergruppe ON tbl_benutzergruppe.gruppe_kurzbz = tbl_gruppe.gruppe_kurzbz
|
||||
AND tbl_benutzergruppe.studiensemester_kurzbz = tbl_lehreinheit.studiensemester_kurzbz
|
||||
WHERE tbl_kalender.von < ?
|
||||
AND tbl_kalender.bis > ?
|
||||
AND tbl_kalender.kalender_id != ?
|
||||
AND tbl_kalender.status_kurzbz NOT IN ('archived', 'deleted', 'to_delete')
|
||||
AND tbl_benutzergruppe.uid NOT IN ($placeholders)
|
||||
AND NOT EXISTS (
|
||||
SELECT 1 FROM lehre.tbl_kalender vorgaenger
|
||||
WHERE vorgaenger.vorgaenger_kalender_id = tbl_kalender.kalender_id
|
||||
)
|
||||
|
||||
UNION ALL
|
||||
|
||||
SELECT DISTINCT tbl_kalender.kalender_id, tbl_kalender.von, tbl_kalender.bis, tbl_studentlehrverband.student_uid AS uid
|
||||
FROM lehre.tbl_kalender
|
||||
JOIN lehre.tbl_kalender_lehreinheit ON tbl_kalender_lehreinheit.kalender_id = tbl_kalender.kalender_id
|
||||
JOIN lehre.tbl_lehreinheit ON tbl_lehreinheit.lehreinheit_id = tbl_kalender_lehreinheit.lehreinheit_id
|
||||
JOIN lehre.tbl_lehreinheitgruppe ON tbl_lehreinheitgruppe.lehreinheit_id = tbl_lehreinheit.lehreinheit_id
|
||||
JOIN public.tbl_studentlehrverband
|
||||
ON tbl_studentlehrverband.studiengang_kz = tbl_lehreinheitgruppe.studiengang_kz
|
||||
AND tbl_studentlehrverband.semester = tbl_lehreinheitgruppe.semester
|
||||
AND tbl_studentlehrverband.studiensemester_kurzbz = tbl_lehreinheit.studiensemester_kurzbz
|
||||
AND (tbl_lehreinheitgruppe.verband = tbl_studentlehrverband.verband OR tbl_lehreinheitgruppe.verband IS NULL OR btrim(tbl_lehreinheitgruppe.verband::text) = '' OR tbl_studentlehrverband.verband IS NULL)
|
||||
AND (tbl_lehreinheitgruppe.gruppe = tbl_studentlehrverband.gruppe OR tbl_lehreinheitgruppe.gruppe IS NULL OR btrim(tbl_lehreinheitgruppe.gruppe::text) = '' OR tbl_studentlehrverband.gruppe IS NULL)
|
||||
WHERE tbl_kalender.von < ?
|
||||
AND tbl_kalender.bis > ?
|
||||
AND tbl_kalender.kalender_id != ?
|
||||
AND tbl_kalender.status_kurzbz NOT IN ('archived', 'deleted', 'to_delete')
|
||||
AND tbl_studentlehrverband.student_uid NOT IN ($placeholders)
|
||||
AND NOT EXISTS (
|
||||
SELECT 1 FROM lehre.tbl_kalender vorgaenger
|
||||
WHERE vorgaenger.vorgaenger_kalender_id = tbl_kalender.kalender_id
|
||||
)
|
||||
";
|
||||
|
||||
$result2 = $dbModel->execReadOnlyQuery($qry2, array_merge(
|
||||
[$data->bis, $data->von, $data->kalender_id],
|
||||
$kollisionsfreie_user,
|
||||
[$data->bis, $data->von, $data->kalender_id],
|
||||
$kollisionsfreie_user
|
||||
));
|
||||
|
||||
if (isError($result2) || !hasData($result2)) return [];
|
||||
|
||||
$conflicts = [];
|
||||
foreach (getData($result2) as $row)
|
||||
{
|
||||
if (isset($curUids[$row->uid]))
|
||||
{
|
||||
$conflicts[] = [
|
||||
'message' =>
|
||||
$this->_ci->phraseslib->t('ui', 'student_kollision')
|
||||
. ': ' . $row->uid
|
||||
. ' (' . date('d.m.Y H:i', strtotime($row->von))
|
||||
. ' - ' . date('d.m.Y H:i', strtotime($row->bis)) . ')',
|
||||
'errorCode' => 'student_collision'
|
||||
];
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
return $conflicts;
|
||||
}
|
||||
|
||||
public function checkAll($kalender_ids)
|
||||
{
|
||||
|
||||
if (empty($kalender_ids)) return [];
|
||||
|
||||
if ($this->_ci->variablelib->getVar('kollision_student') !== 'true') return [];
|
||||
|
||||
$dbModel = new DB_Model();
|
||||
$placeholders = implode(',', array_fill(0, count($kalender_ids), '?'));
|
||||
|
||||
$sql = "
|
||||
SELECT DISTINCT current_kalender.kalender_id, current_benutzergruppe.uid
|
||||
FROM lehre.tbl_kalender current_kalender
|
||||
JOIN lehre.tbl_kalender_lehreinheit current_kalender_le ON current_kalender_le.kalender_id = current_kalender.kalender_id
|
||||
JOIN lehre.tbl_lehreinheit current_lehreinheit ON current_lehreinheit.lehreinheit_id = current_kalender_le.lehreinheit_id
|
||||
JOIN lehre.tbl_lehreinheitgruppe current_lehreinheitgruppe ON current_lehreinheitgruppe.lehreinheit_id = current_lehreinheit.lehreinheit_id
|
||||
JOIN public.tbl_gruppe current_gruppe
|
||||
ON current_gruppe.studiengang_kz = current_lehreinheitgruppe.studiengang_kz
|
||||
AND current_gruppe.semester = current_lehreinheitgruppe.semester
|
||||
AND current_gruppe.gruppe_kurzbz = current_lehreinheitgruppe.gruppe_kurzbz
|
||||
JOIN public.tbl_benutzergruppe current_benutzergruppe ON current_benutzergruppe.gruppe_kurzbz = current_gruppe.gruppe_kurzbz
|
||||
AND current_benutzergruppe.studiensemester_kurzbz = current_lehreinheit.studiensemester_kurzbz
|
||||
JOIN lehre.tbl_kalender other_kalender
|
||||
ON other_kalender.kalender_id != current_kalender.kalender_id
|
||||
AND other_kalender.von < current_kalender.bis
|
||||
AND other_kalender.bis > current_kalender.von
|
||||
AND other_kalender.status_kurzbz NOT IN ('archived', 'deleted', 'to_delete')
|
||||
AND NOT EXISTS (
|
||||
SELECT 1 FROM lehre.tbl_kalender vorgaenger
|
||||
WHERE vorgaenger.vorgaenger_kalender_id = other_kalender.kalender_id
|
||||
)
|
||||
JOIN lehre.tbl_kalender_lehreinheit other_kalender_le ON other_kalender_le.kalender_id = other_kalender.kalender_id
|
||||
JOIN lehre.tbl_lehreinheit other_lehreinheit ON other_lehreinheit.lehreinheit_id = other_kalender_le.lehreinheit_id
|
||||
JOIN lehre.tbl_lehreinheitgruppe other_lehreinheitgruppe ON other_lehreinheitgruppe.lehreinheit_id = other_lehreinheit.lehreinheit_id
|
||||
JOIN public.tbl_gruppe other_gruppe
|
||||
ON other_gruppe.studiengang_kz = other_lehreinheitgruppe.studiengang_kz
|
||||
AND other_gruppe.semester = other_lehreinheitgruppe.semester
|
||||
AND other_gruppe.gruppe_kurzbz = other_lehreinheitgruppe.gruppe_kurzbz
|
||||
JOIN public.tbl_benutzergruppe other_benutzergruppe
|
||||
ON other_benutzergruppe.gruppe_kurzbz = other_gruppe.gruppe_kurzbz
|
||||
AND other_benutzergruppe.uid = current_benutzergruppe.uid
|
||||
AND other_benutzergruppe.studiensemester_kurzbz = other_lehreinheit.studiensemester_kurzbz
|
||||
|
||||
|
||||
WHERE current_kalender.kalender_id IN ($placeholders)
|
||||
|
||||
UNION ALL
|
||||
|
||||
SELECT DISTINCT current_kalender.kalender_id, current_studentlehrverband.student_uid AS uid
|
||||
FROM lehre.tbl_kalender current_kalender
|
||||
JOIN lehre.tbl_kalender_lehreinheit current_kalender_le ON current_kalender_le.kalender_id = current_kalender.kalender_id
|
||||
JOIN lehre.tbl_lehreinheit current_lehreinheit ON current_lehreinheit.lehreinheit_id = current_kalender_le.lehreinheit_id
|
||||
JOIN lehre.tbl_lehreinheitgruppe current_lehreinheitgruppe ON current_lehreinheitgruppe.lehreinheit_id = current_lehreinheit.lehreinheit_id
|
||||
JOIN public.tbl_studentlehrverband current_studentlehrverband
|
||||
ON current_studentlehrverband.studiengang_kz = current_lehreinheitgruppe.studiengang_kz
|
||||
AND current_studentlehrverband.semester = current_lehreinheitgruppe.semester
|
||||
AND current_studentlehrverband.studiensemester_kurzbz = current_lehreinheit.studiensemester_kurzbz
|
||||
AND (current_lehreinheitgruppe.verband = current_studentlehrverband.verband OR current_lehreinheitgruppe.verband IS NULL OR btrim(current_lehreinheitgruppe.verband::text) = '' OR current_studentlehrverband.verband IS NULL)
|
||||
AND (current_lehreinheitgruppe.gruppe = current_studentlehrverband.gruppe OR current_lehreinheitgruppe.gruppe IS NULL OR btrim(current_lehreinheitgruppe.gruppe::text) = '' OR current_studentlehrverband.gruppe IS NULL)
|
||||
|
||||
JOIN lehre.tbl_kalender other_kalender
|
||||
ON other_kalender.kalender_id != current_kalender.kalender_id
|
||||
AND other_kalender.von < current_kalender.bis
|
||||
AND other_kalender.bis > current_kalender.von
|
||||
AND other_kalender.status_kurzbz NOT IN ('archived', 'deleted', 'to_delete')
|
||||
AND NOT EXISTS (
|
||||
SELECT 1 FROM lehre.tbl_kalender vorgaenger
|
||||
WHERE vorgaenger.vorgaenger_kalender_id = other_kalender.kalender_id
|
||||
)
|
||||
JOIN lehre.tbl_kalender_lehreinheit other_kalender_le ON other_kalender_le.kalender_id = other_kalender.kalender_id
|
||||
JOIN lehre.tbl_lehreinheit other_lehreinheit ON other_lehreinheit.lehreinheit_id = other_kalender_le.lehreinheit_id
|
||||
JOIN lehre.tbl_lehreinheitgruppe other_lehreinheitgruppe ON other_lehreinheitgruppe.lehreinheit_id = other_lehreinheit.lehreinheit_id
|
||||
JOIN public.tbl_studentlehrverband other_slv
|
||||
ON other_slv.studiengang_kz = other_lehreinheitgruppe.studiengang_kz
|
||||
AND other_slv.semester = other_lehreinheitgruppe.semester
|
||||
AND other_slv.studiensemester_kurzbz = other_lehreinheit.studiensemester_kurzbz
|
||||
AND other_slv.student_uid = current_studentlehrverband.student_uid
|
||||
AND (other_lehreinheitgruppe.verband = other_slv.verband OR other_lehreinheitgruppe.verband IS NULL OR btrim(other_lehreinheitgruppe.verband::text) = '' OR other_slv.verband IS NULL)
|
||||
AND (other_lehreinheitgruppe.gruppe = other_slv.gruppe OR other_lehreinheitgruppe.gruppe IS NULL OR btrim(other_lehreinheitgruppe.gruppe::text) = '' OR other_slv.gruppe IS NULL)
|
||||
|
||||
WHERE current_kalender.kalender_id IN ($placeholders)
|
||||
";
|
||||
|
||||
$result = $dbModel->execReadOnlyQuery($sql, array_merge($kalender_ids, $kalender_ids));
|
||||
|
||||
if (isError($result) || !hasData($result)) return [];
|
||||
|
||||
$grouped = [];
|
||||
foreach (getData($result) as $row)
|
||||
{
|
||||
$grouped[$row->kalender_id][] = true;
|
||||
}
|
||||
|
||||
return $grouped;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,362 @@
|
||||
<?php
|
||||
|
||||
class VerbandCollisionCheck implements ICollisionCheck
|
||||
{
|
||||
|
||||
private $_ci;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->_ci =& get_instance();
|
||||
$this->_ci->load->model('ressource/Kalender_model', 'KalenderModel');
|
||||
$this->_ci->load->library('VariableLib', array('uid' => getAuthUID()));
|
||||
$this->_ci->load->library('PhrasesLib', array('ui'));
|
||||
|
||||
}
|
||||
|
||||
public function getName()
|
||||
{
|
||||
return 'verband';
|
||||
}
|
||||
|
||||
public function check($data)
|
||||
{
|
||||
if (!isset($data->von, $data->bis, $data->kalender_id)) return [];
|
||||
|
||||
if ($this->_ci->variablelib->getVar('ignore_kollision') === 'true') return [];
|
||||
|
||||
$kollision_student = $this->_ci->variablelib->getVar('kollision_student') === 'false';
|
||||
$kollision_reservierung = $this->_ci->variablelib->getVar('ignore_reservierung') === 'false';
|
||||
|
||||
if (!$kollision_student && !$kollision_reservierung) return [];
|
||||
|
||||
$dbModel = new DB_Model();
|
||||
$collisions = [];
|
||||
|
||||
if ($kollision_student)
|
||||
{
|
||||
$union_event = "";
|
||||
|
||||
if ($kollision_reservierung)
|
||||
{
|
||||
$union_event = "
|
||||
UNION
|
||||
SELECT tbl_kalender_event_teilnehmer.studiengang_kz, tbl_kalender_event_teilnehmer.semester, tbl_kalender_event_teilnehmer.verband, tbl_kalender_event_teilnehmer.gruppe, tbl_kalender_event_teilnehmer.gruppe_kurzbz, tbl_kalender_event_teilnehmer.kalender_id
|
||||
FROM lehre.tbl_kalender_event_teilnehmer
|
||||
WHERE tbl_kalender_event_teilnehmer.rolle_kurzbz = 'teilnehmer'
|
||||
";
|
||||
}
|
||||
|
||||
$sql_gruppen = "
|
||||
SELECT
|
||||
other_kalender.von,
|
||||
other_kalender.bis,
|
||||
COALESCE(
|
||||
other_lehreinheitguppe.gruppe_kurzbz,
|
||||
UPPER(stg.typ::text || stg.kurzbz::text) || '-' || other_lehreinheitguppe.semester ||
|
||||
COALESCE(other_lehreinheitguppe.verband::text, '') ||
|
||||
COALESCE(other_lehreinheitguppe.gruppe::text, '')
|
||||
) AS gruppenname
|
||||
FROM lehre.tbl_kalender current_kalender
|
||||
|
||||
JOIN (
|
||||
SELECT tbl_lehreinheitgruppe.studiengang_kz, tbl_lehreinheitgruppe.semester, tbl_lehreinheitgruppe.verband, tbl_lehreinheitgruppe.gruppe,
|
||||
tbl_lehreinheitgruppe.gruppe_kurzbz, tbl_kalender_lehreinheit.kalender_id
|
||||
FROM lehre.tbl_kalender_lehreinheit
|
||||
JOIN lehre.tbl_lehreinheit ON tbl_lehreinheit.lehreinheit_id = tbl_kalender_lehreinheit.lehreinheit_id
|
||||
JOIN lehre.tbl_lehreinheitgruppe ON tbl_lehreinheitgruppe.lehreinheit_id = tbl_lehreinheit.lehreinheit_id
|
||||
". $union_event ."
|
||||
) current_lehreinheitguppe ON current_lehreinheitguppe.kalender_id = current_kalender.kalender_id
|
||||
|
||||
LEFT JOIN public.tbl_gruppe current_gruppe
|
||||
ON current_gruppe.gruppe_kurzbz = current_lehreinheitguppe.gruppe_kurzbz
|
||||
|
||||
JOIN lehre.tbl_kalender other_kalender
|
||||
ON other_kalender.kalender_id != current_kalender.kalender_id
|
||||
AND other_kalender.von < ?
|
||||
AND other_kalender.bis > ?
|
||||
|
||||
JOIN (
|
||||
SELECT tbl_lehreinheitgruppe.studiengang_kz, tbl_lehreinheitgruppe.semester, tbl_lehreinheitgruppe.verband, tbl_lehreinheitgruppe.gruppe,
|
||||
tbl_lehreinheitgruppe.gruppe_kurzbz, tbl_kalender_lehreinheit.kalender_id
|
||||
FROM lehre.tbl_kalender_lehreinheit
|
||||
JOIN lehre.tbl_lehreinheit ON tbl_lehreinheit.lehreinheit_id = tbl_kalender_lehreinheit.lehreinheit_id
|
||||
JOIN lehre.tbl_lehreinheitgruppe ON tbl_lehreinheitgruppe.lehreinheit_id = tbl_lehreinheit.lehreinheit_id
|
||||
". $union_event ."
|
||||
) other_lehreinheitguppe ON other_lehreinheitguppe.kalender_id = other_kalender.kalender_id
|
||||
|
||||
LEFT JOIN public.tbl_gruppe other_gruppe
|
||||
ON other_gruppe.gruppe_kurzbz = other_lehreinheitguppe.gruppe_kurzbz
|
||||
|
||||
LEFT JOIN public.tbl_studiengang stg
|
||||
ON stg.studiengang_kz = other_lehreinheitguppe.studiengang_kz
|
||||
|
||||
WHERE current_kalender.kalender_id = ?
|
||||
AND other_kalender.status_kurzbz NOT IN ('archived', 'deleted', 'to_delete')
|
||||
AND current_lehreinheitguppe.studiengang_kz = other_lehreinheitguppe.studiengang_kz
|
||||
AND current_lehreinheitguppe.semester = other_lehreinheitguppe.semester
|
||||
AND (
|
||||
(
|
||||
current_lehreinheitguppe.gruppe_kurzbz IS NULL
|
||||
AND other_lehreinheitguppe.gruppe_kurzbz IS NULL
|
||||
AND (
|
||||
current_lehreinheitguppe.verband IS NULL
|
||||
OR (
|
||||
current_lehreinheitguppe.verband = other_lehreinheitguppe.verband
|
||||
AND (current_lehreinheitguppe.gruppe IS NULL OR other_lehreinheitguppe.gruppe IS NULL OR current_lehreinheitguppe.gruppe = other_lehreinheitguppe.gruppe)
|
||||
)
|
||||
)
|
||||
)
|
||||
OR
|
||||
(
|
||||
current_lehreinheitguppe.gruppe_kurzbz IS NOT NULL
|
||||
AND other_lehreinheitguppe.gruppe_kurzbz IS NOT NULL
|
||||
AND current_gruppe.direktinskription IS NOT TRUE
|
||||
AND other_gruppe.direktinskription IS NOT TRUE
|
||||
)
|
||||
OR
|
||||
(
|
||||
(
|
||||
current_lehreinheitguppe.gruppe_kurzbz IS NULL
|
||||
AND other_lehreinheitguppe.gruppe_kurzbz IS NOT NULL
|
||||
AND other_gruppe.direktinskription IS NOT TRUE
|
||||
)
|
||||
OR
|
||||
(
|
||||
current_lehreinheitguppe.gruppe_kurzbz IS NOT NULL
|
||||
AND other_lehreinheitguppe.gruppe_kurzbz IS NULL
|
||||
AND current_gruppe.direktinskription IS NOT TRUE
|
||||
)
|
||||
)
|
||||
)
|
||||
AND other_kalender.kalender_id NOT IN (
|
||||
SELECT vorgaenger_kalender_id
|
||||
FROM lehre.tbl_kalender
|
||||
WHERE vorgaenger_kalender_id IS NOT NULL
|
||||
)
|
||||
";
|
||||
|
||||
$result = $dbModel->execReadOnlyQuery($sql_gruppen, [
|
||||
$data->bis,
|
||||
$data->von,
|
||||
$data->kalender_id,
|
||||
]);
|
||||
|
||||
if (!isError($result) && hasData($result))
|
||||
{
|
||||
foreach (getData($result) as $row)
|
||||
{
|
||||
$collisions[] = [
|
||||
'message' => $this->_ci->phraseslib->t('ui', 'verband_kollision') . ': ' . $row->gruppenname . ' (' . date('d.m.Y H:i', strtotime($row->von)) . ' - ' . date('d.m.Y H:i', strtotime($row->bis)) . ')',
|
||||
'errorCode' => 'verband_collision',
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if ($kollision_reservierung && !$kollision_student)
|
||||
{
|
||||
$sql_reservierung = "
|
||||
SELECT
|
||||
other_kalender.von,
|
||||
other_kalender.bis,
|
||||
COALESCE(
|
||||
other_event_teilnehmer.gruppe_kurzbz,
|
||||
UPPER(stg.typ::text || stg.kurzbz::text) || '-' || other_event_teilnehmer.semester ||
|
||||
COALESCE(other_event_teilnehmer.verband::text, '') ||
|
||||
COALESCE(other_event_teilnehmer.gruppe::text, '')
|
||||
) AS gruppenname
|
||||
FROM lehre.tbl_kalender_event_teilnehmer current_event_teilnehmer
|
||||
LEFT JOIN public.tbl_gruppe current_gruppe
|
||||
ON current_gruppe.gruppe_kurzbz = current_event_teilnehmer.gruppe_kurzbz
|
||||
|
||||
JOIN lehre.tbl_kalender other_kalender
|
||||
ON other_kalender.kalender_id != ?
|
||||
AND other_kalender.von < ?
|
||||
AND other_kalender.bis > ?
|
||||
|
||||
JOIN lehre.tbl_kalender_event_teilnehmer other_event_teilnehmer
|
||||
ON other_event_teilnehmer.kalender_id = other_kalender.kalender_id
|
||||
AND other_event_teilnehmer.rolle_kurzbz = 'teilnehmer'
|
||||
|
||||
LEFT JOIN public.tbl_gruppe other_gruppe
|
||||
ON other_gruppe.gruppe_kurzbz = other_event_teilnehmer.gruppe_kurzbz
|
||||
|
||||
LEFT JOIN public.tbl_studiengang stg
|
||||
ON stg.studiengang_kz = other_event_teilnehmer.studiengang_kz
|
||||
|
||||
WHERE current_event_teilnehmer.kalender_id = ?
|
||||
AND current_event_teilnehmer.rolle_kurzbz = 'teilnehmer'
|
||||
AND other_kalender.status_kurzbz NOT IN ('archived', 'deleted', 'to_delete')
|
||||
AND current_event_teilnehmer.studiengang_kz = other_event_teilnehmer.studiengang_kz
|
||||
AND current_event_teilnehmer.semester = other_event_teilnehmer.semester
|
||||
AND (
|
||||
(
|
||||
current_event_teilnehmer.gruppe_kurzbz IS NULL
|
||||
AND other_event_teilnehmer.gruppe_kurzbz IS NULL
|
||||
AND (
|
||||
current_event_teilnehmer.verband IS NULL
|
||||
OR (
|
||||
current_event_teilnehmer.verband = other_event_teilnehmer.verband
|
||||
AND (current_event_teilnehmer.gruppe IS NULL OR other_event_teilnehmer.gruppe IS NULL OR current_event_teilnehmer.gruppe = other_event_teilnehmer.gruppe)
|
||||
)
|
||||
)
|
||||
)
|
||||
OR
|
||||
(
|
||||
current_event_teilnehmer.gruppe_kurzbz IS NOT NULL
|
||||
AND other_event_teilnehmer.gruppe_kurzbz IS NOT NULL
|
||||
AND current_gruppe.direktinskription IS NOT TRUE
|
||||
AND other_gruppe.direktinskription IS NOT TRUE
|
||||
)
|
||||
OR
|
||||
(
|
||||
(
|
||||
current_event_teilnehmer.gruppe_kurzbz IS NULL
|
||||
AND other_event_teilnehmer.gruppe_kurzbz IS NOT NULL
|
||||
AND other_gruppe.direktinskription IS NOT TRUE
|
||||
)
|
||||
OR
|
||||
(
|
||||
current_event_teilnehmer.gruppe_kurzbz IS NOT NULL
|
||||
AND other_event_teilnehmer.gruppe_kurzbz IS NULL
|
||||
AND current_gruppe.direktinskription IS NOT TRUE
|
||||
)
|
||||
)
|
||||
)
|
||||
AND other_kalender.kalender_id NOT IN (
|
||||
SELECT vorgaenger_kalender_id
|
||||
FROM lehre.tbl_kalender
|
||||
WHERE vorgaenger_kalender_id IS NOT NULL
|
||||
)
|
||||
";
|
||||
|
||||
$result = $dbModel->execReadOnlyQuery($sql_reservierung, [
|
||||
$data->kalender_id,
|
||||
$data->bis,
|
||||
$data->von,
|
||||
$data->kalender_id,
|
||||
]);
|
||||
|
||||
if (!isError($result) && hasData($result))
|
||||
{
|
||||
foreach (getData($result) as $row)
|
||||
{
|
||||
$collisions[] = [
|
||||
'errorCode' => 'reservation_collision',
|
||||
'message' => $this->_ci->phraseslib->t('ui', 'reservierung_kollision') . ': ' . $row->gruppenname . ' (' . date('d.m.Y H:i', strtotime($row->von)) . ' - ' . date('d.m.Y H:i', strtotime($row->bis)) . ')'
|
||||
];
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $collisions;
|
||||
}
|
||||
|
||||
public function checkAll($kalender_ids)
|
||||
{
|
||||
if (empty($kalender_ids)) return [];
|
||||
|
||||
$dbModel = new DB_Model();
|
||||
|
||||
$placeholders = implode(',', array_fill(0, count($kalender_ids), '?'));
|
||||
|
||||
$sql = "
|
||||
SELECT DISTINCT ON (current_kalender.kalender_id) current_kalender.kalender_id
|
||||
FROM lehre.tbl_kalender current_kalender
|
||||
|
||||
JOIN (
|
||||
SELECT tbl_lehreinheitgruppe.studiengang_kz, tbl_lehreinheitgruppe.semester, tbl_lehreinheitgruppe.verband, tbl_lehreinheitgruppe.gruppe,
|
||||
tbl_lehreinheitgruppe.gruppe_kurzbz, tbl_kalender_lehreinheit.kalender_id
|
||||
FROM lehre.tbl_kalender_lehreinheit
|
||||
JOIN lehre.tbl_lehreinheit ON tbl_lehreinheit.lehreinheit_id = tbl_kalender_lehreinheit.lehreinheit_id
|
||||
JOIN lehre.tbl_lehreinheitgruppe ON tbl_lehreinheitgruppe.lehreinheit_id = tbl_lehreinheit.lehreinheit_id
|
||||
UNION
|
||||
SELECT tbl_kalender_event_teilnehmer.studiengang_kz, tbl_kalender_event_teilnehmer.semester, tbl_kalender_event_teilnehmer.verband, tbl_kalender_event_teilnehmer.gruppe,
|
||||
tbl_kalender_event_teilnehmer.gruppe_kurzbz, tbl_kalender_event_teilnehmer.kalender_id
|
||||
FROM lehre.tbl_kalender_event_teilnehmer
|
||||
) current_lehreinheitguppe ON current_lehreinheitguppe.kalender_id = current_kalender.kalender_id
|
||||
|
||||
LEFT JOIN public.tbl_gruppe current_gruppe
|
||||
ON current_gruppe.gruppe_kurzbz = current_lehreinheitguppe.gruppe_kurzbz
|
||||
|
||||
JOIN lehre.tbl_kalender other_kalender
|
||||
ON other_kalender.kalender_id != current_kalender.kalender_id
|
||||
AND other_kalender.von < current_kalender.bis
|
||||
AND other_kalender.bis > current_kalender.von
|
||||
|
||||
JOIN (
|
||||
SELECT tbl_lehreinheitgruppe.studiengang_kz, tbl_lehreinheitgruppe.semester, tbl_lehreinheitgruppe.verband, tbl_lehreinheitgruppe.gruppe,
|
||||
tbl_lehreinheitgruppe.gruppe_kurzbz, tbl_kalender_lehreinheit.kalender_id
|
||||
FROM lehre.tbl_kalender_lehreinheit
|
||||
JOIN lehre.tbl_lehreinheit ON tbl_lehreinheit.lehreinheit_id = tbl_kalender_lehreinheit.lehreinheit_id
|
||||
JOIN lehre.tbl_lehreinheitgruppe ON tbl_lehreinheitgruppe.lehreinheit_id = tbl_lehreinheit.lehreinheit_id
|
||||
UNION
|
||||
SELECT tbl_kalender_event_teilnehmer.studiengang_kz, tbl_kalender_event_teilnehmer.semester, tbl_kalender_event_teilnehmer.verband, tbl_kalender_event_teilnehmer.gruppe,
|
||||
tbl_kalender_event_teilnehmer.gruppe_kurzbz, tbl_kalender_event_teilnehmer.kalender_id
|
||||
FROM lehre.tbl_kalender_event_teilnehmer
|
||||
) other_lehreinheitguppe ON other_lehreinheitguppe.kalender_id = other_kalender.kalender_id
|
||||
|
||||
LEFT JOIN public.tbl_gruppe other_gruppe
|
||||
ON other_gruppe.gruppe_kurzbz = other_lehreinheitguppe.gruppe_kurzbz
|
||||
|
||||
WHERE current_kalender.kalender_id IN ({$placeholders})
|
||||
AND other_kalender.status_kurzbz NOT IN ('archived', 'deleted', 'to_delete')
|
||||
AND current_lehreinheitguppe.studiengang_kz = other_lehreinheitguppe.studiengang_kz
|
||||
AND current_lehreinheitguppe.semester = other_lehreinheitguppe.semester
|
||||
AND (
|
||||
(
|
||||
current_lehreinheitguppe.gruppe_kurzbz IS NULL
|
||||
AND other_lehreinheitguppe.gruppe_kurzbz IS NULL
|
||||
AND (
|
||||
current_lehreinheitguppe.verband IS NULL
|
||||
OR (
|
||||
current_lehreinheitguppe.verband = other_lehreinheitguppe.verband
|
||||
AND (current_lehreinheitguppe.gruppe IS NULL OR other_lehreinheitguppe.gruppe IS NULL OR current_lehreinheitguppe.gruppe = other_lehreinheitguppe.gruppe)
|
||||
)
|
||||
)
|
||||
)
|
||||
OR
|
||||
(
|
||||
current_lehreinheitguppe.gruppe_kurzbz IS NOT NULL
|
||||
AND other_lehreinheitguppe.gruppe_kurzbz IS NOT NULL
|
||||
AND current_gruppe.direktinskription IS NOT TRUE
|
||||
AND other_gruppe.direktinskription IS NOT TRUE
|
||||
)
|
||||
OR
|
||||
(
|
||||
(
|
||||
current_lehreinheitguppe.gruppe_kurzbz IS NULL
|
||||
AND other_lehreinheitguppe.gruppe_kurzbz IS NOT NULL
|
||||
AND other_gruppe.direktinskription IS NOT TRUE
|
||||
)
|
||||
OR
|
||||
(
|
||||
current_lehreinheitguppe.gruppe_kurzbz IS NOT NULL
|
||||
AND other_lehreinheitguppe.gruppe_kurzbz IS NULL
|
||||
AND current_gruppe.direktinskription IS NOT TRUE
|
||||
)
|
||||
)
|
||||
)
|
||||
AND other_kalender.kalender_id NOT IN (
|
||||
SELECT vorgaenger_kalender_id
|
||||
FROM lehre.tbl_kalender
|
||||
WHERE vorgaenger_kalender_id IS NOT NULL
|
||||
)
|
||||
|
||||
";
|
||||
|
||||
$result = $dbModel->execReadOnlyQuery($sql, $kalender_ids);
|
||||
|
||||
if (isError($result) || !hasData($result)) return [];
|
||||
|
||||
$grouped = [];
|
||||
foreach (getData($result) as $row)
|
||||
{
|
||||
$grouped[$row->kalender_id][] = true;
|
||||
}
|
||||
|
||||
return $grouped;
|
||||
}
|
||||
|
||||
}
|
||||
@@ -49,7 +49,7 @@ class DashboardLib
|
||||
|
||||
public function getMergedConfig($dashboard_id, $uid)
|
||||
{
|
||||
$defaultconfig = $this->getDefaultConfig($dashboard_id, $uid);
|
||||
$defaultconfig = $this->getDefaultConfig($dashboard_id);
|
||||
$userconfig = $this->getUserConfig($dashboard_id, $uid);
|
||||
|
||||
$mergedconfig = array_replace_recursive($defaultconfig, $userconfig);
|
||||
@@ -57,14 +57,31 @@ class DashboardLib
|
||||
return $mergedconfig;
|
||||
}
|
||||
|
||||
public function getDefaultConfig($dashboard_id, $uid)
|
||||
public function getDefaultConfig($dashboard_id)
|
||||
{
|
||||
$res_presets = $this->_ci->DashboardPresetModel->getPresets($dashboard_id, $uid);
|
||||
$funktion_kurzbzs = [];
|
||||
$rights = $this->_ci->permissionlib->getAccessRights();
|
||||
if ($rights)
|
||||
$funktion_kurzbzs = array_unique(array_map(function ($right) {
|
||||
return $right->funktion_kurzbz;
|
||||
}, $rights));
|
||||
|
||||
$this->_ci->DashboardPresetModel->db
|
||||
->group_start()
|
||||
->where_in('funktion_kurzbz', $funktion_kurzbzs)
|
||||
->or_where('funktion_kurzbz IS NULL')
|
||||
->group_end();
|
||||
|
||||
$this->_ci->DashboardPresetModel->addOrder('funktion_kurzbz', 'DESC');
|
||||
|
||||
$result = $this->_ci->DashboardPresetModel->loadWhere([
|
||||
'dashboard_id' => $dashboard_id
|
||||
]);
|
||||
$defaultconfig = array();
|
||||
|
||||
if (hasData($res_presets))
|
||||
if (hasData($result))
|
||||
{
|
||||
$presets = getData($res_presets);
|
||||
$presets = getData($result);
|
||||
foreach ($presets as $presetobj)
|
||||
{
|
||||
$preset = json_decode($presetobj->preset, true);
|
||||
@@ -137,8 +154,10 @@ class DashboardLib
|
||||
$dashboard = $this->getDashboardByKurzbz($dashboard_kurzbz);
|
||||
|
||||
$funktion_kurzbz = ($section === self::SECTION_IF_FUNKTION_KURZBZ_IS_NULL) ? null : $section;
|
||||
$result = $this->_ci->DashboardPresetModel
|
||||
->getPresetByDashboardAndFunktion($dashboard->dashboard_id, $funktion_kurzbz);
|
||||
$result = $this->_ci->DashboardPresetModel->loadWhere([
|
||||
'dashboard_id' => $dashboard->dashboard_id,
|
||||
'funktion_kurzbz' => $funktion_kurzbz
|
||||
]);
|
||||
|
||||
if (hasData($result))
|
||||
{
|
||||
@@ -195,11 +214,11 @@ class DashboardLib
|
||||
{
|
||||
foreach ($addwigets as $widget)
|
||||
{
|
||||
if(!isset($widget->widgetid))
|
||||
if(!isset($widget['widgetid']))
|
||||
{
|
||||
$widget->widgetid = $this->generateWidgetId($dashboard_kurzbz);
|
||||
$widget['widgetid'] = $this->generateWidgetId($dashboard_kurzbz);
|
||||
}
|
||||
$this->addWidgetToWidgets($widgets, $section, $widget, $widget->widgetid);
|
||||
$this->addWidgetToWidgets($widgets, $section, $widget, $widget['widgetid']);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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();
|
||||
}
|
||||
}
|
||||
@@ -11,57 +11,4 @@ class Dashboard_Preset_model extends DB_Model
|
||||
$this->dbTable = 'dashboard.tbl_dashboard_preset';
|
||||
$this->pk = 'preset_id';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Presets of given uid.
|
||||
* @param integer dashboard_id
|
||||
* @param string $uid
|
||||
* @return array
|
||||
*/
|
||||
public function getPresets($dashboard_id, $uid)
|
||||
{
|
||||
// TODO: get Funktionen for uid and load all preset for all funktionen for uid
|
||||
//return $this->loadWhere(array('dashboard_id' => $dashboard_id, 'funktion_kurzbz'=> null));
|
||||
$sql = <<<EOSQL
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
dashboard.tbl_dashboard_preset
|
||||
WHERE
|
||||
dashboard_id = ?
|
||||
AND (
|
||||
funktion_kurzbz IN (
|
||||
SELECT
|
||||
DISTINCT funktion_kurzbz
|
||||
FROM
|
||||
public.tbl_benutzerfunktion
|
||||
WHERE
|
||||
uid = ?
|
||||
AND
|
||||
NOW()::date
|
||||
BETWEEN
|
||||
COALESCE(datum_von, '1970-01-01')
|
||||
AND
|
||||
COALESCE(datum_bis, '2170-12-31')
|
||||
)
|
||||
OR
|
||||
funktion_kurzbz IS NULL
|
||||
)
|
||||
ORDER BY
|
||||
funktion_kurzbz DESC
|
||||
EOSQL;
|
||||
|
||||
return $this->execQuery($sql, array($dashboard_id, $uid));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Preset by Dashboard and Funktion
|
||||
* @param integer dashboard_id
|
||||
* @param string funktion_kurzbz
|
||||
* @return array
|
||||
*/
|
||||
public function getPresetByDashboardAndFunktion($dashboard_id, $funktion_kurzbz)
|
||||
{
|
||||
return $this->loadWhere(array('dashboard_id' => $dashboard_id, 'funktion_kurzbz' => $funktion_kurzbz));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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 ?";
|
||||
|
||||
@@ -11,4 +11,26 @@ class Gruppe_model extends DB_Model
|
||||
$this->dbTable = 'public.tbl_gruppe';
|
||||
$this->pk = 'gruppe_kurzbz';
|
||||
}
|
||||
|
||||
public function search($query_words)
|
||||
{
|
||||
$this->addSelect('gruppe_kurzbz,
|
||||
studiengang_kz,
|
||||
semester,
|
||||
bezeichnung,
|
||||
gid,
|
||||
\'false\' as lehrverband');
|
||||
$this->db->where(array('sichtbar' => true, 'aktiv' => true, 'lehre' => true, 'direktinskription' => false, 'semester IS NOT NULL' => null));
|
||||
$this->db->group_start();
|
||||
foreach ($query_words as $word)
|
||||
{
|
||||
$this->db->group_start();
|
||||
$this->db->where('gruppe_kurzbz ILIKE', "%" . $word . "%");
|
||||
$this->db->or_where('bezeichnung ILIKE', "%" . $word . "%");
|
||||
$this->db->group_end();
|
||||
}
|
||||
$this->db->group_end();
|
||||
|
||||
return $this->load();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -41,4 +41,29 @@ class Lehrverband_model extends DB_Model
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function search($query_words)
|
||||
{
|
||||
$this->addSelect('CONCAT(UPPER(CONCAT(typ, kurzbz)), \'\', semester, verband, COALESCE(gruppe,\'\')) as gruppe_kurzbz,
|
||||
studiengang_kz,
|
||||
semester,
|
||||
tbl_lehrverband.bezeichnung,
|
||||
gid,
|
||||
\'true\' as lehrverband');
|
||||
$this->addJoin('public.tbl_studiengang', 'studiengang_kz');
|
||||
$this->addOrder('verband');
|
||||
$this->addOrder('gruppe');
|
||||
$this->db->where(array('tbl_lehrverband.aktiv' => true));
|
||||
|
||||
$this->db->group_start();
|
||||
foreach ($query_words as $word)
|
||||
{
|
||||
$this->db->group_start();
|
||||
$this->db->where('CONCAT(CONCAT(typ, kurzbz), \'\', semester, verband, COALESCE(gruppe,\'\')) ILIKE', "%" . $word . "%");
|
||||
$this->db->or_where('tbl_lehrverband.bezeichnung ILIKE', "%" . $word . "%");
|
||||
$this->db->group_end();
|
||||
}
|
||||
$this->db->group_end();
|
||||
return $this->load();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
class Kalender_Event_Rolle_model extends DB_Model
|
||||
{
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->dbTable = 'lehre.tbl_kalender_event_rolle';
|
||||
$this->pk = array('rolle_kurzbz');
|
||||
$this->hasSequence = false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
<?php
|
||||
class
|
||||
Kalender_Event_Teilnehmer_model extends DB_Model
|
||||
{
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->dbTable = 'lehre.tbl_kalender_event_teilnehmer';
|
||||
$this->pk = array('kalender_event_teilnehmer_id');
|
||||
$this->hasSequence = false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
class Kalender_Event_model extends DB_Model
|
||||
{
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->dbTable = 'lehre.tbl_kalender_event';
|
||||
$this->pk = array('kalender_id');
|
||||
$this->hasSequence = false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
<?php
|
||||
class Kalender_Lehreinheit_model extends DB_Model
|
||||
{
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->dbTable = 'lehre.tbl_kalender_lehreinheit';
|
||||
$this->pk = array('kalender_id','lehreinheit_id');
|
||||
$this->hasSequence = false;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
class Kalender_Ort_model extends DB_Model
|
||||
{
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->dbTable = 'lehre.tbl_kalender_ort';
|
||||
$this->pk = 'kalender_ort_id';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
<?php
|
||||
class Kalender_model extends DB_Model
|
||||
{
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
class Kalenderstatus_model extends DB_Model
|
||||
{
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->dbTable = 'lehre.tbl_kalender_status';
|
||||
$this->pk = 'status_kurzbz';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
class Reservierung_Kalender_model extends DB_Model
|
||||
{
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->dbTable = 'sync.tbl_reservierung_kalender';
|
||||
$this->pk = 'reservierung_kalender_id';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
class Stundenplandev_Kalender_model extends DB_Model
|
||||
{
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->dbTable = 'sync.tbl_stundenplandev_kalender';
|
||||
$this->pk = 'stundenplandev_kalender_id';
|
||||
}
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
$includesArray = array(
|
||||
'title' => 'Tempus',
|
||||
'axios027' => true,
|
||||
'bootstrap5' => true,
|
||||
'fontawesome6' => true,
|
||||
'vue3' => true,
|
||||
'primevue3' => true,
|
||||
'tabulator5' => true,
|
||||
'vuedatepicker11' => true,
|
||||
'momentjs2' => true,
|
||||
'phrases' => array(
|
||||
'global',
|
||||
'ui',
|
||||
'notiz',
|
||||
),
|
||||
'customCSSs' => [
|
||||
'public/css/components/vue-datepicker.css',
|
||||
'public/css/components/primevue.css',
|
||||
'public/css/components/calendar.css',
|
||||
'public/css/Tempus.css',
|
||||
'public/css/Studentenverwaltung.css',
|
||||
'public/css/components/function.css'
|
||||
],
|
||||
'customJSs' => [
|
||||
#'vendor/npm-asset/primevue/tree/tree.min.js',
|
||||
#'vendor/npm-asset/primevue/toast/toast.min.js'
|
||||
'vendor/moment/luxonjs/luxon.min.js'
|
||||
],
|
||||
'customJSModules' => [
|
||||
'public/js/apps/Tempus.js'
|
||||
]
|
||||
);
|
||||
|
||||
$this->load->view('templates/FHC-Header', $includesArray);
|
||||
?>
|
||||
<div id="main">
|
||||
<router-view
|
||||
default-semester="<?= $variables['semester_aktuell']; ?>"
|
||||
active-addons="<?= defined('ACTIVE_ADDONS') ? ACTIVE_ADDONS : ''; ?>"
|
||||
tempus-root="<?= site_url('Tempus'); ?>"
|
||||
cis-root="<?= CIS_ROOT; ?>"
|
||||
avatar-url="<?= site_url('Cis/Pub/bild/person/' . getAuthPersonId()); ?>"
|
||||
logout-url="<?= site_url('Cis/Auth/logout'); ?>"
|
||||
:permissions="<?= htmlspecialchars(json_encode($permissions)); ?>"
|
||||
:config="<?= htmlspecialchars(json_encode($variables)); ?>"
|
||||
>
|
||||
</router-view>
|
||||
</div>
|
||||
|
||||
<?php $this->load->view('templates/FHC-Footer', $includesArray); ?>
|
||||
+9
-3
@@ -8,9 +8,15 @@ $this->load->view(
|
||||
'axios027' => true,
|
||||
'restclient' => true,
|
||||
'vue3' => true,
|
||||
'customJSModules' => ['public/js/apps/Dashboard.js'],
|
||||
'primevue3' => true,
|
||||
'vuedatepicker11' => true,
|
||||
'customJSs' => [
|
||||
'vendor/moment/luxonjs/luxon.min.js'
|
||||
],
|
||||
'customJSModules' => ['public/js/apps/Dashboard/Admin.js'],
|
||||
'customCSSs' => [
|
||||
'public/css/components/dashboard.css'
|
||||
'public/css/components/dashboard.css',
|
||||
'public/css/components/primevue.css',
|
||||
],
|
||||
'navigationcomponent' => true
|
||||
)
|
||||
@@ -25,7 +31,7 @@ $this->load->view(
|
||||
<div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom">
|
||||
<h1 class="h2">Dashboard</h1>
|
||||
</div>
|
||||
<core-dashboard dashboard="CIS" apiurl="<?= site_url('dashboard'); ?>"></core-dashboard>
|
||||
<dashboard-admin></dashboard-admin>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
+8
-3
@@ -8,7 +8,12 @@ $this->load->view(
|
||||
'axios027' => true,
|
||||
'restclient' => true,
|
||||
'vue3' => true,
|
||||
'customJSModules' => ['public/js/apps/DashboardAdmin.js'],
|
||||
'vuedatepicker11' => true,
|
||||
'primevue3' => true,
|
||||
'customJSs' => [
|
||||
'vendor/moment/luxonjs/luxon.min.js'
|
||||
],
|
||||
'customJSModules' => ['public/js/apps/Dashboard/Preview.js'],
|
||||
'customCSSs' => [
|
||||
'public/css/components/dashboard.css'
|
||||
],
|
||||
@@ -23,9 +28,9 @@ $this->load->view(
|
||||
|
||||
<div id="content">
|
||||
<div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom">
|
||||
<h1 class="h2">Dashboard</h1>
|
||||
<h1 class="h2">Dashboard <?= $dashboard_kurzbz ?></h1>
|
||||
</div>
|
||||
<dashboard-admin dashboard="CIS" apiurl="<?= site_url('dashboard'); ?>"></dashboard-admin>
|
||||
<core-dashboard dashboard="<?= $dashboard_kurzbz ?>"></core-dashboard>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -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>
|
||||
|
||||
@@ -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=='')
|
||||
{
|
||||
|
||||
@@ -802,6 +802,10 @@ echo '<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>';
|
||||
class="sortDirectionIndicator"
|
||||
sort="rdf:http://www.technikum-wien.at/prestudentrolle/rdf#fgm" />
|
||||
<splitter class="tree-splitter"/>
|
||||
<treecol id="student-prestudent-tree-rolle-faktiv" label="F-Aktiv" flex="1" hidden="true" persist="hidden, width, ordinal"
|
||||
class="sortDirectionIndicator"
|
||||
sort="rdf:http://www.technikum-wien.at/prestudentrolle/rdf#faktiv" />
|
||||
<splitter class="tree-splitter"/>
|
||||
</treecols>
|
||||
|
||||
<template>
|
||||
@@ -828,6 +832,7 @@ echo '<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>';
|
||||
<treecell properties="Aktiv_rdf:http://www.technikum-wien.at/prestudentrolle/rdf#aktiv rdf:http://www.technikum-wien.at/prestudentrolle/rdf#stichtagsaktiv" label="rdf:http://www.technikum-wien.at/prestudentrolle/rdf#updateamum"/>
|
||||
<treecell properties="Aktiv_rdf:http://www.technikum-wien.at/prestudentrolle/rdf#aktiv rdf:http://www.technikum-wien.at/prestudentrolle/rdf#stichtagsaktiv" label="rdf:http://www.technikum-wien.at/prestudentrolle/rdf#updatevon"/>
|
||||
<treecell properties="Aktiv_rdf:http://www.technikum-wien.at/prestudentrolle/rdf#aktiv rdf:http://www.technikum-wien.at/prestudentrolle/rdf#stichtagsaktiv" label="rdf:http://www.technikum-wien.at/prestudentrolle/rdf#fgm"/>
|
||||
<treecell properties="Aktiv_rdf:http://www.technikum-wien.at/prestudentrolle/rdf#aktiv rdf:http://www.technikum-wien.at/prestudentrolle/rdf#stichtagsaktiv" label="rdf:http://www.technikum-wien.at/prestudentrolle/rdf#faktiv"/>
|
||||
</treerow>
|
||||
</treeitem>
|
||||
</treechildren>
|
||||
|
||||
@@ -3550,9 +3550,19 @@ function StudentZeugnisDokumentArchivieren()
|
||||
case 'microcredentialzertifikat_1':
|
||||
case 'microcredentialzertifikat_2':
|
||||
case 'microcredentialzertifikat_3':
|
||||
case 'microcredentialzertifikat_4':
|
||||
case 'microcredential_1':
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
@@ -552,9 +552,41 @@ class lehreinheitmitarbeiter extends basis_db
|
||||
$beginn = new DateTime($beginn);
|
||||
$ende = new DateTime($ende);
|
||||
|
||||
// get relevant Studiensemester
|
||||
$studiensemester_kurzbz_arr = [];
|
||||
|
||||
$qry = '
|
||||
SELECT
|
||||
studiensemester_kurzbz
|
||||
FROM
|
||||
public.tbl_studiensemester
|
||||
WHERE
|
||||
start BETWEEN
|
||||
'. $this->db_add_param($beginn->format('Y-m-d')). ' AND
|
||||
'. $this->db_add_param($ende->format('Y-m-d'));
|
||||
|
||||
if ($this->db_query($qry))
|
||||
{
|
||||
while($row = $this->db_fetch_object())
|
||||
{
|
||||
$studiensemester_kurzbz_arr[] = $row->studiensemester_kurzbz;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->errormsg = 'Fehler bei der Datenbankabfrage';
|
||||
return false;
|
||||
}
|
||||
|
||||
$lehrgaengeDistr = $this->_getLehrgaengeForDistribution($studiensemester_kurzbz_arr);
|
||||
|
||||
if (!is_array($studiensemester_kurzbz_arr) || empty($studiensemester_kurzbz_arr)) return true;
|
||||
|
||||
$qry = '
|
||||
WITH semester_sws_tbl AS (
|
||||
SELECT DISTINCT lehreinheit_id, studiensemester_kurzbz, lema.semesterstunden, stg.studiengang_kz
|
||||
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)
|
||||
@@ -564,38 +596,104 @@ class lehreinheitmitarbeiter extends basis_db
|
||||
JOIN public.tbl_studiengang stg ON stg.studiengang_kz = sto.studiengang_kz
|
||||
JOIN public.tbl_studiensemester ss USING (studiensemester_kurzbz)
|
||||
WHERE mitarbeiter_uid = '. $this->db_add_param($uid). '
|
||||
AND (
|
||||
ss.start BETWEEN
|
||||
'. $this->db_add_param($beginn->format('Y-m-d')). ' AND
|
||||
'. $this->db_add_param($ende->format('Y-m-d')). ')
|
||||
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
|
||||
AND lema.semesterstunden != 0
|
||||
)
|
||||
|
||||
SELECT
|
||||
studiengang_kz,
|
||||
studiensemester_kurzbz,
|
||||
melde_studiengang_kz,
|
||||
lgartcode,
|
||||
sum(semesterstunden) AS summe,
|
||||
round(sum(semesterstunden) / 15, 2) AS sws
|
||||
FROM
|
||||
semester_sws_tbl
|
||||
GROUP BY
|
||||
studiengang_kz,
|
||||
studiensemester_kurzbz
|
||||
studiensemester_kurzbz,
|
||||
melde_studiengang_kz,
|
||||
lgartcode
|
||||
ORDER BY
|
||||
studiengang_kz;
|
||||
';
|
||||
|
||||
if ($this->db_query($qry))
|
||||
{
|
||||
$additionalLehrgaenge = [];
|
||||
|
||||
while($row = $this->db_fetch_object())
|
||||
{
|
||||
$obj = new StdClass();
|
||||
$obj->studiengang_kz = $row->studiengang_kz;
|
||||
$obj->studiensemester_kurzbz = $row->studiensemester_kurzbz;
|
||||
$obj->melde_studiengang_kz = $row->melde_studiengang_kz;
|
||||
$obj->lgartcode = $row->lgartcode;
|
||||
$obj->sws = $row->sws;
|
||||
|
||||
if (isset($lehrgaengeDistr[$uid][$row->studiensemester_kurzbz]))
|
||||
{
|
||||
$lehrgaenge = $lehrgaengeDistr[$uid][$row->studiensemester_kurzbz];
|
||||
|
||||
foreach ($lehrgaenge as $lehreinheit_id => $lehrgangKzArr)
|
||||
{
|
||||
// wenn lehrgang gefunden, zusammenhängende Lehrgaenge holen und sws aufteilen
|
||||
if (array_key_exists($row->studiengang_kz, $lehrgangKzArr))
|
||||
{
|
||||
foreach ($lehrgangKzArr as $studiengang_kz => $lehrgang)
|
||||
{
|
||||
// check: nur eine Studiengangsverknüpfung pro Mitarbeiter, Semester, und Referenzstudiengang
|
||||
if (
|
||||
$studiengang_kz == $row->studiengang_kz
|
||||
|| isset(
|
||||
$additionalLehrgaenge[$uid][$row->studiensemester_kurzbz][$row->studiengang_kz][$studiengang_kz]
|
||||
)
|
||||
) continue;
|
||||
|
||||
// Lehrgang erstellen
|
||||
$lg = new StdClass();
|
||||
$lg->mitarbeiter_uid = $uid;
|
||||
$lg->melde_studiengang_kz = $lehrgang->melde_studiengang_kz;
|
||||
$lg->lgartcode = $lehrgang->lgartcode;
|
||||
$lg->studiengang_kz = $lehrgang->studiengang_kz;
|
||||
$lg->studiensemester_kurzbz = $lehrgang->studiensemester_kurzbz;
|
||||
$lg->summe = $row->summe;
|
||||
$lg->sws = $row->sws;
|
||||
// Lehrgang, der mit Ursprungsstudiengang aufgrund lehreinheit "verknüpft" ist, hinzufügen
|
||||
$additionalLehrgaenge[$uid][$row->studiensemester_kurzbz][$row->studiengang_kz][$studiengang_kz] = $lg;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ignorieren, wenn für den Studiengang keine verknüpften Lehrgaenge hat
|
||||
if (isset($additionalLehrgaenge[$uid][$row->studiensemester_kurzbz][$row->studiengang_kz]))
|
||||
{
|
||||
$addLehrgaenge = $additionalLehrgaenge[$uid][$row->studiensemester_kurzbz][$row->studiengang_kz];
|
||||
|
||||
// sws Durchschnitt über alle verknuepften Lehrgaenge berechnet
|
||||
$summeSws = $row->summe/(count($addLehrgaenge) + 1);
|
||||
$sws = $row->sws/(count($addLehrgaenge) + 1);
|
||||
|
||||
// neue sws zuweisen
|
||||
$obj->summe = $summeSws;
|
||||
$obj->sws = $sws;
|
||||
|
||||
foreach ($addLehrgaenge as $conn_ws_studiengang_kz => $lehrgang)
|
||||
{
|
||||
// sws fuer jeden verknuepften Lehrgang zuweisen
|
||||
$lehrgang->summe = $summeSws;
|
||||
$lehrgang->sws = $sws;
|
||||
|
||||
// neue lehrgang sws hinzufuegen
|
||||
$this->result [] = $lehrgang;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->result []= $obj;
|
||||
}
|
||||
return true;
|
||||
@@ -655,4 +753,63 @@ class lehreinheitmitarbeiter extends basis_db
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get "connected" Lehrgaenge for equal sws distribution.
|
||||
* @param $studiensemester_kurzbz_arr all semester for which Lehrgaenge should be retrieved
|
||||
* @return object success or error
|
||||
*/
|
||||
private function _getLehrgaengeForDistribution($studiensemester_kurzbz_arr)
|
||||
{
|
||||
if (!is_array($studiensemester_kurzbz_arr) || empty($studiensemester_kurzbz_arr)) return [];
|
||||
|
||||
$qry = "
|
||||
WITH gruppen AS (
|
||||
SELECT
|
||||
mitarbeiter_uid, lehreinheit_id, lehrveranstaltung_id, studiensemester_kurzbz, sem.start, sem.ende,
|
||||
lehreinheitgruppe_id, studiengang_kz, melde_studiengang_kz, lgartcode
|
||||
FROM
|
||||
lehre.tbl_lehreinheitmitarbeiter lema
|
||||
JOIN lehre.tbl_lehreinheit le USING (lehreinheit_id)
|
||||
JOIN lehre.tbl_lehreinheitgruppe legr USING (lehreinheit_id)
|
||||
JOIN public.tbl_studiengang stg USING (studiengang_kz)
|
||||
JOIN public.tbl_studiensemester sem USING (studiensemester_kurzbz)
|
||||
WHERE
|
||||
bismelden
|
||||
AND stg.melderelevant
|
||||
AND stg.typ = 'l'
|
||||
AND le.studiensemester_kurzbz IN (".$this->implode4SQL($studiensemester_kurzbz_arr).")
|
||||
)
|
||||
SELECT
|
||||
DISTINCT mitarbeiter_uid, studiensemester_kurzbz, lehreinheit_id, studiengang_kz, melde_studiengang_kz, lgartcode
|
||||
FROM
|
||||
gruppen gr
|
||||
GROUP BY
|
||||
mitarbeiter_uid, studiensemester_kurzbz, lehreinheit_id, studiengang_kz, melde_studiengang_kz, lgartcode
|
||||
ORDER BY
|
||||
mitarbeiter_uid, studiensemester_kurzbz, lehreinheit_id, studiengang_kz, melde_studiengang_kz, lgartcode";
|
||||
|
||||
$lehrgaengeDistributions = [];
|
||||
|
||||
if($this->db_query($qry))
|
||||
{
|
||||
while($row = $this->db_fetch_object())
|
||||
{
|
||||
// group by properties
|
||||
$lehrgaengeDistributions
|
||||
[$row->mitarbeiter_uid]
|
||||
[$row->studiensemester_kurzbz]
|
||||
[$row->lehreinheit_id]
|
||||
[$row->studiengang_kz]
|
||||
= $row;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->errormsg = 'Fehler bei der Datenbankabfrage';
|
||||
return false;
|
||||
}
|
||||
|
||||
return $lehrgaengeDistributions;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -706,6 +706,7 @@ class prestudent extends person
|
||||
$rolle->bestaetigtam = $row->bestaetigtam;
|
||||
$rolle->bestaetigtvon = $row->bestaetigtvon;
|
||||
$rolle->fgm = $row->fgm;
|
||||
$rolle->faktiv = $this->db_parse_bool($row->faktiv);
|
||||
$rolle->anmerkung_status = $row->anmerkung;
|
||||
$rolle->bewerbung_abgeschicktamum = $row->bewerbung_abgeschicktamum;
|
||||
$rolle->rt_stufe = $row->rt_stufe;
|
||||
|
||||
@@ -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.';
|
||||
|
||||
@@ -97,3 +97,15 @@
|
||||
display: none;
|
||||
}
|
||||
|
||||
.weekPageContainer .calendar-event-collisions
|
||||
{
|
||||
display: grid;
|
||||
grid-template-columns: auto 1fr;
|
||||
background: repeating-linear-gradient(
|
||||
135deg,
|
||||
transparent,
|
||||
transparent 16px,
|
||||
rgba(0, 0, 0, 0.3) 16px,
|
||||
rgba(0, 0, 0, 0.3) 32px
|
||||
);
|
||||
}
|
||||
@@ -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;
|
||||
|
||||
@@ -0,0 +1,187 @@
|
||||
@import './Fhc.css';
|
||||
@import './components/searchbar/searchbar.css';
|
||||
@import './components/verticalsplit.css';
|
||||
@import './components/FilterComponent.css';
|
||||
@import './components/Tabs.css';
|
||||
@import './components/Notiz.css';
|
||||
|
||||
html {
|
||||
font-size: .875em;
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
body {
|
||||
/*display: flex;*/
|
||||
height: 100%;
|
||||
}
|
||||
.heightfull {
|
||||
height: 95%;
|
||||
}
|
||||
.navbar-dark .navbar-brand:focus {
|
||||
box-shadow: 0 0 0 .25rem rgba(13,110,253,.25);
|
||||
z-index: 3;
|
||||
}
|
||||
#main {
|
||||
height: 100%;
|
||||
}
|
||||
.tempus {
|
||||
height: 100%;
|
||||
}
|
||||
.searchbar {
|
||||
margin-right: 0!important;
|
||||
}
|
||||
.searchbar > .input-group {
|
||||
margin-right: 0!important;
|
||||
}
|
||||
.searchbar > .input-group > * {
|
||||
border-radius: 0!important;
|
||||
}
|
||||
|
||||
#sidebarMenu {
|
||||
width: 0%;
|
||||
}
|
||||
|
||||
.tabulator-row.disabled.tabulator-row-odd .tabulator-cell {
|
||||
color: var(--gray-400);
|
||||
}
|
||||
.tabulator-row.disabled.tabulator-row-even .tabulator-cell {
|
||||
color: var(--gray-500);
|
||||
}
|
||||
|
||||
/* Dropdown Toolbar Interessent, submenu */
|
||||
.dropend .dropdown-toggle.d-flex::after {
|
||||
height: 0;
|
||||
}
|
||||
|
||||
@media (min-width: 768px) {
|
||||
#sidebarMenu {
|
||||
visibility: visible!important;
|
||||
transform: none;
|
||||
position: inherit;
|
||||
z-index: 1;
|
||||
}
|
||||
}
|
||||
|
||||
.toast.toast-success {
|
||||
color: #0f5132;
|
||||
background-color: #d1e7dd!important;
|
||||
border-color: #badbcc!important;
|
||||
}
|
||||
.toast.toast-danger {
|
||||
color: #842029;
|
||||
background-color: #f8d7da!important;
|
||||
border-color: #f5c2c7!important;
|
||||
}
|
||||
|
||||
.has-filter .fa-filter {
|
||||
color: var(--bs-success);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
#parkingslot {
|
||||
border: 1px dashed;
|
||||
min-height: 5vh;
|
||||
max-height: 15vh;
|
||||
color: #AAAAAA;
|
||||
text-align: center;
|
||||
font-size: large;
|
||||
margin-top: 1.25rem;
|
||||
overflow-y: auto;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
flex-wrap: wrap;
|
||||
}
|
||||
|
||||
.course-picker {
|
||||
border: 1px dashed #AAAAAA;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
flex: 1 1 0;
|
||||
min-height: 0;
|
||||
}
|
||||
|
||||
.course-picker-row {
|
||||
padding: 0.5rem;
|
||||
margin-bottom: 0.5rem;
|
||||
border: 1px solid var(--bs-border-color);
|
||||
background-color: var(--event-bg);
|
||||
}
|
||||
|
||||
.parkingevent {
|
||||
border: 1px dashed !important;
|
||||
border-color: #AAAAAA;
|
||||
padding: 0.5rem;
|
||||
margin-bottom: 0.5rem;
|
||||
margin-left: 0.5rem;
|
||||
margin-right: 0.5rem;
|
||||
}
|
||||
|
||||
:root{
|
||||
--fhc-calendar-pane-height: calc(100vh - 120px);
|
||||
}
|
||||
|
||||
.eckerltest {
|
||||
box-shadow: 3px 3px 3px #ccc;
|
||||
}
|
||||
|
||||
.verband-selection {
|
||||
border: 1px dashed #AAAAAA;
|
||||
margin-bottom: 0.5rem;
|
||||
max-height: 450px;
|
||||
overflow-y: auto;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.lecture-selection {
|
||||
border: 1px dashed #AAAAAA;
|
||||
margin-bottom: 0.5rem;
|
||||
max-height: 20vh;
|
||||
overflow-y: auto;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
|
||||
.room-selection {
|
||||
border: 1px dashed #AAAAAA;
|
||||
margin-bottom: 0.5rem;
|
||||
padding: 0.5rem 0 0.5rem 0.5rem;
|
||||
}
|
||||
|
||||
.btn-link.text-danger {
|
||||
text-decoration: none;
|
||||
font-weight: 600;
|
||||
}
|
||||
|
||||
.btn-link.text-danger:hover {
|
||||
color: #dc3545;
|
||||
transform: scale(1.1);
|
||||
}
|
||||
|
||||
|
||||
|
||||
.bg-lecturer-wish {
|
||||
opacity: .15;
|
||||
}
|
||||
.bg-lecturer-block {
|
||||
background: rgba(255, 0, 0, 0.15);
|
||||
}
|
||||
|
||||
|
||||
.wish-w--2 {
|
||||
background-color: #FF2200;
|
||||
}
|
||||
.wish-w--1 {
|
||||
background-color: #FF9922;
|
||||
}
|
||||
.wish-w-1 {
|
||||
background-color: #CCFFCC;
|
||||
}
|
||||
.wish-w-2 {
|
||||
background-color: #48FA66;
|
||||
}
|
||||
|
||||
|
||||
@@ -2,6 +2,10 @@
|
||||
cursor: pointer;
|
||||
font-size: var(--fhc-calendar-fontsize-event, .875rem);
|
||||
}
|
||||
.event--parked {
|
||||
opacity: 0.45 !important;
|
||||
}
|
||||
|
||||
.fhc-calendar-mode-day .fhc-calendar-base-grid-line,
|
||||
.fhc-calendar-mode-week .fhc-calendar-base-grid-line {
|
||||
padding: 0 var(--fhc-calendar-gap-events, var(--fhc-calendar-gap, 1px));
|
||||
@@ -69,3 +73,36 @@
|
||||
.fhc-calendar-base .event > *:hover {
|
||||
filter: brightness(120%);
|
||||
}
|
||||
|
||||
.fhc-resize-bar {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
height: 15px;
|
||||
flex: 0 0 12px;
|
||||
cursor: ns-resize;
|
||||
position: relative;
|
||||
visibility: hidden;
|
||||
pointer-events: none;
|
||||
background-color: transparent !important;
|
||||
border: none !important;
|
||||
}
|
||||
|
||||
.fhc-resize-bar--top {
|
||||
margin-bottom: -16px;
|
||||
}
|
||||
.fhc-resize-bar--bottom {
|
||||
margin-top: -16px;
|
||||
}
|
||||
|
||||
.fhc-calendar-base-grid-line-event:hover > .fhc-resize-bar {
|
||||
visibility: visible;
|
||||
pointer-events: auto;
|
||||
}
|
||||
.fhc-calendar-base-grid-line-event.event:hover {
|
||||
z-index: 50;
|
||||
}
|
||||
.fhc-resize-bar {
|
||||
z-index: 2;
|
||||
}
|
||||
|
||||
|
||||
@@ -193,3 +193,6 @@
|
||||
word-break: break-word;
|
||||
}
|
||||
|
||||
.news-list-item p {
|
||||
word-break: break-word;
|
||||
}
|
||||
@@ -0,0 +1,46 @@
|
||||
/**
|
||||
* Copyright (C) 2026 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 {
|
||||
list() {
|
||||
return {
|
||||
method: 'get',
|
||||
url: 'api/frontend/v1/dashboard/board/list'
|
||||
};
|
||||
},
|
||||
add(params) {
|
||||
return {
|
||||
method: 'post',
|
||||
url: 'api/frontend/v1/dashboard/board/create',
|
||||
params
|
||||
};
|
||||
},
|
||||
update(params) {
|
||||
return {
|
||||
method: 'post',
|
||||
url: 'api/frontend/v1/dashboard/board/update',
|
||||
params
|
||||
};
|
||||
},
|
||||
delete(dashboard_id) {
|
||||
return {
|
||||
method: 'post',
|
||||
url: 'api/frontend/v1/dashboard/board/delete',
|
||||
params: { dashboard_id }
|
||||
};
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
/**
|
||||
* Copyright (C) 2026 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 {
|
||||
list(dashboard_kurzbz) {
|
||||
return {
|
||||
method: 'get',
|
||||
url: 'api/frontend/v1/dashboard/preset/list/'
|
||||
+ encodeURIComponent(dashboard_kurzbz)
|
||||
};
|
||||
},
|
||||
getBatch(params) {
|
||||
return {
|
||||
method: 'post',
|
||||
url: 'api/frontend/v1/dashboard/preset/getBatch',
|
||||
params
|
||||
};
|
||||
},
|
||||
addWidget(params) {
|
||||
return {
|
||||
method: 'post',
|
||||
url: 'api/frontend/v1/dashboard/preset/addWidget',
|
||||
params
|
||||
};
|
||||
},
|
||||
removeWidget(params) {
|
||||
return {
|
||||
method: 'post',
|
||||
url: 'api/frontend/v1/dashboard/preset/removeWidget',
|
||||
params
|
||||
};
|
||||
}
|
||||
};
|
||||
@@ -0,0 +1,45 @@
|
||||
/**
|
||||
* Copyright (C) 2026 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 {
|
||||
get(dashboard) {
|
||||
return {
|
||||
method: 'get',
|
||||
url: '/api/frontend/v1/dashboard/user/get/' + dashboard
|
||||
};
|
||||
},
|
||||
addWidget(dashboard, widget) {
|
||||
return {
|
||||
method: 'post',
|
||||
url: '/api/frontend/v1/dashboard/user/addWidget',
|
||||
params: {
|
||||
dashboard,
|
||||
widget
|
||||
}
|
||||
};
|
||||
},
|
||||
removeWidget(dashboard, widget) {
|
||||
return {
|
||||
method: 'post',
|
||||
url: '/api/frontend/v1/dashboard/user/removeWidget',
|
||||
params: {
|
||||
dashboard,
|
||||
widget
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
@@ -16,23 +16,31 @@
|
||||
*/
|
||||
|
||||
export default {
|
||||
getAllStudienSemester(studiensemester, studiengang, semester, studienplan) {
|
||||
get(widget) {
|
||||
return {
|
||||
method: 'get',
|
||||
url: 'api/frontend/v1/Studium/getStudienAllSemester/',
|
||||
params: {studiensemester, studiengang, semester, studienplan}
|
||||
url: '/api/frontend/v1/dashboard/widget/get/' + widget
|
||||
};
|
||||
},
|
||||
getLvPlanForStudiensemester(studiensemester, lvid) {
|
||||
list(dashboard) {
|
||||
return {
|
||||
method: 'get',
|
||||
url: '/api/frontend/v1/LvPlan/getLvPlanForStudiensemester/'+ studiensemester + '/' + lvid
|
||||
url: '/api/frontend/v1/dashboard/widget/list/' + dashboard
|
||||
};
|
||||
},
|
||||
getLvEvaluierungInfo(studiensemester_kurzbz, lvid) {
|
||||
listAllowed(dashboard) {
|
||||
return {
|
||||
method: 'get',
|
||||
url: 'api/frontend/v1/Studium/getLvEvaluierungInfo/' + studiensemester_kurzbz + '/' + lvid
|
||||
url: '/api/frontend/v1/dashboard/widget/listAllowed/' + dashboard
|
||||
};
|
||||
},
|
||||
}
|
||||
setAllowed(dashboard_id, widget_id, allowed) {
|
||||
return {
|
||||
method: 'post',
|
||||
url: '/api/frontend/v1/dashboard/widget/setAllowed',
|
||||
params: {
|
||||
dashboard_id, widget_id, allowed
|
||||
}
|
||||
};
|
||||
}
|
||||
};
|
||||
@@ -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,
|
||||
};
|
||||
},
|
||||
getAssignedResourcesByCalenderId(calenderID) {
|
||||
return {
|
||||
method: "get",
|
||||
url: "/api/frontend/v1/tempus/OperationalResourceToCalenderAPI/getAssignedResourcesByCalenderId/" + calenderID,
|
||||
};
|
||||
},
|
||||
storeResourcesToCalendarRelationship(calenderID, assignedResources) {
|
||||
return {
|
||||
method: "post",
|
||||
url: "/api/frontend/v1/tempus/OperationalResourceToCalenderAPI/storeResourcesToCalendarRelationship",
|
||||
params: { kalender_id: calenderID, assignedResources: assignedResources },
|
||||
};
|
||||
}
|
||||
};
|
||||
@@ -9,4 +9,12 @@ export default {
|
||||
}
|
||||
};
|
||||
},
|
||||
loadTempusRenderers() {
|
||||
return {
|
||||
method: 'get',
|
||||
url: '/api/frontend/v1/RendererLoader/GetTempusRenderers',
|
||||
params: {
|
||||
}
|
||||
};
|
||||
},
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user