mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-01 20:29:29 +00:00
Compare commits
37 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 03469edf3e | |||
| d89191b7f7 | |||
| dd9d712702 | |||
| f030465e50 | |||
| 6fb4461231 | |||
| f20a9ec080 | |||
| d1461bfe54 | |||
| f274e26e91 | |||
| 9b75d8bb72 | |||
| edeb211247 | |||
| ddb702ae05 | |||
| 183ffdafd8 | |||
| 26820d4891 | |||
| 776fd890ba | |||
| b1c480286c | |||
| 258d7c474b | |||
| b094d7f3e1 | |||
| 50a5ce3dce | |||
| 941f336ac8 | |||
| 827b51045b | |||
| 1b4158af2d | |||
| a7d6fbdc8b | |||
| 7a2d2f2826 | |||
| 707cb414a2 | |||
| c722008b17 | |||
| f4b9b9e3ae | |||
| ff7878b68a | |||
| 4e02df8629 | |||
| ef19a065c5 | |||
| 18854de6fd | |||
| 6fc39e9ef5 | |||
| a4d3015367 | |||
| eafe5da311 | |||
| f074503266 | |||
| 1e082792bb | |||
| 7c3b717542 | |||
| 12fba4f2ca |
@@ -23,15 +23,6 @@ Events::on('loadRenderers', function ($renderers) {
|
||||
);
|
||||
});
|
||||
|
||||
Events::on('loadRenderers', function ($renderers) {
|
||||
$fhc_core_renderers =& $renderers();
|
||||
$fhc_core_renderers["slot_room"] = array(
|
||||
'modalTitle' => APP_ROOT.'public/js/components/Cis/Renderer/Slot/roomModalTitle.js',
|
||||
'modalContent' => APP_ROOT.'public/js/components/Cis/Renderer/Slot/roomModalContent.js',
|
||||
'calendarEventStyles' => APP_ROOT.'public/css/Cis4/CoreCalendarEvents.css'
|
||||
);
|
||||
});
|
||||
|
||||
Events::on('loadRenderers', function ($renderers) {
|
||||
$fhc_core_renderers =& $renderers();
|
||||
$fhc_core_renderers["ferien"] = array(
|
||||
|
||||
@@ -208,14 +208,7 @@ $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'
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
<?php
|
||||
|
||||
if (!defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
// 'entschuldigt' & 'noch nicht eingetragen' -> wirken sich nicht auf Antritte aus
|
||||
$config['NOTEN_OHNE_ANTRITT'] = [9, 17]; // tbl_note pk
|
||||
@@ -64,10 +64,6 @@ $route['api/v1/system/[S|s]prache/(:any)'] = 'api/v1/system/sprache2/$1';
|
||||
$route['Cis/LvPlan/.*'] = 'Cis/LvPlan/index/$1';
|
||||
$route['Cis/MyLvPlan/.*'] = 'Cis/MyLvPlan/index/$1';
|
||||
$route['Cis/MyLv/.*'] = 'Cis/MyLv/index/$1';
|
||||
$route['Cis/OtherLvPlan/.*'] = 'Cis/OtherLvPlan/index/$1';
|
||||
//Route for LV Plan Stg/Semester/Verband/Gruppe
|
||||
$route['Cis/StgOrgLvPlan/.*'] = 'Cis/StgOrgLvPlan/index/$1';
|
||||
$route['Cis/Benotungstool/.*'] = 'Cis/Benotungstool/index/$1';
|
||||
|
||||
$route['Abgabetool/Assistenz'] = 'Cis/Abgabetool/Assistenz';
|
||||
$route['Abgabetool/Assistenz/(:any)'] = 'Cis/Abgabetool/Assistenz/$1';
|
||||
|
||||
@@ -22,9 +22,8 @@ unset($config['student']['searchfields']['email']);
|
||||
unset($config['student']['searchfields']['tel']);
|
||||
$config['student']['resultfields'] = [
|
||||
"s.student_uid AS uid",
|
||||
"s.matrikelnr AS personenkennzeichen",
|
||||
"s.matrikelnr",
|
||||
"p.person_id",
|
||||
"p.matr_nr AS matrikelnummer",
|
||||
"(p.vorname || ' ' || p.nachname) AS name",
|
||||
"ARRAY[s.student_uid || '@' || '" . DOMAIN . "'] AS email",
|
||||
"CASE
|
||||
|
||||
@@ -31,8 +31,12 @@ class Abgabetool extends Auth_Controller
|
||||
{
|
||||
// TODO: routing from index based on berechtigung?
|
||||
|
||||
$viewData = array(
|
||||
'uid'=>getAuthUID(),
|
||||
);
|
||||
|
||||
if(defined('CIS4') && CIS4) {
|
||||
$this->load->view('CisRouterView/CisRouterView.php', ['route' => 'Abgabetool']);
|
||||
$this->load->view('CisRouterView/CisRouterView.php', ['viewData' => $viewData, 'route' => 'Abgabetool']);
|
||||
} else {
|
||||
$this->load->view('Cis/Abgabetool.php', ['uid' => getAuthUID(), 'route' => 'Abgabetool']);
|
||||
}
|
||||
@@ -40,8 +44,12 @@ class Abgabetool extends Auth_Controller
|
||||
|
||||
public function Student($student_uid_prop = '')
|
||||
{
|
||||
$viewData = array(
|
||||
'uid'=>getAuthUID(),
|
||||
);
|
||||
|
||||
if(defined('CIS4') && CIS4) {
|
||||
$this->load->view('CisRouterView/CisRouterView.php', ['route' => 'AbgabetoolStudent']);
|
||||
$this->load->view('CisRouterView/CisRouterView.php', ['viewData' => $viewData, 'route' => 'AbgabetoolStudent']);
|
||||
} else {
|
||||
$this->load->view('Cis/Abgabetool.php', ['uid' => getAuthUID(), 'route' => 'AbgabetoolStudent', 'student_uid_prop' => $student_uid_prop]);
|
||||
}
|
||||
@@ -49,8 +57,12 @@ class Abgabetool extends Auth_Controller
|
||||
|
||||
public function Mitarbeiter()
|
||||
{
|
||||
$viewData = array(
|
||||
'uid'=>getAuthUID(),
|
||||
);
|
||||
|
||||
if(defined('CIS4') && CIS4) {
|
||||
$this->load->view('CisRouterView/CisRouterView.php', ['route' => 'AbgabetoolMitarbeiter']);
|
||||
$this->load->view('CisRouterView/CisRouterView.php', ['viewData' => $viewData, 'route' => 'AbgabetoolMitarbeiter']);
|
||||
} else {
|
||||
$this->load->view('Cis/Abgabetool.php', ['uid' => getAuthUID(), 'route' => 'AbgabetoolMitarbeiter']);
|
||||
}
|
||||
@@ -58,8 +70,13 @@ class Abgabetool extends Auth_Controller
|
||||
|
||||
public function Assistenz($stg_kz_prop = '')
|
||||
{
|
||||
|
||||
$viewData = array(
|
||||
'uid'=>getAuthUID(),
|
||||
);
|
||||
|
||||
if(defined('CIS4') && CIS4) {
|
||||
$this->load->view('CisRouterView/CisRouterView.php', ['route' => 'AbgabetoolAssistenz']);
|
||||
$this->load->view('CisRouterView/CisRouterView.php', ['viewData' => $viewData, 'route' => 'AbgabetoolAssistenz']);
|
||||
} else {
|
||||
$this->load->view('Cis/Abgabetool.php', ['uid' => getAuthUID(), 'route' => 'AbgabetoolAssistenz', 'stg_kz_prop' => $stg_kz_prop]);
|
||||
}
|
||||
@@ -67,8 +84,12 @@ class Abgabetool extends Auth_Controller
|
||||
|
||||
public function Deadlines()
|
||||
{
|
||||
$viewData = array(
|
||||
'uid'=>getAuthUID(),
|
||||
);
|
||||
|
||||
if(defined('CIS4') && CIS4) {
|
||||
$this->load->view('CisRouterView/CisRouterView.php', ['route' => 'DeadlinesOverview']);
|
||||
$this->load->view('CisRouterView/CisRouterView.php', ['viewData' => $viewData, 'route' => 'DeadlinesOverview']);
|
||||
} else {
|
||||
$this->load->view('Cis/Abgabetool.php', ['uid' => getAuthUID(), 'route' => 'DeadlinesOverview']);
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ class Auth extends FHC_Controller
|
||||
|
||||
if ($this->form_validation->run())
|
||||
{
|
||||
redirect($this->authlib->getLandingPage('/Cis4'));
|
||||
redirect($this->authlib->getLandingPage('/CisVue/Dashboard'));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
@@ -28,6 +28,12 @@ class LvPlan extends Auth_Controller
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$this->load->view('CisRouterView/CisRouterView.php', ['route' => 'LvPlan']);
|
||||
|
||||
$viewData = array(
|
||||
'uid'=>getAuthUID(),
|
||||
'timezone' => $this->config->item('timezone')
|
||||
);
|
||||
|
||||
$this->load->view('CisRouterView/CisRouterView.php', ['viewData' => $viewData, 'route' => 'LvPlan']);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,6 +26,11 @@ class MyLv extends Auth_Controller
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$this->load->view('CisRouterView/CisRouterView.php', ['route' => 'MyLv']);
|
||||
|
||||
$viewData = array(
|
||||
|
||||
);
|
||||
|
||||
$this->load->view('CisRouterView/CisRouterView.php', ['viewData' => $viewData, 'route' => 'MyLv']);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -27,7 +27,13 @@ class MyLvPlan extends Auth_Controller
|
||||
* @return void
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$this->load->view('CisRouterView/CisRouterView.php', ['route' => 'MyLvPlan']);
|
||||
{
|
||||
|
||||
$viewData = array(
|
||||
'uid'=>getAuthUID(),
|
||||
'timezone' => $this->config->item('timezone')
|
||||
);
|
||||
|
||||
$this->load->view('CisRouterView/CisRouterView.php', ['viewData' => $viewData, 'route' => 'MyLvPlan']);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,34 +0,0 @@
|
||||
<?php
|
||||
|
||||
if (!defined('BASEPATH'))
|
||||
exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class OtherLvPlan extends Auth_Controller
|
||||
{
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'index' => ['basis/other_lv_plan:r']
|
||||
]);
|
||||
|
||||
// Load Config
|
||||
$this->load->config('calendar');
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$this->load->view('CisRouterView/CisRouterView.php', ['route' => 'OtherLvPlan']);
|
||||
}
|
||||
}
|
||||
@@ -55,7 +55,15 @@ class Profil extends Auth_Controller
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$this->load->view('CisRouterView/CisRouterView.php', ['route' => 'profilIndex']);
|
||||
|
||||
$this->load->library('ProfilLib');
|
||||
$profil_data = $this->profillib->getView(getAuthUID());
|
||||
$profil_data = hasData($profil_data) ? getData($profil_data) : null;
|
||||
$viewData = array(
|
||||
'editable'=>true,
|
||||
'profil_data' => $profil_data,
|
||||
);
|
||||
$this->load->view('CisRouterView/CisRouterView.php',['viewData' => $viewData, 'route' => 'profilIndex']);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -65,13 +73,23 @@ class Profil extends Auth_Controller
|
||||
*/
|
||||
public function View($uid)
|
||||
{
|
||||
$this->load->view('CisRouterView/CisRouterView.php', ['route' => 'profilViewUid']);
|
||||
$this->load->library('ProfilLib');
|
||||
$profil_data = $this->profillib->getView($uid);
|
||||
$profil_data = hasData($profil_data) ? getData($profil_data) : null;
|
||||
$viewData = array (
|
||||
'uid' => $uid,
|
||||
'profil_data'=>$profil_data,
|
||||
);
|
||||
if($uid == getAuthUID()){
|
||||
$viewData['editable'] = true;
|
||||
}
|
||||
$this->load->view('CisRouterView/CisRouterView.php',['viewData' => $viewData, 'route' => 'profilViewUid']);
|
||||
}
|
||||
|
||||
/**
|
||||
* checks whether a specific userID is a student or not (foreword declaration of the function isStudent in Student_model.php)
|
||||
* checks whether a specific userID is a mitarbeiter or not (foreword declaration of the function isMitarbeiter in Mitarbeiter_model.php)
|
||||
* @access public
|
||||
* @param $uid the userID used to check if it is a student
|
||||
* @param $uid the userID used to check if it is a mitarbeiter
|
||||
* @return boolean
|
||||
*/
|
||||
public function isStudent($uid)
|
||||
@@ -101,7 +119,7 @@ class Profil extends Auth_Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* gets the adressen that are marked as zustell from the currently logged in user
|
||||
* gets the adressen that are marked as zustell from the currenlty logged in user
|
||||
* @access public
|
||||
* @return array a list of adresse_id's
|
||||
*/
|
||||
@@ -244,23 +262,23 @@ class Profil extends Auth_Controller
|
||||
$this->GemeindeModel->addDistinct();
|
||||
$this->GemeindeModel->addSelect(["name"]);
|
||||
if ($nation == "A") {
|
||||
if (isset($zip) && $zip > 999 && $zip < 32000) {
|
||||
if (isset($zip) && $zip > 999 && $zip < 32000) {
|
||||
|
||||
$gemeinde_res = $this->GemeindeModel->loadWhere(['plz' => $zip]);
|
||||
if (isError($gemeinde_res)) {
|
||||
show_error("error while trying to query bis.tbl_gemeinde");
|
||||
$gemeinde_res = $this->GemeindeModel->loadWhere(['plz' => $zip]);
|
||||
if (isError($gemeinde_res)) {
|
||||
show_error("error while trying to query bis.tbl_gemeinde");
|
||||
}
|
||||
$gemeinde_res = hasData($gemeinde_res) ? getData($gemeinde_res) : null;
|
||||
$gemeinde_res = array_map(function ($obj) {
|
||||
return $obj->name;
|
||||
}, $gemeinde_res);
|
||||
echo json_encode($gemeinde_res);
|
||||
|
||||
} else {
|
||||
echo json_encode(error("ortschaftskennziffer code was not valid"));
|
||||
}
|
||||
$gemeinde_res = hasData($gemeinde_res) ? getData($gemeinde_res) : null;
|
||||
$gemeinde_res = array_map(function ($obj) {
|
||||
return $obj->name;
|
||||
}, $gemeinde_res);
|
||||
echo json_encode($gemeinde_res);
|
||||
|
||||
} else {
|
||||
echo json_encode(error("ortschaftskennziffer code was not valid"));
|
||||
}
|
||||
} else {
|
||||
echo json_encode(error("Nation was not 'A' (Austria)"));
|
||||
echo json_encode(error("Nation was not 'A' (Austria)"));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -732,4 +750,6 @@ class Profil extends Auth_Controller
|
||||
$zutrittskarte_ausgegebenam = str_replace("-", ".", $zutrittskarte_ausgegebenam);
|
||||
return $zutrittskarte_ausgegebenam;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class ProjektabgabeUebersicht extends Auth_Controller
|
||||
{
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'index' => ['basis/cis:r']
|
||||
]);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$this->load->view('CisRouterView/CisRouterView.php', ['route' => 'ProjektabgabeUebersicht']);
|
||||
}
|
||||
}
|
||||
@@ -25,6 +25,11 @@ class Raumsuche extends Auth_Controller
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$this->load->view('CisRouterView/CisRouterView.php', ['route' => 'Raumsuche']);
|
||||
|
||||
$viewData = array(
|
||||
'uid'=>getAuthUID(),
|
||||
);
|
||||
|
||||
$this->load->view('CisRouterView/CisRouterView.php', ['viewData' => $viewData, 'route' => 'Raumsuche']);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,33 +0,0 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class StgOrgLvPlan extends Auth_Controller
|
||||
{
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'index' => ['basis/cis:r']
|
||||
]);
|
||||
|
||||
// Load Config
|
||||
$this->load->config('calendar');
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$this->load->view('CisRouterView/CisRouterView.php', ['route' => 'StgOrgLvPlan']);
|
||||
}
|
||||
}
|
||||
@@ -29,7 +29,10 @@ class Studium extends Auth_Controller
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$this->load->view('CisRouterView/CisRouterView.php',['route' => 'studium']);
|
||||
$viewData = array(
|
||||
|
||||
);
|
||||
$this->load->view('CisRouterView/CisRouterView.php',['viewData' => $viewData, 'route' => 'studium']);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -1,30 +0,0 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class Zeitsperren extends Auth_Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'index' => ['basis/cis:r'],
|
||||
]);
|
||||
|
||||
// Load Libraries
|
||||
$this->load->library('VariableLib', ['uid' => getAuthUID()]);
|
||||
}
|
||||
|
||||
/**
|
||||
* index loads the view Zeitsperren
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$viewData = array(
|
||||
'uid'=>getAuthUID(),
|
||||
);
|
||||
|
||||
$this->load->view('CisRouterView/CisRouterView.php', ['viewData' => $viewData, 'route' => 'zeitsperren']);
|
||||
}
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
<?php
|
||||
|
||||
if (!defined('BASEPATH'))
|
||||
exit('No direct script access allowed');
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
*
|
||||
@@ -14,9 +13,9 @@ class Cis4 extends Auth_Controller
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct(
|
||||
array(
|
||||
'index' => 'basis/cis:r'
|
||||
)
|
||||
array(
|
||||
'index' => 'basis/cis:r'
|
||||
)
|
||||
);
|
||||
|
||||
// Load Config
|
||||
@@ -31,6 +30,16 @@ class Cis4 extends Auth_Controller
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$this->load->view('CisRouterView/CisRouterView.php', ['route' => 'FhcDashboard']);
|
||||
$this->load->model('person/Person_model', 'PersonModel');
|
||||
$personData = getData($this->PersonModel->getByUid(getAuthUID()))[0];
|
||||
|
||||
$viewData = array(
|
||||
'uid' => getAuthUID(),
|
||||
'name' => $personData->vorname,
|
||||
'person_id' => $personData->person_id,
|
||||
'timezone' => $this->config->item('timezone')
|
||||
);
|
||||
|
||||
$this->load->view('CisRouterView/CisRouterView.php', ['viewData' => $viewData, 'route' => 'FhcDashboard']);
|
||||
}
|
||||
}
|
||||
|
||||
+17
-11
@@ -5,18 +5,18 @@ if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class Benotungstool extends Auth_Controller
|
||||
class Dashboard extends Auth_Controller
|
||||
{
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'index' => self::PERM_LOGGED
|
||||
]);
|
||||
|
||||
$this->_ci =& get_instance();
|
||||
parent::__construct(
|
||||
array(
|
||||
'index' => 'dashboard/benutzer:r'
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
@@ -27,11 +27,17 @@ class Benotungstool extends Auth_Controller
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$viewData = array(
|
||||
'uid'=>getAuthUID(),
|
||||
);
|
||||
|
||||
$this->load->view('CisRouterView/CisRouterView.php', ['viewData' => $viewData, 'route' => 'Benotungstool']);
|
||||
$this->load->model('person/Person_model','PersonModel');
|
||||
$personData = getData($this->PersonModel->getByUid(getAuthUID()))[0];
|
||||
|
||||
$viewData = array(
|
||||
'uid' => getAuthUID(),
|
||||
'name' => $personData->vorname,
|
||||
'person_id' => $personData->person_id
|
||||
);
|
||||
|
||||
$this->load->view('CisRouterView/CisRouterView.php', ['viewData' => $viewData]);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -511,11 +511,10 @@ class Abgabe extends FHCAPI_Controller
|
||||
return $projektarbeit->projektarbeit_id;
|
||||
};
|
||||
$projektarbeiten_ids = array_map($mapFunc, $projektarbeiten->retval);
|
||||
|
||||
$ret = $this->ProjektarbeitModel->getProjektarbeitenAbgabetermine($projektarbeiten_ids);
|
||||
$projektabgaben = $this->getDataOrTerminateWithError($ret, 'general');
|
||||
|
||||
if(count($projektarbeiten_ids) > 0) {
|
||||
$ret = $this->ProjektarbeitModel->getProjektarbeitenAbgabetermine($projektarbeiten_ids);
|
||||
$projektabgaben = $this->getDataOrTerminateWithError($ret, 'general');
|
||||
}
|
||||
|
||||
forEach($projektarbeiten->retval as $pa) {
|
||||
|
||||
@@ -847,10 +846,9 @@ class Abgabe extends FHCAPI_Controller
|
||||
private function getProjektbetreuerEmailByProjektarbeitID($projektarbeit_id) {
|
||||
$this->load->model('education/Projektarbeit_model', 'ProjektarbeitModel');
|
||||
$result = $this->ProjektarbeitModel->getProjektbetreuerEmail($projektarbeit_id);
|
||||
if(count($result->retval) > 0) {
|
||||
$email = getData($result);
|
||||
return $email[0]->uid ? $email[0]->uid.'@'.DOMAIN : $email[0]->private_email;
|
||||
} else return '';
|
||||
$email = $this->getDataOrTerminateWithError($result, 'general');
|
||||
|
||||
return $email[0]->uid ? $email[0]->uid.'@'.DOMAIN : $email[0]->private_email;
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -18,8 +18,6 @@
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
use \DateTime as DateTime;
|
||||
|
||||
class Bookmark extends FHCAPI_Controller
|
||||
{
|
||||
|
||||
@@ -30,162 +28,111 @@ class Bookmark extends FHCAPI_Controller
|
||||
{
|
||||
parent::__construct([
|
||||
'getBookmarks' => self::PERM_LOGGED,
|
||||
'delete' => self::PERM_LOGGED,
|
||||
'insert' => self::PERM_LOGGED,
|
||||
'delete' => self::PERM_LOGGED,
|
||||
'insert' => self::PERM_LOGGED,
|
||||
'update' => self::PERM_LOGGED,
|
||||
'changeOrder' => self::PERM_LOGGED
|
||||
]);
|
||||
]);
|
||||
|
||||
$this->load->model('dashboard/Bookmark_model', 'BookmarkModel');
|
||||
|
||||
$this->uid = getAuthUID();
|
||||
$this->pid = getAuthPersonID();
|
||||
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
|
||||
/**
|
||||
* gets the bookmarks associated to a user
|
||||
/**
|
||||
* gets the bookmarks associated to a user
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function getBookmarks()
|
||||
{
|
||||
$this->BookmarkModel->addOrder("sort");
|
||||
$this->BookmarkModel->addOrder("bookmark_id");
|
||||
$bookmarks = $this->BookmarkModel->loadWhere(["uid"=>$this->uid]);
|
||||
|
||||
$bookmarks = $this->getDataOrTerminateWithError($bookmarks);
|
||||
$bookmarks = $this->getDataOrTerminateWithError($bookmarks);
|
||||
|
||||
$this->terminateWithSuccess($bookmarks);
|
||||
}
|
||||
$this->terminateWithSuccess($bookmarks);
|
||||
}
|
||||
|
||||
/**
|
||||
* deletes bookmark from associated user
|
||||
/**
|
||||
* deletes bookmark from associated user
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function delete($bookmark_id)
|
||||
public function delete($bookmark_id)
|
||||
{
|
||||
$bookmark = $this->BookmarkModel->load($bookmark_id);
|
||||
$bookmark = $this->BookmarkModel->load($bookmark_id);
|
||||
|
||||
$bookmark = current($this->getDataOrTerminateWithError($bookmark));
|
||||
$bookmark = current($this->getDataOrTerminateWithError($bookmark));
|
||||
|
||||
// only delete bookmark if the user is the owner of the bookmark
|
||||
if ($bookmark->uid == $this->uid || $this->permissionlib->isBerechtigt('admin')) {
|
||||
$delete_result = $this->BookmarkModel->delete($bookmark_id);
|
||||
// only delete bookmark if the user is the owner of the bookmark
|
||||
if($bookmark->uid == $this->uid || $this->permissionlib->isBerechtigt('admin')){
|
||||
|
||||
$delete_result = $this->getDataOrTerminateWithError($delete_result);
|
||||
$delete_result = $this->BookmarkModel->delete($bookmark_id);
|
||||
|
||||
$this->terminateWithSuccess($delete_result);
|
||||
} else {
|
||||
$this->_outputAuthError(['delete' => ['admin:rw']]);
|
||||
}
|
||||
}
|
||||
$delete_result = $this->getDataOrTerminateWithError($delete_result);
|
||||
|
||||
/**
|
||||
* inserts new bookmark into the bookmark table
|
||||
$this->terminateWithSuccess($delete_result);
|
||||
}else{
|
||||
$this->_outputAuthError(['delete' => ['admin:rw']]);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* inserts new bookmark into the bookmark table
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function insert()
|
||||
public function insert()
|
||||
{
|
||||
// form validation
|
||||
$this->load->library('form_validation');
|
||||
$this->form_validation->set_rules('url', 'URL', 'required|valid_url|max_length[511]');
|
||||
$this->form_validation->set_rules('title', 'Title', 'required|max_length[255]');
|
||||
if (!$this->form_validation->run())
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
// form validation
|
||||
$this->load->library('form_validation');
|
||||
$this->form_validation->set_rules('url', 'URL', 'required|valid_url|max_length[511]');
|
||||
$this->form_validation->set_rules('title', 'Title', 'required|max_length[255]');
|
||||
if($this->form_validation->run() == FALSE) $this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
$url = $this->input->post('url', true);
|
||||
$title = $this->input->post('title', true);
|
||||
$tag = $this->input->post('tag', true);
|
||||
if (is_array($tag)) {
|
||||
$tag = json_encode($tag); // convert PHP array to JSON string
|
||||
}
|
||||
$sort = $this->input->post('sort', true);
|
||||
$url = $this->input->post('url',true);
|
||||
$title = $this->input->post('title',true);
|
||||
$tag = $this->input->post('tag', true);
|
||||
|
||||
$insert_into_result = $this->BookmarkModel->insert([
|
||||
'uid' => $this->uid,
|
||||
'url' => $url,
|
||||
'title' => $title,
|
||||
'tag' => $tag,
|
||||
'insertvon' => $this->uid,
|
||||
'updateamum' => null,
|
||||
'updatevon' => null,
|
||||
'sort' => $sort
|
||||
]);
|
||||
$insert_into_result = $this->BookmarkModel->insert(['uid'=>$this->uid, 'url'=>$url, 'title'=>$title,'tag'=>$tag, 'insertvon'=>$this->uid, 'updateamum'=>NULL, 'updatevon'=>NULL]);
|
||||
|
||||
$insert_into_result = $this->getDataOrTerminateWithError($insert_into_result);
|
||||
$insert_into_result = $this->getDataOrTerminateWithError($insert_into_result);
|
||||
|
||||
$this->terminateWithSuccess($insert_into_result);
|
||||
}
|
||||
$this->terminateWithSuccess($insert_into_result);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* updates bookmark in the bookmark table
|
||||
* updates bookmark in the bookmark table
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function update($bookmark_id)
|
||||
public function update($bookmark_id)
|
||||
{
|
||||
// form validation
|
||||
$this->load->library('form_validation');
|
||||
$this->form_validation->set_rules('url', 'URL', 'required|valid_url|max_length[511]');
|
||||
$this->form_validation->set_rules('title', 'Title', 'required|max_length[255]');
|
||||
if (!$this->form_validation->run())
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
// form validation
|
||||
$this->load->library('form_validation');
|
||||
$this->form_validation->set_rules('url', 'URL', 'required|valid_url|max_length[511]');
|
||||
$this->form_validation->set_rules('title', 'Title', 'required|max_length[255]');
|
||||
if($this->form_validation->run() == FALSE) $this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
$url = $this->input->post('url', true);
|
||||
$title = $this->input->post('title', true);
|
||||
$tag = $this->input->post('tag', true);
|
||||
if (is_array($tag)) {
|
||||
$tag = json_encode($tag);
|
||||
}
|
||||
$url = $this->input->post('url',true);
|
||||
$title = $this->input->post('title',true);
|
||||
|
||||
$now = new DateTime();
|
||||
$now = $now->format('Y-m-d H:i:s');
|
||||
|
||||
$update_result = $this->BookmarkModel->update($bookmark_id, [
|
||||
'url' => $url,
|
||||
'title' => $title,
|
||||
'tag' => $tag,
|
||||
'updateamum' => $now
|
||||
]);
|
||||
$update_result = $this->BookmarkModel->update($bookmark_id,['url'=>$url, 'title'=>$title,'updateamum'=>$now]);
|
||||
|
||||
$update_result = $this->getDataOrTerminateWithError($update_result);
|
||||
$update_result = $this->getDataOrTerminateWithError($update_result);
|
||||
|
||||
$this->terminateWithSuccess($update_result);
|
||||
}
|
||||
$this->terminateWithSuccess($update_result);
|
||||
|
||||
/**
|
||||
* changes sort of two bookmarks in the bookmark table
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function changeOrder($bookmark_id1, $bookmark_id2)
|
||||
{
|
||||
$update_result = [];
|
||||
|
||||
$result1 = $this->BookmarkModel->load($bookmark_id1);
|
||||
$data1 = $this->getDataOrTerminateWithError($result1);
|
||||
$sort1 = current($data1)->sort;
|
||||
|
||||
$result2 = $this->BookmarkModel->load(["bookmark_id"=>$bookmark_id2]);
|
||||
$data2 = $this->getDataOrTerminateWithError($result2);
|
||||
$sort2 = current($data2)->sort;
|
||||
|
||||
$update_result1 = $this->BookmarkModel->update($bookmark_id1, [
|
||||
'sort' => $sort2
|
||||
]);
|
||||
$update_result[] = $this->getDataOrTerminateWithError($update_result1);
|
||||
|
||||
$update_result2 = $this->BookmarkModel->update($bookmark_id2, [
|
||||
'sort' => $sort1
|
||||
]);
|
||||
$update_result[] = $this->getDataOrTerminateWithError($update_result2);
|
||||
|
||||
$this->terminateWithSuccess($update_result);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ class Cis4FhcApi extends FHCAPI_Controller
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'dashboardViewData' => self::PERM_LOGGED,
|
||||
'getViewData' => self::PERM_LOGGED,
|
||||
]);
|
||||
|
||||
}
|
||||
@@ -36,22 +36,17 @@ class Cis4FhcApi extends FHCAPI_Controller
|
||||
// Public methods
|
||||
|
||||
/**
|
||||
* retrieves view data for dashboard view
|
||||
* @access public
|
||||
* @param $uid the userID for which profile is being viewed, null or missing value implies one's own profile
|
||||
*/
|
||||
public function dashboardViewData()
|
||||
* fetches ViewData
|
||||
*/
|
||||
public function getViewData()
|
||||
{
|
||||
$this->load->model('person/Person_model','PersonModel');
|
||||
$personData = getData($this->PersonModel->getByUid(getAuthUID()))[0];
|
||||
|
||||
$this->load->config('calendar');
|
||||
|
||||
$viewData = array(
|
||||
'uid' => getAuthUID(),
|
||||
'name' => $personData->vorname,
|
||||
'person_id' => $personData->person_id,
|
||||
'timezone' => $this->config->item('timezone'),
|
||||
'person_id' => $personData->person_id
|
||||
);
|
||||
|
||||
$this->terminateWithSuccess($viewData);
|
||||
|
||||
@@ -16,13 +16,12 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
if (!defined('BASEPATH'))
|
||||
exit('No direct script access allowed');
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
|
||||
class CisMenu extends FHCAPI_Controller
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* Object initialization
|
||||
*/
|
||||
@@ -32,95 +31,28 @@ class CisMenu extends FHCAPI_Controller
|
||||
'getMenu' => self::PERM_LOGGED,
|
||||
]);
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
/**
|
||||
/**
|
||||
* fetches the menu for CIS from the database based on the userLanguage
|
||||
*/
|
||||
public function getMenu()
|
||||
public function getMenu()
|
||||
{
|
||||
$this->load->model('content/Content_model', 'ContentModel');
|
||||
$this->load->config('cis');
|
||||
$cis4_content_id = $this->config->item('cis_menu_root_content_id');
|
||||
$result = $this->ContentModel->getMenu($cis4_content_id, getAuthUID(), getUserLanguage());
|
||||
$cis4_content_id =$this->config->item('cis_menu_root_content_id');
|
||||
$result = $this->ContentModel->getMenu($cis4_content_id, getAuthUID(),getUserLanguage());
|
||||
$result = $this->getDataOrTerminateWithError($result);
|
||||
$menu = $result->childs ?? [];
|
||||
|
||||
$menu = $this->generateUrlsForMenuItems($menu);
|
||||
$this->terminateWithSuccess($menu);
|
||||
}
|
||||
|
||||
private function generateUrlsForMenuItems($menuItems)
|
||||
{
|
||||
return array_map(
|
||||
function ($menuItem) {
|
||||
return $this->generateUrlForMenuItem($menuItem);
|
||||
},
|
||||
$menuItems
|
||||
);
|
||||
}
|
||||
|
||||
private function generateUrlForMenuItem($menuItem)
|
||||
{
|
||||
$menuItem->url = $this->menuItemUrlHelper($menuItem);
|
||||
unset($menuItem->content);
|
||||
|
||||
if ($menuItem->childs && count($menuItem->childs)) {
|
||||
$menuItem->childs = $this->generateUrlsForMenuItems($menuItem->childs);
|
||||
}
|
||||
|
||||
return $menuItem;
|
||||
}
|
||||
|
||||
private function menuItemUrlHelper($menuItem)
|
||||
{
|
||||
if ($menuItem->template_kurzbz !== 'redirect') {
|
||||
return site_url("/CisVue/Cms/content/" . $menuItem->content_id);
|
||||
}
|
||||
|
||||
if (!$menuItem->content || !mb_strlen($menuItem->content)) {
|
||||
return '';
|
||||
}
|
||||
|
||||
$doc = new DOMDocument();
|
||||
$doc->loadXML($menuItem->content);
|
||||
$urlElem = $doc->getElementsByTagName('url')->item(0);
|
||||
|
||||
if (!$urlElem) {
|
||||
return '';
|
||||
}
|
||||
|
||||
$url = $urlElem->textContent;
|
||||
|
||||
if (strpos($url, '../cms/news.php') !== false) {
|
||||
$newsRegex = '/^\.\.\/cms\/news\.php/';
|
||||
$url = preg_replace($newsRegex, site_url("/CisVue/Cms/news"), $url);
|
||||
}
|
||||
|
||||
if (strpos($url, '../cms/content.php?') !== false) {
|
||||
$contentRegex = '/^\.\.\/cms\/content\.php\?content_id=([0-9]+)/';
|
||||
$matches = [];
|
||||
preg_match($contentRegex, $url, $matches);
|
||||
$url = site_url('/CisVue/Cms/content/' . $matches[1]);
|
||||
}
|
||||
|
||||
if (strpos($url, '../index.ci.php') !== false) {
|
||||
$indexRegex = '/^\.\.\/index\.ci\.php/';
|
||||
$url = preg_replace($indexRegex, site_url(), $url);
|
||||
}
|
||||
|
||||
if (strpos($url, '../') !== false) {
|
||||
$relativeRegex = '/^\.\.\//';
|
||||
$url = preg_replace($relativeRegex, base_url(), $url);
|
||||
}
|
||||
|
||||
return $url;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -208,6 +208,7 @@ class Documents extends FHCAPI_Controller
|
||||
$this->load->model('system/Vorlage_model', 'VorlageModel');
|
||||
|
||||
$result = $this->VorlageModel->load($xsl);
|
||||
$this->addMeta("ress", $result);
|
||||
$vorlage = current($this->getDataOrTerminateWithError($result));
|
||||
if (!$vorlage)
|
||||
show_404();
|
||||
@@ -220,7 +221,7 @@ class Documents extends FHCAPI_Controller
|
||||
'gedruckt' => true,
|
||||
'insertamum' => date('c'),
|
||||
'insertvon' => getAuthUID(),
|
||||
'uid' => $this->input->post_get('uid') ?: null,
|
||||
'uid' => $this->input->post_get('uid') ?: '',
|
||||
'archiv' => true,
|
||||
'signiert' => !!$sign_user,
|
||||
'stud_selfservice' => $vorlage->stud_selfservice
|
||||
@@ -250,9 +251,6 @@ class Documents extends FHCAPI_Controller
|
||||
'studiensemester_kurzbz' => $ss,
|
||||
'student_uid' => $akteData['uid']
|
||||
]);
|
||||
|
||||
if (!hasData($result)) $this->terminateWithError($this->p->t("stv", "error_noLehrverbandAssigned"));
|
||||
|
||||
$res = current($this->getDataOrTerminateWithError($result));
|
||||
|
||||
$studiengang_kz = $res->studiengang_kz;
|
||||
@@ -334,7 +332,6 @@ class Documents extends FHCAPI_Controller
|
||||
if ($prestudent_id) {
|
||||
$this->load->model('crm/prestudent_model', 'PrestudentModel');
|
||||
$this->PrestudentModel->addJoin('public.tbl_studiengang', 'studiengang_kz', 'LEFT');
|
||||
$this->PrestudentModel->addSelect('tbl_prestudent.*, UPPER(typ || kurzbz) AS kuerzel');
|
||||
$result = $this->PrestudentModel->load($prestudent_id);
|
||||
$prestudent = current($this->getDataOrTerminateWithError($result));
|
||||
|
||||
|
||||
@@ -18,9 +18,18 @@
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
//require_once('../../../include/studiengang.class.php');
|
||||
//require_once('../../../include/student.class.php');
|
||||
//require_once('../../../include/datum.class.php');
|
||||
//require_once('../../../include/mail.class.php');
|
||||
//require_once('../../../include/benutzerberechtigung.class.php');
|
||||
//require_once('../../../include/phrasen.class.php');
|
||||
//require_once('../../../include/projektarbeit.class.php');
|
||||
//require_once('../../../include/projektbetreuer.class.php');
|
||||
|
||||
class Lehre extends FHCAPI_Controller
|
||||
{
|
||||
|
||||
|
||||
/**
|
||||
* Object initialization
|
||||
*/
|
||||
@@ -29,58 +38,39 @@ class Lehre extends FHCAPI_Controller
|
||||
parent::__construct([
|
||||
'lvStudentenMail' => self::PERM_LOGGED,
|
||||
'LV' => self::PERM_LOGGED,
|
||||
'Pruefungen' => self::PERM_LOGGED,
|
||||
'semesterAverageGrade' => self::PERM_LOGGED,
|
||||
'getZugewieseneLv' => self::PERM_LOGGED,
|
||||
'getLeForLv' => self::PERM_LOGGED
|
||||
'Pruefungen' => self::PERM_LOGGED
|
||||
]);
|
||||
|
||||
$this->load->library('PhrasesLib');
|
||||
|
||||
$this->loadPhrases(
|
||||
array(
|
||||
'global',
|
||||
'ui',
|
||||
'abgabetool'
|
||||
)
|
||||
);
|
||||
|
||||
$this->load->helper('hlp_sancho_helper');
|
||||
|
||||
require_once(FHCPATH . 'include/studiengang.class.php');
|
||||
require_once(FHCPATH . 'include/student.class.php');
|
||||
require_once(FHCPATH . 'include/projektarbeit.class.php');
|
||||
require_once(FHCPATH . 'include/projektbetreuer.class.php');
|
||||
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
/**
|
||||
/**
|
||||
* constructs the emails of the groups from a lehrveranstaltung
|
||||
*/
|
||||
public function lvStudentenMail()
|
||||
public function lvStudentenMail()
|
||||
{
|
||||
$lehreinheit_id = $this->input->get("lehreinheit_id",TRUE);
|
||||
$lehreinheit_id = $this->input->get("lehreinheit_id",TRUE);
|
||||
|
||||
// return early if the required parameter is missing
|
||||
if(!isset($lehreinheit_id))
|
||||
{
|
||||
$this->terminateWithError('Missing required parameter', self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
|
||||
// return early if the required parameter is missing
|
||||
if(!isset($lehreinheit_id))
|
||||
{
|
||||
$this->terminateWithError('Missing required parameter', self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
$this->load->model('education/Lehreinheit_model', 'LehreinheitModel');
|
||||
|
||||
$studentenMails = $this->LehreinheitModel->getStudentenMail($lehreinheit_id);
|
||||
|
||||
$this->load->model('education/Lehreinheit_model', 'LehreinheitModel');
|
||||
|
||||
$studentenMails = $this->LehreinheitModel->getStudentenMail($lehreinheit_id);
|
||||
|
||||
$studentenMails = $this->getDataOrTerminateWithError($studentenMails);
|
||||
$studentenMails = $this->getDataOrTerminateWithError($studentenMails);
|
||||
|
||||
//convert array of objects into array of strings
|
||||
$studentenMails = array_map(function($element){
|
||||
return $element->mail;
|
||||
}, $studentenMails);
|
||||
|
||||
$this->terminateWithSuccess($studentenMails);
|
||||
$this->terminateWithSuccess($studentenMails);
|
||||
}
|
||||
|
||||
public function LV($studiensemester_kurzbz, $lehrveranstaltung_id)
|
||||
@@ -90,13 +80,13 @@ class Lehre extends FHCAPI_Controller
|
||||
$result = $this->LehrveranstaltungModel->getLvsByStudentWithGrades(getAuthUID(), $studiensemester_kurzbz, getUserLanguage(), $lehrveranstaltung_id);
|
||||
|
||||
$result = current($this->getDataOrTerminateWithError($result));
|
||||
|
||||
|
||||
$this->terminateWithSuccess($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* fetches all Pruefungen of a student for a specific lehrveranstaltung
|
||||
* if the student passed the Pruefung on the first attempt, no information about the Pruefungen is stored in the database
|
||||
* if the student passed the Pruefung on the first attempt, no information about the Pruefungen is stored in the database
|
||||
* @param mixed $lehrveranstaltung_id
|
||||
* @return void
|
||||
*/
|
||||
@@ -110,90 +100,5 @@ class Lehre extends FHCAPI_Controller
|
||||
|
||||
$this->terminateWithSuccess($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* calculates and returns the grade average and weighted average for a specific semester
|
||||
* @param string $studiensemester_kurzbz
|
||||
* @return void
|
||||
*/
|
||||
|
||||
public function semesterAverageGrade($studiensemester_kurzbz)
|
||||
{
|
||||
$this->load->model('education/Lehrveranstaltung_model', 'LehrveranstaltungModel');
|
||||
$semesterLvs = $this->LehrveranstaltungModel->getLvsByStudentWithGrades(getAuthUID(), $studiensemester_kurzbz, getUserLanguage());
|
||||
|
||||
if (isError($semesterLvs))
|
||||
return $this->outputJsonError(getError($semesterLvs));
|
||||
|
||||
$semesterLvsData = getData($semesterLvs);
|
||||
|
||||
$doGradesExist = false;
|
||||
$sum = 0;
|
||||
$count = 0;
|
||||
$sumWeighted = 0;
|
||||
$sumEcts = 0;
|
||||
|
||||
foreach ($semesterLvsData as $lv) {
|
||||
if (!$lv->znote || $lv->znote < 1 || $lv->znote > 5)
|
||||
continue;
|
||||
|
||||
$doGradesExist = true;
|
||||
|
||||
$sum += $lv->znote;
|
||||
$count++;
|
||||
$sumWeighted += $lv->znote * floatval($lv->ects);
|
||||
$sumEcts += floatval($lv->ects);
|
||||
}
|
||||
|
||||
$averageGrade = null;
|
||||
$weightedAverageGrade = null;
|
||||
if ($doGradesExist) {
|
||||
$averageGrade = $sum/$count;
|
||||
$weightedAverageGrade = $sumWeighted/$sumEcts;
|
||||
}
|
||||
|
||||
$this->terminateWithSuccess(['average_grade' => $averageGrade, 'weighted_average_grade' => $weightedAverageGrade]);
|
||||
}
|
||||
|
||||
/**
|
||||
* fetches all assigned lehrveranstaltungen of a mitarbeiter for a given semester
|
||||
* @param mixed $uid
|
||||
* @param mixed $sem_kurzbz
|
||||
* @return void
|
||||
*/
|
||||
public function getZugewieseneLv() {
|
||||
$uid = $this->input->get("uid",TRUE);
|
||||
$sem_kurzbz = $this->input->get("sem_kurzbz",TRUE);
|
||||
|
||||
// TODO: error messages
|
||||
|
||||
if(!isset($sem_kurzbz) || isEmptyString($sem_kurzbz))
|
||||
$this->terminateWithError($this->p->t('global', 'wrongParameters'), 'general');
|
||||
|
||||
if (!isset($uid) || isEmptyString($uid))
|
||||
$uid = getAuthUID();
|
||||
|
||||
// querying other ma_uids data requires admin permission
|
||||
if($uid !== getAuthUID()) {
|
||||
$this->load->library('PermissionLib');
|
||||
$isAdmin = $this->permissionlib->isBerechtigt('admin');
|
||||
if(!$isAdmin) $this->terminateWithError($this->p->t('ui', 'keineBerechtigung'), 'general');
|
||||
}
|
||||
|
||||
$this->load->model('education/Lehrveranstaltung_model', 'LehrveranstaltungModel');
|
||||
$result = $this->LehrveranstaltungModel->getLvForLektorInSemester($sem_kurzbz, $uid);
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
public function getLeForLv() {
|
||||
$lv_id = $this->input->get("lv_id",TRUE);
|
||||
$sem_kurzbz = $this->input->get("sem_kurzbz",TRUE);
|
||||
|
||||
$this->load->model('education/Lehreinheit_model', 'LehreinheitModel');
|
||||
|
||||
// $this->terminateWithSuccess($this->LehreinheitModel->getLesForLv($lv_id, $sem_kurzbz));
|
||||
$this->terminateWithSuccess($this->LehreinheitModel->getAllLehreinheitenForLvaAndMaUid($lv_id, getAuthUID(), $sem_kurzbz));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -36,8 +36,7 @@ class LvMenu extends FHCAPI_Controller
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'getLvMenu' => self::PERM_LOGGED,
|
||||
'getMultipleLvMenu' => self::PERM_LOGGED
|
||||
'getLvMenu' => self::PERM_LOGGED
|
||||
]);
|
||||
|
||||
$this->load->model("ressource/Mitarbeiter_model");
|
||||
@@ -62,23 +61,24 @@ class LvMenu extends FHCAPI_Controller
|
||||
|
||||
/**
|
||||
* alternative function to get multiple lvMenus with a single http request
|
||||
* not yet working as intended as the menu_lv.inc.php scripts called by the
|
||||
* lvMenuBuild event have logic coupled to require_once import which results in
|
||||
* a wrong logic after the first invocation -> faulty results for lvinfo, moodle
|
||||
* and several others
|
||||
*/
|
||||
public function getMultipleLvMenu(){
|
||||
$lvMenuOptionList = $this->input->post('lvMenuOptionList', true);
|
||||
public function getMultipleLvMenu($lvMenuOptionList){
|
||||
$result =[];
|
||||
foreach($lvMenuOptionList as $lvMenuOptions){
|
||||
$lvMenu = $this->getLvMenuInternal($lvMenuOptions['lvid'],$lvMenuOptions['studiensemester_kurzbz']);
|
||||
|
||||
$lvMenu = $this->getLvMenu($lvMenuOptions['lvid'],$lvMenuOptions['studiensemester_kurzbz']);
|
||||
if(isError($lvMenu)){
|
||||
// TODO: some lvMenu threw an error, handle error here
|
||||
}
|
||||
$result[$lvMenuOptions['lvid']]=$lvMenu;
|
||||
}
|
||||
$this->terminateWithSuccess($result);
|
||||
}
|
||||
|
||||
private function getLvMenuInternal($lvid, $studiensemester_kurzbz) {
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function getLvMenu($lvid, $studiensemester_kurzbz)
|
||||
{
|
||||
|
||||
// return early if parameters are missing
|
||||
if(!isset($lvid) || !isset($studiensemester_kurzbz))
|
||||
@@ -89,14 +89,14 @@ class LvMenu extends FHCAPI_Controller
|
||||
|
||||
// get the user
|
||||
if (!$user=getAuthUID())
|
||||
$this->terminateWithError($this->p->t('global', 'nichtAngemeldet'));
|
||||
$this->terminateWithError($this->p->t('global', 'nichtAngemeldet'));
|
||||
|
||||
// check if is_lector
|
||||
$is_lector = false;
|
||||
$mares = $this->Mitarbeiter_model->isMitarbeiter($user);
|
||||
if(hasData($mares))
|
||||
{
|
||||
$is_lector = getData($mares);
|
||||
$is_lector = getData($mares);
|
||||
}
|
||||
|
||||
// definition of user_is_allowed_to_upload
|
||||
@@ -105,7 +105,7 @@ class LvMenu extends FHCAPI_Controller
|
||||
|
||||
// load lehrveranstaltung
|
||||
$lvres = $this->Lehrveranstaltung_model->load($lvid);
|
||||
if(!hasData($lvres))
|
||||
if(!hasData($lvres))
|
||||
{
|
||||
$this->terminateWithError('LV ' . $lvid . ' not found.');
|
||||
}
|
||||
@@ -124,7 +124,7 @@ class LvMenu extends FHCAPI_Controller
|
||||
$stgres = $this->Studiengang_model->load(strval($studiengang_kz));
|
||||
if(!hasData($stgres))
|
||||
{
|
||||
$this->terminateWithError('Stg ' . $lv->studiengang_kz . ' not found.');
|
||||
$this->terminateWithError('Stg ' . $lv->studiengang_kz . ' not found.');
|
||||
}
|
||||
$stg = (getData($stgres))[0];
|
||||
$kurzbz = strtoupper($stg->typ . $stg->kurzbz);
|
||||
@@ -139,7 +139,7 @@ class LvMenu extends FHCAPI_Controller
|
||||
$angemeldet = false;
|
||||
|
||||
$lesres = $this->Lehreinheit_model->getLehreinheitenForStudentAndStudienSemester(
|
||||
$lvid, $user, $angezeigtes_stsem
|
||||
$lvid, $user, $angezeigtes_stsem
|
||||
);
|
||||
|
||||
if(hasData($lesres) && count(getData($lesres)) > 0)
|
||||
@@ -148,7 +148,7 @@ class LvMenu extends FHCAPI_Controller
|
||||
|
||||
// lehrfach
|
||||
$lehrfach_id='';
|
||||
|
||||
|
||||
if(defined('CIS_LEHRVERANSTALTUNG_LEHRFACH_ANZEIGEN') && CIS_LEHRVERANSTALTUNG_LEHRFACH_ANZEIGEN)
|
||||
{
|
||||
// Wenn der eingeloggte User zu einer der Lehreinheiten zugeteilt ist
|
||||
@@ -211,8 +211,8 @@ class LvMenu extends FHCAPI_Controller
|
||||
foreach($fbs as $row)
|
||||
{
|
||||
$lehrfach_oe_kurzbz_arr[] = $row->oe_kurzbz;
|
||||
if($this->PermissionLib->isBerechtigt('lehre', null, $row->oe_kurzbz)
|
||||
|| $this->PermissionLib->isBerechtigt('assistenz', null, $stg->oe_kurzbz))
|
||||
if($this->PermissionLib->isBerechtigt('lehre', null, $row->oe_kurzbz)
|
||||
|| $this->PermissionLib->isBerechtigt('assistenz', null, $stg->oe_kurzbz))
|
||||
{
|
||||
$user_is_allowed_to_upload=true;
|
||||
}
|
||||
@@ -224,21 +224,21 @@ class LvMenu extends FHCAPI_Controller
|
||||
$menu = array();
|
||||
|
||||
$this->fhc_menu_lvinfo($menu, $lvid, $studiengang_kz, $lektor_der_lv, $is_lector, $lehrfach_oe_kurzbz_arr);
|
||||
|
||||
|
||||
$this->fhc_menu_feedback($menu, $angemeldet, $lvid);
|
||||
|
||||
|
||||
$this->fhc_menu_gesamtnote($menu, $angemeldet, $lvid, $lv, $is_lector, $angezeigtes_stsem);
|
||||
|
||||
|
||||
$this->fhc_menu_emailStudierende($menu, $user, $angemeldet, $lvid, $angezeigtes_stsem);
|
||||
|
||||
|
||||
$this->fhc_menu_abmeldung($menu, $user, $is_lector, $lvid, $angezeigtes_stsem);
|
||||
|
||||
|
||||
$this->fhc_menu_lehretools($menu, $lvid, $angezeigtes_stsem, $sprache);
|
||||
|
||||
|
||||
$this->fhc_menu_anrechnungStudent($menu, $lvid, $angezeigtes_stsem);
|
||||
|
||||
|
||||
$this->fhc_menu_anrechnungLector($menu, $angezeigtes_stsem);
|
||||
|
||||
|
||||
|
||||
// Addons Menu Logic
|
||||
// ##########################################################################################
|
||||
@@ -272,18 +272,18 @@ class LvMenu extends FHCAPI_Controller
|
||||
'permissionLib' => &$this->PermissionLib,
|
||||
'phrasesLib' => &$this->PhrasesLib
|
||||
];
|
||||
|
||||
Events::trigger('lvMenuBuild',
|
||||
// passing $menu per reference
|
||||
function & () use (&$menu) {
|
||||
return $menu;
|
||||
},
|
||||
$params
|
||||
|
||||
Events::trigger('lvMenuBuild',
|
||||
// passing $menu per reference
|
||||
function & () use (&$menu) {
|
||||
return $menu;
|
||||
},
|
||||
$params
|
||||
);
|
||||
|
||||
// Menu sortieren
|
||||
// ##########################################################################################
|
||||
|
||||
|
||||
foreach ($menu as $key => $row){
|
||||
|
||||
// removes menu points that are not needed in the c4 lvUebersicht
|
||||
@@ -291,7 +291,7 @@ class LvMenu extends FHCAPI_Controller
|
||||
unset($menu[$key]);
|
||||
continue;
|
||||
}
|
||||
|
||||
|
||||
// fills pos array to sort the menu
|
||||
$pos[$key] = $row['position'];
|
||||
|
||||
@@ -299,18 +299,11 @@ class LvMenu extends FHCAPI_Controller
|
||||
|
||||
array_multisort($pos, SORT_ASC, SORT_NUMERIC, $menu);
|
||||
|
||||
|
||||
return $menu;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public function getLvMenu($lvid, $studiensemester_kurzbz)
|
||||
{
|
||||
$menu = $this->getLvMenuInternal($lvid, $studiensemester_kurzbz);
|
||||
// HTTP response
|
||||
// ##########################################################################################
|
||||
|
||||
$this->terminateWithSuccess($menu);
|
||||
|
||||
}
|
||||
|
||||
private function fhc_menu_lvinfo(&$menu, $lvid, $studiengang_kz, $lektor_der_lv, $is_lector, $lehrfach_oe_kurzbz_arr){
|
||||
|
||||
@@ -16,8 +16,7 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
if (!defined('BASEPATH'))
|
||||
exit('No direct script access allowed');
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
use CI3_Events as Events;
|
||||
use \DateTime as DateTime;
|
||||
@@ -34,25 +33,19 @@ class LvPlan extends FHCAPI_Controller
|
||||
|
||||
parent::__construct([
|
||||
'getRoomplan' => self::PERM_LOGGED,
|
||||
'Stunden' => self::PERM_LOGGED,
|
||||
'getReservierungen' => self::PERM_LOGGED,
|
||||
'Stunden' => self::PERM_LOGGED,
|
||||
'getReservierungen' => self::PERM_LOGGED,
|
||||
'LvPlanEvents' => self::PERM_LOGGED,
|
||||
'eventsPersonal' => self::PERM_LOGGED,
|
||||
'eventsLv' => self::PERM_LOGGED,
|
||||
'getLehreinheitStudiensemester' => self::PERM_LOGGED,
|
||||
'studiensemesterDateInterval' => self::PERM_LOGGED,
|
||||
'getLvPlanForStudiensemester' => self::PERM_LOGGED,
|
||||
'getLv' => self::PERM_LOGGED,
|
||||
'eventsStgOrg' => self::PERM_LOGGED,
|
||||
'fetchFerienEvents' => self::PERM_LOGGED,
|
||||
'getStudiengaenge' => self::PERM_LOGGED,
|
||||
'getLehrverband' => self::PERM_LOGGED,
|
||||
'permissionOtherLvPlan' => self::PERM_LOGGED,
|
||||
'compactibleEventTypes' => self::PERM_LOGGED,
|
||||
'getLv' => self::PERM_LOGGED
|
||||
]);
|
||||
|
||||
$this->load->library('LogLib');
|
||||
$this->loglib->setConfigs(array(
|
||||
$this->load->library('LogLib');
|
||||
$this->loglib->setConfigs(array(
|
||||
'classIndex' => 5,
|
||||
'functionIndex' => 5,
|
||||
'lineIndex' => 4,
|
||||
@@ -60,17 +53,17 @@ class LvPlan extends FHCAPI_Controller
|
||||
'dbExecuteUser' => 'RESTful API'
|
||||
));
|
||||
|
||||
$this->load->library('form_validation');
|
||||
$this->load->library('form_validation');
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
/**
|
||||
* fetches LvPlan and Moodle events together
|
||||
* @access public
|
||||
*
|
||||
*/
|
||||
* fetches LvPlan and Moodle events together
|
||||
* @access public
|
||||
*
|
||||
*/
|
||||
public function LvPlanEvents()
|
||||
{
|
||||
$hasLv = $this->input->post('lv_id');
|
||||
@@ -90,30 +83,24 @@ class LvPlan extends FHCAPI_Controller
|
||||
// form validation
|
||||
$this->form_validation->set_rules('start_date', "start_date", "required");
|
||||
$this->form_validation->set_rules('end_date', "end_date", "required");
|
||||
|
||||
|
||||
if (!$this->form_validation->run())
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
// storing the post parameter in local variables
|
||||
$start_date = $this->input->post('start_date', true);
|
||||
$end_date = $this->input->post('end_date', true);
|
||||
$uid = $this->input->post('uid', true);
|
||||
|
||||
// disallow accessing other user's events if missing permission
|
||||
if ($uid && $uid !== getAuthUID() && !$this->permissionlib->isBerechtigt('basis/other_lv_plan')) {
|
||||
$this->terminateWithError("Missing permission to view other users' timetables!");
|
||||
}
|
||||
|
||||
// fetching lvplan events
|
||||
$result = $this->stundenplanlib->getEventsUser($start_date, $end_date, $uid);
|
||||
$result = $this->stundenplanlib->getEventsUser($start_date, $end_date);
|
||||
$lvplanEvents = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
// fetching moodle events
|
||||
$moodleEvents = $this->fetchMoodleEvents($start_date, $end_date, $uid);
|
||||
$moodleEvents = $this->fetchMoodleEvents($start_date, $end_date);
|
||||
|
||||
// fetching ferien events
|
||||
$ferienEvents = $this->fetchFerienEvents($start_date, $end_date, $uid);
|
||||
|
||||
$ferienEvents = $this->fetchFerienEvents($start_date, $end_date);
|
||||
|
||||
|
||||
$this->terminateWithSuccess(array_merge(
|
||||
$lvplanEvents,
|
||||
@@ -122,45 +109,6 @@ class LvPlan extends FHCAPI_Controller
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* fetches LvPlan for studiengang / semester / verband / gruppe
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
public function eventsStgOrg()
|
||||
{
|
||||
$this->load->library('StundenplanLib');
|
||||
|
||||
// form validation
|
||||
$this->form_validation->set_rules('start_date', "start_date", "required");
|
||||
$this->form_validation->set_rules('end_date', "end_date", "required");
|
||||
//$this->form_validation->set_rules('stg_kz', "stg_kz", "required"); //no validation show empty calendar
|
||||
|
||||
if (!$this->form_validation->run()) {
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
$stgOrgEvents = [];
|
||||
$ferienEvents = [];
|
||||
} else {
|
||||
$start_date = $this->input->post('start_date', true);
|
||||
$end_date = $this->input->post('end_date', true);
|
||||
$stg_kz = $this->input->post('stg_kz', true);
|
||||
$sem = $this->input->post('sem', true);
|
||||
$verband = $this->input->post('verband', true);
|
||||
$gruppe = $this->input->post('gruppe', true);
|
||||
|
||||
$result = $this->stundenplanlib->getEventsStgOrg($start_date, $end_date, $stg_kz, $sem, $verband, $gruppe);
|
||||
$stgOrgEvents = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$result = $this->stundenplanlib->fetchFerienTageEvents($start_date, $end_date, $stg_kz);
|
||||
$ferienEvents = $this->getDataOrTerminateWithError($result);
|
||||
}
|
||||
|
||||
$this->terminateWithSuccess(array_merge(
|
||||
$stgOrgEvents,
|
||||
$ferienEvents
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* fetches LvPlan and Ferien events together for the lv
|
||||
*
|
||||
@@ -174,7 +122,7 @@ class LvPlan extends FHCAPI_Controller
|
||||
$this->form_validation->set_rules('start_date', "start_date", "required");
|
||||
$this->form_validation->set_rules('end_date', "end_date", "required");
|
||||
$this->form_validation->set_rules('lv_id', "lv_id", "required|integer");
|
||||
|
||||
|
||||
if (!$this->form_validation->run())
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
@@ -189,6 +137,7 @@ class LvPlan extends FHCAPI_Controller
|
||||
|
||||
// fetching ferien events
|
||||
$ferienEvents = $this->fetchFerienEvents($start_date, $end_date);
|
||||
|
||||
|
||||
$this->terminateWithSuccess(array_merge(
|
||||
$lvplanEvents,
|
||||
@@ -197,42 +146,40 @@ class LvPlan extends FHCAPI_Controller
|
||||
}
|
||||
|
||||
//TODO: delete this function if we don't use the old calendar export endpoints anymore
|
||||
public function studiensemesterDateInterval($date)
|
||||
{
|
||||
$this->load->model('organisation/Studiensemester_model', 'StudiensemesterModel');
|
||||
$studiensemester = $this->StudiensemesterModel->getByDate(date_format(date_create($date), 'Y-m-d'));
|
||||
$studiensemester = current($this->getDataOrTerminateWithError($studiensemester));
|
||||
public function studiensemesterDateInterval($date){
|
||||
$this->load->model('organisation/Studiensemester_model','StudiensemesterModel');
|
||||
$studiensemester =$this->StudiensemesterModel->getByDate(date_format(date_create($date),'Y-m-d'));
|
||||
$studiensemester =current($this->getDataOrTerminateWithError($studiensemester));
|
||||
$this->terminateWithSuccess($studiensemester);
|
||||
}
|
||||
|
||||
public function getLvPlanForStudiensemester($studiensemester, $lvid)
|
||||
{
|
||||
public function getLvPlanForStudiensemester($studiensemester,$lvid){
|
||||
$this->load->library('StundenplanLib');
|
||||
$this->load->model('organisation/Studiensemester_model', 'StudiensemesterModel');
|
||||
|
||||
$studiensemester_result = $this->StudiensemesterModel->loadWhere(["studiensemester_kurzbz" => $studiensemester]);
|
||||
$this->load->model('organisation/Studiensemester_model','StudiensemesterModel');
|
||||
|
||||
$studiensemester_result = $this->StudiensemesterModel->loadWhere(["studiensemester_kurzbz"=>$studiensemester]);
|
||||
$studiensemester_result = current($this->getDataOrTerminateWithError($studiensemester_result));
|
||||
$timespan_start = new DateTime($studiensemester_result->start);
|
||||
$timespan_ende = new DateTime($studiensemester_result->ende);
|
||||
$lvplan = $this->stundenplanlib->getStundenplan(date_format($timespan_start, 'Y-m-d'), date_format($timespan_ende, 'Y-m-d'), $lvid);
|
||||
$lvplan = $this->stundenplanlib->getStundenplan(date_format($timespan_start, 'Y-m-d'),date_format($timespan_ende, 'Y-m-d'), $lvid);
|
||||
$this->terminateWithSuccess($lvplan);
|
||||
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* fetches Stunden layout from database
|
||||
* @access public
|
||||
*
|
||||
*/
|
||||
public function Stunden()
|
||||
/**
|
||||
* fetches Stunden layout from database
|
||||
* @access public
|
||||
*
|
||||
*/
|
||||
public function Stunden()
|
||||
{
|
||||
$this->load->model('ressource/Stunde_model', 'StundeModel');
|
||||
|
||||
$this->StundeModel->addOrder('stunde', 'ASC');
|
||||
$stunden = $this->StundeModel->load();
|
||||
|
||||
$stunden = $this->getDataOrTerminateWithError($stunden);
|
||||
$stunden = $this->getDataOrTerminateWithError($stunden);
|
||||
|
||||
$this->terminateWithSuccess($stunden);
|
||||
}
|
||||
@@ -263,10 +210,10 @@ class LvPlan extends FHCAPI_Controller
|
||||
$roomplan_data = $this->stundenplanlib->getRoomplan($ort_kurzbz, $start_date, $end_date);
|
||||
|
||||
$roomplan_data = $this->getDataOrTerminateWithError($roomplan_data);
|
||||
|
||||
|
||||
$this->terminateWithSuccess($roomplan_data);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* gets the reservierungen of a room if the ort_kurzbz parameter is
|
||||
* supplied otherwise gets the reservierungen of the lvplan of a student
|
||||
@@ -279,32 +226,25 @@ class LvPlan extends FHCAPI_Controller
|
||||
{
|
||||
$this->form_validation->set_rules('start_date', "StartDate", "required");
|
||||
$this->form_validation->set_rules('end_date', "EndDate", "required");
|
||||
|
||||
|
||||
if (!$this->form_validation->run())
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
// storing the post parameter in local variables
|
||||
$start_date = $this->input->post('start_date', true);
|
||||
$end_date = $this->input->post('end_date', true);
|
||||
$uid = $this->input->post('uid', true);
|
||||
|
||||
// disallow accessing other user's reservierungen if missing permission
|
||||
if ($uid && $uid !== getAuthUID() && !$this->permissionlib->isBerechtigt('basis/other_lv_plan')) {
|
||||
$this->terminateWithError("Missing permission to view other users' timetables!");
|
||||
}
|
||||
|
||||
// get data
|
||||
$this->load->library('StundenplanLib');
|
||||
|
||||
$result = $this->stundenplanlib->getReservierungen($start_date, $end_date, $ort_kurzbz, $uid);
|
||||
$result = $this->stundenplanlib->getReservierungen($start_date, $end_date, $ort_kurzbz);
|
||||
|
||||
$result = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($result);
|
||||
}
|
||||
|
||||
public function getLehreinheitStudiensemester($lehreinheit_id)
|
||||
{
|
||||
public function getLehreinheitStudiensemester($lehreinheit_id){
|
||||
$this->load->model('education/Lehreinheit_model', 'LehreinheitModel');
|
||||
$this->LehreinheitModel->addSelect(["studiensemester_kurzbz"]);
|
||||
$result = $this->LehreinheitModel->load($lehreinheit_id);
|
||||
@@ -347,68 +287,6 @@ class LvPlan extends FHCAPI_Controller
|
||||
return $this->terminateWithSuccess(current($result));
|
||||
}
|
||||
|
||||
public function getStudiengaenge()
|
||||
{
|
||||
$this->load->model('organisation/Studiengang_model', 'StudiengangModel');
|
||||
|
||||
$this->StudiengangModel->addOrder('typ');
|
||||
$this->StudiengangModel->addOrder('kurzbz');
|
||||
$result = $this->StudiengangModel->loadWhere([
|
||||
'aktiv' => true
|
||||
]);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
return $this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
public function getLehrverband($studiengang_kz, $semester = null, $verband = null)
|
||||
{
|
||||
$this->load->model('organisation/Lehrverband_model', 'LehrverbandModel');
|
||||
|
||||
$where = [
|
||||
'aktiv' => true,
|
||||
'studiengang_kz' => $studiengang_kz,
|
||||
];
|
||||
|
||||
if ($semester !== null && $semester !== 'null' && $semester !== 'undefined') {
|
||||
$where['semester'] = $semester;
|
||||
}
|
||||
if ($verband !== null && $verband !== 'null' && $verband !== 'undefined') {
|
||||
$where['verband'] = $verband;
|
||||
}
|
||||
|
||||
$this->LehrverbandModel->addOrder('studiengang_kz');
|
||||
$this->LehrverbandModel->addOrder('semester');
|
||||
$this->LehrverbandModel->addOrder('verband');
|
||||
$this->LehrverbandModel->addOrder('gruppe');
|
||||
$result = $this->LehrverbandModel->loadWhere($where);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
return $this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if the current user has permission to view other users' timetables
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function permissionOtherLvPlan()
|
||||
{
|
||||
$this->terminateWithSuccess($this->permissionlib->isBerechtigt('basis/other_lv_plan'));
|
||||
}
|
||||
|
||||
/**
|
||||
* get event types which can be compacted in lv plan display
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function compactibleEventTypes()
|
||||
{
|
||||
$this->terminateWithSuccess(["lehreinheit", "reservierung", "ferien", "moodle"]);
|
||||
}
|
||||
|
||||
/**
|
||||
* fetch moodle events
|
||||
*
|
||||
@@ -416,30 +294,30 @@ class LvPlan extends FHCAPI_Controller
|
||||
* @param string $end_date
|
||||
* @return array
|
||||
*/
|
||||
private function fetchMoodleEvents($start_date, $end_date, $uid = null)
|
||||
private function fetchMoodleEvents($start_date, $end_date)
|
||||
{
|
||||
$this->load->config('calendar');
|
||||
|
||||
$tz = new DateTimeZone($this->config->item('timezone'));
|
||||
|
||||
|
||||
$start = new DateTime($start_date);
|
||||
$start->setTimezone($tz);
|
||||
|
||||
|
||||
$end = new DateTime($end_date);
|
||||
$end->setTimezone($tz);
|
||||
$end->modify('+1 day -1 second');
|
||||
|
||||
|
||||
$moodle_events = [];
|
||||
|
||||
|
||||
Events::trigger(
|
||||
'moodleCalendarEvents',
|
||||
function &() use (&$moodle_events) {
|
||||
function & () use (&$moodle_events) {
|
||||
return $moodle_events;
|
||||
},
|
||||
[
|
||||
'start_date' => $start->format('c'),
|
||||
'end_date' => $end->format('c'),
|
||||
'username' => $uid ?? getAuthUID()
|
||||
'username' => getAuthUID()
|
||||
]
|
||||
);
|
||||
|
||||
@@ -453,23 +331,23 @@ class LvPlan extends FHCAPI_Controller
|
||||
* @param string $end_date
|
||||
* @return array
|
||||
*/
|
||||
private function fetchFerienEvents($start_date, $end_date, $uid = null)
|
||||
private function fetchFerienEvents($start_date, $end_date)
|
||||
{
|
||||
$this->load->model('organisation/Studiensemester_model', 'StudiensemesterModel');
|
||||
$this->load->model('education/Studentlehrverband_model', 'StudentLehrverbandModel');
|
||||
|
||||
$currentStudiensemester = $this->StudiensemesterModel->getByDate($start_date);
|
||||
$currentStudiensemester = $this->getDataOrTerminateWithError($currentStudiensemester);
|
||||
|
||||
|
||||
if ($currentStudiensemester) {
|
||||
$studentsemester_kurzbz = current($currentStudiensemester)->studiensemester_kurzbz;
|
||||
|
||||
$studiengang = $this->StudentLehrverbandModel->loadWhere([
|
||||
"student_uid" => $uid ?? getAuthUID(),
|
||||
"student_uid" => getAuthUID(),
|
||||
"studiensemester_kurzbz" => $studentsemester_kurzbz
|
||||
]);
|
||||
$studiengang = $this->getDataOrTerminateWithError($studiengang);
|
||||
|
||||
|
||||
if ($studiengang)
|
||||
$studiengang_kz = current($studiengang)->studiengang_kz;
|
||||
else
|
||||
@@ -479,7 +357,7 @@ class LvPlan extends FHCAPI_Controller
|
||||
}
|
||||
|
||||
$ferienEvents = $this->stundenplanlib->fetchFerienTageEvents($start_date, $end_date, $studiengang_kz);
|
||||
|
||||
|
||||
return $this->getDataOrTerminateWithError($ferienEvents);
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,76 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2024 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 OtherLvPlan extends FHCAPI_Controller
|
||||
{
|
||||
|
||||
/**
|
||||
* Object initialization
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'otherLvPlanViewData' => ['basis/other_lv_plan:r'],
|
||||
]);
|
||||
|
||||
$this->load->model('ressource/mitarbeiter_model', 'MitarbeiterModel');
|
||||
$this->load->model('person/Benutzer_model', 'BenutzerModel');
|
||||
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
/**
|
||||
* retrieves viewData for other lv plan view
|
||||
* @access public
|
||||
* @param $uid the userID for which the other lv plan is being viewed
|
||||
*/
|
||||
public function otherLvPlanViewData($uid)
|
||||
{
|
||||
$isMitarbeiterResult = $this->MitarbeiterModel->isMitarbeiter($uid);
|
||||
$isMitarbeiter = getData($isMitarbeiterResult);
|
||||
$isStudent = !$isMitarbeiter;
|
||||
|
||||
$this->BenutzerModel->addSelect(["foto", "vorname", "nachname"]);
|
||||
$this->BenutzerModel->addJoin("tbl_person", "person_id");
|
||||
$personResult = $this->BenutzerModel->load([$uid]);
|
||||
$person = hasData($personResult) ? getData($personResult) : null;
|
||||
|
||||
$viewData = [
|
||||
"user_data" => [
|
||||
"username" => $uid,
|
||||
"is_student" => $isStudent,
|
||||
"is_mitarbeiter" => $isMitarbeiter,
|
||||
"foto" => $person[0]->foto,
|
||||
"vorname" => $person[0]->vorname,
|
||||
"nachname" => $person[0]->nachname,
|
||||
],
|
||||
];
|
||||
|
||||
$this->terminateWithSuccess($viewData);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
// Private methods
|
||||
|
||||
}
|
||||
|
||||
@@ -16,8 +16,7 @@
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
if (!defined('BASEPATH'))
|
||||
exit('No direct script access allowed');
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class Profil extends FHCAPI_Controller
|
||||
{
|
||||
@@ -28,13 +27,13 @@ class Profil extends FHCAPI_Controller
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'fotoSperre' => self::PERM_LOGGED,
|
||||
'fotoSperre' => self::PERM_LOGGED,
|
||||
'getGemeinden' => self::PERM_LOGGED,
|
||||
'getAllNationen' => self::PERM_LOGGED,
|
||||
'isMitarbeiter' => self::PERM_LOGGED,
|
||||
'profilViewData' => self::PERM_LOGGED,
|
||||
]);
|
||||
|
||||
|
||||
$this->load->library('PermissionLib');
|
||||
|
||||
$this->load->model('ressource/mitarbeiter_model', 'MitarbeiterModel');
|
||||
@@ -49,37 +48,28 @@ class Profil extends FHCAPI_Controller
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
/**
|
||||
* retrieves view data for profile view
|
||||
* @access public
|
||||
* @param $uid the userID for which profile is being viewed, null or missing value implies one's own profile
|
||||
*/
|
||||
public function profilViewData($uid = null)
|
||||
{
|
||||
$authUid = getAuthUID();
|
||||
$isProfilOfAuthUser = !$uid || $uid === $authUid;
|
||||
|
||||
public function profilViewData($uid=null){
|
||||
$this->load->library('ProfilLib');
|
||||
$profileData = $this->profillib->getView($uid ?? $authUid);
|
||||
$profileData = hasData($profileData) ? getData($profileData) : null;
|
||||
|
||||
$viewData = [
|
||||
'editable' => $isProfilOfAuthUser,
|
||||
'profil_data' => $profileData,
|
||||
'permissions' => [
|
||||
'basis/other_lv_plan' => $this->permissionlib->isBerechtigt(('basis/other_lv_plan'))
|
||||
]
|
||||
];
|
||||
|
||||
if ($isProfilOfAuthUser) {
|
||||
$viewData['calendar_sync_urls'] = $this->getCalendarSyncUrlData();
|
||||
$editable = false;
|
||||
if(isset($uid) && $uid != null){
|
||||
$profil_data = $this->profillib->getView($uid);
|
||||
if($uid == getAuthUID()){
|
||||
$editable = true;
|
||||
}
|
||||
}else{
|
||||
$editable = true;
|
||||
$profil_data = $this->profillib->getView(getAuthUID());
|
||||
}
|
||||
|
||||
|
||||
$profil_data = hasData($profil_data) ? getData($profil_data) : null;
|
||||
$viewData = array(
|
||||
'editable'=>$editable,
|
||||
'profil_data' => $profil_data,
|
||||
);
|
||||
$this->terminateWithSuccess($viewData);
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* update column foto_sperre in public.tbl_person
|
||||
* @access public
|
||||
* @param boolean $value new value for the column
|
||||
@@ -87,9 +77,9 @@ class Profil extends FHCAPI_Controller
|
||||
*/
|
||||
public function fotoSperre($value)
|
||||
{
|
||||
if (!isset($value)) {
|
||||
$this->terminateWithError("Missing parameter", self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
if(!isset($value)){
|
||||
$this->terminateWithError("Missing parameter", self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
|
||||
$res = $this->PersonModel->update($this->pid, ["foto_sperre" => $value]);
|
||||
if (isError($res)) {
|
||||
@@ -97,10 +87,10 @@ class Profil extends FHCAPI_Controller
|
||||
}
|
||||
$this->PersonModel->addSelect("foto_sperre");
|
||||
$res = $this->PersonModel->load($this->pid);
|
||||
|
||||
$res = $this->getDataOrTerminateWithError($res);
|
||||
|
||||
$this->terminateWithSuccess(current($res));
|
||||
|
||||
$res = $this->getDataOrTerminateWithError($res);
|
||||
|
||||
$this->terminateWithSuccess(current($res));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -119,7 +109,7 @@ class Profil extends FHCAPI_Controller
|
||||
if (isError($nation_res)) {
|
||||
$this->terminateWithError("error while trying to query table codex.tbl_nation", self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
|
||||
|
||||
$nation_res = $this->getDataOrTerminateWithError($nation_res);
|
||||
|
||||
$this->terminateWithSuccess($nation_res);
|
||||
@@ -127,30 +117,30 @@ class Profil extends FHCAPI_Controller
|
||||
|
||||
public function getGemeinden($nation, $zip)
|
||||
{
|
||||
if (!isset($nation) || !isset($zip)) {
|
||||
if(!isset($nation) || !isset($zip)){
|
||||
echo json_encode(error("Missing parameters"));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
$this->load->model('codex/Gemeinde_model', "GemeindeModel");
|
||||
|
||||
|
||||
|
||||
$gemeinde_res = $this->GemeindeModel->getGemeindeByPlz($zip);
|
||||
|
||||
|
||||
if (isError($gemeinde_res)) {
|
||||
$this->terminateWithError(getError($gemeinde_res), self::ERROR_TYPE_GENERAL);
|
||||
$this->terminateWithError(getError($gemeinde_res),self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
$gemeinde_res = $this->getDataOrTerminateWithError($gemeinde_res);
|
||||
|
||||
|
||||
/* $gemeinde_res = array_map(function ($obj) {
|
||||
return $obj->ortschaftsname;
|
||||
}, $gemeinde_res); */
|
||||
|
||||
$this->terminateWithSuccess($gemeinde_res);
|
||||
|
||||
$this->terminateWithSuccess($gemeinde_res);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* checks whether a specific userID is a mitarbeiter or not (foreword declaration of the function isMitarbeiter in Mitarbeiter_model.php)
|
||||
* @access public
|
||||
@@ -160,48 +150,23 @@ class Profil extends FHCAPI_Controller
|
||||
public function isMitarbeiter($uid)
|
||||
{
|
||||
|
||||
if (!$uid)
|
||||
$this->terminateWithError("No uid provided", self::ERROR_TYPE_GENERAL);
|
||||
|
||||
|
||||
if(!$uid) $this->terminateWithError("No uid provided", self::ERROR_TYPE_GENERAL);
|
||||
|
||||
|
||||
$result = $this->MitarbeiterModel->isMitarbeiter($uid);
|
||||
|
||||
|
||||
if (isError($result)) {
|
||||
$this->terminateWithError("error when calling Mitarbeiter_model function isMitarbeiter with uid " . $uid, self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
|
||||
$result = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
|
||||
$this->terminateWithSuccess($result);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
// Private methods
|
||||
|
||||
/**
|
||||
* gets the identifier, phrase, and url for each calendar sync option
|
||||
* @access private
|
||||
* @return array array of arrays, where each child array is a sync option
|
||||
*/
|
||||
private function getCalendarSyncUrlData()
|
||||
{
|
||||
return [
|
||||
[
|
||||
"identifier" => "cal_dav",
|
||||
"labelPhrase" => "profil/calendar_sync_cal_dav",
|
||||
"url" => APP_ROOT . "webdav/lvplan.php/calendars/" . $this->uid . "/LVPlan-" . $this->uid,
|
||||
],
|
||||
[
|
||||
"identifier" => "cal_dav_principal",
|
||||
"labelPhrase" => "profil/calendar_sync_cal_dav_principal",
|
||||
"url" => APP_ROOT . "webdav/lvplan.php/principals/" . $this->uid,
|
||||
],
|
||||
[
|
||||
"identifier" => "i_cal",
|
||||
"labelPhrase" => "profil/calendar_sync_i_cal",
|
||||
"url" => APP_ROOT . "webdav/google.php?cal=" . encryptData($this->uid, LVPLAN_CYPHER_KEY) . "&" . microtime(true),
|
||||
],
|
||||
];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -1,64 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2024 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 StgOrgLvPlan extends FHCAPI_Controller
|
||||
{
|
||||
|
||||
/**
|
||||
* Object initialization
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'stgOrgLvPlanViewData' => self::PERM_LOGGED,
|
||||
]);
|
||||
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
/**
|
||||
* fetches view data for stg org lv plan
|
||||
* @access public
|
||||
*/
|
||||
public function stgOrgLvPlanViewData()
|
||||
{
|
||||
$this->load->model('organisation/Studiengang_model', 'StudiengangModel');
|
||||
$this->StudiengangModel->addOrder('typ');
|
||||
$this->StudiengangModel->addOrder('kurzbz');
|
||||
$result = $this->StudiengangModel->loadWhere([
|
||||
'aktiv' => true
|
||||
]);
|
||||
$studiengaenge = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$viewData = array(
|
||||
'studiengaenge' => $studiengaenge,
|
||||
);
|
||||
|
||||
$this->terminateWithSuccess($viewData);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
// Private methods
|
||||
|
||||
}
|
||||
|
||||
@@ -1,67 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2024 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 Studiensemester extends FHCAPI_Controller
|
||||
{
|
||||
|
||||
private $_ci;
|
||||
|
||||
/**
|
||||
* Object initialization
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'getStudiensemester'=> self::PERM_LOGGED,
|
||||
|
||||
]);
|
||||
|
||||
$this->_ci =& get_instance();
|
||||
|
||||
$this->_ci->load->model('organisation/Studiensemester_model', 'StudiensemesterModel');
|
||||
|
||||
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
/**
|
||||
* GET METHOD
|
||||
* returns List of all studiensemester as well as current one
|
||||
*/
|
||||
public function getStudiensemester()
|
||||
{
|
||||
$this->_ci->StudiensemesterModel->addOrder("start", "DESC");
|
||||
$result = $this->_ci->StudiensemesterModel->load();
|
||||
|
||||
$studiensemester = getData($result);
|
||||
$result = $this->_ci->StudiensemesterModel->getAkt();
|
||||
$aktuell = getData($result);
|
||||
|
||||
$this->terminateWithSuccess(array($studiensemester, $aktuell));
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Private methods
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -62,36 +62,21 @@ class Studium extends FHCAPI_Controller
|
||||
|
||||
if($this->getDataOrTerminateWithError($this->StudentModel->isStudent(getAuthUID()))){
|
||||
$studentLehrverband =$this->StudentlehrverbandModel->loadWhere(["student_uid" => getAuthUID(), "studiensemester_kurzbz" => $aktuelles_studiensemester->studiensemester_kurzbz]);
|
||||
|
||||
//TODO(Manu) check if use Fallback or just comment out all paramschecks?
|
||||
//add Fallback: if no LehrverbandData of actual semester, get Data of previous one
|
||||
if(!hasData($studentLehrverband))
|
||||
{
|
||||
$result= $this->StudiensemesterModel->getPreviousFrom($aktuelles_studiensemester->studiensemester_kurzbz);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
$vorheriges_studiensemester = current($data)->studiensemester_kurzbz;
|
||||
$studentLehrverband =$this->StudentlehrverbandModel->loadWhere(["student_uid" => getAuthUID(), "studiensemester_kurzbz" => $vorheriges_studiensemester]);
|
||||
}
|
||||
$studentLehrverband = current(getData($studentLehrverband));
|
||||
|
||||
$studentLehrverband = current($this->getDataOrTerminateWithError($studentLehrverband));
|
||||
|
||||
$student_studiensemester = $studentLehrverband->studiensemester_kurzbz;
|
||||
$student_studiengang = $studentLehrverband->studiengang_kz;
|
||||
$student_semester = $studentLehrverband->semester;
|
||||
$student_studienplan = $this->getStudienPlanFromPrestudentStatus(getAuthPersonId())->studienplan_id;
|
||||
|
||||
if(!isset($parameter_studiensemester)) {
|
||||
$student_studiensemester = $studentLehrverband->studiensemester_kurzbz;
|
||||
$parameter_studiensemester = $student_studiensemester;
|
||||
}
|
||||
if(!isset($parameter_studiengang)) {
|
||||
$student_studiengang = $studentLehrverband->studiengang_kz;
|
||||
$parameter_studiengang = $student_studiengang;
|
||||
}
|
||||
if(!isset($parameter_semester)) {
|
||||
$student_semester = $studentLehrverband->semester;
|
||||
$parameter_semester = $student_semester;
|
||||
}
|
||||
if(!isset($parameter_studiensemester))
|
||||
$parameter_studiensemester = $student_studiensemester;
|
||||
if(!isset($parameter_studiengang))
|
||||
$parameter_studiengang = $student_studiengang;
|
||||
if(!isset($parameter_semester))
|
||||
$parameter_semester = $student_semester;
|
||||
if(!isset($parameter_studienplan))
|
||||
$parameter_studienplan = $student_studienplan;
|
||||
|
||||
$parameter_studienplan = $student_studienplan;
|
||||
}
|
||||
|
||||
if(isset($parameter_studiensemester)){
|
||||
@@ -111,7 +96,8 @@ class Studium extends FHCAPI_Controller
|
||||
|
||||
// fetch studiensemester
|
||||
$allStudienSemester = $this->getDataOrTerminateWithError($this->StudiensemesterModel->load());
|
||||
|
||||
|
||||
|
||||
if(isset($parameter_studiensemester) && !empty(array_filter($allStudienSemester, function($studiensemester) use($parameter_studiensemester){
|
||||
return $studiensemester->studiensemester_kurzbz == $parameter_studiensemester->studiensemester_kurzbz;
|
||||
}))){
|
||||
@@ -230,8 +216,6 @@ class Studium extends FHCAPI_Controller
|
||||
$studienplaene = array_map(function($studienplan){
|
||||
$orgform = current($this->getDataOrTerminateWithError($this->OrgformModel->loadWhere(["orgform_kurzbz" => $studienplan->orgform_kurzbz])));
|
||||
$studienplan->orgform_bezeichnung = $orgform->bezeichnung;
|
||||
// bezeichnung_mehrsprachig
|
||||
$studienplan->orgform_bezeichnung_english = $orgform->bezeichnung_mehrsprachig[1];
|
||||
return $studienplan;
|
||||
},$studienplaene);
|
||||
return $studienplaene;
|
||||
|
||||
@@ -1,367 +0,0 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class Zeitsperren extends FHCAPI_Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'getZeitsperrenUser' => self::PERM_LOGGED,
|
||||
'getTypenZeitsperren' => self::PERM_LOGGED,
|
||||
'getTypenErreichbarkeit' => self::PERM_LOGGED,
|
||||
'getStunden' => self::PERM_LOGGED,
|
||||
'loadZeitsperre' => self::PERM_LOGGED,
|
||||
'add' => self::PERM_LOGGED,
|
||||
'update' => self::PERM_LOGGED,
|
||||
'delete' => self::PERM_LOGGED,
|
||||
]);
|
||||
|
||||
// Load Libraries
|
||||
$this->load->library('VariableLib', ['uid' => getAuthUID()]);
|
||||
$this->load->library('form_validation');
|
||||
|
||||
// Load language phrases
|
||||
$this->loadPhrases([
|
||||
'ui',
|
||||
'person',
|
||||
'zeitsperren'
|
||||
]);
|
||||
|
||||
// Load models
|
||||
$this->load->model('ressource/Zeitsperre_model', 'ZeitsperreModel');
|
||||
$this->load->model('ressource/Zeitsperretyp_model', 'ZeitsperretypModel');
|
||||
$this->load->model('ressource/Erreichbarkeit_model', 'ErreichbarkeitModel');
|
||||
$this->load->model('ressource/Stunde_model', 'StundeModel');
|
||||
$this->load->model('ressource/Zeitaufzeichnung_model', 'ZeitaufzeichnungModel');
|
||||
}
|
||||
|
||||
public function getZeitsperrenUser($uid)
|
||||
{
|
||||
//check if $uid is passedUser
|
||||
$loggedInUser = getAuthUID();
|
||||
if($loggedInUser != $uid) {
|
||||
$this->load->library('PermissionLib');
|
||||
$isAdmin = $this->permissionlib->isBerechtigt('admin');
|
||||
if(!$isAdmin) {
|
||||
$this->terminateWithError($this->p->t('ui', 'noAdmin'), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
}
|
||||
|
||||
$result = $this->ZeitsperreModel->getZeitsperrenUser($uid);
|
||||
|
||||
if (isError($result)) {
|
||||
$this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
$this->terminateWithSuccess((getData($result) ?: []));
|
||||
}
|
||||
|
||||
public function getTypenZeitsperren()
|
||||
{
|
||||
$this->ZeitsperretypModel->addOrder('beschreibung', 'ASC');
|
||||
$result = $this->ZeitsperretypModel->load();
|
||||
if (isError($result)) {
|
||||
$this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
$this->terminateWithSuccess((getData($result) ?: []));
|
||||
}
|
||||
|
||||
public function getTypenErreichbarkeit()
|
||||
{
|
||||
$result = $this->ErreichbarkeitModel->load();
|
||||
if (isError($result)) {
|
||||
$this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
$this->terminateWithSuccess((getData($result) ?: []));
|
||||
}
|
||||
|
||||
public function getStunden()
|
||||
{
|
||||
$this->StundeModel->addOrder('stunde', 'ASC');
|
||||
$result = $this->StundeModel->load();
|
||||
if (isError($result)) {
|
||||
$this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
$this->terminateWithSuccess((getData($result) ?: []));
|
||||
}
|
||||
|
||||
public function loadZeitsperre($zeitsperre_id)
|
||||
{
|
||||
$this->ZeitsperreModel->addSelect(
|
||||
'campus.tbl_zeitsperre.*, typ.*,
|
||||
ma.person_id AS ma_person_id, ma.vorname AS ma_vorname, ma.nachname AS ma_nachname,
|
||||
ma.titelpre AS ma_titelpre, ma.titelpost AS ma_titelpost'
|
||||
);
|
||||
$this->ZeitsperreModel->addJoin('campus.tbl_zeitsperretyp typ', 'ON (typ.zeitsperretyp_kurzbz = campus.tbl_zeitsperre.zeitsperretyp_kurzbz)');
|
||||
$this->ZeitsperreModel->addJoin('public.tbl_benutzer ben', 'ON (ben.uid = campus.tbl_zeitsperre.vertretung_uid)', 'LEFT');
|
||||
$this->ZeitsperreModel->addJoin('public.tbl_person ma', 'ON (ma.person_id = ben.person_id)', 'LEFT');
|
||||
$result = $this->ZeitsperreModel->loadWhere(
|
||||
array('zeitsperre_id' => $zeitsperre_id)
|
||||
);
|
||||
|
||||
if (isError($result)) {
|
||||
$this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
$this->terminateWithSuccess((current(getData($result)) ?: []));
|
||||
}
|
||||
|
||||
public function add($mitarbeiter_uid)
|
||||
{
|
||||
$loggedInUser = getAuthUID();
|
||||
|
||||
if($mitarbeiter_uid != $loggedInUser)
|
||||
$this->terminateWithError($this->p->t('ui', 'noPermission'), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$this->form_validation->set_rules('zeitsperretyp_kurzbz', 'Grund Zeitsperre', 'required', [
|
||||
'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => 'Grund Zeitsperre'])
|
||||
]);
|
||||
|
||||
$this->form_validation->set_rules('vondatum', 'VonDatum', 'required|is_valid_date', [
|
||||
'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => 'VonDatum']),
|
||||
'is_valid_date' => $this->p->t('ui', 'error_notValidDate', ['field' => 'VonDatum'])
|
||||
]);
|
||||
|
||||
$this->form_validation->set_rules('bisdatum', 'BisDatum', 'required|is_valid_date|callback_check_von_bis_datum|callback_check_diff_intval', [
|
||||
'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => 'BisDatum']),
|
||||
'is_valid_date' => $this->p->t('ui', 'error_notValidDate', ['field' => 'BisDatum']),
|
||||
'check_von_bis_datum' => $this->p->t('zeitsperre', 'error_VonDatumGroesserAlsBisDatum'),
|
||||
'check_diff_intval' => $this->p->t('zeitsperre', 'error_zeitraumAuffallendHoch')
|
||||
]);
|
||||
|
||||
if ($this->form_validation->run() == false)
|
||||
{
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
}
|
||||
|
||||
$bezeichnung = $this->input->post('bezeichnung');
|
||||
$vondatum = $this->input->post('vondatum');
|
||||
$vonstunde = $this->input->post('vonstunde');
|
||||
$bisdatum = $this->input->post('bisdatum');
|
||||
$bisstunde = $this->input->post('bisstunde');
|
||||
//$vonIso = $this->input->post('vonISO'); //Timestamp für Stunde
|
||||
//$bisIso = $this->input->post('bisISO'); //Timestamp für Stunde
|
||||
$erreichbarkeit_kurzbz = $this->input->post('erreichbarkeit_kurzbz');
|
||||
$vertretung_uid = $this->input->post('vertretung_uid');
|
||||
$zeitsperretyp_kurzbz = $this->input->post('zeitsperretyp_kurzbz');
|
||||
|
||||
//check if existing zeitsperre
|
||||
$result = $this->ZeitsperreModel->getSperreByDate($mitarbeiter_uid, $vondatum, $vonstunde, true);
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
if(hasData($result))
|
||||
{
|
||||
$this->terminateWithError($this->p->t('zeitsperren', 'error_existingZeitsperre', ['typ'=> current($data)->zeitsperretyp_kurzbz]), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
|
||||
//check if existing zeitaufzeichnung
|
||||
if(in_array($zeitsperretyp_kurzbz, Zeitsperre_model::BLOCKIERENDE_ZEITSPERREN))
|
||||
{
|
||||
$result = $this->ZeitsperreModel->existsZeitaufzeichnung($mitarbeiter_uid, $vondatum, $bisdatum);
|
||||
|
||||
if(hasData($result))
|
||||
$this->terminateWithError($this->p->t('zeitsperren', 'error_existingZeitaufzeichnung'), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
|
||||
$result = $this->ZeitsperreModel->insert(
|
||||
[
|
||||
'mitarbeiter_uid' => $mitarbeiter_uid,
|
||||
'bezeichnung' => $bezeichnung,
|
||||
'vondatum' => $vondatum,
|
||||
'vonstunde' => $vonstunde,
|
||||
'bisdatum' => $bisdatum,
|
||||
'bisstunde' => $bisstunde,
|
||||
'erreichbarkeit_kurzbz' => $erreichbarkeit_kurzbz,
|
||||
'zeitsperretyp_kurzbz' => $zeitsperretyp_kurzbz,
|
||||
'vertretung_uid' => $vertretung_uid,
|
||||
'insertvon' => $loggedInUser,
|
||||
'insertamum' => date('c'),
|
||||
]
|
||||
);
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
public function update($zeitsperre_id)
|
||||
{
|
||||
//check if loggedin User is owner of the zeitsperre
|
||||
$loggedInUser = getAuthUID();
|
||||
$result = $this->ZeitsperreModel->load($zeitsperre_id);
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
$uid = current($data)->mitarbeiter_uid;
|
||||
|
||||
if($uid != $loggedInUser)
|
||||
$this->terminateWithError($this->p->t('ui', 'noPermission'), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
if(!$zeitsperre_id)
|
||||
{
|
||||
return $this->terminateWithError($this->p->t('ui', 'error_missingId', ['id'=> 'Zeitsperre_id']), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
//get current params
|
||||
$array_update = [
|
||||
'bezeichnung',
|
||||
'vondatum',
|
||||
'vonstunde',
|
||||
'bisdatum',
|
||||
'bisstunde',
|
||||
// 'vonISO', //Timestamp für Stunde
|
||||
// 'bisISO', //Timestamp für Stunde
|
||||
'erreichbarkeit_kurzbz',
|
||||
'vertretung_uid',
|
||||
'zeitsperretyp_kurzbz',
|
||||
'mitarbeiter_uid',
|
||||
];
|
||||
$post = $this->input->post();
|
||||
$update = [];
|
||||
|
||||
foreach ($array_update as $prop)
|
||||
{
|
||||
if (array_key_exists($prop, $post))
|
||||
{
|
||||
$update[$prop] = $post[$prop];
|
||||
}
|
||||
}
|
||||
|
||||
// Validation
|
||||
$rulesDefined = false; //necessary, otherwise CI validation will always be triggered, even without rules
|
||||
foreach ($update as $key => $val) {
|
||||
switch ($key) {
|
||||
case 'zeitsperretyp_kurzbz':
|
||||
$this->form_validation->set_rules(
|
||||
$key,
|
||||
'Grund Zeitsperre',
|
||||
'required',
|
||||
['required' => $this->p->t('ui', 'error_fieldRequired', ['field'=>'Grund Zeitsperre'])]
|
||||
);
|
||||
$rulesDefined = true;
|
||||
break;
|
||||
case 'vondatum':
|
||||
$this->form_validation->set_rules(
|
||||
$key,
|
||||
'VonDatum',
|
||||
'required|is_valid_date',
|
||||
[
|
||||
'required' => $this->p->t('ui', 'error_fieldRequired', ['field'=>'VonDatum']),
|
||||
'is_valid_date' => $this->p->t('ui', 'error_notValidDate', ['field'=>'VonDatum'])
|
||||
]
|
||||
);
|
||||
$rulesDefined = true;
|
||||
break;
|
||||
case 'bisdatum':
|
||||
$rules = 'required|is_valid_date';
|
||||
if (array_key_exists('vondatum', $update)) {
|
||||
$rules .= '|callback_check_von_bis_datum|callback_check_diff_intval';
|
||||
}
|
||||
$this->form_validation->set_rules(
|
||||
$key,
|
||||
'BisDatum',
|
||||
$rules,
|
||||
[
|
||||
'required' => $this->p->t('ui', 'error_fieldRequired', ['field'=>'BisDatum']),
|
||||
'is_valid_date' => $this->p->t('ui', 'error_notValidDate', ['field'=>'BisDatum']),
|
||||
'check_von_bis_datum' => $this->p->t('zeitsperre', 'error_VonDatumGroesserAlsBisDatum'),
|
||||
'check_diff_intval' => $this->p->t('zeitsperre', 'error_zeitraumAuffallendHoch')
|
||||
]
|
||||
);
|
||||
$rulesDefined = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if ($rulesDefined && $this->form_validation->run() == false) {
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
}
|
||||
|
||||
if(array_key_exists('vondatum', $post) || array_key_exists('bisdatum', $post))
|
||||
{
|
||||
$result = $this->ZeitsperreModel->load($zeitsperre_id);
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
$data = current($data);
|
||||
|
||||
$mitarbeiter_uid = array_key_exists('mitarbeiter_uid', $post) ? $update['mitarbeiter_uid'] : $data->mitarbeiter_uid;
|
||||
$vondatum = array_key_exists('vondatum', $post) ? $update['vondatum'] : $data->vondatum;
|
||||
$bisdatum = array_key_exists('bisdatum', $post) ? $update['bisdatum'] : $data->bisdatum;
|
||||
$vonstunde = array_key_exists('vonstunde', $post) ? $update['vonstunde'] : $data->vonstunde;
|
||||
$zeitsperretyp_kurzbz = array_key_exists('zeitsperretyp_kurzbz', $post) ? $update['zeitsperretyp_kurzbz'] : $data->zeitsperretyp_kurzbz;
|
||||
|
||||
$result = $this->ZeitsperreModel->getSperreByDate($mitarbeiter_uid, $vondatum, $vonstunde, true);
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
if(hasData($result))
|
||||
{
|
||||
$this->terminateWithError($this->p->t('zeitsperren', 'error_existingZeitsperre', ['typ'=> current($data)->zeitsperretyp_kurzbz]), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
|
||||
//check if existing zeitaufzeichnung
|
||||
if(in_array($zeitsperretyp_kurzbz, Zeitsperre_model::BLOCKIERENDE_ZEITSPERREN))
|
||||
{
|
||||
$result = $this->ZeitsperreModel->existsZeitaufzeichnung($mitarbeiter_uid, $vondatum, $bisdatum);
|
||||
|
||||
if(hasData($result))
|
||||
$this->terminateWithError($this->p->t('zeitsperren', 'error_existingZeitaufzeichnung'), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($update)) {
|
||||
$update['updatevon'] = $loggedInUser;
|
||||
$update['updateamum'] = date('c');
|
||||
$result = $this->ZeitsperreModel->update($zeitsperre_id, $update);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
else
|
||||
$this->terminateWithSuccess("no update");
|
||||
}
|
||||
|
||||
public function delete($zeitsperre_id)
|
||||
{
|
||||
|
||||
if (!is_numeric($zeitsperre_id) || (int)$zeitsperre_id <= 0)
|
||||
{
|
||||
$this->terminateWithError($this->p->t('ui', 'error_missingId', ['id' => 'Zeitsperre_id']), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
|
||||
//check if loggedin User is owner of the zeitsperre
|
||||
$loggedInUser = getAuthUID();
|
||||
$result = $this->ZeitsperreModel->load($zeitsperre_id);
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
$uid = current($data)->mitarbeiter_uid;
|
||||
|
||||
if($uid != $loggedInUser)
|
||||
$this->terminateWithError($this->p->t('ui', 'noPermission'), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$result = $this->ZeitsperreModel->delete(
|
||||
array('zeitsperre_id' => $zeitsperre_id)
|
||||
);
|
||||
|
||||
if (isError($result)) {
|
||||
$this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
$this->terminateWithSuccess((getData($result) ?: []));
|
||||
}
|
||||
|
||||
public function check_von_bis_datum($bisdatum)
|
||||
{
|
||||
$vondatum = $this->input->post('vondatum');
|
||||
|
||||
return $vondatum <= $bisdatum;
|
||||
}
|
||||
|
||||
public function check_diff_intval($bisdatum)
|
||||
{
|
||||
$vondatum = $this->input->post('vondatum');
|
||||
|
||||
// Intervall in days
|
||||
$vonTs = strtotime($vondatum);
|
||||
$bisTs = strtotime($bisdatum);
|
||||
|
||||
$tage = ($bisTs - $vonTs) / 86400;
|
||||
|
||||
// if intervall > 14
|
||||
return $tage <= 14;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,232 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2024 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 RoomPlan extends FHCAPI_Controller
|
||||
{
|
||||
|
||||
/**
|
||||
* Object initialization
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'addRoomReservation' => self::PERM_LOGGED,
|
||||
'deleteRoomReservation' => self::PERM_LOGGED,
|
||||
'getRoomCreationInfo' => self::PERM_LOGGED,
|
||||
'getGruppen' => self::PERM_LOGGED,
|
||||
'getLektor' => self::PERM_LOGGED,
|
||||
'getReservableMap' => self::PERM_LOGGED,
|
||||
]);
|
||||
|
||||
$this->load->library('LogLib');
|
||||
$this->loglib->setConfigs(array(
|
||||
'classIndex' => 5,
|
||||
'functionIndex' => 5,
|
||||
'lineIndex' => 4,
|
||||
'dbLogType' => 'API',
|
||||
'dbExecuteUser' => 'RESTful API'
|
||||
));
|
||||
|
||||
$this->load->library('form_validation');
|
||||
$this->load->library('PermissionLib');
|
||||
$this->load->library('StundenplanLib');
|
||||
|
||||
$this->loadPhrases(['ui']);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
|
||||
|
||||
public function addRoomReservation()
|
||||
{
|
||||
$this->form_validation->set_rules('selectedStart', "Start", "required");
|
||||
$this->form_validation->set_rules('selectedEnd', "End", "required");
|
||||
$this->form_validation->set_rules('title', "Title", "required|max_length[10]");
|
||||
$this->form_validation->set_rules('beschreibung', "Beschreibung", "required|max_length[32]");
|
||||
$this->form_validation->set_rules('ort_kurzbz', "Ort", "required|max_length[16]");
|
||||
$this->form_validation->set_rules('studiengang', 'Studiengang', 'numeric');
|
||||
$this->form_validation->set_rules('semester', 'Semester', 'integer|greater_than_equal_to[0]');
|
||||
$this->form_validation->set_rules('verband', 'Verband', 'trim');
|
||||
$this->form_validation->set_rules('gruppe', 'Gruppe', 'trim');
|
||||
$this->form_validation->set_rules('spezialgruppe', 'Spezialgruppe', 'max_length[32]');
|
||||
$this->form_validation->set_rules('lektoren', 'Lektoren');
|
||||
|
||||
if (!$this->form_validation->run())
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
$start = $this->input->post('selectedStart');
|
||||
$end = $this->input->post('selectedEnd');
|
||||
$title = $this->input->post('title');
|
||||
$beschreibung = $this->input->post('beschreibung');
|
||||
$ort_kurzbz = $this->input->post('ort_kurzbz');
|
||||
|
||||
$studiengang_kz = $this->input->post('studiengang');
|
||||
$semester = $this->input->post('semester');
|
||||
$verband = $this->input->post('verband');
|
||||
$gruppe = $this->input->post('gruppe');
|
||||
$spezialgruppe = $this->input->post('spezialgruppe');
|
||||
$lektoren = $this->input->post('lektoren');
|
||||
|
||||
|
||||
$result = $this->stundenplanlib->addReservation($start, $end, $title, $beschreibung, $ort_kurzbz, $lektoren, $studiengang_kz, $semester, $verband, $gruppe, $spezialgruppe);
|
||||
|
||||
if (isError($result))
|
||||
$this->terminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($result);
|
||||
}
|
||||
|
||||
public function deleteRoomReservation()
|
||||
{
|
||||
$reservierung_id = $this->input->post('reservierung_id');
|
||||
|
||||
$result = $this->stundenplanlib->deleteReservation($reservierung_id);
|
||||
|
||||
if (isError($result))
|
||||
$this->terminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($result);
|
||||
}
|
||||
|
||||
public function getRoomCreationInfo()
|
||||
{
|
||||
$return_array = array('berechtigt' => false, 'studiengaenge' => []);
|
||||
if (!$this->permissionlib->isBerechtigt('lehre/reservierung'))
|
||||
$this->terminateWithSuccess($return_array);
|
||||
|
||||
$stg_berechtigungen = $this->permissionlib->getSTG_isEntitledFor('lehre/reservierung');
|
||||
if (isEmptyArray($stg_berechtigungen))
|
||||
$this->terminateWithSuccess($return_array);
|
||||
|
||||
$this->load->model('organisation/Studiengang_model', 'StudiengangModel');
|
||||
$this->StudiengangModel->addSelect('studiengang_kz, UPPER(CONCAT(typ, kurzbz)) as kuerzel, kurzbzlang');
|
||||
$this->StudiengangModel->addOrder('typ, kurzbz');
|
||||
$this->StudiengangModel->db->where_in('studiengang_kz', $stg_berechtigungen);
|
||||
$studiengaenge = $this->StudiengangModel->loadWhere(array('aktiv' => true));
|
||||
|
||||
if (isError($studiengaenge))
|
||||
$this->terminateWithError($studiengaenge);
|
||||
|
||||
$return_array['studiengaenge'] = hasData($studiengaenge) ? getData($studiengaenge) : [];
|
||||
$return_array['berechtigt'] = true;
|
||||
|
||||
$this->terminateWithSuccess($return_array);
|
||||
}
|
||||
|
||||
public function getGruppen()
|
||||
{
|
||||
$query = $this->input->get('query');
|
||||
if (is_null($query))
|
||||
$this->terminateWithError($this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$stg_berechtigungen = $this->permissionlib->getSTG_isEntitledFor('lehre/reservierung');
|
||||
|
||||
if (isEmptyArray($stg_berechtigungen))
|
||||
$this->terminateWithSuccess([]);
|
||||
|
||||
$this->load->model('organisation/gruppe_model', 'GruppeModel');
|
||||
|
||||
$query_words = explode(' ', urldecode($query));
|
||||
|
||||
$this->GruppeModel->addOrder('gruppe_kurzbz');
|
||||
$this->GruppeModel->db->group_start();
|
||||
foreach ($query_words as $word)
|
||||
{
|
||||
$this->GruppeModel->db->group_start();
|
||||
$this->GruppeModel->db->where('gruppe_kurzbz ILIKE', "%" . $word . "%");
|
||||
$this->GruppeModel->db->or_where('bezeichnung ILIKE', "%" . $word . "%");
|
||||
$this->GruppeModel->db->or_where('beschreibung ILIKE', "%" . $word . "%");
|
||||
$this->GruppeModel->db->or_where('orgform_kurzbz ILIKE', "%" . $word . "%");
|
||||
|
||||
if (is_numeric($word))
|
||||
{
|
||||
$this->GruppeModel->db->or_where('studiengang_kz', $word);
|
||||
}
|
||||
$this->GruppeModel->db->group_end();
|
||||
}
|
||||
$this->GruppeModel->db->group_end();
|
||||
$this->GruppeModel->db->where_in('studiengang_kz', $stg_berechtigungen);
|
||||
$gruppen = $this->GruppeModel->loadWhere(array('sichtbar' => true, 'lehre' => true));
|
||||
if (isError($gruppen))
|
||||
$this->terminateWithError($gruppen);
|
||||
|
||||
$this->terminateWithSuccess(hasData($gruppen) ? getData($gruppen) : []);
|
||||
}
|
||||
|
||||
public function getLektor()
|
||||
{
|
||||
|
||||
$query = $this->input->get('query');
|
||||
if (is_null($query))
|
||||
$this->terminateWithError($this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$stg_berechtigungen = $this->permissionlib->getSTG_isEntitledFor('lehre/reservierung');
|
||||
|
||||
if (isEmptyArray($stg_berechtigungen))
|
||||
$this->terminateWithSuccess([]);
|
||||
|
||||
$this->load->model('ressource/Mitarbeiter_model', 'MitarbeiterModel');
|
||||
|
||||
$query_words = explode(' ', urldecode($query));
|
||||
|
||||
$this->MitarbeiterModel->addSelect('uid, person_id, vorname, nachname');
|
||||
$this->MitarbeiterModel->addJoin('public.tbl_benutzer', 'uid = mitarbeiter_uid');
|
||||
$this->MitarbeiterModel->addJoin('public.tbl_person', 'person_id');
|
||||
$this->MitarbeiterModel->db->where('public.tbl_benutzer.aktiv', true);
|
||||
$this->MitarbeiterModel->db->group_start();
|
||||
foreach ($query_words as $word)
|
||||
{
|
||||
$this->MitarbeiterModel->db->group_start();
|
||||
$this->MitarbeiterModel->db->where('tbl_person.vorname ILIKE', "%" . $word . "%");
|
||||
$this->MitarbeiterModel->db->or_where('tbl_person.nachname ILIKE', "%" . $word . "%");
|
||||
$this->MitarbeiterModel->db->or_where('uid ILIKE', "%" . $word . "%");
|
||||
$this->MitarbeiterModel->db->group_end();
|
||||
}
|
||||
$this->MitarbeiterModel->db->group_end();
|
||||
|
||||
$this->MitarbeiterModel->addOrder('nachname');
|
||||
$this->MitarbeiterModel->addOrder('vorname');
|
||||
$mitarbeiter = $this->MitarbeiterModel->load();
|
||||
if (isError($mitarbeiter))
|
||||
$this->terminateWithError($mitarbeiter);
|
||||
|
||||
$this->terminateWithSuccess(hasData($mitarbeiter) ? getData($mitarbeiter) : []);
|
||||
}
|
||||
|
||||
public function getReservableMap($ort_kurzbz = null)
|
||||
{
|
||||
$this->form_validation->set_rules('start_date', "StartDate", "required");
|
||||
$this->form_validation->set_rules('end_date', "EndDate", "required");
|
||||
|
||||
if (!$this->form_validation->run())
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
// storing the post parameter in local variables
|
||||
$start_date = $this->input->post('start_date', true);
|
||||
$end_date = $this->input->post('end_date', true);
|
||||
|
||||
$result = $this->stundenplanlib->getReservableMap($ort_kurzbz, $start_date, $end_date);
|
||||
|
||||
$this->terminateWithSuccess(array('reservierbarMap' => hasData($result) ? getData($result) : []));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,142 +0,0 @@
|
||||
<?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()
|
||||
{
|
||||
$this->DashboardModel->addSelect('dashboard_id');
|
||||
$this->DashboardModel->addSelect('dashboard_kurzbz');
|
||||
$this->DashboardModel->addSelect('tbl_dashboard.beschreibung');
|
||||
$this->DashboardModel->addSelect("(
|
||||
SELECT json_agg(w.*)
|
||||
FROM dashboard.tbl_widget w
|
||||
JOIN dashboard.tbl_dashboard_widget dw
|
||||
USING(widget_id)
|
||||
WHERE dw.dashboard_id=tbl_dashboard.dashboard_id
|
||||
) AS \"widgetSetup\"");
|
||||
|
||||
$result = $this->DashboardModel->load();
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$data = array_map(function ($dashboard) {
|
||||
$tmpSetups = json_decode($dashboard->widgetSetup);
|
||||
$tmpSetups = array_map(function ($widget) {
|
||||
$widget->setup->file = absoluteJsImportUrl($widget->setup->file);
|
||||
return $widget;
|
||||
}, $tmpSetups);
|
||||
$dashboard->widgetSetup = $tmpSetups;
|
||||
return $dashboard;
|
||||
}, $data);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
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($data);
|
||||
}
|
||||
|
||||
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($data);
|
||||
}
|
||||
}
|
||||
@@ -1,199 +0,0 @@
|
||||
<?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);
|
||||
$result[$funktion] = $preset;
|
||||
} 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);
|
||||
|
||||
$preset_decoded[$widget['widgetid']] = $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 (!isset($preset_decoded[$widgetid]))
|
||||
show_404();
|
||||
|
||||
unset($preset_decoded[$widgetid]);
|
||||
|
||||
$preset->preset = json_encode($preset_decoded);
|
||||
|
||||
$result = $this->dashboardlib->insertOrUpdatePreset($preset);
|
||||
|
||||
$this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess(array('msg' => $this->p->t('dashboard', 'success_savePreset')));
|
||||
}
|
||||
}
|
||||
@@ -1,124 +0,0 @@
|
||||
<?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->getMergedUserConfig($dashboard->dashboard_id, $uid);
|
||||
|
||||
$this->terminateWithSuccess($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);
|
||||
|
||||
if (isset($widget['source']))
|
||||
unset($widget['source']);
|
||||
|
||||
$override = $this->dashboardlib->getOverrideOrCreateEmptyOverride($dashboard_kurzbz, $uid);
|
||||
|
||||
$override_decoded = json_decode($override->override, true);
|
||||
|
||||
$override_decoded[$widget['widgetid']] = $widget;
|
||||
|
||||
$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);
|
||||
|
||||
if (!isset($override_decoded[$widget_id]))
|
||||
show_404();
|
||||
|
||||
unset($override_decoded[$widget_id]);
|
||||
|
||||
$override->override = json_encode($override_decoded);
|
||||
|
||||
$result = $this->dashboardlib->insertOrUpdateOverride($override);
|
||||
|
||||
$this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess();
|
||||
}
|
||||
}
|
||||
@@ -1,137 +0,0 @@
|
||||
<?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);
|
||||
}
|
||||
}
|
||||
@@ -1,218 +0,0 @@
|
||||
<?php
|
||||
/**
|
||||
* FH-Complete
|
||||
*
|
||||
* @package FHC-API
|
||||
* @author FHC-Team
|
||||
* @copyright Copyright (c) 2016, fhcomplete.org
|
||||
* @license GPLv3
|
||||
* @link http://fhcomplete.org
|
||||
* @since Version 1.0
|
||||
* @filesource
|
||||
*/
|
||||
// ------------------------------------------------------------------------
|
||||
|
||||
if (!defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
use CI3_Events as Events;
|
||||
|
||||
class PaabgabeUebersicht extends FHCAPI_Controller
|
||||
{
|
||||
const DOWNLOAD_PERMISSION = 'lehre/abgabetool:download';
|
||||
const ABGABE_TYPES = ['Bachelor', 'Diplom'];
|
||||
|
||||
/**
|
||||
* PaabgabeUebersicht API constructor.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'viewData' => self::PERM_LOGGED,
|
||||
'getPaAbgaben' => array('lehre/abgabetool:r'),
|
||||
'getStudiengaenge' => array('lehre/abgabetool:r'),
|
||||
'getTermine' => array('lehre/abgabetool:r'),
|
||||
'getPaAbgabetypen' => array('lehre/abgabetool:r'),
|
||||
'downloadZip' => array('lehre/abgabetool:r'),
|
||||
//'downloadProjektarbeit' => array('lehre/abgabetool:r')
|
||||
]);
|
||||
|
||||
$this->load->model('education/Paabgabe_model', 'PaabgabeModel');
|
||||
|
||||
$this->load->library('PermissionLib');
|
||||
|
||||
// Load Phrases
|
||||
$this->loadPhrases([
|
||||
'abgabetool'
|
||||
]);
|
||||
}
|
||||
|
||||
public function viewData()
|
||||
{
|
||||
$viewData = [
|
||||
"uid" => getAuthUID(),
|
||||
// TODO create permission
|
||||
"showEdit" => true,
|
||||
];
|
||||
|
||||
$this->terminateWithSuccess($viewData);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Projektabgaben for search criteria.
|
||||
*/
|
||||
public function getPaAbgaben()
|
||||
{
|
||||
$studiengang_kz = $this->input->get('studiengang_kz');
|
||||
$abgabetyp_kurzbz = $this->input->get('abgabetyp_kurzbz');
|
||||
$abgabedatum = $this->input->get('abgabedatum');
|
||||
$personSearchString = $this->input->get('personSearchString');
|
||||
|
||||
$result = $this->PaabgabeModel->getPaAbgaben(self::ABGABE_TYPES, $studiengang_kz, $abgabetyp_kurzbz, $abgabedatum, $personSearchString);
|
||||
|
||||
if (isError($result)) $this->terminateWithError(getError($result), self::ERROR_TYPE_DB);
|
||||
|
||||
// check wether Abgabe is in visual library
|
||||
if (hasData($result))
|
||||
{
|
||||
Events::trigger('in_visual_library', getData($result));
|
||||
}
|
||||
|
||||
$this->terminateWithSuccess(getData($result) ?: []);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all Studiengänge for which user is entitled for
|
||||
*/
|
||||
public function getStudiengaenge()
|
||||
{
|
||||
$studiengang_kz_arr = $this->permissionlib->getSTG_isEntitledFor(self::DOWNLOAD_PERMISSION);
|
||||
|
||||
if (!$studiengang_kz_arr) $this->terminateWithSuccess([]);
|
||||
|
||||
$this->load->model('organisation/Studiengang_model', 'StudiengangModel');
|
||||
|
||||
$this->StudiengangModel->addSelect('tbl_studiengang.*, UPPER(tbl_studiengang.typ || tbl_studiengang.kurzbz) AS kuerzel', $studiengang_kz_arr);
|
||||
$this->StudiengangModel->db->where_in('studiengang_kz', $studiengang_kz_arr);
|
||||
$this->StudiengangModel->addOrder('typ, kurzbz');
|
||||
$result = $this->StudiengangModel->load();
|
||||
|
||||
if (isError($result)) $this->terminateWithError(getError($result), self::ERROR_TYPE_DB);
|
||||
|
||||
$this->terminateWithSuccess((getData($result) ?: []));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get projekt work due dates, depending on search criteria.
|
||||
*/
|
||||
public function getTermine()
|
||||
{
|
||||
$studiengang_kz = $this->input->get('studiengang_kz');
|
||||
$abgabetyp_kurzbz = $this->input->get('abgabetyp_kurzbz');
|
||||
|
||||
$result = $this->PaabgabeModel->getTermine(self::ABGABE_TYPES, $studiengang_kz, $abgabetyp_kurzbz);
|
||||
|
||||
if (isError($result)) $this->terminateWithError(getError($result), self::ERROR_TYPE_DB);
|
||||
|
||||
$this->terminateWithSuccess((getData($result) ?: []));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get all submission types.
|
||||
*/
|
||||
public function getPaAbgabetypen()
|
||||
{
|
||||
// Load model PaabgabetypModel
|
||||
$this->load->model('education/Paabgabetyp_model', 'PaabgabetypModel');
|
||||
|
||||
$this->PaabgabetypModel->addOrder('bezeichnung');
|
||||
$result = $this->PaabgabetypModel->load();
|
||||
|
||||
if (isError($result)) $this->terminateWithError(getError($result), self::ERROR_TYPE_DB);
|
||||
|
||||
$this->terminateWithSuccess((getData($result) ?: []));
|
||||
}
|
||||
|
||||
/**
|
||||
* Download zip files with project works matching submission search criteria.
|
||||
*/
|
||||
public function downloadZip()
|
||||
{
|
||||
$studiengang_kz = $this->input->get('studiengang_kz');
|
||||
$abgabetyp_kurzbz = $this->input->get('abgabetyp_kurzbz');
|
||||
$abgabedatum = $this->input->get('abgabedatum');
|
||||
$personSearchString = $this->input->get('personSearchString');
|
||||
|
||||
if (!isset($studiengang_kz) && !isset($abgabetyp_kurzbz) && !isset($abgabedatum) && !isset($personSearchString))
|
||||
$this->terminateWithFileOutput('text/plain', $this->p->t('abgabetool', 'nichtsAusgewaehlt'));
|
||||
|
||||
$this->load->library('zip');
|
||||
|
||||
$result = $this->PaabgabeModel->getPaAbgaben(self::ABGABE_TYPES, $studiengang_kz, $abgabetyp_kurzbz, $abgabedatum, $personSearchString);
|
||||
|
||||
if (isError($result)) $this->terminateWithFileOutput('text/plain', getError($result));
|
||||
|
||||
$fileExists = false;
|
||||
$studiengang_kuerzel = null;
|
||||
|
||||
if (!hasData($result)) $this->terminateWithFileOutput('text/plain', $this->p->t('abgabetool', 'keineDateienVorhanden'));
|
||||
|
||||
$abgaben = getData($result);
|
||||
|
||||
foreach ($abgaben as $abgabe)
|
||||
{
|
||||
$path = PAABGABE_PATH.$abgabe->paabgabe_id.'_'.$abgabe->uid.'.pdf';
|
||||
if (file_exists($path))
|
||||
{
|
||||
$fileExists = true;
|
||||
$studiengang_kuerzel = $abgabe->studiengang_kuerzel;
|
||||
$this->zip->read_file($path);
|
||||
}
|
||||
}
|
||||
|
||||
if (!$fileExists) $this->terminateWithFileOutput('text/plain', $this->p->t('abgabetool', 'keineDateienVorhanden'));
|
||||
|
||||
$studiengang_kz = $this->input->get('studiengang_kz');
|
||||
$zipFileName = 'Abgabe'.(isset($studiengang_kz) && isset($studiengang_kuerzel) ? '_'.$studiengang_kuerzel : '').'.zip';
|
||||
$this->zip->download($zipFileName);
|
||||
}
|
||||
|
||||
/**
|
||||
* Download Projektarbeit document.
|
||||
*/
|
||||
//~ public function downloadProjektarbeit()
|
||||
//~ {
|
||||
//~ $paabgabe_id = $this->input->get('paabgabe_id');
|
||||
|
||||
//~ if (!is_numeric($paabgabe_id))
|
||||
//~ $this->terminateWithError($this->p->t('ui', 'error_missingId', ['id' => 'Abgabe ID']), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
//~ //$abgabeRes = $this->PaabgabeModel->getEndabgabe($projektarbeit_id);
|
||||
//~ $this->PaabgabeModel->addSelect("paabgabe_id, student_uid, tbl_paabgabe.datum, tbl_paabgabe.abgabedatum, projekttyp_kurzbz, titel, titel_english,
|
||||
//~ paabgabe_id || '_' || student_uid || '.pdf' AS filename");
|
||||
//~ $this->PaabgabeModel->addJoin('lehre.tbl_projektarbeit', 'projektarbeit_id');
|
||||
//~ $abgabeRes = $this->PaabgabeModel->load($paabgabe_id);
|
||||
|
||||
//~ if (isError($abgabeRes))
|
||||
//~ show_error(getError($abgabeRes));
|
||||
|
||||
//~ if (hasData($abgabeRes))
|
||||
//~ {
|
||||
//~ $endabgabe = getData($abgabeRes)[0];
|
||||
//~ $filepath = PAABGABE_PATH.$endabgabe->filename;
|
||||
|
||||
//~ if (file_exists($filepath))
|
||||
//~ {
|
||||
//~ $this->output
|
||||
//~ ->set_status_header(200)
|
||||
//~ ->set_content_type('application/pdf', 'utf-8')
|
||||
//~ ->set_header('Content-Disposition: attachment; filename="'.$endabgabe->filename.'"')
|
||||
//~ ->set_output(file_get_contents($filepath))
|
||||
//~ ->_display();
|
||||
//~ }
|
||||
//~ else
|
||||
//~ {
|
||||
//~ show_error("File does not exist.");
|
||||
//~ }
|
||||
//~ }
|
||||
//~ }
|
||||
}
|
||||
@@ -42,22 +42,14 @@ class Messages extends FHCAPI_Controller
|
||||
]);
|
||||
}
|
||||
|
||||
public function getMessages($id, $type_id, $size=null, $page=null)
|
||||
public function getMessages($id, $type_id, $size, $page)
|
||||
{
|
||||
if($type_id != 'person_id'){
|
||||
$id = $this->_getPersonId($id, $type_id);
|
||||
}
|
||||
|
||||
if(!(is_null($size) && is_null($page)))
|
||||
{
|
||||
$offset = $size * ($page - 1);
|
||||
$limit = $size;
|
||||
}
|
||||
else
|
||||
{
|
||||
$offset = null;
|
||||
$limit = null;
|
||||
}
|
||||
$offset = $size * ($page - 1);
|
||||
$limit = $size;
|
||||
|
||||
$result = $this->MessageModel->getMessagesForTable($id, $offset, $limit);
|
||||
|
||||
|
||||
@@ -78,32 +78,52 @@ 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);
|
||||
|
||||
$mergedArray = [];
|
||||
$docNames = array_map(function ($item) {
|
||||
return $item->dokument_kurzbz;
|
||||
}, $resultPreDoc);
|
||||
|
||||
foreach ($resultPreDoc as $pre)
|
||||
foreach($docNames as $doc)
|
||||
{
|
||||
$result = $this->AkteModel->getAktenFAS($person_id, $pre->dokument_kurzbz, $studiengang_kz, $prestudent_id, true);
|
||||
$result = $this->AkteModel->getAktenFAS($person_id, $doc, $studiengang_kz, $prestudent_id, true);
|
||||
|
||||
if (isError($result))
|
||||
{
|
||||
return $this->terminateWithError($result, self::ERROR_TYPE_GENERAL);
|
||||
|
||||
}
|
||||
if (hasData($result))
|
||||
{
|
||||
foreach (getData($result) as $doc)
|
||||
$data = getData($result);
|
||||
foreach ($data as $value)
|
||||
{
|
||||
$merged = clone $doc;
|
||||
$merged->docdatum = $pre->docdatum;
|
||||
$merged->insertvonma = $pre->insertvonma;
|
||||
$merged->bezeichnung = $pre->bezeichnung;
|
||||
$mergedArray[] = $merged;
|
||||
array_push($arrayAccepted, $value);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$mergedArray[] = $pre;
|
||||
}
|
||||
|
||||
//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;
|
||||
}
|
||||
|
||||
$mergedArray[] = $merged;
|
||||
}
|
||||
|
||||
$this->terminateWithSuccess($mergedArray);
|
||||
|
||||
@@ -48,8 +48,7 @@ class Konto extends FHCAPI_Controller
|
||||
|
||||
// Load language phrases
|
||||
$this->loadPhrases([
|
||||
'konto',
|
||||
'lehre'
|
||||
'konto'
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -113,7 +112,7 @@ class Konto extends FHCAPI_Controller
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function getBuchungstypen($studiensemester_kurzbz = null)
|
||||
public function getBuchungstypen()
|
||||
{
|
||||
$this->load->model('crm/Buchungstyp_model', 'BuchungstypModel');
|
||||
|
||||
@@ -123,7 +122,6 @@ class Konto extends FHCAPI_Controller
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->_getOEHBeitrag($data, $studiensemester_kurzbz);
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
@@ -496,43 +494,4 @@ 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,44 +851,40 @@ 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');
|
||||
|
||||
if(defined('STV_TAGS_ENABLED') && STV_TAGS_ENABLED)
|
||||
{
|
||||
$tags = $this->config->item('stv_prestudent_tags');
|
||||
$whereTags = '';
|
||||
if (is_array($tags) && !isEmptyArray($tags)) {
|
||||
$tags = array_keys($tags);
|
||||
|
||||
$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) . ")";
|
||||
foreach ($tags as $key => $tag) {
|
||||
$tags[$key] = $this->db->escape($tag);
|
||||
}
|
||||
$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
|
||||
";
|
||||
$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
|
||||
";
|
||||
|
||||
$this->PrestudentModel->addJoin('public.tbl_studiengang stg', 'studiengang_kz', 'LEFT');
|
||||
$this->PrestudentModel->addJoin('public.tbl_person p', 'person_id');
|
||||
@@ -911,17 +907,11 @@ 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');
|
||||
|
||||
if(defined('STV_TAGS_ENABLED') && STV_TAGS_ENABLED)
|
||||
{
|
||||
$this->PrestudentModel->addJoin($subQueryTag, 'tag_data_agg.prestudent_id = tbl_prestudent.prestudent_id', 'LEFT');
|
||||
}
|
||||
$this->PrestudentModel->addJoin($subQueryTag, 'tag_data_agg.prestudent_id = tbl_prestudent.prestudent_id', 'LEFT');
|
||||
|
||||
|
||||
$this->PrestudentModel->addSelect("b.uid");
|
||||
if(defined('STV_TAGS_ENABLED') && STV_TAGS_ENABLED)
|
||||
{
|
||||
$this->PrestudentModel->addSelect('tag_data_agg.tags');
|
||||
}
|
||||
$this->PrestudentModel->addSelect('tag_data_agg.tags');
|
||||
$this->PrestudentModel->addSelect('titelpre');
|
||||
$this->PrestudentModel->addSelect('nachname');
|
||||
$this->PrestudentModel->addSelect('vorname');
|
||||
|
||||
@@ -13,13 +13,12 @@ class Mylv extends Auth_Controller
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
|
||||
parent::__construct([
|
||||
'Student' => ['student/anrechnung_beantragen:r','user:r', 'basis/cis:r'], // TODO(chris): permissions?
|
||||
'Studiensemester' => ['student/anrechnung_beantragen:r','user:r', 'basis/cis:r'], // TODO(chris): permissions?
|
||||
'Lvs' => ['student/anrechnung_beantragen:r','user:r', 'basis/cis:r'], // TODO(chris): permissions?
|
||||
'Info' => ['student/anrechnung_beantragen:r','user:r', 'basis/cis:r'], // TODO(chris): permissions?
|
||||
'Pruefungen' => ['student/anrechnung_beantragen:r','user:r', 'basis/cis:r'] // TODO(chris): permissions?
|
||||
'Student' => ['student/anrechnung_beantragen:r','user:r'], // TODO(chris): permissions?
|
||||
'Studiensemester' => ['student/anrechnung_beantragen:r','user:r'], // TODO(chris): permissions?
|
||||
'Lvs' => ['student/anrechnung_beantragen:r','user:r'], // TODO(chris): permissions?
|
||||
'Info' => ['student/anrechnung_beantragen:r','user:r'], // TODO(chris): permissions?
|
||||
'Pruefungen' => ['student/anrechnung_beantragen:r','user:r'] // TODO(chris): permissions?
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -45,27 +44,13 @@ class Mylv extends Auth_Controller
|
||||
public function Studiensemester()
|
||||
{
|
||||
$this->load->model('organisation/Studiensemester_model', 'StudiensemesterModel');
|
||||
$this->load->model('crm/Student_model', 'StudentModel');
|
||||
$this->load->model('ressource/Mitarbeiter_model', 'MitarbeiterModel');
|
||||
|
||||
$isMitarbeiter = getData($this->MitarbeiterModel->isMitarbeiter(getAuthUID())) ?? false;
|
||||
if($isMitarbeiter) {
|
||||
$result = $this->StudiensemesterModel->getWhereMitarbeiterHasLvs(getAuthUID());
|
||||
$result = $this->StudiensemesterModel->getWhereStudentHasLvs(getAuthUID());
|
||||
|
||||
if (isError($result))
|
||||
return $this->outputJsonError(getError($result));
|
||||
if (isError($result))
|
||||
return $this->outputJsonError(getError($result));
|
||||
|
||||
$this->outputJsonSuccess(getData($result));
|
||||
} else if(getData($this->StudentModel->isStudent(getAuthUID())) ?? false) { // $isStudent
|
||||
$result = $this->StudiensemesterModel->getWhereStudentHasLvs(getAuthUID());
|
||||
|
||||
if (isError($result))
|
||||
return $this->outputJsonError(getError($result));
|
||||
|
||||
$this->outputJsonSuccess(getData($result));
|
||||
} else {
|
||||
$this->outputJsonError('neither student or mitarbeiter');
|
||||
}
|
||||
$this->outputJsonSuccess(getData($result));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -73,27 +58,13 @@ class Mylv extends Auth_Controller
|
||||
public function Lvs($studiensemester_kurzbz)
|
||||
{
|
||||
$this->load->model('education/Lehrveranstaltung_model', 'LehrveranstaltungModel');
|
||||
$this->load->model('crm/Student_model', 'StudentModel');
|
||||
$this->load->model('ressource/Mitarbeiter_model', 'MitarbeiterModel');
|
||||
|
||||
$isMitarbeiter = getData($this->MitarbeiterModel->isMitarbeiter(getAuthUID())) ?? false;
|
||||
if($isMitarbeiter) {
|
||||
$result = $this->LehrveranstaltungModel->getLvsByMitarbeiterInSemester(getAuthUID(), $studiensemester_kurzbz);
|
||||
$result = $this->LehrveranstaltungModel->getLvsByStudentWithGrades(getAuthUID(), $studiensemester_kurzbz, getUserLanguage());
|
||||
|
||||
if (isError($result))
|
||||
return $this->outputJsonError(getError($result));
|
||||
if (isError($result))
|
||||
return $this->outputJsonError(getError($result));
|
||||
|
||||
$this->outputJsonSuccess(getData($result));
|
||||
} else if(getData($this->StudentModel->isStudent(getAuthUID())) ?? false) { // $isStudent
|
||||
$result = $this->LehrveranstaltungModel->getLvsByStudentWithGrades(getAuthUID(), $studiensemester_kurzbz, getUserLanguage());
|
||||
|
||||
if (isError($result))
|
||||
return $this->outputJsonError(getError($result));
|
||||
|
||||
$this->outputJsonSuccess(getData($result));
|
||||
} else {
|
||||
$this->outputJsonError('neither student or mitarbeiter');
|
||||
}
|
||||
$this->outputJsonSuccess(getData($result));
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,52 +0,0 @@
|
||||
<?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
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,76 @@
|
||||
<?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');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,216 @@
|
||||
<?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);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
<?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) ?: []);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
<?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');
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,134 @@
|
||||
<?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));
|
||||
}
|
||||
}
|
||||
@@ -495,10 +495,6 @@ class AbgabetoolJob extends JOB_Controller
|
||||
// get all new or changed termine in interval
|
||||
$result = $this->_ci->PaabgabeModel->findAbgabenNewOrUpdatedSince($interval, $relevantTypes);
|
||||
$retval = getData($result);
|
||||
if(!$retval) {
|
||||
$this->_ci->logInfo("Keine Emails an Betreuer über neue oder veränderte Termine versandt");
|
||||
return;
|
||||
}
|
||||
|
||||
// group changed/new abgaben for projektarbeiten
|
||||
$projektarbeiten = [];
|
||||
@@ -561,8 +557,6 @@ class AbgabetoolJob extends JOB_Controller
|
||||
$anredeFillString = $data->anrede == "Herr" ? "r" : "";
|
||||
$fullFormattedNameString = $data->first;
|
||||
|
||||
$relevantCounter = 0; // workaround to check if a betreuer needs to have any notification about relevant
|
||||
// abgaben at all to avoid sending empty emails since we filter on certain conditions
|
||||
forEach($tupelArr as $tupel) {
|
||||
$projektarbeit_id = $tupel[0];
|
||||
$betreuerRow = $tupel[1];
|
||||
@@ -581,8 +575,6 @@ class AbgabetoolJob extends JOB_Controller
|
||||
continue;
|
||||
}
|
||||
|
||||
$relevantCounter++;
|
||||
|
||||
// format the Student Name
|
||||
$s = $relevantAbgaben[0];
|
||||
$nameParts = [];
|
||||
@@ -641,11 +633,6 @@ class AbgabetoolJob extends JOB_Controller
|
||||
// done with building the change list, now send it
|
||||
$betreuerRow = $tupelArr[0][1];
|
||||
|
||||
if($relevantCounter == 0) {
|
||||
$this->_ci->logInfo('No Relevant Abgaben to notify Betreuer PersonID: "'.$betreuerRow->person_id.'".');
|
||||
continue;
|
||||
}
|
||||
|
||||
$path = $this->_ci->config->item('URL_MITARBEITER');
|
||||
$url = CIS_ROOT.$path;
|
||||
|
||||
|
||||
@@ -215,11 +215,8 @@ class Pruefungsprotokoll extends Auth_Controller
|
||||
if (hasData($abschlusspruefung))
|
||||
{
|
||||
$abschlusspruefung_data = getData($abschlusspruefung);
|
||||
if ($this->permissionlib->isBerechtigt('admin')
|
||||
|| (
|
||||
isset($abschlusspruefung_data->studiengang_kz)
|
||||
&& $this->permissionlib->isBerechtigt('assistenz', 'suid', $abschlusspruefung_data->studiengang_kz)
|
||||
)
|
||||
if ($this->permissionlib->isBerechtigt('admin') ||
|
||||
(isset($abschlusspruefung_data->studiengang_kz) && $this->permissionlib->isBerechtigt('assistenz', 'suid', $abschlusspruefung_data->studiengang_kz))
|
||||
|| $this->_uid === $abschlusspruefung_data->uid_vorsitz)
|
||||
$result = $abschlusspruefung;
|
||||
else
|
||||
|
||||
@@ -417,7 +417,6 @@ 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)');
|
||||
|
||||
@@ -111,7 +111,9 @@ function generateJSDataStorageObject($indexPage, $calledPath, $calledMethod)
|
||||
'theme' => [
|
||||
'name'=>$ci->config->item('theme_name'),
|
||||
'modes'=>$ci->config->item('theme_modes'),
|
||||
]
|
||||
],
|
||||
'fhcomplete_build_version' => $ci->config->item('fhcomplete_build_version'),
|
||||
'use_fhcomplete_build_version_in_path' => $ci->config->item('use_fhcomplete_build_version_in_path'),
|
||||
);
|
||||
|
||||
$toPrint = "\n";
|
||||
@@ -178,6 +180,8 @@ function generateJSModulesInclude($JSModules)
|
||||
|
||||
$ci =& get_instance();
|
||||
$cachetoken = '?'.$ci->config->item('fhcomplete_build_version');
|
||||
$ci->load->config('javascript');
|
||||
$use_bundled_javascript = $ci->config->item('use_bundled_javascript');
|
||||
|
||||
if (isset($JSModules))
|
||||
{
|
||||
@@ -185,14 +189,20 @@ function generateJSModulesInclude($JSModules)
|
||||
|
||||
for ($tmpJSsCounter = 0; $tmpJSsCounter < count($tmpJSs); $tmpJSsCounter++)
|
||||
{
|
||||
$item = $tmpJSs[$tmpJSsCounter];
|
||||
if($use_bundled_javascript && preg_match('#/js/apps/#', $item))
|
||||
{
|
||||
$item = preg_replace('#^public/#', 'public/dist/', $item);
|
||||
}
|
||||
echo "<!--{$item}-->".PHP_EOL;
|
||||
if($ci->config->item('use_fhcomplete_build_version_in_path'))
|
||||
{
|
||||
$relurl = preg_replace('#public/#', 'public/' . $ci->config->item('fhcomplete_build_version') . '/', $tmpJSs[$tmpJSsCounter]);
|
||||
$relurl = preg_replace('#public/#', 'public/' . $ci->config->item('fhcomplete_build_version') . '/', $item);
|
||||
$toPrint = sprintf($jsInclude, base_url($relurl)).PHP_EOL;
|
||||
}
|
||||
else
|
||||
{
|
||||
$toPrint = sprintf($jsInclude, base_url($tmpJSs[$tmpJSsCounter].$cachetoken)).PHP_EOL;
|
||||
$toPrint = sprintf($jsInclude, base_url($item.$cachetoken)).PHP_EOL;
|
||||
}
|
||||
|
||||
if ($tmpJSsCounter > 0) $toPrint = "\t\t".$toPrint;
|
||||
|
||||
@@ -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', 'DESC');
|
||||
$this->_ci->StudierendenantragstatusModel->addOrder('insertamum');
|
||||
$this->_ci->StudierendenantragstatusModel->addLimit(1);
|
||||
$result = $this->_ci->StudierendenantragstatusModel->loadWhere([
|
||||
'studierendenantrag_id' => $antrag_id,
|
||||
|
||||
@@ -42,7 +42,7 @@ class ExtensionsLib
|
||||
// Directories that are part of the extension archive
|
||||
private $SOFTLINK_TARGET_DIRECTORIES = array(
|
||||
APPPATH => array('config', 'components', 'controllers', 'helpers', 'hooks', 'libraries', 'models', 'views', 'widgets'),
|
||||
DOC_ROOT => array('public')
|
||||
DOC_ROOT => array('public', 'public/dist')
|
||||
);
|
||||
|
||||
private $_errorOccurred; // boolean, true if an error occurred while installing an extension
|
||||
|
||||
@@ -50,7 +50,6 @@ 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
|
||||
|
||||
/**
|
||||
@@ -62,8 +61,6 @@ 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
|
||||
@@ -72,10 +69,8 @@ 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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -345,16 +340,6 @@ class PermissionLib
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the access rights for the current user
|
||||
*
|
||||
* @return array|null
|
||||
*/
|
||||
public function getAccessRights()
|
||||
{
|
||||
return $this->access_rights;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Private methods
|
||||
|
||||
|
||||
@@ -40,16 +40,13 @@ class StundenplanLib
|
||||
* @return stdClass
|
||||
* @access public
|
||||
*/
|
||||
public function getEventsUser($start, $end, $uid = null)
|
||||
public function getEventsUser($start, $end)
|
||||
{
|
||||
$this->_ci =& get_instance();
|
||||
|
||||
$this->_ci->load->model('ressource/Mitarbeiter_model', 'MitarbeiterModel');
|
||||
|
||||
if (!$uid) {
|
||||
$uid = getAuthUID();
|
||||
}
|
||||
|
||||
$uid = getAuthUID();
|
||||
if (is_null($uid))
|
||||
return error("No UID");
|
||||
|
||||
@@ -114,7 +111,6 @@ class StundenplanLib
|
||||
return $stundenplan_data;
|
||||
$stundenplan_data = getData($stundenplan_data) ?? [];
|
||||
|
||||
$this->_ci->addMeta("stundenplanData", $stundenplan_data);
|
||||
$function_error = $this->expandObjectInformation($stundenplan_data);
|
||||
if ($function_error)
|
||||
return $function_error;
|
||||
@@ -221,7 +217,7 @@ class StundenplanLib
|
||||
* @param string $ort_kurzbz
|
||||
* @return stdClass
|
||||
*/
|
||||
public function getReservierungen($start_date, $end_date, $ort_kurzbz = '', $uid = null)
|
||||
public function getReservierungen($start_date, $end_date, $ort_kurzbz = '')
|
||||
{
|
||||
$this->_ci =& get_instance();
|
||||
|
||||
@@ -232,14 +228,14 @@ class StundenplanLib
|
||||
$this->_ci->load->model('ressource/Reservierung_model', 'ReservierungModel');
|
||||
$this->_ci->load->model('ressource/Stundenplan_model', 'StundenplanModel');
|
||||
|
||||
$is_mitarbeiter = getData($this->_ci->MitarbeiterModel->isMitarbeiter($uid ?? getAuthUID()));
|
||||
$is_mitarbeiter = getData($this->_ci->MitarbeiterModel->isMitarbeiter(getAuthUID()));
|
||||
|
||||
if ($is_mitarbeiter && empty($ort_kurzbz)) {
|
||||
// request for personal lvplan show only reservations of logged in user
|
||||
$reservierungen = $this->_ci->ReservierungModel->getReservierungenMitarbeiter($start_date, $end_date, $uid);
|
||||
$reservierungen = $this->_ci->ReservierungModel->getReservierungenMitarbeiter($start_date, $end_date);
|
||||
} else {
|
||||
// querying the reservierungen
|
||||
$reservierungen = $this->_ci->ReservierungModel->getReservierungen($start_date, $end_date, $ort_kurzbz, $uid);
|
||||
$reservierungen = $this->_ci->ReservierungModel->getReservierungen($start_date, $end_date, $ort_kurzbz);
|
||||
}
|
||||
|
||||
if (isError($reservierungen))
|
||||
@@ -361,10 +357,7 @@ class StundenplanLib
|
||||
if (isError($ort_content_object)) {
|
||||
return error(getData($ort_content_object));
|
||||
}
|
||||
$ort_content_object_data = getData($ort_content_object);
|
||||
$ort_content_object = (is_array($ort_content_object_data) && count($ort_content_object_data) > 0)
|
||||
? $ort_content_object_data[0]
|
||||
: null;
|
||||
$ort_content_object = getData($ort_content_object)[0];
|
||||
if($ort_content_object) {
|
||||
$item->ort_content_id = $ort_content_object->content_id;
|
||||
}
|
||||
@@ -375,39 +368,6 @@ class StundenplanLib
|
||||
$item->gruppe = $gruppe_obj_array;
|
||||
$item->lektor = $lektor_obj_array;
|
||||
|
||||
$this->_ci->load->library('PermissionLib');
|
||||
$berechtigt_begrenzt = $this->_ci->permissionlib->isBerechtigt('lehre/reservierung:begrenzt', 'sui');
|
||||
|
||||
$now = time();
|
||||
$res_lektor_start = $this->jump_day($now, RES_TAGE_LEKTOR_MIN - 1);
|
||||
$res_lektor_ende = mktime(0, 0, 0, date('m', $now), date('d', $now) + RES_TAGE_LEKTOR_BIS, date('Y', $now));
|
||||
|
||||
$start_date = is_numeric($item->beginn) ? $item->beginn : strtotime($item->beginn);
|
||||
if (!date('w', $start_date)) {
|
||||
$start_date = $this->jump_day($start_date, 1);
|
||||
}
|
||||
|
||||
$start_date_str = date('Y-m-d', $start_date);
|
||||
$res_lektor_start_str = date('Y-m-d', $res_lektor_start);
|
||||
$res_lektor_ende_str = date('Y-m-d', $res_lektor_ende);
|
||||
|
||||
$show_delete = (
|
||||
(
|
||||
$berechtigt_begrenzt &&
|
||||
(
|
||||
(isset($item->insertvon) && $item->insertvon == getAuthUID()) ||
|
||||
(isset($item->uids) && in_array(getAuthUID(), $item->uids))
|
||||
)
|
||||
) &&
|
||||
$start_date_str >= $res_lektor_start_str &&
|
||||
$start_date_str <= $res_lektor_ende_str
|
||||
);
|
||||
|
||||
if ($show_delete)
|
||||
$item->deletable = true;
|
||||
else
|
||||
$item->deletable = false;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -485,237 +445,6 @@ class StundenplanLib
|
||||
return success($ferienEventsFlattened);
|
||||
}
|
||||
|
||||
public function getEventsStgOrg( $start, $end, $stg_kz, $sem, $verband, $gruppe)
|
||||
{
|
||||
$this->_ci =& get_instance();
|
||||
|
||||
$this->_ci->load->model('ressource/Stundenplan_model', 'StundenplanModel');
|
||||
|
||||
$stundenplan_data = $this->_ci->StundenplanModel->getStundenplanStudiengang($start, $end, $stg_kz, $sem, $verband, $gruppe);
|
||||
if (isError($stundenplan_data))
|
||||
return $stundenplan_data;
|
||||
$stundenplan_data = getData($stundenplan_data) ?? [];
|
||||
|
||||
$function_error = $this->expandObjectInformation($stundenplan_data);
|
||||
if ($function_error)
|
||||
return $function_error;
|
||||
|
||||
return success($stundenplan_data);
|
||||
}
|
||||
|
||||
public function addReservation($start, $end, $title, $beschreibung, $ort_kurzbz, $lektoren = null, $studiengang = null, $semester = null, $verband = null, $gruppe = null, $spezialgruppe = null)
|
||||
{
|
||||
$this->_ci =& get_instance();
|
||||
$this->_ci->load->model('ressource/Stunde_model', 'StundeModel');
|
||||
$this->_ci->load->model('ressource/Reservierung_model', 'ReservierungModel');
|
||||
$this->_ci->load->model('ressource/stundenplandev_model', 'StundenplandevModel');
|
||||
$this->_ci->load->model('ressource/stundenplan_model', 'StundenplanModel');
|
||||
$this->_ci->load->library('PermissionLib');
|
||||
|
||||
$startTime = new DateTime($start);
|
||||
$endTime = new DateTime($end);
|
||||
|
||||
$stunden = $this->_ci->StundeModel->loadWhere(array(
|
||||
'beginn <' => $endTime->format('H:i:s'),
|
||||
'ende >' => $startTime->format('H:i:s')
|
||||
));
|
||||
|
||||
if (!hasData($stunden))
|
||||
{
|
||||
return error("Keine Stunden vorhanden");
|
||||
}
|
||||
|
||||
$stunden = array_column(getData($stunden), 'stunde');
|
||||
|
||||
$this->_ci->StundenplandevModel->db->select('1');
|
||||
$this->_ci->StundenplandevModel->db->where('datum', $startTime->format('Y-m-d'));
|
||||
$this->_ci->StundenplandevModel->db->where('ort_kurzbz', $ort_kurzbz);
|
||||
$this->_ci->StundenplandevModel->db->where_in('stunde', $stunden);
|
||||
$stundenplandev_belegung = $this->_ci->StundenplandevModel->load();
|
||||
|
||||
$this->_ci->StundenplanModel->db->select('1');
|
||||
$this->_ci->StundenplanModel->db->where('ort_kurzbz', $ort_kurzbz);
|
||||
$this->_ci->StundenplanModel->db->where('datum', $startTime->format('Y-m-d'));
|
||||
$this->_ci->StundenplanModel->db->where_in('stunde', $stunden);
|
||||
$stundenplan_belegung = $this->_ci->StundenplanModel->load();
|
||||
|
||||
if ((hasData($stundenplandev_belegung) || hasData($stundenplan_belegung))
|
||||
&& !$this->_ci->permissionlib->isBerechtigt('lehre/reservierungAdvanced'))
|
||||
return error ('lvplan/bereitsReserviert');
|
||||
|
||||
$this->_ci->ReservierungModel->addSelect('stunde');
|
||||
$reservation_hours = $this->_ci->ReservierungModel->loadWhere(array('datum' => $startTime->format('Y-m-d'), 'ort_kurzbz' => $ort_kurzbz));
|
||||
|
||||
|
||||
if (isError($reservation_hours))
|
||||
return $reservation_hours;
|
||||
|
||||
$reservation_hours = hasData($reservation_hours) ? array_column(getData($reservation_hours), 'stunde') : array();
|
||||
|
||||
if (!empty(array_intersect($stunden, $reservation_hours))
|
||||
&& !$this->_ci->permissionlib->isBerechtigt('lehre/reservierungAdvanced'))
|
||||
return error("lvplan/bereitsReserviert");
|
||||
|
||||
|
||||
if (!empty($lektoren))
|
||||
{
|
||||
foreach ($lektoren as $lektor)
|
||||
{
|
||||
$insert = array('ort_kurzbz' => $ort_kurzbz,
|
||||
'datum' => $startTime->format('Y-m-d'),
|
||||
'titel' => $title,
|
||||
'studiengang_kz' => is_null($studiengang) ? 0 : $studiengang,
|
||||
'beschreibung' => $beschreibung,
|
||||
'insertvon' => getAuthUID(),
|
||||
'uid' => $lektor,
|
||||
'semester' => is_null($semester) ? null : $semester,
|
||||
'verband' => is_null($verband) ? null : $verband,
|
||||
'gruppe' => is_null($gruppe) ? null : $gruppe,
|
||||
'gruppe_kurzbz' => is_null($spezialgruppe) ? null : $spezialgruppe,
|
||||
);
|
||||
|
||||
foreach ($stunden as $stunde)
|
||||
{
|
||||
$insert['stunde'] = $stunde;
|
||||
$check_insert = $this->_ci->ReservierungModel->insert($insert);
|
||||
if (isError($check_insert))
|
||||
return $check_insert;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
foreach ($stunden as $stunde)
|
||||
{
|
||||
$check_insert = $this->_ci->ReservierungModel->insert(array(
|
||||
'ort_kurzbz' => $ort_kurzbz,
|
||||
'uid' => getAuthUID(),
|
||||
'stunde' => $stunde,
|
||||
'datum' => $startTime->format('Y-m-d'),
|
||||
'titel' => $title,
|
||||
'studiengang_kz' => is_null($studiengang) ? 0 : $studiengang,
|
||||
'beschreibung' => $beschreibung,
|
||||
'insertvon' => getAuthUID()
|
||||
));
|
||||
if (isError($check_insert))
|
||||
return $check_insert;
|
||||
}
|
||||
}
|
||||
|
||||
return success("Erfolgreich");
|
||||
}
|
||||
|
||||
public function deleteReservation($reservierung_id)
|
||||
{
|
||||
$this->_ci =& get_instance();
|
||||
$this->_ci->load->model('ressource/Reservierung_model', 'ReservierungModel');
|
||||
$this->_ci->load->model('ressource/Stunde_model', 'StundeModel');
|
||||
$this->_ci->load->library('PermissionLib');
|
||||
|
||||
|
||||
$this->_ci->ReservierungModel->db->where_in('reservierung_id', $reservierung_id);
|
||||
$reservation = $this->_ci->ReservierungModel->load();
|
||||
if (isError($reservation))
|
||||
return $reservation;
|
||||
|
||||
if (!hasData($reservation))
|
||||
return error("Reservierungen nicht gefunden");
|
||||
|
||||
$reservations = getData($reservation);
|
||||
|
||||
$today = new DateTime();
|
||||
foreach ($reservations as $reservierung)
|
||||
{
|
||||
if ($today->format('Y-m-d') > $reservierung->datum)
|
||||
return error("Vergangene Reservierungen können nicht gelöscht werden");
|
||||
|
||||
if (($this->_ci->permissionlib->isBerechtigt('lehre/reservierung:begrenzt')) && ($reservierung->insertvon == getAuthUID() || $reservierung->uid === getAuthUID()))
|
||||
{
|
||||
$delete_result = $this->_ci->ReservierungModel->delete($reservierung->reservierung_id);
|
||||
|
||||
if (isError($delete_result))
|
||||
return $delete_result;
|
||||
}
|
||||
}
|
||||
return success("Erfolgreich");
|
||||
}
|
||||
|
||||
|
||||
public function getReservableMap($ort_kurzbz, $start_date, $end_date)
|
||||
{
|
||||
$this->_ci =& get_instance();
|
||||
$this->_ci->load->model('ressource/Ort_model', 'OrtModel');
|
||||
$this->_ci->load->library('PermissionLib');
|
||||
|
||||
$berechtigt_begrenzt = $this->_ci->permissionlib->isBerechtigt('lehre/reservierung:begrenzt', 'suid');
|
||||
$berechtigt_erweitert = $this->_ci->permissionlib->isBerechtigt('lehre/reservierung', 'suid');
|
||||
|
||||
$ort_data = $this->_ci->OrtModel->load($ort_kurzbz);
|
||||
if (isError($ort_data) || !hasData($ort_data))
|
||||
return [];
|
||||
|
||||
$ort_data = getData($ort_data)[0];
|
||||
|
||||
if (!$ort_data->reservieren)
|
||||
return [];
|
||||
|
||||
if (!$berechtigt_begrenzt && !$berechtigt_erweitert)
|
||||
return [];
|
||||
|
||||
$start_ts = is_numeric($start_date) ? (int)$start_date : strtotime($start_date);
|
||||
$end_ts = is_numeric($end_date) ? (int)$end_date : strtotime($end_date);
|
||||
|
||||
if (!$start_ts || !$end_ts)
|
||||
return [];
|
||||
|
||||
if ($end_ts < $start_ts)
|
||||
{
|
||||
$tmp = $start_ts;
|
||||
$start_ts = $end_ts;
|
||||
$end_ts = $tmp;
|
||||
}
|
||||
|
||||
$now = time();
|
||||
$tage_min = defined('RES_TAGE_LEKTOR_MIN') ? (int)RES_TAGE_LEKTOR_MIN : 0;
|
||||
$tage_bis = defined('RES_TAGE_LEKTOR_BIS') ? (int)RES_TAGE_LEKTOR_BIS : 0;
|
||||
|
||||
$datum_res_lektor_start = $this->jump_day($now, $tage_min - 1);
|
||||
$datum_res_lektor_ende = $this->jump_day($now, $tage_bis);
|
||||
|
||||
$start_ymd_allowed = date('Y-m-d', $datum_res_lektor_start);
|
||||
$end_ymd_allowed = date('Y-m-d', $datum_res_lektor_ende);
|
||||
|
||||
$result = [];
|
||||
|
||||
$current = strtotime(date('Y-m-d', $start_ts) . ' 00:00:00');
|
||||
$end_day = strtotime(date('Y-m-d', $end_ts) . ' 00:00:00');
|
||||
|
||||
while ($current <= $end_day)
|
||||
{
|
||||
$ymd = date('Y-m-d', $current);
|
||||
|
||||
if ((int)date('w', $current) === 0)
|
||||
{
|
||||
$result[$ymd] = false;
|
||||
$current = $this->jump_day($current, 1);
|
||||
continue;
|
||||
}
|
||||
|
||||
$result[$ymd] = ($ymd >= $start_ymd_allowed && $ymd <= $end_ymd_allowed) ? true : false;
|
||||
|
||||
$current = $this->jump_day($current, 1);
|
||||
}
|
||||
|
||||
return success($result);
|
||||
}
|
||||
|
||||
private function jump_day($timestamp, $days)
|
||||
{
|
||||
$days = (int)$days;
|
||||
$prefix = ($days >= 0 ? '+' : '');
|
||||
return strtotime($prefix . $days . ' days', $timestamp);
|
||||
}
|
||||
|
||||
// start of the private functions ########################################################################################################
|
||||
|
||||
// function used to sort an array of studiensemester strings
|
||||
|
||||
@@ -37,9 +37,7 @@ class DashboardLib
|
||||
|
||||
public function getDashboardByKurzbz($dashboard_kurzbz)
|
||||
{
|
||||
$result = $this->_ci->DashboardModel->loadWhere([
|
||||
'dashboard_kurzbz' => $dashboard_kurzbz
|
||||
]);
|
||||
$result = $this->_ci->DashboardModel->getDashboardByKurzbz($dashboard_kurzbz);
|
||||
|
||||
if (hasData($result))
|
||||
{
|
||||
@@ -49,55 +47,30 @@ class DashboardLib
|
||||
return null;
|
||||
}
|
||||
|
||||
public function getMergedUserConfig($dashboard_id, $uid)
|
||||
public function getMergedConfig($dashboard_id, $uid)
|
||||
{
|
||||
$defaultconfig = $this->getUserBaseConfig($dashboard_id);
|
||||
$userconfig = $this->getUserOverrideConfig($dashboard_id, $uid);
|
||||
$defaultconfig = $this->getDefaultConfig($dashboard_id, $uid);
|
||||
$userconfig = $this->getUserConfig($dashboard_id, $uid);
|
||||
|
||||
$sourceconfig = array_map(function ($value) {
|
||||
return ['source' => $value['source']];
|
||||
}, $defaultconfig);
|
||||
|
||||
$mergedconfig = array_replace_recursive($defaultconfig, $userconfig, $sourceconfig);
|
||||
$mergedconfig = array_replace_recursive($defaultconfig, $userconfig);
|
||||
|
||||
return $mergedconfig;
|
||||
}
|
||||
|
||||
protected function getUserBaseConfig($dashboard_id)
|
||||
public function getDefaultConfig($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
|
||||
]);
|
||||
$res_presets = $this->_ci->DashboardPresetModel->getPresets($dashboard_id, $uid);
|
||||
$defaultconfig = array();
|
||||
|
||||
if (hasData($result))
|
||||
if (hasData($res_presets))
|
||||
{
|
||||
$presets = getData($result);
|
||||
$presets = getData($res_presets);
|
||||
foreach ($presets as $presetobj)
|
||||
{
|
||||
$preset = json_decode($presetobj->preset, true);
|
||||
if (null !== $preset)
|
||||
{
|
||||
$preset = array_map(function ($value) use ($presetobj) {
|
||||
$value['source'] = $presetobj->funktion_kurzbz ?: self::SECTION_IF_FUNKTION_KURZBZ_IS_NULL;
|
||||
return $value;
|
||||
}, $preset);
|
||||
$defaultconfig = array_merge_recursive($defaultconfig, $preset);
|
||||
$defaultconfig = array_replace_recursive($defaultconfig, $preset);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -105,7 +78,7 @@ class DashboardLib
|
||||
return $defaultconfig;
|
||||
}
|
||||
|
||||
protected function getUserOverrideConfig($dashboard_id, $uid)
|
||||
public function getUserConfig($dashboard_id, $uid)
|
||||
{
|
||||
$res_userconfig = $this->_ci->DashboardOverrideModel->getOverride($dashboard_id, $uid);
|
||||
|
||||
@@ -134,7 +107,7 @@ class DashboardLib
|
||||
$emptyoverride = new stdClass();
|
||||
$emptyoverride->dashboard_id = $dashboard->dashboard_id;
|
||||
$emptyoverride->uid = $uid;
|
||||
$emptyoverride->override = '[]';
|
||||
$emptyoverride->override = '{"' . self::USEROVERRIDE_SECTION . '": {"widgets":{}}, "custom": { "widgets" : {}}}';
|
||||
|
||||
return $emptyoverride;
|
||||
}
|
||||
@@ -153,7 +126,8 @@ class DashboardLib
|
||||
$emptypreset = new stdClass();
|
||||
$emptypreset->dashboard_id = $dashboard->dashboard_id;
|
||||
$emptypreset->funktion_kurzbz = $funktion_kurzbz;
|
||||
$emptypreset->preset = '[]';
|
||||
$section = ($funktion_kurzbz !== null) ? $funktion_kurzbz : self::SECTION_IF_FUNKTION_KURZBZ_IS_NULL;
|
||||
$emptypreset->preset = '{"' . $section . '": { "widgets" : {}},"custom": { "widgets" : {}}}';
|
||||
|
||||
return $emptypreset;
|
||||
}
|
||||
@@ -163,10 +137,8 @@ class DashboardLib
|
||||
$dashboard = $this->getDashboardByKurzbz($dashboard_kurzbz);
|
||||
|
||||
$funktion_kurzbz = ($section === self::SECTION_IF_FUNKTION_KURZBZ_IS_NULL) ? null : $section;
|
||||
$result = $this->_ci->DashboardPresetModel->loadWhere([
|
||||
'dashboard_id' => $dashboard->dashboard_id,
|
||||
'funktion_kurzbz' => $funktion_kurzbz
|
||||
]);
|
||||
$result = $this->_ci->DashboardPresetModel
|
||||
->getPresetByDashboardAndFunktion($dashboard->dashboard_id, $funktion_kurzbz);
|
||||
|
||||
if (hasData($result))
|
||||
{
|
||||
@@ -218,4 +190,44 @@ class DashboardLib
|
||||
|
||||
return $result;
|
||||
}
|
||||
|
||||
public function addWidgetsToWidgets(&$widgets, $dashboard_kurzbz, $section, $addwigets)
|
||||
{
|
||||
foreach ($addwigets as $widget)
|
||||
{
|
||||
if(!isset($widget->widgetid))
|
||||
{
|
||||
$widget->widgetid = $this->generateWidgetId($dashboard_kurzbz);
|
||||
}
|
||||
$this->addWidgetToWidgets($widgets, $section, $widget, $widget->widgetid);
|
||||
}
|
||||
}
|
||||
|
||||
public function addWidgetToWidgets(&$widgets, $section, $widget, $widgetid)
|
||||
{
|
||||
$section = ($section !== null) ? $section : self::SECTION_IF_FUNKTION_KURZBZ_IS_NULL;
|
||||
if (!isset($widgets[$section]) || !isset($widgets[$section]["widgets"]) || !is_array($widgets[$section]))
|
||||
{
|
||||
$widgets[$section] = array();
|
||||
$widgets[$section]["widgets"] = array();
|
||||
}
|
||||
|
||||
$widgets[$section]["widgets"][$widgetid] = $widget;
|
||||
}
|
||||
|
||||
public function removeWidgetFromWidgets(&$widgets, $section, $widgetid)
|
||||
{
|
||||
$section = ($section !== null) ? $section : self::SECTION_IF_FUNKTION_KURZBZ_IS_NULL;
|
||||
if (isset($widgets[$section]) && isset($widgets[$section]["widgets"][$widgetid]))
|
||||
{
|
||||
unset($widgets[$section]["widgets"][$widgetid]);
|
||||
if(empty($widgets[$section]["widgets"]) && $section !== self::USEROVERRIDE_SECTION) {
|
||||
unset($widgets[$section]);
|
||||
}
|
||||
return true;
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -40,9 +40,7 @@ abstract class AbstractBestandteil implements IValidation
|
||||
|
||||
if( is_bool($new_value) && ($old_value !== $new_value) ) {
|
||||
$this->modifiedcolumns[$columnname] = $columnname;
|
||||
} else if(is_null($old_value) xor is_null($new_value)) {
|
||||
$this->modifiedcolumns[$columnname] = $columnname;
|
||||
} else if($old_value != $new_value) {
|
||||
} else if($old_value != $new_value) {
|
||||
$this->modifiedcolumns[$columnname] = $columnname;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -3,7 +3,6 @@ namespace vertragsbestandteil;
|
||||
|
||||
use Exception;
|
||||
use vertragsbestandteil\VertragsbestandteilStunden;
|
||||
use vertragsbestandteil\VertragsbestandteilLohnguide;
|
||||
|
||||
/**
|
||||
* Description of VertragsbestandteilFactory
|
||||
@@ -23,7 +22,6 @@ 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)
|
||||
{
|
||||
@@ -71,11 +69,6 @@ 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 '
|
||||
@@ -134,12 +127,6 @@ 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,7 +10,6 @@ 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';
|
||||
|
||||
|
||||
@@ -1,161 +0,0 @@
|
||||
<?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,73 +11,4 @@ class Mobilitaet_model extends DB_Model
|
||||
$this->dbTable = 'bis.tbl_mobilitaet';
|
||||
$this->pk = 'mobilitaet_id';
|
||||
}
|
||||
|
||||
public function getMobilityZusatzForUids($uids) {
|
||||
$qry = "SELECT distinct on(nachname, vorname, public.tbl_benutzer.person_id) uid,
|
||||
tbl_mitarbeiter.mitarbeiter_uid,
|
||||
tbl_note.lkt_ueberschreibbar, tbl_note.anmerkung,
|
||||
tbl_mobilitaet.mobilitaetstyp_kurzbz,
|
||||
(CASE WHEN bis.tbl_mobilitaet.studiensemester_kurzbz = vw_student_lehrveranstaltung.studiensemester_kurzbz THEN 1 ELSE 0 END) as doubledegree,
|
||||
public.tbl_prestudent.gsstudientyp_kurzbz as ddtype,
|
||||
(SELECT status_kurzbz FROM public.tbl_prestudentstatus
|
||||
WHERE prestudent_id=tbl_student.prestudent_id
|
||||
ORDER BY datum DESC, insertamum DESC, ext_id DESC LIMIT 1) as studienstatus
|
||||
FROM
|
||||
campus.vw_student_lehrveranstaltung
|
||||
JOIN public.tbl_benutzer USING(uid)
|
||||
JOIN public.tbl_person USING(person_id)
|
||||
LEFT JOIN public.tbl_student ON(uid=student_uid)
|
||||
LEFT JOIN public.tbl_mitarbeiter ON(uid=mitarbeiter_uid)
|
||||
LEFT JOIN public.tbl_studentlehrverband USING(student_uid,studiensemester_kurzbz)
|
||||
LEFT JOIN lehre.tbl_zeugnisnote on(vw_student_lehrveranstaltung.lehrveranstaltung_id=tbl_zeugnisnote.lehrveranstaltung_id
|
||||
AND tbl_zeugnisnote.student_uid=tbl_student.student_uid
|
||||
AND tbl_zeugnisnote.studiensemester_kurzbz=tbl_studentlehrverband.studiensemester_kurzbz)
|
||||
LEFT JOIN lehre.tbl_note USING (note)
|
||||
LEFT JOIN bis.tbl_bisio ON(uid=tbl_bisio.student_uid)
|
||||
LEFT JOIN public.tbl_studiengang ON(tbl_student.studiengang_kz=tbl_studiengang.studiengang_kz)
|
||||
LEFT JOIN bis.tbl_mobilitaet USING(prestudent_id)
|
||||
LEFT JOIN public.tbl_prestudent USING(prestudent_id)
|
||||
WHERE uid IN ?";
|
||||
|
||||
return $this->execReadOnlyQuery($qry, [$uids]);
|
||||
}
|
||||
|
||||
public function formatZusatz($entry, $erhalter_kz) {
|
||||
$zusatz = '';
|
||||
|
||||
if (isset($entry->studienstatus) && $entry->studienstatus === 'Incoming') {
|
||||
$zusatz = '(i)';
|
||||
}
|
||||
|
||||
if (isset($entry->lkt_ueberschreibbar) && $entry->lkt_ueberschreibbar === false) {
|
||||
$zusatz .= ' (' . ($entry->anmerkung ?? '') . ')';
|
||||
}
|
||||
|
||||
if (isset($entry->mitarbeiter_uid) && $entry->mitarbeiter_uid !== null) {
|
||||
$zusatz .= ' (ma)';
|
||||
}
|
||||
|
||||
if (isset($entry->stg_kz_student) && $entry->stg_kz_student == $erhalter_kz) {
|
||||
$zusatz .= ' (a.o.)';
|
||||
}
|
||||
|
||||
if (
|
||||
isset($entry->mobilitaetstyp_kurzbz) && $entry->mobilitaetstyp_kurzbz &&
|
||||
isset($entry->doubledegree) && $entry->doubledegree === 1
|
||||
) {
|
||||
$zusatz .= ' (d.d.';
|
||||
|
||||
$ddtype = $entry->ddtype ?? null;
|
||||
|
||||
if ($ddtype == 'Intern') {
|
||||
$zusatz .= 'i.)';
|
||||
} elseif ($ddtype == 'Extern') {
|
||||
$zusatz .= 'o.)';
|
||||
} else {
|
||||
$zusatz .= ')';
|
||||
}
|
||||
}
|
||||
|
||||
return $zusatz;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -234,9 +234,9 @@ class Content_model extends DB_Model
|
||||
FROM
|
||||
campus.tbl_content c1
|
||||
LEFT JOIN
|
||||
campus.tbl_contentsprache s1 ON c1.content_id=s1.content_id AND s1.sprache=? AND sichtbar=true
|
||||
campus.tbl_contentsprache s1 ON c1.content_id=s1.content_id AND s1.sprache=?
|
||||
WHERE
|
||||
c1.aktiv = true
|
||||
sichtbar=true
|
||||
) s2
|
||||
LEFT JOIN
|
||||
campus.tbl_contentsprache s3 USING(content_id, sprache)
|
||||
@@ -277,7 +277,7 @@ class Content_model extends DB_Model
|
||||
JOIN
|
||||
campus.tbl_contentsprache s USING(contentsprache_id)
|
||||
LEFT JOIN
|
||||
campus.tbl_contentchild k ON(m.content_id=k.content_id) and c.aktiv = true
|
||||
campus.tbl_contentchild k ON(m.content_id=k.content_id)
|
||||
WHERE EXISTS (
|
||||
SELECT 1
|
||||
FROM campus.tbl_contentgruppe
|
||||
|
||||
@@ -11,4 +11,8 @@ class Bookmark_model extends DB_Model
|
||||
$this->dbTable = 'dashboard.tbl_bookmark';
|
||||
$this->pk = 'bookmark_id';
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -11,4 +11,57 @@ 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));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,4 +11,15 @@ class Dashboard_model extends DB_Model
|
||||
$this->dbTable = 'dashboard.tbl_dashboard';
|
||||
$this->pk = 'dashboard_id';
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get Dashboard by kurzbz.
|
||||
* @param string dashboard_kurzbz
|
||||
* @return array
|
||||
*/
|
||||
public function getDashboardByKurzbz($dashboard_kurzbz)
|
||||
{
|
||||
return $this->loadWhere(array('dashboard_kurzbz' => $dashboard_kurzbz));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -100,14 +100,12 @@ class Abschlusspruefung_model extends DB_Model
|
||||
|
||||
if (isError($abschlussarbeit))
|
||||
return $abschlussarbeit;
|
||||
|
||||
if (hasData($abschlussarbeit))
|
||||
{
|
||||
$abschlussarbeit = getData($abschlussarbeit)[0];
|
||||
$abschlusspruefungdata->projektarbeit_studiengangstyp_name = $abschlussarbeit->projekttyp_kurzbz;
|
||||
$abschlusspruefungdata->abschlussarbeit_titel = $abschlussarbeit->titel;
|
||||
$abschlusspruefungdata->abschlussarbeit_note = $abschlussarbeit->note;
|
||||
$abschlusspruefungdata->abschlussarbeit_sprache = $abschlussarbeit->sprache_bezeichnung;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,53 +52,4 @@ class LePruefung_model extends DB_Model
|
||||
'student_uid' => $student_uid
|
||||
]);
|
||||
}
|
||||
|
||||
public function getPruefungenByLvStudiensemester($lv_id, $sem_kurzbz) {
|
||||
$qry = "SELECT lehre.tbl_pruefung.*, tbl_lehrveranstaltung.bezeichnung as lehrveranstaltung_bezeichnung, tbl_lehrveranstaltung.lehrveranstaltung_id,
|
||||
tbl_note.bezeichnung as note_bezeichnung, tbl_pruefungstyp.beschreibung as typ_beschreibung, tbl_lehreinheit.studiensemester_kurzbz as studiensemester_kurzbz
|
||||
FROM lehre.tbl_pruefung, lehre.tbl_lehreinheit, lehre.tbl_lehrveranstaltung, lehre.tbl_note, lehre.tbl_pruefungstyp
|
||||
WHERE lehre.tbl_pruefung.lehreinheit_id=tbl_lehreinheit.lehreinheit_id
|
||||
AND tbl_lehreinheit.lehrveranstaltung_id=tbl_lehrveranstaltung.lehrveranstaltung_id
|
||||
AND lehre.tbl_pruefung.note = tbl_note.note
|
||||
AND lehre.tbl_pruefung.pruefungstyp_kurzbz=tbl_pruefungstyp.pruefungstyp_kurzbz
|
||||
AND tbl_lehrveranstaltung.lehrveranstaltung_id = ?
|
||||
AND tbl_lehreinheit.studiensemester_kurzbz = ?
|
||||
ORDER BY datum DESC;";
|
||||
|
||||
return $this->execReadOnlyQuery($qry, array($lv_id, $sem_kurzbz));
|
||||
}
|
||||
|
||||
public function getPruefungenByUidTypLvStudiensemester($uid, $typ = null, $lv_id = null, $sem_kurzbz = null) {
|
||||
$params = [$uid];
|
||||
$qry = "SELECT tbl_pruefung.*, tbl_lehrveranstaltung.bezeichnung as lehrveranstaltung_bezeichnung, tbl_lehrveranstaltung.lehrveranstaltung_id,
|
||||
tbl_note.bezeichnung as note_bezeichnung, tbl_pruefungstyp.beschreibung as typ_beschreibung, tbl_lehreinheit.studiensemester_kurzbz as studiensemester_kurzbz
|
||||
FROM lehre.tbl_pruefung, lehre.tbl_lehreinheit, lehre.tbl_lehrveranstaltung, lehre.tbl_note, lehre.tbl_pruefungstyp
|
||||
WHERE student_uid= ?
|
||||
AND tbl_pruefung.lehreinheit_id=tbl_lehreinheit.lehreinheit_id
|
||||
AND tbl_lehreinheit.lehrveranstaltung_id=tbl_lehrveranstaltung.lehrveranstaltung_id
|
||||
AND tbl_pruefung.note = tbl_note.note
|
||||
AND tbl_pruefung.pruefungstyp_kurzbz=tbl_pruefungstyp.pruefungstyp_kurzbz";
|
||||
if ($typ != null)
|
||||
{
|
||||
$qry .= " AND tbl_pruefungstyp.pruefungstyp_kurzbz = ?";
|
||||
$params[] = $typ;
|
||||
}
|
||||
|
||||
if ($lv_id != null)
|
||||
{
|
||||
$qry .= " AND tbl_lehrveranstaltung.lehrveranstaltung_id = ?";
|
||||
$params[] = $lv_id;
|
||||
}
|
||||
|
||||
if ($sem_kurzbz != null)
|
||||
{
|
||||
$qry .= " AND tbl_lehreinheit.studiensemester_kurzbz = ?";
|
||||
$params[] = $sem_kurzbz;
|
||||
}
|
||||
|
||||
|
||||
$qry .= " ORDER BY datum DESC";
|
||||
|
||||
return $this->execReadOnlyQuery($qry, $params);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -739,26 +739,4 @@ EOSQL;
|
||||
)";
|
||||
}
|
||||
|
||||
|
||||
public function getAllLehreinheitenForLvaAndMaUid($lva_id, $ma_uid, $sem_kurzbz)
|
||||
{
|
||||
$query = "SELECT DISTINCT tbl_lehreinheitmitarbeiter.lehreinheit_id, tbl_lehreinheit.lehrveranstaltung_id, tbl_lehreinheit.lehrform_kurzbz,
|
||||
tbl_lehreinheitmitarbeiter.mitarbeiter_uid,
|
||||
tbl_lehreinheitgruppe.semester,
|
||||
tbl_lehreinheitgruppe.verband,
|
||||
tbl_lehreinheitgruppe.gruppe,
|
||||
tbl_lehreinheitgruppe.gruppe_kurzbz,
|
||||
tbl_lehrveranstaltung.kurzbz,
|
||||
tbl_studiengang.kurzbzlang,
|
||||
(SELECT COUNT(DISTINCT datum) FROM campus.vw_stundenplan WHERE lehreinheit_id = lehre.tbl_lehreinheit.lehreinheit_id) as termincount,
|
||||
(SELECT COUNT(*) FROM campus.vw_student_lehrveranstaltung WHERE lehreinheit_id = lehre.tbl_lehreinheit.lehreinheit_id) as studentcount
|
||||
FROM lehre.tbl_lehreinheit JOIN lehre.tbl_lehreinheitmitarbeiter USING(lehreinheit_id)
|
||||
JOIN lehre.tbl_lehreinheitgruppe USING(lehreinheit_id)
|
||||
JOIN lehre.tbl_lehrveranstaltung USING(lehrveranstaltung_id)
|
||||
JOIN public.tbl_studiengang ON (tbl_lehreinheitgruppe.studiengang_kz = tbl_studiengang.studiengang_kz)
|
||||
WHERE lehrveranstaltung_id = ? AND studiensemester_kurzbz = ? AND mitarbeiter_uid = ?
|
||||
ORDER BY tbl_lehreinheitgruppe.gruppe_kurzbz";
|
||||
|
||||
return $this->execQuery($query, [$lva_id, $sem_kurzbz, $ma_uid]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -317,7 +317,7 @@ class Lehrveranstaltung_model extends DB_Model
|
||||
tbl_bisio.bisio_id, tbl_bisio.von, tbl_bisio.bis, tbl_student.studiengang_kz AS stg_kz_student,
|
||||
tbl_zeugnisnote.note, tbl_mitarbeiter.mitarbeiter_uid, tbl_person.matr_nr, tbl_benutzer.uid,
|
||||
UPPER(tbl_studiengang.typ::varchar(1) || tbl_studiengang.kurzbz) as kuerzel, tbl_studiengang.orgform_kurzbz, vw_student_lehrveranstaltung.semester, vw_student_lehrveranstaltung.studiensemester_kurzbz, vw_student_lehrveranstaltung.bezeichnung,
|
||||
tbl_student.prestudent_id, campus.vw_student_lehrveranstaltung.lehreinheit_id
|
||||
tbl_student.prestudent_id
|
||||
FROM
|
||||
campus.vw_student_lehrveranstaltung
|
||||
JOIN public.tbl_benutzer USING(uid)
|
||||
@@ -402,17 +402,14 @@ class Lehrveranstaltung_model extends DB_Model
|
||||
SELECT
|
||||
vorname, nachname, mitarbeiter_uid, lehrfunktion_kurzbz
|
||||
FROM
|
||||
lehre.tbl_lehreinheit le
|
||||
lehre.tbl_lehreinheit
|
||||
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
|
||||
le.lehrveranstaltung_id= ?
|
||||
AND le.studiensemester_kurzbz = ?
|
||||
tbl_lehreinheit.lehrveranstaltung_id= ?
|
||||
AND tbl_lehreinheit.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
|
||||
@@ -1346,65 +1343,4 @@ class Lehrveranstaltung_model extends DB_Model
|
||||
|
||||
return $this->execQuery($qry, $params);
|
||||
}
|
||||
|
||||
public function getLvForLektorInSemester($sem_kurzbz, $uid) {
|
||||
$qry = "SELECT DISTINCT (tbl_lehrveranstaltung.lehrveranstaltung_id),
|
||||
UPPER(tbl_studiengang.typ::varchar(1) || tbl_studiengang.kurzbz) as stg_kurzbz,
|
||||
tbl_lehrveranstaltung.semester as lv_semester,
|
||||
tbl_lehrveranstaltung.bezeichnung as lv_bezeichnung,
|
||||
(SELECT kurzbz FROM public.tbl_mitarbeiter
|
||||
WHERE mitarbeiter_uid=tbl_lehreinheitmitarbeiter.mitarbeiter_uid) as lektor
|
||||
FROM
|
||||
lehre.tbl_lehreinheit JOIN lehre.tbl_lehreinheitmitarbeiter USING(lehreinheit_id)
|
||||
JOIN lehre.tbl_lehrveranstaltung USING(lehrveranstaltung_id)
|
||||
JOIN public.tbl_studiengang USING(studiengang_kz)
|
||||
JOIN lehre.tbl_lehrveranstaltung as lehrfach ON(tbl_lehreinheit.lehrfach_id=lehrfach.lehrveranstaltung_id)
|
||||
WHERE
|
||||
tbl_lehreinheit.studiensemester_kurzbz = ?
|
||||
AND mitarbeiter_uid = ?
|
||||
ORDER BY stg_kurzbz,lv_semester,lv_bezeichnung";
|
||||
|
||||
return $this->execReadOnlyQuery($qry, array($sem_kurzbz, $uid));
|
||||
}
|
||||
|
||||
// used for cis4 mylv mitarbeiter
|
||||
public function getLvsByMitarbeiterInSemester($mitarbeiter_uid, $sem_kurzbz) {
|
||||
$qry = "SELECT * FROM (
|
||||
SELECT DISTINCT ON (lehre.tbl_lehrveranstaltung.lehrveranstaltung_id)
|
||||
public.tbl_studiengang.studiengang_kz,
|
||||
lehre.tbl_lehrveranstaltung.semester,
|
||||
public.tbl_studiengang.bezeichnung as sg_bezeichnung,
|
||||
public.tbl_studiengang.english as sg_bezeichnung_eng,
|
||||
UPPER(tbl_studiengang.typ::varchar(1) || tbl_studiengang.kurzbz) as studiengang_kuerzel,
|
||||
lehre.tbl_lehrveranstaltung.lehrveranstaltung_id,
|
||||
lehre.tbl_lehrveranstaltung.bezeichnung,
|
||||
lehre.tbl_lehrveranstaltung.bezeichnung_english as bezeichnung_eng,
|
||||
lehre.tbl_lehrveranstaltung.farbe,
|
||||
lehre.tbl_lehrveranstaltung.lvinfo,
|
||||
lehre.tbl_lehrveranstaltung.benotung,
|
||||
lehre.tbl_lehrveranstaltung.orgform_kurzbz,
|
||||
lehre.tbl_lehrveranstaltung.sprache,
|
||||
lehre.tbl_lehrveranstaltung.ects,
|
||||
lehre.tbl_lehrveranstaltung.incoming
|
||||
FROM
|
||||
lehre.tbl_lehreinheit JOIN lehre.tbl_lehreinheitmitarbeiter USING(lehreinheit_id)
|
||||
JOIN lehre.tbl_lehrveranstaltung USING(lehrveranstaltung_id)
|
||||
JOIN public.tbl_studiengang USING(studiengang_kz)
|
||||
JOIN lehre.tbl_lehrveranstaltung as lehrfach ON(tbl_lehreinheit.lehrfach_id=lehrfach.lehrveranstaltung_id)
|
||||
WHERE
|
||||
tbl_lehreinheit.studiensemester_kurzbz = ?
|
||||
AND mitarbeiter_uid = ?) as distincted_by_lva_id
|
||||
JOIN (
|
||||
SELECT lehrveranstaltung_id, TRUNC(SUM(lehre.tbl_lehreinheitmitarbeiter.semesterstunden)) as semesterstunden
|
||||
FROM lehre.tbl_lehreinheit
|
||||
JOIN lehre.tbl_lehreinheitmitarbeiter USING(lehreinheit_id)
|
||||
JOIN lehre.tbl_lehrveranstaltung USING(lehrveranstaltung_id)
|
||||
WHERE tbl_lehreinheit.studiensemester_kurzbz = ?
|
||||
AND mitarbeiter_uid = ?
|
||||
GROUP BY lehrveranstaltung_id
|
||||
) semesterstundenAggregatedSubquery USING(lehrveranstaltung_id)
|
||||
ORDER BY studiengang_kuerzel, semester, bezeichnung";
|
||||
|
||||
return $this->execReadOnlyQuery($qry, [$sem_kurzbz, $mitarbeiter_uid, $sem_kurzbz, $mitarbeiter_uid]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,7 +14,7 @@ class Lvgesamtnote_model extends DB_Model
|
||||
}
|
||||
|
||||
/**
|
||||
* Laedt die Noten - lvgesamtnote (Vorschlag) JOIN tbl.note (zeugnisnote)
|
||||
* Laedt die Noten
|
||||
*
|
||||
* @param integer $lehrveranstaltung_id
|
||||
* @param string $student_uid
|
||||
@@ -46,19 +46,4 @@ class Lvgesamtnote_model extends DB_Model
|
||||
|
||||
return $this->loadWhere($where);
|
||||
}
|
||||
|
||||
public function getLvGesamtNoteVorschlag($lehrveranstaltung_id, $student_uid, $studiensemester_kurzbz)
|
||||
{
|
||||
$qry = "SELECT * FROM campus.tbl_lvgesamtnote
|
||||
WHERE campus.tbl_lvgesamtnote.student_uid = ?
|
||||
AND campus.tbl_lvgesamtnote.studiensemester_kurzbz = ?";
|
||||
$params = [$student_uid, $studiensemester_kurzbz];
|
||||
|
||||
if ($lehrveranstaltung_id) {
|
||||
$qry .= "AND campus.tbl_lvgesamtnote.lehrveranstaltung_id = ?";
|
||||
$params[] = $lehrveranstaltung_id;
|
||||
}
|
||||
|
||||
return $this->execReadOnlyQuery($qry, $params);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,33 +11,12 @@ class Note_model extends DB_Model
|
||||
$this->dbTable = 'lehre.tbl_note';
|
||||
$this->pk = 'note';
|
||||
}
|
||||
|
||||
|
||||
public function getAllActive() {
|
||||
$qry ="SELECT *
|
||||
FROM lehre.tbl_note
|
||||
WHERE aktiv = true";
|
||||
|
||||
return $this->execReadOnlyQuery($qry);
|
||||
}
|
||||
|
||||
// used to determine the primary key of note "entschuldigt" to avoid hardcoded magic numbers
|
||||
// that might differ in a different installation of fhcomplete
|
||||
public function getEntschuldigtNote() {
|
||||
$qry ="SELECT *
|
||||
FROM lehre.tbl_note
|
||||
WHERE bezeichnung = 'entschuldigt'";
|
||||
|
||||
return $this->execReadOnlyQuery($qry);
|
||||
}
|
||||
|
||||
// used to determine the primary key of note "noch nicht eingetragen" to avoid hardcoded magic numbers
|
||||
// that might differ in a different installation of fhcomplete
|
||||
public function getNochNichtEingetragenNote() {
|
||||
$qry ="SELECT *
|
||||
FROM lehre.tbl_note
|
||||
WHERE bezeichnung = 'Noch nicht eingetragen'";
|
||||
|
||||
return $this->execReadOnlyQuery($qry);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -26,9 +26,6 @@ class Notenschluesselaufteilung_model extends DB_Model
|
||||
$this->load->model('education/Notenschluesselzuordnung_model', 'NotenschluesselzuordnungModel');
|
||||
$notenschluessel_kurzbz = $this->NotenschluesselzuordnungModel->getKurzbzForLv($lehrveranstaltung_id, $studiensemester_kurzbz);
|
||||
|
||||
if($notenschluessel_kurzbz == null)
|
||||
return success(null);
|
||||
|
||||
$this->addSelect("note");
|
||||
$this->addOrder("punkte", "DESC");
|
||||
$this->addLimit(1);
|
||||
|
||||
@@ -61,174 +61,6 @@ class Paabgabe_model extends DB_Model
|
||||
return $this->execReadOnlyQuery($qry, array($person_id));
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets project submissions for search criteria.
|
||||
* @param array $projekttyp_kurzbz_arr contains all relevant project types (e.g. Bachelor)
|
||||
* @param int $studiengang_kz study program
|
||||
* @param string $abgabetyp_kurzbz project submission type (e.g. end upload, intermediate submission)
|
||||
* @param string $abgabedatum due date for hand-in
|
||||
* @param string $personSearchString for searching by person, i.e. name, uid, person/prestudent id
|
||||
* @param int $limit limiting max number of results if search criteria is not precise enough
|
||||
* @return object
|
||||
*/
|
||||
public function getPaAbgaben(
|
||||
$projekttyp_kurzbz_arr,
|
||||
$studiengang_kz = null,
|
||||
$abgabetyp_kurzbz = null,
|
||||
$abgabedatum = null,
|
||||
$personSearchString = null,
|
||||
$limit = 1000
|
||||
) {
|
||||
$params = [];
|
||||
|
||||
$qry = "
|
||||
SELECT
|
||||
stg.bezeichnung AS stgbez, paabg.datum AS termin,
|
||||
paabg.paabgabe_id, paabg.projektarbeit_id, paabg.paabgabetyp_kurzbz, paabg.abgabedatum,
|
||||
abgabetyp.bezeichnung AS paabgabetyp_bezeichnung, ben.uid, pers.vorname, pers.nachname, pa.projekttyp_kurzbz, pa.titel,
|
||||
UPPER(stg.typ || stg.kurzbz) AS studiengang_kuerzel,
|
||||
(
|
||||
/* show all relevant Studiengänge of person and wether it is an employee*/
|
||||
SELECT
|
||||
STRING_AGG(studiengang || ' ' || last_status, ' | ')
|
||||
|| (CASE WHEN EXISTS (
|
||||
SELECT 1 FROM public.tbl_mitarbeiter ma
|
||||
JOIN public.tbl_benutzer ben ON ma.mitarbeiter_uid = ben.uid
|
||||
WHERE person_id = prestudents.person_id
|
||||
AND ben.aktiv
|
||||
) THEN ' | Mitarbeiter' ELSE '' END)
|
||||
FROM (
|
||||
SELECT
|
||||
DISTINCT person_id, prestudent_id, UPPER(stg.typ || stg.kurzbz) AS studiengang,
|
||||
get_rolle_prestudent(ps.prestudent_id, null) AS last_status
|
||||
FROM
|
||||
public.tbl_prestudent ps
|
||||
JOIN public.tbl_studiengang stg USING (studiengang_kz)
|
||||
WHERE
|
||||
person_id = pers.person_id
|
||||
ORDER BY
|
||||
prestudent_id DESC
|
||||
) prestudents
|
||||
WHERE
|
||||
last_status IN ('Abgewiesener','Aufgenommener', 'Student', 'Incoming', 'Diplomand', 'Abbrecher', 'Unterbrecher', 'Absolvent')
|
||||
GROUP BY
|
||||
person_id
|
||||
LIMIT 1;
|
||||
) AS status
|
||||
FROM
|
||||
lehre.tbl_projektarbeit pa
|
||||
JOIN campus.tbl_paabgabe paabg USING(projektarbeit_id)
|
||||
JOIN campus.tbl_paabgabetyp abgabetyp USING(paabgabetyp_kurzbz)
|
||||
LEFT JOIN public.tbl_benutzer ben ON(uid=student_uid)
|
||||
LEFT JOIN public.tbl_person pers ON(ben.person_id=pers.person_id)
|
||||
LEFT JOIN lehre.tbl_lehreinheit USING(lehreinheit_id)
|
||||
LEFT JOIN lehre.tbl_lehrveranstaltung USING(lehrveranstaltung_id)
|
||||
LEFT JOIN public.tbl_studiengang stg USING(studiengang_kz)
|
||||
WHERE
|
||||
TRUE";
|
||||
|
||||
if (isset($projekttyp_kurzbz_arr) && !isEmptyArray($projekttyp_kurzbz_arr))
|
||||
{
|
||||
$qry .= " AND projekttyp_kurzbz IN ?";
|
||||
$params[] = $projekttyp_kurzbz_arr;
|
||||
}
|
||||
|
||||
if (isset($studiengang_kz) && is_numeric($studiengang_kz))
|
||||
{
|
||||
$qry .= " AND stg.studiengang_kz=?";
|
||||
$params[] = $studiengang_kz;
|
||||
}
|
||||
|
||||
if (isset($abgabetyp_kurzbz))
|
||||
{
|
||||
$qry .= " AND paabg.paabgabetyp_kurzbz=?";
|
||||
$params[] = $abgabetyp_kurzbz;
|
||||
}
|
||||
|
||||
if (isset($abgabedatum))
|
||||
{
|
||||
$qry .= " AND paabg.datum=?";
|
||||
$params[] = $abgabedatum;
|
||||
}
|
||||
|
||||
if (is_numeric($personSearchString))
|
||||
{
|
||||
$personSearchString = (int) $personSearchString;
|
||||
$params = array_merge($params, [$personSearchString, $personSearchString]);
|
||||
$qry .= " AND (
|
||||
pers.person_id = ?
|
||||
OR EXISTS (SELECT 1 FROM public.tbl_prestudent WHERE person_id = pers.person_id AND prestudent_id = ?)
|
||||
)";
|
||||
}
|
||||
elseif (is_string($personSearchString))
|
||||
{
|
||||
// remove empty spaces and lowercase
|
||||
$personSearchString = strtolower(str_replace(' ', '', $personSearchString));
|
||||
$qry .= " AND (
|
||||
LOWER(REPLACE(pers.nachname || pers.vorname || pers.nachname, ' ', '')) LIKE ".$this->db->escape('%'.$personSearchString.'%')."
|
||||
OR ben.uid LIKE ".$this->db->escape('%'.$personSearchString.'%')."
|
||||
)";
|
||||
}
|
||||
|
||||
$qry .= " ORDER BY nachname";
|
||||
|
||||
if (isset($limit) && is_numeric($limit) && (!isset($studiengang_kz) || !is_numeric($studiengang_kz)) && !isset($abgabedatum))
|
||||
{
|
||||
$qry .= " LIMIT ?";
|
||||
$params[] = $limit;
|
||||
}
|
||||
|
||||
return $this->execReadOnlyQuery($qry, $params);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets due dates for projekt submission search criteria.
|
||||
* @param array $projekttyp_kurzbz_arr contains all relevant project types (e.g. Bachelor)
|
||||
* @param int $studiengang_kz study program
|
||||
* @param string $abgabetyp_kurzbz project submission type (e.g. end upload, intermediate submission)
|
||||
* @return object
|
||||
*/
|
||||
public function getTermine($projekttyp_kurzbz_arr, $studiengang_kz, $abgabetyp_kurzbz)
|
||||
{
|
||||
$params = [];
|
||||
|
||||
$qry = "
|
||||
SELECT
|
||||
DISTINCT tbl_paabgabe.datum as termin, to_char(tbl_paabgabe.datum, 'DD.MM.YYYY') as termin_anzeige
|
||||
FROM
|
||||
lehre.tbl_projektarbeit
|
||||
JOIN campus.tbl_paabgabe USING(projektarbeit_id)
|
||||
LEFT JOIN public.tbl_benutzer ON(uid=student_uid)
|
||||
LEFT JOIN public.tbl_person ON(tbl_benutzer.person_id=tbl_person.person_id)
|
||||
LEFT JOIN lehre.tbl_lehreinheit USING(lehreinheit_id)
|
||||
LEFT JOIN lehre.tbl_lehrveranstaltung USING(lehrveranstaltung_id)
|
||||
LEFT JOIN public.tbl_studiengang USING(studiengang_kz)
|
||||
WHERE
|
||||
TRUE";
|
||||
|
||||
if (isset($projekttyp_kurzbz_arr) && !isEmptyArray($projekttyp_kurzbz_arr))
|
||||
{
|
||||
$qry .= " AND projekttyp_kurzbz IN ?";
|
||||
$params[] = $projekttyp_kurzbz_arr;
|
||||
}
|
||||
|
||||
if (isset($studiengang_kz) && is_numeric($studiengang_kz))
|
||||
{
|
||||
$qry .= " AND public.tbl_studiengang.studiengang_kz=?";
|
||||
$params[] = $studiengang_kz;
|
||||
}
|
||||
|
||||
if (isset($abgabetyp_kurzbz))
|
||||
{
|
||||
$qry .= " AND campus.tbl_paabgabe.paabgabetyp_kurzbz=?";
|
||||
$params[] = $abgabetyp_kurzbz;
|
||||
}
|
||||
|
||||
$qry .= " ORDER BY termin DESC";
|
||||
|
||||
return $this->execReadOnlyQuery($qry, $params);
|
||||
}
|
||||
|
||||
public function findAbgabenNewOrUpdatedSince($interval, $relevantTypes)
|
||||
{
|
||||
|
||||
@@ -247,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::date = CURRENT_DATE - INTERVAL ?
|
||||
OR campus.tbl_paabgabe.updateamum::date = CURRENT_DATE - INTERVAL ?)
|
||||
AND campus.tbl_paabgabe.paabgabetyp_kurzbz IN ?";
|
||||
|
||||
WHERE (campus.tbl_paabgabe.insertamum >= NOW() - INTERVAL ?
|
||||
OR campus.tbl_paabgabe.updateamum >= NOW() - INTERVAL ?)
|
||||
AND campus.tbl_paabgabe.paabgabetyp_kurzbz IN ?";
|
||||
|
||||
return $this->execQuery($query, [$interval, $interval, $relevantTypes]);
|
||||
}
|
||||
|
||||
@@ -276,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 = CURRENT_DATE - INTERVAL ?";
|
||||
AND campus.tbl_paabgabe.abgabedatum >= NOW() - INTERVAL ?";
|
||||
|
||||
if($relevantTypes !== null) {
|
||||
$query .= " AND campus.tbl_paabgabe.paabgabetyp_kurzbz IN ?";
|
||||
|
||||
@@ -23,11 +23,9 @@ class Projektarbeit_model extends DB_Model
|
||||
*/
|
||||
public function getProjektarbeit($student_uid, $studiengang_kz = null, $studiensemester_kurzbz = null, $projekttyp = null, $final = null)
|
||||
{
|
||||
$sprache_index = "COALESCE((SELECT index FROM public.tbl_sprache WHERE sprache=" . $this->escape(getUserLanguage()) . " LIMIT 1), 1)";
|
||||
$qry = "SELECT
|
||||
pa.*, tbl_projekttyp.bezeichnung,
|
||||
tbl_lehreinheit.studiensemester_kurzbz, tbl_lehrveranstaltung.lehrveranstaltung_id,
|
||||
tbl_sprache.bezeichnung[".$sprache_index."] AS sprache_bezeichnung,
|
||||
tbl_firma.name AS firma_name,
|
||||
(
|
||||
SELECT
|
||||
@@ -46,7 +44,6 @@ class Projektarbeit_model extends DB_Model
|
||||
JOIN lehre.tbl_lehreinheit USING (lehreinheit_id)
|
||||
JOIN lehre.tbl_lehrveranstaltung USING (lehrveranstaltung_id)
|
||||
LEFT JOIN public.tbl_firma USING (firma_id)
|
||||
LEFT JOIN public.tbl_sprache ON pa.sprache = tbl_sprache.sprache
|
||||
WHERE
|
||||
pa.student_uid = ?";
|
||||
|
||||
|
||||
@@ -306,5 +306,4 @@ class Pruefung_model extends DB_Model
|
||||
|
||||
return $this->loadWhereCommitteeExamsFailed();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -594,10 +594,7 @@ 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, ', ', "
|
||||
. "UPPER(" . $this->dbTable . ".typ), "
|
||||
. "UPPER(" . $this->dbTable . ".kurzbz),')') AS name");
|
||||
$this->addSelect("CONCAT(UPPER(pers.nachname), ' ', pers.vorname, ' (', " . $this->dbTable . ".bezeichnung, ')') AS name");
|
||||
|
||||
$this->addJoin('public.tbl_prestudent p', 'studiengang_kz');
|
||||
$this->addJoin(
|
||||
|
||||
@@ -59,37 +59,6 @@ class Studienplan_model extends DB_Model
|
||||
'tbl_studienplan_lehrveranstaltung.semester' => $semester
|
||||
));
|
||||
}
|
||||
|
||||
public function getStudienplanByLvaSemKurzbz($lehrveranstaltung_id, $studiensemester_kurzbz) {
|
||||
$qry= "
|
||||
SELECT
|
||||
DISTINCT tbl_studienplan.*
|
||||
FROM
|
||||
lehre.tbl_studienplan
|
||||
JOIN lehre.tbl_studienplan_lehrveranstaltung
|
||||
USING(studienplan_id)
|
||||
WHERE
|
||||
tbl_studienplan_lehrveranstaltung.lehrveranstaltung_id IN (
|
||||
SELECT
|
||||
lv.lehrveranstaltung_id
|
||||
FROM
|
||||
lehre.tbl_lehrveranstaltung AS lv
|
||||
LEFT JOIN lehre.tbl_lehrveranstaltung AS t ON t.lehrveranstaltung_id=lv.lehrveranstaltung_template_id
|
||||
WHERE
|
||||
lv.lehrtyp_kurzbz<>'tpl'
|
||||
AND (lv.lehrveranstaltung_id= ? OR (lv.lehrveranstaltung_template_id= ? AND t.lehrtyp_kurzbz='tpl'))
|
||||
)
|
||||
AND EXISTS (
|
||||
SELECT 1
|
||||
FROM
|
||||
lehre.tbl_studienplan_semester
|
||||
WHERE studienplan_id=tbl_studienplan.studienplan_id
|
||||
AND studiensemester_kurzbz= ?
|
||||
AND semester = tbl_studienplan_lehrveranstaltung.semester)
|
||||
ORDER BY bezeichnung";
|
||||
|
||||
return $this->execReadOnlyQuery($qry, array($lehrveranstaltung_id, $lehrveranstaltung_id, $studiensemester_kurzbz));
|
||||
}
|
||||
|
||||
public function getStudienplanLehrveranstaltungForPrestudent($studienplan_id, $semester, $prestudent_id)
|
||||
{
|
||||
|
||||
@@ -242,30 +242,6 @@ class Studiensemester_model extends DB_Model
|
||||
return $this->loadWhere(['uid' => $student_uid, 'v.lehre' => true]);
|
||||
}
|
||||
|
||||
public function getWhereMitarbeiterHasLvs($uid) {
|
||||
// first order by year with last 2 letter from right,
|
||||
// then order by WS/SS inside the years
|
||||
// query it asc so the ordering magic in cis4 turns it around again
|
||||
$qry = "WITH unique_semesters AS (
|
||||
SELECT DISTINCT ON (studiensemester_kurzbz)
|
||||
studiensemester_kurzbz,
|
||||
start,
|
||||
ende,
|
||||
bezeichnung,
|
||||
studienjahr_kurzbz
|
||||
FROM lehre.tbl_lehreinheit
|
||||
JOIN lehre.tbl_lehreinheitmitarbeiter USING(lehreinheit_id)
|
||||
JOIN public.tbl_studiensemester USING(studiensemester_kurzbz)
|
||||
WHERE mitarbeiter_uid = ?
|
||||
)
|
||||
SELECT * FROM unique_semesters
|
||||
ORDER BY
|
||||
RIGHT(studiensemester_kurzbz, 2) ASC,
|
||||
LEFT(studiensemester_kurzbz, 2) ASC;";
|
||||
|
||||
return $this->execReadOnlyQuery($qry, [$uid]);
|
||||
}
|
||||
|
||||
public function getAktAndFutureSemester()
|
||||
{
|
||||
$query = 'SELECT studiensemester_kurzbz
|
||||
|
||||
@@ -261,42 +261,6 @@ 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']);
|
||||
|
||||
@@ -18,10 +18,10 @@ class Reservierung_model extends DB_Model
|
||||
*
|
||||
* @return stdClass
|
||||
*/
|
||||
public function getReservierungen($start_date, $end_date, $ort_kurzbz = null, $uid = null)
|
||||
public function getReservierungen($start_date, $end_date, $ort_kurzbz = null)
|
||||
{
|
||||
|
||||
$lvplan_reservierungen_query = "SELECT r.* , stund.beginn, stund.ende,
|
||||
|
||||
$lvplan_reservierungen_query="SELECT r.* , stund.beginn, stund.ende,
|
||||
CASE
|
||||
WHEN r.gruppe_kurzbz IS NOT NULL THEN r.gruppe_kurzbz
|
||||
ELSE CONCAT(UPPER(studg.typ),UPPER(studg.kurzbz),'-',COALESCE(CAST(r.semester AS varchar),'/'),COALESCE(CAST(r.verband AS varchar),'/'))
|
||||
@@ -35,7 +35,7 @@ class Reservierung_model extends DB_Model
|
||||
LEFT JOIN public.tbl_studiensemester ss2 ON slv.studiensemester_kurzbz = ss2.studiensemester_kurzbz AND ss2.start <=r.datum AND ss2.ende >= r.datum
|
||||
WHERE datum >= ? AND datum <= ? AND (ss1.studiensemester_kurzbz IS NOT NULL
|
||||
OR ss2.studiensemester_kurzbz IS NOT NULL)";
|
||||
|
||||
|
||||
$raum_reservierungen_query = "SELECT res.*, beginn, ende,
|
||||
CASE
|
||||
WHEN res.gruppe_kurzbz IS NOT NULL THEN res.gruppe_kurzbz
|
||||
@@ -46,29 +46,28 @@ class Reservierung_model extends DB_Model
|
||||
JOIN lehre.tbl_stunde ON lehre.tbl_stunde.stunde = res.stunde
|
||||
WHERE res.ort_kurzbz = ? AND datum >= ? AND datum <= ?";
|
||||
|
||||
$subquery = is_null($ort_kurzbz) ? $lvplan_reservierungen_query : $raum_reservierungen_query;
|
||||
|
||||
$query_result = $this->execReadOnlyQuery("
|
||||
$subquery = is_null($ort_kurzbz)? $lvplan_reservierungen_query:$raum_reservierungen_query;
|
||||
|
||||
$query_result= $this->execReadOnlyQuery("
|
||||
SELECT
|
||||
DISTINCT(insertvon),
|
||||
'reservierung' as type, beginn, ende, datum, array_agg(DISTINCT reservierung_id) AS reservierung_id,
|
||||
'reservierung' as type, beginn, ende, datum,
|
||||
COALESCE(titel, beschreibung) as topic,
|
||||
array_agg(DISTINCT mitarbeiter_kurzbz) as lektor,
|
||||
array_agg(DISTINCT (gruppe,verband,semester,studiengang_kz,gruppen_kuerzel)) as gruppe,
|
||||
array_agg(DISTINCT(uid)) as uids,
|
||||
|
||||
ort_kurzbz, 'FFFFFF' as farbe
|
||||
|
||||
FROM
|
||||
(
|
||||
" . $subquery . "
|
||||
". $subquery ."
|
||||
) AS subquery
|
||||
|
||||
GROUP BY datum, beginn, ende, ort_kurzbz, titel, beschreibung, insertvon
|
||||
GROUP BY datum, beginn, ende, ort_kurzbz, titel, beschreibung
|
||||
|
||||
ORDER BY datum, beginn
|
||||
", is_null($ort_kurzbz) ? [$uid ?? getAuthUID(), $uid ?? getAuthUID(), $start_date, $end_date] : [$ort_kurzbz, $start_date, $end_date]);
|
||||
|
||||
", is_null($ort_kurzbz) ?[getAuthUID(), getAuthUID(),$start_date,$end_date]: [$ort_kurzbz, $start_date, $end_date]);
|
||||
|
||||
|
||||
return $query_result;
|
||||
}
|
||||
|
||||
@@ -77,7 +76,7 @@ class Reservierung_model extends DB_Model
|
||||
*
|
||||
* @return stdClass
|
||||
*/
|
||||
public function getReservierungenMitarbeiter($start_date, $end_date, $uid = null)
|
||||
public function getReservierungenMitarbeiter($start_date, $end_date)
|
||||
{
|
||||
|
||||
$raum_reservierungen_query = "SELECT res.*, beginn, ende,
|
||||
@@ -92,26 +91,25 @@ class Reservierung_model extends DB_Model
|
||||
|
||||
$subquery = $raum_reservierungen_query;
|
||||
|
||||
|
||||
$query_result = $this->execReadOnlyQuery("
|
||||
|
||||
$query_result= $this->execReadOnlyQuery("
|
||||
SELECT
|
||||
DISTINCT(insertvon),
|
||||
'reservierung' as type, beginn, ende, datum,
|
||||
COALESCE(titel, beschreibung) as topic,
|
||||
array_agg(DISTINCT mitarbeiter_kurzbz) as lektor,
|
||||
array_agg(DISTINCT (gruppe,verband,semester,studiengang_kz,gruppen_kuerzel)) as gruppe,
|
||||
array_agg(DISTINCT(uid)) as uids,
|
||||
|
||||
ort_kurzbz, 'FFFFFF' as farbe
|
||||
|
||||
FROM
|
||||
(
|
||||
" . $subquery . "
|
||||
". $subquery ."
|
||||
) AS subquery
|
||||
|
||||
GROUP BY datum, beginn, ende, ort_kurzbz, titel, beschreibung, insertvon
|
||||
GROUP BY datum, beginn, ende, ort_kurzbz, titel, beschreibung
|
||||
|
||||
ORDER BY datum, beginn
|
||||
", [$uid ?? getAuthUID(), $start_date, $end_date]);
|
||||
", [getAuthUID(), $start_date, $end_date]);
|
||||
|
||||
|
||||
return $query_result;
|
||||
@@ -131,9 +129,9 @@ class Reservierung_model extends DB_Model
|
||||
$this->addJoin('public.tbl_studiensemester ss2', 'slv.studiensemester_kurzbz=ss2.studiensemester_kurzbz AND ss2.start<=r.datum AND ss2.ende>=r.datum', 'LEFT');
|
||||
$this->db->or_where('ss1.studiensemester_kurzbz IS NOT NULL', null, false);
|
||||
$this->db->or_where('ss2.studiensemester_kurzbz IS NOT NULL', null, false);
|
||||
|
||||
|
||||
$query = $this->db->get_compiled_select('campus.vw_reservierung r');
|
||||
|
||||
|
||||
return $this->execQuery($query, [$uid, $uid]);
|
||||
}
|
||||
|
||||
|
||||
@@ -388,84 +388,6 @@ class Stundenplan_model extends DB_Model
|
||||
|
||||
ORDER BY datum, beginn", [$start_date, $end_date, $ma_uid]);
|
||||
}
|
||||
|
||||
/**
|
||||
* queries Stundenplan and filters by studiengang, semester, verband gruppe
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function getStundenplanStudiengang($start_date, $end_date, $stg_kz, $sem, $verband, $gruppe) {
|
||||
|
||||
$qry_params = [$start_date, $end_date, $stg_kz];
|
||||
|
||||
$qry = "
|
||||
SELECT
|
||||
'lehreinheit' as type, beginn, ende, datum,
|
||||
CONCAT(lehrfach,'-',lehrform) as topic,
|
||||
array_agg(DISTINCT lektor) as lektor,
|
||||
array_agg(DISTINCT (gruppe,verband,semester,studiengang_kz,gruppen_kuerzel)) as gruppe,
|
||||
string_agg(DISTINCT ort_kurzbz, '/') as ort_kurzbz,
|
||||
array_agg(DISTINCT lehreinheit_id) as lehreinheit_id,
|
||||
titel, lehrfach, lehrform, lehrfach_bez, organisationseinheit, farbe, lehrveranstaltung_id
|
||||
FROM
|
||||
(
|
||||
SELECT unr,datum,beginn, ende,
|
||||
CASE
|
||||
WHEN sp.mitarbeiter_kurzbz IS NOT NULL THEN sp.mitarbeiter_kurzbz
|
||||
ELSE sp.lektor
|
||||
END as lektor,
|
||||
CASE
|
||||
WHEN gruppe_kurzbz IS NOT NULL THEN gruppe_kurzbz
|
||||
ELSE CONCAT(UPPER(sp.stg_typ),UPPER(sp.stg_kurzbz),'-',COALESCE(CAST(sp.semester AS varchar),'/'),COALESCE(CAST(sp.verband AS varchar),'/'))
|
||||
END as gruppen_kuerzel,
|
||||
(SELECT bezeichnung
|
||||
FROM public.tbl_organisationseinheit
|
||||
WHERE oe_kurzbz IN(
|
||||
SELECT oe_kurzbz
|
||||
FROM lehre.tbl_lehrveranstaltung
|
||||
WHERE lehrveranstaltung_id = sp.lehrveranstaltung_id
|
||||
)) as organisationseinheit,
|
||||
sp.ort_kurzbz, sp.studiengang_kz, sp.titel,sp.lehreinheit_id,sp.lehrfach_id,sp.anmerkung,fix,lehrveranstaltung_id,stg_kurzbzlang,stg_bezeichnung,stg_typ,fachbereich_kurzbz,lehrfach,lehrfach_bez,farbe,lehrform,anmerkung_lehreinheit,gruppe, verband, semester,stg_kurzbz
|
||||
FROM (
|
||||
SELECT sp.*
|
||||
FROM lehre.vw_stundenplan sp
|
||||
WHERE
|
||||
sp.datum >= ?
|
||||
AND sp.datum <= ?
|
||||
) sp
|
||||
JOIN lehre.tbl_stunde ON lehre.tbl_stunde.stunde = sp.stunde
|
||||
WHERE studiengang_kz = ? ";
|
||||
|
||||
if($sem != NULL)
|
||||
{
|
||||
$qry_params[] = $sem;
|
||||
$qry .= " AND (semester = ? OR semester IS NULL)";
|
||||
}
|
||||
if($verband != NULL)
|
||||
{
|
||||
$qry_params[] = $verband;
|
||||
$qry .= " AND (verband = ? OR verband IS NULL OR verband = '0' OR verband = '')";
|
||||
}
|
||||
if($gruppe != NULL)
|
||||
{
|
||||
$qry_params[] = $gruppe;
|
||||
$qry .= " AND (gruppe = ? OR gruppe IS NULL OR gruppe = '0' OR gruppe = '') ";
|
||||
}
|
||||
$qry.= " AND (
|
||||
gruppe_kurzbz is null OR EXISTS(
|
||||
SELECT 1
|
||||
FROM
|
||||
public.tbl_gruppe WHERE gruppe_kurzbz = sp.gruppe_kurzbz AND direktinskription = false
|
||||
)
|
||||
)";
|
||||
|
||||
$qry.= " ) as subquery
|
||||
|
||||
GROUP BY unr, datum, beginn, ende, titel, lehrform, lehrfach, lehrfach_bez, organisationseinheit, farbe, lehrveranstaltung_id
|
||||
ORDER BY datum, beginn; ";
|
||||
|
||||
return $this->execReadOnlyQuery($qry, $qry_params);
|
||||
}
|
||||
|
||||
/**
|
||||
* NO STANDALONE FUNCTION - Generates a SQL query string to fetch 'stundenplan' events for a specific student within the current semester.
|
||||
|
||||
@@ -12,8 +12,6 @@ class Zeitsperre_model extends DB_Model
|
||||
$this->pk = 'zeitsperre_id';
|
||||
}
|
||||
|
||||
const BLOCKIERENDE_ZEITSPERREN = ['Krank','Urlaub','ZA','DienstV','PflegeU','DienstF','CovidSB','CovidKS'];
|
||||
|
||||
/**
|
||||
* Save or update Zeitsperre.
|
||||
*
|
||||
@@ -63,128 +61,4 @@ class Zeitsperre_model extends DB_Model
|
||||
|
||||
return $this->execQuery($qry);
|
||||
}
|
||||
|
||||
/**
|
||||
* get Zeitsperren of a user
|
||||
*
|
||||
* @param $uid mitarbeiteruid
|
||||
* @param $bisgrenze @true show only entries of actual business year (1.9.- 31.8.)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getZeitsperrenUser($uid, $bisgrenze = true)
|
||||
{
|
||||
$qry = "
|
||||
SELECT
|
||||
tbl_zeitsperre.*, tbl_zeitsperretyp.*, tbl_erreichbarkeit.farbe AS erreichbarkeit_farbe,
|
||||
tbl_erreichbarkeit.beschreibung AS erreichbarkeit_beschreibung,
|
||||
CONCAT (ps.vorname, ' ', ps.nachname) as vertretung
|
||||
FROM (campus.tbl_zeitsperre JOIN campus.tbl_zeitsperretyp USING (zeitsperretyp_kurzbz))
|
||||
LEFT JOIN campus.tbl_erreichbarkeit USING (erreichbarkeit_kurzbz)
|
||||
LEFT JOIN public.tbl_benutzer ON campus.tbl_zeitsperre.vertretung_uid = public.tbl_benutzer.uid
|
||||
LEFT JOIN public.tbl_person ps USING (person_id)
|
||||
WHERE mitarbeiter_uid= ?
|
||||
";
|
||||
|
||||
if($bisgrenze)
|
||||
{
|
||||
$qry.="
|
||||
AND (
|
||||
(date_part('month',vondatum)>=9 AND date_part('year', vondatum)>='".(date('Y')-1)."')
|
||||
OR
|
||||
(date_part('month',vondatum)<9 AND date_part('year', vondatum)>='".(date('Y'))."')
|
||||
)";
|
||||
}
|
||||
|
||||
$qry.= " ORDER BY vondatum DESC";
|
||||
|
||||
return $this->execQuery($qry, array('mitarbeiter_uid' => $uid));
|
||||
}
|
||||
|
||||
/**
|
||||
* check a date for existing zeitsperre
|
||||
*
|
||||
* @param $uid mitarbeiteruid
|
||||
* @param $datum datum to check
|
||||
* @param $stunde stunde (default = null)
|
||||
* @param bool $nurblockierend if only hr relevante zeitsperren have to be checked
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function getSperreByDate($uid, $datum, $stunde = null, $nurblockierend = false)
|
||||
{
|
||||
$parametersArray = [$datum, $datum];
|
||||
|
||||
$qry = "
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
campus.tbl_zeitsperre
|
||||
WHERE
|
||||
vondatum <= ?
|
||||
AND bisdatum>= ?";
|
||||
|
||||
if($nurblockierend)
|
||||
{
|
||||
$qry .= " AND zeitsperretyp_kurzbz IN ('"
|
||||
. implode("','", self::BLOCKIERENDE_ZEITSPERREN)
|
||||
. "')";
|
||||
}
|
||||
|
||||
if(!is_null($stunde))
|
||||
{
|
||||
$parametersArray = array_merge(
|
||||
$parametersArray,
|
||||
[$datum, $stunde, $datum, $datum, $stunde, $datum]
|
||||
);
|
||||
|
||||
$qry.=" AND
|
||||
((vondatum= ? AND vonstunde<= ? OR vonstunde is null OR vondatum<> ?) AND
|
||||
(bisdatum= ? AND bisstunde>= ? OR bisstunde is null OR bisdatum<> ?))";
|
||||
}
|
||||
|
||||
array_push($parametersArray, $uid);
|
||||
|
||||
$qry .= "AND mitarbeiter_uid= ? ";
|
||||
|
||||
return $this->execQuery($qry, $parametersArray);
|
||||
}
|
||||
|
||||
/**
|
||||
* check a date for existing zeitsperre
|
||||
*
|
||||
* @param $uid mitarbeiteruid
|
||||
* @param $vondatum datum in Format IS0
|
||||
* @param $bisdatum datum in Format ISO
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function existsZeitaufzeichnung($uid, $vonDay, $bisDay)
|
||||
{
|
||||
try {
|
||||
$from = new DateTime($vonDay);
|
||||
$to = new DateTime($bisDay);
|
||||
} catch (Exception $e) {
|
||||
throw new Exception("Invalid date format");
|
||||
}
|
||||
|
||||
//remove hour stamps
|
||||
$from->setTime(0, 0, 0);
|
||||
$to->setTime(0, 0, 0)->modify('+1 day');
|
||||
|
||||
$fromSql = $from->format('Y-m-d');
|
||||
$toSql = $to->format('Y-m-d');
|
||||
$params = [$uid, $fromSql, $toSql];
|
||||
|
||||
$qry = "
|
||||
SELECT *
|
||||
FROM campus.tbl_zeitaufzeichnung
|
||||
WHERE uid = ?
|
||||
AND start >= ?
|
||||
AND ende < ? ";
|
||||
|
||||
$result = $this->execQuery($qry, $params);
|
||||
|
||||
return $result;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -242,7 +242,6 @@ 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
|
||||
@@ -311,12 +310,11 @@ class Message_model extends DB_Model
|
||||
public.tbl_person pr on pr.person_id = fm.recipient_id
|
||||
order by
|
||||
m.insertamum DESC
|
||||
{$limitoffset}
|
||||
limit ?
|
||||
offset ?;
|
||||
EOSQL;
|
||||
|
||||
$parametersArray = $limitoffset
|
||||
? array($person_id, $person_id, $limit, $offset)
|
||||
: array($person_id, $person_id);
|
||||
$parametersArray = array($person_id, $person_id, $limit, $offset);
|
||||
|
||||
$count = 0;
|
||||
$data = $this->execQuery($sql, $parametersArray);
|
||||
@@ -327,7 +325,7 @@ EOSQL;
|
||||
$data = getData($data);
|
||||
if($data)
|
||||
{
|
||||
$count = is_null($limit) ? 1 : ceil($data[0]->total_msgs / $limit);
|
||||
$count = ceil($data[0]->total_msgs / $limit);
|
||||
}
|
||||
|
||||
return success(['data' => $data, 'count' => $count]);
|
||||
|
||||
@@ -1,11 +0,0 @@
|
||||
<?php
|
||||
|
||||
class VertragsbestandteilLohnguide_model extends DB_Model
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->dbTable = 'hr.tbl_vertragsbestandteil_lohnguide';
|
||||
$this->pk = 'vertragsbestandteil_id';
|
||||
}
|
||||
}
|
||||
@@ -37,8 +37,7 @@ 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,
|
||||
lg.stellenbezeichnung, lg.vordienstzeit, lg.fachrichtung_kurzbz, lg.modellstelle_kurzbz, lg.kommentar_person, lg.kommentar_modellstelle
|
||||
z.zeitaufzeichnung, z.azgrelevant, z.homeoffice
|
||||
FROM
|
||||
hr.tbl_vertragsbestandteil v
|
||||
LEFT JOIN
|
||||
@@ -64,8 +63,6 @@ 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;
|
||||
}
|
||||
|
||||
@@ -11,7 +11,6 @@ $includesArray = array(
|
||||
'skipID' => '#fhccontent',
|
||||
'vuedatepicker11' => true,
|
||||
'customCSSs' => array(
|
||||
'vendor/vuejs/vuedatepicker_css/main.css',
|
||||
'public/css/components/verticalsplit.css',
|
||||
'public/css/components/searchbar/searchbar.css',
|
||||
'public/css/Fhc.css',
|
||||
@@ -25,30 +24,22 @@ $includesArray = array(
|
||||
'public/css/components/abgabetool/abgabe.css',
|
||||
'public/css/Cis4/Cms.css',
|
||||
'public/css/Cis4/Studium.css',
|
||||
'public/css/Cis4/Benotungstool.css',
|
||||
'public/css/Cis4/Zeitsperren.css',
|
||||
),
|
||||
'customJSs' => array(
|
||||
'vendor/npm-asset/primevue/accordion/accordion.min.js',
|
||||
'vendor/npm-asset/primevue/accordiontab/accordiontab.min.js',
|
||||
'vendor/npm-asset/primevue/checkbox/checkbox.min.js',
|
||||
'vendor/npm-asset/primevue/chips/chips.min.js',
|
||||
'vendor/npm-asset/primevue/multiselect/multiselect.min.js',
|
||||
'vendor/npm-asset/primevue/inputnumber/inputnumber.min.js',
|
||||
'vendor/npm-asset/primevue/speeddial/speeddial.min.js',
|
||||
'vendor/npm-asset/primevue/textarea/textarea.min.js',
|
||||
'vendor/npm-asset/primevue/timeline/timeline.min.js',
|
||||
'vendor/npm-asset/primevue/inplace/inplace.min.js',
|
||||
'vendor/npm-asset/primevue/message/message.min.js',
|
||||
'vendor/npm-asset/primevue/divider/divider.min.js',
|
||||
'vendor/npm-asset/primevue/password/password.js',
|
||||
'vendor/npm-asset/primevue/multiselect/multiselect.js',
|
||||
'vendor/npm-asset/primevue/tieredmenu/tieredmenu.js',
|
||||
'vendor/moment/luxonjs/luxon.min.js'
|
||||
),
|
||||
'customJSModules' => array(
|
||||
'public/js/apps/Cis/Cis.js',
|
||||
'vendor/olifolkerd/tabulator5/src/js/modules/ColumnCalcs/ColumnCalcs.js'
|
||||
'public/js/apps/Dashboard/Fhc.js',
|
||||
),
|
||||
|
||||
);
|
||||
@@ -56,6 +47,8 @@ $includesArray = array(
|
||||
$this->load->view('templates/CISVUE-Header', $includesArray);
|
||||
?>
|
||||
<div id="fhccontent" class="h-100" route=<?php echo $route ?>>
|
||||
<router-view></router-view>
|
||||
<router-view
|
||||
:view-data='<?php echo json_encode($viewData) ?>'
|
||||
></router-view>
|
||||
</div>
|
||||
<?php $this->load->view('templates/CISVUE-Footer', $includesArray); ?>
|
||||
|
||||
+3
-9
@@ -8,15 +8,9 @@ $this->load->view(
|
||||
'axios027' => true,
|
||||
'restclient' => true,
|
||||
'vue3' => true,
|
||||
'primevue3' => true,
|
||||
'vuedatepicker11' => true,
|
||||
'customJSs' => [
|
||||
'vendor/moment/luxonjs/luxon.min.js'
|
||||
],
|
||||
'customJSModules' => ['public/js/apps/Dashboard/Admin.js'],
|
||||
'customJSModules' => ['public/js/apps/Dashboard.js'],
|
||||
'customCSSs' => [
|
||||
'public/css/components/dashboard.css',
|
||||
'public/css/components/primevue.css',
|
||||
'public/css/components/dashboard.css'
|
||||
],
|
||||
'navigationcomponent' => true
|
||||
)
|
||||
@@ -31,7 +25,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>
|
||||
<dashboard-admin></dashboard-admin>
|
||||
<core-dashboard dashboard="CIS" apiurl="<?= site_url('dashboard'); ?>"></core-dashboard>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
+3
-8
@@ -8,12 +8,7 @@ $this->load->view(
|
||||
'axios027' => true,
|
||||
'restclient' => true,
|
||||
'vue3' => true,
|
||||
'vuedatepicker11' => true,
|
||||
'primevue3' => true,
|
||||
'customJSs' => [
|
||||
'vendor/moment/luxonjs/luxon.min.js'
|
||||
],
|
||||
'customJSModules' => ['public/js/apps/Dashboard/Preview.js'],
|
||||
'customJSModules' => ['public/js/apps/DashboardAdmin.js'],
|
||||
'customCSSs' => [
|
||||
'public/css/components/dashboard.css'
|
||||
],
|
||||
@@ -28,9 +23,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 <?= $dashboard_kurzbz ?></h1>
|
||||
<h1 class="h2">Dashboard</h1>
|
||||
</div>
|
||||
<core-dashboard dashboard="<?= $dashboard_kurzbz ?>"></core-dashboard>
|
||||
<dashboard-admin dashboard="CIS" apiurl="<?= site_url('dashboard'); ?>"></dashboard-admin>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
<?php
|
||||
$includesArray = array(
|
||||
$this->load->view(
|
||||
'templates/FHC-Header',
|
||||
array(
|
||||
'title' => 'Lehrauftrag bestellen',
|
||||
'jquery3' => true,
|
||||
'jqueryui1' => true,
|
||||
@@ -10,15 +12,8 @@ $includesArray = array(
|
||||
'dialoglib' => true,
|
||||
'navigationwidget' => true,
|
||||
'addons' => true,
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
$this->load->view(
|
||||
'templates/FHC-Header',
|
||||
$includesArray
|
||||
);
|
||||
|
||||
|
||||
?>
|
||||
|
||||
<?php echo $this->widgetlib->widget('NavigationWidget'); ?>
|
||||
@@ -38,12 +33,4 @@ $this->load->view(
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
|
||||
|
||||
$this->load->view(
|
||||
'templates/FHC-Footer',
|
||||
$includesArray
|
||||
);
|
||||
|
||||
?>
|
||||
<?php $this->load->view('templates/FHC-Footer'); ?>
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
<?php
|
||||
|
||||
$includesArray = array(
|
||||
$this->load->view(
|
||||
'templates/FHC-Header',
|
||||
array(
|
||||
'title' => 'Lehrauftrag bestellen',
|
||||
'jquery3' => true,
|
||||
'bootstrap3' => true,
|
||||
@@ -8,13 +9,8 @@ $includesArray = array(
|
||||
'sbadmintemplate3' => true,
|
||||
'ajaxlib' => true,
|
||||
'navigationwidget' => true,
|
||||
)
|
||||
);
|
||||
|
||||
$this->load->view(
|
||||
'templates/FHC-Header',
|
||||
$includesArray
|
||||
);
|
||||
|
||||
?>
|
||||
|
||||
<?php echo $this->widgetlib->widget('NavigationWidget'); ?>
|
||||
@@ -38,11 +34,4 @@ $this->load->view(
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php
|
||||
|
||||
$this->load->view(
|
||||
'templates/FHC-Footer',
|
||||
$includesArray
|
||||
);
|
||||
|
||||
?>
|
||||
<?php $this->load->view('templates/FHC-Footer'); ?>
|
||||
|
||||
@@ -1,101 +1,89 @@
|
||||
<?php
|
||||
|
||||
$includesArray = array(
|
||||
'title' => 'Lehrauftrag annehmen',
|
||||
'jquery3' => true,
|
||||
'jqueryui1' => true,
|
||||
'jquerycheckboxes1' => true,
|
||||
'bootstrap5' => true,
|
||||
'fontawesome6' => true,
|
||||
'sbadmintemplate' => false,
|
||||
'tabulator5' => true,
|
||||
'tabulator5JQuery' => true,
|
||||
'cis'=>true,
|
||||
'momentjs2' => true,
|
||||
'ajaxlib' => true,
|
||||
'dialoglib' => true,
|
||||
'tablewidget' => true,
|
||||
'phrases' => array(
|
||||
'global' => array(
|
||||
'lehrauftraegeAnnehmen',
|
||||
'dokumentePDF',
|
||||
'PDFLehrauftraegeFH',
|
||||
'PDFLehrauftraegeLehrgaenge'
|
||||
),
|
||||
'ui' => array(
|
||||
'anzeigen',
|
||||
'alleAnzeigen',
|
||||
'nurBestellteAnzeigen',
|
||||
'nurErteilteAnzeigen',
|
||||
'nurAngenommeneAnzeigen',
|
||||
'nurStornierteAnzeigen',
|
||||
'hilfeZuDieserSeite',
|
||||
'alleAuswaehlen',
|
||||
'alleAbwaehlen',
|
||||
'ausgewaehlteZeilen',
|
||||
'hilfe',
|
||||
'tabelleneinstellungen',
|
||||
'keineDatenVorhanden',
|
||||
'spaltenEinstellen',
|
||||
'bestelltVon',
|
||||
'erteiltVon',
|
||||
'angenommenVon',
|
||||
'storniertVon',
|
||||
'lehrauftragInBearbeitung',
|
||||
'wartetAufErteilung',
|
||||
'wartetAufErneuteErteilung',
|
||||
'letzterStatusBestellt',
|
||||
'letzterStatusErteilt',
|
||||
'letzterStatusAngenommen',
|
||||
'vertragWurdeStorniert',
|
||||
$this->load->view(
|
||||
'templates/FHC-Header',
|
||||
array(
|
||||
'title' => 'Lehrauftrag annehmen',
|
||||
'jquery3' => true,
|
||||
'jqueryui1' => true,
|
||||
'jquerycheckboxes1' => true,
|
||||
'bootstrap5' => true,
|
||||
'fontawesome6' => true,
|
||||
'sbadmintemplate' => false,
|
||||
'tabulator5' => true,
|
||||
'tabulator5JQuery' => true,
|
||||
'cis'=>true,
|
||||
'momentjs2' => true,
|
||||
'ajaxlib' => true,
|
||||
'dialoglib' => true,
|
||||
'tablewidget' => true,
|
||||
'phrases' => array(
|
||||
'global' => array(
|
||||
'lehrauftraegeAnnehmen',
|
||||
'dokumentePDF',
|
||||
'PDFLehrauftraegeFH',
|
||||
'PDFLehrauftraegeLehrgaenge'
|
||||
),
|
||||
'ui' => array(
|
||||
'anzeigen',
|
||||
'alleAnzeigen',
|
||||
'nurBestellteAnzeigen',
|
||||
'nurErteilteAnzeigen',
|
||||
'nurAngenommeneAnzeigen',
|
||||
'nurStornierteAnzeigen',
|
||||
'hilfeZuDieserSeite',
|
||||
'alleAuswaehlen',
|
||||
'alleAbwaehlen',
|
||||
'ausgewaehlteZeilen',
|
||||
'hilfe',
|
||||
'tabelleneinstellungen',
|
||||
'keineDatenVorhanden',
|
||||
'spaltenEinstellen',
|
||||
'bestelltVon',
|
||||
'erteiltVon',
|
||||
'angenommenVon',
|
||||
'storniertVon',
|
||||
'lehrauftragInBearbeitung',
|
||||
'wartetAufErteilung',
|
||||
'wartetAufErneuteErteilung',
|
||||
'letzterStatusBestellt',
|
||||
'letzterStatusErteilt',
|
||||
'letzterStatusAngenommen',
|
||||
'vertragWurdeStorniert',
|
||||
),
|
||||
'password' => array('password'),
|
||||
'dms' => array('informationsblattExterneLehrende'),
|
||||
'table' => array(
|
||||
'spaltenEinAusblenden',
|
||||
'spaltenEinAusblendenMitKlickOeffnen',
|
||||
'spaltenEinAusblendenAufEinstellungenKlicken',
|
||||
'spaltenEinAusblendenMitKlickAktivieren',
|
||||
'spaltenEinAusblendenMitKlickSchliessen',
|
||||
'spaltenbreiteVeraendern',
|
||||
'spaltenbreiteVeraendernText',
|
||||
'spaltenbreiteVeraendernInfotext',
|
||||
'zeilenAuswaehlen',
|
||||
'zeilenAuswaehlenEinzeln',
|
||||
'zeilenAuswaehlenBereich',
|
||||
'zeilenAuswaehlenAlle'
|
||||
),
|
||||
'password' => array('password'),
|
||||
'dms' => array('informationsblattExterneLehrende'),
|
||||
'table' => array(
|
||||
'spaltenEinAusblenden',
|
||||
'spaltenEinAusblendenMitKlickOeffnen',
|
||||
'spaltenEinAusblendenAufEinstellungenKlicken',
|
||||
'spaltenEinAusblendenMitKlickAktivieren',
|
||||
'spaltenEinAusblendenMitKlickSchliessen',
|
||||
'spaltenbreiteVeraendern',
|
||||
'spaltenbreiteVeraendernText',
|
||||
'spaltenbreiteVeraendernInfotext',
|
||||
'zeilenAuswaehlen',
|
||||
'zeilenAuswaehlenEinzeln',
|
||||
'zeilenAuswaehlenBereich',
|
||||
'zeilenAuswaehlenAlle'
|
||||
'lehre' => array(
|
||||
'lehrauftraegeAnnehmen',
|
||||
'lehrauftraegeAnnehmenText',
|
||||
'lehrauftraegeAnnehmenKlickStatusicon',
|
||||
'lehrauftraegeAnnehmenLehrauftraegeWaehlen',
|
||||
'lehrauftraegeAnnehmenMitKlickAnnehmen',
|
||||
'lehrauftraegeNichtAuswaehlbar',
|
||||
'lehrauftraegeNichtAuswaehlbarTextBeiAnnahme',
|
||||
'filterAlleBeiAnnahme',
|
||||
'filterErteiltBeiAnnahme',
|
||||
'filterAngenommen'
|
||||
)
|
||||
),
|
||||
'lehre' => array(
|
||||
'lehrauftraegeAnnehmen',
|
||||
'lehrauftraegeAnnehmenText',
|
||||
'lehrauftraegeAnnehmenKlickStatusicon',
|
||||
'lehrauftraegeAnnehmenLehrauftraegeWaehlen',
|
||||
'lehrauftraegeAnnehmenMitKlickAnnehmen',
|
||||
'lehrauftraegeNichtAuswaehlbar',
|
||||
'lehrauftraegeNichtAuswaehlbarTextBeiAnnahme',
|
||||
'filterAlleBeiAnnahme',
|
||||
'filterErteiltBeiAnnahme',
|
||||
'filterAngenommen'
|
||||
)
|
||||
),
|
||||
'customJSs' => array(
|
||||
'public/js/bootstrapper.js',
|
||||
'public/js/lehre/lehrauftrag/acceptLehrauftrag.js'
|
||||
'customJSs' => array(
|
||||
'public/js/bootstrapper.js',
|
||||
'public/js/lehre/lehrauftrag/acceptLehrauftrag.js')
|
||||
)
|
||||
);
|
||||
|
||||
if (defined("CIS4")) {
|
||||
$this->load->view(
|
||||
'templates/CISVUE-Header',
|
||||
$includesArray
|
||||
);
|
||||
} else {
|
||||
$this->load->view(
|
||||
'templates/FHC-Header',
|
||||
$includesArray
|
||||
);
|
||||
}
|
||||
|
||||
?>
|
||||
|
||||
|
||||
@@ -242,17 +230,5 @@ if (defined("CIS4")) {
|
||||
</div><!-- end page-wrapper -->
|
||||
<br>
|
||||
|
||||
<?php
|
||||
if (defined("CIS4")) {
|
||||
$this->load->view(
|
||||
'templates/CISVUE-Footer',
|
||||
$includesArray
|
||||
);
|
||||
} else {
|
||||
$this->load->view(
|
||||
'templates/FHC-Footer',
|
||||
$includesArray
|
||||
);
|
||||
}
|
||||
?>
|
||||
<?php $this->load->view('templates/FHC-Footer'); ?>
|
||||
|
||||
|
||||
@@ -1,101 +1,98 @@
|
||||
<?php
|
||||
$includesArray = array(
|
||||
'title' => 'Lehrauftrag erteilen',
|
||||
'jquery3' => true,
|
||||
'jqueryui1' => true,
|
||||
'jquerycheckboxes1' => true,
|
||||
'bootstrap3' => true,
|
||||
'fontawesome6' => true,
|
||||
'sbadmintemplate3' => true,
|
||||
'tabulator5' => true,
|
||||
'tabulator5JQuery' => true,
|
||||
'momentjs2' => true,
|
||||
'ajaxlib' => true,
|
||||
'dialoglib' => true,
|
||||
'tablewidget' => true,
|
||||
'navigationwidget' => true,
|
||||
'phrases' => array(
|
||||
'global' => array(
|
||||
'lehrauftraegeErteilen',
|
||||
'mehrHilfe',
|
||||
'weitereInformationenUnter'
|
||||
),
|
||||
'ui' => array(
|
||||
'anzeigen',
|
||||
'alleAnzeigen',
|
||||
'nurNeueAnzeigen',
|
||||
'nurBestellteAnzeigen',
|
||||
'nurErteilteAnzeigen',
|
||||
'nurAngenommeneAnzeigen',
|
||||
'nurGeaenderteAnzeigen',
|
||||
'nurDummiesAnzeigen',
|
||||
'hilfeZuDieserSeite',
|
||||
'alleAuswaehlen',
|
||||
'alleAbwaehlen',
|
||||
'ausgewaehlteZeilen',
|
||||
'hilfe',
|
||||
'tabelleneinstellungen',
|
||||
'keineDatenVorhanden',
|
||||
'spaltenEinstellen',
|
||||
'bestelltVon',
|
||||
'erteiltVon',
|
||||
'angenommenVon',
|
||||
'stundenStundensatzGeaendert',
|
||||
'neuerLehrauftragOhneLektorVerplant',
|
||||
'wartetAufBestellung',
|
||||
'wartetAufErneuteBestellung',
|
||||
'neuerLehrauftragWartetAufBestellung',
|
||||
'letzterStatusBestellt',
|
||||
'letzterStatusErteilt',
|
||||
'letzterStatusAngenommen',
|
||||
),
|
||||
'table' => array(
|
||||
'spaltenEinAusblenden',
|
||||
'spaltenEinAusblendenMitKlickOeffnen',
|
||||
'spaltenEinAusblendenAufEinstellungenKlicken',
|
||||
'spaltenEinAusblendenMitKlickAktivieren',
|
||||
'spaltenEinAusblendenMitKlickSchliessen',
|
||||
'spaltenbreiteVeraendern',
|
||||
'spaltenbreiteVeraendernText',
|
||||
'spaltenbreiteVeraendernInfotext',
|
||||
'zeilenAuswaehlen',
|
||||
'zeilenAuswaehlenEinzeln',
|
||||
'zeilenAuswaehlenBereich',
|
||||
'zeilenAuswaehlenAlle'
|
||||
),
|
||||
'lehre' => array(
|
||||
'lehrauftragStandardBestellprozess',
|
||||
'lehrauftragStandardBestellprozessBestellen',
|
||||
'lehrauftragStandardBestellprozessErteilen',
|
||||
'lehrauftragStandardBestellprozessAnnehmen',
|
||||
'lehrauftraegeErteilen',
|
||||
'lehrauftraegeErteilenText',
|
||||
'lehrauftraegeErteilenKlickStatusicon',
|
||||
'lehrauftraegeErteilenLehrauftraegeWaehlen',
|
||||
'lehrauftraegeErteilenMitKlickErteilen',
|
||||
'geaenderteLehrauftraege',
|
||||
'geaenderteLehrauftraegeTextBeiErteilung',
|
||||
'lehrauftraegeNichtAuswaehlbar',
|
||||
'lehrauftraegeNichtAuswaehlbarTextBeiErteilung',
|
||||
'filterAlle',
|
||||
'filterNeu',
|
||||
'filterBestellt',
|
||||
'filterErteilt',
|
||||
'filterAngenommen',
|
||||
'filterGeaendert',
|
||||
'filterDummies'
|
||||
)
|
||||
),
|
||||
'customJSs' => array(
|
||||
'public/js/bootstrapper.js',
|
||||
'public/js/lehre/lehrauftrag/approveLehrauftrag.js'
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
$this->load->view(
|
||||
'templates/FHC-Header',
|
||||
$includesArray
|
||||
'templates/FHC-Header',
|
||||
array(
|
||||
'title' => 'Lehrauftrag erteilen',
|
||||
'jquery3' => true,
|
||||
'jqueryui1' => true,
|
||||
'jquerycheckboxes1' => true,
|
||||
'bootstrap3' => true,
|
||||
'fontawesome6' => true,
|
||||
'sbadmintemplate3' => true,
|
||||
'tabulator5' => true,
|
||||
'tabulator5JQuery' => true,
|
||||
'momentjs2' => true,
|
||||
'ajaxlib' => true,
|
||||
'dialoglib' => true,
|
||||
'tablewidget' => true,
|
||||
'navigationwidget' => true,
|
||||
'phrases' => array(
|
||||
'global' => array(
|
||||
'lehrauftraegeErteilen',
|
||||
'mehrHilfe',
|
||||
'weitereInformationenUnter'
|
||||
),
|
||||
'ui' => array(
|
||||
'anzeigen',
|
||||
'alleAnzeigen',
|
||||
'nurNeueAnzeigen',
|
||||
'nurBestellteAnzeigen',
|
||||
'nurErteilteAnzeigen',
|
||||
'nurAngenommeneAnzeigen',
|
||||
'nurGeaenderteAnzeigen',
|
||||
'nurDummiesAnzeigen',
|
||||
'hilfeZuDieserSeite',
|
||||
'alleAuswaehlen',
|
||||
'alleAbwaehlen',
|
||||
'ausgewaehlteZeilen',
|
||||
'hilfe',
|
||||
'tabelleneinstellungen',
|
||||
'keineDatenVorhanden',
|
||||
'spaltenEinstellen',
|
||||
'bestelltVon',
|
||||
'erteiltVon',
|
||||
'angenommenVon',
|
||||
'stundenStundensatzGeaendert',
|
||||
'neuerLehrauftragOhneLektorVerplant',
|
||||
'wartetAufBestellung',
|
||||
'wartetAufErneuteBestellung',
|
||||
'neuerLehrauftragWartetAufBestellung',
|
||||
'letzterStatusBestellt',
|
||||
'letzterStatusErteilt',
|
||||
'letzterStatusAngenommen',
|
||||
),
|
||||
'table' => array(
|
||||
'spaltenEinAusblenden',
|
||||
'spaltenEinAusblendenMitKlickOeffnen',
|
||||
'spaltenEinAusblendenAufEinstellungenKlicken',
|
||||
'spaltenEinAusblendenMitKlickAktivieren',
|
||||
'spaltenEinAusblendenMitKlickSchliessen',
|
||||
'spaltenbreiteVeraendern',
|
||||
'spaltenbreiteVeraendernText',
|
||||
'spaltenbreiteVeraendernInfotext',
|
||||
'zeilenAuswaehlen',
|
||||
'zeilenAuswaehlenEinzeln',
|
||||
'zeilenAuswaehlenBereich',
|
||||
'zeilenAuswaehlenAlle'
|
||||
),
|
||||
'lehre' => array(
|
||||
'lehrauftragStandardBestellprozess',
|
||||
'lehrauftragStandardBestellprozessBestellen',
|
||||
'lehrauftragStandardBestellprozessErteilen',
|
||||
'lehrauftragStandardBestellprozessAnnehmen',
|
||||
'lehrauftraegeErteilen',
|
||||
'lehrauftraegeErteilenText',
|
||||
'lehrauftraegeErteilenKlickStatusicon',
|
||||
'lehrauftraegeErteilenLehrauftraegeWaehlen',
|
||||
'lehrauftraegeErteilenMitKlickErteilen',
|
||||
'geaenderteLehrauftraege',
|
||||
'geaenderteLehrauftraegeTextBeiErteilung',
|
||||
'lehrauftraegeNichtAuswaehlbar',
|
||||
'lehrauftraegeNichtAuswaehlbarTextBeiErteilung',
|
||||
'filterAlle',
|
||||
'filterNeu',
|
||||
'filterBestellt',
|
||||
'filterErteilt',
|
||||
'filterAngenommen',
|
||||
'filterGeaendert',
|
||||
'filterDummies'
|
||||
)
|
||||
),
|
||||
'customJSs' => array(
|
||||
'public/js/bootstrapper.js',
|
||||
'public/js/lehre/lehrauftrag/approveLehrauftrag.js'
|
||||
)
|
||||
)
|
||||
);
|
||||
?>
|
||||
|
||||
@@ -211,13 +208,5 @@ $this->load->view(
|
||||
</div><!-- end page-wrapper -->
|
||||
<br>
|
||||
|
||||
<?php
|
||||
|
||||
|
||||
$this->load->view(
|
||||
'templates/FHC-Footer',
|
||||
$includesArray
|
||||
);
|
||||
|
||||
?>
|
||||
<?php $this->load->view('templates/FHC-Footer'); ?>
|
||||
|
||||
|
||||
@@ -1,101 +1,98 @@
|
||||
<?php
|
||||
$includesArray = array(
|
||||
'title' => 'Lehrauftrag bestellen',
|
||||
'jquery3' => true,
|
||||
'jqueryui1' => true,
|
||||
'jquerycheckboxes1' => true,
|
||||
'bootstrap3' => true,
|
||||
'fontawesome6' => true,
|
||||
'sbadmintemplate3' => true,
|
||||
'tabulator5' => true,
|
||||
'tabulator5JQuery' => true,
|
||||
'momentjs2' => true,
|
||||
'ajaxlib' => true,
|
||||
'dialoglib' => true,
|
||||
'tablewidget' => true,
|
||||
'navigationwidget' => true,
|
||||
'phrases' => array(
|
||||
'global' => array(
|
||||
'lehrauftraegeBestellen',
|
||||
'mehrHilfe',
|
||||
'weitereInformationenUnter'
|
||||
),
|
||||
'ui' => array(
|
||||
'anzeigen',
|
||||
'alleAnzeigen',
|
||||
'nurNeueAnzeigen',
|
||||
'nurBestellteAnzeigen',
|
||||
'nurErteilteAnzeigen',
|
||||
'nurAngenommeneAnzeigen',
|
||||
'nurGeaenderteAnzeigen',
|
||||
'nurDummiesAnzeigen',
|
||||
'hilfeZuDieserSeite',
|
||||
'alleAuswaehlen',
|
||||
'alleAbwaehlen',
|
||||
'ausgewaehlteZeilen',
|
||||
'hilfe',
|
||||
'tabelleneinstellungen',
|
||||
'keineDatenVorhanden',
|
||||
'spaltenEinstellen',
|
||||
'bestelltVon',
|
||||
'erteiltVon',
|
||||
'angenommenVon',
|
||||
'neuerLehrauftragOhneLektorVerplant',
|
||||
'neuerLehrauftragWartetAufBestellung',
|
||||
'letzterStatusBestellt',
|
||||
'letzterStatusErteilt',
|
||||
'letzterStatusAngenommen',
|
||||
'nachAenderungStundensatzStunden',
|
||||
'vorAenderungStundensatzStunden'
|
||||
),
|
||||
'table' => array(
|
||||
'spaltenEinAusblenden',
|
||||
'spaltenEinAusblendenMitKlickOeffnen',
|
||||
'spaltenEinAusblendenAufEinstellungenKlicken',
|
||||
'spaltenEinAusblendenMitKlickAktivieren',
|
||||
'spaltenEinAusblendenMitKlickSchliessen',
|
||||
'spaltenbreiteVeraendern',
|
||||
'spaltenbreiteVeraendernText',
|
||||
'spaltenbreiteVeraendernInfotext',
|
||||
'zeilenAuswaehlen',
|
||||
'zeilenAuswaehlenEinzeln',
|
||||
'zeilenAuswaehlenBereich',
|
||||
'zeilenAuswaehlenAlle'
|
||||
),
|
||||
'lehre' => array(
|
||||
'lehrauftragStandardBestellprozess',
|
||||
'lehrauftragStandardBestellprozessBestellen',
|
||||
'lehrauftragStandardBestellprozessErteilen',
|
||||
'lehrauftragStandardBestellprozessAnnehmen',
|
||||
'lehrauftraegeBestellen',
|
||||
'lehrauftraegeBestellenText',
|
||||
'lehrauftraegeBestellenKlickStatusicon',
|
||||
'lehrauftraegeBestellenLehrauftraegeWaehlen',
|
||||
'lehrauftraegeBestellenMitKlickBestellen',
|
||||
'lehrauftraegeBestellenVertragWirdAngelegt',
|
||||
'geaenderteLehrauftraege',
|
||||
'geaenderteLehrauftraegeText',
|
||||
'lehrauftraegeNichtAuswaehlbar',
|
||||
'lehrauftraegeNichtAuswaehlbarText',
|
||||
'filterAlle',
|
||||
'filterNeu',
|
||||
'filterBestellt',
|
||||
'filterErteilt',
|
||||
'filterAngenommen',
|
||||
'filterGeaendert',
|
||||
'filterDummies'
|
||||
)
|
||||
),
|
||||
'customJSs' => array(
|
||||
'public/js/bootstrapper.js',
|
||||
'public/js/lehre/lehrauftrag/orderLehrauftrag.js'
|
||||
)
|
||||
);
|
||||
|
||||
|
||||
$this->load->view(
|
||||
'templates/FHC-Header',
|
||||
$includesArray
|
||||
'templates/FHC-Header',
|
||||
array(
|
||||
'title' => 'Lehrauftrag bestellen',
|
||||
'jquery3' => true,
|
||||
'jqueryui1' => true,
|
||||
'jquerycheckboxes1' => true,
|
||||
'bootstrap3' => true,
|
||||
'fontawesome6' => true,
|
||||
'sbadmintemplate3' => true,
|
||||
'tabulator5' => true,
|
||||
'tabulator5JQuery' => true,
|
||||
'momentjs2' => true,
|
||||
'ajaxlib' => true,
|
||||
'dialoglib' => true,
|
||||
'tablewidget' => true,
|
||||
'navigationwidget' => true,
|
||||
'phrases' => array(
|
||||
'global' => array(
|
||||
'lehrauftraegeBestellen',
|
||||
'mehrHilfe',
|
||||
'weitereInformationenUnter'
|
||||
),
|
||||
'ui' => array(
|
||||
'anzeigen',
|
||||
'alleAnzeigen',
|
||||
'nurNeueAnzeigen',
|
||||
'nurBestellteAnzeigen',
|
||||
'nurErteilteAnzeigen',
|
||||
'nurAngenommeneAnzeigen',
|
||||
'nurGeaenderteAnzeigen',
|
||||
'nurDummiesAnzeigen',
|
||||
'hilfeZuDieserSeite',
|
||||
'alleAuswaehlen',
|
||||
'alleAbwaehlen',
|
||||
'ausgewaehlteZeilen',
|
||||
'hilfe',
|
||||
'tabelleneinstellungen',
|
||||
'keineDatenVorhanden',
|
||||
'spaltenEinstellen',
|
||||
'bestelltVon',
|
||||
'erteiltVon',
|
||||
'angenommenVon',
|
||||
'neuerLehrauftragOhneLektorVerplant',
|
||||
'neuerLehrauftragWartetAufBestellung',
|
||||
'letzterStatusBestellt',
|
||||
'letzterStatusErteilt',
|
||||
'letzterStatusAngenommen',
|
||||
'nachAenderungStundensatzStunden',
|
||||
'vorAenderungStundensatzStunden'
|
||||
),
|
||||
'table' => array(
|
||||
'spaltenEinAusblenden',
|
||||
'spaltenEinAusblendenMitKlickOeffnen',
|
||||
'spaltenEinAusblendenAufEinstellungenKlicken',
|
||||
'spaltenEinAusblendenMitKlickAktivieren',
|
||||
'spaltenEinAusblendenMitKlickSchliessen',
|
||||
'spaltenbreiteVeraendern',
|
||||
'spaltenbreiteVeraendernText',
|
||||
'spaltenbreiteVeraendernInfotext',
|
||||
'zeilenAuswaehlen',
|
||||
'zeilenAuswaehlenEinzeln',
|
||||
'zeilenAuswaehlenBereich',
|
||||
'zeilenAuswaehlenAlle'
|
||||
),
|
||||
'lehre' => array(
|
||||
'lehrauftragStandardBestellprozess',
|
||||
'lehrauftragStandardBestellprozessBestellen',
|
||||
'lehrauftragStandardBestellprozessErteilen',
|
||||
'lehrauftragStandardBestellprozessAnnehmen',
|
||||
'lehrauftraegeBestellen',
|
||||
'lehrauftraegeBestellenText',
|
||||
'lehrauftraegeBestellenKlickStatusicon',
|
||||
'lehrauftraegeBestellenLehrauftraegeWaehlen',
|
||||
'lehrauftraegeBestellenMitKlickBestellen',
|
||||
'lehrauftraegeBestellenVertragWirdAngelegt',
|
||||
'geaenderteLehrauftraege',
|
||||
'geaenderteLehrauftraegeText',
|
||||
'lehrauftraegeNichtAuswaehlbar',
|
||||
'lehrauftraegeNichtAuswaehlbarText',
|
||||
'filterAlle',
|
||||
'filterNeu',
|
||||
'filterBestellt',
|
||||
'filterErteilt',
|
||||
'filterAngenommen',
|
||||
'filterGeaendert',
|
||||
'filterDummies'
|
||||
)
|
||||
),
|
||||
'customJSs' => array(
|
||||
'public/js/bootstrapper.js',
|
||||
'public/js/lehre/lehrauftrag/orderLehrauftrag.js'
|
||||
)
|
||||
)
|
||||
);
|
||||
?>
|
||||
|
||||
@@ -212,11 +209,5 @@ $this->load->view(
|
||||
</div><!-- end page-wrapper -->
|
||||
<br>
|
||||
|
||||
<?php
|
||||
|
||||
$this->load->view(
|
||||
'templates/FHC-Footer',
|
||||
$includesArray
|
||||
);
|
||||
?>
|
||||
<?php $this->load->view('templates/FHC-Footer'); ?>
|
||||
|
||||
|
||||
@@ -9,8 +9,22 @@ $sitesettings = array(
|
||||
'ajaxlib' => true,
|
||||
'sbadmintemplate3' => true,
|
||||
'phrases' => array(
|
||||
'abschlusspruefung',
|
||||
'ui'
|
||||
'abschlusspruefung' => array(
|
||||
'freigegebenAm',
|
||||
'pruefungGespeichert',
|
||||
'pruefungSpeichernFehler',
|
||||
'abschlussbeurteilungLeer',
|
||||
'beginnzeitLeer',
|
||||
'beginnzeitFormatError',
|
||||
'endezeitLeer',
|
||||
'endezeitFormatError',
|
||||
'endezeitBeforeError',
|
||||
'verfNotice'
|
||||
),
|
||||
'ui' => array(
|
||||
'stunde',
|
||||
'minute'
|
||||
)
|
||||
),
|
||||
'customCSSs' => array(
|
||||
'public/css/sbadmin2/admintemplate_contentonly.css',
|
||||
@@ -23,18 +37,10 @@ $sitesettings = array(
|
||||
)
|
||||
);
|
||||
|
||||
if(defined('CIS4')){
|
||||
$this->load->view(
|
||||
'templates/CISVUE-Header',
|
||||
$sitesettings
|
||||
);
|
||||
}else{
|
||||
$this->load->view(
|
||||
'templates/FHC-Header',
|
||||
$sitesettings
|
||||
);
|
||||
}
|
||||
|
||||
$this->load->view(
|
||||
'templates/FHC-Header',
|
||||
$sitesettings
|
||||
);
|
||||
?>
|
||||
<div id="wrapper">
|
||||
<div id="page-wrapper">
|
||||
@@ -155,14 +161,6 @@ if(defined('CIS4')){
|
||||
<?php echo ($abschlusspruefung->studiengangstyp == 'Bachelor' ? $this->p->t('abschlusspruefung', 'pruefungsgegenstandBachelor') : $this->p->t('abschlusspruefung', 'pruefungsgegenstandMaster')) ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td>
|
||||
<?php echo $this->p->t('abschlusspruefung', 'spracheDerArbeit') ?> <?php echo $arbeit_name ?>
|
||||
</td>
|
||||
<td colspan="5">
|
||||
<?php echo $abschlusspruefung->abschlussarbeit_sprache ?? '' ?>
|
||||
</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td colspan="6">
|
||||
<?php echo ucfirst($this->p->t('global', 'notizen')); ?>
|
||||
@@ -203,9 +201,7 @@ if(defined('CIS4')){
|
||||
<div class="col-lg-12 text-right">
|
||||
<p>
|
||||
<?php $freigegeben = isset($abschlusspruefung->freigabedatum); ?>
|
||||
<button id="saveProtocolBtn" class="btn btn-default"<?php echo $freigegeben ? ' disabled title="'.$this->p->t('abschlusspruefung', 'bereitsFreigegeben').'"' : '' ?>>
|
||||
<?php echo $this->p->t('ui', 'speichern') ?>
|
||||
</button>
|
||||
<button id="saveProtocolBtn" class="btn btn-default"<?php echo $freigegeben ? " disabled" : "" ?>><?php echo $this->p->t('ui', 'speichern') ?></button>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
@@ -240,14 +236,7 @@ if(defined('CIS4')){
|
||||
</div>
|
||||
</div>
|
||||
<?php
|
||||
if (defined('CIS4')) {
|
||||
$this->load->view(
|
||||
'templates/CISVUE-Footer',
|
||||
$sitesettings
|
||||
);
|
||||
} else {
|
||||
$this->load->view(
|
||||
'templates/FHC-Footer',
|
||||
$sitesettings
|
||||
);
|
||||
}
|
||||
$this->load->view(
|
||||
'templates/FHC-Footer',
|
||||
$sitesettings
|
||||
);
|
||||
|
||||
@@ -6,7 +6,7 @@ $includesArray = array(
|
||||
'fontawesome6' => true,
|
||||
'axios027' => true,
|
||||
'customJSModules' => array_merge([
|
||||
'public/js/apps/Cis/Menu.js'
|
||||
'public/js/apps/Cis.js'
|
||||
], $customJSModules ?? []),
|
||||
'customCSSs' => array_merge([
|
||||
'public/css/Cis4/Cis.css'
|
||||
|
||||
@@ -8,7 +8,7 @@ $includesArray = array(
|
||||
'axios027' => true,
|
||||
'primevue3' => true,
|
||||
'customJSModules' => array_merge([
|
||||
'public/js/apps/Cis/Menu.js'
|
||||
'public/js/apps/Cis.js'
|
||||
], $customJSModules ?? []),
|
||||
'customCSSs' => array_merge([
|
||||
'public/css/Cis4/Cis.css',
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user