Merge branch 'feature-40311/Stundenplan_widget' into feature-25999/C4

This commit is contained in:
Harald Bamberger
2024-09-09 13:26:03 +02:00
45 changed files with 1199 additions and 752 deletions
View File
-44
View File
@@ -1,44 +0,0 @@
<?php
/* Copyright (C) 2015 fhcomplete.org
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
*
* Authors: Andreas Oesterreicher <andreas.oesterreicher@technikum-wien.at>
*/
/**
* Initialisierung des Addons
*/
?>
if(typeof addon =='undefined')
var addon=Array();
addon.push(
{
init: function(page, params)
{
// Diese Funktion wird nach dem Laden der Seite im CIS aufgerufen
/*
switch(page)
{
case 'cis/private/tools/zeitaufzeichnung.php':
break;
default:
break;
}
*/
}
});
@@ -1,55 +0,0 @@
<?php
/* Copyright (C) 2014 fhcomplete.org
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
*
* Authors: Andreas Österreicher <andreas.oesterreicher@technikum-wien.at>
*/
/**
* Diese Datei fügt zusätzliche Links im CIS Profil ein
* Dazu muss die Datei umbenannt werden in profil_array.php
*
* Dazu wird ein Array aufgebaut welches die Links enthaelt.
*
* $menu = array('MeinLink'=>array('name'=>'Name des Links','link'=>'../path/to/file.php','target'='content'));
*/
// Unterschiedliche Links für Studierende und Mitarbeiter
if($type=='student')
{
if(!$ansicht)
$menu['Notenliste']=array('name'=>$p->t('profil/leistungsbeurteilung'), 'link'=>'../lehre/notenliste.php', 'target'=>'content');
$menu['LVPlan']=array('name'=>$p->t('profil/lvplanVon').' '.$user->nachname, 'link'=>'../lvplan/stpl_week.php?pers_uid='.$user->uid.'&type=student', 'target'=>'content');
}
else
{
if(!$ansicht)
{
$menu['Zeitwunsch']=array('name'=>$p->t('profil/zeitwuensche'), 'link'=>'zeitwunsch.php?uid='.$user->uid, 'target'=>'content');
$menu['Lehrveranstaltungen']=array('name'=>$p->t('lvaliste/lehrveranstaltungen'), 'link'=>'lva_liste.php?uid='.$user->uid, 'target'=>'content');
}
if(check_lektor(get_uid()))
{
$menu['Zeitsperren']=array('name'=>$p->t('profil/zeitsperrenVon').' '.$user->nachname, 'link'=>'zeitsperre_days.php?days=30&lektor='.$user->uid, 'target'=>'content');
}
if($uid!=get_uid())
{
$menu['LVPlan']=array('name'=>$p->t('profil/lvplanVon').' '.$user->nachname, 'link'=>'../lvplan/stpl_week.php?pers_uid='.$user->uid.'&type=lektor', 'target'=>'content');
}
}
?>
View File
-90
View File
@@ -1,90 +0,0 @@
<?php
/* Copyright (C) 2013 fhcomplete.org
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
*
* Authors: Andreas Oesterreicher <andreas.oesterreicher@technikum-wien.at>
*/
/**
* Initialisierung des Addons
*/
?>
addon.push(
{
init: function()
{
// Diese Funktion wird nach dem Laden des FAS aufgerufen
/*
// Hinzufuegen eines zusaetzlichen Tabs bei Mitarbeitern mit einem Label darin
var tabitem = document.createElement("tab");
tabitem.setAttribute("id","addon-template-tab");
tabitem.setAttribute("label","Template");
var mitarbeitertabs = document.getElementById("mitarbeiter-tabs");
mitarbeitertabs.appendChild(tabitem);
var tabpanelitem = document.createElement("vbox");
tabpanelitem.setAttribute("id","addon-template-tabpannel-vbox");
var label = document.createElement("label");
label.setAttribute("value","Template");
tabpanelitem.appendChild(label);
var mitarbeitertabpanels=document.getElementById("mitarbeiter-tabpanels-main");
mitarbeitertabpanels.appendChild(tabpanelitem);
// zusaetzliche Funktion beim klicken des Suchen Button bei Mitarbeitern hinzufuegen
searchbutton = document.getElementById("mitarbeiter-toolbar-button-search");
searchbutton.addEventListener("command",AddonTemplateMitarbeiterSearch, true);
// Menuepunkt hinzufuegen
statistikmenue = document.getElementById("menu-statistic-popup");
var menuentry = document.createElement("menuitem");
menuentry.setAttribute("id","addons-template-mymenuentry");
menuentry.setAttribute("label","Addon Template Menu Entry");
menuentry.addEventListener("command",AddonTemplateMenuEntry, true);
statistikmenue.appendChild(menuentry);
*/
},
selectMitarbeiter: function(person_id, mitarbeiter_uid)
{
},
selectStudent: function(person_id, prestudent_id, student_uid)
{
},
selectVerband: function(item)
{
},
selectInstitut: function(institut)
{
},
selectLektor: function(lektor)
{
}
});
function AddonTemplateMitarbeiterSearch()
{
alert("AddonTemplateSearchButtonClicked");
}
function AddonTemplateMenuEntry()
{
alert("AddonTemplateMenuEntry clicked");
}
-101
View File
@@ -1,101 +0,0 @@
<?php
/* Copyright (C) 2013 FH Technikum-Wien
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
*
*/
/**
* FH-Complete Addon Template Datenbank Check
*
* Prueft und aktualisiert die Datenbank
*/
require_once('../../config/system.config.inc.php');
require_once('../../include/basis_db.class.php');
require_once('../../include/functions.inc.php');
require_once('../../include/benutzerberechtigung.class.php');
// Datenbank Verbindung
$db = new basis_db();
echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../skin/fhcomplete.css" type="text/css">
<link rel="stylesheet" href="../../skin/vilesci.css" type="text/css">
<title>Addon Datenbank Check</title>
</head>
<body>
<h1>Addon Datenbank Check</h1>';
$uid = get_uid();
$rechte = new benutzerberechtigung();
$rechte->getBerechtigungen($uid);
if(!$rechte->isBerechtigt('basis/addon', null, 'suid'))
{
exit('Sie haben keine Berechtigung für die Verwaltung von Addons');
}
echo '<h2>Aktualisierung der Datenbank</h2>';
// Code fuer die Datenbankanpassungen
/*
if(!$result = @$db->db_query("SELECT 1 FROM addon.tbl_template_items"))
{
$qry = 'CREATE TABLE addon.tbl_template_items
(
template_items_kurzbz varchar(32),
bezeichnung varchar(256)
);';
if(!$db->db_query($qry))
echo '<strong>addon.tbl_template_items: '.$db->db_last_error().'</strong><br>';
else
echo ' addon.tbl_template_items: Tabelle addon.template_items hinzugefuegt!<br>';
}
*/
echo '<br>Aktualisierung abgeschlossen<br><br>';
echo '<h2>Gegenprüfung</h2>';
// Liste der verwendeten Tabellen / Spalten des Addons
$tabellen=array(
"addon.tbl_template_items" => array("template_items_kurzbz","bezeichnung"),
);
$tabs=array_keys($tabellen);
$i=0;
foreach ($tabellen AS $attribute)
{
$sql_attr='';
foreach($attribute AS $attr)
$sql_attr.=$attr.',';
$sql_attr=substr($sql_attr, 0, -1);
if (!@$db->db_query('SELECT '.$sql_attr.' FROM '.$tabs[$i].' LIMIT 1;'))
echo '<BR><strong>'.$tabs[$i].': '.$db->db_last_error().' </strong><BR>';
else
echo $tabs[$i].': OK - ';
flush();
$i++;
}
?>
View File
-66
View File
@@ -1,66 +0,0 @@
<?php
/* Copyright (C) 2013 FH Technikum-Wien
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
*
*/
/**
* FH-Complete Addon Template Installation
*
* Installationsscript zur Erstinitialisierung des Addons
*/
require_once('version.php');
require_once('../../version.php');
require_once('../../config/system.config.inc.php');
require_once('../../include/functions.inc.php');
require_once('../../include/benutzerberechtigung.class.php');
echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../skin/fhcomplete.css" type="text/css">
<link rel="stylesheet" href="../../skin/vilesci.css" type="text/css">
<title>Addon Installation</title>
</head>
<body>
<h1>Addon Installation</h1>';
$uid = get_uid();
$rechte = new benutzerberechtigung();
$rechte->getBerechtigungen($uid);
if(!$rechte->isBerechtigt('basis/addon', null, 'suid'))
{
exit('Sie haben keine Berechtigung für die Verwaltung von Addons');
}
if($fhcomplete_version>=$fhcomplete_target_version)
{
echo 'Installiere Addon <span class="marked">'.$addon_name.'</span> Version <span class="marked">'.$addon_version.'</span><br><br>';
/**
* Fuegen Sie hier Ihre Installationsroutine hinzu
*/
echo '<a href="dbcheck.php">&gt;&gt; weiter zur Aktualisierung der Datenbank</a>';
}
else
{
echo 'Dieses Addon funktioniert erst mit FHComplete Version '.$fhcomplete_target_version;
echo 'Installation abgebrochen';
}
?>
-6
View File
@@ -1,6 +0,0 @@
In diesem Ordner können Locale-Dateien abgelegt werden.
Diese überschreiben globale Locales die unter /locale/ abgelegt sind.
In den Dateien müssen nicht alle Phrasen vorhanden sein. Es genügt, wenn nur die Phrasen vorhanden sind die überschrieben werden sollen. Alle anderen Phrasen werden aus dem Standard-Ordner übernommen.
Die Datei mit der Phrase muss jedoch den selben Namen haben wie die Ursprungsdatei in der die Phrase enthalten ist.
View File
View File
View File
@@ -1,2 +0,0 @@
In diesem Ordner können modifizierte ODT Vorlagen für die Dokumentenerstellung abgelegt werden.
Vorlagen die in diesem Ordner abgelegt werden, werden bevorzugt gegenüber jenen die unter /system/vorlage_zip abgelegt sind.
-29
View File
@@ -1,29 +0,0 @@
<?php
/* Copyright (C) 2013 FH Technikum-Wien
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
*
*/
// Name des Addons
$addon_name = 'Template';
// Versionsnummer des Addons
$addon_version = '0.01';
// FH-Complete Min-Version
$fhcomplete_target_version = '2.2';
?>
-44
View File
@@ -1,44 +0,0 @@
<?php
/* Copyright (C) 2013 FH Technikum-Wien
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
*
*/
require_once('../../../config/vilesci.config.inc.php');
require_once('../../../include/functions.inc.php');
require_once('../../../include/benutzerberechtigung.class.php');
echo '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<link rel="stylesheet" href="../../../skin/fhcomplete.css" type="text/css">
<link rel="stylesheet" href="../../../skin/vilesci.css" type="text/css">
<title>Template</title>
</head>
<body>
<h1>Template</h1>';
$uid = get_uid();
$rechte = new benutzerberechtigung();
$rechte->getBerechtigungen($uid);
if(!$rechte->isBerechtigt('basis/addon'))
{
die('Sie haben keine Berechtigung fuer diese Seite');
}
echo 'Template Addon Vilesci Integration';
?>
-44
View File
@@ -1,44 +0,0 @@
<?php
/* Copyright (C) 2015 fhcomplete.org
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
*
* Authors: Andreas Oesterreicher <andreas.oesterreicher@technikum-wien.at>
*/
/**
* Initialisierung des Addons
*/
?>
if(typeof addon =='undefined')
var addon=Array();
addon.push(
{
init: function(page, params)
{
// Diese Funktion wird nach dem Laden der Seite im Vilesci aufgerufen
/*
switch(page)
{
case 'vilesci/lehre/lehrveranstaltung.php':
break;
default:
break;
}
*/
}
});
-44
View File
@@ -1,44 +0,0 @@
<?php
/* Copyright (C) 2017 fhcomplete.org
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
*
* Authors: Andreas Oesterreicher <andreas.oesterreicher@technikum-wien.at>,
*/
/**
* Hier koennen neue Menuepunkte im Vilesci definiert werden
*/
// Hauptmenuepunkt hinzufuegen
$menu_addon = array
(
'Template'=>array
(
'name'=>'Template', 'opener'=>'true', 'hide'=>'true', 'permissions'=>array('basis/addon'), 'image'=>'../../skin/images/vilesci_addons.png',
'link'=>'left.php?categorie=Template', 'target'=>'nav',
'TemplateEntry1'=>array('name'=>'Template Entry1', 'link'=>'../addons/template/vilesci/index.php', 'target'=>'main'),
'TemplateEntry2'=>array('name'=>'Template Entry2', 'link'=>'../addons/template/vilesci/index.php', 'target'=>'main')
)
);
$menu = array_merge($menu,$menu_addon);
// Submenuepunkt hinzufuegen unter dem Hauptmenue Punkt "Admin"
$menu_addon = array
(
'TemplateSubmenu'=>array('name'=>'Template', 'link'=>'../addons/template/vilesci/index.php', 'target'=>'main','permissions'=>array('basis/addon')),
);
$menu['Admin'] = array_merge($menu['Admin'],$menu_addon);
?>
@@ -1,69 +0,0 @@
<?php
/* Copyright (C) 2014 fhcomplete.org
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
*
* Authors: Andreas Oesterreicher <andreas.oesterreicher@technikum-wien.at> and
*/
/**
* Benutzerdefinierte Funktion zur Generierung der UIDs
* Zur Aktivierung muss die Datei in generateuid.inc.php umbenannt werden
*/
/**
* Generiert die UID für Studierende
*
* @param $stgkzl Studiengangskuerzel
* @param $jahr Studienjahr (zB 2014)
* @param $stgtyp Studiengangstyp einstellige Ziffer
* @param $matrikelnummer Personenkennzeichen des Studierenden
*/
function generateUID($stgkzl, $jahr, $stgtyp, $matrikelnummer)
{
return $matrikelnummer;
}
/**
* Gerneriert die Mitarbeiter UID
* Format v.nachname max 20 Zeichen
* Im Fall von Doppelnamen wird vor dem Bindestrich abgeschnitten
*
* @param $vorname Vorname
* @param $nachname Nachname
* @param $lektor Boolean true wenn Lektor sonst false
*/
function generateMitarbeiterUID($vorname, $nachname, $lektor, $fixangestellt=true)
{
$bn = new benutzer();
$uid='';
// Wenn ein Bindestrich vorhanden ist (Doppelname), dort abschneiden
if(mb_strpos($nachname,'-')!==false)
$nachname = mb_substr($nachname, 0, mb_strpos($nachname,'-'));
// Nachname wird so lange verkuerzt bis eine eindeutige UID entsteht die noch nicht vergeben ist
for($nn=18;$nn!=0;$nn--)
{
$uid = mb_substr($vorname,0,1);
$uid .= mb_substr($nachname,0,$nn);
$uid = mb_str_replace(' ','',$uid);
$uid = mb_str_replace('-','',$uid);
$uid = mb_strtolower($uid);
if(!$bn->uid_exists($uid))
return $uid;
}
return false;
}
@@ -1,39 +0,0 @@
<?php
/* Copyright (C) 2014 fhcomplete.org
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
*
* Authors: Andreas Oesterreicher <andreas.oesterreicher@technikum-wien.at>
*/
/*
* Diese Datei überschreibt die Default-Funktionen zur Passwort Änderung
* Zur Aktivierung muss die Datei in passwort.inc.php umbenannt werden
*
* Ansonsten wird die Default Funktionalität unter /include/tw/passwort.inc.php verwendet
*/
/**
* Aendert das Passwort
* @param $passwort_alt Altes (aktuelles) Passwort
* @param $passwort_neu neues Passwort
* @param $uid - UID/Benutzername des Users
* @return true wenn erfolgreich - Fehlermeldung im Fehlerfall
*/
function change_password($passwort_alt, $passwort_neu, $uid)
{
return 'Passwort Änderung fehlgeschlagen.';
}
?>
@@ -1,72 +0,0 @@
<?php
/* Copyright (C) 2014 fhcomplete.org
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as
* published by the Free Software Foundation; either version 2 of the
* License, or (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program; if not, write to the Free Software
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
*
* Authors: Andreas Oesterreicher <andreas.oesterreicher@technikum-wien.at>
*/
// Raumtyp der per Default am Infoterminal angezeigt wird
$ServiceTerminalDefaultRaumtyp='EDV';
// Liste der Raumtypen die am Infoterminal angezeigt werden
$ServiceTerminalRaumtypen=array(
array("type"=>"EDV","beschreibung"=>"&nbsp;Freie&nbsp;<br>&nbsp;PC R&auml;ume&nbsp;","img"=>""),
array("type"=>"HS","beschreibung"=>"&nbsp;Freie&nbsp;<br>&nbsp;H&ouml;rs&auml;le&nbsp;","img"=>""),
array("type"=>"SEM","beschreibung"=>"&nbsp;Freie&nbsp;<br>&nbsp;Seminarr&auml;ume&nbsp;","img"=>""),
array("type"=>"Lab","beschreibung"=>"&nbsp;Freie&nbsp;<br>&nbsp;Laborr&auml;ume&nbsp;","img"=>""),
);
/**
* Prueft ob die Karte verlaengert werden darf
* @param $uid
* @return Array mit boolean und Errormsg
*/
function ServiceTerminalCheckVerlaengerung($uid)
{
if(!check_lektor($uid))
{
$konto = new konto();
if($aktSemester= $konto->getLastStudienbeitrag($uid))
{
return array(true,'Studienbeitrag für Semester '.$aktSemester.' bezahlt');
}
else
{
return array(false,'Verlängerung der Karte ist derzeit nicht möglich da der Studienbeitrag noch nicht bezahlt wurde');
}
}
else
return array(false,'Für Mitarbeiter ist eine Kartenverlängerung nicht möglich');
}
/**
* Liefert den Text der auf die Karte gedruckt werden soll oder einer Errormsg
* @param $uid UID des Users
* @return array mit Datum/Drucktext und errorMessage
*/
function ServiceTerminalGetDrucktext($uid)
{
// hole Semester des letzten eingezahlten Studienbeitrages
$konto = new konto();
if(!$aktSemester= $konto->getLastStudienbeitrag($uid))
{
return array('datum'=>'', 'errorMessage'=>'Fehler beim Auslesen des Studienganges. Bitte wenden Sie sich an den Service Desk.');
}
return array('datum'=>'Gueltig fuer/valid for '.$aktSemester, 'errorMessage'=>'');
}
?>
View File
+2
View File
@@ -3,6 +3,8 @@ if (! defined('BASEPATH')) exit('No direct script access allowed');
use CI3_Events as Events;
// build the menu for fhc
/**
* NOTE(chris): example:
Events::on('stv_conf_student', function (&$res) {
@@ -17,6 +17,7 @@ class Dashboard extends Auth_Controller
'index' => 'user:r'
)
);
}
// -----------------------------------------------------------------------------------------------------------------
@@ -26,7 +27,7 @@ class Dashboard extends Auth_Controller
* @return void
*/
public function index()
{
{
$this->load->view('CisHtml/Dashboard.php');
}
}
@@ -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');
class Lehre extends FHCAPI_Controller
{
/**
* Object initialization
*/
public function __construct()
{
parent::__construct([
'lvStudentenMail' => self::PERM_LOGGED,
]);
}
//------------------------------------------------------------------------------------------------------------------
// Public methods
/**
* constructs the emails of the groups from a lehrveranstaltung
*/
public function lvStudentenMail()
{
$lehreinheit_id = $this->input->get("lehreinheit_id",TRUE);
// return early if the required parameter is missing
if(!isset($lehreinheit_id))
{
$this->terminateWithError('Missing required parameter', self::ERROR_TYPE_GENERAL);
}
$this->load->model('education/Lehreinheit_model', 'LehreinheitModel');
$studentenMails = $this->LehreinheitModel->getStudentenMail($lehreinheit_id);
$studentenMails = $this->getDataOrTerminateWithError($studentenMails);
//convert array of objects into array of strings
$studentenMails = array_map(function($element){
return $element->mail;
}, $studentenMails);
$this->terminateWithSuccess($studentenMails);
}
}
@@ -0,0 +1,803 @@
<?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;
/**
* This controller operates between (interface) the JS (GUI) and the SearchBarLib (back-end)
* Provides data to the ajax get calls about the searchbar component
* This controller works with JSON calls on the HTTP GET and the output is always JSON
*/
class LvMenu extends FHCAPI_Controller
{
/**
* Object initialization
*/
public function __construct()
{
parent::__construct([
'getLvMenu' => self::PERM_LOGGED
]);
$this->load->library("PhrasesLib");
$this->loadPhrases(array('global'));
}
//------------------------------------------------------------------------------------------------------------------
// Public methods
/**
*
*/
public function getLvMenu($lvid, $studiensemester_kurzbz)
{
// return early if parameters are missing
if(!isset($lvid) || !isset($studiensemester_kurzbz))
$this->terminateWithError('Missing parameters', self::ERROR_TYPE_GENERAL);
// FH-Core Variables
// ##########################################################################################
require_once(FHCPATH.'config/cis.config.inc.php');
require_once(FHCPATH.'include/lehrveranstaltung.class.php');
require_once(FHCPATH.'include/studiensemester.class.php');
require_once(FHCPATH.'include/lehreinheit.class.php');
require_once(FHCPATH.'include/vertrag.class.php');
require_once(FHCPATH.'include/functions.inc.php');
require_once(FHCPATH.'include/benutzerberechtigung.class.php');
require_once(FHCPATH.'include/studiengang.class.php');
require_once(FHCPATH.'include/phrasen.class.php');
require_once(FHCPATH.'include/lvangebot.class.php');
require_once(FHCPATH.'include/lehre_tools.class.php');
// data gets not returned
//require_once(FHCPATH.'addons/moodle/lib/LogicCourses.php');
//require_once(FHCPATH.'addons/moodle/lib/Database.php');
// get the sprache
$sprache = getSprache();
$p = new phrasen($sprache);
//$p = $this->$p;
// get the db
if (!$db = new basis_db())
die($p->t('global/fehlerBeimOeffnenDerDatenbankverbindung'));
// get the user
if (!$user=get_uid())
die($p->t('global/nichtAngemeldet'));
// check if is_lector
if(check_lektor($user))
$is_lector=true;
else
$is_lector=false;
// definition of user_is_allowed_to_upload
$user_is_allowed_to_upload=false;
// rechte des users
$rechte = new benutzerberechtigung();
$rechte->getBerechtigungen($user);
$angezeigtes_stsem = $studiensemester_kurzbz;
// load lehreinheit
$lehreinheit = new lehreinheit($lvid);
// load lehrveranstaltung
$lv_obj = new lehrveranstaltung();
$lv_obj->load($lvid);
$lv=$lv_obj;
// define studiengang_kz / semester / lehrverzeichnis
$studiengang_kz = $lv->studiengang_kz;
$semester = $lv->semester;
$short = $lv->lehreverzeichnis;
// load studiengang
$stg_obj = new studiengang();
$stg_obj->load($lv->studiengang_kz);
$kurzbz = $stg_obj->kuerzel;
$short_name = $lv->bezeichnung;
$short_short_name = $lv->lehreverzeichnis;
// create documents directory
$dir_name=DOC_ROOT.'/documents';
if(!is_dir($dir_name))
{
exec('mkdir -m 755 '.escapeshellarg($dir_name));
exec('sudo chown www-data:teacher '.escapeshellarg($dir_name));
}
// angemeldet
$angemeldet = true;
if(defined('CIS_LEHRVERANSTALTUNG_WENNANGEMELDET_DETAILS_ANZEIGEN') && CIS_LEHRVERANSTALTUNG_WENNANGEMELDET_DETAILS_ANZEIGEN && !$is_lector)
{
$angemeldet = false;
$lehrveranstaltung_obj = new lehrveranstaltung();
$result = $lehrveranstaltung_obj->getLehreinheitenOfLv($lvid, $user, $angezeigtes_stsem);
if(count($result)>0)
$angemeldet = true;
}
// lehrfach
$lehrfach_id='';
if(defined('CIS_LEHRVERANSTALTUNG_LEHRFACH_ANZEIGEN') && CIS_LEHRVERANSTALTUNG_LEHRFACH_ANZEIGEN)
{
// Wenn der eingeloggte User zu einer der Lehreinheiten zugeteilt ist
// wird zusätzlich das Lehrfach der Lehreinheit angezeigt.
if($is_lector )
{
$result = $lehreinheit->lehrfach_id_mitarbeiter($angezeigtes_stsem,$user,$lvid);
}
else
{
$result = $lehreinheit->lehrfach_id_studierender($angezeigtes_stsem,$user,$lvid);
}
// Wenn die LV mehrere verschiedenen Lehrfaecher hat, und der User zu mehreren davon zugeteilt ist
// wird das Lehrfach nicht angezeigt damit es nicht zu verwirrungen kommt.
if(count($result)==1 && $row = $result[0])
{
$lehrfach_id=$row->lehrfach_id;
}
}
// lektor der lv
$lektor_der_lv=false;
$db_result = $lehreinheit->lehreinheitInfo($lvid,$angezeigtes_stsem,$lehrfach_id);
$num_rows_result = count($db_result);
if($num_rows_result > 0)
{
foreach($db_result as $row_lector)
{
// Lektor wird erst angezeigt wenn der Auftrag erteilt wurde
if (defined('CIS_LV_LEKTORINNENZUTEILUNG_VERTRAGSPRUEFUNG_VON')
&& CIS_LV_LEKTORINNENZUTEILUNG_VERTRAGSPRUEFUNG_VON != '')
{
$vertrag = new vertrag();
if (!$vertrag->isVertragErteiltLV($lvid, $angezeigtes_stsem, $row_lector->uid))
{
continue;
}
}
if($user==$row_lector->uid)
{
$lektor_der_lv=true;
$user_is_allowed_to_upload=true;
}
// style of the link
if($row_lector->lvleiter=='t')
$style='style="font-weight: bold"';
else
$style='';
}
}
//Berechtigungen auf Fachbereichsebene
$lehrfach_oe_kurzbz_arr = array();
if($result = $lv_obj->getBerechtigungenAufFachberechsebene($lvid,$angezeigtes_stsem))
{
foreach($result as $row)
{
$lehrfach_oe_kurzbz_arr[]=$row->oe_kurzbz;
if($rechte->isBerechtigt('lehre',$row->oe_kurzbz) || $rechte->isBerechtigt('assistenz',$stg_obj->oe_kurzbz)){
$user_is_allowed_to_upload=true;
}
}
}
// FH-Core Menu Logic
// ##########################################################################################
$menu = array();
//todo: digitale anwesenheiten sollte ein Events.php im config/ folder beinhalten
//$this->fhc_menu_digitale_anwesenheiten($menu, $angemeldet, $studiengang_kz, $semester, $lvid, $angezeigtes_stsem, $p);
$this->fhc_menu_lvinfo($menu, $lvid, $studiengang_kz, $lektor_der_lv, $is_lector, $rechte, $lehrfach_oe_kurzbz_arr, $p);
$this->fhc_menu_feedback($menu, $angemeldet, $lvid, $p);
$this->fhc_menu_gesamtnote($menu, $angemeldet, $lvid, $lv_obj, $is_lector, $angezeigtes_stsem, $p);
$this->fhc_menu_emailStudierende($menu, $angemeldet, $lehreinheit->lehreinheit_id, $p);
$this->fhc_menu_abmeldung($menu, $user, $is_lector, $lvid, $angezeigtes_stsem, $p);
$this->fhc_menu_lehretools($menu, $lvid, $angezeigtes_stsem, $sprache);
$this->fhc_menu_anrechnungStudent($menu, $rechte, $lvid, $angezeigtes_stsem, $p);
$this->fhc_menu_anrechnungLector($menu, $rechte, $angezeigtes_stsem, $p);
// LEGACY FH-CORE MENU POINTS
//$this->fhc_menu_notenliste($menu, $angemeldet, $is_lector, $lvid, $studiengang_kz, $angezeigtes_stsem, $kurzbz, $semester, $short_short_name, $p);
//$this->fhc_menu_download($menu, $angemeldet, $user_is_allowed_to_upload, $rechte, $semester, $kurzbz, $studiengang_kz, $short_short_name, $short, $p);
//$this->fhc_menu_semesterplan($menu, $angemeldet, $user_is_allowed_to_upload, $rechte, $lvid, $studiengang_kz, $kurzbz, $semester, $short_short_name, $p);
//$this->fhc_menu_stundenupload($menu, $angemeldet, $lvid, $is_lector, $studiengang_kz, $kurzbz, $semester, $short, $short_short_name, $p);
//$this->fhc_menu_pinboard($menu, $angemeldet, $is_lector, $studiengang_kz, $semester, $p);
// Addons Menu Logic
// ##########################################################################################
$params = [
'sprache'=>$sprache,
'p'=>$p,
'ci_p'=> $this->p,
'db'=>$db,
'user'=>$user,
'is_lector'=>$is_lector,
'user_is_allowed_to_upload'=>$user_is_allowed_to_upload,
'rechte'=>$rechte,
'angezeigtes_stsem'=>$angezeigtes_stsem,
'lehreinheit'=>$lehreinheit,
'lv_obj'=>$lv_obj,
'lv'=>$lv,
'lvid'=>$lvid,
'studiengang_kz'=>$studiengang_kz,
'semester'=>$semester,
'short'=>$short,
'stg_obj'=>$stg_obj,
'kurzbz'=>$kurzbz,
'short_name'=>$short_name,
'short_short_name'=>$short_short_name,
'dir_name'=>$dir_name,
'angemeldet'=>$angemeldet,
'lehrfach_id'=>$lehrfach_id,
'lektor_der_lv'=>$lektor_der_lv,
'lehrfach_oe_kurzbz_arr'=>$lehrfach_oe_kurzbz_arr,
];
Events::trigger('lvMenuBuild',
// passing $menu per reference
function & () use (&$menu) {
return $menu;
},
$params
);
// Menu sortieren
// ##########################################################################################
foreach ($menu as $key => $row){
// removes menu points that are not needed in the c4 lvUebersicht
if( !array_key_exists('c4_link',$row) || !array_key_exists('c4_icon',$row)){
unset($menu[$key]);
continue;
}
// fills pos array to sort the menu
$pos[$key] = $row['position'];
}
array_multisort($pos, SORT_ASC, SORT_NUMERIC, $menu);
// DEBUGGING
$this->addMeta("is_lector",$is_lector);
$this->addMeta("lektor_der_lv",$lektor_der_lv);
// HTTP response
// ##########################################################################################
$this->terminateWithSuccess($menu);
}
private function fhc_menu_digitale_anwesenheiten(&$menu, $angemeldet, $studiengang_kz, $semester, $lvid, $angezeigtes_stsem, $p){
// DIGITALE ANWESENHEITEN
if (CIS_LEHRVERANSTALTUNG_ANWESENHEIT_ANZEIGEN && $angemeldet) {
$menu[] = array
(
'id' => 'core_menu_digitale_anwesenheitslisten',
'position' => '50',
'name' => $p->t('lehre/digiAnw'),
'c4_icon' => base_url('skin/images/button_kreuzerltool.png'),
'c4_link' => base_url("index.ci.php/extensions/FHC-Core-Anwesenheiten/?stg_kz=$studiengang_kz&sem=$semester&lvid=$lvid&sem_kurzbz=$angezeigtes_stsem&nav=false"),
'c4_linkList' => []
);
}
}
private function fhc_menu_lvinfo(&$menu, $lvid, $studiengang_kz, $lektor_der_lv, $is_lector, $rechte, $lehrfach_oe_kurzbz_arr, $p){
// LVINFO
if(!defined('CIS_LEHRVERANSTALTUNG_LVINFO_ANZEIGEN') || CIS_LEHRVERANSTALTUNG_LVINFO_ANZEIGEN)
{
$c4_linkList=array();
// Bearbeiten Button anzeigen wenn Lektor der LV und bearbeiten fuer Lektoren aktiviert ist
// Oder Berechtigung zum Bearbeiten eingetragen ist
if((!defined('CIS_LEHRVERANSTALTUNG_LVINFO_LEKTOR_EDIT') && $lektor_der_lv)
|| (defined('CIS_LEHRVERANSTALTUNG_LVINFO_LEKTOR_EDIT') && CIS_LEHRVERANSTALTUNG_LVINFO_LEKTOR_EDIT==true && $lektor_der_lv)
|| $rechte->isBerechtigt('lehre/lvinfo',$studiengang_kz)
|| $rechte->isBerechtigtMultipleOe('lehre/lvinfo', $lehrfach_oe_kurzbz_arr)
)
{
$c4_linkList[]= [$p->t('lehre/lvInfoBearbeiten'), 'ects/index.php?lvid='.$lvid];
}
elseif ($is_lector)
{
$c4_linkList[]= ["Bearbeiten der LV-Infos derzeit gesperrt",'#'];
}
$menu[]=array
(
'id'=>'core_menu_lvinfo',
'position'=>'10',
'name'=>$p->t('lehre/lehrveranstaltungsinformation'),
'icon'=>'../../../skin/images/button_lvinfo.png',
'link'=>'',
'c4_icon'=> base_url('skin/images/button_lvinfo.png'),
'c4_link'=>'',
'c4_linkList'=>$c4_linkList
);
}
}
private function fhc_menu_feedback(&$menu, $angemeldet, $lvid, $p){
//FEEDBACK
if((!defined('CIS_LEHRVERANSTALTUNG_FEEDBACK_ANZEIGEN') || CIS_LEHRVERANSTALTUNG_FEEDBACK_ANZEIGEN) && $angemeldet)
{
$menu[]=array
(
'id'=>'core_menu_feedback',
'position'=>'60',
'name'=>$p->t('lehre/feedback'),
'c4_icon'=> base_url('skin/images/button_feedback.png'),
'c4_link'=> base_url('feedback.php?lvid='.$lvid),
);
}
}
private function fhc_menu_gesamtnote(&$menu, $angemeldet, $lvid, $lv_obj, $is_lector, $angezeigtes_stsem, $p){
//Gesamtnote
if($is_lector && ((!defined('CIS_LEHRVERANSTALTUNG_GESAMTNOTE_ANZEIGEN') || CIS_LEHRVERANSTALTUNG_GESAMTNOTE_ANZEIGEN) && $angemeldet))
{
if($lv_obj->benotung)
{
$menu[]=array
(
'id'=>'core_menu_gesamtnote',
'position'=>'80',
'name'=>$p->t('lehre/gesamtnote'),
'c4_icon'=> base_url('skin/images/button_endnote.png'),
'c4_link'=> base_url('cis/private/lehre/benotungstool/lvgesamtnoteverwalten.php?lvid='.urlencode($lvid).'&stsem='.urlencode($angezeigtes_stsem))
//'c4_link'=> base_url('benotungstool/lvgesamtnoteverwalten.php?lvid='.urlencode($lvid).'&stsem='.urlencode($angezeigtes_stsem))
);
}
else
{
$menu[]=array
(
'id'=>'core_menu_gesamtnote',
'position'=>'80',
'name'=>$p->t('lehre/gesamtnote'),
'c4_icon'=>base_url('skin/images/button_endnote.png'),
'c4_link'=>'#',
'c4_linkList'=>[[$p->t('lehre/noteneingabedeaktiviert'),'#']],
);
}
}
}
private function fhc_menu_emailStudierende(&$menu, $angemeldet, $lehreinheit_id,$p){
// Email an Studierende
if((!defined('CIS_LEHRVERANSTALTUNG_MAILSTUDIERENDE_ANZEIGEN') || CIS_LEHRVERANSTALTUNG_MAILSTUDIERENDE_ANZEIGEN) && $angemeldet)
{
$mailto='mailto:';
$c4_linkList=array();
// load the Lehreinheit model and get the student mails
$this->load->model('education/Lehreinheit_model','LehreinheitModel');
$studentMails = $this->LehreinheitModel->getStudentenMail($lehreinheit_id);
// get the data of the database result and map the array of objects to their object property
$studentMails = $this->getDataOrTerminateWithError($studentMails, 'No student mails found');
// emails used to create the mailto link
$mailtoMails = array();
$noMails = array();
$noMailLink = FALSE;
foreach($studentMails as $mail){
if($mail->mail == 'nomail'){
$noMails[]=$mail->gruppe_kurzbz;
$noMailLink= TRUE;
}else{
$mailtoMails[]=$mail->mail;
}
}
if($noMailLink){
$c4_linkList[]=[$p->t('lehre/keinMailverteiler',array(implode(" ",$noMails))), '#'];
$link_onclick='alert(\''.$p->t('lehre/keinMailverteiler',array(implode(" ",$noMails))).'\');';
}else{
$link_onclick='';
}
$mailto .= implode(',',$mailtoMails);
$menu[]=array
(
'id'=>'core_menu_mailanstudierende',
'position'=>'100',
'name'=>$p->t('lehre/mail'),
'c4_icon'=>base_url('skin/images/button_feedback.png'),
'c4_link'=>$mailto,
'c4_linkList'=>$c4_linkList,
'link_onclick'=>$link_onclick
);
}
}
private function fhc_menu_abmeldung(&$menu, $user, $is_lector, $lvid, $angezeigtes_stsem, $p){
if(!defined('CIS_LEHRVERANSTALTUNG_ABMELDUNG_ANZEIGEN') || CIS_LEHRVERANSTALTUNG_ABMELDUNG_ANZEIGEN)
{
if(!$is_lector)
{
$lvangebot = new lvangebot();
$gruppen = $lvangebot->AbmeldungMoeglich($lvid, $angezeigtes_stsem, $user);
if(count($gruppen)>0)
{
$menu[]=array
(
'id'=>'core_menu_abmeldung',
'position'=>'120',
'name'=>$p->t('lehre/abmelden'),
'c4_icon'=>base_url('skin/images/button_studiupload.png'),
'c4_link'=>base_url('abmeldung.php?lvid='.urlencode($lvid).'&stsem='.urlencode($angezeigtes_stsem)),
);
}
}
}
}
private function fhc_menu_lehretools(&$menu, $lvid, $angezeigtes_stsem, $sprache){
//Anzeigen von zusaetzlichen Lehre-Tools
$lehretools = new lehre_tools();
if($lehretools->getTools($lvid, $angezeigtes_stsem))
{
if(count($lehretools->result)>0)
{
foreach($lehretools->result as $row)
{
$menu[]=array
(
'id'=>'core_menu_lehretools_'.$row->lehre_tools_id,
'position'=>'1000',
'name'=>$row->bezeichnung[$sprache],
'c4_icon'=>base_url('cms/dms.php?id='.$row->logo_dms_id),
'c4_link'=>$row->basis_url,
);
}
}
}
}
private function fhc_menu_anrechnungStudent(&$menu, $rechte, $lvid, $angezeigtes_stsem, $p){
// Anerkennung nachgewiesener Kenntnisse (Anrechnung) - Anzeige fuer Studenten
if((!defined('CIS_LEHRVERANSTALTUNG_ANRECHNUNG_ANZEIGEN') || CIS_LEHRVERANSTALTUNG_ANRECHNUNG_ANZEIGEN)
&& $rechte->isBerechtigt('student/anrechnung_beantragen'))
{
$menu[]=array
(
'id'=>'core_menu_anerkennungNachgewiesenerKenntnisse',
'position'=>'128',
'name'=>$p->t('lehre/anrechnung'),
'c4_icon'=>base_url('skin/images/button_listen.png'),
'c4_link' => base_url('index.ci.php/lehre/anrechnung/RequestAnrechnung?studiensemester='.urlencode($angezeigtes_stsem).'&lv_id='.urlencode($lvid))
);
}
}
private function fhc_menu_anrechnungLector(&$menu, $rechte, $angezeigtes_stsem, $p){
// Anerkennung nachgewiesener Kenntnisse (Anrechnung) - Anzeige fuer LektorInnen
if((!defined('CIS_LEHRVERANSTALTUNG_ANRECHNUNG_ANZEIGEN') || CIS_LEHRVERANSTALTUNG_ANRECHNUNG_ANZEIGEN)
&& $rechte->isBerechtigt('lehre/anrechnung_empfehlen'))
{
$menu[]=array
(
'id'=>'core_menu_anerkennungNachgewiesenerKenntnisse_empfehlen',
'position'=>'128',
'name'=>$p->t('lehre/anrechnungen'),
'c4_icon'=> base_url('skin/images/button_listen.png'),
'c4_link' => base_url('index.ci.php/lehre/anrechnung/ReviewAnrechnungUebersicht?studiensemester='.urlencode($angezeigtes_stsem))
);
}
}
// OLD PINBOARD MENU POINT *********************************************************************************************************************************************
/*
private function fhc_menu_pinboard(&$menu, $angemeldet, $is_lector, $studiengang_kz, $semester, $p){
// Pinboard
if((!defined('CIS_LEHRVERANSTALTUNG_PINBOARD_ANZEIGEN') || CIS_LEHRVERANSTALTUNG_PINBOARD_ANZEIGEN) && $angemeldet)
{
$text='';
if($is_lector)
$text.= "<a href='../../../cms/newsverwaltung.php?studiengang_kz=$studiengang_kz&semester=$semester' class='Item'>".$p->t('profil/adminstration')."</a>";
// this is the new cis4 version
$menu[]=array
(
'id'=>'core_menu_pinboard',
'position'=>'110',
'name'=>$p->t('lehre/pinboard'),
'c4_icon'=>base_url('skin/images/button_pinboard.png'),
'c4_link'=>base_url('CisHtml/Cms/news'),
'text'=>$text
);
}
}
*/
// LEGACY MENU POINTS THAT USED OWN DIRECTORIES *************************************************************************************************************************
/*
private function fhc_menu_semesterplan(&$menu, $angemeldet, $user_is_allowed_to_upload, $rechte, $lvid, $studiengang_kz, $kurzbz, $semester, $short_short_name, $p){
// Semesterplan
if((!defined('CIS_LEHRVERANSTALTUNG_SEMESTERPLAN_ANZEIGEN') || CIS_LEHRVERANSTALTUNG_SEMESTERPLAN_ANZEIGEN) && $angemeldet)
{
$dir_name = $this->ensureDirectoryExists($kurzbz, $semester, $short_short_name, 'semesterplan','teacher');
$dir_empty = $this->isDirectoryEmpty($dir_name);
if($dir_empty == false)
{
$link = $dir_name.'/';
}
else
$link = '';
$text='';
if((!defined('CIS_LEHRVERANSTALTUNG_SEMESTERPLAN_LEKTOR_EDIT') && $user_is_allowed_to_upload)
|| (defined('CIS_LEHRVERANSTALTUNG_SEMESTERPLAN_LEKTOR_EDIT') && CIS_LEHRVERANSTALTUNG_SEMESTERPLAN_LEKTOR_EDIT==true && $user_is_allowed_to_upload)
|| $rechte->isBerechtigt('admin',$studiengang_kz) || $rechte->isBerechtigt('lehre',$studiengang_kz))
{
$text.= '<a class="Item" href="#" onClick="javascript:window.open(\'semupload.php?lvid='.$lvid.'\',\'_blank\',\'width=400,height=300,location=no,menubar=no,status=no,toolbar=no\');return false;">';
$text.= $p->t('lehre/semesterplanUpload')."</a>";
$text.= '&nbsp;&nbsp;&nbsp;<a class="Item" href="semdownhlp.php" >';
$text.= $p->t('lehre/semesterplanVorlage');
$text.= ' [html]';
$text.= '</a>';
$text.= '&nbsp;<a class="Item" href="semdownhlp.php?format=doc" >';
$text.= '[doc]';
$text.= '</a>';
$text.= '&nbsp;<a href="#" onClick="showSemPlanHelp()";>('.$p->t('lehre/semesterplanVorlageHilfe').')</a>';
}
$menu[]=array
(
'id'=>'core_menu_semesterplan',
'position'=>'20',
'name'=>$p->t('lehre/semesterplan'),
'icon'=>'../../../skin/images/button_semplan.png',
'link'=>$link,
'c4_icon'=> base_url('skin/images/button_semplan.png'),
'c4_link'=> $link,
'link_target'=>'_blank',
'text'=>$text
);
}
}
private function fhc_menu_stundenupload(&$menu, $angemeldet, $lvid, $is_lector, $studiengang_kz, $kurzbz, $semester, $short, $short_short_name, $p){
// Studentenupload
if((!defined('CIS_LEHRVERANSTALTUNG_STUDENTENUPLOAD_ANZEIGEN') || CIS_LEHRVERANSTALTUNG_STUDENTENUPLOAD_ANZEIGEN) && $angemeldet)
{
$link='';
$link_target='';
$dir_name = $this->ensureDirectoryExists($kurzbz, $semester, $short_short_name, 'upload','student');
$dir_empty = $this->isDirectoryEmpty($dir_name);
if(isset($dir_empty) && $dir_empty == false)
{
if($is_lector == true)
{
$link='lector_choice.php?lvid='.urlencode($lvid);
$link_target='_blank';
}
else
{
$link='upload.php?course_id='.urlencode($studiengang_kz).'&term_id='.urlencode($semester).'&short='.urlencode($short);
$link_target='_blank';
}
}
else
{
if($is_lector == true)
{
$link='';
}
else
{
$link='upload.php?course_id='.urlencode($studiengang_kz).'&term_id='.urlencode($semester).'&short='.urlencode($short);
$link_target='_blank';
}
}
$menu[]=array
(
'id'=>'core_menu_studentenupload',
'position'=>'90',
'name'=>$p->t('lehre/studentenAbgabe'),
'c4_icon'=>'skin/images/button_studiupload.png',
'c4_link'=>$link,
'link_target'=>$link_target
);
}
}
private function fhc_menu_download(&$menu, $angemeldet, $user_is_allowed_to_upload, $rechte, $semester, $kurzbz, $studiengang_kz, $short_short_name, $short, $p){
if((!defined('CIS_LEHRVERANSTALTUNG_DOWNLOAD_ANZEIGEN') || CIS_LEHRVERANSTALTUNG_DOWNLOAD_ANZEIGEN) && $angemeldet)
{
$dir_name = $this->ensureDirectoryExists($kurzbz, $semester, $short_short_name, 'download','teacher');
$dir_empty = $this->isDirectoryEmpty($dir_name);
$text = '';
if($dir_empty == false)
{
$link = $dir_name.'/';
}
else
$link = '';
//Wenn user eine Lehrfachzuteilung fuer dieses Lehrfach hat wird
//Ein Link zum Upload angezeigt und ein Link um das Download-Verzeichnis
//als Zip Archiv herunterzuladen
if($user_is_allowed_to_upload || $rechte->isBerechtigt('admin',$studiengang_kz) || $rechte->isBerechtigt('lehre',$studiengang_kz))// || $rechte->isBerechtigt('lehre',null,null,$fachbereich_id))
{
$text.= mb_strtolower("$kurzbz/$semester/$short/download");
$text.= '<br>';
$text.= "<a class='Item' target='_blank' href='upload.php?course_id=$studiengang_kz&term_id=$semester&short=$short'>".$p->t('lehre/upload')."</a>";
$text.= '&nbsp;&nbsp;&nbsp;';
}
$menu[]=array
(
'id'=>'core_menu_download',
'position'=>'30',
'name'=>$p->t('lehre/download'),
'icon'=>'../../../skin/images/button_download.png',
'link'=>$link,
'c4_icon'=> base_url('skin/images/button_download.png'),
'c4_link'=>$link,
'text'=>$text
);
}
}
private function fhc_menu_notenliste(&$menu, $angemeldet, $is_lector, $lvid, $studiengang_kz, $angezeigtes_stsem, $kurzbz, $semester, $short_short_name, $p){
// Anwesenheits und Notenlisten
if(CIS_LEHRVERANSTALTUNG_LEISTUNGSUEBERSICHT_ANZEIGEN || $is_lector)
{
$link='';
$name='';
if($is_lector)
{
$name = $p->t('lehre/anwesenheitsUndNotenlisten');
$link= "anwesenheitsliste.php?stg_kz=$studiengang_kz&sem=$semester&lvid=$lvid&stsem=$angezeigtes_stsem";
}
$text='';
if(CIS_LEHRVERANSTALTUNG_LEISTUNGSUEBERSICHT_ANZEIGEN && ($angemeldet || $is_lector))
{
$dir_name = $this->ensureDirectoryExists($kurzbz, $semester, $short_short_name, 'leistung','teacher');
$dir_empty = $this->isDirectoryEmpty($dir_name);
if($dir_empty == false)
{
if($is_lector)
{
$text.= '<a href="'.$dir_name.'" target="_blank">';
$text.= '<strong>'.$p->t('lehre/leistungsuebersicht').'</strong>';
$text.= '</a>';
}
else
{
$name = $p->t('lehre/leistungsuebersicht');
$link = $dir_name;
}
}
else
{
if($is_lector)
{
$text.= '<strong>'.$p->t('lehre/leistungsuebersicht').'</strong>';
}
else
{
$name = $p->t('lehre/leistungsuebersicht');
$link = '';
}
}
}
$menu[]=array
(
'id'=>'core_menu_anwesenheitslisten',
'position'=>'40',
'name'=>$name,
'icon'=>'../../../skin/images/button_listen.png',
'link'=>$link,
'c4_icon'=> base_url('skin/images/button_listen.png'),
'c4_link'=>$link,
'text'=>$text
);
}
}
private function ensureDirectoryExists($kurzbz, $semester, $short_short_name, $type, $role){
$dir_name = DOC_ROOT.'/documents/'.mb_strtolower($kurzbz).'/'.$semester.'/'.mb_strtolower($short_short_name).'/'.$type;
if (!is_dir($dir_name)) {
exec('mkdir -m 775 -p '.escapeshellarg($dir_name));
exec('sudo chown www-data:teacher '.escapeshellarg(DOC_ROOT.'/documents/'.mb_strtolower($kurzbz)));
exec('sudo chown www-data:teacher '.escapeshellarg(DOC_ROOT.'/documents/'.mb_strtolower($kurzbz).'/'.$semester));
exec('sudo chown www-data:teacher '.escapeshellarg(DOC_ROOT.'/documents/'.mb_strtolower($kurzbz).'/'.$semester.'/'.mb_strtolower($short_short_name)));
exec('sudo chown www-data:'.$role.' '.escapeshellarg($dir_name));
}
return $dir_name;
}
private function isDirectoryEmpty($dir){
return count(scandir($dir)) == 2 ? true : false;
}
*/
}
+5
View File
@@ -46,6 +46,11 @@ class CI3_Events
* NOTE(chris): Autoload Events config
*/
require_once(APPPATH.'config/Events.php');
foreach (scandir(APPPATH.'config/extensions') as $dir)
if ($dir[0] != '.' && file_exists(APPPATH.'config/extensions/'.$dir.'/Events.php'))
require_once APPPATH.'config/extensions/'.$dir.'/Events.php';
foreach (scandir(FHCPATH.'addons') as $dir)
if ($dir[0] != '.' && file_exists(FHCPATH.'addons/'.$dir.'/Events.php'))
require_once FHCPATH.'addons/'.$dir.'/Events.php';
@@ -113,4 +113,47 @@ class Lehreinheit_model extends DB_Model
return $this->execQuery($query, array($lehreinheit_id));
}
/**
* Gets emails of all Studierende in a lehrveranstaltung
* @param int $lehreinheit_id
* @return array
*/
public function getStudentenMail($lehreinheit_id)
{
// logic used from cis_menu_lv.inc.php line 335
return $this->execReadOnlyQuery("
SELECT
gruppe_kurzbz,
CASE
WHEN nomail = TRUE THEN 'nomail'
WHEN gruppe_kurzbz !='' THEN LOWER(gruppe_kurzbz || '@' || ?)
ELSE LOWER(stg_typ || stg_kurzbz || semester || TRIM(verband) || TRIM(gruppe) || '@' || ?)
END AS mail
FROM
(
SELECT
distinct vw_lehreinheit.studiensemester_kurzbz, vw_lehreinheit.stg_kurzbz, vw_lehreinheit.stg_typ, vw_lehreinheit.semester,
COALESCE(vw_lehreinheit.verband,'') as verband, COALESCE(vw_lehreinheit.gruppe,'') as gruppe, vw_lehreinheit.gruppe_kurzbz, tbl_gruppe.mailgrp,
CASE
WHEN mailgrp = TRUE OR mailgrp IS NULL THEN FALSE
ELSE TRUE
END as nomail
FROM campus.vw_lehreinheit
LEFT JOIN public.tbl_gruppe USING(gruppe_kurzbz)
WHERE
vw_lehreinheit.lehrveranstaltung_id=
(select distinct lehrveranstaltung_id from campus.vw_lehreinheit where lehreinheit_id=?)
AND
vw_lehreinheit.studiensemester_kurzbz =
(select distinct studiensemester_kurzbz from campus.vw_lehreinheit where lehreinheit_id=?)
AND (vw_lehreinheit.gruppe_kurzbz IS NULL OR
(vw_lehreinheit.gruppe_kurzbz IS NOT NULL AND (SELECT COUNT(*) FROM public.tbl_benutzergruppe where gruppe_kurzbz = vw_lehreinheit.gruppe_kurzbz AND studiensemester_kurzbz = vw_lehreinheit.studiensemester_kurzbz) > 0))
) AS subquery
",[DOMAIN,DOMAIN,$lehreinheit_id,$lehreinheit_id ]);
}
}
@@ -19,11 +19,12 @@ class Stundenplan_model extends DB_Model
*/
public function loadForUid($uid)
{
$this->addSelect('sp.*');
$this->addSelect(['sp.*','le.studiensemester_kurzbz']);
$this->db->join('public.tbl_benutzergruppe bg', 'sp.gruppe_kurzbz=bg.gruppe_kurzbz AND bg.uid=?', 'LEFT', false);
$this->addJoin('public.tbl_studiensemester ss1', 'bg.studiensemester_kurzbz=ss1.studiensemester_kurzbz AND ss1.start<=sp.datum AND ss1.ende>=sp.datum', 'LEFT');
$this->db->join('public.tbl_studentlehrverband slv', "sp.studiengang_kz=slv.studiengang_kz AND slv.student_uid=? AND (slv.semester=sp.semester OR sp.semester IS NULL) AND (slv.verband=sp.verband OR sp.verband IS NULL OR sp.verband='' OR sp.verband='0') AND (slv.gruppe=sp.gruppe OR sp.gruppe IS NULL OR sp.gruppe='' OR sp.gruppe='0') AND sp.gruppe_kurzbz IS NULL", 'LEFT', false);
$this->addJoin('public.tbl_studiensemester ss2', 'slv.studiensemester_kurzbz=ss2.studiensemester_kurzbz AND ss2.start<=sp.datum AND ss2.ende>=sp.datum', 'LEFT');
$this->db->join('lehre.tbl_lehreinheit le', 'le.lehreinheit_id=sp.lehreinheit_id', 'LEFT');
$this->db->or_where('ss1.studiensemester_kurzbz IS NOT NULL', null, false);
$this->db->or_where('ss2.studiensemester_kurzbz IS NOT NULL', null, false);
+7 -5
View File
@@ -7,13 +7,15 @@ $includesArray = array(
#'skin/style.css.php'
]
);
switch($template_kurzbz){
case 'raum_contentmittitel':
$includesArray['tabulator5'] = true;
break;
if(isset($template_kurzbz)){
switch($template_kurzbz){
case 'raum_contentmittitel':
$includesArray['tabulator5'] = true;
break;
}
}
$this->load->view('templates/CISVUE-Header', $includesArray);
?>
+1
View File
@@ -1,6 +1,7 @@
<?php
$includesArray = array(
'title' => 'FH-Complete',
'tabulator5'=>true,
'customJSModules' => ['public/js/apps/Dashboard/Fhc.js'],
'customCSSs' => [
'public/css/components/dashboard.css'
+7 -5
View File
@@ -8,13 +8,15 @@ $includesArray = array(
]
);
switch($template_kurzbz){
case 'raum_contentmittitel':
$includesArray['tabulator5'] = true;
break;
if(isset($template_kurzbz)){
switch($template_kurzbz){
case 'raum_contentmittitel':
$includesArray['tabulator5'] = true;
break;
}
}
$this->load->view('templates/CISHTML-Header', $includesArray);
$this->load->view('templates/CISVUE-Header', $includesArray);
?>
<h2><?php echo isset($content_id)? "Content" : "News" ?></h2>
+1
View File
@@ -1,6 +1,7 @@
<?php
$includesArray = array(
'title' => 'Dashboard',
'tabulator5'=>true,
'customJSModules' => ['public/js/apps/Dashboard/Fhc.js'],
'customCSSs' => [
'public/css/components/dashboard.css'
+7 -4
View File
@@ -8,12 +8,15 @@ $includesArray = array(
]
);
switch($template_kurzbz){
case 'raum_contentmittitel':
$includesArray['tabulator5'] = true;
break;
if(isset($template_kurzbz)){
switch($template_kurzbz){
case 'raum_contentmittitel':
$includesArray['tabulator5'] = true;
break;
}
}
$this->load->view('templates/CISVUE-Header', $includesArray);
?>
+1
View File
@@ -1,5 +1,6 @@
<?php
$includesArray = array(
'tabulator5'=>true,
'customJSModules' => ['public/js/apps/Dashboard/Fhc.js'],
'customCSSs' => [
'public/css/components/dashboard.css'
+96
View File
@@ -1122,4 +1122,100 @@ class lehreinheit extends basis_db
return $ret;
}
public function lehreinheitInfo($lvid,$angezeigtes_stsem,$lehrfach_id)
{
$qry = "SELECT * FROM (SELECT distinct on(uid) vorname, nachname, tbl_benutzer.uid as uid,
CASE WHEN lehrfunktion_kurzbz='LV-Leitung' THEN true ELSE false END as lvleiter
FROM lehre.tbl_lehreinheit, lehre.tbl_lehreinheitmitarbeiter, public.tbl_benutzer, public.tbl_person
WHERE
tbl_lehreinheit.lehreinheit_id=tbl_lehreinheitmitarbeiter.lehreinheit_id AND
tbl_lehreinheitmitarbeiter.mitarbeiter_uid=tbl_benutzer.uid AND
tbl_person.person_id=tbl_benutzer.person_id AND
lehrveranstaltung_id=".$this->db_add_param($lvid, FHC_INTEGER)." AND
tbl_lehreinheitmitarbeiter.mitarbeiter_uid NOT like '_Dummy%' AND
tbl_benutzer.aktiv=true AND tbl_person.aktiv=true AND
studiensemester_kurzbz=".$this->db_add_param($angezeigtes_stsem);
if($lehrfach_id!='')
$qry.=" AND tbl_lehreinheit.lehrfach_id=".$this->db_add_param($lehrfach_id);
$qry.=" ORDER BY uid, lvleiter desc) as a ORDER BY lvleiter desc, nachname, vorname";
$result = $this->db_query($qry);
if (!$result)
{
$this->errormsg=$this->db_last_error().$qry;
return false;
}
$ret = array();
while($row = $this->db_fetch_object($result))
{
$ret[] = $row;
}
return $ret;
}
public function lehrfach_id_mitarbeiter($angezeigtes_stsem,$user,$lvid)
{
$qry = "SELECT
distinct lehrfach_id
FROM
lehre.tbl_lehreinheit
JOIN lehre.tbl_lehreinheitmitarbeiter USING(lehreinheit_id)
WHERE
studiensemester_kurzbz=".$this->db_add_param($angezeigtes_stsem)."
AND mitarbeiter_uid=".$this->db_add_param($user)."
AND lehrveranstaltung_id=".$this->db_add_param($lvid, FHC_INTEGER);
$result = $this->db_query($qry);
if (!$result)
{
$this->errormsg=$this->db_last_error().$qry;
return false;
}
$ret = array();
while($row = $this->db_fetch_object($result))
{
$ret[] = $row;
}
return $ret;
}
public function lehrfach_id_studierender($lvid,$angezeigtes_stsem,$user)
{
$qry = "SELECT distinct lehrfach_id
FROM
campus.vw_student_lehrveranstaltung
WHERE
lehrveranstaltung_id=".$this->db_add_param($lvid, FHC_INTEGER)."
AND studiensemester_kurzbz=".$this->db_add_param($angezeigtes_stsem)."
AND uid=".$this->db_add_param($user);
$result = $this->db_query($qry);
if (!$result)
{
$this->errormsg=$this->db_last_error().$qry;
return false;
}
$ret = array();
while($row = $this->db_fetch_object($result))
{
$ret[] = $row;
}
return $ret;
}
}
+31
View File
@@ -2861,5 +2861,36 @@ class lehrveranstaltung extends basis_db
return false;
}
}
//Berechtigungen auf Fachbereichsebene
public function getBerechtigungenAufFachberechsebene($lvid,$angezeigtes_stsem)
{
$qry = "SELECT
distinct lehrfach.oe_kurzbz
FROM
lehre.tbl_lehrveranstaltung
JOIN lehre.tbl_lehreinheit USING(lehrveranstaltung_id)
JOIN lehre.tbl_lehrveranstaltung as lehrfach ON(tbl_lehreinheit.lehrfach_id=lehrfach.lehrveranstaltung_id)
WHERE tbl_lehrveranstaltung.lehrveranstaltung_id=".$this->db_add_param($lvid, FHC_INTEGER);
if(isset($angezeigtes_stsem) && $angezeigtes_stsem!=''){
$qry .= " AND studiensemester_kurzbz=".$this->db_add_param($angezeigtes_stsem);
}
$lehrveranstaltungen = [];
if($result = $this->db_query($qry))
{
while($row = $this->db_fetch_object($result))
{
$lehrveranstaltungen[] = $row;
}
return $lehrveranstaltungen;
}
else
{
$this->errormsg = 'Fehler beim Laden der Daten';
return false;
}
}
}
?>
+11
View File
@@ -35,3 +35,14 @@
.cursor-move {
cursor: move;
}
.lvUebersichtMenuPunkt:hover{
background-color:rgba(0, 100, 156, 0.25);
}
.underline_hover:hover{
color:var(--bs-primary);
text-decoration: underline;
}
+12
View File
@@ -0,0 +1,12 @@
export default {
getLvMenu(lvid, studiensemester_kurzbz) {
return this.$fhcApi.get(
FHC_JS_DATA_STORAGE_OBJECT.app_root +
FHC_JS_DATA_STORAGE_OBJECT.ci_router +
`/api/frontend/v1/LvMenu/getLvMenu/${lvid}/${studiensemester_kurzbz}`,
{}
);
},
}
+4
View File
@@ -29,6 +29,8 @@ import betriebsmittel from "./betriebsmittel.js";
import ampeln from "./ampeln.js";
import ort from "./ort.js";
import cms from "./cms.js";
import lehre from "./lehre.js";
import addons from "./addons.js";
export default {
search,
@@ -45,4 +47,6 @@ export default {
ampeln,
ort,
cms,
lehre,
addons,
};
+10
View File
@@ -0,0 +1,10 @@
export default {
getStudentenMail(lehreinheit_id) {
return this.$fhcApi.get(
FHC_JS_DATA_STORAGE_OBJECT.app_root +
FHC_JS_DATA_STORAGE_OBJECT.ci_router +
"/api/frontend/v1/Lehre/lvStudentenMail",
{ lehreinheit_id: lehreinheit_id }
);
},
}
+7 -4
View File
@@ -1,4 +1,5 @@
import BsModal from "../../Bootstrap/Modal";
import RaumContent from "./Content_types/Raum_contentmittitel";
export default {
@@ -8,6 +9,7 @@ export default {
components:{
BsModal,
RaumContent,
},
props:{
contentID:{
@@ -36,7 +38,8 @@ export default {
if(this.contentID){
this.$fhcApi.factory.cms.content(this.contentID).then(res =>{
this.content = res.data;
this.content = res.data.content;
this.type = res.data.type;
})
}
@@ -44,17 +47,17 @@ export default {
},
mounted(){
this.modal = this.$refs.modalContainer;
},
template:/*html*/`
<bs-modal @hideBsModal="modalHidden" @showBsModal="modalShown" ref="modalContainer" dialogClass="modal-lg">
<bs-modal @hideBsModal="modalHidden" dialogClass="modal-xl" @showBsModal="modalShown" ref="modalContainer" dialogClass="modal-lg">
<template #title>
<span v-if="ort_kurzbz">{{ort_kurzbz}}</span>
<span v-else>Raum Informationen</span>
</template>
<template #default>
<div v-if="content" v-html="content"></div>
<RaumContent v-if="content" :content="content"></RaumContent>
<div v-else>Der Content für diesen Raum konnte nicht geladen werden</div>
</template>
<template #footer>
+62 -21
View File
@@ -2,46 +2,87 @@ import BsModal from "../../Bootstrap/Modal";
export default {
props:{
event:{
type:Object,
required:true,
default:null,
}
},
data(){
return {
// reactive data
items:["lehrveranstaltungsInformationen","Notenlisten","Moodle","Gesamtnote","E-mail","Pinboard","Alle Termine der LV","Anrechnung","Evaluierung","Neue Einmeldung"],
lehreinheit:null,
stg:null,
lv:null,
result: false,
menu: [],
selectedMenu:null,
}
},
mixins:[BsModal],
components:{
BsModal,
},
methods:{
selectMenu: function(menuItem, index=null){
// early return if link is #
if(index != null && menuItem.c4_linkList[index][1] == '#') return;
switch(menuItem.id){
case "core_menu_mailanstudierende": window.location.href=menuItem.c4_link; break;
default:
this.selectedMenu= {...menuItem};
}
if( this.selectedMenu && index != null && menuItem.c4_linkList[index][1] !='#'){
this.selectedMenu.c4_link = menuItem.c4_linkList[index][1];
this.selectedMenu.name += ' - ' + menuItem.c4_linkList[index][0];
}
},
hiddenModal: function(){
this.selectedMenu = null;
},
showModal: function(){
this.$fhcApi.factory.addons.getLvMenu(this.event.lehrveranstaltung_id, this.event.studiensemester_kurzbz).then(res =>{
//this.$fhcApi.factory.addons.getLvMenu(750, "WS2005").then(res =>{
if(res.data){
this.menu = res.data;
}
});
},
},
mounted(){
this.modal = this.$refs.modalContainer;
},
template:/*html*/`
<bs-modal ref="modalContainer" dialogClass="modal-lg">
<bs-modal :bodyClass="selectedMenu ? '' : 'px-4 py-5'" @showBsModal="showModal" @hiddenBsModal="hiddenModal" ref="modalContainer" :dialogClass="{'modal-lg': !selectedMenu, 'modal-fullscreen':selectedMenu}">
<template #title>
<span v-if="lv ">
{{lv + (stg?' / ' + stg:'')}}
</span>
<span v-else>
Lehrveranstaltungs Übersicht
</span>
<span v-if="event?.lehrfach_bez ">{{event?.lehrfach_bez + (event?.stg_kurzbzlang?' / ' + event?.stg_kurzbzlang:'')}}</span>
<span v-else>Lehrveranstaltungs Übersicht</span>
</template>
<template #default>
<div :style="{'display':'grid', 'row-gap':'10px', 'column-gap':'10px', 'grid-template-columns':'repeat(3,minmax(100px,1fr))', 'grid-template-rows':'repeat('+Math.ceil(items.length / 3)+',minmax(100px,1fr))'} ">
<div class="d-flex flex-column align-items-center justify-content-center" v-for="item in items" :key="item">
<span>{{item}}</span>
<i class="fa fa-file"></i>
<div v-if="selectedMenu" class="d-flex flex-column h-100">
<div class="d-flex mb-2">
<button v-if="selectedMenu" @click="selectedMenu=null" class="btn btn-secondary me-2"><i class="fa fa-chevron-left"></i> Back</button>
<h2>{{selectedMenu.name}}</h2>
</div>
<iframe class="h-100 w-100" :src="selectedMenu.c4_link" :title="selectedMenu.name"></iframe>
</div>
<div v-else-if="!menu">No Menu available</div>
<div v-else :style="{'display':'grid', 'row-gap':'10px', 'column-gap':'10px', 'grid-template-columns':'repeat(3,minmax(100px,1fr))', 'grid-template-rows':'repeat('+Math.ceil(menu.length / 3)+',minmax(100px,1fr))'} ">
<div :title="menuItem.name" role="button" @click="selectMenu(menuItem)" class="lvUebersichtMenuPunkt border border-1 d-flex flex-column align-items-center justify-content-center p-1 text-center" v-for="(menuItem, index) in menu" :key="index">
<img :src="menuItem.c4_icon" :alt="menuItem.name" ></img>
<span @click="selectMenu(menuItem)" class="underline_hover mt-2">{{menuItem.name}}</span>
<span v-for="([text,link],index) in menuItem.c4_linkList" @click.stop="selectMenu(menuItem,index)" :class="{'underline_hover':menuItem.c4_linkList[index][1] != '#'}" class="mt-1" :index="index">{{text}}</span>
</div>
</div>
</template>
<template #footer>
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Close</button>
</template>
</bs-modal>
`,
};
@@ -240,6 +240,12 @@ export default {
this.data.profilUpdates?.sort(this.sortProfilUpdates);
},
mounted(){
// this is a test api call to test whether the addon lvevaluierung the menu point adds if the logged in user is the lector of the lehrveranstaltung
this.$fhcApi.factory.addons.getLvMenu(750, "WS2005").then(res =>{
console.log("this is the addon endpoint res",res);
});
},
template: /*html*/ `
<div class="container-fluid text-break fhc-form" >
+1 -1
View File
@@ -8,7 +8,7 @@ export default {
DashboardWidgetPicker
},
props: [
"dashboard"
"dashboard",
],
data: () => ({
sections: [],
@@ -21,8 +21,11 @@ export default {
minimized: true,
events: null,
currentDay: new Date(),
// used for contentModal
roomInfoContentID: null,
ort_kurzbz: null,
// used for LvUbersichtModal
selectedEvent: null,
}
},
computed: {
@@ -57,11 +60,9 @@ export default {
},
showLvUebersicht: function (event){
this.selectedEvent= event;
Vue.nextTick(()=>{this.$refs.lvUebersicht.show();});
this.$refs.lvUebersicht.lehreinheit = event.lehreinheit_id;
this.$refs.lvUebersicht.lv = event.title;
this.$refs.lvUebersicht.stg = event.stg_typ + event.stg_kurzbz + (event.verband?'-' + event.verband:'' );
this.$refs.lvUebersicht.show();
},
selectDay(day) {
@@ -111,7 +112,7 @@ export default {
},
template: /*html*/`
<div class="dashboard-widget-stundenplan d-flex flex-column h-100">
<lv-uebersicht ref="lvUebersicht" />
<lv-uebersicht ref="lvUebersicht" :event="selectedEvent" />
<content-modal :contentID="roomInfoContentID" :ort_kurzbz="" dialogClass="modal-lg" ref="contentModal"/>
<fhc-calendar :initial-date="currentDay" class="border-0" class-header="p-0" @select:day="selectDay" v-model:minimized="minimized" :events="events" no-week-view :show-weeks="false" />
<div v-show="minimized" class="flex-grow-1 overflow-scroll">