mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-22 01:12:17 +00:00
Merge branch 'merge_C4_25999_61235_61730' into rc1_FHC4_C4
This commit is contained in:
@@ -3,12 +3,35 @@ if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
use CI3_Events as Events;
|
||||
|
||||
/**
|
||||
* NOTE(chris): example:
|
||||
Events::on('stv_conf_student', function (&$res) {
|
||||
$res['test'] = [
|
||||
'title' => 'TEST',
|
||||
'component' => './Stv/Studentenverwaltung/Details/Notizen.js'
|
||||
];
|
||||
});
|
||||
*/
|
||||
Events::on('loadRenderers', function ($renderers) {
|
||||
$fhc_core_renderers =& $renderers();
|
||||
$fhc_core_renderers["lehreinheit"] = array(
|
||||
'calendarEvent' => APP_ROOT.'public/js/components/Cis/Renderer/Lehreinheit/calendarEvent.js',
|
||||
'modalTitle' => APP_ROOT.'public/js/components/Cis/Renderer/Lehreinheit/modalTitle.js',
|
||||
'modalContent' => APP_ROOT.'public/js/components/Cis/Renderer/Lehreinheit/modalContent.js',
|
||||
'calendarEventStyles' => APP_ROOT.'public/css/Cis4/CoreCalendarEvents.css'
|
||||
);
|
||||
});
|
||||
|
||||
Events::on('loadRenderers', function ($renderers) {
|
||||
$fhc_core_renderers =& $renderers();
|
||||
$fhc_core_renderers["reservierung"] = array(
|
||||
'calendarEvent' => APP_ROOT.'public/js/components/Cis/Renderer/Reservierungen/calendarEvent.js',
|
||||
'modalTitle' => APP_ROOT.'public/js/components/Cis/Renderer/Reservierungen/modalTitle.js',
|
||||
'modalContent' => APP_ROOT.'public/js/components/Cis/Renderer/Reservierungen/modalContent.js',
|
||||
'calendarEventStyles' => APP_ROOT.'public/css/Cis4/CoreCalendarEvents.css'
|
||||
);
|
||||
});
|
||||
|
||||
Events::on('loadRenderers', function ($renderers) {
|
||||
$fhc_core_renderers =& $renderers();
|
||||
$fhc_core_renderers["ferien"] = array(
|
||||
'calendarEvent' => APP_ROOT.'public/js/components/Cis/Renderer/Feiertage/calendarEvent.js',
|
||||
'modalTitle' => APP_ROOT.'public/js/components/Cis/Renderer/Feiertage/modalTitle.js',
|
||||
'modalContent' => APP_ROOT.'public/js/components/Cis/Renderer/Feiertage/modalContent.js',
|
||||
'calendarEventStyles' => APP_ROOT.'public/css/Cis4/CoreCalendarEvents.css'
|
||||
);
|
||||
});
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -0,0 +1,6 @@
|
||||
<?php
|
||||
|
||||
if (!defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
// Define configuration parameters
|
||||
$config['timezone'] = 'Europe/Vienna';
|
||||
@@ -0,0 +1,25 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
// liste von raumtyp_kurzbz welche in raumsuche studenten angezeigt werden
|
||||
$config['roomtypes_student'] = array(
|
||||
'LAB BM/Chem',
|
||||
'xEDV 1-36',
|
||||
'xEDV 37-60',
|
||||
'EDV 60',
|
||||
'EDV-HÖPL',
|
||||
'EDV ES',
|
||||
'LAB Elek',
|
||||
'LAB ES/TK',
|
||||
'Ener-EDV',
|
||||
'Ener-Lab',
|
||||
'Ener-SEM',
|
||||
'Ener-HS',
|
||||
'HS 59-109',
|
||||
'HS 25-38',
|
||||
'HS 39-58',
|
||||
'LAB Inf',
|
||||
'LAB Robo',
|
||||
'LAB SET'
|
||||
);
|
||||
@@ -61,7 +61,7 @@ $route['api/v1/organisation/[O|o]rganisationseinheit/(:any)'] = 'api/v1/organisa
|
||||
$route['api/v1/ressource/[B|b]etriebsmittelperson/(:any)'] = 'api/v1/ressource/betriebsmittelperson2/$1';
|
||||
$route['api/v1/system/[S|s]prache/(:any)'] = 'api/v1/system/sprache2/$1';
|
||||
|
||||
$route['Cis/Stundenplan/.*'] = 'Cis/Stundenplan/index/$1';
|
||||
$route['Cis/LvPlan/.*'] = 'Cis/LvPlan/index/$1';
|
||||
|
||||
// load routes from extensions
|
||||
$subdir = 'application/config/extensions';
|
||||
|
||||
@@ -0,0 +1,11 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
|
||||
// changing the color theme
|
||||
|
||||
$config['theme_name']='default';
|
||||
$config['theme_css']= "public/css/theme/default.css";
|
||||
$config['theme_logo']= "public/images/logo_fh-complete_300x46.png";
|
||||
$config['theme_modes']=['light','dark'];
|
||||
@@ -0,0 +1,108 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class Abgabetool extends Auth_Controller
|
||||
{
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'index' => self::PERM_LOGGED,
|
||||
'getStudentProjektarbeitAbgabeFile' => self::PERM_LOGGED,
|
||||
'Mitarbeiter' => self::PERM_LOGGED,
|
||||
'Student' => self::PERM_LOGGED,
|
||||
'Deadlines' => self::PERM_LOGGED
|
||||
]);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
|
||||
$viewData = array(
|
||||
'uid'=>getAuthUID(),
|
||||
);
|
||||
|
||||
$this->load->view('CisRouterView/CisRouterView.php', ['viewData' => $viewData, 'route' => 'Abgabetool']);
|
||||
}
|
||||
|
||||
public function Student()
|
||||
{
|
||||
|
||||
$viewData = array(
|
||||
'uid'=>getAuthUID(),
|
||||
);
|
||||
|
||||
$this->load->view('CisRouterView/CisRouterView.php', ['viewData' => $viewData, 'route' => 'AbgabetoolStudent']);
|
||||
}
|
||||
|
||||
public function Mitarbeiter()
|
||||
{
|
||||
|
||||
$viewData = array(
|
||||
'uid'=>getAuthUID(),
|
||||
);
|
||||
|
||||
$this->load->view('CisRouterView/CisRouterView.php', ['viewData' => $viewData, 'route' => 'AbgabetoolMitarbeiter']);
|
||||
}
|
||||
|
||||
public function Deadlines()
|
||||
{
|
||||
|
||||
$viewData = array(
|
||||
'uid'=>getAuthUID(),
|
||||
);
|
||||
|
||||
$this->load->view('CisRouterView/CisRouterView.php', ['viewData' => $viewData, 'route' => 'DeadlinesOverview']);
|
||||
}
|
||||
|
||||
|
||||
public function getStudentProjektarbeitAbgabeFile()
|
||||
{
|
||||
$this->_ci =& get_instance();
|
||||
$this->_ci->load->helper('download');
|
||||
|
||||
$paabgabe_id = $this->_ci->input->get('paabgabe_id');
|
||||
$student_uid = $this->_ci->input->get('student_uid');
|
||||
|
||||
if (!isset($paabgabe_id) || isEmptyString($paabgabe_id) || !isset($student_uid) || isEmptyString($student_uid))
|
||||
$this->terminateWithJsonError($this->p->t('global', 'wrongParameters'), 'general');
|
||||
|
||||
$this->_ci->load->model('education/Projektarbeit_model', 'ProjektarbeitModel');
|
||||
|
||||
$isZugeteilterBetreuer = count($this->_ci->ProjektarbeitModel->checkZuordnung($student_uid, getAuthUID())->retval) > 0;
|
||||
|
||||
if(getAuthUID() == $student_uid || $isZugeteilterBetreuer) {
|
||||
$file_path = PAABGABE_PATH.$paabgabe_id.'_'.$student_uid.'.pdf';
|
||||
if(file_exists($file_path)) {
|
||||
|
||||
header('Content-Description: File Transfer');
|
||||
header('Content-Type: application/octet-stream');
|
||||
header('Expires: 0');
|
||||
header('Cache-Control: must-revalidate');
|
||||
header('Pragma: public');
|
||||
header('Content-Disposition: attachment; filename="'.basename($file_path).'"');
|
||||
header('Content-Length: ' . filesize($file_path));
|
||||
|
||||
flush(); // send headers first just in case
|
||||
readfile($file_path); // read file content to output buffer
|
||||
|
||||
} else {
|
||||
$this->terminateWithJsonError('File not found');
|
||||
}
|
||||
} else {
|
||||
$this->terminateWithJsonError('Keine Zuordnung!');
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class LvPlan 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()
|
||||
{
|
||||
|
||||
$viewData = array(
|
||||
'uid'=>getAuthUID(),
|
||||
'timezone' => $this->config->item('timezone')
|
||||
);
|
||||
|
||||
$this->load->view('CisRouterView/CisRouterView.php', ['viewData' => $viewData, 'route' => 'LvPlan']);
|
||||
}
|
||||
}
|
||||
@@ -55,8 +55,13 @@ class Profil extends Auth_Controller
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
|
||||
$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']);
|
||||
}
|
||||
@@ -68,8 +73,16 @@ class Profil extends Auth_Controller
|
||||
*/
|
||||
public function View($uid)
|
||||
{
|
||||
$viewData = array ('uid' => $uid);
|
||||
|
||||
$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']);
|
||||
}
|
||||
|
||||
|
||||
+4
-4
@@ -5,7 +5,7 @@ if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class Stundenplan extends Auth_Controller
|
||||
class Raumsuche extends Auth_Controller
|
||||
{
|
||||
/**
|
||||
* Constructor
|
||||
@@ -25,11 +25,11 @@ class Stundenplan extends Auth_Controller
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
|
||||
|
||||
$viewData = array(
|
||||
'uid'=>getAuthUID(),
|
||||
);
|
||||
|
||||
$this->load->view('CisRouterView/CisRouterView.php', ['viewData' => $viewData, 'route' => 'Stundenplan']);
|
||||
|
||||
$this->load->view('CisRouterView/CisRouterView.php', ['viewData' => $viewData, 'route' => 'Raumsuche']);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
<?php
|
||||
|
||||
if (!defined('BASEPATH'))
|
||||
exit('No direct script access allowed');
|
||||
|
||||
class Studium extends Auth_Controller
|
||||
{
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'index' => ['basis/cis:r'],
|
||||
|
||||
]);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
|
||||
/**
|
||||
* index loads the Studium view
|
||||
* @access public
|
||||
* @return void
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$viewData = array(
|
||||
|
||||
);
|
||||
$this->load->view('CisRouterView/CisRouterView.php',['viewData' => $viewData, 'route' => 'studium']);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -17,6 +17,9 @@ class Cis4 extends Auth_Controller
|
||||
'index' => 'basis/cis:r'
|
||||
)
|
||||
);
|
||||
|
||||
// Load Config
|
||||
$this->load->config('calendar');
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
@@ -27,15 +30,16 @@ class Cis4 extends Auth_Controller
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$this->load->model('person/Person_model','PersonModel');
|
||||
$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
|
||||
'person_id' => $personData->person_id,
|
||||
'timezone' => $this->config->item('timezone')
|
||||
);
|
||||
|
||||
$this->load->view('CisRouterView/CisRouterView.php',['viewData' => $viewData, 'route' => 'FhcDashboard']);
|
||||
$this->load->view('CisRouterView/CisRouterView.php', ['viewData' => $viewData, 'route' => 'FhcDashboard']);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -87,9 +87,14 @@ class Cms extends Auth_Controller
|
||||
$this->load->view('CisRouterView/CisRouterView.php', ['viewData'=>$viewData, 'route' => 'News']);
|
||||
}
|
||||
|
||||
public function getRoomInformation($ort_kurzbz){
|
||||
public function getRoomInformation($ort_kurzbz)
|
||||
{
|
||||
// Load Config
|
||||
$this->load->config('calendar');
|
||||
|
||||
$viewData = array(
|
||||
'ort_kurzbz' => $ort_kurzbz
|
||||
'ort_kurzbz' => $ort_kurzbz,
|
||||
'timezone' => $this->config->item('timezone')
|
||||
);
|
||||
$this->load->view('CisRouterView/CisRouterView.php', ['viewData' => $viewData, 'route' => 'CmsRoom']);
|
||||
}
|
||||
|
||||
@@ -18,6 +18,14 @@
|
||||
|
||||
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
|
||||
{
|
||||
@@ -31,10 +39,33 @@ class Lehre extends FHCAPI_Controller
|
||||
'lvStudentenMail' => self::PERM_LOGGED,
|
||||
'LV' => self::PERM_LOGGED,
|
||||
'Pruefungen' => self::PERM_LOGGED,
|
||||
'getStudentProjektarbeiten' => self::PERM_LOGGED, // TODO: abgabetool berechtigung?
|
||||
'getStudentProjektabgaben' => self::PERM_LOGGED,
|
||||
'postStudentProjektarbeitZwischenabgabe' => self::PERM_LOGGED,
|
||||
'postStudentProjektarbeitEndupload' => self::PERM_LOGGED,
|
||||
'getMitarbeiterProjektarbeiten' => self::PERM_LOGGED,
|
||||
'postProjektarbeitAbgabe' => self::PERM_LOGGED,
|
||||
'deleteProjektarbeitAbgabe' => self::PERM_LOGGED,
|
||||
'postSerientermin' => self::PERM_LOGGED,
|
||||
'fetchDeadlines' => self::PERM_LOGGED // TODO: mitarbeiter recht prüfen
|
||||
]);
|
||||
|
||||
|
||||
$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');
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
@@ -94,10 +125,557 @@ class Lehre extends FHCAPI_Controller
|
||||
|
||||
$this->terminateWithSuccess($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* fetches all projektabgabetermine for a given projektarbeit_id used in cis4 student abgabetool
|
||||
*/
|
||||
public function getStudentProjektabgaben() {
|
||||
$projektarbeit_id = $this->input->get("projektarbeit_id",TRUE);
|
||||
|
||||
// TODO: error messages
|
||||
|
||||
if (!isset($projektarbeit_id) || isEmptyString($projektarbeit_id))
|
||||
$this->terminateWithError($this->p->t('global', 'wrongParameters'), 'general');
|
||||
|
||||
$projektarbeit_obj = new projektarbeit();
|
||||
if($projektarbeit_id==-1)
|
||||
$this->terminateWithError($this->p->t('global', 'wrongParameters'), 'general');
|
||||
|
||||
if(!$projektarbeit_obj->load($projektarbeit_id))
|
||||
$this->terminateWithError($this->p->t('global', 'wrongParameters'), 'general');
|
||||
|
||||
$paIsCurrent = $projektarbeit_obj->projektarbeitIsCurrent($projektarbeit_id);
|
||||
|
||||
$this->load->model('education/Projektarbeit_model', 'ProjektarbeitModel');
|
||||
$ret = $this->ProjektarbeitModel->getProjektarbeitAbgabetermine($projektarbeit_id);
|
||||
|
||||
// TODO: fetch zweitbetreuer
|
||||
|
||||
$this->terminateWithSuccess(array($ret, $paIsCurrent));
|
||||
}
|
||||
|
||||
/**
|
||||
* fetches all projektarbeiten and betreuer for a given student_uid used in cis4 student abgabetool
|
||||
*/
|
||||
public function getStudentProjektarbeiten($uid)
|
||||
{
|
||||
$this->load->model('ressource/Mitarbeiter_model', 'MitarbeiterModel');
|
||||
$this->load->model('education/Projektarbeit_model', 'ProjektarbeitModel');
|
||||
|
||||
if (!isset($uid) || isEmptyString($uid))
|
||||
$this->terminateWithError($this->p->t('global', 'wrongParameters'), 'general');
|
||||
|
||||
$isZugeteilterBetreuer = count($this->ProjektarbeitModel->checkZuordnung($uid, getAuthUID())->retval) > 0;
|
||||
$this->addMeta('isZugeteilterBetreuer', $isZugeteilterBetreuer);
|
||||
$isMitarbeiter = $this->MitarbeiterModel->isMitarbeiter(getAuthUID());
|
||||
|
||||
if ($isMitarbeiter && $isZugeteilterBetreuer){
|
||||
$projektarbeiten = $this->ProjektarbeitModel->getStudentProjektarbeitenWithBetreuer($uid);
|
||||
} else {
|
||||
$projektarbeiten = $this->ProjektarbeitModel->getStudentProjektarbeitenWithBetreuer(getAuthUID());
|
||||
}
|
||||
|
||||
$this->terminateWithSuccess(array($projektarbeiten, DOMAIN, $uid));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* projektarbeit - upload for zwischenabgaben in cis4 student abgabetool
|
||||
*/
|
||||
public function postStudentProjektarbeitZwischenabgabe()
|
||||
{
|
||||
|
||||
$projektarbeit_id = $_POST['projektarbeit_id'];
|
||||
$paabgabe_id = $_POST['paabgabe_id'];
|
||||
$student_uid = $_POST['student_uid'];
|
||||
$bperson_id = $_POST['bperson_id'];
|
||||
$paabgabetyp_kurzbz = $_POST['paabgabetyp_kurzbz'];
|
||||
|
||||
if (!isset($projektarbeit_id) || isEmptyString($projektarbeit_id)
|
||||
|| !isset($paabgabe_id) || isEmptyString($paabgabe_id)
|
||||
|| !isset($student_uid) || isEmptyString($student_uid)
|
||||
|| !isset($paabgabetyp_kurzbz) || isEmptyString($paabgabetyp_kurzbz))
|
||||
$this->terminateWithError($this->p->t('global', 'wrongParameters'), 'general');
|
||||
|
||||
if ((isset($_FILES) and isset($_FILES['file']) and ! $_FILES['file']['error'])) {
|
||||
move_uploaded_file($_FILES['file']['tmp_name'], PAABGABE_PATH.$paabgabe_id.'_'.$student_uid.'.pdf');
|
||||
|
||||
if(file_exists(PAABGABE_PATH.$paabgabe_id.'_'.$student_uid.'.pdf')) {
|
||||
|
||||
exec('chmod 640 "'.PAABGABE_PATH.$paabgabe_id.'_'.$student_uid.'.pdf'.'"');
|
||||
|
||||
$this->load->model('education/Paabgabe_model', 'PaabgabeModel');
|
||||
$res = $this->PaabgabeModel->update($paabgabe_id, array(
|
||||
'abgabedatum' => date('Y-m-d'),
|
||||
'updatevon' => getAuthUID(),
|
||||
'updateamum' => date('Y-m-d H:i:s')
|
||||
));
|
||||
|
||||
$this->sendUploadEmail($bperson_id, $projektarbeit_id, $paabgabetyp_kurzbz, $student_uid);
|
||||
$this->terminateWithSuccess($res);
|
||||
} else {
|
||||
$this->terminateWithError('Error moving File');
|
||||
}
|
||||
|
||||
} else {
|
||||
$this->terminateWithError('File missing');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* upload für finale abgaben aka Endupload in cis4 student abgabetool
|
||||
*/
|
||||
public function postStudentProjektarbeitEndupload()
|
||||
{
|
||||
|
||||
$projektarbeit_id = $_POST['projektarbeit_id'];
|
||||
$paabgabe_id = $_POST['paabgabe_id'];
|
||||
$student_uid = $_POST['student_uid'];
|
||||
$sprache = $_POST['sprache'];
|
||||
$abstract = $_POST['abstract'];
|
||||
$abstract_en = $_POST['abstract_en'];
|
||||
$schlagwoerter = $_POST['schlagwoerter'];
|
||||
$schlagwoerter_en = $_POST['schlagwoerter_en'];
|
||||
$seitenanzahl = $_POST['seitenanzahl'];
|
||||
$bperson_id = $_POST['bperson_id'];
|
||||
$paabgabetyp_kurzbz = $_POST['paabgabetyp_kurzbz'];
|
||||
|
||||
if (!isset($projektarbeit_id) || isEmptyString($projektarbeit_id)
|
||||
|| !isset($paabgabe_id) || isEmptyString($paabgabe_id)
|
||||
|| !isset($student_uid) || isEmptyString($student_uid)
|
||||
|| !isset($paabgabetyp_kurzbz) || isEmptyString($paabgabetyp_kurzbz))
|
||||
$this->terminateWithError($this->p->t('global', 'wrongParameters'), 'general');
|
||||
|
||||
// TODO: maybe check for other params aswell?
|
||||
|
||||
if ((isset($_FILES) and isset($_FILES['file']) and ! $_FILES['file']['error'])) {
|
||||
move_uploaded_file($_FILES['file']['tmp_name'], PAABGABE_PATH.$paabgabe_id.'_'.$student_uid.'.pdf');
|
||||
|
||||
if(file_exists(PAABGABE_PATH.$paabgabe_id.'_'.$student_uid.'.pdf')) {
|
||||
|
||||
// Loads Libraries
|
||||
$this->load->library('SignatureLib');
|
||||
|
||||
// Check if the document is signed
|
||||
$signaturVorhanden = true;
|
||||
$signList = SignatureLib::list(PAABGABE_PATH.$paabgabe_id.'_'.$student_uid.'.pdf');
|
||||
if (is_array($signList) && count($signList) > 0)
|
||||
{
|
||||
// The document is signed
|
||||
$uploadedDocumentSigned = 'The document is signed';
|
||||
}
|
||||
elseif ($signList === null)
|
||||
{
|
||||
$uploadedDocumentSigned = 'WARNING: signature server error';
|
||||
}
|
||||
else
|
||||
{
|
||||
$signaturVorhanden = false;
|
||||
$uploadedDocumentSigned = 'No document signature found';
|
||||
}
|
||||
$this->addMeta('signaturInfo', $uploadedDocumentSigned);
|
||||
|
||||
if ($signaturVorhanden === false)
|
||||
{
|
||||
$this->signaturFehltEmail($student_uid);
|
||||
}
|
||||
|
||||
// TODO error handle get data has data the updates
|
||||
// update projektarbeit cols
|
||||
$this->load->model('education/Projektarbeit_model', 'ProjektarbeitModel');
|
||||
$this->ProjektarbeitModel->updateProjektarbeit($projektarbeit_id,$sprache,$abstract,$abstract_en
|
||||
,$schlagwoerter, $schlagwoerter_en, $seitenanzahl);
|
||||
|
||||
|
||||
// update paabgabe datum
|
||||
$this->load->model('education/Paabgabe_model', 'PaabgabeModel');
|
||||
$res = $this->PaabgabeModel->update($paabgabe_id, array(
|
||||
'abgabedatum' => date('Y-m-d'),
|
||||
'updatevon' => getAuthUID(),
|
||||
'updateamum' => date('Y-m-d H:i:s')
|
||||
));
|
||||
|
||||
$this->sendUploadEmail($bperson_id, $projektarbeit_id, $paabgabetyp_kurzbz, $student_uid);
|
||||
|
||||
$this->terminateWithSuccess($res);
|
||||
} else {
|
||||
$this->terminateWithError('Error moving File');
|
||||
}
|
||||
|
||||
} else {
|
||||
$this->terminateWithError('File missing');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private function signaturFehltEmail($student_uid) {
|
||||
|
||||
|
||||
// Mail an Studiengang wenn keine Signatur gefunden wurde
|
||||
$student = new student();
|
||||
if(!$student->load($student_uid))
|
||||
$this->terminateWithError($this->p->t('global','userNichtGefunden'), 'general');
|
||||
|
||||
$stg_obj = new studiengang();
|
||||
if(!$stg_obj->load($student->studiengang_kz))
|
||||
$this->terminateWithError($this->p->t('global','fehlerBeimLesenAusDatenbank'), 'general');
|
||||
|
||||
$subject = 'Abgabe ohne Signatur';
|
||||
$tomail = $stg_obj->email;
|
||||
$data = array(
|
||||
'vorname' => $student->vorname,
|
||||
'nachname' => $student->nachname,
|
||||
'studiengang' => $stg_obj->bezeichnung
|
||||
);
|
||||
|
||||
$mailres = sendSanchoMail(
|
||||
'ParbeitsbeurteilungSiganturFehlt',
|
||||
$data,
|
||||
$tomail,
|
||||
$subject,
|
||||
'sancho_header_min_bw.jpg',
|
||||
'sancho_footer_min_bw.jpg'
|
||||
);
|
||||
}
|
||||
|
||||
private function sendUploadEmail($bperson_id, $projektarbeit_id, $paabgabetyp_kurzbz, $student_uid) {
|
||||
|
||||
$this->load->model('education/Projektarbeit_model', 'ProjektarbeitModel');
|
||||
|
||||
$resBetr = $this->ProjektarbeitModel->getProjektbetreuerAnrede($bperson_id);
|
||||
|
||||
$projektarbeit_obj = new projektarbeit();
|
||||
|
||||
if(!$projektarbeit_obj->load($projektarbeit_id))
|
||||
$this->terminateWithError('Ungueltiger Eintrag');
|
||||
|
||||
$num_rows_sem = $projektarbeit_obj->projektarbeitIsCurrent($projektarbeit_id);
|
||||
|
||||
if( null === $num_rows_sem || false === $num_rows_sem )
|
||||
{
|
||||
$this->terminateWithError($this->p->t('abgabetool','fehlerAktualitaetProjektarbeit'), 'general');
|
||||
}
|
||||
|
||||
foreach($resBetr->retval as $betreuerRow) {
|
||||
|
||||
// query student benutzer view for every betreuer row
|
||||
$studentUser = $this->ProjektarbeitModel->getProjektarbeitBenutzer($student_uid)->retval[0];
|
||||
|
||||
// TODO: hasdata, getData etc
|
||||
|
||||
// 1. Begutachter mail ohne Token
|
||||
$mail_baselink = APP_ROOT."index.ci.php/extensions/FHC-Core-Projektarbeitsbeurteilung/ProjektarbeitsbeurteilungErstbegutachter";
|
||||
$mail_fulllink = "$mail_baselink?projektarbeit_id=".$projektarbeit_id."&uid=".$studentUser->uid;
|
||||
$projekttyp_kurzbz = $projektarbeit_obj->projekttyp_kurzbz;
|
||||
$subject = $projektarbeit_obj->projekttyp_kurzbz == 'Diplom' ? 'Masterarbeitsbetreuung' : 'Bachelorarbeitsbetreuung';
|
||||
$abgabetyp = $paabgabetyp_kurzbz == 'end' ? 'Endabgabe' : 'Zwischenabgabe';
|
||||
|
||||
$maildata = array();
|
||||
$maildata['geehrt'] = "geehrte".($betreuerRow->anrede=="Herr"?"r":"");
|
||||
$maildata['anrede'] = $betreuerRow->anrede;
|
||||
$maildata['betreuer_voller_name'] = $betreuerRow->first;
|
||||
$maildata['student_anrede'] = $studentUser->anrede;
|
||||
$maildata['student_voller_name'] = trim($studentUser->titelpre." ".$studentUser->vorname." ".$studentUser->nachname." ".$studentUser->titelpost);
|
||||
$maildata['abgabetyp'] = $abgabetyp;
|
||||
$maildata['parbeituebersichtlink'] = "<p><a href='".APP_ROOT."cis/private/lehre/abgabe_lektor_frameset.html'>Zur Projektarbeitsübersicht</a></p>";
|
||||
$maildata['bewertunglink'] = $num_rows_sem >= 1 && $paabgabetyp_kurzbz == 'end' ? "<p><a href='$mail_fulllink'>Zur Beurteilung der Arbeit</a></p>" : "";
|
||||
$maildata['token'] = "";
|
||||
|
||||
$mailres = sendSanchoMail(
|
||||
'ParbeitsbeurteilungEndupload',
|
||||
$maildata,
|
||||
$betreuerRow->mitarbeiter_uid."@".DOMAIN,
|
||||
$subject,
|
||||
'sancho_header_min_bw.jpg',
|
||||
'sancho_footer_min_bw.jpg',
|
||||
get_uid()."@".DOMAIN);
|
||||
|
||||
if(!$mailres)
|
||||
{
|
||||
$this->terminateWithError($this->p->t('abgabetool', 'fehlerMailBegutachter'), 'general');
|
||||
}
|
||||
|
||||
// 2. Begutachter mail, wenn Endabgabe, mit Token wenn extern
|
||||
if ($paabgabetyp_kurzbz == 'end')
|
||||
{
|
||||
// Zweitbegutachter holen
|
||||
$zweitbegutachter = new projektbetreuer();
|
||||
$zweitbegutachterRes = $zweitbegutachter->getZweitbegutachterWithToken($bperson_id, $projektarbeit_id, $studentUser->uid);
|
||||
|
||||
if ($zweitbegutachterRes)
|
||||
{
|
||||
$zweitbegutachterResults = $zweitbegutachter->result;
|
||||
|
||||
foreach ($zweitbegutachterResults as $begutachter)
|
||||
{
|
||||
// token generieren, wenn noch nicht vorhanden und notwendig (wird in methode überprüft)
|
||||
$tokenGenRes = $zweitbegutachter->generateZweitbegutachterToken($begutachter->person_id, $projektarbeit_id);
|
||||
|
||||
if (!$tokenGenRes)
|
||||
{
|
||||
$this->terminateWithError($this->p->t('abgabetool', 'fehlerMailZweitBegutachter'), 'general');
|
||||
}
|
||||
|
||||
// Zweitbegutachter (evtl. mit Token) holen
|
||||
$zweitbegutachterMitToken = new projektbetreuer();
|
||||
$begutachterMitTokenRes = $zweitbegutachterMitToken->getZweitbegutachterWithToken($bperson_id, $projektarbeit_id, $studentUser->uid, $begutachter->person_id);
|
||||
|
||||
if (!$begutachterMitTokenRes)
|
||||
{
|
||||
$this->terminateWithError($this->p->t('abgabetool', 'fehlerMailZweitBegutachter'), 'general');
|
||||
}
|
||||
|
||||
// Email an Zweitbegutachter senden
|
||||
if (isset($zweitbegutachterMitToken->result[0]))
|
||||
{
|
||||
$begutachterMitToken = $zweitbegutachterMitToken->result[0];
|
||||
|
||||
$path = $begutachterMitToken->betreuerart_kurzbz == 'Zweitbegutachter' ? 'ProjektarbeitsbeurteilungZweitbegutachter' : 'ProjektarbeitsbeurteilungErstbegutachter';
|
||||
$mail_baselink = APP_ROOT."index.ci.php/extensions/FHC-Core-Projektarbeitsbeurteilung/$path";
|
||||
$mail_fulllink = "$mail_baselink?projektarbeit_id=".$projektarbeit_id."&uid=".$studentUser->uid;
|
||||
$intern = isset($begutachterMitToken->uid);
|
||||
$mail_link = $intern ? $mail_fulllink : $mail_baselink;
|
||||
|
||||
$zweitbetmaildata = array();
|
||||
$zweitbetmaildata['geehrt'] = "geehrte" . ($begutachterMitToken->anrede == "Herr" ? "r" : "");
|
||||
$zweitbetmaildata['anrede'] = $begutachterMitToken->anrede;
|
||||
$zweitbetmaildata['betreuer_voller_name'] = $begutachterMitToken->voller_name;
|
||||
$zweitbetmaildata['student_anrede'] = $maildata['student_anrede'];
|
||||
$zweitbetmaildata['student_voller_name'] = $maildata['student_voller_name'];
|
||||
$zweitbetmaildata['abgabetyp'] = $abgabetyp;
|
||||
$zweitbetmaildata['parbeituebersichtlink'] = $intern ? $maildata['parbeituebersichtlink'] : "";
|
||||
$zweitbetmaildata['bewertunglink'] = $num_rows_sem >= 1 ? "<p><a href='$mail_link'>Zur Beurteilung der Arbeit</a></p>" : "";
|
||||
$zweitbetmaildata['token'] = $num_rows_sem >= 1 && isset($begutachterMitToken->zugangstoken) && !$intern ? "<p>Zugangstoken: " . $begutachterMitToken->zugangstoken . "</p>" : "";
|
||||
|
||||
$mailres = sendSanchoMail(
|
||||
'ParbeitsbeurteilungEndupload',
|
||||
$zweitbetmaildata,
|
||||
$begutachterMitToken->email,
|
||||
$subject,
|
||||
'sancho_header_min_bw.jpg',
|
||||
'sancho_footer_min_bw.jpg',
|
||||
get_uid()."@".DOMAIN
|
||||
);
|
||||
|
||||
if (!$mailres)
|
||||
{
|
||||
$this->terminateWithError($this->p->t('abgabetool', 'fehlerMailBegutachter'), 'general');
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function getMitarbeiterProjektarbeiten() {
|
||||
$this->load->model('education/Projektarbeit_model', 'ProjektarbeitModel');
|
||||
|
||||
$boolParamStr = $this->input->get('showall');
|
||||
$trueStrings = ['true', '1'];
|
||||
$falseStrings = ['false', '0'];
|
||||
|
||||
// Handle missing or invalid parameter
|
||||
if ($boolParamStr === null) {
|
||||
$this->terminateWithError($this->p->t('global', 'wrongParameters'), 'general');
|
||||
}
|
||||
$boolParamStrLower = strtolower($boolParamStr);
|
||||
|
||||
if (in_array($boolParamStrLower, $trueStrings, true)) {
|
||||
$showAllBool = true;
|
||||
} elseif (in_array($boolParamStrLower, $falseStrings, true)) {
|
||||
$showAllBool = false;
|
||||
} else {
|
||||
// $this->terminateWithError($this->p->t('global', 'wrongParameters'), 'general');
|
||||
}
|
||||
|
||||
$projektarbeiten = $this->ProjektarbeitModel->getMitarbeiterProjektarbeiten(getAuthUID(), $showAllBool);
|
||||
|
||||
$this->terminateWithSuccess(array($projektarbeiten, DOMAIN));
|
||||
}
|
||||
|
||||
public function postProjektarbeitAbgabe() {
|
||||
$projektarbeit_id = $_POST['projektarbeit_id'];
|
||||
$paabgabe_id = $_POST['paabgabe_id'];
|
||||
$paabgabetyp_kurzbz = $_POST['paabgabetyp_kurzbz'];
|
||||
$datum = $_POST['datum'];
|
||||
$fixtermin = $_POST['fixtermin'];
|
||||
$kurzbz = $_POST['kurzbz'];
|
||||
|
||||
if (!isset($projektarbeit_id) || isEmptyString($projektarbeit_id)
|
||||
|| !isset($paabgabe_id) || isEmptyString($paabgabe_id)
|
||||
|| !isset($datum) || isEmptyString($datum)
|
||||
|| !isset($datum) || isEmptyString($datum)
|
||||
|| !isset($paabgabetyp_kurzbz) || isEmptyString($paabgabetyp_kurzbz))
|
||||
$this->terminateWithError($this->p->t('global', 'wrongParameters'), 'general');
|
||||
|
||||
$this->load->model('education/Paabgabe_model', 'PaabgabeModel');
|
||||
|
||||
if($paabgabe_id == -1) {
|
||||
$result = $this->PaabgabeModel->insert(
|
||||
array(
|
||||
'projektarbeit_id' => $projektarbeit_id,
|
||||
'paabgabetyp_kurzbz' => $paabgabetyp_kurzbz,
|
||||
'fixtermin' => $fixtermin,
|
||||
'datum' => $datum,
|
||||
'kurzbz' => $kurzbz,
|
||||
'insertvon' => getAuthUID(),
|
||||
'insertamum' => date('Y-m-d H:i:s')
|
||||
)
|
||||
);
|
||||
|
||||
$this->terminateWithSuccess($result);
|
||||
} else {
|
||||
$result = $this->PaabgabeModel->update(
|
||||
$paabgabe_id,
|
||||
array(
|
||||
'paabgabetyp_kurzbz' => $paabgabetyp_kurzbz,
|
||||
'datum' => $datum,
|
||||
'kurzbz' => $kurzbz,
|
||||
'updatevon' => getAuthUID(),
|
||||
'updateamum' => date('Y-m-d H:i:s')
|
||||
)
|
||||
);
|
||||
|
||||
$this->terminateWithSuccess($result);
|
||||
}
|
||||
}
|
||||
|
||||
public function deleteProjektarbeitAbgabe() {
|
||||
$paabgabe_id = $_POST['paabgabe_id'];
|
||||
|
||||
if (!isset($paabgabe_id) || isEmptyString($paabgabe_id))
|
||||
$this->terminateWithError($this->p->t('global', 'wrongParameters'), 'general');
|
||||
|
||||
$this->load->model('education/Paabgabe_model', 'PaabgabeModel');
|
||||
|
||||
$result = $this->PaabgabeModel->load($paabgabe_id);
|
||||
$result = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
if(count($result) == 0)
|
||||
$this->terminateWithError($this->p->t('global', 'wrongParameters'), 'general');
|
||||
|
||||
// TODO: berechtigung?
|
||||
if($result[0]->insertvon === getAuthUID()) {
|
||||
$result = $this->PaabgabeModel->delete($paabgabe_id);
|
||||
$result = $this->getDataOrTerminateWithError($result);
|
||||
$this->terminateWithSuccess($result);
|
||||
}
|
||||
|
||||
$this->terminateWithError($this->p->t('global', 'wrongParameters'), 'general');
|
||||
}
|
||||
|
||||
/**
|
||||
* endpoint for adding the same paabgabe for multiple projektarbeiten
|
||||
* can be slow for large n since it queries twice per projektarbeit_id
|
||||
*/
|
||||
public function postSerientermin() {
|
||||
$projektarbeit_ids = $_POST['projektarbeit_ids'];
|
||||
$datum = $_POST['datum'];
|
||||
$paabgabetyp_kurzbz = $_POST['paabgabetyp_kurzbz'];
|
||||
$bezeichnung = $_POST['bezeichnung'];
|
||||
$kurzbz = $_POST['kurzbz'];
|
||||
|
||||
if (!isset($projektarbeit_ids) || !is_array($projektarbeit_ids) || empty($projektarbeit_ids)
|
||||
|| !isset($datum) || isEmptyString($datum)
|
||||
|| !isset($kurzbz) || isEmptyString($kurzbz)
|
||||
|| !isset($bezeichnung) || isEmptyString($bezeichnung)
|
||||
|| !isset($paabgabetyp_kurzbz) || isEmptyString($paabgabetyp_kurzbz))
|
||||
$this->terminateWithError($this->p->t('global', 'wrongParameters'), 'general');
|
||||
|
||||
// old script checks if there already are tbl_paabgabe entries with exact date, type & kurzbz
|
||||
// for each termin - good to check that in principle but should not matter in this place. if necessary
|
||||
// duplicate abgabetermine can be easily deleted manually, also via cronjob@night.
|
||||
|
||||
// since this entry includes the kurzbz string match, it should have only ever mattered when there were
|
||||
// multiple users entering the exact same set of (date, type, kurzbz) - which is a much more narrow case than the
|
||||
// general "saveMultiple" function should handle
|
||||
|
||||
// old script afterwards again queries if user is not the zweitbetreuer of any id - this is blocked in the ui
|
||||
// and should never unintentionally happen
|
||||
|
||||
// TODO: check berechtigung &/|| zuordnung?
|
||||
|
||||
$this->load->model('education/Paabgabe_model', 'PaabgabeModel');
|
||||
$this->load->model('education/Projektarbeit_model', 'ProjektarbeitModel');
|
||||
|
||||
$res = [];
|
||||
foreach ($projektarbeit_ids as $projektarbeit_id) {
|
||||
|
||||
$result = $this->PaabgabeModel->insert(
|
||||
array(
|
||||
'projektarbeit_id' => $projektarbeit_id,
|
||||
'paabgabetyp_kurzbz' => $paabgabetyp_kurzbz,
|
||||
'fixtermin' => false,
|
||||
'datum' => $datum,
|
||||
'kurzbz' => $kurzbz,
|
||||
'insertvon' => getAuthUID(),
|
||||
'insertamum' => date('Y-m-d H:i:s')
|
||||
)
|
||||
);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
// $res[] = $data;
|
||||
|
||||
// send mail to student
|
||||
$result = $this->ProjektarbeitModel->getStudentInfoForProjektarbeitId($projektarbeit_id);
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
// $this->addMeta('emaildata'.$projektarbeit_id, $data);
|
||||
|
||||
$datetime = new DateTime($datum);
|
||||
$dateEmailFormatted = $datetime->format('d.m.Y');
|
||||
|
||||
$anredeFillString = $data[0]->anrede=="Herr"?"r":"";
|
||||
|
||||
$fullFormattedNameString = trim($data[0]->titelpre." ".$data[0]->vorname." ".$data[0]->nachname." ".$data[0]->titelpost);
|
||||
$res[] = $fullFormattedNameString;
|
||||
|
||||
// Prepare mail content
|
||||
$body_fields = array(
|
||||
'anrede' => $data[0]->anrede,
|
||||
'anredeFillString' => $anredeFillString,
|
||||
'datum' => $dateEmailFormatted,
|
||||
'bezeichnung' => $bezeichnung,
|
||||
'fullFormattedNameString' => $fullFormattedNameString,
|
||||
'kurzbz' => $kurzbz
|
||||
);
|
||||
|
||||
$email = $data[0]->uid."@".DOMAIN;
|
||||
|
||||
sendSanchoMail(
|
||||
'neuerAbgabetermin',
|
||||
$body_fields,
|
||||
$email,
|
||||
$this->p->t('abgabetool', 'neuerTerminBachelorMasterbetreuung')
|
||||
);
|
||||
}
|
||||
|
||||
$this->terminateWithSuccess($res);
|
||||
|
||||
}
|
||||
|
||||
public function fetchDeadlines() {
|
||||
$person_id = $_POST['person_id'];
|
||||
|
||||
if (!isset($person_id) || isEmptyString($person_id))
|
||||
$person_id = getAuthPersonId();
|
||||
|
||||
|
||||
if($person_id !== getAuthPersonId()) {
|
||||
$this->load->library('PermissionLib');
|
||||
$isAdmin = $this->permissionlib->isBerechtigt('admin');
|
||||
if(!$isAdmin) $this->terminateWithError($this->p->t('ui', 'keineBerechtigung'), 'general');
|
||||
}
|
||||
|
||||
$this->load->model('education/Paabgabe_model', 'PaabgabeModel');
|
||||
$result = $this->PaabgabeModel->getDeadlines($person_id);
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,264 @@
|
||||
<?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');
|
||||
|
||||
use CI3_Events as Events;
|
||||
use \DateTime as DateTime;
|
||||
use \DateTimeZone as DateTimeZone;
|
||||
|
||||
class LvPlan extends FHCAPI_Controller
|
||||
{
|
||||
|
||||
/**
|
||||
* Object initialization
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
|
||||
parent::__construct([
|
||||
'getRoomplan' => self::PERM_LOGGED,
|
||||
'Stunden' => self::PERM_LOGGED,
|
||||
'getReservierungen' => self::PERM_LOGGED,
|
||||
'LvPlanEvents' => self::PERM_LOGGED,
|
||||
'getLehreinheitStudiensemester' => self::PERM_LOGGED,
|
||||
'studiensemesterDateInterval' => self::PERM_LOGGED,
|
||||
'getLvPlanForStudiensemester' => self::PERM_LOGGED,
|
||||
]);
|
||||
|
||||
$this->load->library('LogLib');
|
||||
$this->loglib->setConfigs(array(
|
||||
'classIndex' => 5,
|
||||
'functionIndex' => 5,
|
||||
'lineIndex' => 4,
|
||||
'dbLogType' => 'API', // required
|
||||
'dbExecuteUser' => 'RESTful API'
|
||||
));
|
||||
|
||||
$this->load->library('form_validation');
|
||||
|
||||
//load models
|
||||
$this->load->model('ressource/Stundenplan_model', 'StundenplanModel');
|
||||
$this->load->model('ressource/Reservierung_model', 'ReservierungModel');
|
||||
|
||||
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
/**
|
||||
* fetches LvPlan and Moodle events together
|
||||
* @access public
|
||||
*
|
||||
*/
|
||||
public function LvPlanEvents(){
|
||||
$this->load->library('StundenplanLib');
|
||||
|
||||
// form validation
|
||||
$this->load->library('form_validation');
|
||||
$this->form_validation->set_data($_GET);
|
||||
$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() === FALSE)
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
// storing the get parameter in local variables
|
||||
$start_date = $this->input->get('start_date', TRUE);
|
||||
$end_date = $this->input->get('end_date', TRUE);
|
||||
$lv_id = $this->input->get('lv_id', TRUE);
|
||||
|
||||
$res_lvplan_events = $this->stundenplanlib->getStundenplan($start_date,$end_date,$lv_id);
|
||||
$lvplan_events = $this->getDataOrTerminateWithError($res_lvplan_events);
|
||||
if( is_null($lvplan_events) || isEmptyArray($lvplan_events) )
|
||||
{
|
||||
$lvplan_events = array();
|
||||
}
|
||||
|
||||
// fetching moodle events
|
||||
$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) {
|
||||
return $moodle_events;
|
||||
},
|
||||
[
|
||||
'start_date' => $start->format('c'),
|
||||
'end_date' => $end->format('c'),
|
||||
'username' => getAuthUID()
|
||||
]
|
||||
);
|
||||
|
||||
$lvAndMoodleEvents = array_merge($lvplan_events,$moodle_events);
|
||||
|
||||
$this->load->model('education/Studentlehrverband_model','StudentLehrverbandModel');
|
||||
$this->load->model('organisation/Studiensemester_model','StudiensemesterModel');
|
||||
$current_Studiensemester = $this->StudiensemesterModel->getAkt();
|
||||
$current_Studiensemester = $this->getDataOrTerminateWithError($current_Studiensemester);
|
||||
$current_Studiensemester = current($current_Studiensemester)->studiensemester_kurzbz;
|
||||
$studiengang = $this->StudentLehrverbandModel->loadWhere(["student_uid"=>getAuthUID(),"studiensemester_kurzbz"=>$current_Studiensemester]);
|
||||
$studiengang = $this->getDataOrTerminateWithError($studiengang);
|
||||
if(!empty($studiengang)){
|
||||
$studiengang = current($studiengang)->studiengang_kz;
|
||||
}else{
|
||||
$studiengang = 0;
|
||||
}
|
||||
|
||||
$ferienEvents = $this->stundenplanlib->fetchFerienTageEvents($start_date, $end_date, $studiengang);
|
||||
$ferienEvents = $this->getDataOrTerminateWithError($ferienEvents);
|
||||
$allEvents = array_merge($lvAndMoodleEvents,$ferienEvents);
|
||||
// sort array with moodle events first
|
||||
usort($lvAndMoodleEvents, function($a, $b){
|
||||
if ($a->type === 'moodle' && $b->type !== 'moodle') {
|
||||
return -1;
|
||||
} elseif ($a->type !== 'moodle' && $b->type === 'moodle') {
|
||||
return 1;
|
||||
} elseif ($a->type === 'ferien' && ($b->type !== 'moodle' && $b->type !== 'ferien')) {
|
||||
return -1;
|
||||
} elseif (($a->type !== 'ferien' && $a->type !== 'moodle') && $b->type === 'ferien') {
|
||||
return 1;
|
||||
} else {
|
||||
return 0;
|
||||
}
|
||||
});
|
||||
|
||||
$this->terminateWithSuccess($allEvents);
|
||||
}
|
||||
|
||||
//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));
|
||||
$this->terminateWithSuccess($studiensemester);
|
||||
}
|
||||
|
||||
public function getLvPlanForStudiensemester($studiensemester,$lvid){
|
||||
$this->load->library('StundenplanLib');
|
||||
$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);
|
||||
$this->terminateWithSuccess($lvplan);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* fetches Stunden layout from database
|
||||
* @access public
|
||||
*
|
||||
*/
|
||||
public function Stunden()
|
||||
{
|
||||
$this->load->model('ressource/Stunde_model', 'StundeModel');
|
||||
|
||||
$stunden = $this->StundeModel->load();
|
||||
|
||||
$stunden = $this->getDataOrTerminateWithError($stunden);
|
||||
|
||||
$this->terminateWithSuccess($stunden);
|
||||
}
|
||||
|
||||
/**
|
||||
* fetches room events from a certain date
|
||||
* @access public
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
public function getRoomplan()
|
||||
{
|
||||
// form validation
|
||||
$this->load->library('form_validation');
|
||||
|
||||
$this->form_validation->set_rules('ort_kurzbz', "Ort", "required");
|
||||
$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
|
||||
$ort_kurzbz = $this->input->post('ort_kurzbz', true);
|
||||
$start_date = $this->input->post('start_date', true);
|
||||
$end_date = $this->input->post('end_date', true);
|
||||
|
||||
// get data
|
||||
$this->load->library('StundenplanLib');
|
||||
|
||||
$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
|
||||
* @access public
|
||||
*
|
||||
* @param string $ort_kurzbz
|
||||
* @return void
|
||||
*/
|
||||
public function getReservierungen($ort_kurzbz = null)
|
||||
{
|
||||
//form validation
|
||||
$this->load->library('form_validation');
|
||||
|
||||
$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);
|
||||
|
||||
// get data
|
||||
$this->load->library('StundenplanLib');
|
||||
|
||||
$result = $this->stundenplanlib->getReservierungen($start_date, $end_date, $ort_kurzbz);
|
||||
|
||||
$result = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($result);
|
||||
}
|
||||
|
||||
public function getLehreinheitStudiensemester($lehreinheit_id){
|
||||
$this->load->model('education/Lehreinheit_model', 'LehreinheitModel');
|
||||
$this->LehreinheitModel->addSelect(["studiensemester_kurzbz"]);
|
||||
$result = $this->LehreinheitModel->load($lehreinheit_id);
|
||||
$result = current($this->getDataOrTerminateWithError($result))->studiensemester_kurzbz;
|
||||
$this->terminateWithSuccess($result);
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -35,15 +35,98 @@ class Ort extends FHCAPI_Controller
|
||||
parent::__construct([
|
||||
'ContentID' => self::PERM_LOGGED,
|
||||
'getOrtKurzbzContent' => self::PERM_LOGGED,
|
||||
'getRooms' => self::PERM_LOGGED,
|
||||
'getTypes' => self::PERM_LOGGED
|
||||
]);
|
||||
|
||||
$this->load->model('ressource/Ort_model', 'OrtModel');
|
||||
|
||||
$this->config->load('raumsuche');
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
/**
|
||||
* Retrieves all Ort entries filtered by the provided parameters
|
||||
*/
|
||||
public function getRooms()
|
||||
{
|
||||
$this->load->library('form_validation');
|
||||
$this->form_validation->set_data($_GET);
|
||||
$this->form_validation->set_rules('datum','Datum','required');
|
||||
$this->form_validation->set_rules('von','Uhrzeit Von','required|regex_match[/^[0-9]{2}:[0-9]{2}$/]');
|
||||
$this->form_validation->set_rules('bis','Uhrzeit Bis','required|regex_match[/^[0-9]{2}:[0-9]{2}$/]');
|
||||
if($this->form_validation->run() == FALSE) {
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
}
|
||||
|
||||
$datum = $this->input->get('datum', TRUE);
|
||||
$von = $this->input->get('von', TRUE);
|
||||
$bis = $this->input->get('bis', TRUE);
|
||||
$typ = $this->input->get('typ', TRUE);
|
||||
$personenanzahl = $this->input->get('personenanzahl', TRUE);
|
||||
|
||||
|
||||
$this->load->model('ressource/Mitarbeiter_model', 'MitarbeiterModel');
|
||||
$isMitarbeiter = $this->MitarbeiterModel->isMitarbeiter(getAuthUID())->retval;
|
||||
|
||||
$this->load->model('ressource/Stunde_model', 'StundeModel');
|
||||
$vonStunde = getData($this->StundeModel->getStundeForTime($von))[0]->stunde;
|
||||
$bisStunde = getData($this->StundeModel->getStundeForTime($bis))[0]->stunde;
|
||||
|
||||
$params = array();
|
||||
$qry = "SELECT DISTINCT tbl_ort.*
|
||||
FROM public.tbl_ort JOIN public.tbl_ortraumtyp USING(ort_kurzbz)
|
||||
WHERE aktiv AND lehre AND ort_kurzbz NOT LIKE '\\\\_%'";
|
||||
if($typ) {
|
||||
$params[] = $typ;
|
||||
$qry.= "AND raumtyp_kurzbz = ?";
|
||||
}
|
||||
|
||||
if(!$isMitarbeiter) { // students are only allowed to get a subset defined by config
|
||||
$qry.= ' AND raumtyp_kurzbz IN ?';
|
||||
$params[] = $this->config->item('roomtypes_student');
|
||||
$this->addMeta('config', $this->config->item('roomtypes_student'));
|
||||
}
|
||||
|
||||
$qry.= "AND (max_person>= ? OR max_person is null)";
|
||||
$params[] = $personenanzahl;
|
||||
|
||||
$qry.=" AND ort_kurzbz NOT IN
|
||||
(
|
||||
SELECT ort_kurzbz FROM lehre.tbl_stundenplandev WHERE datum = ? AND stunde >= ? AND stunde <= ?
|
||||
UNION
|
||||
SELECT ort_kurzbz FROM campus.tbl_reservierung WHERE datum= ? AND stunde >= ? AND stunde <= ?
|
||||
)
|
||||
";
|
||||
$params = array_merge($params, [$datum, $vonStunde, $bisStunde, $datum, $vonStunde, $bisStunde]);
|
||||
// $this->addMeta('qry', $qry);
|
||||
// $this->addMeta('params', $params);
|
||||
$result = $this->OrtModel->execReadOnlyQuery($qry, $params);
|
||||
|
||||
$this->terminateWithSuccess($result);
|
||||
}
|
||||
|
||||
public function getTypes()
|
||||
{
|
||||
$this->load->model('ressource/Raumtyp_model', 'RaumtypModel');
|
||||
$qry = "SELECT * FROM public.tbl_raumtyp WHERE aktiv = true";
|
||||
$params = array();
|
||||
$this->load->model('ressource/Mitarbeiter_model', 'MitarbeiterModel');
|
||||
|
||||
$isMitarbeiter = $this->MitarbeiterModel->isMitarbeiter(getAuthUID())->retval;
|
||||
if(!$isMitarbeiter) { // students are only allowed to get a subset defined by config
|
||||
$qry.= ' AND raumtyp_kurzbz IN ?';
|
||||
$params[] = $this->config->item('roomtypes_student');
|
||||
}
|
||||
|
||||
$qry .= " ORDER BY raumtyp_kurzbz;";
|
||||
|
||||
$result = $this->OrtModel->execReadOnlyQuery($qry, $params);
|
||||
|
||||
$this->terminateWithSuccess(getData($result));
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a JSON body via HTTP POST and provides the parameters
|
||||
*/
|
||||
|
||||
@@ -27,27 +27,17 @@ class Profil extends FHCAPI_Controller
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'getView' => 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');
|
||||
$this->load->model('crm/Student_model', 'StudentModel');
|
||||
$this->load->model('person/Benutzer_model', 'BenutzerModel');
|
||||
$this->load->model('person/Person_model', 'PersonModel');
|
||||
$this->load->model('person/Adresse_model', 'AdresseModel');
|
||||
$this->load->model('person/Benutzerfunktion_model', 'BenutzerfunktionModel');
|
||||
$this->load->model('person/Benutzergruppe_model', 'BenutzergruppeModel');
|
||||
$this->load->model('ressource/Betriebsmittelperson_model', 'BetriebsmittelpersonModel');
|
||||
$this->load->model('person/Kontakt_model', 'KontaktModel');
|
||||
$this->load->model('person/Profil_update_model', 'ProfilUpdateModel');
|
||||
$this->load->model('content/DmsVersion_model', 'DmsVersionModel');
|
||||
|
||||
|
||||
//? put the uid and pid inside the controller for reusability
|
||||
@@ -58,66 +48,25 @@ class Profil extends FHCAPI_Controller
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
|
||||
/**
|
||||
* function that returns the data used for the corresponding view
|
||||
* the client side parses the @param $uid and calls this function to get the data to the correct view
|
||||
* @access public
|
||||
* @param boolean $uid the userID used to identify which information should be retrieved for which view
|
||||
* @return stdClass all the data corresponding to a view of a user
|
||||
*/
|
||||
public function getView($uid)
|
||||
{
|
||||
$res = new stdClass();
|
||||
$editAllowed = getAuthUID() == $uid || $this->permissionlib->isBerechtigt('admin');
|
||||
|
||||
// if parsing the URL did not found a UID then the UID of the logged in user is used
|
||||
if ($uid == "Profil" || $uid == $this->uid) {
|
||||
$isMitarbeiter = $this->MitarbeiterModel->isMitarbeiter($this->uid);
|
||||
if (isError($isMitarbeiter)) {
|
||||
show_error("error while checking if UID: " . $this->uid . " is a mitarbeiter");
|
||||
public function profilViewData($uid=null){
|
||||
$this->load->library('ProfilLib');
|
||||
$editable = false;
|
||||
if(isset($uid) && $uid != null){
|
||||
$profil_data = $this->profillib->getView($uid);
|
||||
if($uid == getAuthUID()){
|
||||
$editable = true;
|
||||
}
|
||||
$isMitarbeiter = getData($isMitarbeiter);
|
||||
if ($isMitarbeiter) {
|
||||
$res->view = "MitarbeiterProfil";
|
||||
$res->data = $this->mitarbeiterProfil();
|
||||
$res->data->pid = $this->pid;
|
||||
} else {
|
||||
$res->view = "StudentProfil";
|
||||
$res->data = $this->studentProfil();
|
||||
$res->data->pid = $this->pid;
|
||||
}
|
||||
// editing your own profil - true
|
||||
$editAllowed = true;
|
||||
}else{
|
||||
$editable = true;
|
||||
$profil_data = $this->profillib->getView(getAuthUID());
|
||||
}
|
||||
// UID is availabe when accessing Profil/View/:uid
|
||||
else {
|
||||
$this->PersonModel->addSelect(["person_id"]);
|
||||
$pid = $this->PersonModel->getByUid($uid);
|
||||
if (isError($pid)) {
|
||||
show_error("error while trying to update table public.tbl_person while searching for a person with UID: " . $uid);
|
||||
}
|
||||
$pid = hasData($pid) ? getData($pid)[0] : null;
|
||||
if (!$pid) {
|
||||
show_error("Person with UID: " . $uid . " does not exist");
|
||||
}
|
||||
$isMitarbeiter = $this->MitarbeiterModel->isMitarbeiter($uid);
|
||||
if (isError($isMitarbeiter)) {
|
||||
show_error("error while checking if UID: " . $uid . " is a mitarbeiter");
|
||||
}
|
||||
$isMitarbeiter = getData($isMitarbeiter);
|
||||
if ($isMitarbeiter) {
|
||||
$res->view = "ViewMitarbeiterProfil";
|
||||
$res->data = $this->viewMitarbeiterProfil($uid);
|
||||
|
||||
} else {
|
||||
$res->view = "ViewStudentProfil";
|
||||
$res->data = $this->viewStudentProfil($uid);
|
||||
}
|
||||
}
|
||||
$res->data->editAllowed = $editAllowed;
|
||||
$this->terminateWithSuccess($res);
|
||||
|
||||
$profil_data = hasData($profil_data) ? getData($profil_data) : null;
|
||||
$viewData = array(
|
||||
'editable'=>$editable,
|
||||
'profil_data' => $profil_data,
|
||||
);
|
||||
$this->terminateWithSuccess($viewData);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -134,14 +83,11 @@ class Profil extends FHCAPI_Controller
|
||||
|
||||
$res = $this->PersonModel->update($this->pid, ["foto_sperre" => $value]);
|
||||
if (isError($res)) {
|
||||
show_error("error while trying to update table public.tbl_person");
|
||||
$this->terminateWithError("error while trying to update table public.tbl_person");
|
||||
}
|
||||
$this->PersonModel->addSelect("foto_sperre");
|
||||
$res = $this->PersonModel->load($this->pid);
|
||||
if (isError($res)) {
|
||||
show_error("error while trying to query table public.tbl_person");
|
||||
}
|
||||
|
||||
|
||||
$res = $this->getDataOrTerminateWithError($res);
|
||||
|
||||
$this->terminateWithSuccess(current($res));
|
||||
@@ -194,91 +140,7 @@ class Profil extends FHCAPI_Controller
|
||||
|
||||
}
|
||||
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
// Private methods
|
||||
|
||||
/**
|
||||
* function that returns the data used for viewing another mitarbeiter profile
|
||||
* @access private
|
||||
* @param integer $uid the userID to retrieve the mitarbeiter data
|
||||
* @return stdClass restricted mitarbeiter data
|
||||
*/
|
||||
private function viewMitarbeiterProfil($uid)
|
||||
{
|
||||
$mailverteiler_res = $this->getMailverteiler($uid);
|
||||
$benutzer_funktion_res = $this->getBenutzerFunktion($uid);
|
||||
$benutzer_res = $this->getBenutzerAlias($uid);
|
||||
$person_res = $this->getPersonInfo($uid);
|
||||
$mitarbeiter_res = $this->getMitarbeiterInfo($uid);
|
||||
$telefon_res = $this->getTelefonInfo($uid);
|
||||
|
||||
$res = new stdClass();
|
||||
$res->username = $uid;
|
||||
|
||||
//? Person Info
|
||||
foreach ($person_res as $key => $val) {
|
||||
$res->$key = $val;
|
||||
}
|
||||
|
||||
//? Mitarbeiter Info
|
||||
foreach ($mitarbeiter_res as $key => $val) {
|
||||
$res->$key = $val;
|
||||
|
||||
}
|
||||
|
||||
$intern_email = array();
|
||||
$intern_email["type"] = "intern";
|
||||
$intern_email["email"] = $uid . "@" . DOMAIN;
|
||||
$extern_email = array();
|
||||
$extern_email["type"] = "alias";
|
||||
$extern_email["email"] = $benutzer_res->alias . "@" . DOMAIN;
|
||||
$res->emails = array($intern_email, $extern_email);
|
||||
|
||||
$res->funktionen = $benutzer_funktion_res;
|
||||
$res->mailverteiler = $mailverteiler_res;
|
||||
$res->standort_telefon = isset($telefon_res) ? $telefon_res->kontakt : null;
|
||||
|
||||
return $res;
|
||||
}
|
||||
|
||||
/**
|
||||
* function that returns the data used for viewing another student profile
|
||||
* @access private
|
||||
* @param integer $uid the userID to retrieve the student data
|
||||
* @return stdClass restricted student data
|
||||
*/
|
||||
private function viewStudentProfil($uid)
|
||||
{
|
||||
$mailverteiler_res = $this->getMailverteiler($uid);
|
||||
$person_res = $this->getPersonInfo($uid);
|
||||
$student_res = $this->getStudentInfo($uid);
|
||||
$matr_res = $this->getMatrikelNummer($uid);
|
||||
|
||||
$res = new stdClass();
|
||||
$res->username = $uid;
|
||||
|
||||
//? Person Information
|
||||
foreach ($person_res as $key => $value) {
|
||||
$res->$key = $value;
|
||||
}
|
||||
|
||||
//? Student Information
|
||||
foreach ($student_res as $key => $value) {
|
||||
$res->$key = $value;
|
||||
}
|
||||
|
||||
$intern_email = array();
|
||||
$intern_email["type"] = "intern";
|
||||
$intern_email["email"] = $uid . "@" . DOMAIN;
|
||||
|
||||
$res->emails = [$intern_email];
|
||||
$res->matrikelnummer = $matr_res->matr_nr;
|
||||
$res->mailverteiler = $mailverteiler_res;
|
||||
|
||||
return $res;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* checks whether a specific userID is a mitarbeiter or not (foreword declaration of the function isMitarbeiter in Mitarbeiter_model.php)
|
||||
* @access public
|
||||
@@ -302,394 +164,9 @@ class Profil extends FHCAPI_Controller
|
||||
$this->terminateWithSuccess($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* function that returns the data used for the mitarbeiter profile
|
||||
* @access private
|
||||
* @return stdClass mitarbeiter data
|
||||
*/
|
||||
private function mitarbeiterProfil()
|
||||
{
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
// Private methods
|
||||
|
||||
$zutrittskarte_ausgegebenam = $this->getZutrittskarteDatum($this->uid);
|
||||
$adresse_res = $this->getAdressenInfo($this->pid);
|
||||
$kontakte_res = $this->getKontaktInfo($this->pid);
|
||||
$mailverteiler_res = $this->getMailverteiler($this->uid);
|
||||
$person_res = $this->getPersonInfo($this->uid, true);
|
||||
$benutzer_funktion_res = $this->getBenutzerFunktion($this->uid);
|
||||
$betriebsmittelperson_res = $this->getBetriebsmittelInfo($this->pid);
|
||||
$profilUpdates = $this->getProfilUpdates($this->uid);
|
||||
$telefon_res = $this->getTelefonInfo($this->uid);
|
||||
$mitarbeiter_res = $this->getMitarbeiterInfo($this->uid);
|
||||
|
||||
$res = new stdClass();
|
||||
$res->username = $this->uid;
|
||||
|
||||
//? Person Information
|
||||
foreach ($person_res as $key => $value) {
|
||||
$res->$key = $value;
|
||||
}
|
||||
|
||||
//? Mitarbeiter Information
|
||||
foreach ($mitarbeiter_res as $key => $value) {
|
||||
$res->$key = $value;
|
||||
}
|
||||
|
||||
$res->adressen = $adresse_res;
|
||||
$res->zutrittsdatum = $zutrittskarte_ausgegebenam;
|
||||
$res->kontakte = $kontakte_res;
|
||||
$res->mittel = $betriebsmittelperson_res;
|
||||
$res->mailverteiler = $mailverteiler_res;
|
||||
|
||||
$intern_email = array();
|
||||
$intern_email["type"] = "intern";
|
||||
$intern_email["email"] = $this->uid . "@" . DOMAIN;
|
||||
$extern_email = array();
|
||||
$extern_email["type"] = "alias";
|
||||
$extern_email["email"] = $mitarbeiter_res->alias . "@" . DOMAIN;
|
||||
$res->emails = [$intern_email, $extern_email];
|
||||
|
||||
$res->funktionen = $benutzer_funktion_res;
|
||||
$res->standort_telefon = $telefon_res;
|
||||
$res->profilUpdates = $profilUpdates;
|
||||
|
||||
return $res;
|
||||
}
|
||||
|
||||
/**
|
||||
* function that returns the data used for the student profile
|
||||
* @access private
|
||||
* @return stdClass student data
|
||||
*/
|
||||
private function studentProfil()
|
||||
{
|
||||
$betriebsmittelperson_res = $this->getBetriebsmittelInfo($this->pid);
|
||||
$kontakte_res = $this->getKontaktInfo($this->pid);
|
||||
$zutrittskarte_ausgegebenam = $this->getZutrittskarteDatum($this->uid);
|
||||
$adresse_res = $this->getAdressenInfo($this->pid);
|
||||
$mailverteiler_res = $this->getMailverteiler($this->uid);
|
||||
$person_res = $this->getPersonInfo($this->uid, true);
|
||||
$zutrittsgruppe_res = $this->getZutrittsgruppen($this->uid);
|
||||
$student_res = $this->getStudentInfo($this->uid);
|
||||
$matr_res = $this->getMatrikelNummer($this->uid);
|
||||
$profilUpdates = $this->getProfilUpdates($this->uid);
|
||||
|
||||
$res = new stdClass();
|
||||
$res->username = $this->uid;
|
||||
|
||||
//? Person Information
|
||||
foreach ($person_res as $key => $value) {
|
||||
$res->$key = $value;
|
||||
}
|
||||
|
||||
//? Student Information
|
||||
foreach ($student_res as $key => $value) {
|
||||
$res->$key = trim($value);
|
||||
}
|
||||
|
||||
$intern_email = array();
|
||||
$intern_email["type"] = "intern";
|
||||
$intern_email["email"] = $this->uid . "@" . DOMAIN;
|
||||
|
||||
$res->emails = [$intern_email];
|
||||
$res->adressen = $adresse_res;
|
||||
$res->zutrittsdatum = $zutrittskarte_ausgegebenam;
|
||||
$res->kontakte = $kontakte_res;
|
||||
$res->mittel = $betriebsmittelperson_res;
|
||||
$res->matrikelnummer = $matr_res->matr_nr;
|
||||
$res->zuttritsgruppen = $zutrittsgruppe_res;
|
||||
$res->mailverteiler = $mailverteiler_res;
|
||||
$res->profilUpdates = $profilUpdates;
|
||||
|
||||
return $res;
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* gets all the mailverteiler using the tables: tbl_benutzer, tbl_benutzergruppe, tbl_gruppe
|
||||
* @access private
|
||||
* @param integer $uid the userID used to retrieve the mailverteiler
|
||||
* @return array returns the mailvertailer corresponding to a userID
|
||||
*/
|
||||
private function getMailverteiler($uid)
|
||||
{
|
||||
$this->PersonModel->addSelect('gruppe_kurzbz, beschreibung');
|
||||
$this->PersonModel->addJoin('tbl_benutzer', 'person_id');
|
||||
$this->PersonModel->addJoin('tbl_benutzergruppe', 'uid');
|
||||
$this->PersonModel->addJoin('tbl_gruppe', 'gruppe_kurzbz');
|
||||
|
||||
$mailverteiler_res = $this->PersonModel->loadWhere(array('mailgrp' => true, 'uid' => $uid));
|
||||
if (isError($mailverteiler_res)) {
|
||||
show_error("was not able to query the table public.tbl_benutzer:" . getData($mailverteiler_res));
|
||||
}
|
||||
$mailverteiler_res = hasData($mailverteiler_res) ? getData($mailverteiler_res) : null;
|
||||
$mailverteiler_res = array_map(function ($element) {
|
||||
$element->mailto = "mailto:" . $element->gruppe_kurzbz . "@" . DOMAIN;
|
||||
return $element;
|
||||
}, $mailverteiler_res);
|
||||
return $mailverteiler_res;
|
||||
}
|
||||
|
||||
/**
|
||||
* gets all the Benutzerfunktionen of a corresponding user
|
||||
* @access private
|
||||
* @param integer $uid the userID used to retrieve the Benutzerfunktionen
|
||||
* @return array returns the Benutzerfunktionen corresponding to a userID
|
||||
*/
|
||||
private function getBenutzerFunktion($uid)
|
||||
{
|
||||
$this->BenutzerfunktionModel->addSelect(["tbl_benutzerfunktion.bezeichnung as Bezeichnung", "tbl_organisationseinheit.bezeichnung as Organisationseinheit", "datum_von as Gültig_von", "datum_bis as Gültig_bis", "wochenstunden as Wochenstunden"]);
|
||||
$this->BenutzerfunktionModel->addJoin("tbl_organisationseinheit", "oe_kurzbz");
|
||||
|
||||
$benutzer_funktion_res = $this->BenutzerfunktionModel->loadWhere(array('uid' => $uid));
|
||||
if (isError($benutzer_funktion_res)) {
|
||||
show_error("was not able to query the table public.tbl_benutzerfunktion:" . getData($benutzer_funktion_res));
|
||||
}
|
||||
$benutzer_funktion_res = hasData($benutzer_funktion_res) ? getData($benutzer_funktion_res) : null;
|
||||
return $benutzer_funktion_res;
|
||||
}
|
||||
|
||||
/**
|
||||
* gets all the Betriebsmittel of a corresponding user
|
||||
* @access private
|
||||
* @param integer $uid the userID used to retrieve the Betriebsmittel
|
||||
* @return array returns the Betriebsmittel corresponding to a userID
|
||||
*/
|
||||
private function getBetriebsmittelInfo($pid)
|
||||
{
|
||||
$this->BetriebsmittelpersonModel->addSelect(["CONCAT(betriebsmitteltyp, ' ' ,beschreibung) as Betriebsmittel", "nummer as Nummer", "ausgegebenam as Ausgegeben_am"]);
|
||||
|
||||
//? betriebsmittel are not needed in a view
|
||||
$betriebsmittelperson_res = $this->BetriebsmittelpersonModel->getBetriebsmittel($pid);
|
||||
if (isError($betriebsmittelperson_res)) {
|
||||
show_error("was not able to query the table public.tbl_betriebsmittelperson:" . getData($betriebsmittelperson_res));
|
||||
}
|
||||
$betriebsmittelperson_res = hasData($betriebsmittelperson_res) ? getData($betriebsmittelperson_res) : null;
|
||||
return $betriebsmittelperson_res;
|
||||
}
|
||||
|
||||
/**
|
||||
* gets the alias of a corresponding user
|
||||
* @access private
|
||||
* @param integer $uid the userID used to get the alias
|
||||
* @return string the alias of the userID
|
||||
*/
|
||||
private function getBenutzerAlias($uid)
|
||||
{
|
||||
$this->BenutzerModel->addSelect(["alias"]);
|
||||
$benutzer_res = $this->BenutzerModel->load([$uid]);
|
||||
if (isError($benutzer_res)) {
|
||||
show_error("was not able to query the table public.tbl_benutzer:" . getData($benutzer_res));
|
||||
} else {
|
||||
$benutzer_res = hasData($benutzer_res) ? getData($benutzer_res)[0] : null;
|
||||
}
|
||||
|
||||
return $benutzer_res;
|
||||
}
|
||||
|
||||
/**
|
||||
* gets the person information corresponding to a user
|
||||
* @access private
|
||||
* @param integer $uid the userID used to get the person information
|
||||
* @param integer $geburtsInfo flag wether to add the columns gebort, gebdatum, foto_sperre or not
|
||||
* @return array all the person informaion corresponding to a userID
|
||||
*/
|
||||
private function getPersonInfo($uid, $geburtsInfo = null)
|
||||
{
|
||||
$selectClause = ["foto", "foto_sperre", "anrede", "titelpost as postnomen", "titelpre as titel", "vorname", "nachname"];
|
||||
/** @param integer $geburtsInfo */
|
||||
if ($geburtsInfo) {
|
||||
array_push($selectClause, "gebort");
|
||||
array_push($selectClause, "TO_CHAR(gebdatum, 'DD.MM.YYYY') as gebdatum");
|
||||
}
|
||||
$this->BenutzerModel->addSelect($selectClause);
|
||||
$this->BenutzerModel->addJoin("tbl_person", "person_id");
|
||||
|
||||
$person_res = $this->BenutzerModel->load([$uid]);
|
||||
if (isError($person_res)) {
|
||||
show_error("was not able to query the table public.tbl_benutzer:" . getData($person_res));
|
||||
} else {
|
||||
$person_res = hasData($person_res) ? getData($person_res)[0] : null;
|
||||
}
|
||||
|
||||
if( ($person_res->foto === null) || (($this->uid !== $uid) && ($person_res->foto_sperre !== false)) )
|
||||
{
|
||||
$dummy_foto = base64_encode(file_get_contents(DOC_ROOT.'skin/images/profilbild_dummy.jpg'));
|
||||
$person_res->foto = $dummy_foto;
|
||||
}
|
||||
|
||||
return $person_res;
|
||||
}
|
||||
|
||||
/**
|
||||
* gets the mitarbeiter information corresponding to a user
|
||||
* @access private
|
||||
* @param integer $uid the userID used to get the mitarbeiter information
|
||||
* @return array all the mitarbeiter informaion corresponding to a userID
|
||||
*/
|
||||
private function getMitarbeiterInfo($uid)
|
||||
{
|
||||
$this->MitarbeiterModel->addSelect(["kurzbz", "telefonklappe", "alias", "ort_kurzbz"]);
|
||||
$this->MitarbeiterModel->addJoin("tbl_benutzer", "tbl_benutzer.uid = tbl_mitarbeiter.mitarbeiter_uid");
|
||||
$mitarbeiter_res = $this->MitarbeiterModel->load($uid);
|
||||
if (isError($mitarbeiter_res)) {
|
||||
show_error("was not able to query the table public.tbl_mitarbeiter:" . getData($mitarbeiter_res));
|
||||
} else {
|
||||
$mitarbeiter_res = hasData($mitarbeiter_res) ? getData($mitarbeiter_res)[0] : null;
|
||||
}
|
||||
|
||||
return $mitarbeiter_res;
|
||||
}
|
||||
|
||||
/**
|
||||
* gets the telefon information corresponding to a user
|
||||
* @access private
|
||||
* @param integer $uid the userID used to get the telefon information
|
||||
* @return array all the telefon informaion corresponding to a userID
|
||||
*/
|
||||
private function getTelefonInfo($uid)
|
||||
{
|
||||
$this->MitarbeiterModel->addSelect(["kontakt"]);
|
||||
$this->MitarbeiterModel->addJoin("tbl_kontakt", "tbl_mitarbeiter.standort_id = tbl_kontakt.standort_id");
|
||||
$this->MitarbeiterModel->addLimit(1);
|
||||
$telefon_res = $this->MitarbeiterModel->loadWhere(["mitarbeiter_uid" => $uid, "kontakttyp" => "telefon"]);
|
||||
if (isError($telefon_res)) {
|
||||
show_error("was not able to query the table public.tbl_mitarbeiter:" . getData($telefon_res));
|
||||
}
|
||||
$telefon_res = hasData($telefon_res) ? getData($telefon_res)[0] : null;
|
||||
return $telefon_res;
|
||||
}
|
||||
|
||||
/**
|
||||
* gets the student information corresponding to a user
|
||||
* @access private
|
||||
* @param integer $uid the userID used to get the student information
|
||||
* @return array all the student informaion corresponding to a userID
|
||||
*/
|
||||
private function getStudentInfo($uid)
|
||||
{
|
||||
$this->StudentModel->addSelect(['tbl_studiengang.bezeichnung as studiengang', 'tbl_studiengang.studiengang_kz as studiengang_kz', 'tbl_student.semester', 'tbl_student.verband', 'tbl_student.gruppe', 'tbl_student.matrikelnr as personenkennzeichen']);
|
||||
$this->StudentModel->addJoin('tbl_studiengang', "tbl_studiengang.studiengang_kz=tbl_student.studiengang_kz");
|
||||
|
||||
$student_res = $this->StudentModel->load([$uid]);
|
||||
if (isError($student_res)) {
|
||||
show_error("was not able to query the table public.tbl_student:" . getData($student_res));
|
||||
}
|
||||
$student_res = hasData($student_res) ? getData($student_res)[0] : null;
|
||||
return $student_res;
|
||||
}
|
||||
|
||||
/**
|
||||
* gets the profil updates corresponding to a user
|
||||
* @access private
|
||||
* @param integer $uid the userID used to get the profil updates
|
||||
* @return array all the profil updates corresponding to a userID
|
||||
*/
|
||||
private function getProfilUpdates($uid)
|
||||
{
|
||||
$profilUpdates = $this->ProfilUpdateModel->getProfilUpdatesWhere(['uid' => $uid]);
|
||||
if (isError($profilUpdates)) {
|
||||
show_error("was not able to query the table public.tbl_profil_update:" . getData($profilUpdates));
|
||||
}
|
||||
$profilUpdates = hasData($profilUpdates) ? getData($profilUpdates) : null;
|
||||
return $profilUpdates;
|
||||
}
|
||||
|
||||
/**
|
||||
* gets the Matrikelnummer corresponding to a user
|
||||
* @access private
|
||||
* @param integer $uid the userID used to get the Matrikelnummer
|
||||
* @return integer the Matrikelnummer corresponding to a userID
|
||||
*/
|
||||
private function getMatrikelNummer($uid)
|
||||
{
|
||||
$this->BenutzerModel->addSelect(["matr_nr"]);
|
||||
$this->BenutzerModel->addJoin("tbl_person", "person_id");
|
||||
|
||||
$matr_res = $this->BenutzerModel->load([$uid]);
|
||||
if (isError($matr_res)) {
|
||||
show_error("was not able to query the table public.tbl_benutzer:" . getData($matr_res));
|
||||
}
|
||||
$matr_res = hasData($matr_res) ? getData($matr_res)[0] : [];
|
||||
return $matr_res;
|
||||
}
|
||||
|
||||
/**
|
||||
* gets the Zutrittsgruppen corresponding to a user
|
||||
* @access private
|
||||
* @param integer $uid the userID used to get the Zutrittsgruppen
|
||||
* @return array all the Zutrittsgruppen corresponding to a userID
|
||||
*/
|
||||
private function getZutrittsgruppen($uid)
|
||||
{
|
||||
$this->BenutzergruppeModel->addSelect(['bezeichnung']);
|
||||
$this->BenutzergruppeModel->addJoin('tbl_gruppe', 'gruppe_kurzbz');
|
||||
|
||||
$zutrittsgruppe_res = $this->BenutzergruppeModel->loadWhere(array("uid" => $uid, "zutrittssystem" => true));
|
||||
if (isError($zutrittsgruppe_res)) {
|
||||
show_error("was not able to query the table public.tbl_benutzergruppe:" . getData($zutrittsgruppe_res));
|
||||
}
|
||||
$zutrittsgruppe_res = hasData($zutrittsgruppe_res) ? getData($zutrittsgruppe_res) : null;
|
||||
return $zutrittsgruppe_res;
|
||||
}
|
||||
|
||||
/**
|
||||
* gets the address information corresponding to a user
|
||||
* @access private
|
||||
* @param integer $uid the userID used to get the address information
|
||||
* @return array all the address information corresponding to a userID
|
||||
*/
|
||||
private function getAdressenInfo($pid)
|
||||
{
|
||||
$adresse_res = $this->AdresseModel->addSelect(["adresse_id", "strasse", "tbl_adressentyp.bezeichnung as typ", "plz", "ort", "zustelladresse", "gemeinde", "nation"]);
|
||||
$adresse_res = $this->AdresseModel->addOrder("zustelladresse", "DESC");
|
||||
$adresse_res = $this->AdresseModel->addJoin("tbl_adressentyp", "typ=adressentyp_kurzbz");
|
||||
|
||||
$adresse_res = $this->AdresseModel->loadWhere(["person_id" => $pid]);
|
||||
if (isError($adresse_res)) {
|
||||
show_error("was not able to query the table public.tbl_adresse:" . getData($adresse_res));
|
||||
}
|
||||
$adresse_res = hasData($adresse_res) ? getData($adresse_res) : null;
|
||||
return $adresse_res;
|
||||
}
|
||||
|
||||
/**
|
||||
* gets the kontakt information corresponding to a user
|
||||
* @access private
|
||||
* @param integer $uid the userID used to get the kontakt information
|
||||
* @return array all the kontakt information corresponding to a userID
|
||||
*/
|
||||
private function getKontaktInfo($pid)
|
||||
{
|
||||
$this->KontaktModel->addSelect(['kontakttyp', 'kontakt_id', 'kontakt', 'tbl_kontakt.anmerkung', 'tbl_kontakt.zustellung']);
|
||||
$this->KontaktModel->addJoin('public.tbl_standort', 'standort_id', 'LEFT');
|
||||
$this->KontaktModel->addJoin('public.tbl_firma', 'firma_id', 'LEFT');
|
||||
$this->KontaktModel->addOrder('kontakttyp, kontakt, tbl_kontakt.updateamum, tbl_kontakt.insertamum');
|
||||
|
||||
$kontakte_res = $this->KontaktModel->loadWhere(['person_id' => $pid]);
|
||||
if (isError($kontakte_res)) {
|
||||
show_error("was not able to query the table public.tbl_kontakt:" . getData($kontakte_res));
|
||||
}
|
||||
$kontakte_res = hasData($kontakte_res) ? getData($kontakte_res) : null;
|
||||
return $kontakte_res;
|
||||
}
|
||||
|
||||
/**
|
||||
* gets the date of issue of the FH access card corresponding to a user
|
||||
* @access private
|
||||
* @param integer $uid the userID used to get the date of issue of the FH access card
|
||||
* @return string the date of issue of the FH access card corresponding to a userID
|
||||
*/
|
||||
private function getZutrittskarteDatum($uid)
|
||||
{
|
||||
$zutrittskarte_ausgegebenam = $this->BetriebsmittelpersonModel->getBetriebsmittelByUid($uid, "Zutrittskarte");
|
||||
if (isError($zutrittskarte_ausgegebenam)) {
|
||||
show_error("was not able to query the table wavi.tbl_bentriebsmittelperson:" . getData($zutrittskarte_ausgegebenam));
|
||||
}
|
||||
$zutrittskarte_ausgegebenam = hasData($zutrittskarte_ausgegebenam) ? getData($zutrittskarte_ausgegebenam)[0]->ausgegebenam : null;
|
||||
|
||||
//? formats date from 01-01-2000 to 01.01.2000
|
||||
$zutrittskarte_ausgegebenam = str_replace("-", ".", $zutrittskarte_ausgegebenam);
|
||||
return $zutrittskarte_ausgegebenam;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -44,6 +44,7 @@ class ProfilUpdate extends FHCAPI_Controller
|
||||
'updateProfilRequest' => self::PERM_LOGGED,
|
||||
'deleteProfilRequest' => self::PERM_LOGGED,
|
||||
'insertFile' => self::PERM_LOGGED,
|
||||
'updateProfilbild' => self::PERM_LOGGED,
|
||||
'show' => self::PERM_LOGGED,
|
||||
]);
|
||||
|
||||
@@ -478,6 +479,96 @@ class ProfilUpdate extends FHCAPI_Controller
|
||||
$this->terminateWithSuccess($res);
|
||||
}
|
||||
|
||||
public function updateProfilbild()
|
||||
{
|
||||
|
||||
$resize = function($filename, $width, $height){
|
||||
// Hoehe und Breite neu berechnen
|
||||
list($width_orig, $height_orig) = getimagesize($filename);
|
||||
|
||||
if ($width && ($width_orig < $height_orig))
|
||||
{
|
||||
$width = ($height / $height_orig) * $width_orig;
|
||||
}
|
||||
else
|
||||
{
|
||||
$height = ($width / $width_orig) * $height_orig;
|
||||
}
|
||||
|
||||
$image_p = imagecreatetruecolor($width, $height);
|
||||
|
||||
$image = imagecreatefromjpeg($filename);
|
||||
|
||||
//Bild nur verkleinern aber nicht vergroessern
|
||||
if($width_orig>$width || $height_orig>$height)
|
||||
imagecopyresampled($image_p, $image, 0, 0, 0, 0, $width, $height, $width_orig, $height_orig);
|
||||
else
|
||||
$image_p = $image;
|
||||
|
||||
imagejpeg($image_p, $filename, 80);
|
||||
|
||||
@imagedestroy($image_p);
|
||||
@imagedestroy($image);
|
||||
};
|
||||
|
||||
if (!count($_FILES)) {
|
||||
$this->terminateWithError("No file available for upload");
|
||||
}
|
||||
|
||||
$files = $_FILES['files'];
|
||||
|
||||
$_FILES['files']['name'] = current($files['name']);
|
||||
$_FILES['files']['type'] = current($files['type']);
|
||||
$_FILES['files']['tmp_name'] = current($files['tmp_name']);
|
||||
$_FILES['files']['error'] = current($files['error']);
|
||||
$_FILES['files']['size'] = current($files['size']);
|
||||
$_FILES['files']['tmp_name'] = current($files['tmp_name']);
|
||||
|
||||
$filename = $_FILES['files']['tmp_name'];
|
||||
|
||||
$ext = substr(current($files['name']), strrpos(current($files['name']), '.') + 1);
|
||||
if($ext!='jpg' && $ext!='jpeg'){
|
||||
$this->terminateWithError("Only jpg and jpeg files are allowed for profilbild upload");
|
||||
}
|
||||
|
||||
// resize
|
||||
$resize($filename, 827, 1063);
|
||||
|
||||
//akte
|
||||
$fp = fopen($filename,'r');
|
||||
//auslesen
|
||||
$content = fread($fp, filesize($filename));
|
||||
$base64_content = base64_encode($content);
|
||||
$this->load->library('AkteLib');
|
||||
$aktenInsertResult = $this->aktelib->add($this->pid,'Lichtbil',"Lichtbild_".$this->pid.".jpg","image/jpg",$fp,"Lichtbild gross");
|
||||
fclose($fp);
|
||||
if (isError($aktenInsertResult)) {
|
||||
$this->terminateWithError(getError($aktenInsertResult));
|
||||
}
|
||||
|
||||
// in person abspeichern
|
||||
$resize($filename, 101, 130);
|
||||
$fp = fopen($filename,'r');
|
||||
$content = fread($fp, filesize($filename));
|
||||
fclose($fp);
|
||||
$base64_content = base64_encode($content);
|
||||
$this->load->model('person/Person_model','PersonModel');
|
||||
$personUpdate = $this->PersonModel->update($this->pid, ["foto"=>$base64_content]);
|
||||
if(isError($personUpdate)){
|
||||
$this->terminateWithError(getError($personUpdate));
|
||||
}
|
||||
|
||||
|
||||
// update foto status
|
||||
$this->load->model('person/Fotostatusperson_model','FotostatusModel');
|
||||
$fotoInsert = $this->FotostatusModel->insert(["person_id"=>$this->pid,"fotostatus_kurzbz"=>"hochgeladen","datum"=>date('Y-m-d'),"insertamum"=>date('Y-m-d H:i:s'),"insertvon"=>$this->uid,"updateamum"=>date('Y-m-d H:i:s'),"updatevon"=>$this->uid]);
|
||||
if(isError($fotoInsert)){
|
||||
$this->terminateWithError(getError($fotoInsert));
|
||||
}
|
||||
|
||||
$this->terminateWithSuccess();
|
||||
}
|
||||
|
||||
public function getProfilUpdateWithPermission($status = null)
|
||||
{
|
||||
// early return if no status has been passed as argument
|
||||
|
||||
@@ -0,0 +1,72 @@
|
||||
<?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');
|
||||
|
||||
use CI3_Events as Events;
|
||||
|
||||
class RendererLoader extends FHCAPI_Controller
|
||||
{
|
||||
|
||||
/**
|
||||
* Object initialization
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
|
||||
parent::__construct([
|
||||
'GetRenderers' => self::PERM_LOGGED,
|
||||
|
||||
]);
|
||||
|
||||
$this->load->library('LogLib');
|
||||
$this->loglib->setConfigs(array(
|
||||
'classIndex' => 5,
|
||||
'functionIndex' => 5,
|
||||
'lineIndex' => 4,
|
||||
'dbLogType' => 'API', // required
|
||||
'dbExecuteUser' => 'RESTful API'
|
||||
));
|
||||
|
||||
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
/**
|
||||
* fetches Stundenplan and Moodle events together
|
||||
* @access public
|
||||
*
|
||||
*/
|
||||
public function GetRenderers(){
|
||||
$renderer_paths = [];
|
||||
Events::trigger(
|
||||
'loadRenderers',
|
||||
function & () use (&$renderer_paths)
|
||||
{
|
||||
return $renderer_paths;
|
||||
}
|
||||
);
|
||||
$this->terminateWithSuccess($renderer_paths);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
@@ -0,0 +1,329 @@
|
||||
<?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');
|
||||
|
||||
use CI3_Events as Events;
|
||||
|
||||
class Studium extends FHCAPI_Controller
|
||||
{
|
||||
|
||||
/**
|
||||
* Object initialization
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'getStudienAllSemester'=> self::PERM_LOGGED,
|
||||
'getStudiengaengeForStudienSemester'=> self::PERM_LOGGED,
|
||||
'getStudienplaeneBySemester'=> self::PERM_LOGGED,
|
||||
'getLvEvaluierungInfo'=> self::PERM_LOGGED,
|
||||
]);
|
||||
|
||||
$this->load->model('crm/Student_model', 'StudentModel');
|
||||
$this->load->model('organisation/Studiengang_model', 'StudiengangModel');
|
||||
$this->load->model('organisation/Studienordnung_model','StudienordnungModel');
|
||||
$this->load->model('organisation/Studiensemester_model',"StudiensemesterModel");
|
||||
$this->load->model('organisation/Studienplan_model', 'StudienplanModel');
|
||||
$this->load->model('education/Studentlehrverband_model', 'StudentlehrverbandModel');
|
||||
$this->load->model('crm/Prestudentstatus_model', 'PrestudentstatusModel');
|
||||
$this->load->model('codex/Orgform_model','OrgformModel');
|
||||
$this->load->model('person/Person_model','PersonModel');
|
||||
|
||||
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
public function getStudienAllSemester(){
|
||||
|
||||
$parameter_studiensemester = $this->input->get('studiensemester',true);
|
||||
$parameter_studiengang = $this->input->get('studiengang',true);
|
||||
$parameter_semester = $this->input->get('semester',true);
|
||||
$parameter_studienplan = $this->input->get('studienplan',true);
|
||||
|
||||
$aktuelles_studiensemester = current($this->getDataOrTerminateWithError($this->StudiensemesterModel->getAkt()));
|
||||
|
||||
if($this->getDataOrTerminateWithError($this->StudentModel->isStudent(getAuthUID()))){
|
||||
$studentLehrverband =$this->StudentlehrverbandModel->loadWhere(["student_uid" => getAuthUID(), "studiensemester_kurzbz" => $aktuelles_studiensemester->studiensemester_kurzbz]);
|
||||
$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))
|
||||
$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;
|
||||
}
|
||||
|
||||
if(isset($parameter_studiensemester)){
|
||||
$parameter_studiensemester = current($this->getDataOrTerminateWithError($this->StudiensemesterModel->loadWhere(["studiensemester_kurzbz" => $parameter_studiensemester])));
|
||||
}
|
||||
|
||||
if(isset($parameter_studiengang)){
|
||||
$parameter_studiengang = current($this->getDataOrTerminateWithError($this->StudiengangModel->loadWhere(["studiengang_kz" => $parameter_studiengang])));
|
||||
}
|
||||
|
||||
if(isset($parameter_studienplan)){
|
||||
$this->StudienplanModel->addJoin("lehre.tbl_studienordnung", "studienordnung_id");
|
||||
$this->StudienplanModel->addJoin("lehre.tbl_studienplan_semester", "studienplan_id");
|
||||
$parameter_studienplan = $this->StudienplanModel->loadWhere(["studienplan_id" => $parameter_studienplan, "aktiv" => TRUE]);
|
||||
$parameter_studienplan = current($this->getDataOrTerminateWithError($parameter_studienplan));
|
||||
}
|
||||
|
||||
// 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;
|
||||
}))){
|
||||
$aktuelles_studiensemester = $parameter_studiensemester;
|
||||
}
|
||||
|
||||
// fetch studiengaenge
|
||||
$studiengaenge = $this->computeStudiengaenge($aktuelles_studiensemester->studiensemester_kurzbz);
|
||||
$aktuelles_studiengang = current($studiengaenge);
|
||||
if(!$aktuelles_studiengang){
|
||||
$aktuelles_studiengang = null;
|
||||
}
|
||||
if(isset($parameter_studiengang) && !empty(array_filter( $studiengaenge,function($studiengang)use($parameter_studiengang){
|
||||
return $studiengang->studiengang_kz == $parameter_studiengang->studiengang_kz;
|
||||
}))){
|
||||
$aktuelles_studiengang = $parameter_studiengang;
|
||||
}
|
||||
|
||||
// compute semester and studienplaene
|
||||
if($aktuelles_studiengang){
|
||||
$studienplaene = $this->computeStudienplaene($aktuelles_studiengang->studiengang_kz, $aktuelles_studiensemester->studiensemester_kurzbz);
|
||||
}else{
|
||||
$studienplaene =[];
|
||||
}
|
||||
|
||||
$semester = array_values(array_unique(array_map(function($item){
|
||||
return $item->semester;
|
||||
}, $studienplaene)));
|
||||
$aktuelles_semester = current($semester);
|
||||
if(!$aktuelles_semester){
|
||||
$aktuelles_semester = null;
|
||||
}
|
||||
if(isset($parameter_semester) && in_array($parameter_semester, $semester)){
|
||||
$aktuelles_semester = $parameter_semester;
|
||||
}
|
||||
|
||||
$semester_studienplan = array_filter($studienplaene, function($item) use($aktuelles_semester){
|
||||
return $item->semester == $aktuelles_semester;
|
||||
});
|
||||
|
||||
// fetch current studienplan based on semester
|
||||
$aktuelles_studienplan = current($semester_studienplan);
|
||||
if(!$aktuelles_studienplan){
|
||||
$aktuelles_studienplan = null;
|
||||
}
|
||||
if(isset($parameter_studienplan) && !empty(array_filter( $semester_studienplan, function($studienplan) use($parameter_studienplan){
|
||||
return $studienplan->studienplan_id == $parameter_studienplan->studienplan_id;
|
||||
}))){
|
||||
$aktuelles_studienplan = $parameter_studienplan ;
|
||||
}
|
||||
|
||||
// fetch studienplan lehrveranstaltungen
|
||||
if($aktuelles_studienplan){
|
||||
$lehrveranstaltungen = $this->computeStudienplanLehrveranstaltungen($aktuelles_studienplan->studienplan_id, $aktuelles_semester);
|
||||
foreach($lehrveranstaltungen as $lehrv){
|
||||
foreach($lehrv->lehrveranstaltungen as $lv){
|
||||
$lvLektoren =$this->computeLektorenFromLehrveranstaltung($lv->lehrveranstaltung_id,$aktuelles_semester, $aktuelles_studiengang->studiengang_kz, $aktuelles_studiensemester->studiensemester_kurzbz);
|
||||
$lv->lektoren = $lvLektoren;
|
||||
}
|
||||
|
||||
}
|
||||
$aktuelles_lehrveranstaltungen = $lehrveranstaltungen;
|
||||
}else{
|
||||
$aktuelles_lehrveranstaltungen = [];
|
||||
}
|
||||
|
||||
// result object
|
||||
$result = new stdClass();
|
||||
$result->studienSemester = [];
|
||||
$result->studienSemester["all"]= $allStudienSemester;
|
||||
$result->studienSemester["preselected"]=$aktuelles_studiensemester;
|
||||
$result->studiengang["all"]=$studiengaenge;
|
||||
$result->studiengang["preselected"]=$aktuelles_studiengang;
|
||||
$result->semester["all"] =$semester;
|
||||
$result->semester["preselected"] =$aktuelles_semester;
|
||||
$result->studienplan["all"]=$semester_studienplan;
|
||||
$result->studienplan["preselected"]=$aktuelles_studienplan;
|
||||
$result->lehrveranstaltungen=$aktuelles_lehrveranstaltungen;
|
||||
|
||||
|
||||
$this->terminateWithSuccess($result);
|
||||
}
|
||||
|
||||
public function getLvEvaluierungInfo($studiensemester_kurzbz, $lehrveranstaltung_id){
|
||||
$result = [];
|
||||
Events::trigger('lvEvaluierungsInfo', function & () use (&$result) {
|
||||
return $result;
|
||||
},$lehrveranstaltung_id, $studiensemester_kurzbz);
|
||||
$this->terminateWithSuccess($result);
|
||||
}
|
||||
|
||||
public function getStudiengaengeForStudienSemester($studiensemester){
|
||||
$studiengaenge = $this->computeStudiengaenge($studiensemester);
|
||||
$this->terminateWithSuccess($studiengaenge);
|
||||
}
|
||||
|
||||
public function getStudienplaeneBySemester(){
|
||||
$this->load->library('form_validation');
|
||||
$this->form_validation->set_data($this->input->get());
|
||||
$this->form_validation->set_rules('studiengang', 'studiengang', 'required');
|
||||
$this->form_validation->set_rules('studiensemester', 'studiensemester', 'required');
|
||||
if($this->form_validation->run() == FALSE) $this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
$studiengang = $this->input->get('studiengang',true);
|
||||
$studiensemester = $this->input->get('studiensemester',true);
|
||||
$studienplaene = $this->computeStudienplaene($studiengang, $studiensemester);
|
||||
$this->terminateWithSuccess($studienplaene);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Private methods
|
||||
|
||||
private function computeStudienplaene($studiengang, $studiensemester){
|
||||
$studienplaene = $this->StudienplanModel->getStudienplaeneBySemester($studiengang, $studiensemester);
|
||||
$studienplaene = $this->getDataOrTerminateWithError($studienplaene);
|
||||
$studienplaene = array_map(function($studienplan){
|
||||
$orgform = current($this->getDataOrTerminateWithError($this->OrgformModel->loadWhere(["orgform_kurzbz" => $studienplan->orgform_kurzbz])));
|
||||
$studienplan->orgform_bezeichnung = $orgform->bezeichnung;
|
||||
return $studienplan;
|
||||
},$studienplaene);
|
||||
return $studienplaene;
|
||||
}
|
||||
|
||||
private function computeStudienplanLehrveranstaltungen($studienplan_id, $semester){
|
||||
|
||||
/*
|
||||
SELECT tbl_lehrveranstaltung.*,
|
||||
tbl_studienplan_lehrveranstaltung.studienplan_lehrveranstaltung_id,
|
||||
tbl_studienplan_lehrveranstaltung.semester as stpllv_semester,
|
||||
tbl_studienplan_lehrveranstaltung.pflicht as stpllv_pflicht,
|
||||
tbl_studienplan_lehrveranstaltung.koordinator as stpllv_koordinator,
|
||||
tbl_studienplan_lehrveranstaltung.studienplan_lehrveranstaltung_id_parent,
|
||||
tbl_studienplan_lehrveranstaltung.sort stpllv_sort,
|
||||
tbl_studienplan_lehrveranstaltung.curriculum,
|
||||
tbl_studienplan_lehrveranstaltung.export,
|
||||
tbl_studienplan_lehrveranstaltung.genehmigung
|
||||
FROM lehre.tbl_lehrveranstaltung
|
||||
JOIN lehre.tbl_studienplan_lehrveranstaltung
|
||||
USING(lehrveranstaltung_id)
|
||||
WHERE tbl_studienplan_lehrveranstaltung.studienplan_id=" . $this->db_add_param($studienplan_id, FHC_INTEGER);
|
||||
if (defined("CIS_PROFIL_STUDIENPLAN_MODULE_AUSBLENDEN") && CIS_PROFIL_STUDIENPLAN_MODULE_AUSBLENDEN)
|
||||
$qry .= " AND tbl_lehrveranstaltung.lehrtyp_kurzbz != 'modul'";
|
||||
if (!is_null($semester))
|
||||
{
|
||||
$qry.=" AND tbl_studienplan_lehrveranstaltung.semester=" . $this->db_add_param($semester, FHC_INTEGER);
|
||||
} */
|
||||
$this->load->model('education/Lehrveranstaltung_model', 'LehrveranstaltungModel');
|
||||
|
||||
$query = "
|
||||
SELECT tbl_lehrveranstaltung.*,
|
||||
tbl_studienplan_lehrveranstaltung.studienplan_lehrveranstaltung_id,
|
||||
tbl_studienplan_lehrveranstaltung.semester as stpllv_semester,
|
||||
tbl_studienplan_lehrveranstaltung.pflicht as stpllv_pflicht,
|
||||
tbl_studienplan_lehrveranstaltung.koordinator as stpllv_koordinator,
|
||||
tbl_studienplan_lehrveranstaltung.studienplan_lehrveranstaltung_id_parent,
|
||||
tbl_studienplan_lehrveranstaltung.sort stpllv_sort,
|
||||
tbl_studienplan_lehrveranstaltung.curriculum,
|
||||
tbl_studienplan_lehrveranstaltung.export,
|
||||
tbl_studienplan_lehrveranstaltung.genehmigung
|
||||
FROM lehre.tbl_lehrveranstaltung
|
||||
JOIN lehre.tbl_studienplan_lehrveranstaltung
|
||||
USING(lehrveranstaltung_id)
|
||||
WHERE
|
||||
tbl_lehrveranstaltung.lehre = true AND
|
||||
tbl_studienplan_lehrveranstaltung.studienplan_id=? AND tbl_studienplan_lehrveranstaltung.semester=?";
|
||||
|
||||
if (defined("CIS_PROFIL_STUDIENPLAN_MODULE_AUSBLENDEN") && CIS_PROFIL_STUDIENPLAN_MODULE_AUSBLENDEN)
|
||||
$query .= " AND tbl_lehrveranstaltung.lehrtyp_kurzbz != 'modul'";
|
||||
|
||||
$lehrveranstaltungen = $this->LehrveranstaltungModel->execReadOnlyQuery($query,[$studienplan_id, $semester]);
|
||||
|
||||
$lehrveranstaltungen = $this->getDataOrTerminateWithError($lehrveranstaltungen);
|
||||
usort($lehrveranstaltungen, function($a, $b){
|
||||
if($a->lehrtyp_kurzbz == "modul"){
|
||||
return -1;
|
||||
}
|
||||
else if($b->lehrtyp_kurzbz == "modul"){
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
});
|
||||
$lehrveranstaltungen= array_reduce($lehrveranstaltungen,function($carry, $lehrv){
|
||||
if($lehrv->lehrtyp_kurzbz == "modul"){
|
||||
$lehrv->lehrveranstaltungen = [];
|
||||
array_push($carry, $lehrv);
|
||||
}
|
||||
else{
|
||||
$parent =array_filter($carry, function($item)use($lehrv){
|
||||
return $item->studienplan_lehrveranstaltung_id == $lehrv->studienplan_lehrveranstaltung_id_parent;
|
||||
});
|
||||
$parent = current($parent);
|
||||
if($parent){
|
||||
$parent->lehrveranstaltungen[] = $lehrv;
|
||||
}
|
||||
}
|
||||
return $carry;
|
||||
}, []);
|
||||
return $lehrveranstaltungen;
|
||||
}
|
||||
|
||||
private function computeStudiengaenge($studiensemester){
|
||||
$studiengang_studiensemester_result = $this->StudiengangModel->getStudiengaengeByStudiensemester($studiensemester);
|
||||
$studiengang_studiensemester_result = $this->getDataOrTerminateWithError($studiengang_studiensemester_result);
|
||||
return $studiengang_studiensemester_result;
|
||||
}
|
||||
|
||||
private function getStudienPlanFromPrestudentStatus($person_id){
|
||||
$studienplan_id = current($this->getDataOrTerminateWithError($this->PrestudentstatusModel->getLastStatusPerson($person_id)))->studienplan_id;
|
||||
$studienplan =current($this->getDataOrTerminateWithError($this->StudienplanModel->loadWhere(["studienplan_id"=>$studienplan_id])));
|
||||
return $studienplan;
|
||||
}
|
||||
|
||||
private function computeLektorenFromLehrveranstaltung($lehreinheit_id, $semester, $studiengang, $studiensemester){
|
||||
$this->load->library('StundenplanLib');
|
||||
$lektoren = $this->stundenplanlib->getLektorenFromLehrveranstaltung($lehreinheit_id,$semester, $studiengang,$studiensemester);
|
||||
$lektoren = $this->getDataOrTerminateWithError($lektoren) ?? [];
|
||||
|
||||
$lektoren = array_map(function($lektor){
|
||||
return ["name"=>$this->getDataOrTerminateWithError($this->PersonModel->getFullName($lektor)), "email"=>$lektor."@".DOMAIN];
|
||||
},$lektoren);
|
||||
|
||||
return $lektoren;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
+1
-1
@@ -5,7 +5,7 @@ if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class Stundenplan extends Auth_Controller
|
||||
class LvPlan extends Auth_Controller
|
||||
{
|
||||
|
||||
/**
|
||||
@@ -65,7 +65,7 @@ class Config extends Auth_Controller
|
||||
|
||||
$preset_decoded = json_decode($preset->preset, true);
|
||||
|
||||
$this->DashboardLib->addWidgetsToWidgets($preset_decoded['widgets'], $dashboard_kurzbz, $funktion_kurzbz, $input->widgets);
|
||||
$this->DashboardLib->addWidgetsToWidgets($preset_decoded, $dashboard_kurzbz, $funktion_kurzbz, $input->widgets);
|
||||
|
||||
$preset->preset = json_encode($preset_decoded);
|
||||
|
||||
@@ -92,7 +92,7 @@ class Config extends Auth_Controller
|
||||
}
|
||||
|
||||
$preset_decoded = json_decode($preset->preset, true);
|
||||
if (!$this->DashboardLib->removeWidgetFromWidgets($preset_decoded['widgets'], $funktion_kurzbz, $widgetid))
|
||||
if (!$this->DashboardLib->removeWidgetFromWidgets($preset_decoded, $funktion_kurzbz, $widgetid))
|
||||
{
|
||||
http_response_code(404);
|
||||
$this->terminateWithJsonError('widgetid ' . $widgetid . ' not found');
|
||||
@@ -119,7 +119,7 @@ class Config extends Auth_Controller
|
||||
|
||||
$override_decoded = json_decode($override->override, true);
|
||||
|
||||
$this->DashboardLib->addWidgetsToWidgets($override_decoded['widgets'], $dashboard_kurzbz, $funktion_kurzbz, $input->widgets);
|
||||
$this->DashboardLib->addWidgetsToWidgets($override_decoded, $dashboard_kurzbz, $funktion_kurzbz, $input->widgets);
|
||||
|
||||
$override->override = json_encode($override_decoded);
|
||||
|
||||
@@ -148,7 +148,7 @@ class Config extends Auth_Controller
|
||||
|
||||
$override_decoded = json_decode($override->override, true);
|
||||
|
||||
if (!$this->DashboardLib->removeWidgetFromWidgets($override_decoded['widgets'], $funktion_kurzbz, $widgetid))
|
||||
if (!$this->DashboardLib->removeWidgetFromWidgets($override_decoded, $funktion_kurzbz, $widgetid))
|
||||
{
|
||||
http_response_code(404);
|
||||
$this->terminateWithJsonError('widgetid ' . $widgetid . ' not found');
|
||||
@@ -202,10 +202,10 @@ class Config extends Auth_Controller
|
||||
if ($conf)
|
||||
{
|
||||
$preset = json_decode($conf->preset, true);
|
||||
if (!isset($preset['widgets']) || !isset($preset['widgets'][$funktion]))
|
||||
if (!isset($preset[$funktion]) || !isset($preset[$funktion]['widgets']))
|
||||
$result[$funktion] = [];
|
||||
else
|
||||
$result[$funktion] = $preset['widgets'][$funktion];
|
||||
$result[$funktion] = $preset[$funktion]['widgets'];
|
||||
}
|
||||
else
|
||||
$result[$funktion] = [];
|
||||
|
||||
@@ -88,6 +88,7 @@ function generateCSSsInclude($CSSs)
|
||||
function generateJSDataStorageObject($indexPage, $calledPath, $calledMethod)
|
||||
{
|
||||
$ci =& get_instance();
|
||||
$ci->load->config('theme');
|
||||
$ci->load->model('system/Sprache_model','SpracheModel');
|
||||
$server_language = getData($ci->SpracheModel->loadWhere(['content' => true]));
|
||||
$server_language = array_map(function($language){
|
||||
@@ -107,6 +108,10 @@ function generateJSDataStorageObject($indexPage, $calledPath, $calledMethod)
|
||||
'user_language' => $user_language,
|
||||
'timezone' => date_default_timezone_get(),
|
||||
'systemerror_mailto' => $systemerror_mailto,
|
||||
'theme' => [
|
||||
'name'=>$ci->config->item('theme_name'),
|
||||
'modes'=>$ci->config->item('theme_modes'),
|
||||
]
|
||||
);
|
||||
|
||||
$toPrint = "\n";
|
||||
@@ -231,3 +236,13 @@ function generateBackwardCompatibleJSMsIe($js)
|
||||
echo "<![endif]-->\n";
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructs an accessibility skipLink https://www.w3schools.com/accessibility/accessibility_skip_links.php
|
||||
*/
|
||||
function generateSkipLink($skipID)
|
||||
{
|
||||
$toPrint = '<a id="skiplink" href="';
|
||||
$toPrint.=$skipID;
|
||||
$toPrint.='" class="fhcSkipLink" aria-label="Skip to main content"></a>';
|
||||
echo $toPrint;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,588 @@
|
||||
<?php
|
||||
|
||||
if (! defined("BASEPATH")) exit("No direct script access allowed");
|
||||
|
||||
class ProfilLib{
|
||||
public function __construct()
|
||||
{
|
||||
$this->ci =& get_instance();
|
||||
|
||||
|
||||
}
|
||||
|
||||
public function getView($uid)
|
||||
{
|
||||
// loading required models
|
||||
$this->ci->load->model("ressource/Mitarbeiter_model","MitarbeiterModel");
|
||||
$this->ci->load->model("person/Person_model","PersonModel");
|
||||
|
||||
$res = new stdClass();
|
||||
|
||||
// checking the uid
|
||||
if ($uid == getAuthUID()) {
|
||||
$isMitarbeiter = $this->ci->MitarbeiterModel->isMitarbeiter(getAuthUID());
|
||||
if(isError($isMitarbeiter))
|
||||
{
|
||||
return error(getData($isMitarbeiter));
|
||||
}
|
||||
$isMitarbeiter = getData($isMitarbeiter);
|
||||
if ($isMitarbeiter) {
|
||||
$res->view = "MitarbeiterProfil";
|
||||
$res->data = $this->mitarbeiterProfil();
|
||||
$res->data->pid = getAuthPersonId();
|
||||
} else {
|
||||
$res->view = "StudentProfil";
|
||||
$res->data = $this->studentProfil();
|
||||
$res->data->pid = getAuthPersonId();
|
||||
}
|
||||
$res->data->fotoStatus=$this->isFotoAkzeptiert(getAuthPersonId());
|
||||
}
|
||||
// UID is availabe when accessing Profil/View/:uid
|
||||
else {
|
||||
$isMitarbeiter = $this->ci->MitarbeiterModel->isMitarbeiter($uid);
|
||||
if(isError($isMitarbeiter))
|
||||
{
|
||||
return error(getData($isMitarbeiter));
|
||||
}
|
||||
$isMitarbeiter = getData($isMitarbeiter);
|
||||
if ($isMitarbeiter) {
|
||||
$res->view = "ViewMitarbeiterProfil";
|
||||
$res->data = $this->viewMitarbeiterProfil($uid);
|
||||
|
||||
} else {
|
||||
$res->view = "ViewStudentProfil";
|
||||
$res->data = $this->viewStudentProfil($uid);
|
||||
}
|
||||
}
|
||||
|
||||
return success($res);
|
||||
}
|
||||
|
||||
//PRIVATE METHODS ###############################################
|
||||
|
||||
/**
|
||||
* function that returns the data used for the student profile
|
||||
* @access private
|
||||
* @return stdClass student data
|
||||
*/
|
||||
private function studentProfil()
|
||||
{
|
||||
$pid = getAuthPersonId();
|
||||
$uid = getAuthUID();
|
||||
$betriebsmittelperson_res = $this->getBetriebsmittelInfo($pid);
|
||||
$kontakte_res = $this->getKontaktInfo($pid);
|
||||
$zutrittskarte_ausgegebenam = $this->getZutrittskarteDatum($uid);
|
||||
$adresse_res = $this->getAdressenInfo($pid);
|
||||
$mailverteiler_res = $this->getMailverteiler($uid);
|
||||
$person_res = $this->getPersonInfo($uid, true);
|
||||
$zutrittsgruppe_res = $this->getZutrittsgruppen($uid);
|
||||
$student_res = $this->getStudentInfo($uid);
|
||||
$matr_res = $this->getMatrikelNummer($uid);
|
||||
$profilUpdates = $this->getProfilUpdates($uid);
|
||||
|
||||
$res = new stdClass();
|
||||
$res->username = $uid;
|
||||
|
||||
//? Person Information
|
||||
foreach ($person_res as $key => $value) {
|
||||
$res->$key = $value;
|
||||
}
|
||||
|
||||
//? Student Information
|
||||
foreach ($student_res as $key => $value) {
|
||||
$res->$key = trim($value);
|
||||
}
|
||||
|
||||
$intern_email = array();
|
||||
$intern_email["type"] = "intern";
|
||||
$intern_email["email"] = DOMAIN? $uid . "@" . DOMAIN :"";
|
||||
|
||||
$res->emails = [$intern_email];
|
||||
$res->adressen = $adresse_res;
|
||||
$res->zutrittsdatum = $zutrittskarte_ausgegebenam;
|
||||
$res->kontakte = $kontakte_res;
|
||||
$res->mittel = $betriebsmittelperson_res;
|
||||
$res->matrikelnummer = $matr_res->matr_nr;
|
||||
$res->zuttritsgruppen = $zutrittsgruppe_res;
|
||||
$res->mailverteiler = $mailverteiler_res;
|
||||
$res->profilUpdates = $profilUpdates;
|
||||
|
||||
return $res;
|
||||
}
|
||||
|
||||
/**
|
||||
* function that returns the data used for the mitarbeiter profile
|
||||
* @access private
|
||||
* @return stdClass mitarbeiter data
|
||||
*/
|
||||
private function mitarbeiterProfil()
|
||||
{
|
||||
$pid = getAuthPersonId();
|
||||
$uid = getAuthUID();
|
||||
$zutrittskarte_ausgegebenam = $this->getZutrittskarteDatum($uid);
|
||||
$adresse_res = $this->getAdressenInfo($pid);
|
||||
$kontakte_res = $this->getKontaktInfo($pid);
|
||||
$mailverteiler_res = $this->getMailverteiler($uid);
|
||||
$person_res = $this->getPersonInfo($uid, true);
|
||||
$benutzer_funktion_res = $this->getBenutzerFunktion($uid);
|
||||
$betriebsmittelperson_res = $this->getBetriebsmittelInfo($pid);
|
||||
$profilUpdates = $this->getProfilUpdates($uid);
|
||||
$telefon_res = $this->getTelefonInfo($uid);
|
||||
$mitarbeiter_res = $this->getMitarbeiterInfo($uid);
|
||||
|
||||
$res = new stdClass();
|
||||
$res->username = $uid;
|
||||
|
||||
//? Person Information
|
||||
foreach ($person_res as $key => $value) {
|
||||
$res->$key = $value;
|
||||
}
|
||||
|
||||
//? Mitarbeiter Information
|
||||
foreach ($mitarbeiter_res as $key => $value) {
|
||||
$res->$key = $value;
|
||||
}
|
||||
|
||||
$res->adressen = $adresse_res;
|
||||
$res->zutrittsdatum = $zutrittskarte_ausgegebenam;
|
||||
$res->kontakte = $kontakte_res;
|
||||
$res->mittel = $betriebsmittelperson_res;
|
||||
$res->mailverteiler = $mailverteiler_res;
|
||||
|
||||
$intern_email = array();
|
||||
$intern_email["type"] = "intern";
|
||||
$intern_email["email"] = DOMAIN? $uid . "@" . DOMAIN : "";
|
||||
$extern_email = array();
|
||||
$extern_email["type"] = "alias";
|
||||
|
||||
$extern_email["email"] = $mitarbeiter_res->alias? ($mitarbeiter_res->alias . "@" . DOMAIN) : null;
|
||||
$res->emails = $extern_email["email"]?[$intern_email, $extern_email]:[$intern_email];
|
||||
|
||||
$res->funktionen = $benutzer_funktion_res;
|
||||
$res->standort_telefon = $telefon_res;
|
||||
$res->profilUpdates = $profilUpdates;
|
||||
|
||||
return $res;
|
||||
}
|
||||
|
||||
/**
|
||||
* gets the date of issue of the FH access card corresponding to a user
|
||||
* @access private
|
||||
* @param integer $uid the userID used to get the date of issue of the FH access card
|
||||
* @return string the date of issue of the FH access card corresponding to a userID
|
||||
*/
|
||||
private function getZutrittskarteDatum($uid)
|
||||
{
|
||||
$this->ci->load->model("ressource/Betriebsmittelperson_model","BetriebsmittelpersonModel");
|
||||
$zutrittskarte_ausgegebenam = $this->ci->BetriebsmittelpersonModel->getBetriebsmittelByUid($uid, "Zutrittskarte");
|
||||
|
||||
if(isError($zutrittskarte_ausgegebenam)){
|
||||
return error(getData($zutrittskarte_ausgegebenam));
|
||||
}
|
||||
$zutrittskarte_ausgegebenam = getData($zutrittskarte_ausgegebenam);
|
||||
$zutrittskarte_ausgegebenam = $zutrittskarte_ausgegebenam ? current($zutrittskarte_ausgegebenam)->ausgegebenam : null;
|
||||
|
||||
//? formats date from 01-01-2000 to 01.01.2000
|
||||
$zutrittskarte_ausgegebenam = str_replace("-", ".", $zutrittskarte_ausgegebenam);
|
||||
return $zutrittskarte_ausgegebenam;
|
||||
}
|
||||
|
||||
/**
|
||||
* gets the address information corresponding to a user
|
||||
* @access private
|
||||
* @param integer $uid the userID used to get the address information
|
||||
* @return array all the address information corresponding to a userID
|
||||
*/
|
||||
private function getAdressenInfo($pid)
|
||||
{
|
||||
$this->ci->load->model("person/Adresse_model","AdresseModel");
|
||||
$adresse_res = $this->ci->AdresseModel->addSelect(["adresse_id", "strasse", "tbl_adressentyp.bezeichnung as typ", "plz", "ort", "zustelladresse", "gemeinde", "nation"]);
|
||||
$adresse_res = $this->ci->AdresseModel->addOrder("zustelladresse", "DESC");
|
||||
$adresse_res = $this->ci->AdresseModel->addJoin("tbl_adressentyp", "typ=adressentyp_kurzbz");
|
||||
|
||||
$adresse_res = $this->ci->AdresseModel->loadWhere(["person_id" => $pid]);
|
||||
if(isError($adresse_res)){
|
||||
return error(getData($adresse_res));
|
||||
}
|
||||
$adresse_res = getData($adresse_res) ?? [];
|
||||
return $adresse_res;
|
||||
}
|
||||
|
||||
/**
|
||||
* gets the kontakt information corresponding to a user
|
||||
* @access private
|
||||
* @param integer $uid the userID used to get the kontakt information
|
||||
* @return array all the kontakt information corresponding to a userID
|
||||
*/
|
||||
private function getKontaktInfo($pid)
|
||||
{
|
||||
$this->ci->load->model("person/Kontakt_model","KontaktModel");
|
||||
$this->ci->KontaktModel->addSelect(['kontakttyp', 'kontakt_id', 'kontakt', 'tbl_kontakt.anmerkung', 'tbl_kontakt.zustellung']);
|
||||
$this->ci->KontaktModel->addJoin('public.tbl_standort', 'standort_id', 'LEFT');
|
||||
$this->ci->KontaktModel->addJoin('public.tbl_firma', 'firma_id', 'LEFT');
|
||||
$this->ci->KontaktModel->addOrder('kontakttyp, kontakt, tbl_kontakt.updateamum, tbl_kontakt.insertamum');
|
||||
|
||||
$kontakte_res = $this->ci->KontaktModel->loadWhere(['person_id' => $pid]);
|
||||
if(isError($kontakte_res)){
|
||||
return error(getData($kontakte_res));
|
||||
}
|
||||
$kontakte_res = getData($kontakte_res);
|
||||
return $kontakte_res;
|
||||
}
|
||||
|
||||
/**
|
||||
* gets all the mailverteiler using the tables: tbl_benutzer, tbl_benutzergruppe, tbl_gruppe
|
||||
* @access private
|
||||
* @param integer $uid the userID used to retrieve the mailverteiler
|
||||
* @return array returns the mailvertailer corresponding to a userID
|
||||
*/
|
||||
private function getMailverteiler($uid)
|
||||
{
|
||||
$this->ci->load->model("person/Person_model","PersonModel");
|
||||
$this->ci->PersonModel->addSelect('gruppe_kurzbz, beschreibung');
|
||||
$this->ci->PersonModel->addJoin('tbl_benutzer', 'person_id');
|
||||
$this->ci->PersonModel->addJoin('tbl_benutzergruppe', 'uid');
|
||||
$this->ci->PersonModel->addJoin('tbl_gruppe', 'gruppe_kurzbz');
|
||||
|
||||
$mailverteiler_res = $this->ci->PersonModel->loadWhere(array('mailgrp' => true, 'uid' => $uid));
|
||||
if(isError($mailverteiler_res)){
|
||||
return error(getData($mailverteiler_res));
|
||||
}
|
||||
$mailverteiler_res = getData($mailverteiler_res) ?? [];
|
||||
$mailverteiler_res = gettype($mailverteiler_res) === 'array' ? $mailverteiler_res : [];
|
||||
$mailverteiler_res = array_map(function ($element) {
|
||||
$element->mailto = "mailto:" . $element->gruppe_kurzbz . "@" . DOMAIN;
|
||||
return $element;
|
||||
}, $mailverteiler_res);
|
||||
return $mailverteiler_res;
|
||||
}
|
||||
|
||||
/**
|
||||
* gets the person information corresponding to a user
|
||||
* @access private
|
||||
* @param integer $uid the userID used to get the person information
|
||||
* @param integer $geburtsInfo flag wether to add the columns gebort, gebdatum, foto_sperre or not
|
||||
* @return array all the person informaion corresponding to a userID
|
||||
*/
|
||||
private function getPersonInfo($uid, $geburtsInfo = null)
|
||||
{
|
||||
$this->ci->load->model("person/Benutzer_model","BenutzerModel");
|
||||
$selectClause = ["foto", "foto_sperre", "anrede", "titelpost as postnomen", "titelpre as titel", "vorname", "nachname"];
|
||||
/** @param integer $geburtsInfo */
|
||||
if ($geburtsInfo) {
|
||||
array_push($selectClause, "gebort");
|
||||
array_push($selectClause, "TO_CHAR(gebdatum, 'DD.MM.YYYY') as gebdatum");
|
||||
}
|
||||
$this->ci->BenutzerModel->addSelect($selectClause);
|
||||
$this->ci->BenutzerModel->addJoin("tbl_person", "person_id");
|
||||
|
||||
$person_res = $this->ci->BenutzerModel->load([$uid]);
|
||||
if(isError($person_res)){
|
||||
return error(getData($person_res));
|
||||
}
|
||||
$person_res = getData($person_res);
|
||||
$person_res = $person_res ? current($person_res) : null;
|
||||
|
||||
if(isset($person_res)){
|
||||
if( ($person_res->foto === null) || ((getAuthUID() !== $uid) && ($person_res->foto_sperre !== false)) )
|
||||
{
|
||||
$dummy_foto = base64_encode(file_get_contents(DOC_ROOT.'skin/images/profilbild_dummy.jpg'));
|
||||
$person_res->foto = $dummy_foto;
|
||||
}
|
||||
}
|
||||
|
||||
return $person_res;
|
||||
}
|
||||
|
||||
/**
|
||||
* gets all the Benutzerfunktionen of a corresponding user
|
||||
* @access private
|
||||
* @param integer $uid the userID used to retrieve the Benutzerfunktionen
|
||||
* @return array returns the Benutzerfunktionen corresponding to a userID
|
||||
*/
|
||||
private function getBenutzerFunktion($uid)
|
||||
{
|
||||
$this->ci->load->model("person/Benutzerfunktion_model","BenutzerfunktionModel");
|
||||
$this->ci->BenutzerfunktionModel->addSelect(["tbl_benutzerfunktion.bezeichnung as Bezeichnung", "tbl_organisationseinheit.bezeichnung as Organisationseinheit", "datum_von as Gültig_von", "datum_bis as Gültig_bis", "wochenstunden as Wochenstunden"]);
|
||||
$this->ci->BenutzerfunktionModel->addJoin("tbl_organisationseinheit", "oe_kurzbz");
|
||||
|
||||
$benutzer_funktion_res = $this->ci->BenutzerfunktionModel->loadWhere(array('uid' => $uid));
|
||||
if(isError($benutzer_funktion_res)){
|
||||
return error(getData($benutzer_funktion_res));
|
||||
}
|
||||
$benutzer_funktion_res = getData($benutzer_funktion_res);
|
||||
return $benutzer_funktion_res;
|
||||
}
|
||||
|
||||
/**
|
||||
* gets all the Betriebsmittel of a corresponding user
|
||||
* @access private
|
||||
* @param integer $uid the userID used to retrieve the Betriebsmittel
|
||||
* @return array returns the Betriebsmittel corresponding to a userID
|
||||
*/
|
||||
private function getBetriebsmittelInfo($pid)
|
||||
{
|
||||
$this->ci->load->model("ressource/Betriebsmittelperson_model","BetriebsmittelpersonModel");
|
||||
$this->ci->BetriebsmittelpersonModel->addSelect(["CONCAT(betriebsmitteltyp, ' ' ,beschreibung) as Betriebsmittel", "nummer as Nummer", "ausgegebenam as Ausgegeben_am"]);
|
||||
|
||||
//? betriebsmittel are not needed in a view
|
||||
$betriebsmittelperson_res = $this->ci->BetriebsmittelpersonModel->getBetriebsmittel($pid);
|
||||
if(isError($betriebsmittelperson_res)){
|
||||
return error(getData($betriebsmittelperson_res));
|
||||
}
|
||||
$betriebsmittelperson_res = getData($betriebsmittelperson_res);
|
||||
return $betriebsmittelperson_res;
|
||||
}
|
||||
|
||||
/**
|
||||
* gets the profil updates corresponding to a user
|
||||
* @access private
|
||||
* @param integer $uid the userID used to get the profil updates
|
||||
* @return array all the profil updates corresponding to a userID
|
||||
*/
|
||||
private function getProfilUpdates($uid)
|
||||
{
|
||||
$this->ci->load->model("person/Profil_update_model","ProfilUpdateModel");
|
||||
$profilUpdates = $this->ci->ProfilUpdateModel->getProfilUpdatesWhere(['uid' => $uid]);
|
||||
if(isError($profilUpdates)){
|
||||
return error(getData($profilUpdates));
|
||||
}
|
||||
$profilUpdates = getData($profilUpdates);
|
||||
return $profilUpdates;
|
||||
}
|
||||
|
||||
/**
|
||||
* gets the telefon information corresponding to a user
|
||||
* @access private
|
||||
* @param integer $uid the userID used to get the telefon information
|
||||
* @return array all the telefon informaion corresponding to a userID
|
||||
*/
|
||||
private function getTelefonInfo($uid)
|
||||
{
|
||||
$this->ci->load->model("ressource/Mitarbeiter_model","MitarbeiterModel");
|
||||
$this->ci->MitarbeiterModel->addSelect(["kontakt"]);
|
||||
$this->ci->MitarbeiterModel->addJoin("tbl_kontakt", "tbl_mitarbeiter.standort_id = tbl_kontakt.standort_id");
|
||||
$this->ci->MitarbeiterModel->addLimit(1);
|
||||
$telefon_res = $this->ci->MitarbeiterModel->loadWhere(["mitarbeiter_uid" => $uid, "kontakttyp" => "telefon"]);
|
||||
if(isError($telefon_res)){
|
||||
return error(getData($telefon_res));
|
||||
}
|
||||
$telefon_res = getData($telefon_res);
|
||||
$telefon_res = $telefon_res ? current($telefon_res) : null;
|
||||
return $telefon_res;
|
||||
}
|
||||
|
||||
/**
|
||||
* gets the mitarbeiter information corresponding to a user
|
||||
* @access private
|
||||
* @param integer $uid the userID used to get the mitarbeiter information
|
||||
* @return array all the mitarbeiter informaion corresponding to a userID
|
||||
*/
|
||||
private function getMitarbeiterInfo($uid)
|
||||
{
|
||||
$this->ci->load->model("ressource/Mitarbeiter_model","MitarbeiterModel");
|
||||
$this->ci->MitarbeiterModel->addSelect(["kurzbz", "telefonklappe", "alias", "ort_kurzbz"]);
|
||||
$this->ci->MitarbeiterModel->addJoin("tbl_benutzer", "tbl_benutzer.uid = tbl_mitarbeiter.mitarbeiter_uid");
|
||||
$mitarbeiter_res = $this->ci->MitarbeiterModel->load($uid);
|
||||
if(isError($mitarbeiter_res)){
|
||||
return error(getData($mitarbeiter_res));
|
||||
}
|
||||
$mitarbeiter_res = getData($mitarbeiter_res);
|
||||
$mitarbeiter_res = $mitarbeiter_res ? current($mitarbeiter_res) : null;
|
||||
|
||||
return $mitarbeiter_res;
|
||||
}
|
||||
|
||||
/**
|
||||
* gets the Zutrittsgruppen corresponding to a user
|
||||
* @access private
|
||||
* @param integer $uid the userID used to get the Zutrittsgruppen
|
||||
* @return array all the Zutrittsgruppen corresponding to a userID
|
||||
*/
|
||||
private function getZutrittsgruppen($uid)
|
||||
{
|
||||
$this->ci->load->model("person/Benutzergruppe_model","BenutzergruppeModel");
|
||||
$this->ci->BenutzergruppeModel->addSelect(['bezeichnung']);
|
||||
$this->ci->BenutzergruppeModel->addJoin('tbl_gruppe', 'gruppe_kurzbz');
|
||||
|
||||
$zutrittsgruppe_res = $this->ci->BenutzergruppeModel->loadWhere(array("uid" => $uid, "zutrittssystem" => true));
|
||||
if(isError($zutrittsgruppe_res)){
|
||||
return error(getData($zutrittsgruppe_res));
|
||||
}
|
||||
$zutrittsgruppe_res = getData($zutrittsgruppe_res);
|
||||
return $zutrittsgruppe_res;
|
||||
}
|
||||
|
||||
/**
|
||||
* gets the student information corresponding to a user
|
||||
* @access private
|
||||
* @param integer $uid the userID used to get the student information
|
||||
* @return array all the student informaion corresponding to a userID
|
||||
*/
|
||||
private function getStudentInfo($uid)
|
||||
{
|
||||
$this->ci->load->model("crm/Student_model","StudentModel");
|
||||
$this->ci->StudentModel->addSelect(['tbl_studiengang.bezeichnung as studiengang', 'tbl_studiengang.studiengang_kz as studiengang_kz', 'tbl_student.semester', 'tbl_student.verband', 'tbl_student.gruppe', 'tbl_student.matrikelnr as personenkennzeichen']);
|
||||
$this->ci->StudentModel->addJoin('tbl_studiengang', "tbl_studiengang.studiengang_kz=tbl_student.studiengang_kz");
|
||||
|
||||
$student_res = $this->ci->StudentModel->load([$uid]);
|
||||
|
||||
if(isError($student_res)){
|
||||
return error(getData($student_res));
|
||||
}
|
||||
$student_res = getData($student_res);
|
||||
$student_res = $student_res ? current($student_res) : null;
|
||||
return $student_res;
|
||||
}
|
||||
|
||||
/**
|
||||
* gets the Matrikelnummer corresponding to a user
|
||||
* @access private
|
||||
* @param integer $uid the userID used to get the Matrikelnummer
|
||||
* @return object the Matrikelnummer corresponding to a userID
|
||||
*/
|
||||
private function getMatrikelNummer($uid)
|
||||
{
|
||||
$this->ci->load->model("person/Benutzer_model","BenutzerModel");
|
||||
$this->ci->BenutzerModel->addSelect(["matr_nr"]);
|
||||
$this->ci->BenutzerModel->addJoin("tbl_person", "person_id");
|
||||
|
||||
$matr_res = $this->ci->BenutzerModel->load([$uid]);
|
||||
|
||||
if(isError($matr_res)){
|
||||
return error(getData($matr_res));
|
||||
}
|
||||
$matr_res = getData($matr_res);
|
||||
$matr_res = $matr_res ? current($matr_res) : [];
|
||||
return $matr_res;
|
||||
}
|
||||
|
||||
/**
|
||||
* checks whether the foto of a user is accepted or not
|
||||
* @access private
|
||||
* @param integer $pid the personId of the student or mitarbeiter
|
||||
* @return bool whether the foto is accepted or not
|
||||
*/
|
||||
private function isFotoAkzeptiert($pid)
|
||||
{
|
||||
$this->ci->load->model('person/Fotostatusperson_model','FotostatusModel');
|
||||
$fotostatus = $this->ci->FotostatusModel->execReadOnlyQuery("
|
||||
select distinct on (person_id) person_id, insertamum, fotostatus_kurzbz
|
||||
from public.tbl_person_fotostatus
|
||||
where person_id = ?
|
||||
order by person_id, insertamum desc",[$pid]);
|
||||
if(isError($fotostatus)){
|
||||
return error(getData($fotostatus));
|
||||
}
|
||||
$fotostatus = getData($fotostatus);
|
||||
if(is_array($fotostatus) && count($fotostatus) > 0){
|
||||
$fotostatus = current($fotostatus)->fotostatus_kurzbz == 'akzeptiert';
|
||||
}
|
||||
else
|
||||
$fotostatus = false;
|
||||
return $fotostatus;
|
||||
}
|
||||
|
||||
/**
|
||||
* function that returns the data used for viewing another mitarbeiter profile
|
||||
* @access private
|
||||
* @param integer $uid the userID to retrieve the mitarbeiter data
|
||||
* @return stdClass restricted mitarbeiter data
|
||||
*/
|
||||
private function viewMitarbeiterProfil($uid)
|
||||
{
|
||||
$mailverteiler_res = $this->getMailverteiler($uid);
|
||||
$benutzer_funktion_res = $this->getBenutzerFunktion($uid);
|
||||
$benutzer_res = $this->getBenutzerAlias($uid);
|
||||
$person_res = $this->getPersonInfo($uid);
|
||||
$mitarbeiter_res = $this->getMitarbeiterInfo($uid);
|
||||
$telefon_res = $this->getTelefonInfo($uid);
|
||||
|
||||
$res = new stdClass();
|
||||
$res->username = $uid;
|
||||
|
||||
//? Person Info
|
||||
foreach ($person_res as $key => $val) {
|
||||
$res->$key = $val;
|
||||
}
|
||||
|
||||
//? Mitarbeiter Info
|
||||
foreach ($mitarbeiter_res as $key => $val) {
|
||||
$res->$key = $val;
|
||||
|
||||
}
|
||||
|
||||
$intern_email = array();
|
||||
$intern_email["type"] = "intern";
|
||||
$intern_email["email"] = DOMAIN? $uid . "@" . DOMAIN:"";
|
||||
$extern_email = array();
|
||||
$extern_email["type"] = "alias";
|
||||
|
||||
$extern_email["email"] = $benutzer_res->alias ? ($benutzer_res->alias . "@" . DOMAIN) : null;
|
||||
$res->emails = $extern_email?[$intern_email, $extern_email]:[$intern_email];
|
||||
|
||||
$res->funktionen = $benutzer_funktion_res;
|
||||
$res->mailverteiler = $mailverteiler_res;
|
||||
$res->standort_telefon = isset($telefon_res) ? $telefon_res->kontakt : null;
|
||||
|
||||
return $res;
|
||||
}
|
||||
|
||||
/**
|
||||
* gets the alias of a corresponding user
|
||||
* @access private
|
||||
* @param integer $uid the userID used to get the alias
|
||||
* @return string the alias of the userID
|
||||
*/
|
||||
private function getBenutzerAlias($uid)
|
||||
{
|
||||
$this->ci->load->model("person/Benutzer_model","BenutzerModel");
|
||||
$this->ci->BenutzerModel->addSelect(["alias"]);
|
||||
$benutzer_res = $this->ci->BenutzerModel->load([$uid]);
|
||||
if(isError($benutzer_res)){
|
||||
return error(getData($benutzer_res));
|
||||
}
|
||||
|
||||
$benutzer_res = getData($benutzer_res);
|
||||
$benutzer_res = $benutzer_res ? current($benutzer_res) : null;
|
||||
|
||||
return $benutzer_res;
|
||||
}
|
||||
|
||||
/**
|
||||
* function that returns the data used for viewing another student profile
|
||||
* @access private
|
||||
* @param integer $uid the userID to retrieve the student data
|
||||
* @return stdClass restricted student data
|
||||
*/
|
||||
private function viewStudentProfil($uid)
|
||||
{
|
||||
$mailverteiler_res = $this->getMailverteiler($uid);
|
||||
$person_res = $this->getPersonInfo($uid);
|
||||
$student_res = $this->getStudentInfo($uid);
|
||||
$matr_res = $this->getMatrikelNummer($uid);
|
||||
|
||||
$res = new stdClass();
|
||||
$res->username = $uid;
|
||||
|
||||
//? Person Information
|
||||
foreach ($person_res as $key => $value) {
|
||||
$res->$key = $value;
|
||||
}
|
||||
|
||||
//? Student Information
|
||||
foreach ($student_res as $key => $value) {
|
||||
$res->$key = $value;
|
||||
}
|
||||
|
||||
$intern_email = array();
|
||||
$intern_email["type"] = "intern";
|
||||
$intern_email["email"] = DOMAIN? $uid . "@" . DOMAIN:"";
|
||||
|
||||
$res->emails = [$intern_email];
|
||||
$res->matrikelnummer = $matr_res->matr_nr;
|
||||
$res->mailverteiler = $mailverteiler_res;
|
||||
|
||||
return $res;
|
||||
}
|
||||
}
|
||||
+323
-211
@@ -1,245 +1,244 @@
|
||||
<?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 Stundenplan extends FHCAPI_Controller
|
||||
{
|
||||
use \DateTime as DateTime;
|
||||
use \DateTimeZone as DateTimeZone;
|
||||
use \DateInterval as DateInterval;
|
||||
use \DatePeriod as DatePeriod;
|
||||
|
||||
class StundenplanLib{
|
||||
|
||||
private $_ci; // Code igniter instance
|
||||
|
||||
|
||||
/**
|
||||
* Object initialization
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
|
||||
parent::__construct([
|
||||
'getRoomplan' => self::PERM_LOGGED,
|
||||
'Stunden' => self::PERM_LOGGED,
|
||||
'Reservierungen' => self::PERM_LOGGED,
|
||||
'getStundenplan' => self::PERM_LOGGED,
|
||||
'getLehreinheitStudiensemester' => self::PERM_LOGGED,
|
||||
'studiensemesterDateInterval' => self::PERM_LOGGED,
|
||||
]);
|
||||
|
||||
$this->load->library('LogLib');
|
||||
$this->loglib->setConfigs(array(
|
||||
'classIndex' => 5,
|
||||
'functionIndex' => 5,
|
||||
'lineIndex' => 4,
|
||||
'dbLogType' => 'API', // required
|
||||
'dbExecuteUser' => 'RESTful API'
|
||||
));
|
||||
|
||||
$this->load->library('form_validation');
|
||||
|
||||
//load models
|
||||
$this->load->model('ressource/Stundenplan_model', 'StundenplanModel');
|
||||
$this->load->model('ressource/Reservierung_model', 'ReservierungModel');
|
||||
|
||||
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
//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));
|
||||
$this->terminateWithSuccess($studiensemester);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* fetches Stunden layout from database
|
||||
* @access public
|
||||
*
|
||||
*/
|
||||
public function Stunden()
|
||||
{
|
||||
$this->load->model('ressource/Stunde_model', 'StundeModel');
|
||||
|
||||
$stunden = $this->StundeModel->load();
|
||||
|
||||
$stunden = $this->getDataOrTerminateWithError($stunden);
|
||||
|
||||
$this->terminateWithSuccess($stunden);
|
||||
}
|
||||
|
||||
/**
|
||||
* fetches room events from a certain date
|
||||
* @access public
|
||||
*
|
||||
*/
|
||||
public function getRoomplan()
|
||||
{
|
||||
// form validation
|
||||
$this->load->library('form_validation');
|
||||
$this->form_validation->set_data($_GET);
|
||||
$this->form_validation->set_rules('ort_kurzbz',"Ort","required");
|
||||
$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() === FALSE) $this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
// storing the get parameter in local variables
|
||||
$ort_kurzbz = $this->input->get('ort_kurzbz', TRUE);
|
||||
$start_date = $this->input->get('start_date', TRUE);
|
||||
$end_date = $this->input->get('end_date', TRUE);
|
||||
|
||||
$roomplan_data = $this->StundenplanModel->stundenplanGruppierung($this->StundenplanModel->getRoomQuery($ort_kurzbz, $start_date, $end_date));
|
||||
|
||||
$roomplan_data = $this->getDataOrTerminateWithError($roomplan_data);
|
||||
|
||||
$this->expand_object_information($roomplan_data);
|
||||
|
||||
$this->terminateWithSuccess($roomplan_data);
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* fetches stundenplan events from a UID and start/end date
|
||||
* fetches Stundenplan events from a UID and start/end date
|
||||
* @access public
|
||||
*
|
||||
*/
|
||||
public function getStundenplan($start_date, $end_date, $lv_id = null){
|
||||
$this->_ci =& get_instance();
|
||||
|
||||
public function getStundenplan(){
|
||||
// Load Config
|
||||
$this->_ci->load->config('calendar');
|
||||
|
||||
$this->load->model('ressource/Mitarbeiter_model','MitarbeiterModel');
|
||||
$this->load->model('organisation/Studiensemester_model','StudiensemesterModel');
|
||||
$this->load->model('education/Studentlehrverband_model', 'StudentlehrverbandModel');
|
||||
$this->load->model('person/Benutzergruppe_model','BenutzergruppeModel');
|
||||
|
||||
// form validation
|
||||
$this->load->library('form_validation');
|
||||
$this->form_validation->set_data($_GET);
|
||||
$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() === FALSE)
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
// storing the get parameter in local variables
|
||||
$start_date = $this->input->get('start_date', TRUE);
|
||||
$end_date = $this->input->get('end_date', TRUE);
|
||||
$lv_id = $this->input->get('lv_id', TRUE);
|
||||
$this->_ci->load->model('ressource/Mitarbeiter_model','MitarbeiterModel');
|
||||
$this->_ci->load->model('organisation/Studiensemester_model','StudiensemesterModel');
|
||||
$this->_ci->load->model('education/Studentlehrverband_model', 'StudentlehrverbandModel');
|
||||
$this->_ci->load->model('person/Benutzergruppe_model','BenutzergruppeModel');
|
||||
$this->_ci->load->model('ressource/Stundenplan_model', 'StundenplanModel');
|
||||
|
||||
|
||||
$student_uid = getAuthUID();
|
||||
if(is_null($student_uid))
|
||||
{
|
||||
$this->terminateWithError("No UID");
|
||||
return error("No UID");
|
||||
}
|
||||
|
||||
$semester_range = $this->studienSemesterErmitteln($start_date,$end_date);
|
||||
if(isError($semester_range))
|
||||
{
|
||||
return error(getData($semester_range));
|
||||
}
|
||||
$semester_range = getData($semester_range);
|
||||
$this->sortStudienSemester($semester_range);
|
||||
$this->applyLoadUeberSemesterHaelfte($semester_range);
|
||||
$function_error = $this->applyLoadUeberSemesterHaelfte($semester_range);
|
||||
if(!is_null($function_error)){
|
||||
return $function_error;
|
||||
}
|
||||
|
||||
if($lv_id) { // fetch Stundenplan for lva, irrelevant of who is requesting it (for now)
|
||||
|
||||
$stundenplan_data = $this->StundenplanModel->getStundenplanLVA($start_date, $end_date, $lv_id);
|
||||
$stundenplan_data = $this->getDataOrTerminateWithError($stundenplan_data) ?? [];
|
||||
$this->expand_object_information($stundenplan_data);
|
||||
$stundenplan_data = $this->_ci->StundenplanModel->getStundenplanLVA($start_date, $end_date, $lv_id);
|
||||
if(isError($stundenplan_data))
|
||||
{
|
||||
return error(getData($stundenplan_data));
|
||||
}
|
||||
$stundenplan_data = getData($stundenplan_data) ?? [];
|
||||
$function_error = $this->expand_object_information($stundenplan_data);
|
||||
if(!is_null($function_error)){
|
||||
return $function_error;
|
||||
}
|
||||
|
||||
// query lv itself in case its Stundenplan is being queried and it has no entries
|
||||
$this->load->model('education/Lehrveranstaltung_model','LehrveranstaltungModel');
|
||||
$lv = getData($this->LehrveranstaltungModel->load($lv_id))[0];
|
||||
$this->addMeta('lv', $lv);
|
||||
$this->terminateWithSuccess($stundenplan_data);
|
||||
|
||||
$this->_ci->load->model('education/Lehrveranstaltung_model','LehrveranstaltungModel');
|
||||
$lv_result = $this->_ci->LehrveranstaltungModel->load($lv_id);
|
||||
if(isError($lv_result))
|
||||
{
|
||||
return error(getData($lv_result));
|
||||
}
|
||||
$lv = getData($lv_result)[0];
|
||||
return success($stundenplan_data);
|
||||
}
|
||||
|
||||
$is_mitarbeiter = getData($this->MitarbeiterModel->isMitarbeiter($student_uid));
|
||||
$is_mitarbeiter = getData($this->_ci->MitarbeiterModel->isMitarbeiter($student_uid));
|
||||
if($is_mitarbeiter)
|
||||
{
|
||||
|
||||
$stundenplan_data = $this->StundenplanModel->getStundenplanMitarbeiter($start_date, $end_date, $student_uid);
|
||||
$stundenplan_data = $this->getDataOrTerminateWithError($stundenplan_data) ?? [];
|
||||
$this->expand_object_information($stundenplan_data);
|
||||
$this->terminateWithSuccess($stundenplan_data);
|
||||
$stundenplan_data = $this->_ci->StundenplanModel->getStundenplanMitarbeiter($start_date, $end_date, $student_uid);
|
||||
if(isError($stundenplan_data))
|
||||
{
|
||||
return error(getData($stundenplan_data));
|
||||
}
|
||||
$stundenplan_data = getData($stundenplan_data) ?? [];
|
||||
$function_error = $this->expand_object_information($stundenplan_data);
|
||||
if(!is_null($function_error)){
|
||||
return error($function_error);
|
||||
}
|
||||
return success($stundenplan_data);
|
||||
} else {
|
||||
// getting the gruppen_kurzbz of the student in the different studiensemester
|
||||
$benutzer_gruppen = $this->fetchBenutzerGruppenFromStudiensemester($semester_range);
|
||||
if(isError($benutzer_gruppen))
|
||||
{
|
||||
return error(getData($benutzer_gruppen));
|
||||
}
|
||||
$benutzer_gruppen = getData($benutzer_gruppen);
|
||||
|
||||
// getting the student_lehrverbaende of the student in the different studiensemester
|
||||
$student_lehrverband = $this->fetchStudentlehrverbandFromStudiensemester($semester_range);
|
||||
|
||||
$stundenplan_query = $this->StundenplanModel->getStundenplanQuery($start_date, $end_date, $semester_range, $benutzer_gruppen, $student_lehrverband);
|
||||
if(isError($student_lehrverband))
|
||||
{
|
||||
return error(getData($student_lehrverband));
|
||||
}
|
||||
$student_lehrverband = getData($student_lehrverband);
|
||||
|
||||
$stundenplan_query = $this->_ci->StundenplanModel->getStundenplanQuery($start_date, $end_date, $semester_range, $benutzer_gruppen, $student_lehrverband);
|
||||
if(!$stundenplan_query)
|
||||
{
|
||||
$this->terminateWithSuccess([]);
|
||||
return success([]);
|
||||
}
|
||||
$stundenplan_data = $this->StundenplanModel->stundenplanGruppierung($stundenplan_query);
|
||||
$stundenplan_data = $this->getDataOrTerminateWithError($stundenplan_data) ?? [];
|
||||
|
||||
$this->expand_object_information($stundenplan_data);
|
||||
|
||||
$this->returnObj['$stundenplan_query'] = $stundenplan_query;
|
||||
$this->returnObj['$student_lehrverband'] = $student_lehrverband;
|
||||
$this->returnObj['$benutzer_gruppen'] = $benutzer_gruppen;
|
||||
$this->terminateWithSuccess($stundenplan_data);
|
||||
|
||||
$stundenplan_data = $this->_ci->StundenplanModel->stundenplanGruppierung($stundenplan_query);
|
||||
if(isError($stundenplan_data))
|
||||
{
|
||||
return error(getData($stundenplan_data));
|
||||
}
|
||||
$stundenplan_data = getData($stundenplan_data) ?? [];
|
||||
|
||||
$function_error = $this->expand_object_information($stundenplan_data);
|
||||
if(!is_null($function_error)){
|
||||
return $function_error;
|
||||
}
|
||||
|
||||
return success($stundenplan_data);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// gets the reservierungen of a room if the ort_kurzbz parameter is supplied otherwise gets the reservierungen of the stundenplan of a student
|
||||
public function Reservierungen($ort_kurzbz = null)
|
||||
/**
|
||||
* Get stundenplan for a room
|
||||
*
|
||||
* @param string $ort_kurzbz
|
||||
* @param string $start_date
|
||||
* @param string $end_date
|
||||
* @return stdClass
|
||||
*/
|
||||
public function getRoomplan($ort_kurzbz, $start_date, $end_date)
|
||||
{
|
||||
//form validation
|
||||
$this->load->library('form_validation');
|
||||
$this->form_validation->set_data($_GET);
|
||||
$this->form_validation->set_rules('start_date', "StartDate", "required");
|
||||
$this->form_validation->set_rules('end_date', "EndDate", "required");
|
||||
if($this->form_validation->run() == FALSE) $this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
$this->_ci =& get_instance();
|
||||
|
||||
$this->load->model('ressource/Mitarbeiter_model','MitarbeiterModel');
|
||||
// Load Config
|
||||
$this->_ci->load->config('calendar');
|
||||
// Load Models
|
||||
$this->_ci->load->model('ressource/Stundenplan_model', 'StundenplanModel');
|
||||
|
||||
// storing the get parameter in local variables
|
||||
$start_date = $this->input->get('start_date', TRUE);
|
||||
$end_date = $this->input->get('end_date', TRUE);
|
||||
$query = $this->_ci->StundenplanModel->getRoomQuery($ort_kurzbz, $start_date, $end_date);
|
||||
$roomplan_data = $this->_ci->StundenplanModel->stundenplanGruppierung($query);
|
||||
|
||||
$is_mitarbeiter = getData($this->MitarbeiterModel->isMitarbeiter(getAuthUID()));
|
||||
if($is_mitarbeiter)
|
||||
{
|
||||
$reservierungen = $this->ReservierungModel->getReservierungenMitarbeiter($start_date, $end_date, $ort_kurzbz);
|
||||
if (isError($roomplan_data))
|
||||
return $roomplan_data;
|
||||
|
||||
$this->expand_object_information($roomplan_data->retval);
|
||||
|
||||
return $roomplan_data;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get reservations (for a room or all)
|
||||
*
|
||||
* @param string $start_date
|
||||
* @param string $end_date
|
||||
* @param string $ort_kurzbz
|
||||
* @return stdClass
|
||||
*/
|
||||
public function getReservierungen($start_date, $end_date, $ort_kurzbz = '')
|
||||
{
|
||||
$this->_ci =& get_instance();
|
||||
|
||||
// Load Config
|
||||
$this->_ci->load->config('calendar');
|
||||
// Load Models
|
||||
$this->_ci->load->model('ressource/Mitarbeiter_model', 'MitarbeiterModel');
|
||||
|
||||
$is_mitarbeiter = getData($this->_ci->MitarbeiterModel->isMitarbeiter(getAuthUID()));
|
||||
|
||||
if ($is_mitarbeiter) {
|
||||
$reservierungen = $this->_ci->ReservierungModel->getReservierungenMitarbeiter($start_date, $end_date, $ort_kurzbz);
|
||||
} else {
|
||||
// querying the reservierungen
|
||||
$reservierungen = $this->ReservierungModel->getReservierungen($start_date, $end_date, $ort_kurzbz);
|
||||
$reservierungen = $this->_ci->ReservierungModel->getReservierungen($start_date, $end_date, $ort_kurzbz);
|
||||
}
|
||||
|
||||
$reservierungen = $this->getDataOrTerminateWithError($reservierungen) ?? [];
|
||||
$this->expand_object_information($reservierungen);
|
||||
$this->terminateWithSuccess($reservierungen);
|
||||
if (isError($reservierungen))
|
||||
return $reservierungen;
|
||||
|
||||
$function_error = $this->expand_object_information($reservierungen->retval);
|
||||
|
||||
if (!is_null($function_error))
|
||||
return $function_error;
|
||||
|
||||
return $reservierungen;
|
||||
}
|
||||
|
||||
public function getLehreinheitStudiensemester($lehreinheit_id){
|
||||
$this->load->model('education/Lehreinheit_model', 'LehreinheitModel');
|
||||
$this->LehreinheitModel->addSelect(["studiensemester_kurzbz"]);
|
||||
$result = $this->LehreinheitModel->load($lehreinheit_id);
|
||||
$result = current($this->getDataOrTerminateWithError($result))->studiensemester_kurzbz;
|
||||
$this->terminateWithSuccess($result);
|
||||
public function getLektorenFromLehrveranstaltung($lehrveranstaltung_id, $semester, $studiengang_kz, $studiensemester_kurzbz){
|
||||
$this->_ci =& get_instance();
|
||||
$this->_ci->load->model('ressource/Stundenplan_model', 'StundenplanModel');
|
||||
$this->_ci->load->model('organisation/Studiensemester_model','StudiensemesterModel');
|
||||
|
||||
$studiensemester = $this->_ci->StudiensemesterModel->loadWhere(["studiensemester_kurzbz"=>$studiensemester_kurzbz]);
|
||||
if(isError($studiensemester))
|
||||
{
|
||||
return error(getData($studiensemester));
|
||||
}
|
||||
$studiensemester = current(getData($studiensemester));
|
||||
$lektoren = $this->_ci->StundenplanModel->execReadOnlyQuery("
|
||||
SELECT DISTINCT uid
|
||||
FROM campus.vw_stundenplan
|
||||
WHERE lehrveranstaltung_id = ? AND
|
||||
studiengang_kz = ? AND
|
||||
semester = ? AND
|
||||
(datum BETWEEN ? AND ?)
|
||||
",[$lehrveranstaltung_id, $studiengang_kz, $semester, $studiensemester->start, $studiensemester->ende]);
|
||||
|
||||
if(isError($lektoren))
|
||||
{
|
||||
return error(getData($lektoren));
|
||||
}
|
||||
$lektoren = getData($lektoren);
|
||||
if(isset($lektoren)){
|
||||
$lektoren = array_map(function($lektor){
|
||||
return $lektor->uid;
|
||||
},$lektoren);
|
||||
|
||||
}
|
||||
return success($lektoren);
|
||||
}
|
||||
|
||||
// ################# Private Functions
|
||||
|
||||
private function expand_object_information($data){
|
||||
|
||||
public function expand_object_information($data){
|
||||
$this->_ci =& get_instance();
|
||||
|
||||
foreach ($data as $item)
|
||||
{
|
||||
$tz = new DateTimeZone($this->_ci->config->item('timezone'));
|
||||
$isostart = new DateTime($item->datum . ' ' . $item->beginn, $tz);
|
||||
$item->isostart = $isostart->format(DateTime::ATOM);
|
||||
|
||||
$isoend = new DateTime($item->datum . ' ' . $item->ende, $tz);
|
||||
$item->isoend = $isoend->format(DateTime::ATOM);
|
||||
|
||||
$lektor_obj_array = array();
|
||||
$gruppe_obj_array = array();
|
||||
@@ -247,20 +246,24 @@ class Stundenplan extends FHCAPI_Controller
|
||||
// load lektor object
|
||||
foreach ($item->lektor as $lv_lektor)
|
||||
{
|
||||
$this->StundenplanModel->addLimit(1);
|
||||
$lektor_object = $this->StundenplanModel->execReadOnlyQuery("
|
||||
$this->_ci->StundenplanModel->addLimit(1);
|
||||
$lektor_object = $this->_ci->StundenplanModel->execReadOnlyQuery("
|
||||
SELECT mitarbeiter_uid, vorname, nachname, kurzbz
|
||||
FROM public.tbl_mitarbeiter
|
||||
JOIN public.tbl_benutzer benutzer ON benutzer.uid = mitarbeiter_uid
|
||||
JOIN public.tbl_person person ON person.person_id = benutzer.person_id
|
||||
WHERE kurzbz = ?", [$lv_lektor]);
|
||||
if (isError($lektor_object)) {
|
||||
$this->show_error(getError($lektor_object));
|
||||
$this->_ci->show_error(getError($lektor_object));
|
||||
}
|
||||
$lektor_object = $this->getDataOrTerminateWithError($lektor_object);
|
||||
if(isError($lektor_object))
|
||||
{
|
||||
return error(getData($lektor_object));
|
||||
}
|
||||
$lektor_object = getData($lektor_object);
|
||||
if(count($lektor_object) == 0)
|
||||
{
|
||||
$this->terminateWithError("No lektor object");
|
||||
return error("No lektor object");
|
||||
}
|
||||
$lektor_object = current($lektor_object);
|
||||
// only provide needed information of the mitarbeiter object
|
||||
@@ -286,12 +289,12 @@ class Stundenplan extends FHCAPI_Controller
|
||||
|
||||
if($item->ort_kurzbz) {
|
||||
|
||||
$ort_content_object = $this->StundenplanModel->execReadOnlyQuery("
|
||||
$ort_content_object = $this->_ci->StundenplanModel->execReadOnlyQuery("
|
||||
SELECT content_id
|
||||
FROM public.tbl_ort
|
||||
WHERE ort_kurzbz = ?", [$item->ort_kurzbz]);
|
||||
if (isError($ort_content_object)) {
|
||||
$this->show_error(getError($ort_content_object));
|
||||
return error(getData($ort_content_object));
|
||||
}
|
||||
$ort_content_object = getData($ort_content_object)[0];
|
||||
if($ort_content_object) {
|
||||
@@ -307,6 +310,87 @@ class Stundenplan extends FHCAPI_Controller
|
||||
}
|
||||
}
|
||||
|
||||
public function fetchFerienTageEvents($start_date, $end_date, $studiengang_kz)
|
||||
{
|
||||
$this->_ci =& get_instance();
|
||||
|
||||
// Load Config
|
||||
$this->_ci->load->config('calendar');
|
||||
|
||||
$this->_ci->load->model('organisation/Ferien_model', 'FerienModel');
|
||||
|
||||
$tz = new DateTimeZone($this->_ci->config->item('timezone'));
|
||||
|
||||
$ferienEvents = $this->_ci->FerienModel->execReadOnlyQuery("
|
||||
SELECT *
|
||||
FROM lehre.tbl_ferien
|
||||
WHERE (bisdatum >= ? AND vondatum <= ?) AND (studiengang_kz = 0 OR studiengang_kz = ?)
|
||||
",[$start_date, $end_date, $studiengang_kz]);
|
||||
|
||||
if (isError($ferienEvents)) {
|
||||
return error(getData($ferienEvents));
|
||||
}
|
||||
$ferienEvents = getData($ferienEvents);
|
||||
|
||||
if(is_array($ferienEvents) && count($ferienEvents) > 0){
|
||||
|
||||
$ferienEvents = array_map(function($event){
|
||||
$event_start = new DateTime($event->vondatum);
|
||||
$event_end = new DateTime($event->bisdatum);
|
||||
$event_end->modify('+1 day');
|
||||
|
||||
$interval = new DateInterval('P1D');
|
||||
$period = new DatePeriod($event_start, $interval, $event_end);
|
||||
$event->dates = iterator_to_array($period);
|
||||
return $event;
|
||||
}, $ferienEvents);
|
||||
|
||||
$start_date = new DateTime($start_date);
|
||||
$start_date->setTime(0, 0, 0);
|
||||
$end_date = new DateTime($end_date);
|
||||
$end_date->setTime(23, 59, 59);
|
||||
|
||||
$ferienEventsFlattened=[];
|
||||
foreach($ferienEvents as $ferien_event){
|
||||
foreach($ferien_event->dates as $date){
|
||||
if ($date < $start_date || $date > $end_date)
|
||||
continue;
|
||||
$event = new stdClass();
|
||||
$event->bezeichnung = $ferien_event->bezeichnung;
|
||||
$event->datum = $date->format('Y-m-d');
|
||||
$event->type = 'ferien';
|
||||
$ferienEventsFlattened[] = $event;
|
||||
}
|
||||
};
|
||||
|
||||
$today=new DateTime();
|
||||
$ferienEventsFlattened = array_map(function($event) use($today, $tz){
|
||||
$ferien_event = (object) array(
|
||||
'type' => 'ferien',
|
||||
'beginn' => $today->format('H:i:s'),
|
||||
'ende' => $today->format('H:i:s'),
|
||||
'isostart' => (new DateTime($event->datum . ' 00:00:00', $tz))->format('c'),
|
||||
'isoend' => (new DateTime($event->datum . ' 23:59:59', $tz))->format('c'),
|
||||
'allDayEvent' => true,
|
||||
'datum' => $event->datum,
|
||||
'topic' => $event->bezeichnung,
|
||||
'titel' => $event->bezeichnung,
|
||||
'farbe' => '00689E'
|
||||
);
|
||||
return $ferien_event;
|
||||
}, $ferienEventsFlattened);
|
||||
|
||||
return success($ferienEventsFlattened);
|
||||
}
|
||||
else{
|
||||
return success([]);
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
// start of the private functions ########################################################################################################
|
||||
|
||||
// function used to sort an array of studiensemester strings
|
||||
private function sortStudienSemester(&$semester_range){
|
||||
usort(
|
||||
@@ -371,9 +455,13 @@ class Stundenplan extends FHCAPI_Controller
|
||||
foreach($semester_array as $semester=>$semester_date_range)
|
||||
{
|
||||
// for each active semester query the benutzer_gruppen associated to the semester
|
||||
$benutzer_query = $this->BenutzergruppeModel->execReadOnlyQuery("
|
||||
$benutzer_query = $this->_ci->BenutzergruppeModel->execReadOnlyQuery("
|
||||
SELECT * FROM tbl_benutzergruppe where uid = ? AND studiensemester_kurzbz = ?",[$student_uid, $semester]);
|
||||
$benutzer_query_result = $this->getDataOrTerminateWithError($benutzer_query);
|
||||
if(isError($benutzer_query)){
|
||||
return error(getData($benutzer_query));
|
||||
}
|
||||
$benutzer_query_result = getData($benutzer_query)??[];
|
||||
|
||||
array_push(
|
||||
$benutzer_gruppen[$semester_key],
|
||||
array_map(
|
||||
@@ -408,7 +496,7 @@ class Stundenplan extends FHCAPI_Controller
|
||||
$benutzer_gruppen
|
||||
);
|
||||
|
||||
return $benutzer_gruppen;
|
||||
return success($benutzer_gruppen);
|
||||
}
|
||||
|
||||
private function fetchStudentlehrverbandFromStudiensemester($semester_range){
|
||||
@@ -428,10 +516,14 @@ class Stundenplan extends FHCAPI_Controller
|
||||
foreach($semester_array as $semester=>$semester_date_range)
|
||||
{
|
||||
// for each active semester query the student_lehrverband associated to the semester
|
||||
$lehrverband_query = $this->BenutzergruppeModel->execReadOnlyQuery("
|
||||
$lehrverband_query = $this->_ci->BenutzergruppeModel->execReadOnlyQuery("
|
||||
SELECT * FROM tbl_studentlehrverband where student_uid = ? AND studiensemester_kurzbz = ?", [$student_uid, $semester]);
|
||||
$lehrverband_query_result = $this->getDataOrTerminateWithError($lehrverband_query);
|
||||
array_push($student_lehrverband[$semester_key], array_map(
|
||||
if(isError($lehrverband_query)){
|
||||
return error(getData($lehrverband_query));
|
||||
}
|
||||
$lehrverband_query_result = getData($lehrverband_query)??[];
|
||||
|
||||
$converted_studentLehrverband= array_map(
|
||||
function ($item)
|
||||
{
|
||||
$result = new stdClass();
|
||||
@@ -441,8 +533,12 @@ class Stundenplan extends FHCAPI_Controller
|
||||
$result->gruppe = $item->gruppe;
|
||||
return $result;
|
||||
},
|
||||
$lehrverband_query_result));
|
||||
$lehrverband_query_result);
|
||||
|
||||
array_push($student_lehrverband[$semester_key], $converted_studentLehrverband);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
// merge the studentlehrverband of each studiensemester together for the original studiensemester
|
||||
@@ -453,6 +549,7 @@ class Stundenplan extends FHCAPI_Controller
|
||||
['WS2024'] => [ ['stg_kz'=>298,'semester'=>2,'verband'=>"A",'gruppe'=>""], ['stg_kz'=>298,'semester'=>3,'verband'=>"A",'gruppe'=>""] ],
|
||||
]
|
||||
*/
|
||||
|
||||
$student_lehrverband = array_map(
|
||||
function($studentlehrverband)
|
||||
{
|
||||
@@ -466,7 +563,7 @@ class Stundenplan extends FHCAPI_Controller
|
||||
$student_lehrverband
|
||||
);
|
||||
|
||||
return $student_lehrverband;
|
||||
return success($student_lehrverband);
|
||||
}
|
||||
|
||||
private function applyLoadUeberSemesterHaelfte(&$semester_range){
|
||||
@@ -488,10 +585,14 @@ class Stundenplan extends FHCAPI_Controller
|
||||
$semester_collection = [];
|
||||
foreach($semester_range as $studiensemester)
|
||||
{
|
||||
$previous_studiensemester = $this->StudiensemesterModel->getPreviousFrom($studiensemester);
|
||||
$previous_studiensemester = $this->getDataOrTerminateWithError($previous_studiensemester);
|
||||
$previous_studiensemester = $this->_ci->StudiensemesterModel->getPreviousFrom($studiensemester);
|
||||
if(isError($previous_studiensemester))
|
||||
{
|
||||
return error(getData($previous_studiensemester));
|
||||
}
|
||||
$previous_studiensemester = getData($previous_studiensemester);
|
||||
if (count($previous_studiensemester) == 0) {
|
||||
$this->terminateWithError("No previous semester");
|
||||
return error('no previous semester');
|
||||
}
|
||||
$previous_studiensemester = current($previous_studiensemester)->studiensemester_kurzbz;
|
||||
$semester_collection[$studiensemester] = [$previous_studiensemester, $studiensemester];
|
||||
@@ -540,8 +641,12 @@ class Stundenplan extends FHCAPI_Controller
|
||||
$studienSemesterDateRanges=[];
|
||||
foreach($semester_collection as $semester_original => $semester_adjoint)
|
||||
{
|
||||
$semester_start_ende = $this->StudiensemesterModel->getStartEndeFromStudiensemester($semester_original);
|
||||
$semester_start_ende = current($this->getDataOrTerminateWithError($semester_start_ende));
|
||||
$semester_start_ende = $this->_ci->StudiensemesterModel->getStartEndeFromStudiensemester($semester_original);
|
||||
if(isError($semester_start_ende))
|
||||
{
|
||||
return error(getData($semester_start_ende));
|
||||
}
|
||||
$semester_start_ende = current(getData($semester_start_ende));
|
||||
|
||||
// initialize empty arrays to add key value pairs
|
||||
$studienSemesterDateRanges[$semester_original] = [];
|
||||
@@ -590,29 +695,36 @@ class Stundenplan extends FHCAPI_Controller
|
||||
private function studienSemesterErmitteln($start_date,$end_date){
|
||||
|
||||
// gets all studiensemester from the student from start_date to end_date
|
||||
$semester_range = $this->StudiensemesterModel->getByDateRange($start_date,$end_date);
|
||||
$semester_range = $this->_ci->StudiensemesterModel->getByDateRange($start_date,$end_date);
|
||||
if(isError($semester_range))
|
||||
{
|
||||
return error(getData($semester_range));
|
||||
}
|
||||
$semester_range = array_map(
|
||||
function($sem)
|
||||
{
|
||||
return $sem->studiensemester_kurzbz;
|
||||
},
|
||||
$this->getDataOrTerminateWithError($semester_range)
|
||||
getData($semester_range) ?: []
|
||||
);
|
||||
|
||||
// if no studiensemester is found for the given timespan, get the nearest studiensemester
|
||||
if(count($semester_range) == 0)
|
||||
{
|
||||
$aktuelle_studiensemester = $this->StudiensemesterModel->getNearest();
|
||||
$aktuelle_studiensemester = $this->getDataOrTerminateWithError($aktuelle_studiensemester);
|
||||
$aktuelle_studiensemester = $this->_ci->StudiensemesterModel->getNearest();
|
||||
if(isError($aktuelle_studiensemester))
|
||||
{
|
||||
return error(getData($aktuelle_studiensemester));
|
||||
}
|
||||
$aktuelle_studiensemester = getData($aktuelle_studiensemester);
|
||||
if (count($aktuelle_studiensemester) == 0) {
|
||||
$this->terminateWithError("No aktuelles semester");
|
||||
return error("No aktuelles semester");
|
||||
}
|
||||
$aktuelle_studiensemester = current($aktuelle_studiensemester)->studiensemester_kurzbz;
|
||||
// push aktuelles semester in active semester array
|
||||
array_push($semester_range, $aktuelle_studiensemester);
|
||||
|
||||
}
|
||||
return $semester_range;
|
||||
return success($semester_range);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -107,7 +107,7 @@ class DashboardLib
|
||||
$emptyoverride = new stdClass();
|
||||
$emptyoverride->dashboard_id = $dashboard->dashboard_id;
|
||||
$emptyoverride->uid = $uid;
|
||||
$emptyoverride->override = '{"widgets": {"' . self::USEROVERRIDE_SECTION . '": {}}}';
|
||||
$emptyoverride->override = '{"' . self::USEROVERRIDE_SECTION . '": {"widgets":{}}, "custom": { "widgets" : {}}}';
|
||||
|
||||
return $emptyoverride;
|
||||
}
|
||||
@@ -127,7 +127,7 @@ class DashboardLib
|
||||
$emptypreset->dashboard_id = $dashboard->dashboard_id;
|
||||
$emptypreset->funktion_kurzbz = $funktion_kurzbz;
|
||||
$section = ($funktion_kurzbz !== null) ? $funktion_kurzbz : self::SECTION_IF_FUNKTION_KURZBZ_IS_NULL;
|
||||
$emptypreset->preset = '{"widgets": {"' . $section . '": {}}}';
|
||||
$emptypreset->preset = '{"' . $section . '": { "widgets" : {}},"custom": { "widgets" : {}}}';
|
||||
|
||||
return $emptypreset;
|
||||
}
|
||||
@@ -206,21 +206,22 @@ class DashboardLib
|
||||
public function addWidgetToWidgets(&$widgets, $section, $widget, $widgetid)
|
||||
{
|
||||
$section = ($section !== null) ? $section : self::SECTION_IF_FUNKTION_KURZBZ_IS_NULL;
|
||||
if (!isset($widgets[$section]) || !is_array($widgets[$section]))
|
||||
if (!isset($widgets[$section]) || !isset($widgets[$section]["widgets"]) || !is_array($widgets[$section]))
|
||||
{
|
||||
$widgets[$section] = array();
|
||||
$widgets[$section]["widgets"] = array();
|
||||
}
|
||||
|
||||
$widgets[$section][$widgetid] = $widget;
|
||||
$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][$widgetid]))
|
||||
if (isset($widgets[$section]) && isset($widgets[$section]["widgets"][$widgetid]))
|
||||
{
|
||||
unset($widgets[$section][$widgetid]);
|
||||
if(empty($widgets[$section]) && $section !== self::USEROVERRIDE_SECTION) {
|
||||
unset($widgets[$section]["widgets"][$widgetid]);
|
||||
if(empty($widgets[$section]["widgets"]) && $section !== self::USEROVERRIDE_SECTION) {
|
||||
unset($widgets[$section]);
|
||||
}
|
||||
return true;
|
||||
|
||||
@@ -11,4 +11,5 @@ class Abgabe_model extends DB_Model
|
||||
$this->dbTable = 'campus.tbl_abgabe';
|
||||
$this->pk = 'abgabe_id';
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -452,16 +452,6 @@ class Lehrveranstaltung_model extends DB_Model
|
||||
*/
|
||||
public function getLvsByStudentWithGrades($student_uid, $studiensemester_kurzbz, $sprache = null, $lvid=null)
|
||||
{
|
||||
if ($sprache) {
|
||||
$sprache_qry = $this->db->compile_binds('SELECT index FROM public.tbl_sprache WHERE sprache = ?', [$sprache]);
|
||||
$bezeichnung = 'bezeichnung_mehrsprachig[(' . $sprache_qry . ')]';
|
||||
$sgbezeichnung = $sprache == 'English' ? 'COALESCE(sg.english, sg.bezeichnung)' : 'sg.bezeichnung';
|
||||
$lvbezeichnung = $sprache == 'English' ? 'COALESCE(v.bezeichnung_english, v.bezeichnung)' : 'v.bezeichnung';
|
||||
} else {
|
||||
$bezeichnung = 'bezeichnung';
|
||||
$sgbezeichnung = 'sg.bezeichnung';
|
||||
$lvbezeichnung = 'v.bezeichnung';
|
||||
}
|
||||
|
||||
$this->addDistinct();
|
||||
// TODO(chris): selects
|
||||
@@ -501,16 +491,20 @@ class Lehrveranstaltung_model extends DB_Model
|
||||
$this->addSelect('znn.positiv');
|
||||
|
||||
#$this->addSelect('splv.module');
|
||||
$this->addSelect($lvbezeichnung . ' AS bezeichnung');
|
||||
$this->addSelect($sgbezeichnung . ' AS sg_bezeichnung');
|
||||
$this->addSelect('v.bezeichnung AS bezeichnung');
|
||||
$this->addSelect('v.bezeichnung_english AS bezeichnung_eng');
|
||||
$this->addSelect('sg.bezeichnung AS sg_bezeichnung');
|
||||
$this->addSelect('sg.english AS sg_bezeichnung_eng');
|
||||
$this->addSelect('UPPER(sg.typ::VARCHAR(1) || sg.kurzbz) AS studiengang_kuerzel');
|
||||
|
||||
//also adds returns the index of the grade
|
||||
//TODO: ist zeugnissnote immer gleich wie die lvgesamtnote
|
||||
$this->addSelect('COALESCE(zn.note::numeric,gn.note::numeric) as note_index');
|
||||
$this->addSelect('COALESCE(znn.positiv,gnn.positiv) as positiv');
|
||||
$this->addSelect('COALESCE(gnn.' . $bezeichnung . ', gnn.bezeichnung, gn.note::text) AS lvnote');
|
||||
$this->addSelect('COALESCE(znn.' . $bezeichnung . ', znn.bezeichnung, zn.note::text) AS znote');
|
||||
$this->addSelect('gnn.bezeichnung_mehrsprachig AS lvnotebez');
|
||||
$this->addSelect('gnn.note AS lvnote');
|
||||
$this->addSelect('znn.bezeichnung_mehrsprachig AS znotebez');
|
||||
$this->addSelect('znn.note AS znote');
|
||||
|
||||
// TODO(chris): Potentielle Anpassung "Eine UID"
|
||||
$this->addJoin('campus.vw_student_lehrveranstaltung v', 'lehrveranstaltung_id');
|
||||
|
||||
@@ -30,4 +30,35 @@ class Paabgabe_model extends DB_Model
|
||||
|
||||
return $this->execQuery($qry, array($projektarbeit_id));
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets all Paabgabe Termin Deadlines of zugewiesene Projektarbeiten as a Mitarbeiter for Terminübersicht Abgabetool.
|
||||
* @param int $person_id
|
||||
* @return object
|
||||
*/
|
||||
public function getDeadlines($person_id)
|
||||
{
|
||||
$qry = "SELECT
|
||||
DISTINCT TO_CHAR(tbl_paabgabe.datum, 'DD.MM.YYYY') as datum, tbl_paabgabe.fixtermin, tbl_paabgabe.kurzbz,
|
||||
person_student.vorname as stud_vorname, person_student.nachname as stud_nachname,
|
||||
person_student.titelpre as stud_titelpre, person_student.titelpost as stud_titelpost,
|
||||
tbl_lehrveranstaltung.semester, UPPER(tbl_studiengang.typ || tbl_studiengang.kurzbz) as stg,
|
||||
tbl_paabgabetyp.bezeichnung as typ_bezeichnung
|
||||
FROM
|
||||
campus.tbl_paabgabe
|
||||
JOIN lehre.tbl_projektarbeit USING(projektarbeit_id)
|
||||
JOIN lehre.tbl_projektbetreuer USING(projektarbeit_id)
|
||||
JOIN public.tbl_benutzer bn_student ON(tbl_projektarbeit.student_uid=bn_student.uid)
|
||||
JOIN public.tbl_person person_student ON(bn_student.person_id=person_student.person_id)
|
||||
JOIN lehre.tbl_lehreinheit ON(tbl_projektarbeit.lehreinheit_id=tbl_lehreinheit.lehreinheit_id)
|
||||
JOIN lehre.tbl_lehrveranstaltung ON(tbl_lehreinheit.lehrveranstaltung_id=tbl_lehrveranstaltung.lehrveranstaltung_id)
|
||||
JOIN public.tbl_studiengang ON(tbl_lehrveranstaltung.studiengang_kz=tbl_studiengang.studiengang_kz)
|
||||
JOIN campus.tbl_paabgabetyp USING(paabgabetyp_kurzbz)
|
||||
WHERE
|
||||
tbl_projektbetreuer.person_id= ? AND tbl_paabgabe.datum>=now() AND bn_student.aktiv
|
||||
ORDER BY datum";
|
||||
|
||||
return $this->execReadOnlyQuery($qry, array($person_id));
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -69,4 +69,196 @@ class Projektarbeit_model extends DB_Model
|
||||
|
||||
return $this->execQuery($qry, $params);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update a Projektarbeit of a student by projektarbeit_id with
|
||||
* the paramenters used by the student endupload page in cis4 abgabetool.
|
||||
*/
|
||||
public function updateProjektarbeit($projektarbeit_id,$sprache,$abstract,$abstract_en,
|
||||
$schlagwoerter, $schlagwoerter_en,$seitenanzahl)
|
||||
{
|
||||
$qry = "UPDATE lehre.tbl_projektarbeit SET
|
||||
seitenanzahl = ?,
|
||||
abgabedatum = now(),
|
||||
sprache = ?,
|
||||
schlagwoerter_en = ?,
|
||||
schlagwoerter = ?,
|
||||
abstract = ?,
|
||||
abstract_en = ?
|
||||
WHERE projektarbeit_id = ?";
|
||||
|
||||
return $this->execQuery($qry, array($seitenanzahl, $sprache, $schlagwoerter_en,
|
||||
$schlagwoerter, $abstract, $abstract_en, $projektarbeit_id));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a List of Projektarbeiten of a student with betreuer
|
||||
* used by the student cis4 abgabetool.
|
||||
*/
|
||||
public function getStudentProjektarbeitenWithBetreuer($studentUID)
|
||||
{
|
||||
$betreuerQuery = "
|
||||
SELECT
|
||||
vorname as bvorname,
|
||||
nachname as bnachname,
|
||||
titelpre as btitelpre,
|
||||
titelpost AS btitelpost,
|
||||
titelpost AS btitelpost,
|
||||
tbl_betreuerart.beschreibung AS betreuerart_beschreibung,
|
||||
|
||||
(SELECT person_id
|
||||
FROM lehre.tbl_projektbetreuer
|
||||
WHERE projektarbeit_id=tbl_projektarbeit.projektarbeit_id
|
||||
AND betreuerart_kurzbz IN ('Zweitbetreuer', 'Zweitbegutachter') LIMIT 1) AS zweitbetreuer_person_id,
|
||||
(SELECT betreuerart_kurzbz
|
||||
FROM lehre.tbl_projektbetreuer
|
||||
WHERE projektarbeit_id=tbl_projektarbeit.projektarbeit_id
|
||||
AND betreuerart_kurzbz IN ('Zweitbetreuer', 'Zweitbegutachter') LIMIT 1) AS zweitbetreuer_betreuerart_kurzbz,
|
||||
(SELECT tbl_betreuerart.beschreibung
|
||||
FROM lehre.tbl_projektbetreuer JOIN lehre.tbl_betreuerart USING(betreuerart_kurzbz)
|
||||
WHERE projektarbeit_id=tbl_projektarbeit.projektarbeit_id
|
||||
AND betreuerart_kurzbz IN ('Zweitbetreuer', 'Zweitbegutachter', 'Senatsmitglied') LIMIT 1) AS zweitbetreuer_betreuerart_beschreibung,
|
||||
|
||||
tbl_betreuerart.betreuerart_kurzbz,
|
||||
person_id as bperson_id,
|
||||
projektarbeit_id,
|
||||
lehre.tbl_projekttyp.bezeichnung as projekttypbezeichnung,
|
||||
lehre.tbl_lehreinheit.studiensemester_kurzbz,
|
||||
lehre.tbl_lehrveranstaltung.studiengang_kz,
|
||||
public.tbl_studiengang.kurzbzlang,
|
||||
lehre.tbl_projektbetreuer.note as note,
|
||||
public.tbl_mitarbeiter.mitarbeiter_uid,
|
||||
lehre.tbl_projektarbeit.titel as titel,
|
||||
lehre.tbl_projektarbeit.sprache as sprache,
|
||||
lehre.tbl_projektarbeit.seitenanzahl as seitenanzahl,
|
||||
lehre.tbl_projektarbeit.kontrollschlagwoerter as kontrollschlagwoerter,
|
||||
lehre.tbl_projektarbeit.schlagwoerter as schlagwoerter,
|
||||
lehre.tbl_projektarbeit.schlagwoerter_en as schlagwoerter_en,
|
||||
lehre.tbl_projektarbeit.abstract as abstract,
|
||||
lehre.tbl_projektarbeit.abstract_en as abstract_en,
|
||||
(SELECT abgeschicktvon FROM extension.tbl_projektarbeitsbeurteilung WHERE projektarbeit_id = tbl_projektarbeit.projektarbeit_id AND betreuer_person_id = tbl_projektbetreuer.person_id) AS babgeschickt,
|
||||
(SELECT abgeschicktvon FROM extension.tbl_projektarbeitsbeurteilung WHERE projektarbeit_id = tbl_projektarbeit.projektarbeit_id AND betreuerart_kurzbz IN ('Zweitbetreuer', 'Zweitbegutachter') LIMIT 1) AS zweitbetreuer_abgeschickt,
|
||||
(SELECT datum FROM campus.tbl_paabgabe WHERE paabgabetyp_kurzbz = 'end' AND abgabedatum IS NOT NULL AND projektarbeit_id = tbl_projektarbeit.projektarbeit_id LIMIT 1) AS abgegeben
|
||||
|
||||
FROM lehre.tbl_projektarbeit
|
||||
LEFT JOIN lehre.tbl_projektbetreuer USING(projektarbeit_id)
|
||||
LEFT JOIN public.tbl_person USING(person_id)
|
||||
LEFT JOIN public.tbl_benutzer USING(person_id)
|
||||
LEFT JOIN lehre.tbl_projekttyp USING (projekttyp_kurzbz)
|
||||
LEFT JOIN lehre.tbl_betreuerart USING(betreuerart_kurzbz)
|
||||
LEFT JOIN lehre.tbl_lehreinheit USING(lehreinheit_id)
|
||||
LEFT JOIN lehre.tbl_lehrveranstaltung USING(lehrveranstaltung_id)
|
||||
LEFT JOIN public.tbl_mitarbeiter ON(public.tbl_mitarbeiter.mitarbeiter_uid = public.tbl_benutzer.uid)
|
||||
LEFT JOIN public.tbl_studiengang USING(studiengang_kz)
|
||||
WHERE
|
||||
tbl_projektarbeit.student_uid = ? AND
|
||||
(projekttyp_kurzbz='Bachelor' OR projekttyp_kurzbz='Diplom')
|
||||
AND betreuerart_kurzbz IN ('Betreuer', 'Begutachter', 'Erstbegutachter', 'Senatsvorsitz')";
|
||||
|
||||
return $this->execReadOnlyQuery($betreuerQuery, array($studentUID));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a List of Projektarbeit Abgabetermin used by the student cis4 abgabetool.
|
||||
*/
|
||||
public function getProjektarbeitAbgabetermine($projektarbeit_id) {
|
||||
$qry ="SELECT campus.tbl_paabgabe.paabgabe_id,
|
||||
campus.tbl_paabgabe.projektarbeit_id,
|
||||
campus.tbl_paabgabe.fixtermin,
|
||||
campus.tbl_paabgabe.kurzbz,
|
||||
campus.tbl_paabgabe.datum,
|
||||
campus.tbl_paabgabetyp.paabgabetyp_kurzbz,
|
||||
campus.tbl_paabgabetyp.bezeichnung,
|
||||
campus.tbl_paabgabe.abgabedatum,
|
||||
campus.tbl_paabgabe.insertvon
|
||||
FROM campus.tbl_paabgabe JOIN campus.tbl_paabgabetyp USING(paabgabetyp_kurzbz)
|
||||
WHERE campus.tbl_paabgabe.projektarbeit_id = ?
|
||||
ORDER BY campus.tbl_paabgabe.datum";
|
||||
|
||||
return $this->execReadOnlyQuery($qry, array($projektarbeit_id));
|
||||
}
|
||||
|
||||
public function getProjektbetreuerAnrede($bperson_id) {
|
||||
$qry_betr="SELECT distinct trim(COALESCE(titelpre,'')||' '||COALESCE(vorname,'')||' '||COALESCE(nachname,'')||' '||COALESCE(titelpost,'')) as first,
|
||||
public.tbl_mitarbeiter.mitarbeiter_uid, anrede
|
||||
FROM public.tbl_person JOIN lehre.tbl_projektbetreuer ON(lehre.tbl_projektbetreuer.person_id=public.tbl_person.person_id)
|
||||
JOIN public.tbl_benutzer ON(public.tbl_benutzer.person_id=public.tbl_person.person_id)
|
||||
JOIN public.tbl_mitarbeiter ON(public.tbl_benutzer.uid=public.tbl_mitarbeiter.mitarbeiter_uid)
|
||||
WHERE public.tbl_person.person_id= ?";
|
||||
|
||||
return $this->execReadOnlyQuery($qry_betr, [$bperson_id]);
|
||||
|
||||
}
|
||||
|
||||
public function getProjektarbeitBenutzer($uid) {
|
||||
$qry="SELECT * FROM campus.vw_benutzer where uid=?";
|
||||
return $this->execReadOnlyQuery($qry, [$uid]);
|
||||
}
|
||||
|
||||
/**
|
||||
* Checks if mitarbeiter has a projektbetreuer zuordnung to student.
|
||||
*/
|
||||
public function checkZuordnung($studentUID, $maUID) {
|
||||
//oder Lektor mit Betreuung dieses Studenten
|
||||
$qry = "
|
||||
SELECT 1
|
||||
FROM
|
||||
lehre.tbl_projektarbeit
|
||||
JOIN lehre.tbl_projektbetreuer USING(projektarbeit_id)
|
||||
JOIN campus.vw_benutzer on(vw_benutzer.person_id=tbl_projektbetreuer.person_id)
|
||||
WHERE
|
||||
tbl_projektarbeit.student_uid = ? AND
|
||||
vw_benutzer.uid = ?";
|
||||
|
||||
return $this->execReadOnlyQuery($qry, array($studentUID, $maUID));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a List of Projektarbeiten of a mitarbeiter with zuordnung
|
||||
* used by the mitarbeiter cis4 abgabetool.
|
||||
*/
|
||||
public function getMitarbeiterProjektarbeiten($uid, $showAll){
|
||||
$qry = "SELECT
|
||||
*
|
||||
FROM
|
||||
(SELECT tbl_person.vorname, tbl_person.nachname, tbl_studiengang.typ, tbl_studiengang.kurzbz,
|
||||
tbl_projektarbeit.projekttyp_kurzbz, tbl_projekttyp.bezeichnung, tbl_projektarbeit.titel, tbl_projektarbeit.projektarbeit_id,
|
||||
tbl_projektbetreuer.betreuerart_kurzbz, tbl_betreuerart.beschreibung AS betreuerart_beschreibung,
|
||||
tbl_benutzer.uid, tbl_student.matrikelnr, tbl_lehreinheit.studiensemester_kurzbz
|
||||
FROM lehre.tbl_projektarbeit
|
||||
LEFT JOIN lehre.tbl_projektbetreuer using(projektarbeit_id)
|
||||
LEFT JOIN lehre.tbl_betreuerart using(betreuerart_kurzbz)
|
||||
LEFT JOIN public.tbl_benutzer on(uid=student_uid)
|
||||
LEFT JOIN public.tbl_student on(public.tbl_benutzer.uid=public.tbl_student.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 on(lehre.tbl_lehrveranstaltung.studiengang_kz=public.tbl_studiengang.studiengang_kz)
|
||||
LEFT JOIN lehre.tbl_projekttyp USING (projekttyp_kurzbz)
|
||||
WHERE (projekttyp_kurzbz='Bachelor' OR projekttyp_kurzbz='Diplom')
|
||||
AND tbl_projektbetreuer.person_id IN (SELECT person_id FROM public.tbl_benutzer
|
||||
WHERE public.tbl_benutzer.person_id=lehre.tbl_projektbetreuer.person_id
|
||||
AND public.tbl_benutzer.uid= ? )
|
||||
".($showAll?'':' AND public.tbl_benutzer.aktiv AND lehre.tbl_projektarbeit.note IS NULL ')."
|
||||
AND betreuerart_kurzbz IN ('Betreuer', 'Begutachter', 'Erstbegutachter', 'Zweitbegutachter', 'Erstbetreuer', 'Senatsvorsitz', 'Senatsmitglied')
|
||||
ORDER BY tbl_projektarbeit.projektarbeit_id, betreuerart_kurzbz desc) as xy
|
||||
ORDER BY nachname;";
|
||||
|
||||
return $this->execReadOnlyQuery($qry, array($uid));
|
||||
}
|
||||
|
||||
/**
|
||||
* Fetch Student info relevant to a projektarbeit_id
|
||||
*/
|
||||
public function getStudentInfoForProjektarbeitId($projektarbeit_id) {
|
||||
|
||||
$qry = "SELECT *
|
||||
FROM campus.vw_student
|
||||
WHERE uid IN(
|
||||
SELECT student_uid
|
||||
FROM lehre.tbl_projektarbeit
|
||||
WHERE projektarbeit_id = ? )";
|
||||
|
||||
return $this->execReadOnlyQuery($qry, array($projektarbeit_id));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -709,24 +709,38 @@ class Studiengang_model extends DB_Model
|
||||
if (isError($stg_ltg))
|
||||
return $stg_ltg;
|
||||
$stg_ltg = getData($stg_ltg) ?: [];
|
||||
$stg_ltg = array_values(array_filter($stg_ltg, function($stg_leitung){
|
||||
return $stg_leitung->aktiv;
|
||||
}));
|
||||
$addFotoProperty($stg_ltg);
|
||||
|
||||
$gf_ltg = $this->BenutzerfunktionModel->getBenutzerFunktionenDetailed('gLtg', $stg_obj->oe_kurzbz);
|
||||
if (isError($gf_ltg))
|
||||
return $gf_ltg;
|
||||
$gf_ltg = getData($gf_ltg) ?: [];
|
||||
$gf_ltg = array_values(array_filter($gf_ltg, function($gf_leitung){
|
||||
return $gf_leitung->aktiv;
|
||||
}));
|
||||
$addEmailProperty($gf_ltg);
|
||||
$addFotoProperty($gf_ltg);
|
||||
|
||||
$stv_ltg = $this->BenutzerfunktionModel->getBenutzerFunktionenDetailed('stvLtg', $stg_obj->oe_kurzbz);
|
||||
if (isError($stv_ltg))
|
||||
return $stv_ltg;
|
||||
$stv_ltg = getData($stv_ltg) ?: [];
|
||||
$stv_ltg = array_values(array_filter($stv_ltg, function($stv_leitung){
|
||||
return $stv_leitung->aktiv;
|
||||
}));
|
||||
$addEmailProperty($stv_ltg);
|
||||
|
||||
$addFotoProperty($stv_ltg);
|
||||
|
||||
$ass = $this->BenutzerfunktionModel->getBenutzerFunktionenDetailed('ass', $stg_obj->oe_kurzbz);
|
||||
if (isError($ass))
|
||||
return $ass;
|
||||
$ass = getData($ass) ?: [];
|
||||
$ass = array_values(array_filter($ass, function($assistenz){
|
||||
return $assistenz->aktiv;
|
||||
}));
|
||||
$addEmailProperty($ass);
|
||||
$addFotoProperty($ass);
|
||||
|
||||
@@ -734,6 +748,9 @@ class Studiengang_model extends DB_Model
|
||||
if (isError($hochschulvertr))
|
||||
return $hochschulvertr;
|
||||
$hochschulvertr = getData($hochschulvertr) ?: [];
|
||||
$hochschulvertr = array_values(array_filter($hochschulvertr, function($hochschul_vertreter){
|
||||
return $hochschul_vertreter->aktiv;
|
||||
}));
|
||||
$addEmailProperty($hochschulvertr);
|
||||
|
||||
|
||||
@@ -741,6 +758,9 @@ class Studiengang_model extends DB_Model
|
||||
if (isError($stdv))
|
||||
return $stdv;
|
||||
$stdv = getData($stdv) ?: [];
|
||||
$stdv = array_values(array_filter($stdv, function($std_vertreter){
|
||||
return $std_vertreter->aktiv;
|
||||
}));
|
||||
$addEmailProperty($stdv);
|
||||
|
||||
|
||||
@@ -748,6 +768,9 @@ class Studiengang_model extends DB_Model
|
||||
if (isError($jahrgangsvertr))
|
||||
return $jahrgangsvertr;
|
||||
$jahrgangsvertr = getData($jahrgangsvertr) ?: [];
|
||||
$jahrgangsvertr = array_values(array_filter($jahrgangsvertr, function($jahrgang_vertreter){
|
||||
return $jahrgang_vertreter->aktiv;
|
||||
}));
|
||||
$addEmailProperty($jahrgangsvertr);
|
||||
|
||||
|
||||
|
||||
@@ -21,7 +21,7 @@ class Reservierung_model extends DB_Model
|
||||
public function getReservierungen($start_date, $end_date, $ort_kurzbz = null)
|
||||
{
|
||||
|
||||
$stundenplan_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),'/'))
|
||||
@@ -46,7 +46,7 @@ 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)? $stundenplan_reservierungen_query:$raum_reservierungen_query;
|
||||
$subquery = is_null($ort_kurzbz)? $lvplan_reservierungen_query:$raum_reservierungen_query;
|
||||
|
||||
$query_result= $this->execReadOnlyQuery("
|
||||
SELECT
|
||||
@@ -89,7 +89,7 @@ class Reservierung_model extends DB_Model
|
||||
JOIN lehre.tbl_stunde ON lehre.tbl_stunde.stunde = res.stunde
|
||||
WHERE res.uid = ? AND datum >= ? AND datum <= ?";
|
||||
|
||||
// $subquery = is_null($ort_kurzbz)? $stundenplan_reservierungen_query:$raum_reservierungen_query;
|
||||
// $subquery = is_null($ort_kurzbz)? $lvplan_reservierungen_query:$raum_reservierungen_query;
|
||||
$subquery = $raum_reservierungen_query;
|
||||
|
||||
|
||||
|
||||
@@ -11,4 +11,19 @@ class Stunde_model extends DB_Model
|
||||
$this->dbTable = 'lehre.tbl_stunde';
|
||||
$this->pk = 'stunde';
|
||||
}
|
||||
|
||||
/**
|
||||
* $time needs to be of PGSQL TIME format
|
||||
*/
|
||||
public function getStundeForTime($time) {
|
||||
$query = "
|
||||
SELECT min(stunde) as stunde FROM (
|
||||
SELECT stunde, extract(epoch from (beginn-?)) AS delta FROM lehre.tbl_stunde
|
||||
UNION
|
||||
SELECT stunde, extract(epoch from (ende-?)) AS delta FROM lehre.tbl_stunde
|
||||
) foo WHERE delta>=0
|
||||
";
|
||||
|
||||
return $this->execReadOnlyQuery($query, [$time, $time]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -177,7 +177,7 @@ class Stundenplan_model extends DB_Model
|
||||
|
||||
) as subquery
|
||||
|
||||
GROUP BY unr, datum, beginn, ende, ort_kurzbz, titel, lehrform, lehrfach, lehrfach_bez, organisationseinheit, farbe, lehrveranstaltung_id
|
||||
GROUP BY unr, datum, beginn, ende, titel, lehrform, lehrfach, lehrfach_bez, organisationseinheit, farbe, lehrveranstaltung_id
|
||||
|
||||
ORDER BY datum, beginn
|
||||
");
|
||||
@@ -327,7 +327,7 @@ class Stundenplan_model extends DB_Model
|
||||
|
||||
) as subquery
|
||||
|
||||
GROUP BY unr, datum, beginn, ende, ort_kurzbz, titel, lehrform, lehrfach, lehrfach_bez, organisationseinheit, farbe, lehrveranstaltung_id
|
||||
GROUP BY unr, datum, beginn, ende, titel, lehrform, lehrfach, lehrfach_bez, organisationseinheit, farbe, lehrveranstaltung_id
|
||||
|
||||
ORDER BY datum, beginn
|
||||
", [$start_date, $end_date, $lv_id]);
|
||||
@@ -384,7 +384,7 @@ class Stundenplan_model extends DB_Model
|
||||
|
||||
) as subquery
|
||||
|
||||
GROUP BY unr, datum, beginn, ende, ort_kurzbz, titel, lehrform, lehrfach, lehrfach_bez, organisationseinheit, farbe, lehrveranstaltung_id
|
||||
GROUP BY unr, datum, beginn, ende, titel, lehrform, lehrfach, lehrfach_bez, organisationseinheit, farbe, lehrveranstaltung_id
|
||||
|
||||
ORDER BY datum, beginn", [$start_date, $end_date, $ma_uid]);
|
||||
}
|
||||
|
||||
@@ -2,7 +2,8 @@
|
||||
$includesArray = array(
|
||||
'title' => 'FH-Complete',
|
||||
'bootstrap5' => true,
|
||||
'fontawesome6' => true
|
||||
'fontawesome6' => true,
|
||||
'customJSs' => 'public/js/helpers/ColorThemeSetting.js'
|
||||
);
|
||||
|
||||
$this->load->view('templates/FHC-Header', $includesArray);
|
||||
|
||||
@@ -5,25 +5,32 @@ $includesArray = array(
|
||||
'axios027' => true,
|
||||
'bootstrap5' => true,
|
||||
'fontawesome6' => true,
|
||||
'tabulator5' => true,
|
||||
'tabulator5' => true, // TODO: upgrade to 6 when available
|
||||
'vue3' => true,
|
||||
'primevue3' => true,
|
||||
'skipID' => '#fhccontent',
|
||||
'vuedatepicker11' => true,
|
||||
'customCSSs' => array(
|
||||
'public/css/components/verticalsplit.css',
|
||||
'public/css/components/searchbar/searchbar.css',
|
||||
'public/css/Fhc.css',
|
||||
'public/css/components/dashboard.css',
|
||||
'public/css/components/calendar.css',
|
||||
//'public/css/components/calendar.css', <= imported in dashboard.css
|
||||
'public/css/components/Sprachen.css',
|
||||
'public/css/components/MyLv.css',
|
||||
'public/css/components/FilterComponent.css',
|
||||
'public/css/components/Profil.css',
|
||||
'public/css/components/FormUnderline.css',
|
||||
'public/css/Cis4/Cms.css',
|
||||
'public/css/Cis4/Studium.css',
|
||||
),
|
||||
'customJSs' => array(
|
||||
'vendor/npm-asset/primevue/accordion/accordion.js',
|
||||
'vendor/npm-asset/primevue/accordiontab/accordiontab.js'
|
||||
'vendor/npm-asset/primevue/accordion/accordion.min.js',
|
||||
'vendor/npm-asset/primevue/accordiontab/accordiontab.min.js',
|
||||
'vendor/npm-asset/primevue/inputnumber/inputnumber.min.js',
|
||||
'vendor/npm-asset/primevue/textarea/textarea.min.js',
|
||||
'vendor/npm-asset/primevue/checkbox/checkbox.min.js',
|
||||
'vendor/moment/luxonjs/luxon.min.js'
|
||||
),
|
||||
'customJSModules' => array(
|
||||
'public/js/apps/Dashboard/Fhc.js'
|
||||
@@ -33,7 +40,7 @@ $includesArray = array(
|
||||
|
||||
$this->load->view('templates/CISVUE-Header', $includesArray);
|
||||
?>
|
||||
<div id="fhccontent" route=<?php echo $route ?>>
|
||||
<div id="fhccontent" class="h-100" route=<?php echo $route ?>>
|
||||
<router-view
|
||||
:view-data='<?php echo json_encode($viewData) ?>'
|
||||
></router-view>
|
||||
|
||||
@@ -9,7 +9,6 @@
|
||||
|
||||
<i class="me-2 fa fa-lg fa-info-circle" aria-hidden="true"></i> 
|
||||
<?php echo $this->p->t('anrechnung', 'requestAnrechnungInfoFristenTitle'); ?>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</h2>
|
||||
@@ -80,4 +79,4 @@
|
||||
</div>
|
||||
</div>
|
||||
<?php endif; ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<?php
|
||||
$this->load->config('theme');
|
||||
$includesArray = array(
|
||||
'title' => $title ?? 'FH-Complete',
|
||||
'vue3' => true,
|
||||
@@ -10,7 +11,8 @@ $includesArray = array(
|
||||
'public/js/apps/Cis.js'
|
||||
], $customJSModules ?? []),
|
||||
'customCSSs' => array_merge([
|
||||
'public/css/Cis4/Cis.css'
|
||||
'public/css/Cis4/Cis.css',
|
||||
$this->config->item('theme_css'),
|
||||
], $customCSSs ?? [])
|
||||
);
|
||||
|
||||
@@ -26,7 +28,7 @@ $this->load->view('templates/FHC-Header', $includesArray);
|
||||
<header id="cis-header" class="navbar-dark">
|
||||
<cis-menu
|
||||
root-url="<?= site_url(''); ?>"
|
||||
logo-url="<?= base_url('/public/images/logo-300x160.png'); ?>"
|
||||
logo-url="<?= base_url($this->config->item('theme_logo')); ?>"
|
||||
avatar-url="<?= site_url('Cis/Pub/bild/person/' . getAuthPersonId()); ?>"
|
||||
logout-url="<?= site_url('Cis/Auth/logout'); ?>"
|
||||
:searchbaroptions="searchbaroptions"
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
$tinymce5 = isset($tinymce5) ? $tinymce5 : false;
|
||||
$vue3 = isset($vue3) ? $vue3 : false;
|
||||
$primevue3 = isset($primevue3) ? $primevue3 : false;
|
||||
$vuedatepicker11 = isset($vuedatepicker11) ? $vuedatepicker11 : false;
|
||||
|
||||
// Hooks
|
||||
$addons = isset($addons) ? $addons : false;
|
||||
|
||||
@@ -155,6 +155,8 @@
|
||||
generateJSsInclude('vendor/npm-asset/primevue/tieredmenu/tieredmenu.min.js');
|
||||
}
|
||||
|
||||
if($vuedatepicker11) generateJSsInclude('vendor/vuejs/vuedatepicker_js11/vue-datepicker.iife.js');
|
||||
|
||||
// --------------------------------------------------------------------------------------------------------
|
||||
// From public folder
|
||||
|
||||
@@ -184,11 +186,13 @@
|
||||
|
||||
// User Defined Fields
|
||||
if ($udfs === true) generateJSsInclude('public/js/UDFWidget.js');
|
||||
|
||||
|
||||
// Load addon hooks JS
|
||||
// NOTE: keep it as the last but one
|
||||
if ($addons === true) generateAddonsJSsInclude($calledPath.'/'.$calledMethod);
|
||||
|
||||
|
||||
|
||||
// Eventually required JS
|
||||
// NOTE: keep it as the latest
|
||||
generateJSsInclude($customJSs);
|
||||
|
||||
@@ -9,12 +9,14 @@
|
||||
$title = isset($title) ? $title : null;
|
||||
$refresh = isset($refresh) ? $refresh : null;
|
||||
$customCSSs = isset($customCSSs) ? $customCSSs : null;
|
||||
$skipID = isset($skipID) ? $skipID : null;
|
||||
?>
|
||||
<!-- Header start -->
|
||||
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<head>
|
||||
|
||||
<title><?php printPageTitle($title); ?></title>
|
||||
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
@@ -95,7 +97,12 @@
|
||||
generateCSSsInclude('vendor/npm-asset/primeicons/primeicons.css');
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------------------------------------------
|
||||
if ($vuedatepicker11 === true)
|
||||
{
|
||||
generateCSSsInclude('vendor/vuejs/vuedatepicker_css11/main.css');
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------------------------------------------
|
||||
// From public folder
|
||||
|
||||
// AjaxLib CSS
|
||||
@@ -131,5 +138,7 @@
|
||||
</head>
|
||||
<body>
|
||||
|
||||
<?php if($skipID) generateSkipLink($skipID); ?>
|
||||
|
||||
<!-- Header end -->
|
||||
|
||||
|
||||
+40
-4
@@ -319,9 +319,9 @@
|
||||
"type": "package",
|
||||
"package": {
|
||||
"name": "twbs/bootstrap5",
|
||||
"version": "5.1.3",
|
||||
"version": "5.3.3",
|
||||
"dist": {
|
||||
"url": "https://github.com/twbs/bootstrap/archive/refs/tags/v5.1.3.zip",
|
||||
"url": "https://github.com/twbs/bootstrap/archive/refs/tags/v5.3.3.zip",
|
||||
"type": "zip"
|
||||
}
|
||||
}
|
||||
@@ -381,6 +381,28 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "package",
|
||||
"package": {
|
||||
"name": "vuejs/vuedatepicker_js11",
|
||||
"version": "11.0.1",
|
||||
"dist": {
|
||||
"url": "https://unpkg.com/@vuepic/vue-datepicker@11.0.1/dist/vue-datepicker.iife.js",
|
||||
"type": "file"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "package",
|
||||
"package": {
|
||||
"name": "vuejs/vuedatepicker_css11",
|
||||
"version": "11.0.1",
|
||||
"dist": {
|
||||
"url": "https://unpkg.com/@vuepic/vue-datepicker@11.0.1/dist/main.css",
|
||||
"type": "file"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "package",
|
||||
"package": {
|
||||
@@ -392,6 +414,17 @@
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "package",
|
||||
"package": {
|
||||
"name": "moment/luxonjs",
|
||||
"version": "3.6.1",
|
||||
"dist": {
|
||||
"url": "https://unpkg.com/luxon@3.6.1/build/global/luxon.min.js",
|
||||
"type": "file"
|
||||
}
|
||||
}
|
||||
},
|
||||
{
|
||||
"type": "composer",
|
||||
"url": "https://asset-packagist.org"
|
||||
@@ -440,6 +473,7 @@
|
||||
|
||||
"michelf/php-markdown": "1.5.0",
|
||||
"ml/json-ld": "1.*",
|
||||
"moment/luxonjs": "3.6.1",
|
||||
"moment/momentjs": "2.24.0",
|
||||
"mottie/tablesorter": "2.*",
|
||||
|
||||
@@ -463,12 +497,14 @@
|
||||
"tinymce/tinymce5": "5.10.*",
|
||||
"tomazdragar/simplecropper": "1.0",
|
||||
"twbs/bootstrap3": "3.4.*",
|
||||
"twbs/bootstrap5": "5.1.*",
|
||||
"twbs/bootstrap5": "5.3.*",
|
||||
|
||||
"vuejs/vuejs3": "3.3.8",
|
||||
"vuejs/vuerouter4": "4.1.3",
|
||||
"vuejs/vuedatepicker_js": "7.2.0",
|
||||
"vuejs/vuedatepicker_css": "7.2.0"
|
||||
"vuejs/vuedatepicker_css": "7.2.0",
|
||||
"vuejs/vuedatepicker_js11": "11.0.1",
|
||||
"vuejs/vuedatepicker_css11": "11.0.1"
|
||||
|
||||
},
|
||||
"config": {
|
||||
|
||||
Generated
+30
-3
@@ -4,7 +4,7 @@
|
||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||
"This file is @generated automatically"
|
||||
],
|
||||
"content-hash": "4d532e48e895cb864fb89170e18e2a3d",
|
||||
"content-hash": "1de37a74ba51a66057eb2712b21340c8",
|
||||
"packages": [
|
||||
{
|
||||
"name": "afarkas/html5shiv",
|
||||
@@ -1296,6 +1296,15 @@
|
||||
},
|
||||
"time": "2022-09-29T08:45:17+00:00"
|
||||
},
|
||||
{
|
||||
"name": "moment/luxonjs",
|
||||
"version": "3.6.1",
|
||||
"dist": {
|
||||
"type": "file",
|
||||
"url": "https://unpkg.com/luxon@3.6.1/build/global/luxon.min.js"
|
||||
},
|
||||
"type": "library"
|
||||
},
|
||||
{
|
||||
"name": "moment/momentjs",
|
||||
"version": "2.24.0",
|
||||
@@ -1784,10 +1793,10 @@
|
||||
},
|
||||
{
|
||||
"name": "twbs/bootstrap5",
|
||||
"version": "5.1.3",
|
||||
"version": "5.3.3",
|
||||
"dist": {
|
||||
"type": "zip",
|
||||
"url": "https://github.com/twbs/bootstrap/archive/refs/tags/v5.1.3.zip"
|
||||
"url": "https://github.com/twbs/bootstrap/archive/refs/tags/v5.3.3.zip"
|
||||
},
|
||||
"type": "library"
|
||||
},
|
||||
@@ -1868,6 +1877,15 @@
|
||||
},
|
||||
"type": "library"
|
||||
},
|
||||
{
|
||||
"name": "vuejs/vuedatepicker_css11",
|
||||
"version": "11.0.1",
|
||||
"dist": {
|
||||
"type": "file",
|
||||
"url": "https://unpkg.com/@vuepic/vue-datepicker@11.0.1/dist/main.css"
|
||||
},
|
||||
"type": "library"
|
||||
},
|
||||
{
|
||||
"name": "vuejs/vuedatepicker_js",
|
||||
"version": "7.2.0",
|
||||
@@ -1877,6 +1895,15 @@
|
||||
},
|
||||
"type": "library"
|
||||
},
|
||||
{
|
||||
"name": "vuejs/vuedatepicker_js11",
|
||||
"version": "11.0.1",
|
||||
"dist": {
|
||||
"type": "file",
|
||||
"url": "https://unpkg.com/@vuepic/vue-datepicker@11.0.1/dist/vue-datepicker.iife.js"
|
||||
},
|
||||
"type": "library"
|
||||
},
|
||||
{
|
||||
"name": "vuejs/vuejs3",
|
||||
"version": "3.3.8",
|
||||
|
||||
+331
-56
@@ -1,59 +1,238 @@
|
||||
/* basic */
|
||||
@import '../components/searchbar/searchbar.css';
|
||||
@import '../components/Sprachen.css';
|
||||
@import './Cis/Calendar.css';
|
||||
|
||||
html {
|
||||
font-size: 0.875em;
|
||||
}
|
||||
|
||||
/* variables */
|
||||
:root {
|
||||
--fhc-cis-primary: #00649c;
|
||||
--fhc-cis-primary-hover: #005585;
|
||||
--fhc-cis-header-px: 1rem;
|
||||
--fhc-cis-header-py: .5rem;
|
||||
--fhc-cis-main-px: 1.5rem;
|
||||
--fhc-cis-main-py: 1.5rem;
|
||||
--fhc-cis-menu-lvl-1-bg: #00649c;
|
||||
--fhc-cis-menu-lvl-1-color: #fff;
|
||||
--fhc-cis-menu-lvl-1-bg-hover: #005585;
|
||||
--fhc-cis-menu-lvl-1-color-hover: #fff;
|
||||
--fhc-cis-menu-lvl-2-bg: #343a40;
|
||||
--fhc-cis-menu-lvl-2-color: #fff;
|
||||
--fhc-cis-menu-lvl-2-bg-hover: #2c3136;
|
||||
--fhc-cis-menu-lvl-2-color-hover: #fff;
|
||||
--fhc-cis-menu-lvl-2-color-active: #292b2a;
|
||||
--fhc-cis-menu-lvl-3-bg: #72777A;
|
||||
--fhc-cis-menu-lvl-3-color: #fff;
|
||||
--fhc-cis-menu-lvl-3-bg-hover: #616568;
|
||||
--fhc-cis-menu-lvl-3-color-hover: #fff;
|
||||
--fhc-cis-menu-lvl-4-bg: #ced4da;
|
||||
--fhc-cis-menu-lvl-4-color: #000;
|
||||
--fhc-cis-menu-lvl-4-bg-hover: #d5dae0;
|
||||
--fhc-cis-menu-lvl-4-color-hover: #000;
|
||||
--fhc-cis-menu-lvl-5-bg: #e9ecef;
|
||||
--fhc-cis-menu-lvl-5-color: #000;
|
||||
--fhc-cis-menu-lvl-5-bg-hover: #eceff1;
|
||||
--fhc-cis-menu-lvl-5-color-hover: #000;
|
||||
--fhc-cis-grade-positive: rgb(0, 128, 0);
|
||||
--fhc-cis-grade-negative: rgb(128, 0, 0);
|
||||
.fhc-dark-bg{
|
||||
background-color: var(--fhc-dark);
|
||||
color:var(--fhc-light) !important;
|
||||
}
|
||||
|
||||
.fhc-dark-color {
|
||||
color: var(--fhc-dark);
|
||||
}
|
||||
|
||||
.fhc-dark-bg:hover{
|
||||
filter: brightness(120%);
|
||||
}
|
||||
|
||||
.fhc-primary{
|
||||
background-color: var(--fhc-primary) !important;
|
||||
color: var(--fhc-light) !important;
|
||||
}
|
||||
|
||||
.fhc-primary-color{
|
||||
color: var(--fhc-primary) !important;
|
||||
}
|
||||
|
||||
.fhc-primary-bg {
|
||||
background-color: var(--fhc-primary) !important;
|
||||
}
|
||||
|
||||
.fhc-primary-highlight-bg {
|
||||
background-color: var(--fhc-primary-highlight) !important;
|
||||
}
|
||||
|
||||
.fhc-primary-highlight-color {
|
||||
color: var(--fhc-primary-highlight) !important;
|
||||
}
|
||||
|
||||
.fhc-body-bg{
|
||||
background-color:var(--fhc-background) !important;
|
||||
}
|
||||
|
||||
.fhc-body-color{
|
||||
color: var(--fhc-text) !important;
|
||||
}
|
||||
|
||||
.fhc-secondary-bg{
|
||||
background-color: var(--fhc-tertiary) !important;
|
||||
}
|
||||
|
||||
.fhc-secondary-color {
|
||||
color: var(--fhc-tertiary) !important;
|
||||
}
|
||||
|
||||
.fhc-tertiary-bg{
|
||||
background-color: var(--fhc-secondary) !important;
|
||||
}
|
||||
|
||||
.fhc-tertiary-color {
|
||||
color: var(--fhc-secondary) !important;
|
||||
}
|
||||
|
||||
.fhc-fourth-bg {
|
||||
background-color: var(--fhc-fourth) !important;
|
||||
}
|
||||
|
||||
.fhc-fourth-color {
|
||||
color: var(--fhc-fourth) !important;
|
||||
}
|
||||
|
||||
.fhc-fifth-bg {
|
||||
background-color: var(--fhc-fifth) !important;
|
||||
}
|
||||
|
||||
.fhc-fifth-color {
|
||||
color: var(--fhc-fifth) !important;
|
||||
}
|
||||
|
||||
.fhc-body{
|
||||
color:var(--fhc-text);
|
||||
background-color: var(--fhc-background);
|
||||
border-color: var(--fhc-border);
|
||||
}
|
||||
|
||||
.fhc-secondary {
|
||||
color: var(--fhc-text);
|
||||
background-color: var(--fhc-tertiary);
|
||||
border-color: var(--fhc-border);
|
||||
}
|
||||
|
||||
.fhc-tertiary{
|
||||
color: var(--fhc-text);
|
||||
background-color: var(--fhc-secondary);
|
||||
border-color:var(--fhc-border);
|
||||
}
|
||||
|
||||
.fhc-link-color{
|
||||
color: var(--fhc-link);
|
||||
}
|
||||
|
||||
.fhc-text{
|
||||
color: var(--fhc-text) !important;
|
||||
}
|
||||
|
||||
.fhc-text-light{
|
||||
color: var(--fhc-light) !important;
|
||||
}
|
||||
|
||||
:root{
|
||||
/* sidebar colors */
|
||||
--fhc-cis-sidebar-bg: var(--fhc-secondary);
|
||||
--fhc-cis-menu-bg: var(--fhc-secondary);
|
||||
|
||||
--fhc-cis-header-px: 1rem;
|
||||
--fhc-cis-header-py: .5rem;
|
||||
--fhc-cis-main-px: 1.5rem;
|
||||
--fhc-cis-main-py: 1.5rem;
|
||||
|
||||
--fhc-cis-menu-lvl-1-bg: var(--fhc-primary);
|
||||
--fhc-cis-menu-lvl-1-color: var(--fhc-light);
|
||||
--fhc-cis-menu-lvl-1-bg-hover: var(--fhc-primary-highlight);
|
||||
--fhc-cis-menu-lvl-1-color-hover: var(--fhc-light);
|
||||
|
||||
--fhc-cis-menu-lvl-2-bg: var(--fhc-secondary);
|
||||
--fhc-cis-menu-lvl-2-color: var(--fhc-text);
|
||||
--fhc-cis-menu-lvl-2-bg-hover: var(--fhc-secondary-highlight);
|
||||
--fhc-cis-menu-lvl-2-color-hover: var(--fhc-text);
|
||||
|
||||
--fhc-cis-menu-lvl-3-bg: var(--fhc-tertiary);
|
||||
--fhc-cis-menu-lvl-3-color: var(--fhc-text);
|
||||
--fhc-cis-menu-lvl-3-bg-hover: var(--fhc-tertiary-highlight);
|
||||
--fhc-cis-menu-lvl-3-color-hover: var(--fhc-text);
|
||||
|
||||
--fhc-cis-menu-lvl-4-bg: var(--fhc-fourth);
|
||||
--fhc-cis-menu-lvl-4-color: var(--fhc-text);
|
||||
--fhc-cis-menu-lvl-4-bg-hover: var(--fhc-fourth-highlight);
|
||||
--fhc-cis-menu-lvl-4-color-hover: var(--fhc-text);
|
||||
|
||||
--fhc-cis-menu-lvl-5-bg: var(--fhc-fifth);
|
||||
--fhc-cis-menu-lvl-5-color: var(--fhc-text);
|
||||
--fhc-cis-menu-lvl-5-bg-hover: var(--fhc-fifth-highlight);
|
||||
--fhc-cis-menu-lvl-5-color-hover: var(--fhc-text);
|
||||
--fhc-cis-grade-positive: var(--fhc-success);
|
||||
--fhc-cis-grade-negative: var(--fhc-danger);
|
||||
}
|
||||
|
||||
#themeSwitch i{
|
||||
color: var(fhc-light) !important;
|
||||
}
|
||||
|
||||
@media (min-width: 992px) {
|
||||
:root {
|
||||
--fhc-cis-menu-width: 250px;
|
||||
--fhc-cis-header-height: 60px;
|
||||
--fhc-cis-menu-bg: #72777A;
|
||||
}
|
||||
:root {
|
||||
--fhc-cis-menu-width: 250px;
|
||||
--fhc-cis-header-height: 60px;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 991.98px) {
|
||||
:root {
|
||||
--fhc-cis-menu-width: 400px;
|
||||
--fhc-cis-header-height: 40px;
|
||||
--fhc-cis-menu-bg: #343a40;
|
||||
}
|
||||
:root {
|
||||
--fhc-cis-menu-width: 400px;
|
||||
--fhc-cis-header-height: 40px;
|
||||
}
|
||||
}
|
||||
|
||||
/* lvMenu entry style */
|
||||
#cis-menu .menu-entry {
|
||||
color: var(--fhc-text);
|
||||
}
|
||||
|
||||
#cis-menu .menu-entry .submenu{
|
||||
background-color: var(--fhc-background-highlight);
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
#cis-menu .menu-entry:hover .submenu{
|
||||
background-color: var(--fhc-primary-highlight);
|
||||
color: inherit;
|
||||
}
|
||||
|
||||
#cis-menu .menu-entry:hover .submenu:hover{
|
||||
color: var(--fhc-dark);
|
||||
}
|
||||
|
||||
#cis-menu [disabled="true"].menu-entry .submenu{
|
||||
opacity: 0.5;
|
||||
background-color: var(--fhc-secondary)
|
||||
}
|
||||
|
||||
[disabled="true"].menu-entry {
|
||||
pointer-events: none;
|
||||
cursor: default;
|
||||
background-color: var(--fhc-disabled) !important;
|
||||
color: var(--fhc-dark) !important;
|
||||
opacity: 0.75;
|
||||
-webkit-touch-callout: none;
|
||||
/* iOS Safari */
|
||||
-webkit-user-select: none;
|
||||
/* Safari */
|
||||
-khtml-user-select: none;
|
||||
/* Konqueror HTML */
|
||||
-moz-user-select: none;
|
||||
/* Old versions of Firefox */
|
||||
-ms-user-select: none;
|
||||
/* Internet Explorer/Edge */
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
#cis-menu .menu-entry:hover{
|
||||
background-color: var(--fhc-primary);
|
||||
color:var(--fhc-light);
|
||||
}
|
||||
|
||||
/* lvMenu entry disabled style */
|
||||
[disabled="true"].menu-entry {
|
||||
pointer-events: none;
|
||||
cursor: default;
|
||||
background-color: #dadada !important;
|
||||
color: black !important;
|
||||
-webkit-touch-callout: none;
|
||||
/* iOS Safari */
|
||||
-webkit-user-select: none;
|
||||
/* Safari */
|
||||
-khtml-user-select: none;
|
||||
/* Konqueror HTML */
|
||||
-moz-user-select: none;
|
||||
/* Old versions of Firefox */
|
||||
-ms-user-select: none;
|
||||
/* Internet Explorer/Edge */
|
||||
user-select: none;
|
||||
}
|
||||
|
||||
/* buttons */
|
||||
#cis-header .btn-level-1,
|
||||
@@ -195,6 +374,7 @@ html {
|
||||
|
||||
/* searchbar */
|
||||
#nav-search {
|
||||
background-color: var(--fhc-primary);
|
||||
z-index: 1;
|
||||
}
|
||||
#nav-search.me-3 {
|
||||
@@ -223,9 +403,16 @@ html {
|
||||
}
|
||||
|
||||
#cis-main {
|
||||
color: var(--fhc-text);
|
||||
background-color: var(--fhc-background);
|
||||
border-color: var(--fhc-border);
|
||||
padding: var(--fhc-cis-main-py) var(--fhc-cis-main-px);
|
||||
}
|
||||
|
||||
#cis-main .fa-arrow-up-right-from-square {
|
||||
color: var(--fhc-link) !important;
|
||||
}
|
||||
|
||||
#nav-main-sticky {
|
||||
max-height: calc(100vh - var(--fhc-cis-header-height));
|
||||
}
|
||||
@@ -245,10 +432,6 @@ html {
|
||||
display: flex;
|
||||
}
|
||||
|
||||
.fhc-active {
|
||||
background-color: var(--fhc-cis-menu-lvl-2-color-active) !important;
|
||||
}
|
||||
|
||||
.fhc-seperator {
|
||||
position: relative;
|
||||
}
|
||||
@@ -261,7 +444,7 @@ html {
|
||||
margin-left: 12.5%;
|
||||
width: 75%; /* Full width of the parent element */
|
||||
height: 1px; /* Height of the border */
|
||||
background: linear-gradient(to right, #ffffff, var(--fhc-cis-primary), #ffffff);
|
||||
background: linear-gradient(to right, var(--fhc-background), var(--fhc-primary), var(--fhc-background));
|
||||
opacity: 0.8; /* Adjust opacity for a subtle fade effect */
|
||||
}
|
||||
|
||||
@@ -295,7 +478,7 @@ html {
|
||||
left: 0;
|
||||
height: var(--fhc-cis-header-height);
|
||||
width: var(--fhc-cis-menu-width);
|
||||
background-color: var(--fhc-cis-primary);
|
||||
background-color: var(--fhc-primary);
|
||||
padding: var(--fhc-cis-header-py) var(--fhc-cis-header-px);
|
||||
z-index: 2;
|
||||
}
|
||||
@@ -327,7 +510,7 @@ html {
|
||||
}
|
||||
#nav-main-toggle .collapsed .fa-arrow-circle-left {
|
||||
transform: scaleX(-1);
|
||||
color: var(--bs-dark);
|
||||
color: var(--fhc-black-40);
|
||||
}
|
||||
#nav-search {
|
||||
position: fixed;
|
||||
@@ -345,7 +528,7 @@ html {
|
||||
#nav-user-btn {
|
||||
border-width: 0;
|
||||
padding: var(--fhc-cis-header-py) var(--fhc-cis-header-px);
|
||||
background-color: var(--fhc-cis-primary);
|
||||
background-color: var(--fhc-primary);
|
||||
}
|
||||
#nav-user-btn img {
|
||||
object-fit: contain;
|
||||
@@ -355,7 +538,7 @@ html {
|
||||
#nav-user-menu {
|
||||
position: absolute;
|
||||
min-width: var(--fhc-cis-menu-width);
|
||||
background-color: var(--fhc-cis-menu-lvl-2-bg);
|
||||
background-color: var(--fhc-dark);
|
||||
}
|
||||
|
||||
#nav-user-menu img {
|
||||
@@ -385,12 +568,13 @@ html {
|
||||
@media (max-width: 991.98px) {
|
||||
#cis-main{
|
||||
padding: 0.75rem 0.75rem;
|
||||
height: calc(100vh - var(--fhc-cis-header-height));
|
||||
}
|
||||
#cis-main > :first-child {
|
||||
margin-top: var(--fhc-cis-header-height);
|
||||
}
|
||||
#cis-header {
|
||||
background-color: var(--fhc-cis-primary);
|
||||
background-color: var(--fhc-primary);
|
||||
height: var(--fhc-cis-header-height);
|
||||
position: fixed;
|
||||
width: 100vw;
|
||||
@@ -427,18 +611,23 @@ html {
|
||||
}
|
||||
#nav-user-menu {
|
||||
position: absolute;
|
||||
background-color: var(--fhc-cis-menu-lvl-2-bg);
|
||||
background-color: var(--fhc-dark);
|
||||
}
|
||||
#nav-main-menu {
|
||||
display: block;
|
||||
}
|
||||
}
|
||||
|
||||
#nav-main{
|
||||
background-color: var(--fhc-cis-sidebar-bg);
|
||||
}
|
||||
|
||||
/* Typography */
|
||||
.fhc-header {
|
||||
display: flex;
|
||||
justify-content: space-between;
|
||||
align-items: end;
|
||||
border-bottom: 1px solid #dee2e6;
|
||||
border-bottom: 1px solid var(--fhc-border);
|
||||
margin: 1rem 0;
|
||||
}
|
||||
.fhc-header > h1 {
|
||||
@@ -450,7 +639,7 @@ html {
|
||||
}
|
||||
}
|
||||
.fhc-header > h1 > small {
|
||||
color: #6c757d;
|
||||
color: var(--fhc-tertiary);
|
||||
font-size: 1rem;
|
||||
}
|
||||
.fhc-header > h1 > small:before {
|
||||
@@ -461,7 +650,7 @@ html {
|
||||
text-decoration: none;
|
||||
}
|
||||
.fhc-header > a:after {
|
||||
color: var(--bs-body-color);
|
||||
color: var(--fhc-text);
|
||||
content: "\f059";
|
||||
-moz-osx-font-smoothing: grayscale;
|
||||
-webkit-font-smoothing: antialiased;
|
||||
@@ -478,7 +667,7 @@ html {
|
||||
[disabled="true"].fhc-entry {
|
||||
pointer-events: none;
|
||||
cursor: default;
|
||||
background-color: #dadada !important;
|
||||
background-color: var(--fhc-disabled) !important;
|
||||
color: black !important;
|
||||
-webkit-touch-callout: none; /* iOS Safari */
|
||||
-webkit-user-select: none;/* Safari */
|
||||
@@ -579,4 +768,90 @@ html {
|
||||
|
||||
.dashboard-item {
|
||||
overscroll-behavior: none;
|
||||
}
|
||||
|
||||
.abgabe-zieldatum-border-red,
|
||||
.abgabe-zieldatum-border-yellow,
|
||||
.abgabe-zieldatum-border-pink,
|
||||
.abgabe-zieldatum-border-green {
|
||||
border: solid 3px lightgrey;
|
||||
}
|
||||
|
||||
.abgabe-zieldatum-border-red {
|
||||
border-color: red;
|
||||
}
|
||||
|
||||
.abgabe-zieldatum-border-yellow {
|
||||
border-color: yellow;
|
||||
}
|
||||
|
||||
.abgabe-zieldatum-border-pink {
|
||||
border-color: pink;
|
||||
}
|
||||
|
||||
.abgabe-zieldatum-border-green {
|
||||
border-color: green;
|
||||
}
|
||||
|
||||
.abgabe-zieldatum-overlay {
|
||||
top: 3px;
|
||||
right: 3px;
|
||||
}
|
||||
|
||||
.abgabe-zieldatum-border-red .abgabe-zieldatum-overlay {
|
||||
color: red;
|
||||
}
|
||||
|
||||
.abgabe-zieldatum-border-yellow .abgabe-zieldatum-overlay {
|
||||
color: yellow;
|
||||
}
|
||||
|
||||
.abgabe-zieldatum-border-pink .abgabe-zieldatum-overlay {
|
||||
color: pink;
|
||||
}
|
||||
|
||||
.abgabe-zieldatum-border-green .abgabe-zieldatum-overlay {
|
||||
color: green;
|
||||
}
|
||||
|
||||
.stgkontaktinfo {
|
||||
display: grid;
|
||||
grid-template-columns: 25px auto;
|
||||
word-wrap: anywhere;
|
||||
}
|
||||
|
||||
.mylv-semester-studiengang-lv .card-header {
|
||||
min-height: 55px;
|
||||
}
|
||||
|
||||
#lektorenContainer{
|
||||
display: grid;
|
||||
grid-template-columns: 1fr 1fr 1fr 1fr 1fr 1fr;
|
||||
|
||||
}
|
||||
|
||||
@media(max-width: 990px) {
|
||||
#lektorenContainer{
|
||||
grid-template-columns: 1fr 1fr 1fr;
|
||||
}
|
||||
}
|
||||
|
||||
@media(max-width: 575px) {
|
||||
#lektorenContainer {
|
||||
grid-template-columns: 1fr 1fr;
|
||||
}
|
||||
}
|
||||
|
||||
#cis-main .modal-header{
|
||||
background-color: var(--fhc-primary);
|
||||
color: var(--fhc-light);
|
||||
}
|
||||
|
||||
#cis-main .modal-header .btn-close{
|
||||
filter: invert(1);
|
||||
}
|
||||
|
||||
#cis-main .modal-footer {
|
||||
background-color: var(--fhc-secondary);
|
||||
|
||||
}
|
||||
@@ -0,0 +1,13 @@
|
||||
/* mobile */
|
||||
@media (max-width: 991.98px) {
|
||||
.responsive-calendar .fhc-calendar-mode-week .fhc-calendar-base-label-day .short,
|
||||
.responsive-calendar .fhc-calendar-mode-week .fhc-calendar-base-label-dow .short,
|
||||
.responsive-calendar .fhc-calendar-mode-month .fhc-calendar-base-label-dow .short {
|
||||
display: block;
|
||||
}
|
||||
.responsive-calendar .fhc-calendar-mode-week .fhc-calendar-base-label-day .long,
|
||||
.responsive-calendar .fhc-calendar-mode-week .fhc-calendar-base-label-dow .long,
|
||||
.responsive-calendar .fhc-calendar-mode-month .fhc-calendar-base-label-dow .long {
|
||||
display: none;
|
||||
}
|
||||
}
|
||||
@@ -11,14 +11,14 @@
|
||||
margin-inline-start: 0 !important;
|
||||
}
|
||||
#cms a.btn-outline-primary {
|
||||
color: var(--fhc-cis-primary);
|
||||
border-color: var(--fhc-cis-primary);
|
||||
color: var(--fhc-primary);
|
||||
border-color: var(--fhc-primary);
|
||||
}
|
||||
#cms a.btn-outline-primary:hover,
|
||||
#cms a.btn-outline-primary:focus {
|
||||
color: #fff;
|
||||
background-color: var(--fhc-cis-primary);
|
||||
border-color: var(--fhc-cis-primary);
|
||||
background-color: var(--fhc-primary);
|
||||
border-color: var(--fhc-primary);
|
||||
}
|
||||
#cms a.btn-primary {
|
||||
color: var(--fhc-cis-menu-lvl-1-color);
|
||||
|
||||
@@ -0,0 +1,99 @@
|
||||
/* All */
|
||||
.weekPageContainer,
|
||||
.dayPageContainer {
|
||||
height: 100%;
|
||||
}
|
||||
|
||||
/* Feiertag */
|
||||
.feiertagEventContent {
|
||||
align-items: center;
|
||||
color: var(--fhc-light);
|
||||
}
|
||||
.monthPageContainer .feiertagEventContent,
|
||||
.weekPageContainer .feiertagEventContent,
|
||||
.dayPageContainer .feiertagEventContent {
|
||||
display: grid;
|
||||
grid-template-columns: auto 1fr;
|
||||
justify-items: center;
|
||||
}
|
||||
.listPageContainer .feiertagEventContent {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.monthPageContainer .feiertagEventContent #ferienEventIcon {
|
||||
margin: 0 .5rem;
|
||||
}
|
||||
.weekPageContainer .feiertagEventContent #ferienEventIcon,
|
||||
.dayPageContainer .feiertagEventContent #ferienEventIcon,
|
||||
.listPageContainer .feiertagEventContent #ferienEventIcon {
|
||||
margin: .5rem;
|
||||
}
|
||||
|
||||
.listPageContainer .feiertagEventContent #ferienEventTitle {
|
||||
flex-grow: 1;
|
||||
}
|
||||
|
||||
/* Lehreinheit */
|
||||
.monthPageContainer .lehreinheitEventContent {
|
||||
padding: 0!important;
|
||||
}
|
||||
.monthPageContainer .lehreinheitEventContent #lehreinheitEventHeader,
|
||||
.monthPageContainer .lehreinheitEventContent #lehreinheitLektoren,
|
||||
.monthPageContainer .lehreinheitEventContent #lektorEllipsis {
|
||||
display: none!important;
|
||||
}
|
||||
.monthPageContainer .lehreinheitEventContent #lehreinheitEventText {
|
||||
display: flex;
|
||||
justify-content: space-evenly;
|
||||
align-items: center;
|
||||
}
|
||||
.weekPageContainer .lehreinheitEventContent {
|
||||
display: grid;
|
||||
grid-template-columns: auto 1fr;
|
||||
}
|
||||
.weekPageContainer .lehreinheitEventContent #lehreinheitEventHeader {
|
||||
border-inline-end: solid 1px var(--bs-secondary);
|
||||
align-self: stretch;
|
||||
align-content: center;
|
||||
padding: .25em .5em .25em .25em;
|
||||
margin-inline-end: .25rem;
|
||||
}
|
||||
.weekPageContainer .lehreinheitEventContent #lehreinheitEventText {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-evenly;
|
||||
align-items: center;
|
||||
}
|
||||
.dayPageContainer .lehreinheitEventContent,
|
||||
.listPageContainer .lehreinheitEventContent {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
}
|
||||
.dayPageContainer .lehreinheitEventContent #lehreinheitEventHeader,
|
||||
.listPageContainer .lehreinheitEventContent #lehreinheitEventHeader {
|
||||
align-content: center;
|
||||
padding-inline-end: .5em;
|
||||
border-inline-end: solid 1px;
|
||||
margin-inline-end: .5em;
|
||||
}
|
||||
.dayPageContainer .lehreinheitEventContent #lehreinheitEventText,
|
||||
.listPageContainer .lehreinheitEventContent #lehreinheitEventText {
|
||||
flex: 1 1 auto;
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: .25em;
|
||||
justify-content: center;
|
||||
}
|
||||
.dayPageContainer .lehreinheitEventContent #lehreinheitTopic,
|
||||
.dayPageContainer .lehreinheitEventContent #lehreinheitOrt,
|
||||
.listPageContainer .lehreinheitEventContent #lehreinheitTopic,
|
||||
.listPageContainer .lehreinheitEventContent #lehreinheitOrt {
|
||||
flex: 0 0 100%;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
.fhc-roominformation .lehreinheitEventContent #lehreinheitOrt {
|
||||
display: none;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,60 @@
|
||||
.lvUebersicht{
|
||||
display:grid;
|
||||
gap: 1rem;
|
||||
}
|
||||
|
||||
@media (min-width: 992px) {
|
||||
.lvUebersicht {
|
||||
grid-template-columns: 1fr 1fr 1fr;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 992px){
|
||||
.lvUebersicht{
|
||||
grid-template-columns: 1fr 1fr;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 576px){
|
||||
.lvUebersicht{
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
}
|
||||
|
||||
.lvOptions {
|
||||
display: grid;
|
||||
gap: 1rem;
|
||||
}
|
||||
|
||||
.lvOptions > div {
|
||||
flex-basis: auto;
|
||||
flex-grow: 1;
|
||||
flex-shrink: 1;
|
||||
|
||||
}
|
||||
|
||||
.lvOptions button {
|
||||
flex-shrink: 0;
|
||||
|
||||
}
|
||||
|
||||
@media (min-width: 1200px) {
|
||||
.lvOptions {
|
||||
grid-template-columns: 1fr 1fr 1fr 1fr;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 1200px) {
|
||||
.lvOptions {
|
||||
grid-template-columns: 1fr 1fr;
|
||||
}
|
||||
}
|
||||
|
||||
@media (max-width: 576px) {
|
||||
.lvOptions {
|
||||
grid-template-columns: 1fr;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
+54
-2
@@ -10,7 +10,7 @@
|
||||
font-size: calc(1.325rem + .9vw);
|
||||
}
|
||||
.fhc-header > :first-child > small {
|
||||
color: var(--bs-secondary);
|
||||
color: var(--fhc-tertiary);
|
||||
font-size: .65em;
|
||||
padding-inline-start: 1em;
|
||||
}
|
||||
@@ -104,4 +104,56 @@
|
||||
}
|
||||
.modal-msg .modal-content {
|
||||
height: 95vh;
|
||||
}
|
||||
}
|
||||
|
||||
.fhcSkipLink {
|
||||
position: absolute;
|
||||
left: -10px;
|
||||
top: -10px;
|
||||
width: 1px;
|
||||
height: 1px;
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.fhcSkipLink::before {
|
||||
content: "Skip to main content"
|
||||
}
|
||||
|
||||
.fhcSkipLink:focus {
|
||||
position: absolute;
|
||||
z-index: 9999999;
|
||||
top: var(--fhc-cis-header-height);
|
||||
left: var(--fhc-cis-menu-width);
|
||||
height: 100px;
|
||||
width: 800px;
|
||||
font-size: 24px;
|
||||
font-weight: bold;
|
||||
color: #0044cc;
|
||||
background-color: #ffeb3b;
|
||||
text-decoration: none;
|
||||
padding: 12px 18px;
|
||||
border-radius: 6px;
|
||||
box-shadow: 0px 4px 6px rgba(0, 0, 0, 0.2);
|
||||
transition: all 0.2s ease-in-out;
|
||||
}
|
||||
|
||||
.fhcSkipLink:hover {
|
||||
background-color: #ffcc00;
|
||||
color: #002b80;
|
||||
transform: scale(1.05);
|
||||
}
|
||||
|
||||
.fhc-bullet::before {
|
||||
content: "• ";
|
||||
font-weight: bold;
|
||||
display: inline-block;
|
||||
transform: scale(2);
|
||||
}
|
||||
|
||||
.fhc-bullet-red::before {
|
||||
color: green;
|
||||
}
|
||||
|
||||
.fhc-bullet-green::before {
|
||||
color: red;
|
||||
}
|
||||
|
||||
@@ -1,8 +1,15 @@
|
||||
:root{
|
||||
--filter-widget-border: var(--fhc-dark, black);
|
||||
--filter-widget-color: var(--fhc-dark, black);
|
||||
--filter-widget-primary: var(--fhc-primary, #428bca);
|
||||
--filter-widget-border-light: var(--fhc-border, #ddd);
|
||||
}
|
||||
|
||||
.filter-name-title {
|
||||
font-family: inherit;
|
||||
font-size: 16px;
|
||||
line-height: 1.1;
|
||||
color: black;
|
||||
color: var(--filter-widget-color);
|
||||
}
|
||||
|
||||
.panel-title {
|
||||
@@ -26,7 +33,7 @@
|
||||
}
|
||||
|
||||
.drag-and-drop-fields-span {
|
||||
border: 1px solid black;
|
||||
border: 1px solid var(--filter-widget-border);
|
||||
border-radius: 7px;
|
||||
margin-right: 6px;
|
||||
margin-bottom: 10px;
|
||||
@@ -64,7 +71,7 @@
|
||||
right: 100%;
|
||||
height: 100%;
|
||||
margin-right: 3px;
|
||||
border-left: 2px solid #428bca;
|
||||
border-left: 2px solid var(--filter-widget-primary);
|
||||
}
|
||||
|
||||
.selection-after::after {
|
||||
@@ -74,7 +81,7 @@
|
||||
left: 100%;
|
||||
height: 100%;
|
||||
margin-left: 3px;
|
||||
border-right: 2px solid #428bca;
|
||||
border-right: 2px solid var(--filter-widget-primary);
|
||||
}
|
||||
|
||||
.applied-filter-operation {
|
||||
@@ -139,10 +146,10 @@
|
||||
|
||||
.up-down-border {
|
||||
border-top-width: 1px;
|
||||
border-top-color: #ddd;
|
||||
border-top-color: var(--filter-widget-border-light);
|
||||
border-top-style: solid;
|
||||
border-bottom-width: 1px;
|
||||
border-bottom-color: #ddd;
|
||||
border-bottom-color: var(--filter-widget-border-light);
|
||||
border-bottom-style: solid;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,3 +1,9 @@
|
||||
:root{
|
||||
--fhc-filtercomponent-primary: var(--fhc-primary, #428bca);
|
||||
--fhc-filtercomponent-bg:var(--fhc-background, white);
|
||||
--fhc-filtercomponent-border:var(--fhc-border, black);
|
||||
}
|
||||
|
||||
.filter-header-title {
|
||||
text-align: right;
|
||||
}
|
||||
@@ -26,9 +32,9 @@
|
||||
margin-left: 7px;
|
||||
padding: 11px;
|
||||
display: inline-block;
|
||||
background-color: white;
|
||||
background-color: var(--fhc-filtercomponent-bg);
|
||||
border-style: solid;
|
||||
border-color: black;
|
||||
border-color: var(--fhc-filtercomponent-border);
|
||||
border-width: 1px;
|
||||
border-radius: 7px;
|
||||
font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;
|
||||
@@ -47,7 +53,7 @@
|
||||
right: 100%;
|
||||
height: 100%;
|
||||
margin-right: 3px;
|
||||
border-left: 2px solid #428bca;
|
||||
border-left: 2px solid var(--fhc-filtercomponent-primary);
|
||||
}
|
||||
|
||||
.selection-after::after {
|
||||
@@ -57,7 +63,7 @@
|
||||
left: 100%;
|
||||
height: 100%;
|
||||
margin-left: 3px;
|
||||
border-right: 2px solid #428bca;
|
||||
border-right: 2px solid var(--fhc-filtercomponent-primary);
|
||||
}
|
||||
|
||||
.filter-table-dataset {
|
||||
|
||||
@@ -1,5 +1,11 @@
|
||||
/* FORM UNDERLINE
|
||||
*/
|
||||
:root {
|
||||
--fhc-formunderline-border: var(--fhc-border, #dee2e6);
|
||||
--fhc-formunderline-link: var(--fhc-link, initial);
|
||||
--fhc-formunderline-titel-color: var(--fhc-text,gray);
|
||||
}
|
||||
|
||||
.form-underline{
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
@@ -8,11 +14,13 @@
|
||||
|
||||
}
|
||||
|
||||
|
||||
a.form-underline-content{
|
||||
color: var(--fhc-formunderline-link);
|
||||
}
|
||||
|
||||
.form-underline .form-underline-content{
|
||||
border-width: 1px;
|
||||
border-color: transparent transparent #dee2e6 transparent;
|
||||
border-color: transparent transparent var(--fhc-formunderline-border) transparent;
|
||||
border-style: solid;
|
||||
padding-bottom: 0.25rem;
|
||||
padding-left: 0.5rem;
|
||||
@@ -32,4 +40,5 @@
|
||||
opacity: 0.65;
|
||||
font-size: .85rem;
|
||||
padding-left: 0.5rem;
|
||||
color: var(--fhc-formunderline-titel-color) !important;
|
||||
}
|
||||
@@ -1,4 +1,8 @@
|
||||
:root{
|
||||
--fhc-myLv-disabled: var(--fhc-disabled, #565e647f);
|
||||
}
|
||||
|
||||
.unavailable, .unavailable:hover{
|
||||
color: #565e647f !important;
|
||||
color: var(--fhc-myLv-disabled) !important;
|
||||
cursor: default;
|
||||
}
|
||||
|
||||
@@ -1,13 +1,24 @@
|
||||
/*
|
||||
* Hederer
|
||||
*/
|
||||
|
||||
:root{
|
||||
--fhc-nav-component-bg: var(--fhc-tertiary, #f8f8f8);
|
||||
--fhc-nav-component-border: var(--fhc-border, #5e5e5e);
|
||||
--fhc-nav-component-color: var(--fhc-text, #5e5e5e);
|
||||
--fhc-nav-left-component-border: var(--fhc-border, #e7e7e7);
|
||||
--fhc-nav-left-component-bg: var(--fhc-tertiary, #f8f8f8);
|
||||
--fhc-nav-left-component-color: var(--fhc-primary, #23527c);
|
||||
--fhc-nav-left-component-hover: var(--fhc-secondary-highlight, #eee);
|
||||
}
|
||||
|
||||
.navbar-header {
|
||||
background-color: #f8f8f8;
|
||||
background-color: var(--fhc-nav-component-bg);
|
||||
padding-top: 0px;
|
||||
padding-bottom: 0px;
|
||||
padding-left: 10px;
|
||||
border-style: solid;
|
||||
border-color: #e7e7e7;
|
||||
border-color: var(--fhc-nav-component-border);
|
||||
border-width: 0 0 1px;
|
||||
}
|
||||
|
||||
@@ -15,7 +26,7 @@
|
||||
font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;
|
||||
font-size: 18px;
|
||||
line-height: 1.42857143;
|
||||
color: #5e5e5e !important;
|
||||
color: var(--fhc-nav-component-color) !important;
|
||||
padding-top: 15px !important;
|
||||
padding-right: 7px !important;
|
||||
padding-left: 7px !important;
|
||||
@@ -34,8 +45,8 @@
|
||||
z-index: 1;
|
||||
position: absolute;
|
||||
width: 250px;
|
||||
border-right: 1px solid #e7e7e7;
|
||||
background-color: #f8f8f8;
|
||||
border-right: 1px solid var(--fhc-nav-left-component-border);
|
||||
background-color:var(--fhc-nav-left-component-bg);
|
||||
}
|
||||
|
||||
.navbar-left-side ul {
|
||||
@@ -43,7 +54,7 @@
|
||||
}
|
||||
|
||||
.navbar-left-side ul li {
|
||||
border-bottom: 1px solid #e7e7e7;
|
||||
border-bottom: 1px solid var(--fhc-nav-left-component-border);
|
||||
}
|
||||
|
||||
.left-side-menu-second-level {
|
||||
@@ -67,7 +78,7 @@
|
||||
font-family: "Helvetica Neue",Helvetica,Arial,sans-serif;
|
||||
font-size: 14px;
|
||||
line-height: 1.42857143;
|
||||
color: #23527c;
|
||||
color: var(--fhc-nav-left-component-color);
|
||||
padding-top: 10px !important;
|
||||
padding-bottom: 10px !important;
|
||||
padding-left: 7px !important;
|
||||
@@ -76,7 +87,7 @@
|
||||
}
|
||||
|
||||
.left-side-menu-link-entry:hover {
|
||||
background-color: #eee;
|
||||
background-color: var(--fhc-nav-left-component-hover);
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@@ -1,13 +1,14 @@
|
||||
|
||||
|
||||
|
||||
:root{
|
||||
--fhc-profil-border: var(--fhc-background-highlight, gray);
|
||||
--fhc-profil-tabulator-shadow: var(--fhc-shadow-20, rgba(0,0,0,0.1));
|
||||
}
|
||||
|
||||
.image-lock{
|
||||
height:22px;
|
||||
width:21px;
|
||||
background-color:white;
|
||||
background-color:var(--fhc-profil-border);
|
||||
position:absolute;
|
||||
/* top: 1px is important, otherwise it goes over the border of the thumbnail*/
|
||||
top:1px;
|
||||
right:12px;
|
||||
display:flex;
|
||||
@@ -16,9 +17,22 @@
|
||||
border-radius:3px;
|
||||
}
|
||||
|
||||
.image-upload {
|
||||
height: 22px;
|
||||
width: 21px;
|
||||
background-color: var(--fhc-profil-border);
|
||||
position: absolute;
|
||||
bottom: 4.5px;
|
||||
left: 14.5px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border-radius: 3px 3px 3px 0;
|
||||
}
|
||||
|
||||
.tabulator-collapsed-row{
|
||||
padding:15px;
|
||||
background-color: rgba(0,0,0,0.1);
|
||||
background-color: var(--fhc-profil-tabulator-shadow);
|
||||
|
||||
}
|
||||
|
||||
@@ -30,9 +44,6 @@
|
||||
padding:0 !important;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
.btn-circle {
|
||||
width: 30px;
|
||||
height: 30px;
|
||||
@@ -42,7 +53,3 @@
|
||||
font-size: 12px;
|
||||
line-height: 1.42857;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
@@ -1,9 +1,21 @@
|
||||
|
||||
:root {
|
||||
--fhc-sprachen-color: var(--fhc-text, white);
|
||||
--fhc-sprachen-background: var(--fhc-primary, #005585);
|
||||
--fhc-sprachen-background-highlight: var(--fhc-primary-highlight, #00649c);
|
||||
}
|
||||
|
||||
.sprachen-entry{
|
||||
background-color: var(--fhc-cis-primary-hover);
|
||||
color: var(--fhc-sprachen-color);
|
||||
background-color: var(--fhc-sprachen-background);
|
||||
}
|
||||
|
||||
.sprachen-entry:hover {
|
||||
background-color: var(--fhc-sprachen-background);
|
||||
}
|
||||
|
||||
[selected="true"].sprachen-entry {
|
||||
background-color: var(--fhc-cis-primary);
|
||||
background-color: var(--fhc-sprachen-background-highlight);
|
||||
}
|
||||
|
||||
.sprachen-entry.btn {
|
||||
|
||||
@@ -1,247 +1,41 @@
|
||||
:root{
|
||||
--fhc-calendar-pane-height: calc(100vh - 220px);
|
||||
--fhc-calendar-past: #F5E9D7
|
||||
}
|
||||
@import './calendar/frame.css';
|
||||
@import './calendar/events.css';
|
||||
@import './calendar/backgrounds.css';
|
||||
|
||||
.fhc-calendar-week-page-header {
|
||||
background-color: #e9ecef;
|
||||
}
|
||||
/* Themable Variables */
|
||||
:root {
|
||||
--fhc-calendar-gap: var(--bs-border-width, 1px);
|
||||
|
||||
.fhc-calendar-week-page-header > div:hover{
|
||||
background-color: #dddfe2;
|
||||
}
|
||||
--fhc-calendar-bg: var(--fhc-background, #fff);
|
||||
--fhc-calendar-border: var(--fhc-border, #dee2e6);
|
||||
--fhc-calendar-bg-gap: var(--fhc-border, #dee2e6);
|
||||
|
||||
.fhc-calendar-months .col-4,
|
||||
.fhc-calendar-years .col-4 {
|
||||
padding: 0.1875em 0;
|
||||
}
|
||||
.show-weeks .fhc-calendar-months .col-4,
|
||||
.show-weeks .fhc-calendar-years .col-4 {
|
||||
padding: 0.1875em 0.25em;
|
||||
}
|
||||
.fhc-calendar-months .col-4 button,
|
||||
.fhc-calendar-years .col-4 button {
|
||||
aspect-ratio: 28/18;
|
||||
}
|
||||
--fhc-calendar-bg-event: var(--fhc-white-80, #ccc);
|
||||
--fhc-calendar-border-event: var(--bs-secondary, #6c757d);
|
||||
--fhc-calendar-radius-event: var(--bs-border-radius, .375rem);
|
||||
|
||||
.fhc-calendar-month-page {
|
||||
display: grid;
|
||||
grid-template-columns: repeat(7, 1fr);
|
||||
grid-template-rows: 1.5em repeat(6, 1fr);
|
||||
}
|
||||
.fhc-calendar-month-page.show-weeks {
|
||||
grid-template-columns: 1.5em repeat(7, 1fr);
|
||||
grid-template-rows: 1.5em repeat(6, 1fr);
|
||||
}
|
||||
--fhc-calendar-bg-markings-past: var(--fhc-beige-10, rgba(245, 233, 215, 0.5));
|
||||
--fhc-calendar-border-markings-past: var(--fhc-calendar-border);
|
||||
--fhc-calendar-bg-markings-past-label: var(--fhc-calendar-bg);
|
||||
--fhc-calendar-border-markings-past-label: var(--fhc-calendar-border);
|
||||
|
||||
.fhc-calendar-month-page-weekday,
|
||||
.fhc-calendar-month-page-day {
|
||||
color: inherit;
|
||||
}
|
||||
--fhc-calendar-bg-header: var(--fhc-calendar-bg);
|
||||
--fhc-calendar-bg-header-gap: transparent;
|
||||
--fhc-calendar-bg-allday: var(--fhc-calendar-bg);
|
||||
--fhc-calendar-bg-allday-gap: transparent;
|
||||
--fhc-calendar-bg-body: var(--fhc-calendar-bg);
|
||||
--fhc-calendar-bg-body-gap: transparent;
|
||||
|
||||
.fhc-calendar-week .carousel-item {
|
||||
/*padding: 0.75em;*/
|
||||
}
|
||||
|
||||
.fhc-calendar-week-page {
|
||||
/*aspect-ratio: 7/6;*/
|
||||
min-height: 0;
|
||||
}
|
||||
.fhc-calendar-week-page > div {
|
||||
/*transform: translate(-0.75em, -0.75em);*/
|
||||
/*width: calc(100% + 1.5em);*/
|
||||
/*height: calc(100% + 1.5em);*/
|
||||
max-height: 100%;
|
||||
}
|
||||
.fhc-calendar-week-page > div > div {
|
||||
padding-left: 3em;
|
||||
}
|
||||
.fhc-calendar-week-page .events {
|
||||
display: grid;
|
||||
grid-template-columns: 3em repeat(7, 1fr);
|
||||
margin-left: -3em;
|
||||
/*min-height: 266.6666666667%;*/
|
||||
}
|
||||
.fhc-calendar-week-page .events .day {
|
||||
gap: 1px;
|
||||
}
|
||||
.fhc-calendar-week-page .events .hours, .fhc-calendar-week-page .events .day {
|
||||
display: grid;
|
||||
}
|
||||
|
||||
/* grid hour lines of the Stundenplan use box-shadow instead of border because box-shadow renders consistently on different viewports*/
|
||||
.box-shadow-border-top{
|
||||
box-shadow: 0 0 0 1px #dee2e6 !important;
|
||||
}
|
||||
|
||||
.fhc-calendar-no-events-overlay{
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.fhc-calendar-no-events-overlay::before {
|
||||
content: "";
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
margin:auto;
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
background-image: linear-gradient(120deg, white, gray );
|
||||
opacity: .7;
|
||||
}
|
||||
.fhc-calendar-day-page {
|
||||
/*aspect-ratio: 7/6;*/
|
||||
min-height: 0;
|
||||
}
|
||||
.fhc-calendar-day-page > div {
|
||||
/*transform: translate(-0.75em, -0.75em);*/
|
||||
/*width: calc(100% + 1.5em);*/
|
||||
height: calc(100% + 1.5em);
|
||||
}
|
||||
.fhc-calendar-day-page .flex-column > .flex-grow-1 {
|
||||
padding-left: 3em;
|
||||
}
|
||||
.fhc-calendar-day-page .flex-column {
|
||||
border-right: 1px solid #dee2e6;
|
||||
}
|
||||
.fhc-calendar-day-page .events {
|
||||
display: grid;
|
||||
grid-template-columns: 3em 1fr;
|
||||
/*min-height: 266.6666666667%;*/
|
||||
}
|
||||
.fhc-calendar-day-page .events .day {
|
||||
gap: 1px;
|
||||
}
|
||||
.fhc-calendar-day-page .events .hours, .fhc-calendar-day-page .events .day {
|
||||
display: grid;
|
||||
}
|
||||
|
||||
.fhc-calendar-lg .fhc-calendar-month-page-day,
|
||||
.fhc-calendar-lg .fhc-calendar-month-page-weekday,
|
||||
.fhc-calendar-md .fhc-calendar-month-page-day,
|
||||
.fhc-calendar-md .fhc-calendar-month-page-weekday {
|
||||
border: solid 1px #dee2e6;
|
||||
}
|
||||
.fhc-calendar-lg .fhc-calendar-month-page-day,
|
||||
.fhc-calendar-md .fhc-calendar-month-page-day {
|
||||
aspect-ratio: 1;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
}
|
||||
.fhc-calendar-lg .fhc-calendar-month-page-day.active,
|
||||
.fhc-calendar-md .fhc-calendar-month-page-day.active {
|
||||
border-color: var(--bs-secondary);
|
||||
}
|
||||
/*.fhc-calendar-lg .fhc-calendar-month-page-day .events,*/
|
||||
/*.fhc-calendar-md .fhc-calendar-month-page-day .events {*/
|
||||
/* display: block;*/
|
||||
/* overflow: auto;*/
|
||||
/* font-size: 0.7em;*/
|
||||
/*}*/
|
||||
/*.fhc-calendar-lg .fhc-calendar-month-page-day .events span,*/
|
||||
/*.fhc-calendar-md .fhc-calendar-month-page-day .events span {*/
|
||||
/* display: block;*/
|
||||
/* margin: 0.2em;*/
|
||||
/* padding: 0.1em 0.4em;*/
|
||||
/* border-radius: 0.1em;*/
|
||||
/*}*/
|
||||
.fhc-calendar-lg .fhc-calendar-years .col-4,
|
||||
.fhc-calendar-md .fhc-calendar-years .col-4 {
|
||||
padding: 0.09375em 0;
|
||||
}
|
||||
.show-weeks .fhc-calendar-lg .fhc-calendar-years .col-4,
|
||||
.show-weeks .fhc-calendar-md .fhc-calendar-years .col-4 {
|
||||
padding: 0.09375em 0.25em;
|
||||
}
|
||||
.fhc-calendar-lg .fhc-calendar-years .col-4 button,
|
||||
.fhc-calendar-md .fhc-calendar-years .col-4 button {
|
||||
aspect-ratio: 28/9;
|
||||
}
|
||||
|
||||
.fhc-calendar-xs {
|
||||
font-size: 0.6em;
|
||||
}
|
||||
|
||||
.fhc-calendar-sm .fhc-calendar-month-page {
|
||||
font-size: 0.8em;
|
||||
}
|
||||
|
||||
.fhc-calendar-sm .fhc-calendar-month-page-weekday,
|
||||
.fhc-calendar-xs .fhc-calendar-month-page-weekday {
|
||||
font-style: italic;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: end;
|
||||
}
|
||||
|
||||
.fhc-calendar-month-page-weekday:hover {
|
||||
background-color:#37789c;
|
||||
color:white;
|
||||
--fhc-calendar-bg-month-today: var(--fhc-primary);
|
||||
--fhc-calendar-color-month-today: var(--fhc-white-10);
|
||||
|
||||
}
|
||||
--fhc-calendar-bg-overlay1: var(--fhc-calendar-bg);
|
||||
--fhc-calendar-bg-overlay2: var(--fhc-dark, #212529);
|
||||
|
||||
--fhc-calendar-radius-day-event: var(--fhc-calendar-radius-event);
|
||||
--fhc-calendar-radius-week-event: var(--fhc-calendar-radius-event);
|
||||
--fhc-calendar-radius-month-event: 0;
|
||||
--fhc-calendar-radius-list-event: var(--fhc-calendar-radius-event);
|
||||
|
||||
.fhc-calendar-sm .fhc-calendar-month-page-day,
|
||||
.fhc-calendar-xs .fhc-calendar-month-page-day {
|
||||
position: relative;
|
||||
aspect-ratio: 1;
|
||||
--fhc-calendar-maxheight-allday: 7.125rem;
|
||||
}
|
||||
|
||||
|
||||
|
||||
.fhc-calendar-past {
|
||||
background-color: var(--fhc-calendar-past);
|
||||
border-color: #E8E8E8;
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
.fhc-calendar-month-page-day-highlight {
|
||||
/*background-color: #f5f5f5;*/
|
||||
/*background-color: red;*/
|
||||
}
|
||||
.fhc-highlight-week {
|
||||
/*border-color: black !important;*/
|
||||
}
|
||||
|
||||
.fhc-highlight-day {
|
||||
box-shadow: inset 0 0 0 2px black !important;
|
||||
}
|
||||
|
||||
.fhc-calendar-sm .fhc-calendar-month-page-day.active .no,
|
||||
.fhc-calendar-xs .fhc-calendar-month-page-day.active .no {
|
||||
background-color: rgba(var(--bs-info-rgb), 0.25);
|
||||
border-radius: 50%;
|
||||
font-weight: bold;
|
||||
}
|
||||
.fhc-calendar-sm .fhc-calendar-month-page-day:not(.active):hover .no,
|
||||
.fhc-calendar-xs .fhc-calendar-month-page-day:not(.active):hover .no {
|
||||
background-color: rgba(var(--bs-secondary-rgb), 0.25);
|
||||
border-radius: 50%;
|
||||
}
|
||||
/*.fhc-calendar-sm .fhc-calendar-month-page-day .no,*/
|
||||
/*.fhc-calendar-xs .fhc-calendar-month-page-day .no {*/
|
||||
/* display: flex;*/
|
||||
/* align-items: center;*/
|
||||
/* justify-content: center;*/
|
||||
/* width: 80%;*/
|
||||
/* height: 80%;*/
|
||||
/* margin: 10%;*/
|
||||
/*}*/
|
||||
/*.fhc-calendar-sm .fhc-calendar-month-page-day .events,*/
|
||||
/*.fhc-calendar-xs .fhc-calendar-month-page-day .events {*/
|
||||
/* position: absolute;*/
|
||||
/* bottom: 0;*/
|
||||
/* left: 10%;*/
|
||||
/* width: 80%;*/
|
||||
/* height: 10%;*/
|
||||
/* overflow: hidden;*/
|
||||
/* display: flex;*/
|
||||
/*}*/
|
||||
.fhc-calendar-sm .fhc-calendar-month-page-day .events span,
|
||||
.fhc-calendar-xs .fhc-calendar-month-page-day .events span {
|
||||
overflow: hidden;
|
||||
}
|
||||
|
||||
.selectedEvent {
|
||||
background-color: #00649c !important;
|
||||
color: white;
|
||||
}
|
||||
@@ -0,0 +1,18 @@
|
||||
.background-past {
|
||||
background-color: var(--fhc-calendar-bg-markings-past);
|
||||
border-bottom: solid 1px var(--fhc-calendar-border-markings-past);
|
||||
}
|
||||
.background-past > span {
|
||||
display: none;
|
||||
}
|
||||
.background-past.bg-end > span {
|
||||
display: block;
|
||||
position: absolute;
|
||||
top: 100%;
|
||||
left: 1rem;
|
||||
padding: 0 .5rem;
|
||||
background-color: var(--fhc-calendar-bg-markings-past-label);
|
||||
border: solid 1px var(--fhc-calendar-border-markings-past-label);
|
||||
font-size: .875em;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,71 @@
|
||||
.event {
|
||||
cursor: pointer;
|
||||
font-size: var(--fhc-calendar-fontsize-event, .875rem);
|
||||
}
|
||||
.fhc-calendar-mode-day .fhc-calendar-base-grid-line,
|
||||
.fhc-calendar-mode-week .fhc-calendar-base-grid-line {
|
||||
padding: 0 var(--fhc-calendar-gap-events, var(--fhc-calendar-gap, 1px));
|
||||
}
|
||||
.fhc-calendar-mode-day .all-day-events .event,
|
||||
.fhc-calendar-mode-week .all-day-events .event {
|
||||
margin: var(--fhc-calendar-gap-events, var(--fhc-calendar-gap, 1px)) 0;
|
||||
}
|
||||
.fhc-calendar-mode-list .event {
|
||||
margin-bottom: var(--fhc-calendar-gap-events, var(--fhc-calendar-gap, 1px));
|
||||
}
|
||||
/* Border */
|
||||
.fhc-calendar-mode-day .grid-main .event > *,
|
||||
.fhc-calendar-mode-week .grid-main .event > * {
|
||||
border: solid 1px var(--fhc-calendar-border-event);
|
||||
}
|
||||
.fhc-calendar-mode-day .event {
|
||||
--event-radius: var(--fhc-calendar-radius-day-event, 0);
|
||||
}
|
||||
.fhc-calendar-mode-week .event {
|
||||
--event-radius: var(--fhc-calendar-radius-week-event, 0);
|
||||
}
|
||||
.fhc-calendar-mode-month .event {
|
||||
--event-radius: var(--fhc-calendar-radius-month-event, 0);
|
||||
}
|
||||
.fhc-calendar-mode-list .event {
|
||||
--event-radius: var(--fhc-calendar-radius-list-event, 0);
|
||||
}
|
||||
.fhc-calendar-mode-day .all-day-events .event > *,
|
||||
.fhc-calendar-mode-week .all-day-events .event > *,
|
||||
.fhc-calendar-mode-day .event.event-begin > *,
|
||||
.fhc-calendar-mode-week .event.event-begin > * {
|
||||
border-top-left-radius: var(--event-radius);
|
||||
border-top-right-radius: var(--event-radius);
|
||||
}
|
||||
.fhc-calendar-mode-day .all-day-events .event > *,
|
||||
.fhc-calendar-mode-week .all-day-events .event > *,
|
||||
.fhc-calendar-mode-day .event.event-end > *,
|
||||
.fhc-calendar-mode-week .event.event-end > * {
|
||||
border-bottom-left-radius: var(--event-radius);
|
||||
border-bottom-right-radius: var(--event-radius);
|
||||
}
|
||||
.fhc-calendar-mode-month .event.event-begin > * {
|
||||
border-top-left-radius: var(--event-radius);
|
||||
border-bottom-left-radius: var(--event-radius);
|
||||
}
|
||||
.fhc-calendar-mode-month .event.event-end > * {
|
||||
border-top-right-radius: var(--event-radius);
|
||||
border-bottom-right-radius: var(--event-radius);
|
||||
}
|
||||
.fhc-calendar-mode-list .event > * {
|
||||
border-radius: var(--event-radius);
|
||||
}
|
||||
/* Colors */
|
||||
.fhc-calendar-base .event {
|
||||
--event-default-bg: var(--fhc-calendar-bg-event, #ccc);
|
||||
}
|
||||
.fhc-calendar-base .event .event-type-reservierung {
|
||||
--event-default-bg: var(--fhc-calendar-bg-reservierung, #fff);
|
||||
}
|
||||
.fhc-calendar-base .event > * {
|
||||
background-color: var(--event-bg, var(--event-default-bg));
|
||||
color: var(--event-color, var(--fhc-calendar-color-event, #000));
|
||||
}
|
||||
.fhc-calendar-base .event > *:hover {
|
||||
filter: brightness(120%);
|
||||
}
|
||||
@@ -0,0 +1,219 @@
|
||||
/* Labels */
|
||||
/* ====== */
|
||||
.fhc-calendar-base-label-dow .short,
|
||||
.fhc-calendar-base-label-dow .narrow,
|
||||
.fhc-calendar-base-label-day .full,
|
||||
.fhc-calendar-base-label-day .short,
|
||||
.fhc-calendar-base-label-day .narrow,
|
||||
.fhc-calendar-mode-month .fhc-calendar-base-label-day .long,
|
||||
.collapsed-header .fhc-calendar-base-label-day .long,
|
||||
.collapsed-header .fhc-calendar-base-label-dow .long {
|
||||
display: none;
|
||||
}
|
||||
.fhc-calendar-mode-month .fhc-calendar-base-label-day .narrow,
|
||||
.collapsed-header .fhc-calendar-base-label-day .short,
|
||||
.collapsed-header .fhc-calendar-base-label-dow .short {
|
||||
display: block;
|
||||
}
|
||||
.fhc-calendar-mode-day .fhc-calendar-base-label-day,
|
||||
.fhc-calendar-mode-week .fhc-calendar-base-label-day {
|
||||
font-size: .875em;
|
||||
}
|
||||
.fhc-calendar-mode-day .main-header,
|
||||
.fhc-calendar-mode-week .main-header {
|
||||
text-align: center;
|
||||
}
|
||||
.fhc-calendar-mode-month .fhc-calendar-base-label-week {
|
||||
text-align: right;
|
||||
}
|
||||
.fhc-calendar-base-label-week {
|
||||
margin-left: .5rem;
|
||||
}
|
||||
.fhc-calendar-base-label-time,
|
||||
.fhc-calendar-base-label-day,
|
||||
.fhc-calendar-base-label-week {
|
||||
color: var(--bs-secondary-color);
|
||||
}
|
||||
.fhc-calendar-mode-day .fhc-calendar-base-label-dow,
|
||||
.fhc-calendar-mode-week .fhc-calendar-base-label-dow,
|
||||
.fhc-calendar-base-label-day,
|
||||
.fhc-calendar-base-label-week {
|
||||
cursor: pointer;
|
||||
}
|
||||
.fhc-calendar-base-label-week span + span:before {
|
||||
content: "/";
|
||||
}
|
||||
.fhc-calendar-mode-month .fhc-calendar-base-grid-line-event.event-header {
|
||||
height: 100%;
|
||||
}
|
||||
.fhc-calendar-mode-month .fhc-calendar-base-label-day {
|
||||
width: 100%;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
align-items: center;
|
||||
}
|
||||
.fhc-calendar-mode-month .fhc-calendar-base-grid-line-event.event-header {
|
||||
--event-bg: transparent;
|
||||
font-weight: bold;
|
||||
font-size: var(--fhc-calendar-fontsize-month-day, 1rem);
|
||||
}
|
||||
.fhc-calendar-mode-month .fhc-calendar-base-grid-line-event.event-header .disabled {
|
||||
opacity: .3;
|
||||
}
|
||||
|
||||
|
||||
/* Base Grid */
|
||||
/* ========= */
|
||||
/* Grid */
|
||||
.fhc-calendar-base-grid {
|
||||
--fhc-calendar-axis-collapsible: .2fr;
|
||||
background-color: var(--fhc-calendar-bg-gap);
|
||||
grid-gap: var(--fhc-calendar-gap-header, calc(var(--fhc-calendar-gap, 1px) * 2));
|
||||
}
|
||||
.fhc-calendar-base-grid .grid-header {
|
||||
background-color: var(--fhc-calendar-bg-header-gap, var(--fhc-calendar-bg-gap));
|
||||
}
|
||||
.fhc-calendar-base-grid .grid-header:before,
|
||||
.fhc-calendar-base-grid .grid-allday:before {
|
||||
content: "";
|
||||
}
|
||||
.fhc-calendar-base-grid .grid-header:before,
|
||||
.fhc-calendar-base-grid .grid-header .main-header {
|
||||
background-color: var(--fhc-calendar-bg-header);
|
||||
}
|
||||
.fhc-calendar-base-grid .grid-allday {
|
||||
background-color: var(--fhc-calendar-bg-allday-gap, var(--fhc-calendar-bg-gap));
|
||||
}
|
||||
.fhc-calendar-base-grid .grid-allday:before,
|
||||
.fhc-calendar-base-grid .grid-allday .all-day-events {
|
||||
background-color: var(--fhc-calendar-bg-allday);
|
||||
}
|
||||
.fhc-calendar-base-grid .grid-allday .all-day-events {
|
||||
max-height: var(--fhc-calendar-maxheight-allday);
|
||||
overflow-y: auto;
|
||||
}
|
||||
.fhc-calendar-base-grid .grid-main {
|
||||
grid-gap: var(--fhc-calendar-gap, 1px);
|
||||
background-color: var(--fhc-calendar-bg-body-gap, var(--fhc-calendar-bg-gap));
|
||||
}
|
||||
.fhc-calendar-base-grid .grid-main .part-header,
|
||||
.fhc-calendar-base-grid .grid-main .part-body {
|
||||
background-color: var(--fhc-calendar-bg-body);
|
||||
}
|
||||
.fhc-calendar-base-grid-line {
|
||||
grid-gap: var(--fhc-calendar-gap-events, var(--fhc-calendar-gap, 1px));
|
||||
}
|
||||
.fhc-calendar-base-label-time {
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
align-items: end;
|
||||
}
|
||||
/* Header */
|
||||
.fhc-calendar-base-header .header-picker {
|
||||
display: flex;
|
||||
justify-content: center;
|
||||
}
|
||||
.fhc-calendar-base-header .header-actions {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
justify-content: space-around;
|
||||
align-items: center;
|
||||
margin-bottom: .5rem;
|
||||
row-gap: .5rem;
|
||||
}
|
||||
.fhc-calendar-base-header .header-userdefined:empty {
|
||||
display: none;
|
||||
}
|
||||
@media (min-width: 768px) {
|
||||
.fhc-calendar-base-header {
|
||||
display: grid;
|
||||
grid-template-columns: [userdefined] 1fr [picker] max-content [modes] 1fr;
|
||||
align-items: center;
|
||||
}
|
||||
.fhc-calendar-base-header .header-actions {
|
||||
grid-column: 1 / -1;
|
||||
grid-row: 1;
|
||||
display: grid;
|
||||
grid-template-columns: subgrid;
|
||||
margin-bottom: 0;
|
||||
}
|
||||
.fhc-calendar-base-header .header-userdefined {
|
||||
grid-column: userdefined;
|
||||
}
|
||||
.fhc-calendar-base-header .header-modes {
|
||||
grid-column: modes;
|
||||
}
|
||||
.fhc-calendar-base-header .header-picker {
|
||||
grid-column: picker;
|
||||
grid-row: 1;
|
||||
}
|
||||
}
|
||||
|
||||
/* Modes */
|
||||
/* ===== */
|
||||
/* Day */
|
||||
.fhc-calendar-mode-day .event-details {
|
||||
padding: 1.5rem;
|
||||
width: 100%;
|
||||
border-left: solid 1px var(--fhc-calendar-bg-gap);
|
||||
}
|
||||
.fhc-calendar-mode-day .today {
|
||||
background-color: var(--fhc-calendar-bg-day-today);
|
||||
color: var(--fhc-calendar-color-day-today);
|
||||
}
|
||||
/* Week */
|
||||
.fhc-calendar-mode-week .today {
|
||||
background-color: var(--fhc-calendar-bg-week-today);
|
||||
color: var(--fhc-calendar-color-week-today);
|
||||
}
|
||||
/* Month */
|
||||
.fhc-calendar-mode-month .fhc-calendar-base-grid-line {
|
||||
overflow: hidden;
|
||||
line-height: 1.8;
|
||||
grid-template-rows: 2em;
|
||||
grid-auto-rows: 1.8em;
|
||||
font-size: var(--fhc-calendar-fontsize-event, .875rem);
|
||||
}
|
||||
.fhc-calendar-mode-month .fhc-calendar-base-grid-line-event {
|
||||
font-size: 1em;
|
||||
height: 1.8em;
|
||||
overflow: hidden;
|
||||
}
|
||||
.fhc-calendar-mode-month .fhc-calendar-base-grid-line-event .placeholder-glow {
|
||||
text-indent: 0;
|
||||
}
|
||||
.fhc-calendar-mode-month .fhc-calendar-base-grid-line-event * {
|
||||
max-height: 100%;
|
||||
max-width: 100%;
|
||||
white-space: nowrap;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
}
|
||||
.fhc-calendar-mode-month .event > .today {
|
||||
background-color: var(--fhc-calendar-bg-month-today);
|
||||
color: var(--fhc-calendar-color-month-today);
|
||||
}
|
||||
/* List */
|
||||
.fhc-calendar-mode-list .today {
|
||||
background-color: var(--fhc-calendar-bg-list-today);
|
||||
color: var(--fhc-calendar-color-list-today);
|
||||
}
|
||||
|
||||
/* Overlays */
|
||||
/* ======== */
|
||||
/* No Events */
|
||||
.fhc-calendar-no-events-overlay {
|
||||
background: linear-gradient(120deg, var(--fhc-calendar-bg-overlay1), var(--fhc-calendar-bg-overlay2));
|
||||
opacity: .7;
|
||||
text-align: center;
|
||||
font-size: 2.5rem;
|
||||
font-weight: 500;
|
||||
line-height: 1.2;
|
||||
}
|
||||
.fhc-calendar-no-events-overlay:before {
|
||||
content: "";
|
||||
display: block;
|
||||
height: 100px;
|
||||
}
|
||||
@@ -1,5 +1,43 @@
|
||||
@import './calendar.css';
|
||||
@import './dashboard/news.css';
|
||||
@import './dashboard/LvPlan.css';
|
||||
|
||||
:root{
|
||||
--fhc-dashboard-danger: var(--fhc-danger, #842029);
|
||||
--fhc-dashboard-grid-size: 4;
|
||||
--fhc-dashboard-link: var(--fhc-link, #0a57ca);
|
||||
--fhc-dashboard-gridrow-background: var(--fhc-background, white);
|
||||
--fhc-dashboard-gridrow-background-highlight: var(--fhc-background-highlight, #6c757d);
|
||||
--fhc-dashboard-draggeditem-background: var(--fhc-background, white);
|
||||
--fhc-dashboard-item-overlay-background: var(--fhc-background-highlight, rgba(0, 100, 156, 1));
|
||||
--fhc-dashboard-item-overly-border-color: var(--fhc-border, lightgray);
|
||||
--fhc-dashboard-denied-dragging-animation-color: var(--fhc-danger, red);
|
||||
--fhc-dashboard-pin-pinned-hover-color: var(--fhc-fifth-highlight, rgb(153, 116, 116));
|
||||
--fhc-dashboard-section-info-color: var(--fhc-primary, #00649c);
|
||||
--fhc-dashboard-section-info-color-hover: var(--fhc-primary-highlight, #005585);
|
||||
}
|
||||
|
||||
@media(max-width: 577px) {
|
||||
:root {
|
||||
--fhc-dashboard-grid-size: 1;
|
||||
}
|
||||
}
|
||||
|
||||
.core-dashboard a{
|
||||
color: var(--fhc-dashboard-link);
|
||||
}
|
||||
|
||||
@media (max-width: 576px){
|
||||
.widget-icon {
|
||||
max-height: 250px;
|
||||
object-fit: cover;
|
||||
}
|
||||
.widget-icon-container{
|
||||
max-width: 250px;
|
||||
margin-left: auto;
|
||||
margin-right: auto;
|
||||
}
|
||||
}
|
||||
|
||||
.empty-tile-hover {
|
||||
height: 100%;
|
||||
@@ -11,18 +49,59 @@
|
||||
cursor:pointer;
|
||||
}
|
||||
|
||||
.dashboard-section > .newGridRow{
|
||||
position:absolute;
|
||||
width:20px;
|
||||
height:20px;
|
||||
padding:0;
|
||||
bottom:0;
|
||||
left:50%;
|
||||
transform:translate(-50%, 50%);
|
||||
background-color: var(--fhc-dashboard-gridrow-background);
|
||||
}
|
||||
|
||||
.newGridRow:hover {
|
||||
color:white;
|
||||
background-color: var(--fhc-dashboard-gridrow-background-highlight);
|
||||
}
|
||||
|
||||
.empty-tile-hover:hover {
|
||||
background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="-500 -500 1448 1512"><path fill="rgb(211, 211, 211)" d="M64 32C28.7 32 0 60.7 0 96V416c0 35.3 28.7 64 64 64H384c35.3 0 64-28.7 64-64V96c0-35.3-28.7-64-64-64H64zM200 344V280H136c-13.3 0-24-10.7-24-24s10.7-24 24-24h64V168c0-13.3 10.7-24 24-24s24 10.7 24 24v64h64c13.3 0 24 10.7 24 24s-10.7 24-24 24H248v64c0 13.3-10.7 24-24 24s-24-10.7-24-24z"/></svg>');
|
||||
}
|
||||
|
||||
.alert-danger .form-check-input:checked {
|
||||
border-color: #842029;
|
||||
background-color: #842029;
|
||||
border-color: var(--fhc-dashboard-danger);
|
||||
background-color: var(--fhc-dashboard-danger);
|
||||
}
|
||||
|
||||
:root {
|
||||
--fhc-dashboard-grid-size: 4;
|
||||
}
|
||||
|
||||
@media(max-width: 1400px) {
|
||||
:root {
|
||||
--fhc-dashboard-grid-size: 4;
|
||||
}
|
||||
}
|
||||
|
||||
@media(max-width: 1200px) {
|
||||
:root {
|
||||
--fhc-dashboard-grid-size: 3;
|
||||
}
|
||||
}
|
||||
|
||||
@media(max-width: 992px) {
|
||||
:root {
|
||||
--fhc-dashboard-grid-size: 2;
|
||||
}
|
||||
}
|
||||
|
||||
@media(max-width: 768px) {
|
||||
:root {
|
||||
--fhc-dashboard-grid-size: 2;
|
||||
}
|
||||
}
|
||||
|
||||
@media(max-width: 577px) {
|
||||
:root {
|
||||
--fhc-dashboard-grid-size: 1;
|
||||
@@ -34,11 +113,93 @@
|
||||
}
|
||||
|
||||
.cursor-nw-resize {
|
||||
cursor: nw-resize;
|
||||
cursor: nw-resize !important;
|
||||
}
|
||||
|
||||
.cursor-ew-resize {
|
||||
cursor: ew-resize !important;
|
||||
}
|
||||
|
||||
.cursor-ns-resize {
|
||||
cursor: ns-resize !important;
|
||||
}
|
||||
|
||||
.no-drag-drop {
|
||||
cursor: not-allowed !important;
|
||||
}
|
||||
|
||||
.cursor-move {
|
||||
cursor: move;
|
||||
cursor: move !important;
|
||||
}
|
||||
|
||||
.draggedItem {
|
||||
height: 100%;
|
||||
width: 100%;
|
||||
background-color: var(--fhc-dashboard-draggeditem-background);
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.dashboard-item-overlay{
|
||||
background-color: var(--fhc-dashboard-item-overlay-background);
|
||||
}
|
||||
|
||||
.dashboard-item-overlay::before{
|
||||
position:absolute;
|
||||
content:"";
|
||||
top:0.25rem;
|
||||
left:0.25rem;
|
||||
right:0.25rem;
|
||||
bottom:0.25rem;
|
||||
border:4px dashed var(--fhc-dashboard-item-overly-border-color);
|
||||
opacity: 0.5;
|
||||
}
|
||||
|
||||
#deleteBookmark i{
|
||||
color: var(--fhc-dashboard-danger);
|
||||
}
|
||||
|
||||
.pin:hover{
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.pin[pinned]:hover{
|
||||
color: var(--fhc-dashboard-pin-pinned-hover-color);
|
||||
}
|
||||
|
||||
.section-info{
|
||||
color: var(--fhc-dashboard-section-info-color);
|
||||
cursor:pointer;
|
||||
}
|
||||
|
||||
.section-info:hover {
|
||||
color: var(--fhc-dashboard-section-info-color-hover);
|
||||
}
|
||||
|
||||
.denied-dragging-animation {
|
||||
animation: wiggle 0.5s linear;
|
||||
color: var(--fhc-dashboard-denied-dragging-animation-color) !important;
|
||||
}
|
||||
|
||||
@keyframes wiggle {
|
||||
|
||||
0% {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
|
||||
25% {
|
||||
transform: rotate(-30deg);
|
||||
}
|
||||
|
||||
50% {
|
||||
transform: rotate(0deg);
|
||||
}
|
||||
|
||||
75% {
|
||||
transform: rotate(30deg);
|
||||
}
|
||||
|
||||
100% {
|
||||
transform: rotate(0em);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
.dashboard-widget-lvplan .fhc-calendar-base .card {
|
||||
--bs-card-cap-padding-x: 0;
|
||||
--bs-card-cap-padding-y: 0;
|
||||
--bs-card-border-radius: 0;
|
||||
--bs-card-border-width: 0;
|
||||
--dp-input-padding: .375rem .75rem;
|
||||
--dp-input-icon-padding: calc(1rem + 24px);
|
||||
}
|
||||
.dashboard-widget-lvplan .fhc-calendar-base .card-header {
|
||||
border-bottom-width: var(--bs-border-width);
|
||||
}
|
||||
.dashboard-widget-lvplan .fhc-calendar-base .card-header > .row > .col-auto,
|
||||
.dashboard-widget-lvplan .fhc-calendar-base .card-header .btn-group {
|
||||
width: 100%;
|
||||
}
|
||||
.dashboard-widget-lvplan .fhc-calendar-base .card-header input {
|
||||
--dp-font-size: .7em;
|
||||
}
|
||||
.dashboard-widget-lvplan .fhc-calendar-base .card-header .btn {
|
||||
--bs-btn-font-size: .7em;
|
||||
}
|
||||
.dashboard-widget-lvplan .fhc-calendar-base-label-day {
|
||||
cursor: initial;
|
||||
}
|
||||
.dashboard-widget-lvplan .fhc-calendar-mode-list-view {
|
||||
padding: 0 1rem;
|
||||
}
|
||||
@@ -1,5 +1,10 @@
|
||||
:root{
|
||||
--news-widget-height: 1;
|
||||
--fhc-news-widget-height: 1;
|
||||
--fhc-news-widget-bg: var(--fhc-primary);
|
||||
--fhc-news-widget-highlight-color: var(--fhc-primary-highlight);
|
||||
--fhc-news-widget-border: var(--fhc-border);
|
||||
--fhc-news-widget-border-highlight: var(--fhc-border-highlight);
|
||||
--fhc-news-widget-text-light: var(--fhc-light);
|
||||
}
|
||||
|
||||
|
||||
@@ -8,28 +13,68 @@
|
||||
@media (min-width :576px) {
|
||||
.fhc-news-menu-item {
|
||||
/* padding: top right bottom left */
|
||||
padding:0em 0em 0em 0em !important;
|
||||
padding:0.125em 0.125em 0.125em 0.125em !important;
|
||||
max-height:30px !important;
|
||||
}
|
||||
|
||||
.fhc-news-menu-item-betreff p {
|
||||
display: -webkit-box;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-line-clamp: 1;
|
||||
line-clamp: 1;
|
||||
/* Number of lines to show */
|
||||
overflow: hidden;
|
||||
}
|
||||
}
|
||||
/* media query for md sizes */
|
||||
@media (min-width :768px) {
|
||||
.fhc-news-menu-item {
|
||||
/* padding: top right bottom left */
|
||||
padding: 0.3em 0.3em 0.3em 0.3em !important;
|
||||
padding: 0.25em 0.25em 0.25em 0.25em !important;
|
||||
max-height: 50px !important;
|
||||
}
|
||||
|
||||
.fhc-news-menu-item-betreff p {
|
||||
display: -webkit-box;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-line-clamp: 1;
|
||||
line-clamp: 1;
|
||||
/* Number of lines to show */
|
||||
overflow: hidden;
|
||||
}
|
||||
}
|
||||
/* media query for lg sizes */
|
||||
@media (min-width :992px) {
|
||||
.fhc-news-menu-item {
|
||||
/* padding: top right bottom left */
|
||||
padding: 0.3em 0.3em 0.3em 0.3em !important;
|
||||
padding: 0.25em 0.25em 0.25em 0.25em !important;
|
||||
max-height: 75px !important;
|
||||
}
|
||||
|
||||
.fhc-news-menu-item-betreff p {
|
||||
display: -webkit-box;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-line-clamp: 2;
|
||||
line-clamp: 2;
|
||||
/* Number of lines to show */
|
||||
overflow: hidden;
|
||||
}
|
||||
}
|
||||
/* media query for xl sizes */
|
||||
@media (min-width :1200px) {
|
||||
.fhc-news-menu-item {
|
||||
/* padding: top right bottom left */
|
||||
padding: 1em 1em 0.3em 1em !important;
|
||||
padding: 1em 0.25em 0.25em 0.25em !important;
|
||||
height: 100px !important;
|
||||
}
|
||||
|
||||
.fhc-news-menu-item-betreff p {
|
||||
display: -webkit-box;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-line-clamp: 2;
|
||||
line-clamp: 2;
|
||||
/* Number of lines to show */
|
||||
overflow: hidden;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,8 +82,23 @@
|
||||
@media (min-width :1400px) {
|
||||
.fhc-news-menu-item {
|
||||
/* padding: top right bottom left */
|
||||
padding: 1.2em 1.2em 0.3em 1.2em !important;
|
||||
padding: 1.2em 0.5em 0.5em 0.5em !important;
|
||||
height: 125px !important;
|
||||
}
|
||||
|
||||
.fhc-news-menu-item-betreff p {
|
||||
display: -webkit-box;
|
||||
-webkit-box-orient: vertical;
|
||||
-webkit-line-clamp: 2;
|
||||
line-clamp: 2;
|
||||
/* Number of lines to show */
|
||||
overflow: hidden;
|
||||
}
|
||||
}
|
||||
|
||||
.widgets-news{
|
||||
padding: .5rem;
|
||||
overflow-y: auto;
|
||||
}
|
||||
|
||||
.widgets-news img
|
||||
@@ -48,31 +108,24 @@
|
||||
|
||||
.fhc-news-menu-item {
|
||||
padding: 0.375rem;
|
||||
color: var(--fhc-cis-menu-lvl-1-color);
|
||||
min-height: 5%;
|
||||
max-height: 30%;
|
||||
color: var(--fhc-news-widget-text-light);
|
||||
width: 100%;
|
||||
justify-content: space-between;
|
||||
align-items: center;
|
||||
background-color: #00649c;
|
||||
border: 1px solid #f1f1f1;
|
||||
background-color: var(--fhc-news-widget-bg);
|
||||
border: 1px solid var(--fhc-news-widget-border);
|
||||
cursor: pointer;
|
||||
transition: background-color 0.2s ease, border-color 0.2s ease; /* Smooth transition */
|
||||
}
|
||||
|
||||
.fhc-news-menu-item:hover {
|
||||
background-color: var(--fhc-cis-menu-lvl-1-bg-hover);
|
||||
border-color: #f1f1f1;
|
||||
}
|
||||
|
||||
.fhc-news-menu-item:active {
|
||||
background-color: var(--fhc-cis-menu-lvl-1-color-hover);
|
||||
border-color: #f1f1f1;
|
||||
background-color: var(--fhc-news-widget-highlight-color);
|
||||
border-color: var(--fhc-news-widget-border-highlight);
|
||||
}
|
||||
|
||||
.fhc-news-menu-item.selected {
|
||||
background-color: var(--fhc-cis-menu-lvl-1-bg-hover);
|
||||
border-right: 2px solid #fff;
|
||||
background-color: var(--fhc-news-widget-highlight-color);
|
||||
border: 2px solid var(--fhc-news-widget-border-highlight);
|
||||
|
||||
}
|
||||
|
||||
@@ -83,7 +136,6 @@
|
||||
.fhc-news-menu-item-betreff
|
||||
{
|
||||
width: 100%;
|
||||
text-align: center;
|
||||
max-height: 100%;
|
||||
height: 100%;
|
||||
}
|
||||
@@ -111,32 +163,32 @@
|
||||
|
||||
.carousel-control-prev,
|
||||
.carousel-control-next {
|
||||
opacity: 0;
|
||||
transition: opacity 0.3s ease;
|
||||
top: 0.5rem !important;
|
||||
bottom: auto !important;
|
||||
opacity: 1 !important;
|
||||
}
|
||||
|
||||
/* Show the buttons when the carousel is hovered */
|
||||
.carousel:hover .carousel-control-prev,
|
||||
.carousel:hover .carousel-control-next {
|
||||
opacity: 1;
|
||||
|
||||
.fhc-news-items-lg .row .news-truncate span{
|
||||
color: var(--fhc-primary);
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
.fhc-news-text{
|
||||
font-size: 0.75em;
|
||||
.fhc-news-items-lg .row:hover .news-truncate span{
|
||||
text-decoration: underline;
|
||||
cursor: pointer;
|
||||
font-weight: bold;
|
||||
}
|
||||
|
||||
.fhc-news-xs {
|
||||
font-size: 0.6em;
|
||||
|
||||
|
||||
.news-truncate {
|
||||
display: -webkit-box;
|
||||
-webkit-line-clamp: 2;
|
||||
/* number of lines to show */
|
||||
-webkit-box-orient: vertical;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
word-break: break-word;
|
||||
}
|
||||
|
||||
.fhc-news-sm {
|
||||
font-size: 0.7em;
|
||||
}
|
||||
|
||||
.fhc-news-md {
|
||||
font-size: 1.1em;
|
||||
}
|
||||
|
||||
.fhc-news-lg {
|
||||
font-size: 1.4em;
|
||||
}
|
||||
|
||||
@@ -5,28 +5,44 @@
|
||||
|
||||
@import url(./switches.css);
|
||||
|
||||
#search-filter{
|
||||
border: 1px solid #ced4da;
|
||||
:root{
|
||||
--fhc-searchbar-shadow: var(--fhc-shadow-40, #ced4da);
|
||||
--fhc-searchbar-settings-background-color: var(--fhc-dark, #343a40);
|
||||
--fhc-searchbar-results-background-color: var(--fhc-background, #fff);
|
||||
--fhc-searchbar-results-border-color: var(--fhc-border, lightgrey);
|
||||
--fhc-searchbar-results-link-color: var(--fhc-link, #0d6efd);
|
||||
--fhc-searchbar-results-btn-color: var(--bs-btn-color, white);
|
||||
}
|
||||
|
||||
|
||||
.searchbar_settings {
|
||||
position: absolute;
|
||||
position: absolute;
|
||||
z-index: 9999;
|
||||
background-color: #343a40;
|
||||
background-color: var(--fhc-searchbar-settings-background-color);
|
||||
}
|
||||
|
||||
.searchbar_results {
|
||||
position: absolute;
|
||||
z-index: 9998;
|
||||
background-color: #fff;
|
||||
border: 1px solid lightgrey;
|
||||
background-color: var(--fhc-searchbar-results-background-color);
|
||||
border: 1px solid var(--fhc-searchbar-results-border-color);
|
||||
padding: .5rem;
|
||||
top: 100%;
|
||||
width: 100%;
|
||||
left: 0;
|
||||
right: 0;
|
||||
box-shadow: 2px 2px 4px rgba(0, 0, 0, .4);
|
||||
box-shadow: 2px 2px 4px var(--fhc-searchbar-shadow);
|
||||
}
|
||||
|
||||
.searchbar_results a{
|
||||
color: var(--fhc-searchbar-results-link-color);
|
||||
}
|
||||
/*
|
||||
.searchbar_results a:not(a~i) {
|
||||
color: inherit;
|
||||
}
|
||||
*/
|
||||
.searchbar_results a.btn {
|
||||
color: var(--fhc-searchbar-results-btn-color);
|
||||
}
|
||||
|
||||
.searchbar_results_scroller {
|
||||
@@ -35,7 +51,7 @@
|
||||
}
|
||||
|
||||
.searchbar_result {
|
||||
border-bottom: 1px solid lightgrey;
|
||||
border-bottom: 1px solid var(--fhc-searchbar-results-border-color);
|
||||
margin-bottom: 1rem;
|
||||
}
|
||||
|
||||
|
||||
@@ -1,23 +1,24 @@
|
||||
:root{
|
||||
--fhc-switches-checked-bg: var(--fhc-light, white);
|
||||
--fhc-switches-unchecked-bg: var(--fhc-disabled, var(--bs-gray-600));
|
||||
--fhc-switches-shadow: var(--fhc-shadow-20, rgba(108, 117, 125,.25));
|
||||
}
|
||||
|
||||
.fhc-switches:checked {
|
||||
background-color: white !important;
|
||||
border-color: white !important;
|
||||
background-color: var(--fhc-switches-checked-bg) !important;
|
||||
border-color: transparent;
|
||||
background-position: right center !important;
|
||||
background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%23000000'/%3e%3c/svg%3e") !important;
|
||||
background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='black'/%3e%3c/svg%3e") !important;
|
||||
}
|
||||
|
||||
.fhc-switches {
|
||||
background-color: var(--bs-gray-600) !important;
|
||||
border-color: var(--bs-gray-600) !important;
|
||||
background-color: var(--fhc-switches-unchecked-bg) !important;
|
||||
border-color: transparent;
|
||||
background-position: left center !important;
|
||||
background-image: url("data:image/svg+xml,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='-4 -4 8 8'%3e%3ccircle r='3' fill='%238e99a3'/%3e%3c/svg%3e") !important;
|
||||
}
|
||||
|
||||
.fhc-switches:focus {
|
||||
box-shadow: 0 0 0 .25rem rgba(108, 117, 125,.25);
|
||||
box-shadow: 0 0 0 .25rem var(--fhc-switches-shadow);
|
||||
}
|
||||
|
||||
/*.form-switch .form-check-input:checked {
|
||||
|
||||
|
||||
rgb(52, 58, 64)*/
|
||||
|
||||
|
||||
@@ -3,9 +3,9 @@
|
||||
Author : bambi
|
||||
*/
|
||||
:root {
|
||||
--fhc-verticalsplit-vsplitter-bg-color: #eee;
|
||||
--fhc-verticalsplit-vsplitter-border-color: #eee;
|
||||
--fhc-verticalsplit-vsplitter-splitactions-color: #000;
|
||||
--fhc-verticalsplit-vsplitter-bg-color: var(--fhc-background, #eee);
|
||||
--fhc-verticalsplit-vsplitter-border-color: var(--fhc-border, #eee);
|
||||
--fhc-verticalsplit-vsplitter-splitactions-color: var(--fhc-dark, #000);
|
||||
}
|
||||
|
||||
.verticalsplitted {
|
||||
|
||||
@@ -24,46 +24,6 @@
|
||||
border-color: #DEE2E6 !important;
|
||||
}
|
||||
|
||||
.bg-info-subtle{
|
||||
background-color: #D9EDF7 !important;
|
||||
color: #31708F !important;
|
||||
border-style: solid !important;
|
||||
border-width: 1px !important;
|
||||
border-color: #BCE8F1 !important;
|
||||
}
|
||||
|
||||
.bg-warning-subtle{
|
||||
background-color: #FFF3CD !important;
|
||||
color: #664D03 !important;
|
||||
border-style: solid !important;
|
||||
border-width: 1px !important;
|
||||
border-color: #FFE69C !important;
|
||||
}
|
||||
|
||||
.bg-success-subtle{
|
||||
background-color: #D1E7DD !important;
|
||||
color: #0A3622 !important;
|
||||
border-style: solid !important;
|
||||
border-width: 1px !important;
|
||||
border-color: #A3CFBB !important;
|
||||
}
|
||||
|
||||
.bg-danger-subtle{
|
||||
background-color: #F8D7DA !important;
|
||||
color: #672B31 !important;
|
||||
border-style: solid !important;
|
||||
border-width: 1px !important;
|
||||
border-color: #F1AEB5 !important;
|
||||
}
|
||||
|
||||
.bg-primary-subtle{
|
||||
background-color: #CFE2FF !important;
|
||||
color: #052C65 !important;
|
||||
border-style: solid !important;
|
||||
border-width: 1px !important;
|
||||
border-color: #9EC5FE !important;
|
||||
}
|
||||
|
||||
|
||||
/* html attribute disabled and title don't work together, sets the pointer-event to auto in order to see the title toolip */
|
||||
.btn:disabled {
|
||||
|
||||
@@ -0,0 +1,288 @@
|
||||
/* css overrides for static cms content */
|
||||
@import './default_cms_fixes.css';
|
||||
|
||||
/* colors */
|
||||
:root {
|
||||
|
||||
--fhc-black-10: black;
|
||||
--fhc-black-20: #1d2024;
|
||||
--fhc-black-30: #212529;
|
||||
--fhc-black-40: #292b2a;
|
||||
--fhc-black-50: #2B3035;
|
||||
--fhc-black-60: #2c3136;
|
||||
--fhc-black-70: #343a40;
|
||||
|
||||
--fhc-white-10: #FFFFFF;
|
||||
--fhc-white-20: #f6f6f6;
|
||||
--fhc-white-30: #eceff1;
|
||||
--fhc-white-40: #e9ecef;
|
||||
--fhc-white-50: #dee2e6;
|
||||
--fhc-white-60: #d5dae0;
|
||||
--fhc-white-70: #ced4da;
|
||||
--fhc-white-80: #c7cbcf;
|
||||
--fhc-white-90: #aeb3b8;
|
||||
|
||||
--fhc-gray-10: #858f97;
|
||||
--fhc-gray-20: #72777A;
|
||||
--fhc-gray-30: #616568;
|
||||
--fhc-gray-40: #495057;
|
||||
|
||||
--fhc-blue-10: #0a57ca;
|
||||
--fhc-blue-20: #79b7d8;
|
||||
/* --fhc-blue-20: #00649c;*/
|
||||
--fhc-blue-30: #00598d;
|
||||
/*--fhc-blue-40: #005585;*/
|
||||
--fhc-blue-40: #61aed8;
|
||||
--fhc-blue-50: #00507e;
|
||||
|
||||
--fhc-blue-primary: #006095;
|
||||
--fhc-blue-primary-highlight: #0086CB;
|
||||
|
||||
--fhc-red-10: #842029;
|
||||
--fhc-red-20: #800000;
|
||||
|
||||
--fhc-green-10: #008000;
|
||||
|
||||
--fhc-beige-10: rgba(245, 233, 215, 0.5);
|
||||
--fhc-beige-20: rgba(172, 153, 125, 0.5);
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
:root.light {
|
||||
|
||||
|
||||
/* fhc base colors */
|
||||
--fhc-primary: var(--fhc-blue-primary);
|
||||
--fhc-primary-highlight: var(--fhc-blue-primary-highlight);
|
||||
|
||||
--fhc-secondary: var(--fhc-white-20);
|
||||
--fhc-secondary-highlight: var(--fhc-white-40);
|
||||
|
||||
--fhc-tertiary: var(--fhc-white-40);
|
||||
--fhc-tertiary-highlight: var(--fhc-white-60);
|
||||
|
||||
--fhc-fourth: var(--fhc-white-60);
|
||||
--fhc-fourth-highlight: var(--fhc-white-80);
|
||||
|
||||
--fhc-fifth: var(--fhc-white-80);
|
||||
--fhc-fifth-highlight: var(--fhc-white-90);
|
||||
|
||||
/*background*/
|
||||
--fhc-background: var(--fhc-white-10);
|
||||
--fhc-background-highlight: var(--fhc-white-60);
|
||||
|
||||
/*text*/
|
||||
--fhc-text: var(--fhc-black-30);
|
||||
|
||||
/* shadows and borders */
|
||||
--fhc-shadow-20: rgba(0, 0, 0, 0.2);
|
||||
--fhc-shadow-40: rgba(0, 0, 0, 0.4);
|
||||
--fhc-shadow-60: rgba(0, 0, 0, 0.6);
|
||||
--fhc-shadow-80: rgba(0, 0, 0, 0.8);
|
||||
--fhc-box-shadow: var(--fhc-white-50);
|
||||
--fhc-border: var(--fhc-white-50);
|
||||
--fhc-border-highlight: var(--fhc-gray-40);
|
||||
|
||||
/* links */
|
||||
--fhc-link: var(--fhc-blue-10);
|
||||
|
||||
/* disabled */
|
||||
--fhc-disabled: var(--fhc-gray-10);
|
||||
|
||||
/* status colors */
|
||||
--fhc-danger: var(--fhc-red-10);
|
||||
--fhc-success: var(--fhc-green-10);
|
||||
--fhc-dark: var(--fhc-black-30);
|
||||
--fhc-light: var(--fhc-white-50);
|
||||
|
||||
--fhc-cis-menu-lvl-1-color: var(--fhc-white-50);
|
||||
}
|
||||
|
||||
:root.dark {
|
||||
|
||||
/* fhc base colors */
|
||||
--fhc-primary: var(--fhc-blue-primary);
|
||||
--fhc-primary-highlight: var(--fhc-blue-primary-highlight);
|
||||
|
||||
--fhc-secondary: var(--fhc-black-50);
|
||||
--fhc-secondary-highlight: var(--fhc-black-70);
|
||||
|
||||
--fhc-tertiary: var(--fhc-black-70);
|
||||
--fhc-tertiary-highlight: var(--fhc-gray-40);
|
||||
|
||||
--fhc-danger: var(--fhc-red-10);
|
||||
|
||||
/*background*/
|
||||
--fhc-background: var(--fhc-black-30);
|
||||
--fhc-background-highlight: var(--fhc-black-20);
|
||||
|
||||
/*text*/
|
||||
--fhc-text: var(--fhc-white-50);
|
||||
|
||||
/* shadows and borders */
|
||||
--fhc-shadow-20: rgba(125, 125, 125, 0.2);
|
||||
--fhc-shadow-40: rgba(125, 125, 125, 0.4);
|
||||
--fhc-shadow-60: rgba(125, 125, 125, 0.6);
|
||||
--fhc-shadow-80: rgba(125, 125, 125, 0.8);
|
||||
--fhc-box-shadow: var(--fhc-gray-40);
|
||||
--fhc-border: var(--fhc-gray-40);
|
||||
--fhc-border-highlight: var(--fhc-white-90);
|
||||
|
||||
/* links */
|
||||
--fhc-link: var(--fhc-white-70);
|
||||
|
||||
/* disabled */
|
||||
--fhc-disabled: var(--fhc-gray-10);
|
||||
|
||||
/* status colors */
|
||||
--fhc-danger: var(--fhc-red-10);
|
||||
--fhc-success: var(--fhc-green-10);
|
||||
--fhc-dark: var(--fhc-black-50);
|
||||
--fhc-light: var(--fhc-white-70);
|
||||
|
||||
}
|
||||
|
||||
:root.purple {
|
||||
|
||||
--fhc-purple-primary: rgb(150, 120, 255);
|
||||
--fhc-purple-primary-highlight: rgb(170, 140, 255);
|
||||
--fhc-purple-5: rgb(245, 240, 255);
|
||||
--fhc-purple-10: rgb(235, 225, 255);
|
||||
--fhc-purple-20: rgb(220, 200, 255);
|
||||
--fhc-purple-30: rgb(200, 170, 255);
|
||||
--fhc-purple-40: rgb(180, 140, 240);
|
||||
--fhc-purple-50: rgb(160, 110, 225);
|
||||
--fhc-purple-60: rgb(140, 90, 210);
|
||||
--fhc-purple-70: rgb(120, 70, 195);
|
||||
--fhc-purple-80: rgb(100, 50, 180);
|
||||
--fhc-purple-90: rgb(80, 30, 165);
|
||||
|
||||
/* fhc base colors */
|
||||
--fhc-primary: var(--fhc-purple-primary-highlight);
|
||||
--fhc-primary-highlight: var(--fhc-purple-primary);
|
||||
|
||||
--fhc-secondary: var(--fhc-purple-20);
|
||||
--fhc-secondary-highlight: var(--fhc-purple-40);
|
||||
|
||||
--fhc-tertiary: var(--fhc-purple-30);
|
||||
--fhc-tertiary-highlight: var(--fhc-purple-50);
|
||||
|
||||
/* background */
|
||||
--fhc-background: var(--fhc-purple-5);
|
||||
--fhc-background-highlight: var(--fhc-purple-10);
|
||||
|
||||
/* text */
|
||||
--fhc-text: var(--fhc-black-20);
|
||||
|
||||
/* shadows and borders */
|
||||
--fhc-shadow-20: rgba(150, 100, 200, 0.2);
|
||||
--fhc-shadow-40: rgba(150, 100, 200, 0.4);
|
||||
--fhc-shadow-60: rgba(150, 100, 200, 0.6);
|
||||
--fhc-shadow-80: rgba(150, 100, 200, 0.8);
|
||||
--fhc-box-shadow: var(--fhc-white-50);
|
||||
--fhc-border: var(--fhc-white-50);
|
||||
--fhc-border-highlight: var(--fhc-gray-40);
|
||||
|
||||
/* links */
|
||||
--fhc-link: var(--fhc-black-50);
|
||||
|
||||
/* disabled */
|
||||
--fhc-disabled: var(--fhc-purple-20);
|
||||
|
||||
/* status colors */
|
||||
--fhc-danger: var(--fhc-red-10);
|
||||
--fhc-success: var(--fhc-green-10);
|
||||
--fhc-dark: var(--fhc-black-20);
|
||||
--fhc-light: var(--fhc-white-70);
|
||||
|
||||
}
|
||||
|
||||
/* fhc primary*/
|
||||
html.dark .bg-primary,
|
||||
html.dark .btn-primary,
|
||||
html.dark .btn-outline-primary {
|
||||
background-color: var(--fhc-primary) !important;
|
||||
border-color: var(--fhc-primary) !important;
|
||||
color: white;
|
||||
}
|
||||
|
||||
html.dark .btn-outline-primary:hover,
|
||||
html.dark .btn-primary:hover {
|
||||
filter: brightness(90%);
|
||||
}
|
||||
|
||||
html.dark .text-primary {
|
||||
color: var(--fhc-primary) !important;
|
||||
}
|
||||
|
||||
html.dark .btn-outline-primary,
|
||||
html.dark .border-primary {
|
||||
border-color: var(--fhc-primary) !important;
|
||||
}
|
||||
|
||||
/* fhc danger*/
|
||||
html.dark .bg-danger,
|
||||
html.dark .btn-danger,
|
||||
html.dark .btn-outline-danger {
|
||||
background-color: var(--fhc-danger) !important;
|
||||
border-color: var(--fhc-danger) !important;
|
||||
color: white;
|
||||
}
|
||||
|
||||
html.dark .btn-outline-danger:hover,
|
||||
html.dark .btn-danger:hover {
|
||||
filter: brightness(90%);
|
||||
}
|
||||
|
||||
html.dark .text-danger {
|
||||
color: var(--fhc-danger) !important;
|
||||
}
|
||||
|
||||
html.dark .border-danger {
|
||||
border-color: var(--fhc-danger) !important;
|
||||
}
|
||||
|
||||
|
||||
html.dark .tabulator,
|
||||
html.dark .tabulator .tabulator-header,
|
||||
html.dark .tabulator .tabulator-header .tabulator-col,
|
||||
html.dark .tabulator .tabulator-table,
|
||||
html.dark .tabulator .tabulator-row {
|
||||
background-color: var(--fhc-tertiary) !important;
|
||||
color: var(--fhc-text) !important;
|
||||
border-color: var(--fhc-border) !important;
|
||||
}
|
||||
|
||||
html.dark .tabulator .tabulator-cell {
|
||||
background-color: var(--fhc-tertiary) !important;
|
||||
border-color: var(--fhc-border) !important;
|
||||
}
|
||||
|
||||
html.dark .tabulator .tabulator-header .tabulator-col:hover {
|
||||
background-color: var(--fhc-tertiary) !important;
|
||||
}
|
||||
|
||||
.p-paginator{
|
||||
background-color: var(--fhc-background) !important;
|
||||
}
|
||||
|
||||
.p-paginator .p-paginator-pages .p-paginator-page.p-highlight,
|
||||
.p-dropdown-panel .p-dropdown-items .p-dropdown-item.p-highlight {
|
||||
background-color: var(--fhc-primary) !important;
|
||||
border-color: var(--fhc-primary) !important;
|
||||
color: var(--fhc-light) !important;
|
||||
}
|
||||
|
||||
.p-paginator .p-paginator-pages .p-paginator-page,
|
||||
.p-paginator .p-paginator-next,
|
||||
.p-paginator .p-paginator-prev,
|
||||
.p-paginator .p-paginator-first,
|
||||
.p-paginator .p-paginator-last {
|
||||
color: var(--fhc-primary) !important;
|
||||
}
|
||||
|
||||
.p-link:focus {
|
||||
box-shadow: 0 0 0 0.2rem rgba(var(--fhc-primary), 0.5) !important;
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
/* css overrides for dark mode */
|
||||
html.dark #fhc-cms-content *[style*="color"] {
|
||||
color: var(--fhc-text) !important;
|
||||
}
|
||||
|
||||
/* fhc cms classes */
|
||||
html.dark #fhc-cms-content a {
|
||||
color: var(--fhc-link);
|
||||
}
|
||||
|
||||
html.dark #fhc-cms-content img {
|
||||
background-color: var(--fhc-text);
|
||||
color: var(--fhc-background);
|
||||
}
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 10 KiB |
@@ -18,15 +18,15 @@
|
||||
export default {
|
||||
getRoomInfo(ort_kurzbz, start_date, end_date) {
|
||||
return {
|
||||
method: 'get',
|
||||
url: '/api/frontend/v1/Stundenplan/getRoomplan',
|
||||
method: 'post',
|
||||
url: '/api/frontend/v1/LvPlan/getRoomplan',
|
||||
params: { ort_kurzbz, start_date, end_date }
|
||||
};
|
||||
},
|
||||
getStundenplan(start_date, end_date, lv_id) {
|
||||
getLvPlan(start_date, end_date, lv_id) {
|
||||
return {
|
||||
method: 'get',
|
||||
url: '/api/frontend/v1/Stundenplan/getStundenplan',
|
||||
url: '/api/frontend/v1/LvPlan/getLvPlan',
|
||||
params: { start_date, end_date, lv_id }
|
||||
};
|
||||
},
|
||||
@@ -34,33 +34,44 @@ export default {
|
||||
// TODO(chris): seems to be called from nowhere?
|
||||
return {
|
||||
method: 'get',
|
||||
url: '/api/frontend/v1/Stundenplan/Stunden'
|
||||
url: '/api/frontend/v1/LvPlan/Stunden'
|
||||
};
|
||||
},
|
||||
getOrtReservierungen(ort_kurzbz, start_date, end_date) {
|
||||
return {
|
||||
method: 'get',
|
||||
url: `/api/frontend/v1/Stundenplan/Reservierungen/${ort_kurzbz}`,
|
||||
method: 'post',
|
||||
url: `/api/frontend/v1/LvPlan/getReservierungen/${ort_kurzbz}`,
|
||||
params: { start_date, end_date }
|
||||
};
|
||||
},
|
||||
getStundenplanReservierungen(start_date, end_date) {
|
||||
getLvPlanReservierungen(start_date, end_date) {
|
||||
return {
|
||||
method: 'get',
|
||||
url: '/api/frontend/v1/Stundenplan/Reservierungen',
|
||||
method: 'post',
|
||||
url: '/api/frontend/v1/LvPlan/getReservierungen',
|
||||
params: { start_date, end_date }
|
||||
};
|
||||
},
|
||||
getLehreinheitStudiensemester(lehreinheit_id) {
|
||||
return {
|
||||
method: 'get',
|
||||
url: `/api/frontend/v1/Stundenplan/getLehreinheitStudiensemester/${lehreinheit_id}`
|
||||
url: `/api/frontend/v1/LvPlan/getLehreinheitStudiensemester/${lehreinheit_id}`
|
||||
};
|
||||
},
|
||||
studiensemesterDateInterval(date) {
|
||||
return {
|
||||
method: 'get',
|
||||
url: `/api/frontend/v1/Stundenplan/studiensemesterDateInterval/${date}`
|
||||
url: `/api/frontend/v1/LvPlan/studiensemesterDateInterval/${date}`
|
||||
};
|
||||
},
|
||||
LvPlanEvents(start_date, end_date, lv_id) {
|
||||
return {
|
||||
method: 'get',
|
||||
url: '/api/frontend/v1/LvPlan/LvPlanEvents',
|
||||
params: {
|
||||
start_date: start_date,
|
||||
end_date: end_date,
|
||||
lv_id: lv_id
|
||||
}
|
||||
};
|
||||
},
|
||||
};
|
||||
@@ -16,10 +16,15 @@
|
||||
*/
|
||||
|
||||
export default {
|
||||
getView(uid) {
|
||||
|
||||
profilViewData(uid) {
|
||||
let url = "/api/frontend/v1/Profil/profilViewData";
|
||||
if(uid){
|
||||
url += `/${uid}`;
|
||||
}
|
||||
return {
|
||||
method: 'get',
|
||||
url: `/api/frontend/v1/Profil/getView/${uid}`
|
||||
url: url
|
||||
};
|
||||
},
|
||||
fotoSperre(value) {
|
||||
@@ -69,5 +74,5 @@ export default {
|
||||
method: 'get',
|
||||
url: '/api/frontend/v1/Profil/getAllNationen'
|
||||
};
|
||||
}
|
||||
},
|
||||
};
|
||||
@@ -61,6 +61,13 @@ export default {
|
||||
params: dms
|
||||
};
|
||||
},
|
||||
updateProfilbild(dms) {
|
||||
return {
|
||||
method: 'post',
|
||||
url: `/api/frontend/v1/ProfilUpdate/updateProfilbild`,
|
||||
params: dms
|
||||
};
|
||||
},
|
||||
getProfilRequestFiles(requestID) {
|
||||
return {
|
||||
method: 'get',
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
|
||||
export default {
|
||||
|
||||
loadRenderers() {
|
||||
return {
|
||||
method: 'get',
|
||||
url: '/api/frontend/v1/RendererLoader/GetRenderers',
|
||||
params: {
|
||||
}
|
||||
};
|
||||
},
|
||||
}
|
||||
@@ -22,7 +22,7 @@ import filter from "./filter.js";
|
||||
import studstatus from "./studstatus.js";
|
||||
import profil from "./profil.js";
|
||||
import profilUpdate from "./profilUpdate.js";
|
||||
import stundenplan from "./stundenplan.js";
|
||||
import lvPlan from "./lvPlan.js";
|
||||
import bookmark from "./bookmark.js";
|
||||
import stv from "./stv.js";
|
||||
import notiz from "./notiz.js";
|
||||
@@ -39,6 +39,7 @@ import studiengang from "./studiengang.js";
|
||||
import menu from "./menu.js";
|
||||
import dashboard from "./dashboard.js";
|
||||
import authinfo from "./authinfo.js";
|
||||
import studium from "./studium.js";
|
||||
|
||||
export default {
|
||||
search,
|
||||
@@ -49,7 +50,7 @@ export default {
|
||||
studstatus,
|
||||
profil,
|
||||
profilUpdate,
|
||||
stundenplan,
|
||||
lvPlan,
|
||||
bookmark,
|
||||
stv,
|
||||
notiz,
|
||||
@@ -66,4 +67,5 @@ export default {
|
||||
studiengang,
|
||||
menu,
|
||||
authinfo,
|
||||
studium,
|
||||
};
|
||||
|
||||
@@ -18,5 +18,80 @@ export default {
|
||||
`/api/frontend/v1/Lehre/Pruefungen/${lehrveranstaltung_id}`
|
||||
, {}
|
||||
);
|
||||
},
|
||||
getStudentProjektarbeiten(uid) {
|
||||
return this.$fhcApi.get(
|
||||
`/api/frontend/v1/Lehre/getStudentProjektarbeiten/${uid}`
|
||||
, {}
|
||||
);
|
||||
},
|
||||
getStudentProjektabgaben(detail) {
|
||||
return this.$fhcApi.get(
|
||||
`/api/frontend/v1/Lehre/getStudentProjektabgaben`
|
||||
, {
|
||||
projektarbeit_id: detail.projektarbeit_id,
|
||||
student_uid: detail.student_uid
|
||||
}
|
||||
);
|
||||
},
|
||||
postStudentProjektarbeitEndupload(formData) {
|
||||
const url = '/api/frontend/v1/Lehre/postStudentProjektarbeitEndupload';
|
||||
const headers = {Headers: { "Content-Type": "multipart/form-data" }}
|
||||
return this.$fhcApi.post(url, formData, headers)
|
||||
},
|
||||
postStudentProjektarbeitZwischenabgabe(formData) {
|
||||
const url = '/api/frontend/v1/Lehre/postStudentProjektarbeitZwischenabgabe';
|
||||
const headers = {Headers: { "Content-Type": "multipart/form-data" }}
|
||||
return this.$fhcApi.post(url, formData, headers)
|
||||
},
|
||||
getStudentProjektarbeitAbgabeFile(paabgabe_id, student_uid) {
|
||||
const url = `/Cis/Abgabetool/getStudentProjektarbeitAbgabeFile?paabgabe_id=${paabgabe_id}&student_uid=${student_uid}`;
|
||||
|
||||
window.location = FHC_JS_DATA_STORAGE_OBJECT.app_root + FHC_JS_DATA_STORAGE_OBJECT.ci_router + url
|
||||
},
|
||||
getMitarbeiterProjektarbeiten(uid, all) {
|
||||
return this.$fhcApi.get(
|
||||
`/api/frontend/v1/Lehre/getMitarbeiterProjektarbeiten?showall=${all}`
|
||||
, {}
|
||||
);
|
||||
},
|
||||
postProjektarbeitAbgabe(termin) {
|
||||
const payload = {
|
||||
paabgabe_id: termin.paabgabe_id,
|
||||
paabgabetyp_kurzbz: termin.bezeichnung.paabgabetyp_kurzbz,
|
||||
datum: termin.datum,
|
||||
fixtermin: termin.fixtermin,
|
||||
insertvon: termin.insertvon,
|
||||
kurzbz: termin.kurzbz,
|
||||
projektarbeit_id: termin.projektarbeit_id
|
||||
}
|
||||
const url = '/api/frontend/v1/Lehre/postProjektarbeitAbgabe';
|
||||
|
||||
return this.$fhcApi.post(url, payload, null)
|
||||
|
||||
},
|
||||
deleteProjektarbeitAbgabe(paabgabe_id) {
|
||||
const payload = {
|
||||
paabgabe_id
|
||||
}
|
||||
const url = '/api/frontend/v1/Lehre/deleteProjektarbeitAbgabe';
|
||||
|
||||
return this.$fhcApi.post(url, payload, null)
|
||||
},
|
||||
postSerientermin(datum, paabgabetyp_kurzbz, bezeichnung, kurzbz, projektarbeit_ids) {
|
||||
const payload = {
|
||||
datum, paabgabetyp_kurzbz, bezeichnung, kurzbz, projektarbeit_ids
|
||||
}
|
||||
const url = '/api/frontend/v1/Lehre/postSerientermin';
|
||||
|
||||
return this.$fhcApi.post(url, payload, null)
|
||||
},
|
||||
fetchDeadlines(person_id) {
|
||||
const payload = {
|
||||
person_id
|
||||
}
|
||||
const url = '/api/frontend/v1/Lehre/fetchDeadlines';
|
||||
|
||||
return this.$fhcApi.post(url, payload, null)
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
|
||||
export default {
|
||||
getRoomInfo(ort_kurzbz, start_date, end_date) {
|
||||
return this.$fhcApi.post(
|
||||
'/api/frontend/v1/LvPlan/getRoomplan',
|
||||
{ ort_kurzbz, start_date, end_date}
|
||||
);
|
||||
},
|
||||
getStunden() {
|
||||
return this.$fhcApi.get(
|
||||
'/api/frontend/v1/LvPlan/Stunden',
|
||||
{}
|
||||
);
|
||||
},
|
||||
getOrtReservierungen(ort_kurzbz, start_date, end_date) {
|
||||
return this.$fhcApi.post(
|
||||
`/api/frontend/v1/LvPlan/getReservierungen/${ort_kurzbz}`,
|
||||
{ start_date, end_date}
|
||||
);
|
||||
},
|
||||
getLvPlanReservierungen(start_date, end_date) {
|
||||
return this.$fhcApi.post(
|
||||
'/api/frontend/v1/LvPlan/getReservierungen',
|
||||
{ start_date, end_date }
|
||||
);
|
||||
},
|
||||
getLehreinheitStudiensemester(lehreinheit_id) {
|
||||
return this.$fhcApi.get(
|
||||
`/api/frontend/v1/LvPlan/getLehreinheitStudiensemester/${lehreinheit_id}`,
|
||||
{}
|
||||
);
|
||||
},
|
||||
studiensemesterDateInterval(date) {
|
||||
return this.$fhcApi.get(
|
||||
`/api/frontend/v1/LvPlan/studiensemesterDateInterval/${date}`,
|
||||
{}
|
||||
);
|
||||
},
|
||||
LvPlanEvents(start_date, end_date, lv_id) {
|
||||
return this.$fhcApi.get(
|
||||
'/api/frontend/v1/LvPlan/LvPlanEvents',
|
||||
{ start_date, end_date, lv_id }
|
||||
);
|
||||
},
|
||||
|
||||
|
||||
};
|
||||
@@ -7,4 +7,19 @@ export default {
|
||||
{ ort_kurzbz: ort_kurbz }
|
||||
);
|
||||
},
|
||||
getRooms(datum, von, bis, typ, personenanzahl = 0) {
|
||||
return this.$fhcApi.get(
|
||||
FHC_JS_DATA_STORAGE_OBJECT.app_root +
|
||||
FHC_JS_DATA_STORAGE_OBJECT.ci_router +
|
||||
"/api/frontend/v1/Ort/getRooms",
|
||||
{ datum, von, bis, typ, personenanzahl }
|
||||
);
|
||||
},
|
||||
getRoomTypes() {
|
||||
return this.$fhcApi.get(
|
||||
FHC_JS_DATA_STORAGE_OBJECT.app_root +
|
||||
FHC_JS_DATA_STORAGE_OBJECT.ci_router +
|
||||
"/api/frontend/v1/Ort/getTypes"
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
export default {
|
||||
|
||||
getStudiensemester: function () {
|
||||
return this.$fhcApi.get(
|
||||
'/components/Cis/Mylv/Studiensemester',
|
||||
{}
|
||||
);
|
||||
},
|
||||
|
||||
getAllStudienSemester: function (studiensemester=undefined, studiengang=undefined, semester=undefined, studienplan=undefined) {
|
||||
return this.$fhcApi.get(
|
||||
'/api/frontend/v1/Studium/getStudienAllSemester',
|
||||
{studiensemester, studiengang, semester, studienplan}
|
||||
);
|
||||
},
|
||||
|
||||
getStudiengaengeForStudienSemester: function (studiensemester) {
|
||||
return this.$fhcApi.get(
|
||||
`/api/frontend/v1/Studium/getStudiengaengeForStudienSemester/${studiensemester}`,
|
||||
{}
|
||||
);
|
||||
},
|
||||
getStudienplaeneBySemester: function (studiengang, studiensemester) {
|
||||
return this.$fhcApi.get(
|
||||
`/api/frontend/v1/Studium/getStudienplaeneBySemester`,
|
||||
{
|
||||
studiengang,
|
||||
studiensemester,
|
||||
}
|
||||
);
|
||||
},
|
||||
getLvPlanForStudiensemester: function (studiensemester, lvid) {
|
||||
return this.$fhcApi.get(
|
||||
`/api/frontend/v1/LvPlan/getLvPlanForStudiensemester/${studiensemester}/${lvid}`,
|
||||
{
|
||||
}
|
||||
);
|
||||
},
|
||||
getLvEvaluierungInfo: function (studiensemester_kurzbz, lvid) {
|
||||
return this.$fhcApi.get(
|
||||
`/api/frontend/v1/Studium/getLvEvaluierungInfo/${studiensemester_kurzbz}/${lvid}`,
|
||||
{
|
||||
}
|
||||
);
|
||||
},
|
||||
|
||||
}
|
||||
@@ -1,45 +0,0 @@
|
||||
|
||||
export default {
|
||||
getRoomInfo(ort_kurzbz, start_date, end_date) {
|
||||
return this.$fhcApi.get(
|
||||
'/api/frontend/v1/Stundenplan/getRoomplan',
|
||||
{ ort_kurzbz, start_date, end_date}
|
||||
);
|
||||
},
|
||||
getStundenplan(start_date, end_date, lv_id) {
|
||||
return this.$fhcApi.get(
|
||||
'/api/frontend/v1/Stundenplan/getStundenplan',
|
||||
{ start_date, end_date, lv_id }
|
||||
);
|
||||
},
|
||||
getStunden() {
|
||||
return this.$fhcApi.get(
|
||||
'/api/frontend/v1/Stundenplan/Stunden',
|
||||
{}
|
||||
);
|
||||
},
|
||||
getOrtReservierungen(ort_kurzbz, start_date, end_date) {
|
||||
return this.$fhcApi.get(
|
||||
`/api/frontend/v1/Stundenplan/Reservierungen/${ort_kurzbz}`,
|
||||
{ start_date, end_date}
|
||||
);
|
||||
},
|
||||
getStundenplanReservierungen(start_date, end_date) {
|
||||
return this.$fhcApi.get(
|
||||
'/api/frontend/v1/Stundenplan/Reservierungen',
|
||||
{ start_date, end_date }
|
||||
);
|
||||
},
|
||||
getLehreinheitStudiensemester(lehreinheit_id) {
|
||||
return this.$fhcApi.get(
|
||||
`/api/frontend/v1/Stundenplan/getLehreinheitStudiensemester/${lehreinheit_id}`,
|
||||
{}
|
||||
);
|
||||
},
|
||||
studiensemesterDateInterval(date) {
|
||||
return this.$fhcApi.get(
|
||||
`/api/frontend/v1/Stundenplan/studiensemesterDateInterval/${date}`,
|
||||
{}
|
||||
);
|
||||
},
|
||||
};
|
||||
@@ -2,6 +2,7 @@ import FhcSearchbar from "../components/searchbar/searchbar.js";
|
||||
import CisMenu from "../components/Cis/Menu.js";
|
||||
import PluginsPhrasen from '../plugins/Phrasen.js';
|
||||
import ApiSearchbar from '../api/factory/searchbar.js';
|
||||
import Theme from "../plugin/Theme.js";
|
||||
|
||||
const app = Vue.createApp({
|
||||
name: 'CisApp',
|
||||
@@ -12,6 +13,7 @@ const app = Vue.createApp({
|
||||
data: function() {
|
||||
return {
|
||||
searchbaroptions: {
|
||||
origin: "cis",
|
||||
cssclass: "",
|
||||
calcheightonly: true,
|
||||
types: [
|
||||
@@ -122,4 +124,5 @@ app.use(primevue.config.default, {
|
||||
}
|
||||
})
|
||||
app.use(PluginsPhrasen);
|
||||
app.use(Theme);
|
||||
app.mount('#cis-header');
|
||||
|
||||
@@ -1,20 +1,34 @@
|
||||
import FhcDashboard from '../../components/Dashboard/Dashboard.js';
|
||||
import PluginsPhrasen from '../../plugins/Phrasen.js';
|
||||
import Theme from '../../plugin/Theme.js';
|
||||
import contrast from '../../directives/contrast.js';
|
||||
import {setScrollbarWidth} from "../../helpers/CssVarCalcHelpers.js";
|
||||
import Stundenplan, {DEFAULT_MODE_STUNDENPLAN} from "../../components/Cis/Stundenplan/Stundenplan.js";
|
||||
import LvPlan, {DEFAULT_MODE_LVPLAN} from "../../components/Cis/LvPlan/LvPlan.js";
|
||||
import MylvStudent from "../../components/Cis/Mylv/Student.js";
|
||||
import Profil from "../../components/Cis/Profil/Profil.js";
|
||||
import Raumsuche from "../../components/Cis/Raumsuche/Raumsuche.js";
|
||||
import CmsNews from "../../components/Cis/Cms/News.js";
|
||||
import CmsContent from "../../components/Cis/Cms/Content.js";
|
||||
import Info from "../../components/Cis/Mylv/Semester/Studiengang/Lv/Info.js";
|
||||
import RoomInformation, {DEFAULT_MODE_RAUMINFO} from "../../components/Cis/Mylv/RoomInformation.js";
|
||||
import AbgabetoolStudent from "../../components/Cis/Abgabetool/AbgabetoolStudent.js";
|
||||
import AbgabetoolMitarbeiter from "../../components/Cis/Abgabetool/AbgabetoolMitarbeiter.js";
|
||||
import DeadlineOverview from "../../components/Cis/Abgabetool/DeadlineOverview.js";
|
||||
import Studium from "../../components/Cis/Studium/Studium.js";
|
||||
|
||||
import ApiRenderers from '../../api/factory/renderers.js';
|
||||
|
||||
const ciPath = FHC_JS_DATA_STORAGE_OBJECT.app_root.replace(/(https:|)(^|\/\/)(.*?\/)/g, '') + FHC_JS_DATA_STORAGE_OBJECT.ci_router;
|
||||
|
||||
const router = VueRouter.createRouter({
|
||||
history: VueRouter.createWebHistory(`/${ciPath}`),
|
||||
routes: [
|
||||
{
|
||||
path: `/Cis/Studium`,
|
||||
name: 'Studium',
|
||||
component: Studium,
|
||||
props: true
|
||||
},
|
||||
{
|
||||
path: `/Cis/Profil/View/:uid`,
|
||||
name: 'ProfilView',
|
||||
@@ -27,7 +41,30 @@ const router = VueRouter.createRouter({
|
||||
component: Profil,
|
||||
props: true
|
||||
},
|
||||
|
||||
{
|
||||
path: `/Cis/Abgabetool/Student/:student_uid_prop?`,
|
||||
name: 'AbgabetoolStudent',
|
||||
component: AbgabetoolStudent,
|
||||
props: true
|
||||
},
|
||||
{
|
||||
path: `/Cis/Abgabetool/Mitarbeiter`,
|
||||
name: 'AbgabetoolMitarbeiter',
|
||||
component: AbgabetoolMitarbeiter,
|
||||
props: true
|
||||
},
|
||||
{
|
||||
path: `/Cis/Abgabetool/Deadlines/:person_uid_prop?`,
|
||||
name: 'DeadlineOverview',
|
||||
component: DeadlineOverview,
|
||||
props: true
|
||||
},
|
||||
{
|
||||
path: `/Cis/Raumsuche`,
|
||||
name: 'Raumsuche',
|
||||
component: Raumsuche,
|
||||
props: true
|
||||
},
|
||||
// Redirect old links to new format
|
||||
{
|
||||
path: "/CisVue/Cms/getRoomInformation/:ort_kurzbz",
|
||||
@@ -113,13 +150,13 @@ const router = VueRouter.createRouter({
|
||||
},
|
||||
// Redirect old links to new format
|
||||
{
|
||||
// only trigger on first param being numeric to avoid paths like "Stundenplan/Month" entering here
|
||||
path: "/Cis/Stundenplan/:lv_id(\\d+)",
|
||||
name: "StundenplanOld",
|
||||
component: Stundenplan,
|
||||
// only trigger on first param being numeric to avoid paths like "LvPlan/Month" entering here
|
||||
path: "/Cis/LvPlan/:lv_id(\\d+)",
|
||||
name: "LvPlanOld",
|
||||
component: LvPlan,
|
||||
redirect: (to) => {
|
||||
return { // redirect to longer Stundenplan url and map params
|
||||
name: "Stundenplan",
|
||||
return { // redirect to longer LvPlan url and map params
|
||||
name: "LvPlan",
|
||||
params: {
|
||||
lv_id: to.params.lv_id
|
||||
},
|
||||
@@ -127,9 +164,9 @@ const router = VueRouter.createRouter({
|
||||
},
|
||||
},
|
||||
{
|
||||
path: `/Cis/Stundenplan/:mode?/:focus_date?/:lv_id?`,
|
||||
name: 'Stundenplan',
|
||||
component: Stundenplan,
|
||||
path: `/Cis/LvPlan/:mode?/:focus_date?/:lv_id?`,
|
||||
name: 'LvPlan',
|
||||
component: LvPlan,
|
||||
props: (route) => { // validate and set mode/focus date if for some reason missing
|
||||
const validModes = ["Month", "Week", "Day"];
|
||||
|
||||
@@ -137,7 +174,7 @@ const router = VueRouter.createRouter({
|
||||
const mode = route.params.mode &&
|
||||
validModes.includes(route.params.mode.charAt(0).toUpperCase() + route.params.mode.slice(1).toLowerCase())
|
||||
? route.params.mode.charAt(0).toUpperCase() + route.params.mode.slice(1).toLowerCase()
|
||||
: DEFAULT_MODE_STUNDENPLAN;
|
||||
: DEFAULT_MODE_LVPLAN;
|
||||
|
||||
// default to today date if not provided or string forms invalid date
|
||||
const d = new Date(route.params.focus_date)
|
||||
@@ -156,9 +193,9 @@ const router = VueRouter.createRouter({
|
||||
// missing mode or focus_date -> set defaults
|
||||
if (!to.params.mode || !to.params.focus_date) {
|
||||
next({
|
||||
name: "Stundenplan",
|
||||
name: "LvPlan",
|
||||
params: {
|
||||
mode: to.params.mode || DEFAULT_MODE_STUNDENPLAN,
|
||||
mode: to.params.mode || DEFAULT_MODE_LVPLAN,
|
||||
focus_date: to.params.focus_date || new Date().toISOString().split("T")[0],
|
||||
lv_id: to.params.lv_id
|
||||
}
|
||||
@@ -200,7 +237,8 @@ const router = VueRouter.createRouter({
|
||||
const app = Vue.createApp({
|
||||
name: 'FhcApp',
|
||||
data: () => ({
|
||||
appSideMenuEntries: {}
|
||||
appSideMenuEntries: {},
|
||||
renderers: null,
|
||||
}),
|
||||
components: {},
|
||||
computed: {
|
||||
@@ -210,7 +248,8 @@ const app = Vue.createApp({
|
||||
},
|
||||
provide() {
|
||||
return { // provide injectable & watchable language property
|
||||
language: Vue.computed(() => this.$p.user_language)
|
||||
language: Vue.computed(() => this.$p.user_language),
|
||||
renderers: Vue.computed(() => this.renderers),
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
@@ -220,7 +259,8 @@ const app = Vue.createApp({
|
||||
},
|
||||
handleClick(event) {
|
||||
const target = event.target.closest('a');
|
||||
|
||||
|
||||
if(target?.id == 'skiplink') return
|
||||
if (target && this.isInternalRoute(target.href)) {
|
||||
const url = new URL(target.href)
|
||||
|
||||
@@ -247,6 +287,45 @@ const app = Vue.createApp({
|
||||
}
|
||||
}
|
||||
},
|
||||
async created(){
|
||||
await this.$api
|
||||
.call(ApiRenderers.loadRenderers())
|
||||
.then(res => res.data)
|
||||
.then(data => {
|
||||
for (let rendertype of Object.keys(data)) {
|
||||
let modalTitle = null;
|
||||
let modalContent = null;
|
||||
let calendarEvent = null;
|
||||
if (data[rendertype].modalTitle)
|
||||
modalTitle = Vue.markRaw(Vue.defineAsyncComponent(() => import(data[rendertype].modalTitle)));
|
||||
if (data[rendertype].modalContent)
|
||||
modalContent = Vue.markRaw(Vue.defineAsyncComponent(() => import(data[rendertype].modalContent)));
|
||||
if (data[rendertype].calendarEvent)
|
||||
calendarEvent = Vue.markRaw(Vue.defineAsyncComponent(() => import(data[rendertype].calendarEvent)));
|
||||
|
||||
if (data[rendertype].calendarEventStyles){
|
||||
var head = document.head;
|
||||
if(!head.querySelector(`link[href="${data[rendertype].calendarEventStyles}"]`)){
|
||||
var link = document.createElement("link");
|
||||
link.type = "text/css";
|
||||
link.rel = "stylesheet";
|
||||
link.href = data[rendertype].calendarEventStyles;
|
||||
head.appendChild(link);
|
||||
}
|
||||
}
|
||||
|
||||
if(this.renderers === null) {
|
||||
this.renderers = {};
|
||||
}
|
||||
if (!this.renderers[rendertype]) {
|
||||
this.renderers[rendertype] = {}
|
||||
}
|
||||
this.renderers[rendertype].modalTitle = modalTitle;
|
||||
this.renderers[rendertype].modalContent = modalContent;
|
||||
this.renderers[rendertype].calendarEvent = calendarEvent;
|
||||
}
|
||||
});
|
||||
},
|
||||
mounted() {
|
||||
document.addEventListener('click', this.handleClick);
|
||||
},
|
||||
@@ -264,6 +343,8 @@ app.use(primevue.config.default, {
|
||||
tooltip: 8000
|
||||
}
|
||||
})
|
||||
app.directive('tooltip', primevue.tooltip);
|
||||
app.use(PluginsPhrasen);
|
||||
app.use(Theme);
|
||||
app.directive('contrast', contrast);
|
||||
app.mount('#fhccontent');
|
||||
app.mount('#fhccontent');
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import {CoreNavigationCmpt} from '../components/navigation/Navigation.js';
|
||||
import DashboardAdmin from '../components/Dashboard/Admin.js';
|
||||
import Phrases from "../plugin/Phrasen.js"
|
||||
|
||||
Vue.createApp({
|
||||
name: 'DashboardAdminApp',
|
||||
@@ -12,4 +13,4 @@ Vue.createApp({
|
||||
},
|
||||
mounted() {
|
||||
}
|
||||
}).mount('#main');
|
||||
}).use(Phrases).mount('#main');
|
||||
@@ -16,7 +16,7 @@ export default {
|
||||
:class="this.cModalClass"
|
||||
:id="this.id"
|
||||
:aria-labelledby="this.id + '_label'" aria-hidden="true" tabindex="-1">
|
||||
<div class="modal-dialog" :class="this.cModalDialogClass">
|
||||
<div class="modal-dialog modal-dialog-scrollable" :class="this.cModalDialogClass">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" :id="this.id + '_label'">
|
||||
|
||||
@@ -1,17 +0,0 @@
|
||||
import CalendarHeader from './Header.js';
|
||||
|
||||
export default {
|
||||
components: {
|
||||
CalendarHeader
|
||||
},
|
||||
inject: [
|
||||
'date',
|
||||
'focusDate',
|
||||
'size'
|
||||
],
|
||||
emits: [
|
||||
'updateMode',
|
||||
'change:range',
|
||||
'input'
|
||||
]
|
||||
}
|
||||
@@ -0,0 +1,308 @@
|
||||
import BaseDraganddrop from './Base/DragAndDrop.js';
|
||||
import BaseHeader from './Base/Header.js';
|
||||
import BaseSlider from './Base/Slider.js';
|
||||
import BsModal from '../Bootstrap/Modal.js';
|
||||
|
||||
import CalClick from '../../directives/Calendar/Click.js';
|
||||
|
||||
export default {
|
||||
name: "CalendarBase",
|
||||
components: {
|
||||
BaseDraganddrop,
|
||||
BaseHeader,
|
||||
BaseSlider,
|
||||
BsModal
|
||||
},
|
||||
directives: {
|
||||
CalClick
|
||||
},
|
||||
provide() {
|
||||
return {
|
||||
locale: Vue.computed(() => this.locale),
|
||||
timezone: Vue.computed(() => this.timezone),
|
||||
timeGrid: Vue.computed(() => this.timeGrid),
|
||||
draggableEvents: Vue.computed(() => {
|
||||
if (!this.draggableEvents)
|
||||
return () => false;
|
||||
|
||||
if (Array.isArray(this.draggableEvents))
|
||||
return event => this.draggableEvents.includes(event.type);
|
||||
if (this.draggableEvents instanceof Function)
|
||||
return this.draggableEvents;
|
||||
|
||||
return () => true;
|
||||
}),
|
||||
dropableEvents: Vue.computed(() => {
|
||||
if (!this.onDrop)
|
||||
return () => false;
|
||||
|
||||
if (Array.isArray(this.dropableEvents))
|
||||
return item => this.dropableEvents.includes(item.type);
|
||||
if (this.dropableEvents instanceof Function)
|
||||
return this.dropableEvents;
|
||||
|
||||
return () => true;
|
||||
}),
|
||||
hasDragoverFunc: Vue.computed(() => this.onDragover),
|
||||
mode: Vue.computed(() => this.mode)
|
||||
};
|
||||
},
|
||||
props: {
|
||||
locale: {
|
||||
type: String,
|
||||
default: 'de'
|
||||
},
|
||||
timezone: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
date: {
|
||||
type: [Date, String, Number, luxon.DateTime],
|
||||
default: props => luxon.DateTime.now().setZone(props.timezone).startOf('day')
|
||||
},
|
||||
modes: {
|
||||
type: Object,
|
||||
required: true,
|
||||
default: {}
|
||||
// TODO(chris): verfication functions
|
||||
},
|
||||
mode: String,
|
||||
modeOptions: Object,
|
||||
events: {
|
||||
type: Array,
|
||||
default: []
|
||||
},
|
||||
backgrounds: {
|
||||
type: Array,
|
||||
default: []
|
||||
},
|
||||
showBtns: Boolean,
|
||||
btnMonth: {
|
||||
type: Boolean,
|
||||
default: undefined
|
||||
},
|
||||
btnWeek: {
|
||||
type: Boolean,
|
||||
default: undefined
|
||||
},
|
||||
btnDay: {
|
||||
type: Boolean,
|
||||
default: undefined
|
||||
},
|
||||
btnList: {
|
||||
type: Boolean,
|
||||
default: undefined
|
||||
},
|
||||
timeGrid: Array,
|
||||
draggableEvents: [Boolean, Array, Function],
|
||||
dropableEvents: [Boolean, Array, Function],
|
||||
onDragover: Function,
|
||||
onDrop: Function
|
||||
},
|
||||
emits: [
|
||||
"click:next",
|
||||
"click:prev",
|
||||
"click:mode",
|
||||
"click:event",
|
||||
"click:day",
|
||||
"click:week",
|
||||
"update:date",
|
||||
"update:mode",
|
||||
"update:range",
|
||||
"drop"
|
||||
],
|
||||
data() {
|
||||
return {
|
||||
internalView: null,
|
||||
internalDate: null,
|
||||
modalEvent: null
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
convertedEvents() {
|
||||
return this.events.map(orig => ({
|
||||
id: orig.type + orig[orig.type + '_id'],
|
||||
type: orig.type,
|
||||
start: luxon.DateTime.fromISO(orig.isostart).setZone(this.timezone),
|
||||
end: luxon.DateTime.fromISO(orig.isoend).setZone(this.timezone),
|
||||
orig
|
||||
}));
|
||||
},
|
||||
convertedBackgrounds() {
|
||||
return this.backgrounds.map(bg => {
|
||||
const res = { ...bg };
|
||||
if (res.start) {
|
||||
if (Number.isInteger(res.start))
|
||||
res.start = luxon.DateTime.fromMillis(res.start, { zone: this.timezone, locale: this.locale });
|
||||
else if (res.start instanceof Date)
|
||||
res.start = luxon.DateTime.fromJSDate(res.start, { zone: this.timezone, locale: this.locale });
|
||||
else if (typeof res.start ===
|
||||
'string' || res.start instanceof String)
|
||||
res.start = luxon.DateTime.fromISO(res.start, { zone: this.timezone, locale: this.locale });
|
||||
}
|
||||
if (res.end) {
|
||||
if (Number.isInteger(res.end))
|
||||
res.end = luxon.DateTime.fromMillis(res.end, { zone: this.timezone, locale: this.locale });
|
||||
else if (res.end instanceof Date)
|
||||
res.end = luxon.DateTime.fromJSDate(res.end, { zone: this.timezone, locale: this.locale });
|
||||
else if (typeof res.end ===
|
||||
'string' || res.end instanceof String)
|
||||
res.end = luxon.DateTime.fromISO(res.end, { zone: this.timezone, locale: this.locale });
|
||||
}
|
||||
return res;
|
||||
});
|
||||
},
|
||||
sDate() {
|
||||
if (this.date instanceof luxon.DateTime)
|
||||
return this.date;
|
||||
return luxon.DateTime.fromJSDate(new Date(this.date)).setZone(this.timezone);
|
||||
},
|
||||
cDate: {
|
||||
get() {
|
||||
const date = this.internalDate ? this.internalDate : this.sDate;
|
||||
return date.setLocale(this.locale);
|
||||
},
|
||||
set(value) {
|
||||
this.internalDate = value;
|
||||
this.$emit('update:date', value, this.cMode);
|
||||
}
|
||||
},
|
||||
sMode() {
|
||||
// choose default mode
|
||||
let mode = this.mode;
|
||||
if (mode)
|
||||
mode = mode.toLowerCase();
|
||||
if (!mode || !this.modes[mode])
|
||||
mode = Object.keys(this.modes).find(Boolean); // start with first entry as active mode
|
||||
return mode || '';
|
||||
},
|
||||
cMode: {
|
||||
get() {
|
||||
return this.internalView ? this.internalView : this.sMode;
|
||||
},
|
||||
set(value) {
|
||||
this.internalView = value;
|
||||
this.$emit('update:mode', value, this.cDate);
|
||||
}
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
sDate(n, o) {
|
||||
if (this.sDate.isValid && !this.sDate.hasSame(this.internalDate, 'day'))
|
||||
this.internalDate = this.sDate;
|
||||
},
|
||||
sMode() {
|
||||
if (this.sMode)
|
||||
this.internalView = this.sMode;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
clickPrev() {
|
||||
const evt = new Event('click:prev', {cancelable: true});
|
||||
this.$emit('click:prev', evt);
|
||||
if (evt.defaultPrevented)
|
||||
return;
|
||||
|
||||
// default: switch page
|
||||
this.$refs.mode.prevPage();
|
||||
},
|
||||
clickNext() {
|
||||
const evt = new Event('click:next', {cancelable: true});
|
||||
this.$emit('click:next', evt);
|
||||
if (evt.defaultPrevented)
|
||||
return;
|
||||
|
||||
// default: switch page
|
||||
this.$refs.mode.nextPage();
|
||||
},
|
||||
handleClickDefaults(evt) {
|
||||
// TODO(chris): implement
|
||||
switch (evt.detail.source) {
|
||||
case 'day':
|
||||
if (this.cMode != 'day' && this.modes['day']) {
|
||||
evt.stopPropagation();
|
||||
this.cDate = evt.detail.value;
|
||||
this.cMode = 'day';
|
||||
}
|
||||
break;
|
||||
case 'week':
|
||||
if (this.cMode != 'week' && this.modes['week']) {
|
||||
evt.stopPropagation();
|
||||
this.cDate = luxon.DateTime.fromObject({
|
||||
localWeekNumber: evt.detail.value.number,
|
||||
localWeekYear: evt.detail.value.year
|
||||
}, {
|
||||
zone: this.cDate.zoneName,
|
||||
locale: this.cDate.locale
|
||||
});
|
||||
this.cMode = 'week';
|
||||
}
|
||||
break;
|
||||
}
|
||||
},
|
||||
onDropItem(evt, start, end) {
|
||||
this.$emit('drop', evt, start, end);
|
||||
},
|
||||
showEventModal(eventObj) {
|
||||
this.modalEvent = eventObj;
|
||||
this.$refs.modal.show();
|
||||
},
|
||||
hideEventModal() {
|
||||
if (this.modalEvent)
|
||||
this.modalEvent.closeFn = undefined;
|
||||
this.$refs.modal.hide();
|
||||
this.modalEvent = null;
|
||||
},
|
||||
onModalHidden() {
|
||||
if (this.modalEvent.closeFn)
|
||||
this.modalEvent.closeFn();
|
||||
}
|
||||
},
|
||||
template: /* html */`
|
||||
<div class="fhc-calendar-base h-100">
|
||||
<base-draganddrop
|
||||
class="card h-100"
|
||||
:events="convertedEvents"
|
||||
:backgrounds="convertedBackgrounds"
|
||||
@drop="onDropItem"
|
||||
v-cal-click:container
|
||||
@cal-click-default.capture="handleClickDefaults"
|
||||
>
|
||||
<base-header
|
||||
class="card-header"
|
||||
v-model:date="cDate"
|
||||
v-model:mode="cMode"
|
||||
@prev="clickPrev"
|
||||
@next="clickNext"
|
||||
@click:mode="$emit('click:mode', $event)"
|
||||
:btn-day="!!modes['day'] && (btnDay || (showBtns && btnDay !== false))"
|
||||
:btn-week="!!modes['week'] && (btnWeek || (showBtns && btnWeek !== false))"
|
||||
:btn-month="!!modes['month'] && (btnMonth || (showBtns && btnMonth !== false))"
|
||||
:btn-list="!!modes['list'] && (btnList || (showBtns && btnList !== false))"
|
||||
:mode-options="modeOptions ? modeOptions[cMode] : undefined"
|
||||
>
|
||||
<slot name="actions" />
|
||||
</base-header>
|
||||
<component
|
||||
:is="modes ? modes[cMode] : null || 'div'"
|
||||
ref="mode"
|
||||
v-model:current-date="cDate"
|
||||
@update:range="$emit('update:range', $event)"
|
||||
@request-modal-open="showEventModal"
|
||||
@request-modal-close="hideEventModal"
|
||||
v-bind="modeOptions ? modeOptions[cMode] : null || {}"
|
||||
>
|
||||
<template v-slot="slot"><slot v-bind="slot" /></template>
|
||||
</component>
|
||||
</base-draganddrop>
|
||||
<bs-modal ref="modal" dialog-class="modal-lg" body-class="" @hidden-bs-modal="onModalHidden">
|
||||
<template #title>
|
||||
<slot v-if="modalEvent" v-bind="{mode: 'eventheader', event: modalEvent.event}" />
|
||||
</template>
|
||||
<template #default>
|
||||
<slot v-if="modalEvent" v-bind="{mode: 'event', event: modalEvent.event}" />
|
||||
</template>
|
||||
</bs-modal>
|
||||
</div>
|
||||
`
|
||||
}
|
||||
@@ -0,0 +1,162 @@
|
||||
import DragAndDrop from '../../../helpers/DragAndDrop.js';
|
||||
|
||||
import CalDnd from '../../../directives/Calendar/DragAndDrop.js';
|
||||
|
||||
/**
|
||||
* TODO(chris): this needs serious rework!
|
||||
*/
|
||||
|
||||
export default {
|
||||
name: "CalendarDragAndDrop",
|
||||
directives: {
|
||||
CalDnd
|
||||
},
|
||||
provide() {
|
||||
return {
|
||||
events: Vue.computed(() => this.correctedEvents),
|
||||
backgrounds: Vue.computed(() => this.backgrounds),
|
||||
dropAllowed: Vue.computed(() => this.dragging && this.dropAllowed)
|
||||
};
|
||||
},
|
||||
inject: {
|
||||
mode: "mode",
|
||||
dropableEvents: "dropableEvents"
|
||||
},
|
||||
props: {
|
||||
events: Array,
|
||||
backgrounds: Array
|
||||
},
|
||||
emits: [
|
||||
"drop"
|
||||
],
|
||||
data() {
|
||||
return {
|
||||
dragging: false,
|
||||
allowed: false,
|
||||
draggedInternalEvent: null,
|
||||
draggedExternalEvent: null,
|
||||
targetTimestamp: 0,
|
||||
targetGridEnds: null,
|
||||
dropAllowed: false,
|
||||
|
||||
shadowPreview: false // TODO(chris): IMPLEMENT! (use background instead of event as preview)
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
correctedEvents() {
|
||||
if (this.dragging) {
|
||||
if (this.draggedInternalEvent) {
|
||||
const index = this.events.findIndex(e => e.id == this.draggedInternalEvent.id);
|
||||
if (this.previewEvent && !this.shadowPreview)
|
||||
return this.events.toSpliced(index, 1, this.previewEvent);
|
||||
else
|
||||
return this.events.toSpliced(index, 1);
|
||||
}
|
||||
if (this.previewEvent && !this.shadowPreview)
|
||||
return [...this.events, this.previewEvent];
|
||||
}
|
||||
|
||||
return this.events;
|
||||
},
|
||||
correctedBackgrounds() {
|
||||
if (this.dragging) {
|
||||
if (this.shadowPreview) {
|
||||
// TODO(chris): how to get the length
|
||||
return [...this.backgrounds, {
|
||||
start: new Date(this.targetTimestamp),
|
||||
class: 'shadow-preview'
|
||||
}];
|
||||
}
|
||||
}
|
||||
|
||||
return this.backgrounds;
|
||||
},
|
||||
previewEvent() {
|
||||
if (!this.dragging || !this.dropAllowed)
|
||||
return null;
|
||||
if (!this.targetTimestamp)
|
||||
return null;
|
||||
|
||||
const event = this.draggedInternalEvent || this.draggedExternalEvent;
|
||||
|
||||
if (!event)
|
||||
return null;
|
||||
|
||||
// TODO(chris): calculate length correctly from orig
|
||||
let length = event.end - event.start;
|
||||
if (this.targetGridEnds)
|
||||
length = this.targetGridEnds.find(end => end >= this.targetTimestamp + length) - this.targetTimestamp;
|
||||
|
||||
return {
|
||||
orig: event.orig,
|
||||
start: this.targetTimestamp,
|
||||
end: this.targetTimestamp + length
|
||||
};
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
onDragstart(evt) {
|
||||
DragAndDrop.setTransferData(evt.detail.originalEvent, evt.detail.item.orig);
|
||||
this.draggedInternalEvent = evt.detail.item;
|
||||
},
|
||||
onDragend() {
|
||||
this.draggedInternalEvent = null;
|
||||
this.dragging = false;
|
||||
},
|
||||
onDragenter(evt) {
|
||||
this.dragging = true;
|
||||
|
||||
if (!this.draggedInternalEvent) {
|
||||
const event = DragAndDrop.getValidTransferData(evt.detail.originalEvent);
|
||||
if (event) {
|
||||
this.draggedExternalEvent = {
|
||||
id: event.id,
|
||||
type: event.type,
|
||||
start: event.isostart
|
||||
? luxon.DateTime.fromISO(event.isostart).setZone(this.timezone)
|
||||
: luxon.DateTime.local().setZone(this.timezone),
|
||||
end: event.isoend
|
||||
? luxon.DateTime.fromISO(event.isoend).setZone(this.timezone)
|
||||
: luxon.DateTime.local().setZone(this.timezone),
|
||||
orig: event
|
||||
};
|
||||
} else {
|
||||
this.draggedExternalEvent = null;
|
||||
}
|
||||
this.dropAllowed = this.dropableEvents(event, this.mode);
|
||||
} else {
|
||||
this.dropAllowed = this.dropableEvents(this.draggedInternalEvent, this.mode);
|
||||
}
|
||||
},
|
||||
onDragleave() {
|
||||
this.dragging = false;
|
||||
},
|
||||
onDragchange(evt) {
|
||||
this.targetTimestamp = evt.detail.timestamp;
|
||||
|
||||
this.targetGridEnds = evt.detail.ends || null;
|
||||
},
|
||||
onDrop(evt) {
|
||||
if (!this.dragging || !this.dropAllowed)
|
||||
return;
|
||||
|
||||
this.$emit('drop', evt, this.previewEvent.start, this.previewEvent.end);
|
||||
this.dropAllowed = false;
|
||||
this.dragging = false;
|
||||
}
|
||||
},
|
||||
template: `
|
||||
<div
|
||||
class="fhc-calendar-base-draganddrop"
|
||||
@calendar-dragstart="onDragstart"
|
||||
@calendar-dragend="onDragend"
|
||||
v-cal-dnd:dropcage
|
||||
@calendar-dragenter="onDragenter"
|
||||
@calendar-dragleave="onDragleave"
|
||||
@calendar-dragchange="onDragchange"
|
||||
@drop="onDrop"
|
||||
>
|
||||
<slot />
|
||||
</div>
|
||||
`
|
||||
}
|
||||
@@ -0,0 +1,435 @@
|
||||
import GridLine from './Grid/Line.js';
|
||||
import GridLineEvent from './Grid/Line/Event.js';
|
||||
|
||||
import CalDnd from '../../../directives/Calendar/DragAndDrop.js';
|
||||
|
||||
export default {
|
||||
name: "CalendarGrid",
|
||||
components: {
|
||||
GridLine,
|
||||
GridLineEvent
|
||||
},
|
||||
directives: {
|
||||
CalDnd
|
||||
},
|
||||
inject: {
|
||||
originalEvents: "events",
|
||||
originalBackgrounds: "backgrounds",
|
||||
dropAllowed: "dropAllowed"
|
||||
},
|
||||
provide() {
|
||||
return {
|
||||
flipAxis: Vue.computed(() => this.flipAxis),
|
||||
axisRow: Vue.computed(() => this.axisRow)
|
||||
};
|
||||
},
|
||||
props: {
|
||||
axisMain: {
|
||||
type: Array,
|
||||
required: true,
|
||||
validator(value) {
|
||||
return value.every(item => item instanceof luxon.DateTime);
|
||||
}
|
||||
},
|
||||
axisParts: {
|
||||
type: Array,
|
||||
required: true,
|
||||
validator(value) {
|
||||
return value.every(item =>
|
||||
item instanceof luxon.Duration
|
||||
|| Number.isInteger(item)
|
||||
|| (
|
||||
(
|
||||
item.start instanceof luxon.Duration
|
||||
|| Number.isInteger(item.start)
|
||||
) && (
|
||||
item.end instanceof luxon.Duration
|
||||
|| Number.isInteger(item.end)
|
||||
)
|
||||
)
|
||||
);
|
||||
}
|
||||
},
|
||||
flipAxis: Boolean,
|
||||
allDayEvents: Boolean,
|
||||
axisMainCollapsible: Boolean,
|
||||
snapToGrid: Boolean
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
dragging: false,
|
||||
resizeObserver: null,
|
||||
mutationObserver: null,
|
||||
userScroll: true
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
axisRow() {
|
||||
return this.flipAxis ? 'column' : 'row';
|
||||
},
|
||||
axisCol() {
|
||||
return this.flipAxis ? 'row' : 'column';
|
||||
},
|
||||
axisPartsWithBreaks() {
|
||||
return this.axisParts.reduce((res, tu, index) => {
|
||||
const start = tu.start || tu;
|
||||
const end = tu.end;
|
||||
|
||||
if (res.length) {
|
||||
const lastTuEnd = res.pop();
|
||||
if (Array.isArray(lastTuEnd)) {
|
||||
res.push({
|
||||
start: lastTuEnd[0],
|
||||
end: start,
|
||||
index: lastTuEnd[1]
|
||||
});
|
||||
} else if (lastTuEnd != start) {
|
||||
// add pause
|
||||
res.push({
|
||||
start: lastTuEnd,
|
||||
end: start
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
if (!end) {
|
||||
res.push([start, index]);
|
||||
} else {
|
||||
res.push({
|
||||
start,
|
||||
end,
|
||||
index
|
||||
});
|
||||
res.push(end);
|
||||
}
|
||||
return res;
|
||||
}, []).slice(0, -1);
|
||||
},
|
||||
axisPartsSave() {
|
||||
if (!this.axisParts[this.axisParts.length - 1].end)
|
||||
return this.axisParts.slice(0, -1);
|
||||
return this.axisParts;
|
||||
},
|
||||
start() {
|
||||
return this.axisPartsWithBreaks[0].start;
|
||||
},
|
||||
end() {
|
||||
return this.axisPartsWithBreaks[this.axisPartsWithBreaks.length - 1].end;
|
||||
},
|
||||
ends() {
|
||||
const ends = [];
|
||||
const partsEnds = this.axisPartsWithBreaks
|
||||
.filter(p => p.index !== undefined)
|
||||
.map(p => p.end);
|
||||
for (var date of this.axisMain)
|
||||
for (var part of partsEnds)
|
||||
ends.push(date.plus(part));
|
||||
|
||||
return ends;
|
||||
},
|
||||
axisMainBorders() {
|
||||
return this.axisMain.reduce(
|
||||
(res, curr) => res.concat([curr.plus(this.start), curr.plus(this.end)]),
|
||||
[]
|
||||
);
|
||||
},
|
||||
eventsAllDay() {
|
||||
if (!this.allDayEvents)
|
||||
return [];
|
||||
return this.mapIntoMainAxis(this.originalEvents.filter(event => event.orig.allDayEvent));
|
||||
},
|
||||
eventsNormal() {
|
||||
if (!this.allDayEvents)
|
||||
return this.events;
|
||||
return this.mapIntoMainAxis(this.originalEvents.filter(event => !event.orig.allDayEvent));
|
||||
},
|
||||
events() {
|
||||
return this.mapIntoMainAxis(this.originalEvents);
|
||||
},
|
||||
backgrounds() {
|
||||
return this.mapIntoMainAxis(this.originalBackgrounds);
|
||||
},
|
||||
hasValidEvents() {
|
||||
return this.events.find(e => e.length);
|
||||
},
|
||||
styleGridCols() {
|
||||
let cols = 'repeat(' + this.axisMain.length + ', 1fr)';
|
||||
if (this.axisMainCollapsible) {
|
||||
if (this.hasValidEvents)
|
||||
cols = this.events
|
||||
.map(e => e.length
|
||||
? '1fr'
|
||||
: 'var(--fhc-calendar-axis-collapsible, .5fr)')
|
||||
.join(' ');
|
||||
}
|
||||
return cols;
|
||||
},
|
||||
styleGridRows() {
|
||||
const gridlines = {};
|
||||
|
||||
this.axisPartsWithBreaks.forEach(part => {
|
||||
let ts = part.start.toMillis();
|
||||
if (!gridlines[ts])
|
||||
gridlines[ts] = ['t_' + ts];
|
||||
if (part.index !== undefined)
|
||||
gridlines[ts].push('ps_' + part.index);
|
||||
ts = part.end.toMillis();
|
||||
if (!gridlines[ts])
|
||||
gridlines[ts] = ['t_' + ts];
|
||||
if (part.index !== undefined)
|
||||
gridlines[ts].push('pe_' + part.index);
|
||||
});
|
||||
|
||||
this.eventsNormal.forEach((events, mainIndex) => {
|
||||
let day = this.axisMain[mainIndex];
|
||||
events.forEach(event => {
|
||||
if (!event.startsHere && !event.endsHere)
|
||||
return;
|
||||
|
||||
if (event.startsHere) {
|
||||
let ts = event.start.diff(day).toMillis();
|
||||
if (!gridlines[ts])
|
||||
gridlines[ts] = ['t_' + ts, 'e_' + ts];
|
||||
}
|
||||
if (event.endsHere) {
|
||||
let ts = event.end.diff(day).toMillis();
|
||||
if (!gridlines[ts])
|
||||
gridlines[ts] = ['t_' + ts, 'e_' + ts];
|
||||
}
|
||||
});
|
||||
});
|
||||
|
||||
return Object.keys(gridlines).sort((a,b) => parseInt(a)-parseInt(b)).map((start, i, keys) => {
|
||||
let end = keys[i + 1];
|
||||
if (!end) {
|
||||
gridlines[start].push('end');
|
||||
return '[' + gridlines[start].join(' ') + ']';
|
||||
}
|
||||
return '[' + gridlines[start].join(' ') + '] ' + (end - start) + 'fr';
|
||||
}).join(' ');
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
mapIntoMainAxis(target) {
|
||||
const result = Array.from({length: this.axisMain.length}, () => Array());
|
||||
|
||||
target.forEach(event => {
|
||||
const start = event.start || this.axisMainBorders[0].plus(-1);
|
||||
const end = event.end || this.axisMainBorders[this.axisMainBorders.length - 1].plus(1);
|
||||
|
||||
for (var i = 0; i < this.axisMain.length; i++) {
|
||||
let laneStart = this.axisMainBorders[i * 2];
|
||||
let laneEnd = this.axisMainBorders[i * 2 + 1];
|
||||
if (event.orig?.allDayEvent) {
|
||||
laneStart = laneStart.startOf('day');
|
||||
laneEnd = laneEnd.endOf('day');
|
||||
}
|
||||
if (start < laneEnd && end > laneStart) {
|
||||
const startsHere = start >= laneStart;
|
||||
const endsHere = end <= laneEnd;
|
||||
result[i].push({
|
||||
...event,
|
||||
startsHere,
|
||||
endsHere
|
||||
});
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
return result;
|
||||
},
|
||||
|
||||
/* DRAG AND DROP */
|
||||
getPageTop(el) {
|
||||
let pageTop = el.offsetTop;
|
||||
if (el.offsetParent)
|
||||
pageTop += this.getPageTop(el.offsetParent);
|
||||
return pageTop;
|
||||
},
|
||||
getPageLeft(el) {
|
||||
let pageLeft = el.offsetLeft;
|
||||
if (el.offsetParent)
|
||||
pageLeft += this.getPageLeft(el.offsetParent);
|
||||
return pageLeft;
|
||||
},
|
||||
getTimestampFromMouse(evt, dayTimestamp) {
|
||||
let mouse, mouseFrac;
|
||||
if (this.flipAxis) {
|
||||
mouse = evt.pageX - this.getPageLeft(this.$refs.body) + this.$refs.main.scrollLeft;
|
||||
mouseFrac = mouse / this.$refs.body.offsetWidth;
|
||||
} else {
|
||||
mouse = evt.pageY - this.getPageTop(this.$refs.body) + this.$refs.main.scrollTop;
|
||||
mouseFrac = mouse / this.$refs.body.offsetHeight;
|
||||
}
|
||||
|
||||
return dayTimestamp + this.start + Math.floor((this.end - this.start) * mouseFrac);
|
||||
},
|
||||
|
||||
/* SCROLLING */
|
||||
enableAutoScroll() {
|
||||
if (!this.resizeObserver)
|
||||
this.resizeObserver = new ResizeObserver(this.scrollToEarliestEvent);
|
||||
this.resizeObserver.observe(this.$refs.body);
|
||||
|
||||
if (!this.mutationObserver)
|
||||
this.mutationObserver = new MutationObserver(mutations => {
|
||||
if (mutations.some(m => m.addedNodes.length && [].some.call(m.addedNodes, el => el.matches && el.matches('.fhc-calendar-base-grid-line-event'))))
|
||||
this.scrollToEarliestEvent();
|
||||
});
|
||||
this.mutationObserver.observe(this.$refs.body, {
|
||||
subtree: true,
|
||||
childList: true
|
||||
});
|
||||
|
||||
this.scrollToEarliestEvent();
|
||||
},
|
||||
disableAutoScroll() {
|
||||
if (this.resizeObserver)
|
||||
this.resizeObserver.disconnect();
|
||||
this.resizeObserver = null;
|
||||
|
||||
if (this.mutationObserver)
|
||||
this.mutationObserver.disconnect();
|
||||
this.mutationObserver = null;
|
||||
},
|
||||
scrollToEarliestEvent() {
|
||||
const eventElements = this.$refs.scroller.querySelectorAll('.fhc-calendar-base-grid-line-event');
|
||||
const earliestEventOffset = eventElements.values()
|
||||
.reduce((res, el) => {
|
||||
const top = el.offsetTop;
|
||||
if (!res[1] || top < res[0])
|
||||
return [top, el];
|
||||
return res;
|
||||
}, [0, null]);
|
||||
|
||||
this.userScroll = false;
|
||||
if (earliestEventOffset[1]) {
|
||||
earliestEventOffset[1].scrollIntoView({ behavior: "smooth" });
|
||||
} else {
|
||||
this.$refs.scroller.scrollTo(0, 0);
|
||||
}
|
||||
}
|
||||
},
|
||||
beforeUnmount() {
|
||||
this.disableAutoScroll();
|
||||
},
|
||||
template: /* html */`
|
||||
<div
|
||||
class="fhc-calendar-base-grid"
|
||||
style="display:grid;width:100%;height:100%"
|
||||
:style="'grid-template-' + axisRow + 's:auto' + (allDayEvents ? ' auto ' : ' ') + '1fr;grid-template-' + axisCol + 's:auto ' + styleGridCols"
|
||||
>
|
||||
<div
|
||||
class="grid-header"
|
||||
style="display:grid"
|
||||
:style="'grid-template-' + axisCol + 's:subgrid;grid-' + axisCol + ':1/-1'"
|
||||
>
|
||||
<div
|
||||
v-for="(date, index) in axisMain"
|
||||
:key="index"
|
||||
class="main-header"
|
||||
:class="{'collapsed-header': axisMainCollapsible && hasValidEvents && !events[index].length}"
|
||||
:style="'grid-' + axisCol + ':' + (2+index)"
|
||||
>
|
||||
<slot name="main-header" v-bind="{ index, date }" />
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
v-if="allDayEvents"
|
||||
class="grid-allday"
|
||||
style="display:grid"
|
||||
:style="'grid-template-' + axisCol + 's:subgrid;grid-' + axisCol + ':1/-1'"
|
||||
>
|
||||
<div
|
||||
v-for="(events, index) in eventsAllDay"
|
||||
:key="index"
|
||||
class="all-day-events"
|
||||
:style="'grid-' + axisCol + ':' + (2+index)"
|
||||
>
|
||||
<grid-line-event
|
||||
v-for="(event, i) in events"
|
||||
:key="i"
|
||||
:event="event"
|
||||
>
|
||||
<template v-slot="slot">
|
||||
<slot name="event" v-bind="slot" />
|
||||
</template>
|
||||
</grid-line-event>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
ref="scroller"
|
||||
@scrollend="userScroll ? disableAutoScroll() : userScroll = true"
|
||||
style="display:grid;overflow:auto"
|
||||
:style="'grid-' + axisCol + ':1/-1;grid-template-' + axisCol + 's:subgrid'"
|
||||
>
|
||||
<div
|
||||
ref="main"
|
||||
class="grid-main"
|
||||
style="position:relative;grid-column:1/-1;grid-row:1/-1;display:grid"
|
||||
:style="'grid-template-' + axisCol + 's:subgrid;grid-template-' + axisRow + 's:' + styleGridRows"
|
||||
>
|
||||
<div
|
||||
v-for="(part, index) in axisPartsSave"
|
||||
:key="index"
|
||||
class="part-header"
|
||||
:style="'grid-' + axisCol + ':1;grid-' + axisRow + ': ps_' + index + '/pe_' + index"
|
||||
>
|
||||
<slot name="part-header" v-bind="{ index, part }" />
|
||||
</div>
|
||||
|
||||
<div
|
||||
ref="body"
|
||||
class="grid-body"
|
||||
style="display:grid;grid-template-rows:subgrid;grid-template-columns:subgrid"
|
||||
:style="'grid-' + axisCol + ':2/-1;grid-' + axisRow + ':1/-1'"
|
||||
v-cal-dnd:dropcage
|
||||
@calendar-dragenter="dragging = true"
|
||||
@calendar-dragleave="dragging = false"
|
||||
@dragover="dropAllowed ? $event.preventDefault() : null"
|
||||
>
|
||||
<template
|
||||
v-for="(date, index) in axisMain"
|
||||
:key="index"
|
||||
>
|
||||
<div
|
||||
v-for="(part, i) in axisPartsSave"
|
||||
:key="i"
|
||||
class="part-body"
|
||||
style="position:relative"
|
||||
:style="'grid-' + axisCol + ':' + (1+index) + ';grid-' + axisRow + ':ps_' + i + '/pe_' + i"
|
||||
>
|
||||
<slot name="part-body" v-bind="{ index, part }" />
|
||||
<div
|
||||
v-if="snapToGrid && dragging"
|
||||
style="position:absolute;inset:0;z-index:1"
|
||||
v-cal-dnd:dropzone.once="{date: date.plus(part.start || part), ends: ends.slice(ends.findIndex(end => end > date))}"
|
||||
></div>
|
||||
</div>
|
||||
<grid-line
|
||||
:start="date.plus(start)"
|
||||
:end="date.plus(end)"
|
||||
:date="date"
|
||||
:events="eventsNormal[index]"
|
||||
:backgrounds="backgrounds[index]"
|
||||
style="position:relative"
|
||||
:style="'grid-' + axisRow + ':1/-1;grid-' + axisCol + ':' + (1+index)"
|
||||
>
|
||||
<template #event="slot">
|
||||
<slot name="event" v-bind="slot" />
|
||||
</template>
|
||||
<template #dropzone>
|
||||
<div
|
||||
v-if="!snapToGrid && dragging"
|
||||
style="position:absolute;inset:0;z-index:1"
|
||||
v-cal-dnd:dropzone="evt => getTimestampFromMouse(evt, date)"
|
||||
></div>
|
||||
</template>
|
||||
</grid-line>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`
|
||||
}
|
||||
@@ -0,0 +1,85 @@
|
||||
import LineEvent from './Line/Event.js';
|
||||
import LineBackground from './Line/Background.js';
|
||||
|
||||
/**
|
||||
* TODO(chris):
|
||||
* Event overflow for Month mode (more-button)
|
||||
*/
|
||||
|
||||
export default {
|
||||
name: "GridLine",
|
||||
components: {
|
||||
LineEvent,
|
||||
LineBackground
|
||||
},
|
||||
inject: {
|
||||
axisRow: "axisRow"
|
||||
},
|
||||
props: {
|
||||
date: {
|
||||
type: luxon.DateTime,
|
||||
required: true
|
||||
},
|
||||
start: {
|
||||
type: luxon.DateTime,
|
||||
required: true
|
||||
},
|
||||
end: {
|
||||
type: luxon.DateTime,
|
||||
required: true
|
||||
},
|
||||
events: {
|
||||
type: Array,
|
||||
default: []
|
||||
},
|
||||
backgrounds: {
|
||||
type: Array,
|
||||
default: []
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
eventsWithRowInfo() {
|
||||
const events = [];
|
||||
this.events.forEach(event => {
|
||||
const rows = [1, -1];
|
||||
if (event.startsHere) {
|
||||
rows[0] = 't_' + event.start.diff(this.date).toMillis();
|
||||
}
|
||||
if (event.endsHere) {
|
||||
rows[1] = 't_' + event.end.diff(this.date).toMillis();
|
||||
}
|
||||
|
||||
events.push({
|
||||
...event,
|
||||
rows
|
||||
});
|
||||
});
|
||||
return events;
|
||||
}
|
||||
},
|
||||
template: /* html */`
|
||||
<div
|
||||
class="fhc-calendar-base-grid-line"
|
||||
style="position:relative;display:grid;grid-auto-flow:dense"
|
||||
:style="'grid-template-' + axisRow + 's:subgrid'"
|
||||
>
|
||||
<line-background
|
||||
v-for="bg in backgrounds"
|
||||
:start="start"
|
||||
:end="end"
|
||||
:background="bg"
|
||||
></line-background>
|
||||
<line-event
|
||||
v-for="(event, i) in eventsWithRowInfo"
|
||||
:key="i"
|
||||
:style="'grid-' + axisRow + ': ' + event.rows.join('/')"
|
||||
:event="event"
|
||||
>
|
||||
<template v-slot="slot">
|
||||
<slot name="event" v-bind="slot" />
|
||||
</template>
|
||||
</line-event>
|
||||
<slot name="dropzone" />
|
||||
</div>
|
||||
`
|
||||
}
|
||||
@@ -0,0 +1,72 @@
|
||||
export default {
|
||||
name: "GridLineBackground",
|
||||
inject: {
|
||||
flipAxis: "flipAxis"
|
||||
},
|
||||
props: {
|
||||
start: {
|
||||
type: luxon.DateTime,
|
||||
required: true
|
||||
},
|
||||
end: {
|
||||
type: luxon.DateTime,
|
||||
required: true
|
||||
},
|
||||
background: {
|
||||
type: Object,
|
||||
required: true,
|
||||
validator(value) {
|
||||
if (!value.start && !value.end)
|
||||
return false;
|
||||
if (value.start && !(value.start instanceof luxon.DateTime))
|
||||
return false;
|
||||
if (value.end && !(value.end instanceof luxon.DateTime))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
styles() {
|
||||
if (!this.background.endsHere && !this.background.startsHere)
|
||||
return this.background.style;
|
||||
|
||||
const perc = (this.end.ts - this.start.ts) / 100;
|
||||
|
||||
let border = {};
|
||||
if (this.background.startsHere)
|
||||
border[this.flipAxis ? 'left' : 'top'] = (this.background.start.diff(this.start)) / perc + '%';
|
||||
if (this.background.endsHere)
|
||||
border[this.flipAxis ? 'right' : 'bottom'] = (this.end.diff(this.background.end)) / perc + '%';
|
||||
|
||||
if (!this.background.style)
|
||||
return border;
|
||||
|
||||
return [this.background.style, border];
|
||||
},
|
||||
classes() {
|
||||
if (!this.background.endsHere && !this.background.startsHere)
|
||||
return this.background.class;
|
||||
|
||||
const result = [];
|
||||
if (this.background.class)
|
||||
result.push(this.background.class);
|
||||
if (this.background.startsHere)
|
||||
result.push('bg-begin');
|
||||
if (this.background.endsHere)
|
||||
result.push('bg-end');
|
||||
return result;
|
||||
}
|
||||
},
|
||||
template: /* html */`
|
||||
<div
|
||||
class="fhc-calendar-base-grid-line-background"
|
||||
:class="classes"
|
||||
style="position:absolute;inset:0;z-index:0"
|
||||
:style="styles"
|
||||
:title="background.title"
|
||||
>
|
||||
<span v-if="background.label">{{ background.label }}</span>
|
||||
</div>
|
||||
`
|
||||
}
|
||||
@@ -0,0 +1,57 @@
|
||||
import CalDnd from '../../../../../directives/Calendar/DragAndDrop.js';
|
||||
import CalClick from '../../../../../directives/Calendar/Click.js';
|
||||
|
||||
export default {
|
||||
name: "GridLineEvent",
|
||||
directives: {
|
||||
CalDnd,
|
||||
CalClick
|
||||
},
|
||||
inject: {
|
||||
draggableEvents: "draggableEvents",
|
||||
mode: "mode"
|
||||
},
|
||||
props: {
|
||||
event: {
|
||||
type: Object,
|
||||
required: true,
|
||||
validator(value) {
|
||||
return (value.start && value.end && value.orig);
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
isHeaderOrFooter() {
|
||||
return ['header', 'footer'].includes(this.event.orig);
|
||||
},
|
||||
draggable() {
|
||||
return !this.isHeaderOrFooter && this.draggableEvents(this.event.orig, this.mode);
|
||||
},
|
||||
classes() {
|
||||
const classes = [];
|
||||
if (this.isHeaderOrFooter) {
|
||||
classes.push('event-' + this.event.orig);
|
||||
} else {
|
||||
if (this.event.startsHere)
|
||||
classes.push('event-begin');
|
||||
if (this.event.endsHere)
|
||||
classes.push('event-end');
|
||||
}
|
||||
return classes
|
||||
}
|
||||
},
|
||||
template: /* html */`
|
||||
<div
|
||||
class="fhc-calendar-base-grid-line-event event"
|
||||
:class="classes"
|
||||
style="z-index: 1"
|
||||
:draggable="draggable"
|
||||
v-cal-dnd:draggable="event"
|
||||
v-cal-click:event="isHeaderOrFooter ? event : event.orig"
|
||||
>
|
||||
<slot :event="isHeaderOrFooter ? event : event.orig">
|
||||
{{ event.orig }}
|
||||
</slot>
|
||||
</div>
|
||||
`
|
||||
}
|
||||
@@ -0,0 +1,123 @@
|
||||
/**
|
||||
* TODO(chris): use click-directive
|
||||
*/
|
||||
import DatePicker from './Header/Datepicker.js';
|
||||
|
||||
export default {
|
||||
name: "CalendarHeader",
|
||||
components: {
|
||||
DatePicker
|
||||
},
|
||||
props: {
|
||||
date: {
|
||||
type: luxon.DateTime,
|
||||
required: true
|
||||
},
|
||||
mode: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
modeOptions: {
|
||||
type: Object,
|
||||
default: {}
|
||||
},
|
||||
btnMonth: Boolean,
|
||||
btnWeek: Boolean,
|
||||
btnDay: Boolean,
|
||||
btnList: Boolean
|
||||
},
|
||||
emits: [
|
||||
"next",
|
||||
"prev",
|
||||
"click:mode",
|
||||
"update:date",
|
||||
"update:mode"
|
||||
],
|
||||
data() {
|
||||
return {
|
||||
open: false
|
||||
};
|
||||
},
|
||||
methods: {
|
||||
clickMode(evt, mode) {
|
||||
this.$emit('click:mode', evt);
|
||||
if (!evt.defaultPrevented)
|
||||
this.$emit('update:mode', mode);
|
||||
}
|
||||
},
|
||||
template: /* html */`
|
||||
<div class="fhc-calendar-base-header">
|
||||
<div class="header-actions">
|
||||
<div class="header-userdefined">
|
||||
<slot />
|
||||
</div>
|
||||
<div class="header-modes">
|
||||
<div class="d-flex gap-1 justify-content-end" role="group">
|
||||
<button
|
||||
v-if="btnMonth"
|
||||
type="button"
|
||||
class="btn btn-outline-secondary"
|
||||
:class="{active: mode === 'month'}"
|
||||
@click="clickMode($event, 'month')"
|
||||
>
|
||||
<i class="fa fa-calendar-days"></i>
|
||||
</button>
|
||||
<button
|
||||
v-if="btnWeek"
|
||||
type="button"
|
||||
class="btn btn-outline-secondary"
|
||||
:class="{active: mode === 'week'}"
|
||||
@click="clickMode($event, 'week')"
|
||||
>
|
||||
<i class="fa fa-calendar-week"></i>
|
||||
</button>
|
||||
<button
|
||||
v-if="btnDay"
|
||||
type="button"
|
||||
class="btn btn-outline-secondary"
|
||||
:class="{active: mode === 'day'}"
|
||||
@click="clickMode($event, 'day')"
|
||||
>
|
||||
<i class="fa fa-calendar-day"></i>
|
||||
</button>
|
||||
<button
|
||||
v-if="btnList"
|
||||
type="button"
|
||||
class="btn btn-outline-secondary"
|
||||
:class="{active: mode === 'list'}"
|
||||
@click="clickMode($event, 'list')"
|
||||
>
|
||||
<i class="fa fa-table-list"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="header-picker">
|
||||
<div class="btn-group" role="group">
|
||||
<button
|
||||
class="btn btn-outline-secondary border-0"
|
||||
@click="$emit('prev')"
|
||||
:disabled="open"
|
||||
>
|
||||
<i class="fa fa-chevron-left"></i>
|
||||
</button>
|
||||
<date-picker
|
||||
:mode="mode"
|
||||
:date="date"
|
||||
@update:date="$emit('update:date', $event)"
|
||||
@open="open = true"
|
||||
@closed="open = false"
|
||||
:list-length="modeOptions.length"
|
||||
/>
|
||||
<button
|
||||
class="btn btn-outline-secondary border-0"
|
||||
@click="$emit('next')"
|
||||
:disabled="open"
|
||||
>
|
||||
<i class="fa fa-chevron-right"></i>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`
|
||||
}
|
||||
@@ -0,0 +1,116 @@
|
||||
// TODO(chris): translate aria-labels
|
||||
|
||||
export default {
|
||||
name: "CalendarHeaderDatepicker",
|
||||
components: {
|
||||
VueDatePicker
|
||||
},
|
||||
inject: [
|
||||
"locale",
|
||||
"timezone"
|
||||
],
|
||||
props: {
|
||||
date: {
|
||||
type: luxon.DateTime,
|
||||
required: true
|
||||
},
|
||||
mode: {
|
||||
type: String,
|
||||
required: true
|
||||
},
|
||||
listLength: {
|
||||
type: Number,
|
||||
default: 7
|
||||
}
|
||||
},
|
||||
emits: [
|
||||
"update:date"
|
||||
],
|
||||
computed: {
|
||||
convertedDate() {
|
||||
// convert to target TZ then strip TZ Information
|
||||
// so the datepicker can work with local times
|
||||
return this.date.setZone(this.timezone).setZone('local', { keepLocalTime: true });
|
||||
},
|
||||
current() {
|
||||
switch (this.mode) {
|
||||
case "month":
|
||||
return {month: this.convertedDate.month-1, year: this.convertedDate.year};
|
||||
case "list":
|
||||
return [this.convertedDate.startOf('day').ts, this.convertedDate.startOf('day').plus({ days: this.listLength }).ts - 1];
|
||||
case "week":
|
||||
return [this.convertedDate.startOf('week', { useLocaleWeeks: true }).ts, this.convertedDate.endOf('week', { useLocaleWeeks: true }).ts];
|
||||
case "day":
|
||||
return this.convertedDate;
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
},
|
||||
title() {
|
||||
switch (this.mode) {
|
||||
case "month":
|
||||
return this.date.toLocaleString({ month: 'long', year: 'numeric' });
|
||||
case "week":
|
||||
var year = this.date.localWeekYear;
|
||||
var week = this.date.toFormat('nn');
|
||||
return this.$p.t('calendar/year_kw', { year, week });
|
||||
case "list":
|
||||
return this.date.toLocaleString(luxon.DateTime.DATE_FULL) + '-' + this.date.plus({ days: this.listLength - 1 }).toLocaleString(luxon.DateTime.DATE_FULL);
|
||||
case "day":
|
||||
return this.date.toLocaleString(luxon.DateTime.DATE_FULL);
|
||||
default:
|
||||
return 'View not Supported';
|
||||
}
|
||||
},
|
||||
weekStart() {
|
||||
return luxon.Info.getStartOfWeek(this.date)%7;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
update(value) {
|
||||
let date;
|
||||
switch (this.mode) {
|
||||
case "month":
|
||||
value.month++;
|
||||
date = luxon.DateTime.fromObject(value).setZone(this.timezone, { keepLocalTime: true }).setLocale(this.locale);
|
||||
break;
|
||||
case "list":
|
||||
case "week":
|
||||
date = luxon.DateTime.fromJSDate(value[0]).setZone(this.timezone, { keepLocalTime: true }).setLocale(this.locale);
|
||||
break;
|
||||
case "day":
|
||||
date = luxon.DateTime.fromJSDate(value).setZone(this.timezone, { keepLocalTime: true }).setLocale(this.locale);
|
||||
break;
|
||||
default:
|
||||
return; // Don't update if the value is invalid!
|
||||
}
|
||||
this.$emit("update:date", date);
|
||||
},
|
||||
weekNumbers(date) {
|
||||
return luxon.DateTime.fromJSDate(date, { locale: this.locale }).localWeekNumber;
|
||||
}
|
||||
},
|
||||
template: /* html */`
|
||||
<vue-date-picker
|
||||
:model-value="current"
|
||||
@update:model-value="update"
|
||||
:format="() => title"
|
||||
:month-picker="mode == 'month'"
|
||||
:week-picker="mode == 'week'"
|
||||
:range="mode == 'list' ? { autoRange: listLength - 1 } : false"
|
||||
:text-input="mode == 'day'"
|
||||
:week-start="weekStart"
|
||||
:week-numbers="{ type: weekNumbers }"
|
||||
:clearable="false"
|
||||
:enable-time-picker="false"
|
||||
:config="{ keepActionRow: mode != 'month' }"
|
||||
:action-row="{ showSelect: false, showCancel: false, showNow: mode != 'month', showPreview: false }"
|
||||
auto-apply
|
||||
six-weeks
|
||||
teleport
|
||||
:locale="locale"
|
||||
:now-button-label="$p.t('calendar/today')"
|
||||
:week-num-name="$p.t('calendar/kw')"
|
||||
/>
|
||||
`
|
||||
}
|
||||
@@ -0,0 +1,39 @@
|
||||
import CalClick from '../../../../directives/Calendar/Click.js';
|
||||
|
||||
export default {
|
||||
name: "LabelDay",
|
||||
directives: {
|
||||
CalClick
|
||||
},
|
||||
props: {
|
||||
date: {
|
||||
type: luxon.DateTime,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
titleFull() {
|
||||
return this.date.toLocaleString({day: 'numeric', month: 'long', year: 'numeric'});
|
||||
},
|
||||
titleLong() {
|
||||
return this.date.toLocaleString({day: '2-digit', month: '2-digit', year: 'numeric'});
|
||||
},
|
||||
titleShort() {
|
||||
return this.date.toLocaleString({day: 'numeric', month: 'numeric'});
|
||||
},
|
||||
titleNarrow() {
|
||||
return this.date.toLocaleString({day: 'numeric'});
|
||||
}
|
||||
},
|
||||
template: /* html */`
|
||||
<div
|
||||
class="fhc-calendar-base-label-day"
|
||||
v-cal-click:day="date"
|
||||
>
|
||||
<span class="full">{{ titleFull }}</span>
|
||||
<span class="long">{{ titleLong }}</span>
|
||||
<span class="short">{{ titleShort }}</span>
|
||||
<span class="narrow">{{ titleNarrow }}</span>
|
||||
</div>
|
||||
`
|
||||
}
|
||||
@@ -0,0 +1,35 @@
|
||||
import CalClick from '../../../../directives/Calendar/Click.js';
|
||||
|
||||
export default {
|
||||
name: "LabelDow",
|
||||
directives: {
|
||||
CalClick
|
||||
},
|
||||
props: {
|
||||
date: {
|
||||
type: luxon.DateTime,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
titleLong() {
|
||||
return this.date.toLocaleString({weekday: 'long'});
|
||||
},
|
||||
titleShort() {
|
||||
return this.date.toLocaleString({weekday: 'short'});
|
||||
},
|
||||
titleNarrow() {
|
||||
return this.date.toLocaleString({weekday: 'narrow'});
|
||||
}
|
||||
},
|
||||
template: /* html */`
|
||||
<div
|
||||
class="fhc-calendar-base-label-dow"
|
||||
v-cal-click:dow="date"
|
||||
>
|
||||
<b class="long">{{ titleLong }}</b>
|
||||
<b class="short">{{ titleShort }}</b>
|
||||
<b class="narrow">{{ titleNarrow }}</b>
|
||||
</div>
|
||||
`
|
||||
}
|
||||
@@ -0,0 +1,58 @@
|
||||
export default {
|
||||
name: "LabelTime",
|
||||
props: {
|
||||
part: {
|
||||
type: [luxon.Duration, Number, Object],
|
||||
required: true,
|
||||
validator(value) {
|
||||
if (value instanceof Object) {
|
||||
if (value instanceof luxon.Duration)
|
||||
return true;
|
||||
let start_ok = true;
|
||||
let end_ok = true;
|
||||
if (value.start) {
|
||||
start_ok = (
|
||||
value.start instanceof luxon.Duration
|
||||
|| Number.isInteger(value.start)
|
||||
);
|
||||
}
|
||||
if (value.end) {
|
||||
end_ok = (
|
||||
value.end instanceof luxon.Duration
|
||||
|| Number.isInteger(value.end)
|
||||
);
|
||||
}
|
||||
return start_ok && end_ok;
|
||||
}
|
||||
return true;
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
sanitizedTimestamps() {
|
||||
return this.part.start || this.part.end ? this.part : { start: this.part };
|
||||
},
|
||||
start() {
|
||||
if (!this.sanitizedTimestamps.start)
|
||||
return null;
|
||||
return this.formatTime(this.sanitizedTimestamps.start);
|
||||
},
|
||||
end() {
|
||||
if (!this.sanitizedTimestamps.end)
|
||||
return null;
|
||||
return this.formatTime(this.sanitizedTimestamps.end);
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
formatTime(date) {
|
||||
return date.toISOTime({ suppressSeconds: true });
|
||||
}
|
||||
},
|
||||
template: `
|
||||
<div class="fhc-calendar-base-label-time">
|
||||
<span v-if="start">{{ start }}</span>
|
||||
<span v-if="end">-</span>
|
||||
<span v-if="end">{{ end }}</span>
|
||||
</div>
|
||||
`
|
||||
}
|
||||
@@ -0,0 +1,38 @@
|
||||
import CalClick from '../../../../directives/Calendar/Click.js';
|
||||
|
||||
export default {
|
||||
name: "LabelWeek",
|
||||
directives: {
|
||||
CalClick
|
||||
},
|
||||
props: {
|
||||
date: {
|
||||
type: luxon.DateTime,
|
||||
required: true
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
weeks() {
|
||||
const firstDay = this.date.startOf('week', { useLocaleWeeks: true });
|
||||
const lastDay = this.date.endOf('week', { useLocaleWeeks: true });
|
||||
|
||||
const weeks = [
|
||||
{ number: firstDay.localWeekNumber, year: firstDay.localWeekYear },
|
||||
{ number: lastDay.localWeekNumber, year: lastDay.localWeekYear }
|
||||
];
|
||||
if (weeks[0].number == weeks[1].number)
|
||||
weeks.pop();
|
||||
return weeks;
|
||||
}
|
||||
},
|
||||
template: `
|
||||
<div class="fhc-calendar-base-label-week">
|
||||
<span
|
||||
v-for="week in weeks"
|
||||
v-cal-click:week="week"
|
||||
>
|
||||
{{ week.number }}
|
||||
</span>
|
||||
</div>
|
||||
`
|
||||
}
|
||||
@@ -0,0 +1,129 @@
|
||||
export default {
|
||||
name: 'CalendarSlider',
|
||||
inject: {
|
||||
time: {
|
||||
from: "sliderTime",
|
||||
default: ".3s"
|
||||
}
|
||||
},
|
||||
emits: [
|
||||
'slid'
|
||||
],
|
||||
data() {
|
||||
return {
|
||||
target: 0,
|
||||
extrasAfter: 0,
|
||||
extrasBefore: 0,
|
||||
running: false,
|
||||
promiseResolve: null
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
itemsAfter() {
|
||||
return [...Array(this.extrasAfter)].map((i, k) => 1+k);
|
||||
},
|
||||
itemsBefore() {
|
||||
return [...Array(this.extrasBefore)].map((i, k) => k-this.extrasBefore);
|
||||
},
|
||||
styleSlider() {
|
||||
const style = {
|
||||
position: 'absolute',
|
||||
top: 0,
|
||||
left: 0,
|
||||
width: '100%',
|
||||
height: '100%'
|
||||
};
|
||||
if (this.running) {
|
||||
style.left = (-this.target * 100) + '%';
|
||||
style.transition = 'left ' + this.time + ' ease-in-out';
|
||||
}
|
||||
return style;
|
||||
},
|
||||
styleBefore() {
|
||||
return {
|
||||
position: 'absolute',
|
||||
top: 0,
|
||||
height: '100%',
|
||||
display: 'flex',
|
||||
right: '100%',
|
||||
width: (this.extrasBefore * 100) + '%'
|
||||
};
|
||||
},
|
||||
styleAfter() {
|
||||
return {
|
||||
position: 'absolute',
|
||||
top: 0,
|
||||
height: '100%',
|
||||
display: 'flex',
|
||||
left: '100%',
|
||||
width: (this.extrasAfter * 100) + '%'
|
||||
};
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
prevPage() {
|
||||
return this.slidePages(-1);
|
||||
},
|
||||
nextPage() {
|
||||
return this.slidePages(1);
|
||||
},
|
||||
slidePages(dir) {
|
||||
return new Promise(resolve => {
|
||||
this.promiseResolve = resolve;
|
||||
this.running = true;
|
||||
const newTarget = this.target + dir;
|
||||
if (newTarget > 0) {
|
||||
if (this.extrasAfter < newTarget)
|
||||
this.extrasAfter = newTarget;
|
||||
} else if (newTarget < 0) {
|
||||
if (-this.extrasBefore > newTarget)
|
||||
this.extrasBefore = -newTarget;
|
||||
}
|
||||
this.target = newTarget;
|
||||
});
|
||||
},
|
||||
endSlide() {
|
||||
if (this.promiseResolve) {
|
||||
this.promiseResolve(this.target);
|
||||
this.promiseResolve = null;
|
||||
}
|
||||
this.$emit('slid', this.target);
|
||||
this.running = false;
|
||||
this.target = 0;
|
||||
this.extrasAfter = this.extrasBefore = 0;
|
||||
}
|
||||
},
|
||||
template: /* html */`
|
||||
<div
|
||||
class="fhc-calendar-base-slider h-100"
|
||||
style="position:relative;overflow:hidden"
|
||||
>
|
||||
<div
|
||||
:style="styleSlider"
|
||||
@transitionend="endSlide"
|
||||
>
|
||||
<div :style="styleBefore">
|
||||
<div
|
||||
v-for="i in itemsBefore"
|
||||
:key="i"
|
||||
style="height:100%;width:100%"
|
||||
>
|
||||
<slot :offset="i" />
|
||||
</div>
|
||||
</div>
|
||||
<div :style="styleAfter">
|
||||
<div
|
||||
v-for="i in itemsAfter"
|
||||
:key="i"
|
||||
style="height:100%;width:100%"
|
||||
>
|
||||
<slot :offset="i" />
|
||||
</div>
|
||||
</div>
|
||||
<div style="height:100%;width:100%">
|
||||
<slot :offset="0" />
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`
|
||||
}
|
||||
@@ -1,269 +0,0 @@
|
||||
import CalendarMonth from './Month.js';
|
||||
import CalendarMonths from './Months.js';
|
||||
import CalendarYears from './Years.js';
|
||||
import CalendarWeek from './Week.js';
|
||||
import CalendarWeeks from './Weeks.js';
|
||||
import CalendarDay from './Day.js';
|
||||
import CalendarMinimized from './Minimized.js';
|
||||
import CalendarDate from '../../composables/CalendarDate.js';
|
||||
import CalendarDates from '../../composables/CalendarDates.js';
|
||||
|
||||
const todayDate = new Date(new Date().setHours(0, 0, 0, 0));
|
||||
const today = todayDate.getTime()
|
||||
|
||||
export default {
|
||||
components: {
|
||||
CalendarMonth,
|
||||
CalendarMonths,
|
||||
CalendarYears,
|
||||
CalendarWeek,
|
||||
CalendarWeeks,
|
||||
CalendarDay,
|
||||
CalendarMinimized,
|
||||
},
|
||||
provide() {
|
||||
return {
|
||||
today,
|
||||
todayDate,
|
||||
date: this.date,
|
||||
focusDate: this.focusDate,
|
||||
size: Vue.computed({ get: () => this.size }),
|
||||
containerHeight: Vue.computed({ get: () => this.containerHeight }),
|
||||
containerWidth: Vue.computed({ get: () => this.containerWidth }),
|
||||
|
||||
events: Vue.computed(() => this.eventsPerDay),
|
||||
filteredEvents: Vue.computed(() => this.filteredEvents),
|
||||
minimized: Vue.computed({ get: () => this.minimized, set: v => this.$emit('update:minimized', v) }),
|
||||
showWeeks: this.showWeeks,
|
||||
noMonthView: this.noMonthView,
|
||||
noWeekView: this.noWeekView,
|
||||
eventsAreNull: Vue.computed(() => this.events === null),
|
||||
mode: Vue.computed(()=>this.mode),
|
||||
selectedEvent: Vue.computed(() => this.selectedEvent),
|
||||
setSelectedEvent: (event)=>{this.selectedEvent = event;},
|
||||
};
|
||||
},
|
||||
props: {
|
||||
events: Array,
|
||||
initialDate: {
|
||||
type: [Date, String],
|
||||
default: new Date()
|
||||
},
|
||||
showWeeks: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
initialMode: {
|
||||
type: String,
|
||||
default: 'month'
|
||||
},
|
||||
minimized: Boolean,
|
||||
noWeekView: Boolean,
|
||||
noMonthView: Boolean
|
||||
},
|
||||
watch:{
|
||||
mode(newVal) {
|
||||
this.$emit('change:mode', newVal)
|
||||
},
|
||||
selectedEvent:{
|
||||
handler(newSelectedEvent) {
|
||||
this.$emit('selectedEvent', newSelectedEvent);
|
||||
},
|
||||
immediate: true,
|
||||
},
|
||||
// scroll to the first event if the html element was found
|
||||
scrollTime({focusDate,scrollTime}){
|
||||
// return early if the scrollTime is not set
|
||||
if(!scrollTime) return;
|
||||
// scroll the Stundenplan to the closest event
|
||||
Vue.nextTick(()=>{
|
||||
let previousScrollAnchor = document.getElementById('scroll' + (scrollTime - 1) + this.focusDate.d + this.focusDate.w)
|
||||
let scrollAnchor = document.getElementById('scroll' + scrollTime + this.focusDate.d + this.focusDate.w);
|
||||
if (previousScrollAnchor) {
|
||||
previousScrollAnchor.scrollIntoView({ behavior: 'smooth', block: 'start' });
|
||||
}
|
||||
else {
|
||||
if (scrollAnchor) {
|
||||
scrollAnchor.scrollIntoView({ behavior: 'smooth', block: 'start' });
|
||||
}
|
||||
}
|
||||
});
|
||||
},
|
||||
},
|
||||
emits: [
|
||||
'select:day',
|
||||
'select:event',
|
||||
'change:range',
|
||||
'update:minimized',
|
||||
'selectedEvent',
|
||||
'change:offset'
|
||||
],
|
||||
data() {
|
||||
return {
|
||||
header: '',
|
||||
prevMode: null,
|
||||
currMode: null,
|
||||
date: new CalendarDate(),
|
||||
focusDate: new CalendarDate(),
|
||||
size: 0,
|
||||
containerWidth: 0,
|
||||
containerHeight: 0,
|
||||
selectedEvent:null,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
sizeClass() {
|
||||
// mainly determines calendar font-size
|
||||
return 'fhc-calendar-' + ['xs', 'sm', 'md', 'lg'][this.size];
|
||||
},
|
||||
mode: {
|
||||
get() { return this.minimized ? 'minimized' : this.currMode; },
|
||||
set(v) {
|
||||
if (!v && this.prevMode) {
|
||||
this.currMode = this.prevMode;
|
||||
this.prevMode = null;
|
||||
} else {
|
||||
this.prevMode = this.currMode;
|
||||
this.currMode = v;
|
||||
}
|
||||
}
|
||||
},
|
||||
eventsPerDay() {
|
||||
if (!this.events)
|
||||
return {};
|
||||
return this.events.reduce((result, event) => {
|
||||
let days = Math.ceil((event.end - event.start) / 86400000) || 1;
|
||||
while (days-- > 0) {
|
||||
let day = (new Date(event.start.getFullYear(), event.start.getMonth(), event.start.getDate() + days)).toDateString();
|
||||
if (!result[day])
|
||||
result[day] = [];
|
||||
result[day].push(event);
|
||||
}
|
||||
return result;
|
||||
}, {});
|
||||
},
|
||||
// returns the hour of the earliest event, used to scroll to the events in the calendar (week / day view)
|
||||
scrollTime() {
|
||||
// return the first beginning time of the filtered events
|
||||
if(this.filteredEvents && Array.isArray(this.filteredEvents) && this.filteredEvents.length > 0)
|
||||
{
|
||||
let scrollTime = parseInt(this.filteredEvents.sort((a, b) => parseInt(a.beginn) - parseInt(b.beginn))[0].beginn);
|
||||
// to ensure that the scrollTime watcher triggers even if the scrollTime doesn't change, it returns both the scrollTime and the focusDate
|
||||
return { focusDate: this.focusDate, scrollTime };
|
||||
}
|
||||
// there is no event that matches the current view mode constraints
|
||||
else
|
||||
{
|
||||
return { focusDate: this.focusDate, scrollTime: null };
|
||||
}
|
||||
},
|
||||
// filters the events based on the current calendar view mode
|
||||
// week view - filter events based on their week
|
||||
// day view - filter events based on their day and week
|
||||
// month view - does not filter the events
|
||||
filteredEvents: function(){
|
||||
if (this.events && Array.isArray(this.events) && this.events.length > 0) {
|
||||
let filteredEvents = this.events.filter(event => {
|
||||
let eventDate = new CalendarDate(new Date(event.datum));
|
||||
if (this.mode == 'week' || this.mode == 'Week')
|
||||
{
|
||||
// week view filters the elements only for the same week
|
||||
return this.focusDate.w == eventDate.w;
|
||||
}
|
||||
else if (this.mode == 'day' || this.mode == 'Day')
|
||||
{
|
||||
// day view filters the elements for the same day and the same week
|
||||
return this.focusDate.d == eventDate.d && this.focusDate.w == eventDate.w;
|
||||
}
|
||||
else
|
||||
{
|
||||
// returns all the events, does not filter the events
|
||||
return true;
|
||||
}
|
||||
})
|
||||
|
||||
return filteredEvents;
|
||||
}
|
||||
else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
setMode(mode) {
|
||||
this.mode = mode
|
||||
},
|
||||
handleInput(day) {
|
||||
this.$emit(day[0], day[1]);
|
||||
},
|
||||
},
|
||||
created() {
|
||||
const initMode = this.initialMode.toLowerCase()
|
||||
const allowedInitialModes = ['day'];
|
||||
if (!this.noWeekView)
|
||||
allowedInitialModes.push('week');
|
||||
if (!this.noMonthView)
|
||||
allowedInitialModes.push('month');
|
||||
this.mode = allowedInitialModes[allowedInitialModes.indexOf(initMode)] || allowedInitialModes.pop();
|
||||
this.date.set(new Date(this.initialDate));
|
||||
this.focusDate.set(this.date);
|
||||
},
|
||||
mounted() {
|
||||
if (this.$refs.container) {
|
||||
new ResizeObserver(entries => {
|
||||
for (const entry of entries) {
|
||||
const w = entry.contentBoxSize ? entry.contentBoxSize[0].inlineSize : entry.contentRect.width;
|
||||
const h = entry.contentBoxSize ? entry.contentBoxSize[0].blockSize : entry.contentRect.height;
|
||||
|
||||
// https://getbootstrap.com/docs/5.0/layout/breakpoints/
|
||||
// bootstrap breakpoints watch window size and this function monitors container size of calendar itself.
|
||||
// calendar is using bootstrap breakpoints which influence layout, which retriggers this function
|
||||
// -> some width constellations will loop so we dont use values around bs5 breakpoints
|
||||
// ['xs', 'sm', 'md', 'lg'][this.size]
|
||||
if (w >= 600)
|
||||
this.size = 3;
|
||||
else if (w >= 350)
|
||||
this.size = 2;
|
||||
else if (w >= 250)
|
||||
this.size = 1;
|
||||
else
|
||||
this.size = 0;
|
||||
|
||||
this.containerWidth = w
|
||||
this.containerHeight = h
|
||||
}
|
||||
}).observe(this.$refs.container);
|
||||
}
|
||||
},
|
||||
unmounted(){
|
||||
CalendarDates.cleanup();
|
||||
},
|
||||
template: /*html*/`
|
||||
<div ref="container" class="fhc-calendar card h-100" :class="sizeClass">
|
||||
<component :is="'calendar-' + mode" @updateMode="mode = $event" @change:range="$emit('change:range',$event)"
|
||||
@input="handleInput" @change:offset="$emit('change:offset', $event)">
|
||||
<template #calendarDownloads>
|
||||
<slot name="calendarDownloads" ></slot>
|
||||
</template>
|
||||
<template #monthPage="{event,day}">
|
||||
<slot name="monthPage" :event="event" :day="day" ></slot>
|
||||
</template>
|
||||
<template #weekPage="{event,day}">
|
||||
<slot name="weekPage" :event="event" :day="day" ></slot>
|
||||
</template>
|
||||
<template #dayPage="{event,day,mobile}">
|
||||
<slot name="dayPage" :event="event" :day="day" :mobile="mobile"></slot>
|
||||
</template>
|
||||
<template #pageMobilContent="{lvMenu}">
|
||||
<slot name="pageMobilContent" :lvMenu="lvMenu"></slot>
|
||||
</template>
|
||||
<template #pageMobilContentEmpty>
|
||||
<slot name="pageMobilContentEmpty" ></slot>
|
||||
</template>
|
||||
<template #minimizedPage="{event,day}">
|
||||
<slot name="minimizedPage" :event="event" :day="day"></slot>
|
||||
</template>
|
||||
</component>
|
||||
</div>`
|
||||
}
|
||||
@@ -1,64 +0,0 @@
|
||||
import CalendarAbstract from './Abstract.js';
|
||||
import CalendarPane from './Pane.js';
|
||||
import CalendarDayPage from './Day/Page.js';
|
||||
import CalendarDate from '../../composables/CalendarDate.js';
|
||||
|
||||
export default {
|
||||
mixins: [
|
||||
CalendarAbstract
|
||||
],
|
||||
components: {
|
||||
CalendarDayPage,
|
||||
CalendarPane
|
||||
},
|
||||
computed: {
|
||||
title() {
|
||||
return this.focusDate.wYear + ' KW ' + this.focusDate.w;
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
paneChanged(dir) {
|
||||
let previousDate = new CalendarDate(this.focusDate);
|
||||
this.focusDate.d += dir;
|
||||
this.emitRangeChanged(previousDate);
|
||||
},
|
||||
emitRangeChanged(previousDate) {
|
||||
this.$emit('change:range', { start: previousDate, end:this.focusDate });
|
||||
},
|
||||
prev() {
|
||||
this.$refs.pane.prev();
|
||||
this.$emit('change:offset', { y: 0, m: 0, d: -1 });
|
||||
},
|
||||
next() {
|
||||
this.$refs.pane.next();
|
||||
this.$emit('change:offset', { y: 0, m: 0, d: 1 });
|
||||
},
|
||||
selectEvent(event) {
|
||||
this.$emit('input', ['select:event', event]);
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.emitRangeChanged();
|
||||
},
|
||||
template: /*html*/`
|
||||
<div class="fhc-calendar-day">
|
||||
<calendar-header :title="title" @prev="prev" @next="next" @updateMode="$emit('updateMode', $event)" @click="$emit('updateMode', 'week')">
|
||||
<template #calendarDownloads>
|
||||
<slot name="calendarDownloads"></slot>
|
||||
</template>
|
||||
</calendar-header>
|
||||
<calendar-pane ref="pane" v-slot="slot" @slid="paneChanged">
|
||||
<calendar-day-page :active="slot.active" :year="focusDate.y" :week="focusDate.w+slot.offset" @updateMode="$emit('updateMode', $event)" @page:back="prev" @page:forward="next" @input="selectEvent" >
|
||||
<template #dayPage="{event,day,mobile}">
|
||||
<slot name="dayPage" :event="event" :day="day" :mobile="mobile" ></slot>
|
||||
</template>
|
||||
<template #pageMobilContent="{lvMenu}">
|
||||
<slot name="pageMobilContent" :lvMenu="lvMenu" ></slot>
|
||||
</template>
|
||||
<template #pageMobilContentEmpty>
|
||||
<slot name="pageMobilContentEmpty" ></slot>
|
||||
</template>
|
||||
</calendar-day-page>
|
||||
</calendar-pane>
|
||||
</div>`
|
||||
}
|
||||
@@ -1,434 +0,0 @@
|
||||
import CalendarDate from '../../../composables/CalendarDate.js';
|
||||
import LvModal from "../../../components/Cis/Mylv/LvModal.js";
|
||||
|
||||
import ApiStundenplan from '../../../api/factory/stundenplan.js';
|
||||
import ApiAddons from '../../../api/factory/addons.js';
|
||||
|
||||
function ggt(m, n) {
|
||||
return n == 0 ? m : ggt(n, m % n);
|
||||
}
|
||||
|
||||
function kgv(m, n) {
|
||||
return (m * n) / ggt(m, n);
|
||||
}
|
||||
|
||||
export default {
|
||||
name: 'DayPage',
|
||||
components: {
|
||||
LvModal,
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
hourPosition: null,
|
||||
curHourPosition: null,
|
||||
hourPositionTime: null,
|
||||
lvMenu: null,
|
||||
}
|
||||
},
|
||||
inject: [
|
||||
'today',
|
||||
'todayDate',
|
||||
'date',
|
||||
'focusDate',
|
||||
'size',
|
||||
'events',
|
||||
'noMonthView',
|
||||
'filteredEvents',
|
||||
'isSliding',
|
||||
'calendarScrollTop',
|
||||
'calendarClientHeight',
|
||||
'setSelectedEvent',
|
||||
'selectedEvent',
|
||||
'rowMinHeight'
|
||||
],
|
||||
props: {
|
||||
year: Number,
|
||||
week: Number,
|
||||
active: Boolean,
|
||||
},
|
||||
emits: [
|
||||
'updateMode',
|
||||
'page:back',
|
||||
'page:forward',
|
||||
'input'
|
||||
],
|
||||
watch: {
|
||||
//TODO: on first render non of the day-page components are active and the watcher on selectedEvent does not fetch the lvMenu
|
||||
//TODO: workaround is to watch the active state and refetch in case the lvMenu is empty
|
||||
active: {
|
||||
handler(value) {
|
||||
if (value) {
|
||||
if (!this.lvMenu) {
|
||||
this.fetchLvMenu(this.selectedEvent);
|
||||
}
|
||||
}
|
||||
},
|
||||
immediate: true,
|
||||
},
|
||||
eventsPerDayAndHour: {
|
||||
handler(newEvents) {
|
||||
// if no event is selected, select the first event of the day
|
||||
if (this.selectedEvent == null && newEvents[this.day.toDateString()]?.events.length > 0) {
|
||||
let events = newEvents[this.day.toDateString()]?.events;
|
||||
if (Array.isArray(events) && events.length > 0) {
|
||||
this.setSelectedEvent(events[0].orig);
|
||||
}
|
||||
}
|
||||
},
|
||||
immediate: true
|
||||
},
|
||||
selectedEvent: {
|
||||
handler(event) {
|
||||
// return early if the day-page component is not the active carousel item
|
||||
if (!this.active) {
|
||||
return;
|
||||
}
|
||||
this.lvMenu = null;
|
||||
this.fetchLvMenu(event);
|
||||
},
|
||||
immediate: true,
|
||||
},
|
||||
isSliding: {
|
||||
handler(value) {
|
||||
if (value) {
|
||||
this.setSelectedEvent(null);
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
overlayStyle() {
|
||||
return {
|
||||
'background-color': '#F5E9D7',
|
||||
'position': 'absolute',
|
||||
'pointer-events': 'none',
|
||||
'z-index': 2,
|
||||
height: this.getDayTimePercent + '%',
|
||||
opacity: 0.5,
|
||||
overflow: 'hidden'
|
||||
}
|
||||
},
|
||||
pageHeaderStyle() {
|
||||
return {
|
||||
'z-index': 4,
|
||||
'grid-template-columns': 'repeat(' + this.day.length + ', 1fr)',
|
||||
'grid-template-rows': 1,
|
||||
position: 'sticky',
|
||||
top: 0,
|
||||
}
|
||||
},
|
||||
dayText(){
|
||||
if(!this.day)return {};
|
||||
return {
|
||||
heading: this.day.toLocaleString(this.$p.user_locale.value, { dateStyle: 'short' }),
|
||||
tag: this.day.toLocaleString(this.$p.user_locale.value, { weekday: this.size < 2 ? 'narrow' : (this.size < 3 ? 'short' : 'long') }),
|
||||
datum: this.day.toLocaleString(this.$p.user_locale.value, [{ day: 'numeric', month: 'numeric' }, { day: 'numeric', month: 'numeric' }, { day: 'numeric', month: 'numeric' }, { dateStyle: 'short' }][this.size]),
|
||||
}
|
||||
},
|
||||
noLvStyle() {
|
||||
return {
|
||||
top: (this.calendarScrollTop + 100) + 'px',
|
||||
position: 'absolute',
|
||||
left: 0,
|
||||
'text-align': 'center',
|
||||
width: '100%',
|
||||
'z-index': 1,
|
||||
}
|
||||
},
|
||||
indicatorStyle() {
|
||||
return {
|
||||
'pointer-events': 'none',
|
||||
'padding-left': '3.5rem',
|
||||
'margin-top': '-1px',
|
||||
'z-index': 2,
|
||||
'border-color': '#00649C!important',
|
||||
top: this.hourPosition + 'px',
|
||||
left: 0,
|
||||
right: 0,
|
||||
}
|
||||
},
|
||||
curTime() {
|
||||
const now = new Date();
|
||||
return String(now.getHours()).padStart(2, '0') + ':' + String(now.getMinutes()).padStart(2, '0');
|
||||
},
|
||||
curIndicatorStyle() {
|
||||
return {
|
||||
'pointer-events': 'none',
|
||||
'padding-left': '7rem',
|
||||
'margin-top': '-1px',
|
||||
'z-index': 2,
|
||||
'border-color': '#00649C!important',
|
||||
top: this.getDayTimePercent + '%',
|
||||
left: 0,
|
||||
right: 0,
|
||||
}
|
||||
},
|
||||
noEventsCondition() {
|
||||
return !this.isSliding && (this.filteredEvents?.length === 0 || !this.filteredEvents);
|
||||
},
|
||||
hours() {
|
||||
// returns an array with elements starting at 7 and ending at 24
|
||||
return [...Array(24).keys()].filter(hour => hour >= 7 && hour <= 24);
|
||||
},
|
||||
day() {
|
||||
return new Date(this.focusDate.y, this.focusDate.m, this.focusDate.d);
|
||||
},
|
||||
eventsPerDayAndHour() {
|
||||
// return early if the calendar pane is sliding
|
||||
if (this.isSliding) return {};
|
||||
|
||||
const res = {};
|
||||
|
||||
let key = this.day.toDateString();
|
||||
|
||||
let nextDay = new Date(this.day);
|
||||
nextDay.setDate(nextDay.getDate() + 1);
|
||||
nextDay.setMilliseconds(nextDay.getMilliseconds() - 1);
|
||||
let d = {events: [], lanes: 1};
|
||||
if (this.events[key]) {
|
||||
this.events[key].forEach(evt => {
|
||||
let event = {
|
||||
orig: evt,
|
||||
lane: 1,
|
||||
maxLane: 1,
|
||||
start: evt.start < this.day ? this.day : evt.start,
|
||||
end: evt.end > nextDay ? nextDay : evt.end,
|
||||
shared: [],
|
||||
setSharedMaxRecursive(doneItems) {
|
||||
this.maxLane = Math.max(doneItems[0].maxLane, this.maxLane);
|
||||
doneItems.push(this);
|
||||
this.shared.filter(other => !doneItems.includes(other)).forEach(i => i.setSharedMaxRecursive(doneItems));
|
||||
}
|
||||
};
|
||||
event.shared = d.events.filter(other => other.start < event.end && other.end > event.start);
|
||||
event.shared.forEach(other => other.shared.push(event));
|
||||
let occupiedLanes = event.shared.map(other => other.lane);
|
||||
while (occupiedLanes.includes(event.lane))
|
||||
event.lane++;
|
||||
event.maxLane = Math.max(...[event.lane], ...occupiedLanes);
|
||||
if (event.maxLane > 1) {
|
||||
event.setSharedMaxRecursive([event]);
|
||||
}
|
||||
d.events.push(event);
|
||||
});
|
||||
d.lanes = d.events.map(e => e.maxLane).reduce((res, i) => kgv(res, i), 1);
|
||||
}
|
||||
res[key] = d;
|
||||
|
||||
return res;
|
||||
},
|
||||
smallestTimeFrame() {
|
||||
return [30, 15, 10, 5][this.size];
|
||||
},
|
||||
lookingAtToday() {
|
||||
return this.date.compare(this.todayDate)
|
||||
},
|
||||
getDayTimePercent() {
|
||||
const now = new Date(Date.now())
|
||||
const currentMinutes = now.getMinutes() + now.getHours() * 60
|
||||
let timePercentage = ((currentMinutes - (this.hours[0] * 60)) / (this.hours.length * 60)) * 100;
|
||||
|
||||
return timePercentage
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
dayGridStyle(day) {
|
||||
const styleObj = {
|
||||
'grid-template-columns': '1 1fr',
|
||||
'grid-template-rows': 'repeat(' + (this.hours.length * 60 / this.smallestTimeFrame) + ', 1fr)',
|
||||
}
|
||||
|
||||
if(this.date.compare(this.todayDate)) {
|
||||
styleObj['backgroundImage'] = 'linear-gradient(to bottom, #F5E9D7 '+this.getDayTimePercent+'%, #FFFFFF '+this.getDayTimePercent+'%)'
|
||||
styleObj['border-color'] = '#E8E8E8';
|
||||
// styleObj.opacity = 0.5; // would opaque the whole column
|
||||
}
|
||||
|
||||
return styleObj
|
||||
},
|
||||
fetchLvMenu(event) {
|
||||
if (event && event.type == 'lehreinheit') {
|
||||
this.$api
|
||||
.call(ApiStundenplan.getLehreinheitStudiensemester(event.lehreinheit_id[0]))
|
||||
.then(res => res.data)
|
||||
.then(studiensemester_kurzbz => this.$api.call(
|
||||
ApiAddons.getLvMenu(
|
||||
event.lehreinheit_id,
|
||||
studiensemester_kurzbz
|
||||
)
|
||||
))
|
||||
.then(res => {
|
||||
if (res.data) {
|
||||
this.lvMenu = res.data;
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
hourGridIdentifier(hour) {
|
||||
// this is the id attribute that is responsible to scroll the calender to the first event
|
||||
return 'scroll' + hour + this.focusDate.d + this.week;
|
||||
},
|
||||
hourGridStyle(hour) {
|
||||
return {
|
||||
'pointer-events': 'none',
|
||||
top: this.getAbsolutePositionForHour(hour),
|
||||
left: 0,
|
||||
right: 0,
|
||||
'z-index': 0,
|
||||
}
|
||||
},
|
||||
eventGridStyle(day, event) {
|
||||
return {
|
||||
'z-index': 1,
|
||||
'grid-column-start': 1 + (event.lane - 1) * day.lanes / event.maxLane,
|
||||
'grid-column-end': 1 + event.lane * day.lanes / event.maxLane,
|
||||
'grid-row-start': this.dateToMinutesOfDay(event.start),
|
||||
'grid-row-end': this.dateToMinutesOfDay(event.end),
|
||||
'background-color': event.orig.color,
|
||||
'--test': this.dateToMinutesOfDay(event.end),
|
||||
}
|
||||
},
|
||||
eventClick(evt) {
|
||||
let event = evt.orig;
|
||||
this.setSelectedEvent(event);
|
||||
this.$emit('input', event);
|
||||
},
|
||||
calcHourPosition(event) {
|
||||
let height = this.$refs.eventcontainer.getBoundingClientRect().height;
|
||||
let top = this.$refs.eventcontainer.getBoundingClientRect().top;
|
||||
let position = event.clientY - top;
|
||||
// position percentage of total height
|
||||
let timePercentage = (position / height) * 100;
|
||||
// minute percentage of total minutes
|
||||
let result = (this.hours.length * 60) * (timePercentage / 100);
|
||||
// calculate time in float
|
||||
let currentMinutes = ((result + (this.hours[0] * 60)) / 60);
|
||||
// get hour part of time
|
||||
let currentHour = Math.floor(currentMinutes);
|
||||
// get float part of time
|
||||
let minutePercentage = currentMinutes % currentHour;
|
||||
// calculate minutes from float part of time
|
||||
let minute = Math.round(60 * minutePercentage);
|
||||
// convert minutes to 5 minute interval
|
||||
if (minute % 5 != 0) {
|
||||
minute = Math.round(minute / 5) * 5;
|
||||
}
|
||||
// in case the rounding made the minutes 60, increase the hour and reset the minutes
|
||||
if (minute == 60) {
|
||||
currentHour++;
|
||||
minute = 0;
|
||||
}
|
||||
|
||||
// ## after rounding the time to the nearest 5 Minute interval, we have to convert the time back to the relative position
|
||||
// convert current time in minutes
|
||||
currentMinutes = currentHour * 60 + minute;
|
||||
// calculate the minutes percentage of the total minutes
|
||||
timePercentage = ((currentMinutes - (this.hours[0] * 60)) / (this.hours.length * 60)) * 100;
|
||||
// calculate the relative position of the time percentage
|
||||
position = height * (timePercentage / 100);
|
||||
this.hourPosition = position;
|
||||
|
||||
// add padding to minutes that consist of only one digit
|
||||
minute.toString().length == 1 ? minute = "0" + minute : minute;
|
||||
this.hourPositionTime = currentHour + ":" + minute;
|
||||
},
|
||||
getAbsolutePositionForHour(hour) {
|
||||
// used for the absolute positioning of the gutters of hours
|
||||
return (100 / this.hours.length) * (hour - (24 - this.hours.length)) + '%';
|
||||
},
|
||||
changeToMonth(day) {
|
||||
if (!this.noMonthView) {
|
||||
this.date.set(day);
|
||||
this.focusDate.set(day);
|
||||
this.$emit('updateMode', 'month');
|
||||
}
|
||||
},
|
||||
dateToMinutesOfDay(day) {
|
||||
return Math.floor(((day.getHours() - 7) * 60 + day.getMinutes()) / this.smallestTimeFrame) + 1;
|
||||
}
|
||||
|
||||
},
|
||||
template: /*html*/`
|
||||
<div class="fhc-calendar-day-page h-100">
|
||||
<div class="row m-0 h-100">
|
||||
<div class="col-12 col-xl-6 p-0 h-100">
|
||||
<div class="d-flex flex-column h-100">
|
||||
<div ref="header" class="fhc-calendar-week-page-header d-grid border-2 border-bottom text-center" :style="pageHeaderStyle">
|
||||
<div type="button" class="flex-grow-1" :title="dayText.heading" @click.prevent="changeToMonth(day)">
|
||||
<div class="fw-bold">{{dayText.tag}}</div>
|
||||
<a href="#" class="small text-secondary text-decoration-none" >{{dayText.datum}}</a>
|
||||
</div>
|
||||
</div>
|
||||
<div id="scroll g-0" style="height: 100%; overflow-y: scroll;">
|
||||
|
||||
<div ref="eventcontainer" class="position-relative flex-grow-1" @mousemove="calcHourPosition" @mouseleave="hourPosition = null" >
|
||||
<div :id="hourGridIdentifier(hour)" v-for="hour in hours" :key="hour" class="position-absolute box-shadow-border-top" :style="hourGridStyle(hour)"></div>
|
||||
|
||||
<Transition>
|
||||
<div v-if="hourPosition && !noEventsCondition" class="position-absolute border-top small" :style="indicatorStyle">
|
||||
<span class="border border-top-0 px-2 bg-white">{{hourPositionTime}}</span>
|
||||
</div>
|
||||
</Transition>
|
||||
<Transition>
|
||||
<div v-if="lookingAtToday && !noEventsCondition" class="position-absolute border-top small" :style="curIndicatorStyle">
|
||||
<span class="border border-top-0 px-2 bg-white">{{curTime}}</span>
|
||||
</div>
|
||||
</Transition>
|
||||
<div>
|
||||
<h1 v-if="noEventsCondition" class="m-0 text-secondary" ref="noEventsText" :style="noLvStyle">{{ $p.t('lehre/noLvFound') }}</h1>
|
||||
<div :class="{'fhc-calendar-no-events-overlay':noEventsCondition, 'events':true}">
|
||||
|
||||
<div class="hours">
|
||||
<div v-for="hour in hours" :style="'min-height:' + rowMinHeight " :key="hour" class="text-muted text-end small" :ref="'hour' + hour">{{hour}}:00</div>
|
||||
</div>
|
||||
<div v-for="day in eventsPerDayAndHour" :key="day" class=" day border-start" :style="dayGridStyle(day)">
|
||||
<div v-if="lookingAtToday && !noEventsCondition" :style="overlayStyle"></div>
|
||||
<div v-for="event in day.events" :key="event" :style="eventGridStyle(day,event)" v-contrast
|
||||
:selected="event.orig == selectedEvent" class="fhc-entry mx-2 small rounded overflow-hidden" >
|
||||
<!-- desktop version of the page template, parent receives slotProp mobile = false -->
|
||||
<div class="d-none d-xl-block h-100 " @click.prevent="eventClick(event)">
|
||||
<slot name="dayPage" :event="event" :day="day" :mobile="false">
|
||||
<p>this is a slot placeholder</p>
|
||||
</slot>
|
||||
</div>
|
||||
<!-- mobile version of the page template, parent receives slotProp mobile = true -->
|
||||
<div class="d-block d-xl-none h-100" @click.prevent="eventClick(event)">
|
||||
<slot name="dayPage" :event="event" :day="day" :mobile="true">
|
||||
<p>this is a slot placeholder</p>
|
||||
</slot>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="d-xl-block col-xl-6 p-4 d-none" style="max-height: 100%">
|
||||
<div style="z-index:0; max-height: 100%" class="sticky-top d-flex justify-content-center align-items-center flex-column">
|
||||
<div style="max-height: 100%; overflow-y:auto;" class="w-100">
|
||||
<template v-if="selectedEvent && lvMenu">
|
||||
<slot name="pageMobilContent" :lvMenu="lvMenu" >
|
||||
<p>this is a slot placeholder</p>
|
||||
</slot>
|
||||
</template>
|
||||
<template v-else-if="noEventsCondition">
|
||||
<slot name="pageMobilContentEmpty" >
|
||||
<h3>This is an slot placeholder</h3>
|
||||
</slot>
|
||||
</template>
|
||||
<template v-else>
|
||||
<div class="p-4 d-flex w-100 justify-content-center align-items-center">
|
||||
<i class="fa-solid fa-spinner fa-pulse fa-3x"></i>
|
||||
</div>
|
||||
</template>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
`
|
||||
}
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user