mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-01 20:29:29 +00:00
Compare commits
154 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 96e0dcaf17 | |||
| bf5ab6b7dd | |||
| e229aa3639 | |||
| eb26f4a15f | |||
| 13e8a1a9f6 | |||
| 86538a163d | |||
| 3a91b12f31 | |||
| b2538075ee | |||
| 386cc779bf | |||
| 08c6d58a50 | |||
| 3f53c5feba | |||
| 2c057aad58 | |||
| b6c2f2c9c9 | |||
| c2ce831bca | |||
| 21c1f13b28 | |||
| e0079bb812 | |||
| 966d1d10f6 | |||
| 76936ad74f | |||
| 6fbb09eb6e | |||
| cfe1307018 | |||
| 5139c3e44e | |||
| 1951cd6fa8 | |||
| e3093bdf3f | |||
| b11d8d056a | |||
| 3a4015eced | |||
| aeb5d40840 | |||
| 49c712a5b6 | |||
| 46817b846a | |||
| 8c75608eaf | |||
| 2720ed9ffb | |||
| 2fc392c084 | |||
| ca630e94ae | |||
| 9cff50fa3b | |||
| 3d7a6b1ad3 | |||
| f15fd40636 | |||
| 054cf2f258 | |||
| dc067a619b | |||
| 2a762fa4ab | |||
| ccade6ae0e | |||
| 6971aed030 | |||
| 60e556b2a8 | |||
| 42fbbc5257 | |||
| d01dedb79c | |||
| 1972b461e7 | |||
| e957926a4d | |||
| bac2c13da3 | |||
| b90c26412a | |||
| 65c7ad2aac | |||
| 126a2d3b7b | |||
| 60734f708e | |||
| 9e6c15a10d | |||
| 14a8e2f001 | |||
| 7603f8f12b | |||
| a4f2502fe6 | |||
| 7c1762d467 | |||
| 96745525f1 | |||
| 8d6e04ea77 | |||
| d9e5acb52c | |||
| 6ec32b0ca3 | |||
| 4778bb82c3 | |||
| 36beb927f1 | |||
| ee41b2b68d | |||
| e20ff52f5b | |||
| df05af98d2 | |||
| 5ef1dccfc9 | |||
| 6d28b8986d | |||
| b43f1ec920 | |||
| c3d20bb181 | |||
| fc4e79c1f5 | |||
| 56a6aa993e | |||
| db75cd2f62 | |||
| c57eb1b8de | |||
| f3986688f2 | |||
| f1dbc6ab7d | |||
| d1015956d1 | |||
| 726fce9fac | |||
| f068b56083 | |||
| fa7a125727 | |||
| a94366d5a8 | |||
| 4189346cfa | |||
| 0d55998640 | |||
| 0ee8bd38cf | |||
| e27ee82692 | |||
| 5295a11326 | |||
| c1acc84b2c | |||
| fee929daa8 | |||
| b2f8427475 | |||
| 27a91de5f6 | |||
| 7ccc26c878 | |||
| 9ebc847e8e | |||
| 511b04c1f8 | |||
| ec90d35e02 | |||
| e26387a75a | |||
| ab63bf9d74 | |||
| 4f104523ff | |||
| 02153e469f | |||
| d86f8d4114 | |||
| ea17847fad | |||
| 60f128b314 | |||
| cc0a89c924 | |||
| 8f974e8902 | |||
| a91fe05395 | |||
| d9cdeb9773 | |||
| 0de033e428 | |||
| 1ab9635039 | |||
| e7fdbe13d0 | |||
| 5b3d06f1e0 | |||
| d48ac234b3 | |||
| a6167583a3 | |||
| 4ea486d320 | |||
| e6fb47b335 | |||
| 7b9c89437d | |||
| 027be3e30e | |||
| 3bdac887bf | |||
| 81bf016945 | |||
| 1167251bdc | |||
| 407f62976c | |||
| 26db68726a | |||
| 1e68eb0b90 | |||
| 332efd4106 | |||
| f303191c54 | |||
| d6c7f16ceb | |||
| f1912fe739 | |||
| d8d9521c9c | |||
| 2f7fe05d21 | |||
| ee4b61f549 | |||
| 511a4256bc | |||
| 3c9db86df2 | |||
| 367204a1ee | |||
| bbe55a75ea | |||
| e58bf3a8cf | |||
| 1f2f866c61 | |||
| 6ccbc95697 | |||
| 52d9e0a195 | |||
| 6a3982347b | |||
| 10597a73a9 | |||
| 8623a4e569 | |||
| fe7feeb74e | |||
| 7eee9df8a6 | |||
| 57af813cb4 | |||
| f4a175b93e | |||
| f2180981b4 | |||
| c5abf8c293 | |||
| d9cddd768f | |||
| a904328aaf | |||
| 74b1640a52 | |||
| f3d768bfdd | |||
| af9ff4dbc8 | |||
| 0cfaf32956 | |||
| fee0037eec | |||
| 6c99571096 | |||
| 909d7f62f2 | |||
| 658fe79ad7 | |||
| 5bbf05ac8a |
@@ -208,7 +208,14 @@ $config['navigation_header'] = array(
|
||||
'expand' => true,
|
||||
'sort' => 30,
|
||||
'requiredPermissions' => 'lehre/anrechnungszeitfenster:rw'
|
||||
)
|
||||
),
|
||||
'dashboardadmin' => array(
|
||||
'link' => site_url('dashboard/Admin'),
|
||||
'description' => 'Dashboard Admin',
|
||||
'expand' => true,
|
||||
'sort' => 40,
|
||||
'requiredPermissions' => 'dashboard/admin:r'
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
|
||||
@@ -63,6 +63,7 @@ $route['api/v1/system/[S|s]prache/(:any)'] = 'api/v1/system/sprache2/$1';
|
||||
|
||||
$route['Cis/LvPlan/.*'] = 'Cis/LvPlan/index/$1';
|
||||
$route['Cis/MyLvPlan/.*'] = 'Cis/MyLvPlan/index/$1';
|
||||
$route['Cis/Benotungstool/.*'] = 'Cis/Benotungstool/index/$1';
|
||||
$route['Cis/MyLv/.*'] = 'Cis/MyLv/index/$1';
|
||||
|
||||
$route['Abgabetool/Assistenz'] = 'Cis/Abgabetool/Assistenz';
|
||||
|
||||
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class Benotungstool extends Auth_Controller
|
||||
{
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'index' => self::PERM_LOGGED
|
||||
]);
|
||||
|
||||
$this->_ci =& get_instance();
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
/**
|
||||
* @return void
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
|
||||
|
||||
// TODO: check if related CIS config is also loaded when being routed in Cis4 by vuerouter
|
||||
// TODO: check if new benotungstool should be configurable the exact same way?
|
||||
|
||||
|
||||
$viewData = array(
|
||||
'uid'=>getAuthUID(),
|
||||
'CIS_GESAMTNOTE_UEBERSCHREIBEN' => CIS_GESAMTNOTE_UEBERSCHREIBEN,
|
||||
'CIS_GESAMTNOTE_PRUEFUNG_KOMMPRUEF' => CIS_GESAMTNOTE_PRUEFUNG_KOMMPRUEF,
|
||||
'CIS_GESAMTNOTE_PRUEFUNG_TERMIN3' => CIS_GESAMTNOTE_PRUEFUNG_TERMIN3,
|
||||
'CIS_GESAMTNOTE_PRUEFUNG_TERMIN2' => CIS_GESAMTNOTE_PRUEFUNG_TERMIN2,
|
||||
'CIS_GESAMTNOTE_PRUEFUNG_MOODLE_LE_NOTE' => CIS_GESAMTNOTE_PRUEFUNG_MOODLE_LE_NOTE,
|
||||
'CIS_GESAMTNOTE_PUNKTE' => CIS_GESAMTNOTE_PUNKTE,
|
||||
'CIS_GESAMTNOTE_GEWICHTUNG' => CIS_GESAMTNOTE_GEWICHTUNG,
|
||||
'CIS_ANWESENHEITSLISTE_NOTENLISTE_ANZEIGEN' => CIS_ANWESENHEITSLISTE_NOTENLISTE_ANZEIGEN
|
||||
);
|
||||
|
||||
$this->load->view('CisRouterView/CisRouterView.php', ['viewData' => $viewData, 'route' => 'Benotungstool']);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -511,10 +511,11 @@ class Abgabe extends FHCAPI_Controller
|
||||
return $projektarbeit->projektarbeit_id;
|
||||
};
|
||||
$projektarbeiten_ids = array_map($mapFunc, $projektarbeiten->retval);
|
||||
|
||||
$ret = $this->ProjektarbeitModel->getProjektarbeitenAbgabetermine($projektarbeiten_ids);
|
||||
$projektabgaben = $this->getDataOrTerminateWithError($ret, 'general');
|
||||
|
||||
if(count($projektarbeiten_ids) > 0) {
|
||||
$ret = $this->ProjektarbeitModel->getProjektarbeitenAbgabetermine($projektarbeiten_ids);
|
||||
$projektabgaben = $this->getDataOrTerminateWithError($ret, 'general');
|
||||
}
|
||||
|
||||
forEach($projektarbeiten->retval as $pa) {
|
||||
|
||||
@@ -846,9 +847,10 @@ class Abgabe extends FHCAPI_Controller
|
||||
private function getProjektbetreuerEmailByProjektarbeitID($projektarbeit_id) {
|
||||
$this->load->model('education/Projektarbeit_model', 'ProjektarbeitModel');
|
||||
$result = $this->ProjektarbeitModel->getProjektbetreuerEmail($projektarbeit_id);
|
||||
$email = $this->getDataOrTerminateWithError($result, 'general');
|
||||
|
||||
return $email[0]->uid ? $email[0]->uid.'@'.DOMAIN : $email[0]->private_email;
|
||||
if(count($result->retval) > 0) {
|
||||
$email = getData($result);
|
||||
return $email[0]->uid ? $email[0]->uid.'@'.DOMAIN : $email[0]->private_email;
|
||||
} else return '';
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -208,7 +208,6 @@ class Documents extends FHCAPI_Controller
|
||||
$this->load->model('system/Vorlage_model', 'VorlageModel');
|
||||
|
||||
$result = $this->VorlageModel->load($xsl);
|
||||
$this->addMeta("ress", $result);
|
||||
$vorlage = current($this->getDataOrTerminateWithError($result));
|
||||
if (!$vorlage)
|
||||
show_404();
|
||||
@@ -221,7 +220,7 @@ class Documents extends FHCAPI_Controller
|
||||
'gedruckt' => true,
|
||||
'insertamum' => date('c'),
|
||||
'insertvon' => getAuthUID(),
|
||||
'uid' => $this->input->post_get('uid') ?: '',
|
||||
'uid' => $this->input->post_get('uid') ?: null,
|
||||
'archiv' => true,
|
||||
'signiert' => !!$sign_user,
|
||||
'stud_selfservice' => $vorlage->stud_selfservice
|
||||
@@ -251,6 +250,9 @@ class Documents extends FHCAPI_Controller
|
||||
'studiensemester_kurzbz' => $ss,
|
||||
'student_uid' => $akteData['uid']
|
||||
]);
|
||||
|
||||
if (!hasData($result)) $this->terminateWithError($this->p->t("stv", "error_noLehrverbandAssigned"));
|
||||
|
||||
$res = current($this->getDataOrTerminateWithError($result));
|
||||
|
||||
$studiengang_kz = $res->studiengang_kz;
|
||||
@@ -332,6 +334,7 @@ class Documents extends FHCAPI_Controller
|
||||
if ($prestudent_id) {
|
||||
$this->load->model('crm/prestudent_model', 'PrestudentModel');
|
||||
$this->PrestudentModel->addJoin('public.tbl_studiengang', 'studiengang_kz', 'LEFT');
|
||||
$this->PrestudentModel->addSelect('tbl_prestudent.*, UPPER(typ || kurzbz) AS kuerzel');
|
||||
$result = $this->PrestudentModel->load($prestudent_id);
|
||||
$prestudent = current($this->getDataOrTerminateWithError($result));
|
||||
|
||||
|
||||
@@ -41,7 +41,9 @@ class LvPlan extends FHCAPI_Controller
|
||||
'getLehreinheitStudiensemester' => self::PERM_LOGGED,
|
||||
'studiensemesterDateInterval' => self::PERM_LOGGED,
|
||||
'getLvPlanForStudiensemester' => self::PERM_LOGGED,
|
||||
'getLv' => self::PERM_LOGGED
|
||||
'getLv' => self::PERM_LOGGED,
|
||||
'getLeEvents' => self::PERM_LOGGED,
|
||||
'getLvEvents' => self::PERM_LOGGED,
|
||||
]);
|
||||
|
||||
$this->load->library('LogLib');
|
||||
@@ -54,6 +56,12 @@ class LvPlan extends FHCAPI_Controller
|
||||
));
|
||||
|
||||
$this->load->library('form_validation');
|
||||
$this->load->library('PhrasesLib');
|
||||
$this->loadPhrases(
|
||||
array(
|
||||
'ui'
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
@@ -145,6 +153,38 @@ class LvPlan extends FHCAPI_Controller
|
||||
));
|
||||
}
|
||||
|
||||
public function getLeEvents($le_id = null, $start_date = null, $end_date = null, $stundenplan = 'stundenplandev')
|
||||
{
|
||||
|
||||
if (is_null($le_id) || is_null($start_date) || is_null($end_date))
|
||||
$this->terminateWithError($this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
if ($stundenplan !== 'stundenplandev' && $stundenplan !== 'stundenplan')
|
||||
$this->terminateWithError($this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$this->load->library('StundenplanLib');
|
||||
|
||||
$result = $this->stundenplanlib->getEventsByLE($le_id, $start_date, $end_date, $stundenplan);
|
||||
$lvplanEvents = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($lvplanEvents);
|
||||
}
|
||||
|
||||
public function getLvEvents($lv_id = null, $start_date = null, $end_date = null, $stundenplan = 'stundenplandev')
|
||||
{
|
||||
if (is_null($lv_id) || is_null($start_date) || is_null($end_date))
|
||||
$this->terminateWithError($this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
if ($stundenplan !== 'stundenplandev' && $stundenplan !== 'stundenplan')
|
||||
$this->terminateWithError($this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$this->load->library('StundenplanLib');
|
||||
|
||||
$result = $this->stundenplanlib->getEventsByLV($lv_id, $start_date, $end_date, $stundenplan);
|
||||
|
||||
$this->terminateWithSuccess(hasData($result) ? getData($result) : []);
|
||||
}
|
||||
|
||||
//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');
|
||||
|
||||
@@ -0,0 +1,929 @@
|
||||
<?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 Noten extends FHCAPI_Controller
|
||||
{
|
||||
|
||||
/**
|
||||
* Object initialization
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'getStudentenNoten' => array('lehre/benotungstool:rw'),
|
||||
'getNoten' => array('lehre/benotungstool:rw'),
|
||||
'saveStudentenNoten' => array('lehre/benotungstool:rw'),
|
||||
'getNotenvorschlagStudent' => array('lehre/benotungstool:rw'),
|
||||
'saveNotenvorschlag' => array('lehre/benotungstool:rw'),
|
||||
'saveStudentPruefung' => array('lehre/benotungstool:rw'),
|
||||
'createPruefungen' => array('lehre/benotungstool:rw'),
|
||||
'saveNotenvorschlagBulk' => array('lehre/benotungstool:rw'),
|
||||
'savePruefungenBulk' => array('lehre/benotungstool:rw')
|
||||
]);
|
||||
|
||||
$this->load->library('AuthLib', null, 'AuthLib');
|
||||
$this->load->library('PhrasesLib');
|
||||
|
||||
// Loads phrases system
|
||||
$this->loadPhrases([
|
||||
'global',
|
||||
'person',
|
||||
'benotungstool',
|
||||
'lehre',
|
||||
'ui'
|
||||
]);
|
||||
require_once(FHCPATH . 'include/mobilitaet.class.php');
|
||||
|
||||
$this->load->model('education/LePruefung_model', 'LePruefungModel');
|
||||
$this->load->model('education/Lvgesamtnote_model', 'LvgesamtnoteModel');
|
||||
$this->load->model('education/Lehrveranstaltung_model', 'LehrveranstaltungModel');
|
||||
$this->load->model('person/Person_model', 'PersonModel');
|
||||
$this->load->model('organisation/Studienplan_model', 'StudienplanModel');
|
||||
$this->load->model('crm/Student_model', 'StudentModel');
|
||||
|
||||
$this->load->helper('hlp_sancho_helper');
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* GET METHOD
|
||||
* expects 'lv_id', 'sem_kurzbz'
|
||||
* returns List of all Students of given lehrveranstaltung and semester and fetches their grades.
|
||||
* Loads LvGesamtnote aswell as Teilnoten from externalSources via getExternalGrades Event.
|
||||
* Calculates the Notenvorschlag for every student based on averaging their Teilnoten.
|
||||
* Finally also fetches all Prüfungen for every student which are linked to lva and semester.
|
||||
*/
|
||||
public function getStudentenNoten() {
|
||||
$lv_id = $this->input->get("lv_id",TRUE);
|
||||
$sem_kurzbz = $this->input->get("sem_kurzbz",TRUE);
|
||||
|
||||
if (!isset($lv_id) || isEmptyString($lv_id)
|
||||
|| !isset($sem_kurzbz) || isEmptyString($sem_kurzbz))
|
||||
$this->terminateWithError($this->p->t('global', 'wrongParameters'), 'general');
|
||||
|
||||
// get studenten for lva & sem with zeugnisnote if available
|
||||
$studenten = $this->LehrveranstaltungModel->getStudentsByLv($sem_kurzbz, $lv_id);
|
||||
$studentenData = $this->getDataOrTerminateWithError($studenten);
|
||||
|
||||
$func = function ($value) {
|
||||
return $value->uid;
|
||||
};
|
||||
|
||||
$grades = array();
|
||||
$student_uids = array_map($func, $studentenData);
|
||||
|
||||
foreach($student_uids as $uid) {
|
||||
$grades[$uid]['grades'] = [];
|
||||
|
||||
$res = $this->StudentModel->load([$uid]);
|
||||
if(!isError($res) && hasData($res)) $student = getData($res)[0];
|
||||
|
||||
$prestudent_id = $student->prestudent_id;
|
||||
|
||||
|
||||
// TODO: last class to get rid of but this one is complicated
|
||||
$mobility = new mobilitaet();
|
||||
$mobility->loadPrestudent($prestudent_id);
|
||||
$output = $mobility->result;
|
||||
$eintrag = '';
|
||||
foreach ($output as $k)
|
||||
{
|
||||
if(($k->mobilitaetstyp_kurzbz == 'GS') && ($k->studiensemester_kurzbz == $sem_kurzbz))
|
||||
$eintrag = ' (d.d.)';
|
||||
}
|
||||
$grades[$uid]['mobility'] = $eintrag;
|
||||
|
||||
$result = $this->LvgesamtnoteModel->getLvGesamtNoten($lv_id, $uid, $sem_kurzbz);
|
||||
|
||||
if(!isError($result) && hasData($result)) {
|
||||
$lvgesamtnote = getData($result)[0];
|
||||
$grades[$uid]['note_lv'] = $lvgesamtnote->note;
|
||||
$grades[$uid]['freigabedatum'] = $lvgesamtnote->freigabedatum;
|
||||
$grades[$uid]['benotungsdatum'] = $lvgesamtnote->benotungsdatum;
|
||||
$grades[$uid]['punkte_lv'] = $lvgesamtnote->punkte;
|
||||
} else {
|
||||
$grades[$uid]['note_lv'] = null;
|
||||
$grades[$uid]['freigabedatum'] = null;
|
||||
$grades[$uid]['benotungsdatum'] = null;
|
||||
$grades[$uid]['punkte_lv'] = null;
|
||||
}
|
||||
}
|
||||
|
||||
// send $grades reference to moodle addon
|
||||
Events::trigger(
|
||||
'getExternalGrades',
|
||||
function & () use (&$grades)
|
||||
{
|
||||
return $grades;
|
||||
},
|
||||
[
|
||||
'lvid' => $lv_id,
|
||||
'stsem' => $sem_kurzbz
|
||||
]
|
||||
);
|
||||
|
||||
// calculate notenvorschläge from teilnoten
|
||||
foreach($studentenData as $student) {
|
||||
$g = $grades[$student->uid]['grades'];
|
||||
$note_lv = $grades[$student->uid]['note_lv'];
|
||||
|
||||
// overwrite any calculation with lv note once available
|
||||
if(!is_null($note_lv)) {
|
||||
$student->note_vorschlag = $note_lv;
|
||||
} else if(count($g) > 0) {
|
||||
|
||||
$notensumme = 0;
|
||||
$notensumme_gewichtet = 0;
|
||||
$gewichtsumme = 0;
|
||||
$punktesumme = 0;
|
||||
$punktesumme_gewichtet = 0;
|
||||
$anzahlnoten = 0;
|
||||
foreach($g as $teilnote) {
|
||||
if (is_numeric($teilnote['grade']) || (is_null($teilnote['grade']) && is_numeric($teilnote['points'])))
|
||||
{
|
||||
$notensumme += $teilnote['grade'];
|
||||
$punktesumme += $teilnote['points'];
|
||||
$notensumme_gewichtet += $teilnote['grade'] * $teilnote['weight'];
|
||||
$punktesumme_gewichtet += $teilnote['points'] * $teilnote['weight'];
|
||||
$gewichtsumme += $teilnote['weight'];
|
||||
$anzahlnoten += 1;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// TODO: develop the punkte feature with models
|
||||
// calculate grades points from notenschlüssel
|
||||
if (CIS_GESAMTNOTE_PUNKTE)
|
||||
{
|
||||
if (defined('CIS_GESAMTNOTE_GEWICHTUNG') && CIS_GESAMTNOTE_GEWICHTUNG)
|
||||
{
|
||||
// Lehreinheitsgewichtung
|
||||
$punkte_vorschlag = round($punktesumme_gewichtet / $gewichtsumme, 2);
|
||||
$notenschluessel = new notenschluessel();
|
||||
$note_vorschlag = $notenschluessel->getNote($punkte_vorschlag, $lv_id, $sem_kurzbz);
|
||||
}
|
||||
else
|
||||
{
|
||||
$punkte_vorschlag = round($punktesumme / $anzahlnoten, 2);
|
||||
$notenschluessel = new notenschluessel();
|
||||
$note_vorschlag = $notenschluessel->getNote($punkte_vorschlag, $lv_id, $sem_kurzbz);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (defined('CIS_GESAMTNOTE_GEWICHTUNG') && CIS_GESAMTNOTE_GEWICHTUNG)
|
||||
{
|
||||
$note_vorschlag = round($notensumme_gewichtet / $gewichtsumme);
|
||||
}
|
||||
else
|
||||
{
|
||||
$note_vorschlag = round($notensumme / $anzahlnoten);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
$student->note_vorschlag = $note_vorschlag;
|
||||
}
|
||||
}
|
||||
|
||||
// get all prüfungen with noten held in that semester in that lva
|
||||
$pruefungen = $this->LePruefungModel->getPruefungenByLvStudiensemester($lv_id, $sem_kurzbz);
|
||||
$pruefungenData = getData($pruefungen);
|
||||
|
||||
$this->terminateWithSuccess(array($studentenData, $pruefungenData, DOMAIN, $grades));
|
||||
}
|
||||
|
||||
/**
|
||||
* GET METHOD
|
||||
* returns List of all available & active NotenOptions
|
||||
*/
|
||||
public function getNoten() {
|
||||
$this->load->model('education/Note_model', 'NoteModel');
|
||||
|
||||
$result = $this->NoteModel->getAllActive();
|
||||
$noten = $this->getDataOrTerminateWithError($result);
|
||||
$this->terminateWithSuccess($noten);
|
||||
}
|
||||
|
||||
/**
|
||||
* POST METHOD
|
||||
* expects 'lv_id', 'sem_kurzbz', 'password', 'noten'
|
||||
* Notenfreigabe method which checks the users password as a security measure.
|
||||
* Tries to load Lehrveranstaltung, Studiengang and Person via Model in order to validate the coherency of input parameters
|
||||
* lv_id & sem_kurzbz in relation to the noten array delivered.
|
||||
* Updates the LvGesamtnote note, aswell as freigabedatum, which is key in the logic of the freigegeben/offen/changed notenStatus
|
||||
* Along this process builds a html table to be placed in a confirmation email (uid only and full variant depending on config)
|
||||
* which is being sent to the Lektor, aswell as the assigned Assistenz.
|
||||
*/
|
||||
public function saveStudentenNoten() {
|
||||
$result = $this->getPostJSON();
|
||||
|
||||
if(!property_exists($result, 'sem_kurzbz') || !property_exists($result, 'lv_id') ||
|
||||
!property_exists($result, 'password') || !property_exists($result, 'noten')) {
|
||||
$this->terminateWithError($this->p->t('global', 'missingParameters'), 'general');
|
||||
}
|
||||
|
||||
if(!$this->AuthLib->checkUserAuthByUsernamePassword(getAuthUID(), $result->password)->retval) {
|
||||
$this->terminateWithError($this->p->t('global', 'wrongPassword'), 'general');
|
||||
}
|
||||
|
||||
$lv_id = $result->lv_id;
|
||||
$sem_kurzbz = $result->sem_kurzbz;
|
||||
|
||||
$ret = [];
|
||||
|
||||
$res = $this->LehrveranstaltungModel->load($lv_id);
|
||||
if(isError($res) || !hasData($res)) {
|
||||
$this->terminateWithError($this->p->t('benotungstool', 'noValidLvFoundForId', [$lv_id]));
|
||||
}
|
||||
|
||||
$lv = getData($res)[0];
|
||||
|
||||
$studiengang_kz = $lv->studiengang_kz;
|
||||
$res = $this->StudiengangModel->load($studiengang_kz);
|
||||
if(isError($res) || !hasData($res)) {
|
||||
$this->terminateWithError($this->p->t('benotungstool', 'noValidStudiengangFoundForId', [$studiengang_kz]));
|
||||
}
|
||||
$sg = getData($res)[0];
|
||||
$lvaFullName = $sg->kurzbzlang . ' ' . $lv->semester . '.Semester
|
||||
' . $lv->bezeichnung . " - " .$lv->lehrform_kurzbz. " " . $lv->orgform_kurzbz . " - " . $sem_kurzbz;
|
||||
|
||||
$emails = explode(', ', $sg->email);
|
||||
|
||||
|
||||
$res = $this->PersonModel->load(getAuthPersonId());
|
||||
if(isError($res) || !hasData($res)) {
|
||||
$this->terminateWithError($this->p->t('benotungstool', 'noValidPersonFoundForId', [getAuthPersonId()]));
|
||||
}
|
||||
$pers = getData($res)[0];
|
||||
$lektorFullName = $pers->anrede.' '.$pers->vorname.' '.$pers->nachname; //.' ('.$pers->kurzbz.')';
|
||||
|
||||
|
||||
$res = $this->StudienplanModel->getStudienplanByLvaSemKurzbz($lv_id, $sem_kurzbz);
|
||||
$data = getData($res);
|
||||
$studienplan_bezeichnung = '';
|
||||
foreach ($data as $row) {
|
||||
$studienplan_bezeichnung .= $row->bezeichnung . ' ';
|
||||
}
|
||||
$betreff = $this->p->t('benotungstool','notenfreigabe').' ' . $lv->bezeichnung . ' ' . $lv->orgform_kurzbz . ' - ' . $studienplan_bezeichnung;
|
||||
|
||||
$studlist = "<table border='1'><tr>";
|
||||
|
||||
if (defined('CIS_GESAMTNOTE_FREIGABEMAIL_NOTE') && CIS_GESAMTNOTE_FREIGABEMAIL_NOTE) {
|
||||
$studlist .= "<td><b>" . $this->p->t('person','personenkennzeichen') . "</b></td>\n
|
||||
<td><b>" . $this->p->t('lehre','studiengang') . "</b></td>\n
|
||||
<td><b>" . $this->p->t('benotungstool','c4nachname') . "</b></td>\n
|
||||
<td><b>" . $this->p->t('benotungstool','c4vorname') . "</b></td>\n";
|
||||
$studlist .= "<td><b>" . $this->p->t('benotungstool','c4grade') . "</b></td>\n";
|
||||
$studlist .= "<td><b>" . $this->p->t('ui','bearbeitetVon') . "</b></td></tr>\n";
|
||||
} else {
|
||||
$studlist .= "<td><b>" . $this->p->t('person','uid') . "</b></td></tr>\n";
|
||||
}
|
||||
|
||||
foreach($result->noten as $note) {
|
||||
|
||||
$resultLVGes = $this->LvgesamtnoteModel->getLvGesamtNoten($lv_id, $note->uid, $sem_kurzbz);
|
||||
|
||||
if (!isError($resultLVGes) && hasData($resultLVGes))
|
||||
{
|
||||
$lvgesamtnote = getData($resultLVGes)[0];
|
||||
|
||||
if ($lvgesamtnote->benotungsdatum > $lvgesamtnote->freigabedatum)
|
||||
{
|
||||
|
||||
$id = $this->LvgesamtnoteModel->update(
|
||||
[$lvgesamtnote->student_uid, $lvgesamtnote->studiensemester_kurzbz, $lvgesamtnote->lehrveranstaltung_id],
|
||||
array(
|
||||
'note' => $note->note,
|
||||
'freigabevon_uid' => getAuthUID(),
|
||||
'freigabedatum' => date("Y-m-d H:i:s"),
|
||||
'updateamum' => date("Y-m-d H:i:s"),
|
||||
'updatevon' => getAuthUID()
|
||||
)
|
||||
);
|
||||
|
||||
if($id) {
|
||||
$res = $this->LvgesamtnoteModel->load($id->retval);
|
||||
if(hasData($res)) {
|
||||
$lvgesamtnote = getData($res)[0];
|
||||
$ret[] = array('uid' => $note->uid, 'freigabedatum' => $lvgesamtnote->freigabedatum, 'benotungsdatum' => $lvgesamtnote->benotungsdatum);
|
||||
}
|
||||
}
|
||||
|
||||
if (defined('CIS_GESAMTNOTE_FREIGABEMAIL_NOTE') && CIS_GESAMTNOTE_FREIGABEMAIL_NOTE)
|
||||
{
|
||||
$studlist .= "<tr><td>" . trim($note->matrikelnr) . "</td>";
|
||||
$studlist .= "<td>" . trim($note->kuerzel) . "</td>";
|
||||
$studlist .= "<td>" . trim($note->nachname) . "</td>";
|
||||
$studlist .= "<td>" . trim($note->vorname) . "</td>";
|
||||
|
||||
// TODO: if defined(CIS_PUNKTE) ...
|
||||
$studlist .= "<td>" .$note->noteBezeichnung. "</td>";
|
||||
|
||||
$studlist .= "<td>" . $lvgesamtnote->mitarbeiter_uid;
|
||||
if ($lvgesamtnote->updatevon != '')
|
||||
$studlist .= " (" . $lvgesamtnote->updatevon . ")";
|
||||
$studlist .= "</td></tr>";
|
||||
} else {
|
||||
$studlist .= "<tr><td>" . trim($note->uid) . "</td></tr>\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$studlist .= "</table>";
|
||||
|
||||
// always send the mail, config toggles data contents
|
||||
$this->sendEmail($lektorFullName, $lvaFullName, count($result->noten), $emails, $studlist, $betreff);
|
||||
|
||||
$this->terminateWithSuccess($ret);
|
||||
}
|
||||
|
||||
|
||||
private function sendEmail($lektorFullName, $lvaFullName, $notenCount, $emailAdressen, $studlist, $betreff)
|
||||
{
|
||||
$emailAdressen[] = getAuthUID() . "@" . DOMAIN; // also send mail to lektors own adress
|
||||
$adressen = implode(";", $emailAdressen);
|
||||
|
||||
foreach ($emailAdressen as $email)
|
||||
{
|
||||
// Prepare mail content
|
||||
$body_fields = array(
|
||||
'lektor' => $lektorFullName,
|
||||
'lvaname' => $lvaFullName,
|
||||
'studlist' => $studlist,
|
||||
'neuenotencount' => $notenCount,
|
||||
'adressen' => $adressen
|
||||
);
|
||||
|
||||
// Send mail
|
||||
sendSanchoMail(
|
||||
'Notenfreigabe',
|
||||
$body_fields,
|
||||
$email,
|
||||
$betreff
|
||||
);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* GET METHOD
|
||||
* should return Notenvorschlag for single Students, not yet implemented since it is not needed anywhere right now,
|
||||
* but could be useful later on.
|
||||
*/
|
||||
public function getNotenvorschlagStudent() {
|
||||
// TODO: Notenvorschlag laden allgemeiner Endpunkt, der im Backend mit Logik (z.B. Moodle) angepasst werden kann.
|
||||
|
||||
$this->terminateWithSuccess();
|
||||
}
|
||||
|
||||
/**
|
||||
* POST METHOD
|
||||
* expects 'datum', 'lva_id', 'student_uid', 'note'
|
||||
* Inserts or updates a pruefung for lva & student_uid at given datum (YYYY-MM-DD). When creating a new
|
||||
* Pruefung, sets the provided (Prüfungs-) Note.
|
||||
* Updates the LvGesamtnote of student.
|
||||
* Can return 1 or 2 Prüfungen, since the original grade before the first prüfung is being saved as "Termin1" when
|
||||
* a "Termin2" is being created.
|
||||
*/
|
||||
public function saveStudentPruefung() { // einzelne pruefung speichern
|
||||
$result = $this->getPostJSON();
|
||||
|
||||
if(!property_exists($result, 'datum') || !property_exists($result, 'lva_id') ||
|
||||
!property_exists($result, 'student_uid') || !property_exists($result, 'note')) {
|
||||
$this->terminateWithError($this->p->t('global', 'missingParameters'), 'general');
|
||||
}
|
||||
|
||||
$student_uid = $result->student_uid;
|
||||
$note = $result->note;
|
||||
$punkte = null;
|
||||
$datum = $result->datum;
|
||||
$lva_id = $result->lva_id;
|
||||
$lehreinheit_id = $result->lehreinheit_id;
|
||||
|
||||
$stsem = $result->sem_kurzbz;
|
||||
$typ = $result->typ;
|
||||
|
||||
$jetzt = date("Y-m-d H:i:s");
|
||||
|
||||
// nachpruefungeintragen.php script calls query on campus.student_lehrveranstaltung to find a
|
||||
// lehreinheit_id for lva_id -> lehreinheit should be determined prior to that in new benotungstool
|
||||
// by retrieving it from students row in campus.vw_student_lehrveranstaltung earlier on
|
||||
|
||||
// $lehreinheit_id = getLehreinheit($db, $lvid, $student_uid, $stsem);
|
||||
// $lehreinheit_id = $result->lehreinheit_id;
|
||||
|
||||
$punkte = null;
|
||||
|
||||
// if($punkte!='')
|
||||
// {
|
||||
// // Bei Punkteeingabe wird die Note nochmals geprueft und ggf korrigiert
|
||||
// $notenschluessel = new notenschluessel();
|
||||
// $note_pruef = $notenschluessel->getNote($punkte, $lva_id, $stsem);
|
||||
// if($note_pruef!=$note)
|
||||
// {
|
||||
// $note = $note_pruef;
|
||||
// $note_dirty=true;
|
||||
// }
|
||||
// }
|
||||
|
||||
// TODO: more sophisticated empty check
|
||||
if($note=='')
|
||||
$note = 9;
|
||||
|
||||
|
||||
$this->load->model('education/Lehrveranstaltung_model', 'LehrveranstaltungModel');
|
||||
$this->load->model('organisation/Studiengang_model', 'StudiengangModel');
|
||||
|
||||
$res = $this->LehrveranstaltungModel->load($lva_id);
|
||||
if(isError($res) || !hasData($res)) {
|
||||
$this->terminateWithError('Keine gültige Lehrveranstaltung gefunden für ID: '.$lva_id);
|
||||
}
|
||||
|
||||
$studiengang_kz = getData($res)[0]->studiengang_kz;
|
||||
$res = $this->StudiengangModel->load($studiengang_kz);
|
||||
if(isError($res) || !hasData($res)) {
|
||||
$this->terminateWithError('Kein gültiger Studiengang gefunden für ID: '.$studiengang_kz);
|
||||
}
|
||||
|
||||
$pruefungenChanged = $this->savePruefungstermin($typ, $student_uid, $lva_id, $stsem, $lehreinheit_id, $note, $punkte, $datum);
|
||||
|
||||
//Gesamtnote updaten
|
||||
$result = $this->LvgesamtnoteModel->getLvGesamtNoten($lva_id, $student_uid, $stsem);
|
||||
if(!isError($result) && !hasData($result)) {
|
||||
|
||||
$id = $this->LvgesamtnoteModel->insert(
|
||||
array(
|
||||
'student_uid' => $student_uid,
|
||||
'lehrveranstaltung_id' => $lva_id,
|
||||
'studiensemester_kurzbz' => $stsem,
|
||||
'note' => $note,
|
||||
'punkte' => $punkte,
|
||||
'mitarbeiter_uid' => getAuthUID(),
|
||||
'benotungsdatum' => $jetzt,
|
||||
'freigabedatum' => null,
|
||||
'freigabevon_uid' => null,
|
||||
'bemerkung' => null,
|
||||
'updateamum' => null,
|
||||
'updatevon' => null,
|
||||
'insertamum' => $jetzt,
|
||||
'insertvon' => getAuthUID()
|
||||
)
|
||||
);
|
||||
if($id) {
|
||||
$res = $this->LvgesamtnoteModel->load($id->retval);
|
||||
if(hasData($res)) $lvgesamtnote = getData($res)[0];
|
||||
}
|
||||
}
|
||||
else if(!isError($result) && hasData($result))
|
||||
{
|
||||
$lvgesamtnote = getData($result)[0];
|
||||
|
||||
$id = $this->LvgesamtnoteModel->update(
|
||||
[$lvgesamtnote->student_uid, $lvgesamtnote->studiensemester_kurzbz, $lvgesamtnote->lehrveranstaltung_id],
|
||||
array(
|
||||
'note' => $note,
|
||||
'punkte' => $punkte,
|
||||
'benotungsdatum' => $jetzt,
|
||||
'updateamum' => $jetzt,
|
||||
'updatevon' => getAuthUID()
|
||||
)
|
||||
);
|
||||
|
||||
if($id) {
|
||||
$res = $this->LvgesamtnoteModel->load($id->retval);
|
||||
if(hasData($res)) $lvgesamtnote = getData($res)[0];
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
$savedPruefung = $pruefungenChanged['savedPruefung'] ?? null;
|
||||
$extraPruefung = $pruefungenChanged['extraPruefung'] ?? null;
|
||||
|
||||
$savedPruefungData = count($savedPruefung) > 0 ? $savedPruefung[0] : null;
|
||||
$extraPruefungData = count($extraPruefung) > 0 ? $extraPruefung[0] : null;
|
||||
|
||||
$this->terminateWithSuccess(array($savedPruefungData, $lvgesamtnote, $extraPruefungData));
|
||||
}
|
||||
|
||||
/**
|
||||
* private helper method to update/insert pruefungstermine
|
||||
*/
|
||||
private function savePruefungstermin($typ, $student_uid, $lva_id, $stsem, $lehreinheit_id, $note, $punkte, $datum)
|
||||
{
|
||||
|
||||
$status = [];
|
||||
|
||||
// send $grades reference to moodle addon
|
||||
Events::trigger(
|
||||
'getEntschuldigungsStatusForStudentOnDate',
|
||||
function & () use (&$status)
|
||||
{
|
||||
return $status;
|
||||
},
|
||||
[
|
||||
'student_uid' => $student_uid,
|
||||
'datum' => $datum
|
||||
]
|
||||
);
|
||||
|
||||
if(count($status) > 0 && $status[0] == true) {
|
||||
$note = 17; //entschuldigt
|
||||
}
|
||||
|
||||
$jetzt = date("Y-m-d H:i:s");
|
||||
|
||||
$pruefungenChanged = [];
|
||||
|
||||
$this->load->model('education/Lvgesamtnote_model', 'LvgesamtnoteModel');
|
||||
|
||||
if($typ == "Termin2" && defined('CIS_GESAMTNOTE_PRUEFUNG_TERMIN2') && CIS_GESAMTNOTE_PRUEFUNG_TERMIN2)
|
||||
{
|
||||
|
||||
// Wenn eine Nachprüfung angelegt wird, wird zuerst eine Pruefung mit 1. Termin angelegt welche für die ursprüngliche Note
|
||||
// vor den Prüfungsantritten zählt
|
||||
|
||||
$result1 = $this->LePruefungModel->getPruefungenByUidTypLvStudiensemester($student_uid, "Termin1", $lva_id, $stsem);
|
||||
|
||||
// if there is a termin 1 entry already do nothing
|
||||
if(!isError($result1) && hasData($result1)) {
|
||||
|
||||
} else if(!isError($result1) && !hasData($result1)) {
|
||||
// new entry termin1
|
||||
|
||||
$resultLV = $this->LvgesamtnoteModel->getLvGesamtNoten($lva_id, $student_uid, $stsem);
|
||||
|
||||
// update Termin1 note
|
||||
if (hasData($resultLV))
|
||||
{
|
||||
$lvgesamtnote = getData($resultLV)[0];
|
||||
$pr_note = $lvgesamtnote->note;
|
||||
$pr_punkte = $lvgesamtnote->punkte;
|
||||
$benotungsdatum = $lvgesamtnote->benotungsdatum;
|
||||
}
|
||||
else if(!hasData($resultLV))// set Termin1 note to "noch nicht eingetragen"
|
||||
{
|
||||
$pr_note = 9;
|
||||
$pr_punkte = null;
|
||||
$benotungsdatum = $jetzt;
|
||||
}
|
||||
|
||||
$id = $this->LePruefungModel->insert(
|
||||
array(
|
||||
'lehreinheit_id' => $lehreinheit_id,
|
||||
'student_uid' => $student_uid,
|
||||
'mitarbeiter_uid' => getAuthUID(),
|
||||
'note' => $pr_note,
|
||||
// 'punkte' => $pr_punkte,
|
||||
'pruefungstyp_kurzbz' => "Termin1",
|
||||
'datum' => $benotungsdatum,
|
||||
'anmerkung' => "",
|
||||
'insertamum' => $jetzt,
|
||||
'insertvon' => getAuthUID(),
|
||||
'updateamum' => null,
|
||||
'updatevon' => null,
|
||||
'ext_id' => null
|
||||
)
|
||||
);
|
||||
if($id) {
|
||||
$res = $this->LePruefungModel->load($id->retval);
|
||||
if(hasData($res)) $pruefungenChanged['extraPruefung'] = getData($res);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Die Pruefung wird als Termin2 eingetragen
|
||||
$result2 = $this->LePruefungModel->getPruefungenByUidTypLvStudiensemester($student_uid, "Termin2", $lva_id, $stsem);
|
||||
// if there is a termin 2 entry already update it
|
||||
if(!isError($result2) && hasData($result2)) {
|
||||
// update
|
||||
$termin2 = getData($result2)[0];
|
||||
$id = $this->LePruefungModel->update(
|
||||
$termin2->pruefung_id,
|
||||
array(
|
||||
'updateamum' => $jetzt,
|
||||
'updatevon' => getAuthUID(),
|
||||
'note' => $note,
|
||||
// 'punkte' => $punkte,
|
||||
'datum' => $datum,
|
||||
'anmerkung' => ""
|
||||
)
|
||||
);
|
||||
if($id) {
|
||||
$res = $this->LePruefungModel->load($id->retval);
|
||||
if(hasData($res)) $pruefungenChanged['savedPruefung'] = getData($res);
|
||||
}
|
||||
|
||||
} else if(!isError($result2) && !hasData($result2)) {
|
||||
// new entry termin 2
|
||||
|
||||
$id = $this->LePruefungModel->insert(
|
||||
array(
|
||||
'lehreinheit_id' => $lehreinheit_id,
|
||||
'student_uid' => $student_uid,
|
||||
'mitarbeiter_uid' => getAuthUID(),
|
||||
'note' => $note,
|
||||
// 'punkte' => null,//$punkte,
|
||||
'pruefungstyp_kurzbz' => $typ,
|
||||
'datum' => $datum,
|
||||
'anmerkung' => "",
|
||||
'insertamum' => $jetzt,
|
||||
'insertvon' => getAuthUID(),
|
||||
'updateamum' => null,
|
||||
'updatevon' => null,
|
||||
'ext_id' => null
|
||||
)
|
||||
);
|
||||
if($id) {
|
||||
$res = $this->LePruefungModel->load($id->retval);
|
||||
if(hasData($res)) $pruefungenChanged['savedPruefung'] = getData($res);
|
||||
}
|
||||
}
|
||||
|
||||
} else if($typ == "Termin3" && defined('CIS_GESAMTNOTE_PRUEFUNG_TERMIN3') && CIS_GESAMTNOTE_PRUEFUNG_TERMIN3)
|
||||
{
|
||||
|
||||
$result3 = $this->LePruefungModel->getPruefungenByUidTypLvStudiensemester($student_uid, "Termin3", $lva_id, $stsem);
|
||||
|
||||
if(!isError($result3) && hasData($result3)) {
|
||||
// update
|
||||
$termin3 = getData($result3)[0];
|
||||
|
||||
$id = $this->LePruefungModel->update(
|
||||
$termin3->pruefung_id,
|
||||
array(
|
||||
'updateamum' => $jetzt,
|
||||
'updatevon' => getAuthUID(),
|
||||
'note' => $note,
|
||||
// 'punkte' => $punkte,
|
||||
'datum' => $datum,
|
||||
'anmerkung' => ""
|
||||
)
|
||||
);
|
||||
if($id) {
|
||||
$res = $this->LePruefungModel->load($id->retval);
|
||||
if(hasData($res)) $pruefungenChanged['savedPruefung'] = getData($res);
|
||||
}
|
||||
|
||||
} else if(!isError($result3) && !hasData($result3)) {
|
||||
// insert new termin3
|
||||
|
||||
$id = $this->LePruefungModel->insert(
|
||||
array(
|
||||
'lehreinheit_id' => $lehreinheit_id,
|
||||
'student_uid' => $student_uid,
|
||||
'mitarbeiter_uid' => getAuthUID(),
|
||||
'note' => $note,
|
||||
// 'punkte' => null,//$punkte,
|
||||
'pruefungstyp_kurzbz' => $typ,
|
||||
'datum' => $datum,
|
||||
'anmerkung' => "",
|
||||
'insertamum' => $jetzt,
|
||||
'insertvon' => getAuthUID(),
|
||||
'updateamum' => null,
|
||||
'updatevon' => null,
|
||||
'ext_id' => null
|
||||
)
|
||||
);
|
||||
if($id) {
|
||||
$res = $this->LePruefungModel->load($id->retval);
|
||||
if(hasData($res)) $pruefungenChanged['savedPruefung'] = getData($res);
|
||||
}
|
||||
|
||||
}
|
||||
} else {
|
||||
$this->terminateWithError($this->p->t('benotungstool', 'wrongPruefungType', [$student_uid, $typ]), 'general');
|
||||
}
|
||||
|
||||
return $pruefungenChanged;
|
||||
}
|
||||
|
||||
/**
|
||||
* POST METHOD
|
||||
* expects 'sem_kurzbz', 'lv_id', 'student_uid', 'note'
|
||||
* Method that sets lv_note of student in lva and semester from provided Points/Grade Selection.
|
||||
* Updates the note & benotungsdatum, which is key in the noten state offen/freigegeben/changed
|
||||
*/
|
||||
public function saveNotenvorschlag() {
|
||||
$result = $this->getPostJSON();
|
||||
|
||||
if(!property_exists($result, 'lv_id') || !property_exists($result, 'sem_kurzbz') ||
|
||||
!property_exists($result, 'student_uid') || !property_exists($result, 'note')) {
|
||||
$this->terminateWithError($this->p->t('global', 'missingParameters'), 'general');
|
||||
}
|
||||
|
||||
$lv_id = $result->lv_id;
|
||||
$student_uid = $result->student_uid;
|
||||
$sem_kurzbz = $result->sem_kurzbz;
|
||||
$note = $result->note;
|
||||
|
||||
$result = $this->LvgesamtnoteModel->getLvGesamtNoten($lv_id, $student_uid, $sem_kurzbz);
|
||||
|
||||
if(!isError($result) && hasData($result)) {
|
||||
$lvgesamtnote = getData($result)[0];
|
||||
|
||||
$id = $this->LvgesamtnoteModel->update(
|
||||
[$lvgesamtnote->student_uid, $lvgesamtnote->studiensemester_kurzbz, $lvgesamtnote->lehrveranstaltung_id],
|
||||
array(
|
||||
'note' => $note,
|
||||
'punkte' => null,
|
||||
'benotungsdatum' => date("Y-m-d H:i:s"),
|
||||
'updateamum' => date("Y-m-d H:i:s"),
|
||||
'updatevon' => getAuthUID()
|
||||
)
|
||||
);
|
||||
|
||||
if($id) {
|
||||
$res = $this->LvgesamtnoteModel->load($id->retval);
|
||||
if(hasData($res)) $lvgesamtnote = getData($res)[0];
|
||||
}
|
||||
} else if(!isError($result) && !hasData($result)) {
|
||||
$id = $this->LvgesamtnoteModel->insert(
|
||||
array(
|
||||
'student_uid' => $student_uid,
|
||||
'lehrveranstaltung_id' => $lv_id,
|
||||
'studiensemester_kurzbz' => $sem_kurzbz,
|
||||
'note' => $note,
|
||||
'punkte' => null,
|
||||
'mitarbeiter_uid' => getAuthUID(),
|
||||
'benotungsdatum' => date("Y-m-d H:i:s"),
|
||||
'freigabedatum' => null,
|
||||
'freigabevon_uid' => null,
|
||||
'bemerkung' => null,
|
||||
'updateamum' => null,
|
||||
'updatevon' => null,
|
||||
'insertamum' => date("Y-m-d H:i:s"),
|
||||
'insertvon' => getAuthUID()
|
||||
)
|
||||
);
|
||||
if($id) {
|
||||
$res = $this->LvgesamtnoteModel->load($id->retval);
|
||||
if(hasData($res)) $lvgesamtnote = getData($res)[0];
|
||||
}
|
||||
}
|
||||
|
||||
$this->terminateWithSuccess(array($lvgesamtnote));
|
||||
}
|
||||
|
||||
/**
|
||||
* POST METHOD
|
||||
* expects 'sem_kurzbz', 'lv_id', 'noten'
|
||||
* Bulk variant of saveNotenvorschlag, used when importing grades from csv.
|
||||
*/
|
||||
public function saveNotenvorschlagBulk() {
|
||||
$result = $this->getPostJSON();
|
||||
|
||||
if(!property_exists($result, 'lv_id') || !property_exists($result, 'sem_kurzbz') ||
|
||||
!property_exists($result, 'noten')) {
|
||||
$this->terminateWithError($this->p->t('global', 'missingParameters'), 'general');
|
||||
}
|
||||
|
||||
$lv_id = $result->lv_id;
|
||||
$sem_kurzbz = $result->sem_kurzbz;
|
||||
$noten = $result->noten;
|
||||
|
||||
$retLvNoten = [];
|
||||
|
||||
foreach($noten as $note)
|
||||
{
|
||||
|
||||
$result = $this->LvgesamtnoteModel->getLvGesamtNoten($lv_id, $note->uid, $sem_kurzbz);
|
||||
|
||||
if(!isError($result) && hasData($result)) {
|
||||
$lvgesamtnote = getData($result)[0];
|
||||
|
||||
$id = $this->LvgesamtnoteModel->update(
|
||||
[$lvgesamtnote->student_uid, $lvgesamtnote->studiensemester_kurzbz, $lvgesamtnote->lehrveranstaltung_id],
|
||||
array(
|
||||
'note' => trim($note->note),
|
||||
'punkte' => null,
|
||||
'benotungsdatum' => date("Y-m-d H:i:s"),
|
||||
'updateamum' => date("Y-m-d H:i:s"),
|
||||
'updatevon' => getAuthUID()
|
||||
)
|
||||
);
|
||||
|
||||
if($id) {
|
||||
$res = $this->LvgesamtnoteModel->load($id->retval);
|
||||
if(hasData($res)) $lvgesamtnote = getData($res)[0];
|
||||
}
|
||||
} else if(!isError($result) && !hasData($result)) {
|
||||
$id = $this->LvgesamtnoteModel->insert(
|
||||
array(
|
||||
'student_uid' => $note->uid,
|
||||
'lehrveranstaltung_id' => $lv_id,
|
||||
'studiensemester_kurzbz' => $sem_kurzbz,
|
||||
'note' => trim($note->note),
|
||||
'punkte' => null,
|
||||
'mitarbeiter_uid' => getAuthUID(),
|
||||
'benotungsdatum' => date("Y-m-d H:i:s"),
|
||||
'freigabedatum' => null,
|
||||
'freigabevon_uid' => null,
|
||||
'bemerkung' => null,
|
||||
'updateamum' => null,
|
||||
'updatevon' => null,
|
||||
'insertamum' => date("Y-m-d H:i:s"),
|
||||
'insertvon' => getAuthUID()
|
||||
)
|
||||
);
|
||||
if($id) {
|
||||
$res = $this->LvgesamtnoteModel->load($id->retval);
|
||||
if(hasData($res)) $lvgesamtnote = getData($res)[0];
|
||||
}
|
||||
}
|
||||
|
||||
$retLvNoten[] = $lvgesamtnote;
|
||||
}
|
||||
|
||||
$this->terminateWithSuccess($retLvNoten);
|
||||
}
|
||||
|
||||
/**
|
||||
* POST METHOD
|
||||
* expects 'uids', 'datum'
|
||||
* Bulk variant of saveStudentPruefung, used when creating a new Prüfung for several students. Always sets note to
|
||||
* "noch nicht eingetragen" for the created Prüfung.
|
||||
*/
|
||||
public function createPruefungen() {
|
||||
$result = $this->getPostJSON();
|
||||
|
||||
if(!property_exists($result, 'uids') || !property_exists($result, 'datum')) {
|
||||
$this->terminateWithError($this->p->t('global', 'missingParameters'), 'general');
|
||||
}
|
||||
|
||||
$uids = $result->uids;
|
||||
$datum = $result->datum;
|
||||
$lva_id = $result->lva_id;
|
||||
|
||||
$stsem = $result->sem_kurzbz;
|
||||
|
||||
$ret = [];
|
||||
|
||||
foreach ($uids as $student) {
|
||||
$student_uid = $student->uid;
|
||||
$typ = $student->typ;
|
||||
$note = 9; //$result->note; // TODO: parameterize for import maybe
|
||||
$punkte = ''; // TODO: check punkte feature
|
||||
|
||||
$lehreinheit_id = $student->lehreinheit_id;
|
||||
$ret[$student->uid] = $this->savePruefungstermin($typ, $student_uid, $lva_id, $stsem, $lehreinheit_id, $note, $punkte, $datum);
|
||||
}
|
||||
|
||||
$this->terminateWithSuccess($ret);
|
||||
}
|
||||
|
||||
/**
|
||||
* POST METHOD
|
||||
* expects 'lv_id', 'sem_kurzbz', 'pruefungen'
|
||||
* Bulk variant of saveStudentPruefung, used when importing pruefungsdata from csv with available noten.
|
||||
*/
|
||||
public function savePruefungenBulk() {
|
||||
$result = $this->getPostJSON();
|
||||
|
||||
if(!property_exists($result, 'lv_id') || !property_exists($result, 'sem_kurzbz') ||
|
||||
!property_exists($result, 'pruefungen')) {
|
||||
$this->terminateWithError($this->p->t('global', 'missingParameters'), 'general');
|
||||
}
|
||||
|
||||
$lv_id = $result->lv_id;
|
||||
$sem_kurzbz = $result->sem_kurzbz;
|
||||
$pruefungen = $result->pruefungen;
|
||||
|
||||
$ret = [];
|
||||
|
||||
foreach ($pruefungen as $pruefung) {
|
||||
$student_uid = $pruefung->uid;
|
||||
$typ = $pruefung->typ;
|
||||
$note = $pruefung->note; // TODO: parameterize for import maybe
|
||||
$datum = $pruefung->datum;
|
||||
$punkte = ''; // TODO: check punkte feature
|
||||
|
||||
$lehreinheit_id = $pruefung->lehreinheit_id;
|
||||
$ret[$student_uid] = $this->savePruefungstermin($typ, $student_uid, $lv_id, $sem_kurzbz, $lehreinheit_id, $note, $punkte, $datum);
|
||||
}
|
||||
|
||||
$this->terminateWithSuccess($ret);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2024 fhcomplete.org
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
class Studiensemester extends FHCAPI_Controller
|
||||
{
|
||||
|
||||
private $_ci;
|
||||
|
||||
/**
|
||||
* Object initialization
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'getStudiensemester'=> self::PERM_LOGGED,
|
||||
|
||||
]);
|
||||
|
||||
$this->_ci =& get_instance();
|
||||
|
||||
$this->_ci->load->model('organisation/Studiensemester_model', 'StudiensemesterModel');
|
||||
|
||||
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
|
||||
/**
|
||||
* GET METHOD
|
||||
* returns List of all studiensemester as well as current one
|
||||
*/
|
||||
public function getStudiensemester()
|
||||
{
|
||||
$this->_ci->StudiensemesterModel->addOrder("start", "DESC");
|
||||
$result = $this->_ci->StudiensemesterModel->load();
|
||||
|
||||
$studiensemester = getData($result);
|
||||
$result = $this->_ci->StudiensemesterModel->getAkt();
|
||||
$aktuell = getData($result);
|
||||
|
||||
$this->terminateWithSuccess(array($studiensemester, $aktuell));
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Private methods
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
||||
@@ -0,0 +1,121 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2026 fhcomplete.org
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* This controller operates between (interface) the JS (GUI) and the back-end
|
||||
* Provides data to the ajax get calls about addresses
|
||||
* This controller works with JSON calls on the HTTP GET or POST and the output is always JSON
|
||||
*/
|
||||
class Board extends FHCAPI_Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'list' => 'dashboard/admin:r',
|
||||
'create' => 'dashboard/admin:rw',
|
||||
'update' => 'dashboard/admin:rw',
|
||||
'delete' => 'dashboard/admin:rw'
|
||||
]);
|
||||
|
||||
// Models
|
||||
$this->load->model('dashboard/Dashboard_model', 'DashboardModel');
|
||||
}
|
||||
|
||||
public function list()
|
||||
{
|
||||
$result = $this->DashboardModel->load();
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($result);
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
$dashboard_kurzbz = $this->input->post('dashboard_kurzbz');
|
||||
|
||||
$result = $this->DashboardModel->insert([
|
||||
'dashboard_kurzbz' => $dashboard_kurzbz
|
||||
]);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
|
||||
public function update()
|
||||
{
|
||||
$this->load->library('form_validation');
|
||||
|
||||
$this->form_validation->set_rules('dashboard_id', 'Dashboard ID', 'required');
|
||||
|
||||
if (!$this->form_validation->run())
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
$dashboard_id = $this->input->post('dashboard_id');
|
||||
$dashboard_kurzbz = $this->input->post('dashboard_kurzbz');
|
||||
$beschreibung = $this->input->post('beschreibung');
|
||||
|
||||
$result = $this->DashboardModel->update([
|
||||
'dashboard_id' => $dashboard_id
|
||||
], [
|
||||
'dashboard_kurzbz' => $dashboard_kurzbz,
|
||||
'beschreibung' => $beschreibung
|
||||
]);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($result);
|
||||
}
|
||||
|
||||
public function delete()
|
||||
{
|
||||
$this->load->library('form_validation');
|
||||
|
||||
$this->form_validation->set_rules('dashboard_id', 'Dashboard ID', 'required');
|
||||
|
||||
if (!$this->form_validation->run())
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
$dashboard_id = $this->input->post('dashboard_id');
|
||||
|
||||
//delete all presets
|
||||
$this->load->model('dashboard/Dashboard_Preset_model', 'DashboardPresetModel');
|
||||
|
||||
$result = $this->DashboardPresetModel->delete([
|
||||
'dashboard_id' => $dashboard_id
|
||||
]);
|
||||
$this->getDataOrTerminateWithError($result);
|
||||
|
||||
//delete all widgets
|
||||
$this->load->model('dashboard/Dashboard_Widget_model', 'DashboardWidgetModel');
|
||||
|
||||
$result = $this->DashboardWidgetModel->delete([
|
||||
'dashboard_id' => $dashboard_id
|
||||
]);
|
||||
$this->getDataOrTerminateWithError($result);
|
||||
|
||||
$result = $this->DashboardModel->delete($dashboard_id);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($result);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,200 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2026 fhcomplete.org
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* This controller operates between (interface) the JS (GUI) and the back-end
|
||||
* Provides data to the ajax get calls about addresses
|
||||
* This controller works with JSON calls on the HTTP GET or POST and the output is always JSON
|
||||
*/
|
||||
class Preset extends FHCAPI_Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'list' => 'dashboard/admin:r',
|
||||
'getBatch' => 'dashboard/admin:r',
|
||||
'addWidget' => 'dashboard/admin:rw',
|
||||
'removeWidget' => 'dashboard/admin:rw'
|
||||
]);
|
||||
|
||||
// Load language phrases
|
||||
$this->loadPhrases([
|
||||
'ui'
|
||||
]);
|
||||
|
||||
// Libraries
|
||||
$this->load->library('dashboard/DashboardLib');
|
||||
|
||||
// Models
|
||||
$this->load->model('ressource/Funktion_model', 'FunktionModel');
|
||||
}
|
||||
|
||||
public function list($dashboard_kurzbz)
|
||||
{
|
||||
$sql = "
|
||||
WITH
|
||||
dashboard_presets AS (
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
dashboard.tbl_dashboard_preset dp
|
||||
JOIN
|
||||
dashboard.tbl_dashboard d ON d.dashboard_id = dp.dashboard_id
|
||||
WHERE
|
||||
d.dashboard_kurzbz = {$this->db->escape($dashboard_kurzbz)}
|
||||
),
|
||||
general AS (
|
||||
SELECT
|
||||
'general' AS funktion_kurzbz,
|
||||
'Allgemein' AS beschreibung
|
||||
)
|
||||
|
||||
(
|
||||
SELECT
|
||||
f.funktion_kurzbz,
|
||||
f.beschreibung,
|
||||
COUNT(p.preset_id) AS has_preset
|
||||
FROM
|
||||
general f
|
||||
LEFT JOIN
|
||||
dashboard_presets p ON p.funktion_kurzbz IS NULL
|
||||
GROUP BY
|
||||
f.funktion_kurzbz, f.beschreibung
|
||||
)
|
||||
UNION ALL
|
||||
(
|
||||
SELECT
|
||||
f.funktion_kurzbz,
|
||||
f.beschreibung,
|
||||
COUNT(p.preset_id) AS has_preset
|
||||
FROM
|
||||
public.tbl_funktion f
|
||||
LEFT JOIN
|
||||
dashboard_presets p ON p.funktion_kurzbz = f.funktion_kurzbz
|
||||
GROUP BY
|
||||
f.funktion_kurzbz, f.beschreibung
|
||||
ORDER BY
|
||||
f.beschreibung ASC
|
||||
)
|
||||
";
|
||||
|
||||
$result = $this->FunktionModel->execReadOnlyQuery($sql);
|
||||
|
||||
$funktionen = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($funktionen);
|
||||
}
|
||||
|
||||
public function getBatch()
|
||||
{
|
||||
$this->load->library('form_validation');
|
||||
|
||||
$this->form_validation->set_rules('db', 'Dashboard', 'required');
|
||||
|
||||
if (!$this->form_validation->run())
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
$db = $this->input->post('db');
|
||||
$funktionen = $this->input->post('funktionen') ?: [];
|
||||
|
||||
$result = [];
|
||||
|
||||
foreach ($funktionen as $funktion) {
|
||||
$conf = $this->dashboardlib->getPreset($db, $funktion);
|
||||
if ($conf) {
|
||||
$preset = json_decode($conf->preset, true);
|
||||
if (!isset($preset[$funktion]) || !isset($preset[$funktion]['widgets']))
|
||||
$result[$funktion] = [];
|
||||
else
|
||||
$result[$funktion] = $preset[$funktion]['widgets'];
|
||||
} else {
|
||||
$result[$funktion] = [];
|
||||
}
|
||||
}
|
||||
|
||||
return $this->terminateWithSuccess($result);
|
||||
}
|
||||
|
||||
public function addWidget()
|
||||
{
|
||||
$this->load->library('form_validation');
|
||||
|
||||
$this->form_validation->set_rules('dashboard', 'Dashboard', 'required');
|
||||
$this->form_validation->set_rules('funktion_kurzbz', 'Funktion', 'required');
|
||||
$this->form_validation->set_rules('widget[widget]', 'Widget', 'required');
|
||||
|
||||
if (!$this->form_validation->run())
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
$dashboard_kurzbz = $this->input->post('dashboard');
|
||||
$funktion_kurzbz = $this->input->post('funktion_kurzbz');
|
||||
$widget = $this->input->post('widget');
|
||||
|
||||
if (!isset($widget['widgetid']))
|
||||
$widget['widgetid'] = $this->dashboardlib->generateWidgetId($dashboard_kurzbz);
|
||||
|
||||
$preset = $this->dashboardlib->getPresetOrCreateEmptyPreset($dashboard_kurzbz, $funktion_kurzbz);
|
||||
|
||||
$preset_decoded = json_decode($preset->preset, true);
|
||||
|
||||
$this->dashboardlib->addWidgetsToWidgets($preset_decoded, $dashboard_kurzbz, $funktion_kurzbz, [$widget]);
|
||||
|
||||
$preset->preset = json_encode($preset_decoded);
|
||||
|
||||
$result = $this->dashboardlib->insertOrUpdatePreset($preset);
|
||||
|
||||
$this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($widget['widgetid']);
|
||||
}
|
||||
|
||||
public function removeWidget()
|
||||
{
|
||||
$this->load->library('form_validation');
|
||||
|
||||
$this->form_validation->set_rules('db', 'Dashboard', 'required');
|
||||
$this->form_validation->set_rules('funktion_kurzbz', 'Funktion', 'required');
|
||||
$this->form_validation->set_rules('widgetid', 'Widget', 'required');
|
||||
|
||||
if (!$this->form_validation->run())
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
$dashboard_kurzbz = $this->input->post('db');
|
||||
$funktion_kurzbz = $this->input->post('funktion_kurzbz');
|
||||
$widgetid = $this->input->post('widgetid');
|
||||
|
||||
$preset = $this->dashboardlib->getPreset($dashboard_kurzbz, $funktion_kurzbz);
|
||||
if (!$preset)
|
||||
show_404();
|
||||
|
||||
$preset_decoded = json_decode($preset->preset, true);
|
||||
|
||||
if (!$this->dashboardlib->removeWidgetFromWidgets($preset_decoded, $funktion_kurzbz, $widgetid))
|
||||
show_404();
|
||||
|
||||
$preset->preset = json_encode($preset_decoded);
|
||||
|
||||
$result = $this->dashboardlib->insertOrUpdatePreset($preset);
|
||||
|
||||
$this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess(array('msg' => $this->p->t('dashboard', 'success_savePreset')));
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,159 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2026 fhcomplete.org
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* This controller operates between (interface) the JS (GUI) and the back-end
|
||||
* Provides data to the ajax get calls about the users dashboard
|
||||
* This controller works with JSON calls on the HTTP GET or POST and the output is always JSON
|
||||
*/
|
||||
class User extends FHCAPI_Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'get' => 'dashboard/benutzer:r',
|
||||
'addWidget' => 'dashboard/benutzer:rw',
|
||||
'removeWidget' => 'dashboard/benutzer:rw'
|
||||
]);
|
||||
|
||||
// Libraries
|
||||
$this->load->library('dashboard/DashboardLib');
|
||||
|
||||
// Models
|
||||
$this->load->model('ressource/Funktion_model', 'FunktionModel');
|
||||
}
|
||||
|
||||
public function get($dashboard_kurzbz)
|
||||
{
|
||||
$dashboard = $this->dashboardlib->getDashboardByKurzbz($dashboard_kurzbz);
|
||||
if (!$dashboard)
|
||||
show_404();
|
||||
|
||||
$uid = $this->authlib->getAuthObj()->username;
|
||||
|
||||
/*$mergedconfig = $this->dashboardlib->getMergedConfig($dashboard->dashboard_id, $uid);
|
||||
|
||||
$this->terminateWithSuccess([
|
||||
'general' => call_user_func_array(
|
||||
'array_merge_recursive',
|
||||
$mergedconfig
|
||||
)
|
||||
]);*/
|
||||
$defaultconfig = $this->dashboardlib->getDefaultConfig($dashboard->dashboard_id);
|
||||
$userconfig = $this->dashboardlib->getUserConfig($dashboard->dashboard_id, $uid);
|
||||
|
||||
$defaultconfig_squashed = $defaultconfig ? call_user_func_array('array_replace_recursive', $defaultconfig) : [];
|
||||
$userconfig_squashed = $userconfig ? call_user_func_array('array_replace_recursive', $userconfig) : [];
|
||||
|
||||
$mergedconfig = array_replace_recursive($defaultconfig_squashed, $userconfig_squashed);
|
||||
|
||||
$this->terminateWithSuccess([
|
||||
DashboardLib::SECTION_IF_FUNKTION_KURZBZ_IS_NULL => $mergedconfig
|
||||
]);
|
||||
}
|
||||
|
||||
public function addWidget()
|
||||
{
|
||||
$this->load->library('form_validation');
|
||||
|
||||
$this->form_validation->set_rules('dashboard', 'Dashboard', 'required');
|
||||
$this->form_validation->set_rules('widget[widget]', 'Widget', 'required');
|
||||
|
||||
if (!$this->form_validation->run())
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
$widget = $this->input->post('widget');
|
||||
$dashboard_kurzbz = $this->input->post('dashboard');
|
||||
$uid = $this->authlib->getAuthObj()->username;
|
||||
|
||||
if (!isset($widget['widgetid']))
|
||||
$widget['widgetid'] = $this->dashboardlib->generateWidgetId($dashboard_kurzbz);
|
||||
|
||||
$override = $this->dashboardlib->getOverrideOrCreateEmptyOverride($dashboard_kurzbz, $uid);
|
||||
|
||||
$override_decoded = json_decode($override->override, true);
|
||||
|
||||
if (!isset($override_decoded['general']) || !is_array($override_decoded['general']))
|
||||
$override_decoded['general'] = [];
|
||||
|
||||
if (!isset($override_decoded['general']['widgets']))
|
||||
$override_decoded['general']['widgets'] = [];
|
||||
|
||||
$override_decoded['general']['widgets'][$widget['widgetid']] = $widget;
|
||||
|
||||
// NOTE(chris): remove doubles in other funktionen
|
||||
foreach ($override_decoded as $funktion => $array) {
|
||||
if ($funktion == 'general')
|
||||
continue;
|
||||
if (isset($array['widgets']) && isset($array['widgets'][$widget['widgetid']]))
|
||||
unset($override_decoded[$funktion]['widgets'][$widget['widgetid']]);
|
||||
}
|
||||
|
||||
$override->override = json_encode($override_decoded);
|
||||
|
||||
$result = $this->dashboardlib->insertOrUpdateOverride($override);
|
||||
|
||||
$this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($widget['widgetid']);
|
||||
}
|
||||
|
||||
public function removeWidget()
|
||||
{
|
||||
$this->load->library('form_validation');
|
||||
|
||||
$this->form_validation->set_rules('dashboard', 'Dashboard', 'required');
|
||||
$this->form_validation->set_rules('widget', 'Widget', 'required');
|
||||
|
||||
if (!$this->form_validation->run())
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
$widget_id = $this->input->post('widget');
|
||||
$dashboard_kurzbz = $this->input->post('dashboard');
|
||||
$uid = $this->authlib->getAuthObj()->username;
|
||||
|
||||
$override = $this->dashboardlib->getOverride($dashboard_kurzbz, $uid);
|
||||
if (!$override)
|
||||
show_404();
|
||||
|
||||
$override_decoded = json_decode($override->override, true);
|
||||
|
||||
foreach (array_keys($override_decoded) as $k) {
|
||||
if (!isset($override_decoded[$k]["widgets"])) {
|
||||
unset($override_decoded[$k]);
|
||||
continue;
|
||||
}
|
||||
if (isset($override_decoded[$k]["widgets"][$widget_id])) {
|
||||
unset($override_decoded[$k]["widgets"][$widget_id]);
|
||||
}
|
||||
if (!$override_decoded[$k]["widgets"]) {
|
||||
unset($override_decoded[$k]);
|
||||
}
|
||||
}
|
||||
|
||||
$override->override = json_encode($override_decoded);
|
||||
|
||||
$result = $this->dashboardlib->insertOrUpdateOverride($override);
|
||||
|
||||
$this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess();
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,137 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2026 fhcomplete.org
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* This controller operates between (interface) the JS (GUI) and the back-end
|
||||
* Provides data to the ajax get calls about the users dashboard
|
||||
* This controller works with JSON calls on the HTTP GET or POST and the output is always JSON
|
||||
*/
|
||||
class Widget extends FHCAPI_Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'get' => ['dashboard/benutzer:r', 'dashboard/admin:r'],
|
||||
'list' => 'dashboard/admin:r',
|
||||
'listAllowed' => ['dashboard/benutzer:rw', 'dashboard/admin:r'],
|
||||
'setAllowed' => 'dashboard/admin:rw'
|
||||
]);
|
||||
|
||||
// Libraries
|
||||
$this->load->library('dashboard/DashboardLib');
|
||||
|
||||
// Models
|
||||
$this->load->model('dashboard/Widget_model', 'WidgetModel');
|
||||
}
|
||||
|
||||
public function get($id)
|
||||
{
|
||||
$result = $this->WidgetModel->load($id);
|
||||
|
||||
$widget = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
if (!$widget)
|
||||
return $this->terminateWithSuccess([
|
||||
"widget_id" => 0,
|
||||
"widget_kurzbz" => "notfound",
|
||||
"arguments" => [
|
||||
"className" => 'alert-danger',
|
||||
"title" => 'Widget Not Found',
|
||||
"msg" => 'The widget with the id ' . $id . ' could not be found'
|
||||
],
|
||||
"setup" => [
|
||||
"name" => 'Widget Not Found',
|
||||
"file" => absoluteJsImportUrl('public/js/components/DashboardWidget/Default.js'),
|
||||
"width" => 1,
|
||||
"height" => 1
|
||||
]
|
||||
]);
|
||||
|
||||
$widget = current($widget);
|
||||
$widget->arguments = json_decode($widget->arguments);
|
||||
$tmpsetup = json_decode($widget->setup);
|
||||
$tmpsetup->file = absoluteJsImportUrl($tmpsetup->file);
|
||||
$widget->setup = $tmpsetup;
|
||||
|
||||
$this->terminateWithSuccess($widget);
|
||||
}
|
||||
|
||||
public function list($dashboard)
|
||||
{
|
||||
$result = $this->WidgetModel->getWithAllowedForDashboard($dashboard);
|
||||
|
||||
$widgets = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$widgets = array_map(function ($widget) {
|
||||
$widget->arguments = json_decode($widget->arguments);
|
||||
$tmpsetup = json_decode($widget->setup);
|
||||
$tmpsetup->file = absoluteJsImportUrl($tmpsetup->file);
|
||||
$widget->setup = $tmpsetup;
|
||||
return $widget;
|
||||
}, $widgets);
|
||||
|
||||
$this->terminateWithSuccess($widgets);
|
||||
}
|
||||
|
||||
public function listAllowed($dashboard)
|
||||
{
|
||||
$result = $this->WidgetModel->getForDashboard($dashboard);
|
||||
|
||||
$widgets = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$widgets = array_map(function ($widget) {
|
||||
$widget->arguments = json_decode($widget->arguments);
|
||||
$tmpsetup = json_decode($widget->setup);
|
||||
$tmpsetup->file = absoluteJsImportUrl($tmpsetup->file);
|
||||
$widget->setup = $tmpsetup;
|
||||
return $widget;
|
||||
}, $widgets);
|
||||
|
||||
$this->terminateWithSuccess($widgets);
|
||||
}
|
||||
|
||||
public function setAllowed()
|
||||
{
|
||||
$this->load->library('form_validation');
|
||||
|
||||
$this->form_validation->set_rules('dashboard_id', 'Dashboard', 'required');
|
||||
$this->form_validation->set_rules('widget_id', 'Widget', 'required');
|
||||
$this->form_validation->set_rules('allowed', 'Allowed', 'is_bool');
|
||||
|
||||
if (!$this->form_validation->run())
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
|
||||
$data = [
|
||||
'dashboard_id' => $this->input->post('dashboard_id'),
|
||||
'widget_id' => $this->input->post('widget_id')
|
||||
];
|
||||
|
||||
$this->load->model('dashboard/Dashboard_Widget_model', 'DashboardWidgetModel');
|
||||
|
||||
if ($this->input->post('allowed'))
|
||||
$result = $this->DashboardWidgetModel->insert($data);
|
||||
else
|
||||
$result = $this->DashboardWidgetModel->delete($data);
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
<?php
|
||||
|
||||
if (!defined('BASEPATH'))
|
||||
exit('No direct script access allowed');
|
||||
|
||||
class Config extends FHCAPI_Controller
|
||||
{
|
||||
private $_ci;
|
||||
private $_uid;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'get' => ['admin:r', 'assistenz:r'],
|
||||
'set' => ['admin:r', 'assistenz:r'],
|
||||
]);
|
||||
|
||||
$this->_ci = &get_instance();
|
||||
$this->_setAuthUID();
|
||||
|
||||
$this->loadPhrases([
|
||||
'lehre'
|
||||
]);
|
||||
|
||||
$this->_ci->load->library('VariableLib', ['uid' => $this->_uid]);
|
||||
$this->_ci->load->library('PermissionLib');
|
||||
|
||||
}
|
||||
|
||||
|
||||
public function get()
|
||||
{
|
||||
if (!($this->permissionlib->isBerechtigt('basis/tempus')) && !($this->permissionlib->isBerechtigt('lv-plan')))
|
||||
$this->terminateWithSuccess([]);
|
||||
|
||||
$ignore_kollision = $this->_ci->variablelib->getVar('ignore_kollision');
|
||||
$ignore_zeitsperre = $this->_ci->variablelib->getVar('ignore_zeitsperre');
|
||||
$ignore_reservierung = $this->_ci->variablelib->getVar('ignore_reservierung');
|
||||
|
||||
$config['ignore_kollision'] = [
|
||||
"type" => "checkbox",
|
||||
"label" => 'ignore_kollision',
|
||||
"value" => $ignore_kollision,
|
||||
];
|
||||
|
||||
$config['ignore_zeitsperre'] = [
|
||||
"type" => "checkbox",
|
||||
"label" => 'ignore_zeitsperre',
|
||||
"value" => $ignore_zeitsperre,
|
||||
];
|
||||
|
||||
$config['ignore_reservierung'] = [
|
||||
"type" => "checkbox",
|
||||
"label" => 'ignore_reservierung',
|
||||
"value" => $ignore_reservierung,
|
||||
];
|
||||
|
||||
$this->terminateWithSuccess($config);
|
||||
}
|
||||
public function set()
|
||||
{
|
||||
if (!($this->permissionlib->isBerechtigt('basis/tempus')) && !($this->permissionlib->isBerechtigt('lv-plan')))
|
||||
$this->terminateWithSuccess([]);
|
||||
|
||||
$this->load->model('system/Variable_model', 'VariableModel');
|
||||
|
||||
foreach (['ignore_kollision','ignore_zeitsperre','ignore_reservierung'] as $variable)
|
||||
{
|
||||
if ($this->_ci->input->post($variable) !== null)
|
||||
{
|
||||
$this->VariableModel->update(array('uid' => $this->_uid, 'name' => $variable), array('wert' => $this->input->post($variable)));
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
$this->terminateWithSuccess();
|
||||
}
|
||||
|
||||
private function _setAuthUID()
|
||||
{
|
||||
$this->_uid = getAuthUID();
|
||||
|
||||
if (!$this->_uid)
|
||||
show_error('User authentification failed');
|
||||
}
|
||||
}
|
||||
@@ -15,6 +15,7 @@ class Gruppe extends FHCAPI_Controller
|
||||
'getBenutzerSearch' => ['admin:r', 'assistenz:r'],
|
||||
'getAllSearch' => ['admin:r', 'assistenz:r'],
|
||||
'getByLehreinheit' => ['admin:r', 'assistenz:r'],
|
||||
'getGruppe' => ['admin:r', 'assistenz:r'],
|
||||
]);
|
||||
|
||||
$this->_ci = &get_instance();
|
||||
@@ -67,7 +68,7 @@ class Gruppe extends FHCAPI_Controller
|
||||
|
||||
$this->checkPermission($lehreinheit_id);
|
||||
|
||||
$result = $this->_ci->LehreinheitgruppeModel->addGroup($lehreinheit_id, $gid, !($lehrverband === 'false'));
|
||||
$result = $this->_ci->LehreinheitgruppeModel->addGroup($lehreinheit_id, $gid, $lehrverband === true || $lehrverband === 'true');
|
||||
|
||||
if (isError($result))
|
||||
$this->terminateWithError(getError($result));
|
||||
@@ -75,6 +76,71 @@ class Gruppe extends FHCAPI_Controller
|
||||
$this->terminateWithSuccess($result);
|
||||
}
|
||||
|
||||
public function getGruppe()
|
||||
{
|
||||
$lehrverband = $this->input->post('lehrverband');
|
||||
|
||||
$gruppen_result = array();
|
||||
|
||||
if ($lehrverband === false)
|
||||
{
|
||||
$gruppen_result = $this->_ci->GruppeModel->loadWhere(array(
|
||||
'studiengang_kz' => $this->input->post('stg_kz'),
|
||||
'gruppe_kurzbz' => $this->input->post('gruppe_kurzbz'),
|
||||
'aktiv' => true
|
||||
));
|
||||
}
|
||||
else if ($lehrverband === true)
|
||||
{
|
||||
|
||||
if (!isEmptyString($this->input->post('verband')))
|
||||
{
|
||||
$this->LehrverbandModel->db->where('verband', $this->input->post('verband'));
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->LehrverbandModel->db->group_start();
|
||||
$this->LehrverbandModel->db->where("trim(verband) = ''");
|
||||
$this->LehrverbandModel->db->or_where("verband IS NULL");
|
||||
$this->LehrverbandModel->db->group_end();
|
||||
}
|
||||
|
||||
if (!isEmptyString($this->input->post('gruppe')))
|
||||
{
|
||||
$this->LehrverbandModel->db->where('gruppe', $this->input->post('gruppe'));
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->LehrverbandModel->db->group_start();
|
||||
$this->LehrverbandModel->db->where("trim(gruppe) = ''");
|
||||
$this->LehrverbandModel->db->or_where("gruppe IS NULL");
|
||||
$this->LehrverbandModel->db->group_end();
|
||||
}
|
||||
|
||||
if (!isEmptyString((string)$this->input->post('semester')))
|
||||
{
|
||||
$this->LehrverbandModel->db->where('semester', $this->input->post('semester'));
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
$this->LehrverbandModel->db->group_start();
|
||||
$this->LehrverbandModel->db->where("semester = ''");
|
||||
$this->LehrverbandModel->db->or_where("semester IS NULL");
|
||||
$this->LehrverbandModel->db->group_end();
|
||||
}
|
||||
|
||||
$gruppen_result = $this->LehrverbandModel->loadWhere(array('studiengang_kz' => $this->input->post('stg_kz'), 'aktiv' => true));
|
||||
}
|
||||
|
||||
if (!hasData($gruppen_result))
|
||||
return $this->terminateWithError('No group found');
|
||||
|
||||
$gruppen_array = getData($gruppen_result)[0];
|
||||
|
||||
$this->terminateWithSuccess($gruppen_array->gid);
|
||||
}
|
||||
|
||||
public function getByLehreinheit($lehreinheit_id = null)
|
||||
{
|
||||
if (is_null($lehreinheit_id) || !ctype_digit((string)$lehreinheit_id))
|
||||
|
||||
@@ -134,9 +134,14 @@ class Lektor extends FHCAPI_Controller
|
||||
$this->terminateWithValidationErrors($this->form_validation->error_array());
|
||||
}
|
||||
|
||||
if (isset($formData['semesterstunden']) && (!is_numeric($formData['semesterstunden']) || $formData['semesterstunden'] === ''))
|
||||
$nullable_fields = array('semesterstunden', 'stundensatz', 'planstunden');
|
||||
|
||||
foreach ($nullable_fields as $nullable_field)
|
||||
{
|
||||
$formData['semesterstunden'] = null;
|
||||
if (isset($formData[$nullable_field]) && (!is_numeric($formData[$nullable_field]) || $formData[$nullable_field] === ''))
|
||||
{
|
||||
$formData[$nullable_field] = null;
|
||||
}
|
||||
}
|
||||
|
||||
$lehreinheit_permission = $this->checkPermission($lehreinheit_id, array('admin', 'assistenz', 'lv-plan'));
|
||||
@@ -144,6 +149,9 @@ class Lektor extends FHCAPI_Controller
|
||||
if (!$lehreinheit_permission)
|
||||
$this->terminateWithError($this->p->t('ui', 'error_fieldWriteAccess'));
|
||||
|
||||
if (!is_null($this->getLektorVertrag($lehreinheit_id, $mitarbeiter_uid)) && (array_key_exists('mitarbeiter_uid', $formData) && $mitarbeiter_uid !== $formData['mitarbeiter_uid']))
|
||||
$this->terminateWithError($this->p->t('ui', 'error_fieldWriteAccess'));
|
||||
|
||||
$result = $this->_ci->lektorlib->updateLektorFromLehreinheit($lehreinheit_id, $mitarbeiter_uid, $formData);
|
||||
|
||||
if (isError($result)) $this->terminateWithError(getError($result));
|
||||
@@ -154,7 +162,7 @@ class Lektor extends FHCAPI_Controller
|
||||
{
|
||||
$value = str_replace(',', '.', $value);
|
||||
|
||||
if (!is_numeric($value))
|
||||
if (!is_numeric($value) && $value !== "")
|
||||
{
|
||||
$this->form_validation->set_message('_check_decimal', 'Das Feld {field} muss eine Zahl sein.');
|
||||
return false;
|
||||
|
||||
@@ -0,0 +1,84 @@
|
||||
<?php
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class Noten extends FHCAPI_Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'getCertificate' => 'student/noten:r',
|
||||
'getTeacherProposal' => 'student/noten:r',
|
||||
]);
|
||||
|
||||
// Load Libraries
|
||||
$this->load->library('VariableLib', ['uid' => getAuthUID()]);
|
||||
|
||||
// Load Phrases
|
||||
$this->loadPhrases([
|
||||
'stv',
|
||||
'person',
|
||||
'lehre'
|
||||
]);
|
||||
}
|
||||
|
||||
public function getCertificate($lv_id, $studiensemester_kurzbz = null)
|
||||
{
|
||||
if (is_null($lv_id) || !ctype_digit((string)$lv_id))
|
||||
$this->terminateWithError( $this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$this->load->model('education/lehrveranstaltung_model', 'LehrveranstaltungModel');
|
||||
$this->load->model('education/Zeugnisnote_model', 'ZeugnisnoteModel');
|
||||
$this->load->model('organisation/Studiensemester_model', 'StudiensemesterModel');
|
||||
|
||||
$result = $this->LehrveranstaltungModel->loadWhere([
|
||||
'lehrveranstaltung_id' => $lv_id
|
||||
]);
|
||||
|
||||
$lehrveranstaltung = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
if (!$lehrveranstaltung)
|
||||
$this->terminateWithSuccess([]);
|
||||
|
||||
if ($studiensemester_kurzbz !== null && !$this->StudiensemesterModel->isValidStudiensemester($studiensemester_kurzbz))
|
||||
{
|
||||
$this->terminateWithError($studiensemester_kurzbz . ' - ' . $this->p->t('lehre', 'error_noStudiensemester'));
|
||||
}
|
||||
|
||||
$result = $this->ZeugnisnoteModel->getZeugnisnoten(null, $studiensemester_kurzbz, $lehrveranstaltung[0]->lehrveranstaltung_id);
|
||||
|
||||
$grades = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($grades);
|
||||
}
|
||||
|
||||
public function getTeacherProposal($lv_id, $studiensemester_kurzbz = null)
|
||||
{
|
||||
if (is_null($lv_id) || !ctype_digit((string)$lv_id))
|
||||
$this->terminateWithError( $this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
|
||||
|
||||
$this->load->model('education/lehrveranstaltung_model', 'LehrveranstaltungModel');
|
||||
$this->load->model('education/Lvgesamtnote_model', 'LvgesamtnoteModel');
|
||||
$this->load->model('organisation/Studiensemester_model', 'StudiensemesterModel');
|
||||
|
||||
$result = $this->LehrveranstaltungModel->loadWhere([
|
||||
'lehrveranstaltung_id' => $lv_id
|
||||
]);
|
||||
|
||||
$lehrveranstaltung = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
if (!$lehrveranstaltung)
|
||||
$this->terminateWithSuccess([]);
|
||||
|
||||
if ($studiensemester_kurzbz !== null && !$this->StudiensemesterModel->isValidStudiensemester($studiensemester_kurzbz))
|
||||
{
|
||||
$this->terminateWithError($studiensemester_kurzbz . ' - ' . $this->p->t('lehre', 'error_noStudiensemester'));
|
||||
}
|
||||
|
||||
$result = $this->LvgesamtnoteModel->getLvGesamtNoten($lv_id, null, $studiensemester_kurzbz);
|
||||
|
||||
$grades = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($grades);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -27,7 +27,8 @@ class Setup extends FHCAPI_Controller
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct([
|
||||
'getTabs' => ['admin:r', 'assistenz:r'],
|
||||
'getLETabs' => ['admin:r', 'assistenz:r'],
|
||||
'getLVTabs' => ['admin:r', 'assistenz:r'],
|
||||
'getStudiensemester' => ['admin:r', 'assistenz:r'],
|
||||
'getSprache' => ['admin:r', 'assistenz:r'],
|
||||
'getRaumtyp' => ['admin:r', 'assistenz:r'],
|
||||
@@ -41,9 +42,10 @@ class Setup extends FHCAPI_Controller
|
||||
$this->_ci->load->model('education/Lehrveranstaltung_model', 'LehrveranstaltungModel');
|
||||
|
||||
$this->_ci->load->library('VariableLib', ['uid' => $this->_uid]);
|
||||
$this->_ci->load->helper('hlp_document');
|
||||
}
|
||||
|
||||
public function getTabs()
|
||||
public function getLETabs()
|
||||
{
|
||||
$tabs['details'] = array (
|
||||
'title' => 'Details',
|
||||
@@ -60,6 +62,11 @@ class Setup extends FHCAPI_Controller
|
||||
'component' => absoluteJsImportUrl('public/js/components/LVVerwaltung/Tabs/Lektor.js'),
|
||||
'config' => []
|
||||
);
|
||||
$tabs['termine'] = array (
|
||||
'title' => 'Termine',
|
||||
'component' => APP_ROOT . 'public/js/components/LVVerwaltung/Tabs/Termine.js',
|
||||
'config' => []
|
||||
);
|
||||
$tabs['notiz'] = array (
|
||||
'title' => 'Notizen',
|
||||
'component' => absoluteJsImportUrl('public/js/components/LVVerwaltung/Tabs/Notiz.js'),
|
||||
@@ -68,6 +75,28 @@ class Setup extends FHCAPI_Controller
|
||||
$this->terminateWithSuccess($tabs);
|
||||
}
|
||||
|
||||
public function getLVTabs()
|
||||
{
|
||||
$tabs['termine'] = array (
|
||||
'title' => 'Termine',
|
||||
'component' => APP_ROOT . 'public/js/components/LVVerwaltung/Tabs/LVTermine.js',
|
||||
'config' => []
|
||||
);
|
||||
$tabs['noten'] = array (
|
||||
'title' => 'Noten',
|
||||
'component' => APP_ROOT . 'public/js/components/LVVerwaltung/Tabs/Noten.js',
|
||||
'config' => [
|
||||
'usePoints' => defined('CIS_GESAMTNOTE_PUNKTE') && CIS_GESAMTNOTE_PUNKTE,
|
||||
'edit' => 'both', // Possible values: both|header|inline
|
||||
'delete' => 'inline', // Possible values: both|header|inline
|
||||
'documents' => 'inline', // Possible values: both|header|inline
|
||||
'documentslist' => gradesDocumentsList(),
|
||||
'semesterSelect' => false
|
||||
]
|
||||
);
|
||||
$this->terminateWithSuccess($tabs);
|
||||
}
|
||||
|
||||
public function getStudiensemester()
|
||||
{
|
||||
$this->_ci->load->model('organisation/Studiensemester_model', 'StudiensemesterModel');
|
||||
|
||||
@@ -25,7 +25,25 @@ class StgTree extends FHCAPI_Controller
|
||||
return $this->_outputAuthError([$method => ['admin:r', 'assistenz:r']]);
|
||||
}
|
||||
|
||||
return $this->getStudiengang($method);
|
||||
$count = count($params);
|
||||
if (!$count)
|
||||
return $this->getStudiengang($method);
|
||||
|
||||
if ($count == 1) {
|
||||
if (is_numeric($params[0]))
|
||||
return $this->getSemester($method, $params[0]);
|
||||
else
|
||||
return $this->getStudiengang($method, $params[0]);
|
||||
}
|
||||
if ($count == 2) {
|
||||
if (is_numeric($params[0]))
|
||||
return $this->getVerband($method, $params[0], $params[1]);
|
||||
else
|
||||
return $this->getSemester($method, $params[1], $params[0]);
|
||||
}
|
||||
|
||||
|
||||
|
||||
show_404();
|
||||
}
|
||||
|
||||
@@ -64,16 +82,27 @@ class StgTree extends FHCAPI_Controller
|
||||
$this->terminateWithSuccess($list);
|
||||
}
|
||||
|
||||
protected function getStudiengang($studiengang_kz)
|
||||
protected function getStudiengang($studiengang_kz, $org_form = null)
|
||||
{
|
||||
$link = $studiengang_kz . '/';
|
||||
if ($org_form !== null)
|
||||
$link .= $org_form . '/';
|
||||
|
||||
$this->StudiengangModel->addJoin('public.tbl_lehrverband v', 'studiengang_kz');
|
||||
|
||||
$this->StudiengangModel->addDistinct();
|
||||
$this->StudiengangModel->addSelect("CONCAT(" . $this->StudiengangModel->escape($link) . ", semester) AS link", false);
|
||||
$this->StudiengangModel->addSelect("CONCAT(UPPER(CONCAT(typ, kurzbz)), '-', semester, (SELECT CASE WHEN bezeichnung IS NULL OR bezeichnung='' THEN ''::TEXT ELSE CONCAT(' (', bezeichnung, ')') END FROM public.tbl_lehrverband WHERE studiengang_kz=v.studiengang_kz AND semester=v.semester ORDER BY verband, gruppe LIMIT 1)) AS name", false);
|
||||
$this->StudiengangModel->addSelect("TRUE AS leaf", false);
|
||||
$this->StudiengangModel->addSelect("CONCAT(
|
||||
UPPER(CONCAT(typ, kurzbz)),
|
||||
'-',
|
||||
semester,
|
||||
(
|
||||
SELECT CASE WHEN bezeichnung IS NULL OR bezeichnung='' THEN ''::TEXT ELSE CONCAT(' (', bezeichnung, ')') END
|
||||
FROM public.tbl_lehrverband
|
||||
WHERE studiengang_kz=v.studiengang_kz AND semester=v.semester
|
||||
ORDER BY verband, gruppe LIMIT 1
|
||||
)
|
||||
) AS name", false);
|
||||
|
||||
$this->StudiengangModel->addSelect('semester');
|
||||
$this->StudiengangModel->addSelect($this->StudiengangModel->escape($studiengang_kz) . '::integer AS stg_kz', false);
|
||||
@@ -111,6 +140,115 @@ class StgTree extends FHCAPI_Controller
|
||||
$list = array_merge($list, $result);
|
||||
}
|
||||
}
|
||||
$this->terminateWithSuccess($list);
|
||||
}
|
||||
|
||||
protected function getSemester($studiengang_kz, $semester, $org_form = null)
|
||||
{
|
||||
$link = $studiengang_kz . '/';
|
||||
if ($org_form !== null)
|
||||
$link .= $org_form . '/';
|
||||
$link .= $semester . '/';
|
||||
|
||||
|
||||
$this->load->model('organisation/Gruppe_model', 'GruppeModel');
|
||||
|
||||
$this->GruppeModel->addDistinct();
|
||||
$this->GruppeModel->addSelect("CONCAT(" . $this->GruppeModel->escape($link . 'grp/') . ", gruppe_kurzbz) AS link", false);
|
||||
$this->GruppeModel->addSelect("CONCAT(gruppe_kurzbz, ' (', bezeichnung, ')') AS name", false);
|
||||
$this->GruppeModel->addSelect("TRUE AS leaf", false);
|
||||
|
||||
$this->GruppeModel->addSelect('sort');
|
||||
$this->GruppeModel->addSelect('gruppe_kurzbz');
|
||||
$this->GruppeModel->addSelect($this->GruppeModel->escape($studiengang_kz) . '::integer AS stg_kz', false);
|
||||
|
||||
$this->GruppeModel->addOrder('sort');
|
||||
$this->GruppeModel->addOrder('gruppe_kurzbz');
|
||||
|
||||
$where = [
|
||||
'studiengang_kz' => $studiengang_kz,
|
||||
'semester' => $semester,
|
||||
'lehre' => true,
|
||||
'sichtbar' => true,
|
||||
'aktiv' => true,
|
||||
'direktinskription' => false
|
||||
];
|
||||
|
||||
if ($org_form !== null)
|
||||
$where['orgform_kurzbz'] = $org_form;
|
||||
|
||||
$result = $this->GruppeModel->loadWhere($where);
|
||||
|
||||
$list = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->StudiengangModel->addJoin('public.tbl_lehrverband v', 'studiengang_kz');
|
||||
|
||||
$this->StudiengangModel->addSelect("CONCAT(" . $this->StudiengangModel->escape($link) . ", verband) AS link", false);
|
||||
$this->StudiengangModel->addSelect("CONCAT(UPPER(CONCAT(typ, kurzbz)), '-', semester, verband, (SELECT CASE WHEN bezeichnung IS NULL OR bezeichnung='' THEN ''::TEXT ELSE CONCAT(' (', bezeichnung, ')') END FROM public.tbl_lehrverband WHERE studiengang_kz=v.studiengang_kz AND semester=v.semester AND verband=v.verband ORDER BY gruppe LIMIT 1)) AS name", false);
|
||||
$this->StudiengangModel->addSelect("CASE WHEN MAX(gruppe)='' OR MAX(gruppe)=' ' THEN TRUE ELSE FALSE END AS leaf");
|
||||
|
||||
$this->StudiengangModel->addSelect($this->StudiengangModel->escape($semester) . ' AS semester');
|
||||
$this->StudiengangModel->addSelect('verband');
|
||||
$this->StudiengangModel->addSelect($this->StudiengangModel->escape($studiengang_kz) . '::integer AS stg_kz', false);
|
||||
|
||||
$this->StudiengangModel->addOrder('verband');
|
||||
|
||||
$this->StudiengangModel->addGroupBy('link, name, verband');
|
||||
|
||||
$where = [
|
||||
'v.studiengang_kz' => $studiengang_kz,
|
||||
'v.semester' => $semester,
|
||||
'v.verband !=' => '',
|
||||
'v.aktiv' => true
|
||||
];
|
||||
|
||||
if ($org_form !== null && $semester) // NOTE(chris): on semester 0 show all?
|
||||
$where['v.orgform_kurzbz'] = $org_form;
|
||||
|
||||
$result = $this->StudiengangModel->loadWhere($where);
|
||||
$result = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$list = array_merge($list, $result);
|
||||
|
||||
$this->terminateWithSuccess($list);
|
||||
}
|
||||
|
||||
protected function getVerband($studiengang_kz, $semester, $verband, $org_form = null)
|
||||
{
|
||||
$link = $studiengang_kz . '/';
|
||||
if ($org_form !== null)
|
||||
$link .= $org_form . '/';
|
||||
$link .= $semester . '/'. $verband . '/';
|
||||
|
||||
|
||||
$this->StudiengangModel->addJoin('public.tbl_lehrverband v', 'studiengang_kz');
|
||||
|
||||
$this->StudiengangModel->addDistinct();
|
||||
$this->StudiengangModel->addSelect("CONCAT(" . $this->StudiengangModel->escape($link) . ", gruppe) AS link", false);
|
||||
$this->StudiengangModel->addSelect("CONCAT(UPPER(CONCAT(typ, kurzbz)), '-', semester, verband, gruppe, (SELECT CASE WHEN bezeichnung IS NULL OR bezeichnung='' THEN ''::TEXT ELSE CONCAT(' (', bezeichnung, ')') END FROM public.tbl_lehrverband WHERE studiengang_kz=v.studiengang_kz AND semester=v.semester AND verband=v.verband AND gruppe=v.gruppe ORDER BY gruppe LIMIT 1)) AS name", false);
|
||||
$this->StudiengangModel->addSelect("TRUE AS leaf", false);
|
||||
|
||||
$this->StudiengangModel->addSelect('v.semester');
|
||||
$this->StudiengangModel->addSelect('v.verband');
|
||||
$this->StudiengangModel->addSelect('gruppe');
|
||||
$this->StudiengangModel->addSelect($this->StudiengangModel->escape($studiengang_kz) . '::integer AS stg_kz', false);
|
||||
|
||||
$this->StudiengangModel->addOrder('gruppe');
|
||||
|
||||
$where = [
|
||||
'v.studiengang_kz' => $studiengang_kz,
|
||||
'v.semester' => $semester,
|
||||
'v.verband' => $verband,
|
||||
'v.gruppe !=' => '',
|
||||
'v.aktiv' => true
|
||||
];
|
||||
|
||||
if ($org_form !== null && $semester)
|
||||
$where['v.orgform_kurzbz'] = $org_form;
|
||||
|
||||
$result = $this->StudiengangModel->loadWhere($where);
|
||||
|
||||
$list = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($list);
|
||||
}
|
||||
|
||||
@@ -301,6 +301,7 @@ class Config extends FHCAPI_Controller
|
||||
|
||||
public function student()
|
||||
{
|
||||
$this->load->helper('hlp_document');
|
||||
$result = [];
|
||||
$config = $this->config->item('tabs');
|
||||
|
||||
@@ -376,9 +377,9 @@ class Config extends FHCAPI_Controller
|
||||
'config' => [
|
||||
'usePoints' => defined('CIS_GESAMTNOTE_PUNKTE') && CIS_GESAMTNOTE_PUNKTE,
|
||||
'edit' => 'both', // Possible values: both|header|inline
|
||||
'delete' => 'both', // Possible values: both|header|inline
|
||||
'documents' => 'both', // Possible values: both|header|inline
|
||||
'documentslist' => $this->gradesDocumentsList()
|
||||
'delete' => 'inline', // Possible values: both|header|inline
|
||||
'documents' => 'inline', // Possible values: both|header|inline
|
||||
'documentslist' => gradesDocumentsList()
|
||||
]
|
||||
];
|
||||
|
||||
@@ -622,188 +623,6 @@ class Config extends FHCAPI_Controller
|
||||
] + $this->kontoColumns();
|
||||
}
|
||||
|
||||
/**
|
||||
* Helper function to generate the default documentslist config for the
|
||||
* grades tab.
|
||||
*
|
||||
* The resulting array consists of elements which are associative arrays
|
||||
* that can have the following entries:
|
||||
* title (required) on the first level this can be HTML code.
|
||||
* permissioncheck (optional) an URL to an FHCAPI endpoint which returns
|
||||
* true or false.
|
||||
* link (optional) an URL that will be called if "action" and
|
||||
* "children" are not defined.
|
||||
* action (optional) an associative array that describes an
|
||||
* POST action that will be called if "children" is
|
||||
* not defined.
|
||||
* It can have the following entries:
|
||||
* - url (required) an URL to an FHCAPI endpoint.
|
||||
* - post (optional) an associative array with the POST data to
|
||||
* be sent.
|
||||
* - response (optional) a string that will be displayed on success.
|
||||
* children (optional) an array of child elements
|
||||
*
|
||||
* All strings that start with { and end with } in the URLs and the
|
||||
* actions post parameter will be replaced with the corresponding
|
||||
* attribute of the current dataset (e.G: {uid} will be replaced with the
|
||||
* uid of the current dataset)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
protected function gradesDocumentsList()
|
||||
{
|
||||
$permissioncheck = site_url("api/frontend/v1/documents/permissionAlternativeFormat/{studiengang_kz}");
|
||||
|
||||
$title_ger = $this->p->t("global", "deutsch");
|
||||
$title_eng = $this->p->t("global", "englisch");
|
||||
$title_ff = $this->p->t("stv", "document_certificate");
|
||||
$title_lv = $this->p->t("stv", "document_coursecertificate");
|
||||
|
||||
$link_ff = "documents/export/" .
|
||||
"zertifikat.rdf.php/" .
|
||||
"Zertifikat" .
|
||||
"?stg_kz={studiengang_kz_lv}" .
|
||||
"&uid={uid}" .
|
||||
"&ss={studiensemester_kurzbz}" .
|
||||
"&lvid={lehrveranstaltung_id}";
|
||||
$link_lv_ger = "documents/export/" .
|
||||
"lehrveranstaltungszeugnis.rdf.php/" .
|
||||
"LVZeugnis" .
|
||||
"?stg_kz={studiengang_kz}" .
|
||||
"&uid={uid}" .
|
||||
"&ss={studiensemester_kurzbz}" .
|
||||
"&lvid={lehrveranstaltung_id}";
|
||||
$link_lv_eng = "documents/export/" .
|
||||
"lehrveranstaltungszeugnis.rdf.php/" .
|
||||
"LVZeugnisEng" .
|
||||
"?stg_kz={studiengang_kz}" .
|
||||
"&uid={uid}" .
|
||||
"&ss={studiensemester_kurzbz}" .
|
||||
"&lvid={lehrveranstaltung_id}";
|
||||
|
||||
$archive_url = "api/frontend/v1/documents/archiveSigned";
|
||||
$archive_response = $this->p->t("stv", "document_signed_and_archived");
|
||||
$archive_post_ff = [
|
||||
"xml" => "zertifikat.rdf.php",
|
||||
"xsl" => "Zertifikat",
|
||||
"stg_kz" => "{studiengang_kz_lv}",
|
||||
"uid" => "{uid}",
|
||||
"ss" => "{studiensemester_kurzbz}",
|
||||
"lvid" => "{lehrveranstaltung_id}"
|
||||
];
|
||||
$archive_post_lv_ger = [
|
||||
"xml" => "lehrveranstaltungszeugnis.rdf.php",
|
||||
"xsl" => "LVZeugnis",
|
||||
"stg_kz" => "{studiengang_kz}",
|
||||
"uid" => "{uid}",
|
||||
"ss" => "{studiensemester_kurzbz}",
|
||||
"lvid" => "{lehrveranstaltung_id}"
|
||||
];
|
||||
$archive_post_lv_eng = [
|
||||
"xml" => "lehrveranstaltungszeugnis.rdf.php",
|
||||
"xsl" => "LVZeugnisEng",
|
||||
"stg_kz" => "{studiengang_kz}",
|
||||
"uid" => "{uid}",
|
||||
"ss" => "{studiensemester_kurzbz}",
|
||||
"lvid" => "{lehrveranstaltung_id}"
|
||||
];
|
||||
|
||||
$list = [
|
||||
[
|
||||
'title' => '<i class="fa fa-download" title="' . $this->p->t("stv", "document_download") . '"></i>',
|
||||
'children' => [
|
||||
[
|
||||
'title' => $title_ff,
|
||||
'link' => site_url($link_ff)
|
||||
],
|
||||
[
|
||||
'title' => $title_lv,
|
||||
'children' => [
|
||||
[
|
||||
'title' => $title_ger,
|
||||
'link' => site_url($link_lv_ger),
|
||||
'children' => [
|
||||
[
|
||||
'title' => 'PDF',
|
||||
'permissioncheck' => $permissioncheck,
|
||||
'link' => site_url($link_lv_ger)
|
||||
],
|
||||
[
|
||||
'title' => 'DOC',
|
||||
'permissioncheck' => $permissioncheck,
|
||||
'link' => site_url($link_lv_ger . "&output=doc")
|
||||
],
|
||||
[
|
||||
'title' => 'ODT',
|
||||
'permissioncheck' => $permissioncheck,
|
||||
'link' => site_url($link_lv_ger . "&output=odt")
|
||||
]
|
||||
]
|
||||
],
|
||||
[
|
||||
'title' => $title_eng,
|
||||
'link' => site_url($link_lv_eng),
|
||||
'children' => [
|
||||
[
|
||||
'title' => 'PDF',
|
||||
'permissioncheck' => $permissioncheck,
|
||||
'link' => site_url($link_lv_eng)
|
||||
],
|
||||
[
|
||||
'title' => 'DOC',
|
||||
'permissioncheck' => $permissioncheck,
|
||||
'link' => site_url($link_lv_eng . "&output=doc")
|
||||
],
|
||||
[
|
||||
'title' => 'ODT',
|
||||
'permissioncheck' => $permissioncheck,
|
||||
'link' => site_url($link_lv_eng . "&output=odt")
|
||||
]
|
||||
]
|
||||
]
|
||||
]
|
||||
]
|
||||
]
|
||||
],
|
||||
[
|
||||
'title' => '<i class="fas fa-archive" title="' . $this->p->t("stv", "document_archive") . '"></i>',
|
||||
'children' => [
|
||||
[
|
||||
'title' => $title_ff,
|
||||
'action' => [
|
||||
'url' => site_url($archive_url),
|
||||
'post' => $archive_post_ff,
|
||||
'response' => $archive_response
|
||||
]
|
||||
],
|
||||
[
|
||||
'title' => $title_lv,
|
||||
'children' => [
|
||||
[
|
||||
'title' => $title_ger,
|
||||
'action' => [
|
||||
'url' => site_url($archive_url),
|
||||
'post' => $archive_post_lv_ger,
|
||||
'response' => $archive_response
|
||||
]
|
||||
],
|
||||
[
|
||||
'title' => $title_eng,
|
||||
'action' => [
|
||||
'url' => site_url($archive_url),
|
||||
'post' => $archive_post_lv_eng,
|
||||
'response' => $archive_response
|
||||
]
|
||||
]
|
||||
]
|
||||
]
|
||||
]
|
||||
]
|
||||
];
|
||||
|
||||
return $list;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sort tab list
|
||||
*
|
||||
|
||||
@@ -34,7 +34,7 @@ class LvTermine extends FHCAPI_Controller
|
||||
|
||||
//TODO Build own lib or combine with Controller Stundenplan.php
|
||||
//here use of logic of Stundenplan.php, extended with parameters uid, grouping, and used dbTable
|
||||
public function getStundenplan($uid, $start_date = null, $end_date = null, $groupConsecutiveHours = false, $dbStundenplanTable = "stundenplan")
|
||||
public function getStundenplan($uid, $start_date = null, $end_date = null, $dbStundenplanTable = "stundenplan", $groupConsecutiveHours = false)
|
||||
{
|
||||
$student_uid = $uid;
|
||||
$semester_range = $this->studienSemesterErmitteln($start_date, $end_date);
|
||||
@@ -80,13 +80,6 @@ class LvTermine extends FHCAPI_Controller
|
||||
|
||||
$stundenplan_data = $this->getDataOrTerminateWithError($stundenplan_data) ?? [];
|
||||
$this->terminateWithSuccess($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);
|
||||
}
|
||||
|
||||
public function getStudiensemester()
|
||||
|
||||
@@ -626,7 +626,7 @@ class Students extends FHCAPI_Controller
|
||||
$this->addFilter($studiensemester_kurzbz);
|
||||
|
||||
$result = $this->PrestudentModel->loadWhere($where);
|
||||
|
||||
|
||||
$data = $this->getDataOrTerminateWithError($result);
|
||||
|
||||
$this->terminateWithSuccess($data);
|
||||
@@ -851,40 +851,44 @@ class Students extends FHCAPI_Controller
|
||||
$stdsemEsc = $studiensemester_kurzbz ? $this->PrestudentModel->escape($studiensemester_kurzbz) : 'NULL';
|
||||
|
||||
$this->load->config('stv');
|
||||
$tags = $this->config->item('stv_prestudent_tags');
|
||||
|
||||
$whereTags = '';
|
||||
if (is_array($tags) && !isEmptyArray($tags)) {
|
||||
$tags = array_keys($tags);
|
||||
if(defined('STV_TAGS_ENABLED') && STV_TAGS_ENABLED)
|
||||
{
|
||||
$tags = $this->config->item('stv_prestudent_tags');
|
||||
|
||||
foreach ($tags as $key => $tag) {
|
||||
$tags[$key] = $this->db->escape($tag);
|
||||
$whereTags = '';
|
||||
if (is_array($tags) && !isEmptyArray($tags)) {
|
||||
$tags = array_keys($tags);
|
||||
|
||||
foreach ($tags as $key => $tag) {
|
||||
$tags[$key] = $this->db->escape($tag);
|
||||
}
|
||||
$whereTags = " AND nt.typ_kurzbz IN (" . implode(",", $tags) . ")";
|
||||
}
|
||||
$whereTags = " AND nt.typ_kurzbz IN (" . implode(",", $tags) . ")";
|
||||
$subQueryTag = "
|
||||
(
|
||||
SELECT
|
||||
tag.prestudent_id,
|
||||
COALESCE(json_agg(tag ORDER BY tag.done), '[]'::json) AS tags
|
||||
FROM (
|
||||
SELECT DISTINCT ON (n.notiz_id)
|
||||
n.notiz_id AS id,
|
||||
nt.typ_kurzbz,
|
||||
array_to_json(nt.bezeichnung_mehrsprachig)->>0 AS beschreibung,
|
||||
n.text AS notiz,
|
||||
nt.style,
|
||||
n.erledigt AS done,
|
||||
nz.prestudent_id
|
||||
FROM public.tbl_notizzuordnung AS nz
|
||||
JOIN public.tbl_notiz AS n ON nz.notiz_id = n.notiz_id
|
||||
JOIN public.tbl_notiz_typ AS nt ON n.typ = nt.typ_kurzbz "
|
||||
. $whereTags .
|
||||
"
|
||||
) AS tag
|
||||
GROUP BY tag.prestudent_id
|
||||
) AS tag_data_agg
|
||||
";
|
||||
}
|
||||
$subQueryTag = "
|
||||
(
|
||||
SELECT
|
||||
tag.prestudent_id,
|
||||
COALESCE(json_agg(tag ORDER BY tag.done), '[]'::json) AS tags
|
||||
FROM (
|
||||
SELECT DISTINCT ON (n.notiz_id)
|
||||
n.notiz_id AS id,
|
||||
nt.typ_kurzbz,
|
||||
array_to_json(nt.bezeichnung_mehrsprachig)->>0 AS beschreibung,
|
||||
n.text AS notiz,
|
||||
nt.style,
|
||||
n.erledigt AS done,
|
||||
nz.prestudent_id
|
||||
FROM public.tbl_notizzuordnung AS nz
|
||||
JOIN public.tbl_notiz AS n ON nz.notiz_id = n.notiz_id
|
||||
JOIN public.tbl_notiz_typ AS nt ON n.typ = nt.typ_kurzbz "
|
||||
. $whereTags .
|
||||
"
|
||||
) AS tag
|
||||
GROUP BY tag.prestudent_id
|
||||
) AS tag_data_agg
|
||||
";
|
||||
|
||||
$this->PrestudentModel->addJoin('public.tbl_studiengang stg', 'studiengang_kz', 'LEFT');
|
||||
$this->PrestudentModel->addJoin('public.tbl_person p', 'person_id');
|
||||
@@ -907,11 +911,17 @@ class Students extends FHCAPI_Controller
|
||||
AND ps.studiensemester_kurzbz=public.get_stdsem_prestudent(tbl_prestudent.prestudent_id, ' . $stdsemEsc . ')
|
||||
AND ps.ausbildungssemester=public.get_absem_prestudent(tbl_prestudent.prestudent_id, ' . $stdsemEsc . ')', 'LEFT');
|
||||
|
||||
$this->PrestudentModel->addJoin($subQueryTag, 'tag_data_agg.prestudent_id = tbl_prestudent.prestudent_id', 'LEFT');
|
||||
if(defined('STV_TAGS_ENABLED') && STV_TAGS_ENABLED)
|
||||
{
|
||||
$this->PrestudentModel->addJoin($subQueryTag, 'tag_data_agg.prestudent_id = tbl_prestudent.prestudent_id', 'LEFT');
|
||||
}
|
||||
|
||||
|
||||
$this->PrestudentModel->addSelect("b.uid");
|
||||
$this->PrestudentModel->addSelect('tag_data_agg.tags');
|
||||
if(defined('STV_TAGS_ENABLED') && STV_TAGS_ENABLED)
|
||||
{
|
||||
$this->PrestudentModel->addSelect('tag_data_agg.tags');
|
||||
}
|
||||
$this->PrestudentModel->addSelect('titelpre');
|
||||
$this->PrestudentModel->addSelect('nachname');
|
||||
$this->PrestudentModel->addSelect('vorname');
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2026 fhcomplete.org
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
*/
|
||||
class Admin extends Auth_Controller
|
||||
{
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
// Set required permissions
|
||||
parent::__construct(
|
||||
array(
|
||||
'index' => 'dashboard/admin:rw',
|
||||
'preview' => 'dashboard/admin:r',
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
public function index()
|
||||
{
|
||||
$this->load->view('dashboard/admin.php', []);
|
||||
}
|
||||
|
||||
public function preview($dashboard_kurzbz = 'CIS')
|
||||
{
|
||||
$this->load->view('dashboard/preview.php', [
|
||||
'dashboard_kurzbz' => $dashboard_kurzbz
|
||||
]);
|
||||
}
|
||||
}
|
||||
@@ -1,76 +0,0 @@
|
||||
<?php
|
||||
defined('BASEPATH') || exit('No direct script access allowed');
|
||||
|
||||
class Api extends Auth_Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct(
|
||||
array(
|
||||
'index' => 'dashboard/admin:rw',
|
||||
'getNews' => 'dashboard/benutzer:r',
|
||||
'getAmpeln' => 'dashboard/benutzer:r',
|
||||
)
|
||||
);
|
||||
|
||||
$this->load->library('AuthLib', null, 'AuthLib');
|
||||
|
||||
$this->_setAuthUID();
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
echo 'Dashboard API Controller';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get News.
|
||||
*/
|
||||
public function getNews()
|
||||
{
|
||||
$limit = $this->input->get('limit');
|
||||
|
||||
$this->load->model('content/News_model', 'NewsModel');
|
||||
|
||||
$result = $this->NewsModel->getAll($limit);
|
||||
|
||||
if (hasData($result))
|
||||
{
|
||||
$this->outputJson(getData($result), REST_Controller::HTTP_OK);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->terminateWithJsonError('fehler entdeckt');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get Ampeln.
|
||||
*/
|
||||
public function getAmpeln()
|
||||
{
|
||||
|
||||
$this->load->model('content/Ampel_model', 'AmpelModel');
|
||||
$result = $this->AmpelModel->getByUser($this->_uid);
|
||||
|
||||
if (hasData($result))
|
||||
{
|
||||
$this->outputJson(getData($result), REST_Controller::HTTP_OK);
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->terminateWithJsonError('fehler entdeckt');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve the UID of the logged user and checks if it is valid
|
||||
*/
|
||||
private function _setAuthUID()
|
||||
{
|
||||
$this->_uid = getAuthUID();
|
||||
|
||||
if (!$this->_uid) show_error('User authentification failed');
|
||||
}
|
||||
}
|
||||
@@ -1,216 +0,0 @@
|
||||
<?php
|
||||
defined('BASEPATH') || exit('No direct script access allowed');
|
||||
/**
|
||||
* Description of Config
|
||||
*
|
||||
* @author bambi
|
||||
*/
|
||||
class Config extends Auth_Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct(
|
||||
array(
|
||||
'index' => 'dashboard/benutzer:r',
|
||||
'dummy' => 'dashboard/benutzer:r',
|
||||
'genWidgetId' => 'dashboard/benutzer:rw',
|
||||
'addWidgetsToPreset' => 'dashboard/admin:rw',
|
||||
'removeWidgetFromPreset' => 'dashboard/admin:rw',
|
||||
'addWidgetsToUserOverride' => 'dashboard/benutzer:rw',
|
||||
'removeWidgetFromUserOverride' => 'dashboard/benutzer:rw',
|
||||
'funktionen' => 'dashboard/admin:r',
|
||||
'preset' => 'dashboard/admin:r',
|
||||
'presetBatch' => 'dashboard/admin:r'
|
||||
)
|
||||
);
|
||||
|
||||
$this->load->library('dashboard/DashboardLib', null, 'DashboardLib');
|
||||
$this->load->library('AuthLib', null, 'AuthLib');
|
||||
$this->load->model('ressource/Funktion_model', 'FunktionModel');
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
$dashboard_kurzbz = $this->input->get('db');
|
||||
$uid = $this->AuthLib->getAuthObj()->username;
|
||||
|
||||
$dashboard = $this->DashboardLib->getDashboardByKurzbz($dashboard_kurzbz);
|
||||
if(!$dashboard) {
|
||||
http_response_code(404);
|
||||
$this->terminateWithJsonError(array(
|
||||
'error' => 'Dashboard ' . $dashboard_kurzbz . ' not found.'
|
||||
));
|
||||
}
|
||||
|
||||
$mergedconfig = $this->DashboardLib->getMergedConfig($dashboard->dashboard_id, $uid);
|
||||
$this->outputJsonSuccess($mergedconfig);
|
||||
}
|
||||
|
||||
public function genWidgetId()
|
||||
{
|
||||
$dashboard_kurzbz = $this->input->get('db');
|
||||
$widgetid = $this->DashboardLib->generateWidgetId($dashboard_kurzbz);
|
||||
$this->outputJsonSuccess(array(
|
||||
'widgetid' => $widgetid
|
||||
));
|
||||
}
|
||||
|
||||
public function addWidgetsToPreset()
|
||||
{
|
||||
$input = json_decode($this->input->raw_input_stream);
|
||||
$dashboard_kurzbz = $input->db;
|
||||
$funktion_kurzbz = $input->funktion_kurzbz;
|
||||
|
||||
$preset = $this->DashboardLib->getPresetOrCreateEmptyPreset($dashboard_kurzbz, $funktion_kurzbz);
|
||||
|
||||
$preset_decoded = json_decode($preset->preset, true);
|
||||
|
||||
$this->DashboardLib->addWidgetsToWidgets($preset_decoded, $dashboard_kurzbz, $funktion_kurzbz, $input->widgets);
|
||||
|
||||
$preset->preset = json_encode($preset_decoded);
|
||||
|
||||
$result = $this->DashboardLib->insertOrUpdatePreset($preset);
|
||||
if (isError($result)) {
|
||||
http_response_code(500);
|
||||
$this->terminateWithJsonError('preset could not be saved');
|
||||
}
|
||||
|
||||
$this->outputJsonSuccess(array('msg' => 'preset successfully stored.', 'data' => $preset_decoded));
|
||||
}
|
||||
|
||||
public function removeWidgetFromPreset()
|
||||
{
|
||||
$input = json_decode($this->input->raw_input_stream);
|
||||
$dashboard_kurzbz = $input->db;
|
||||
$funktion_kurzbz = $input->funktion_kurzbz;
|
||||
$widgetid = $input->widgetid;
|
||||
|
||||
$preset = $this->DashboardLib->getPreset($dashboard_kurzbz, $funktion_kurzbz);
|
||||
if ($preset === null) {
|
||||
http_response_code(404);
|
||||
$this->terminateWithJsonError('preset for dashboard ' . $dashboard_kurzbz . ' and funktion ' . $funktion_kurzbz . ' not found.');
|
||||
}
|
||||
|
||||
$preset_decoded = json_decode($preset->preset, true);
|
||||
if (!$this->DashboardLib->removeWidgetFromWidgets($preset_decoded, $funktion_kurzbz, $widgetid))
|
||||
{
|
||||
http_response_code(404);
|
||||
$this->terminateWithJsonError('widgetid ' . $widgetid . ' not found');
|
||||
}
|
||||
|
||||
$preset->preset = json_encode($preset_decoded);
|
||||
$result = $this->DashboardLib->insertOrUpdatePreset($preset);
|
||||
if (isError($result))
|
||||
{
|
||||
http_response_code(500);
|
||||
$this->terminateWithJsonError('failed to remove widget');
|
||||
}
|
||||
$this->outputJsonSuccess(array('msg' => 'preset successfully updated.'));
|
||||
}
|
||||
|
||||
public function addWidgetsToUserOverride()
|
||||
{
|
||||
$input = json_decode($this->input->raw_input_stream);
|
||||
$dashboard_kurzbz = $input->db;
|
||||
$funktion_kurzbz = $input->funktion_kurzbz;
|
||||
$uid = $this->AuthLib->getAuthObj()->username;
|
||||
|
||||
$override = $this->DashboardLib->getOverrideOrCreateEmptyOverride($dashboard_kurzbz, $uid);
|
||||
|
||||
$override_decoded = json_decode($override->override, true);
|
||||
|
||||
$this->DashboardLib->addWidgetsToWidgets($override_decoded, $dashboard_kurzbz, $funktion_kurzbz, $input->widgets);
|
||||
|
||||
$override->override = json_encode($override_decoded);
|
||||
|
||||
$result = $this->DashboardLib->insertOrUpdateOverride($override);
|
||||
if (isError($result)) {
|
||||
http_response_code(500);
|
||||
$this->terminateWithJsonError('override could not be saved');
|
||||
}
|
||||
|
||||
$this->outputJsonSuccess(array('msg' => 'override successfully stored.', 'data' => $override_decoded));
|
||||
}
|
||||
|
||||
public function removeWidgetFromUserOverride()
|
||||
{
|
||||
$input = json_decode($this->input->raw_input_stream);
|
||||
$dashboard_kurzbz = $input->db;
|
||||
$funktion_kurzbz = $input->funktion_kurzbz;
|
||||
$uid = $this->AuthLib->getAuthObj()->username;
|
||||
$widgetid = $input->widgetid;
|
||||
|
||||
$override = $this->DashboardLib->getOverride($dashboard_kurzbz, $uid);
|
||||
if (empty($override)) {
|
||||
http_response_code(404);
|
||||
$this->terminateWithJsonError('userconfig for dashboard ' . $dashboard_kurzbz . ' not found.');
|
||||
}
|
||||
|
||||
$override_decoded = json_decode($override->override, true);
|
||||
|
||||
if (!$this->DashboardLib->removeWidgetFromWidgets($override_decoded, $funktion_kurzbz, $widgetid))
|
||||
{
|
||||
http_response_code(404);
|
||||
$this->terminateWithJsonError('widgetid ' . $widgetid . ' not found');
|
||||
}
|
||||
|
||||
$override->override = json_encode($override_decoded);
|
||||
$result = $this->DashboardLib->insertOrUpdateOverride($override, $uid);
|
||||
if (isError($result))
|
||||
{
|
||||
http_response_code(500);
|
||||
$this->terminateWithJsonError('failed to remove widget');
|
||||
}
|
||||
$this->outputJsonSuccess(array('msg' => 'override successfully updated.'));
|
||||
}
|
||||
|
||||
public function funktionen()
|
||||
{
|
||||
$funktionen = $this->FunktionModel->load();
|
||||
|
||||
if (isError($funktionen)) {
|
||||
http_response_code(404);
|
||||
$this->terminateWithJsonError([
|
||||
'error' => getError($funktionen)
|
||||
]);
|
||||
}
|
||||
|
||||
return $this->outputJsonSuccess(getData($funktionen) ?: []);
|
||||
}
|
||||
|
||||
public function preset()
|
||||
{
|
||||
$db = $this->input->get('db');
|
||||
$funktion = $this->input->get('funktion');
|
||||
|
||||
$conf = $this->DashboardLib->getPreset($db, $funktion);
|
||||
|
||||
if (!$conf)
|
||||
return $this->outputJsonSuccess(['widgets' => [$funktion => []]]);
|
||||
|
||||
return $this->outputJsonSuccess(json_decode($conf->preset, true));
|
||||
}
|
||||
|
||||
public function presetBatch()
|
||||
{
|
||||
$db = $this->input->get('db');
|
||||
$funktionen = $this->input->get('funktionen');
|
||||
$result = [];
|
||||
|
||||
foreach ($funktionen as $funktion) {
|
||||
$conf = $this->DashboardLib->getPreset($db, $funktion);
|
||||
if ($conf)
|
||||
{
|
||||
$preset = json_decode($conf->preset, true);
|
||||
if (!isset($preset[$funktion]) || !isset($preset[$funktion]['widgets']))
|
||||
$result[$funktion] = [];
|
||||
else
|
||||
$result[$funktion] = $preset[$funktion]['widgets'];
|
||||
}
|
||||
else
|
||||
$result[$funktion] = [];
|
||||
}
|
||||
|
||||
return $this->outputJsonSuccess($result);
|
||||
}
|
||||
}
|
||||
@@ -1,86 +0,0 @@
|
||||
<?php
|
||||
defined('BASEPATH') || exit('No direct script access allowed');
|
||||
/**
|
||||
* Description of Widget
|
||||
*
|
||||
* @author chris
|
||||
*/
|
||||
class Dashboard extends Auth_Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct(
|
||||
array(
|
||||
'index' => 'dashboard/admin:r',
|
||||
'create' => 'dashboard/admin:rw',
|
||||
'update' => 'dashboard/admin:rw',
|
||||
'delete' => 'dashboard/admin:rw'
|
||||
)
|
||||
);
|
||||
|
||||
$this->load->library('dashboard/DashboardLib', null, 'DashboardLib');
|
||||
$this->load->model('dashboard/Dashboard_model', 'DashboardModel');
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
$result = $this->DashboardModel->load();
|
||||
|
||||
if (isError($result)) {
|
||||
http_response_code(404);
|
||||
$this->terminateWithJsonError([
|
||||
'error' => getError($result)
|
||||
]);
|
||||
}
|
||||
|
||||
return $this->outputJsonSuccess(getData($result) ?: []);
|
||||
}
|
||||
|
||||
public function create()
|
||||
{
|
||||
$input = $this->getPostJSON();
|
||||
|
||||
$result = $this->DashboardModel->insert($input);
|
||||
|
||||
if (isError($result)) {
|
||||
http_response_code(404);
|
||||
$this->terminateWithJsonError([
|
||||
'error' => getError($result)
|
||||
]);
|
||||
}
|
||||
|
||||
return $this->outputJsonSuccess(getData($result) ?: []);
|
||||
}
|
||||
|
||||
public function update()
|
||||
{
|
||||
$input = $this->getPostJSON();
|
||||
|
||||
$result = $this->DashboardModel->update($input->dashboard_id, $input);
|
||||
|
||||
if (isError($result)) {
|
||||
http_response_code(404);
|
||||
$this->terminateWithJsonError([
|
||||
'error' => getError($result)
|
||||
]);
|
||||
}
|
||||
|
||||
return $this->outputJsonSuccess(getData($result) ?: []);
|
||||
}
|
||||
|
||||
public function delete()
|
||||
{
|
||||
$input = $this->getPostJSON();
|
||||
|
||||
$result = $this->DashboardModel->delete($input->dashboard_id);
|
||||
|
||||
if (isError($result)) {
|
||||
http_response_code(404);
|
||||
$this->terminateWithJsonError([
|
||||
'error' => getError($result)
|
||||
]);
|
||||
}
|
||||
|
||||
return $this->outputJsonSuccess(getData($result) ?: []);
|
||||
}
|
||||
}
|
||||
@@ -1,58 +0,0 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
*/
|
||||
class DashboardDemo extends Auth_Controller
|
||||
{
|
||||
private $_uid; // uid of the logged user
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
// Set required permissions
|
||||
parent::__construct(
|
||||
array(
|
||||
'index' => 'dashboard/benutzer:r',
|
||||
'admin' => 'dashboard/admin:rw'
|
||||
)
|
||||
);
|
||||
|
||||
$this->load->library('AuthLib');
|
||||
$this->load->library('WidgetLib');
|
||||
|
||||
$this->_setAuthUID(); // sets property uid
|
||||
|
||||
$this->setControllerId(); // sets the controller id
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
public function index()
|
||||
{
|
||||
$this->load->view('dashboard/dashboard_demo.php', []);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
// Public methods
|
||||
public function admin()
|
||||
{
|
||||
$this->load->view('dashboard/dashboard_demo_admin.php', []);
|
||||
}
|
||||
|
||||
// -----------------------------------------------------------------------------------------------------------------
|
||||
// Private methods
|
||||
|
||||
/**
|
||||
* Retrieve the UID of the logged user and checks if it is valid
|
||||
*/
|
||||
private function _setAuthUID()
|
||||
{
|
||||
$this->_uid = getAuthUID();
|
||||
|
||||
if (!$this->_uid) show_error('User authentification failed');
|
||||
}
|
||||
}
|
||||
@@ -1,134 +0,0 @@
|
||||
<?php
|
||||
defined('BASEPATH') || exit('No direct script access allowed');
|
||||
/**
|
||||
* Description of Widget
|
||||
*
|
||||
* @author chris
|
||||
*/
|
||||
class Widget extends Auth_Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct(
|
||||
array(
|
||||
'index' => ['dashboard/benutzer:r', 'dashboard/admin:r'],
|
||||
'getAll' => 'dashboard/admin:r',
|
||||
'getWidgetsForDashboard' => ['dashboard/benutzer:rw', 'dashboard/admin:r'],
|
||||
'setAllowed' => 'dashboard/admin:rw'
|
||||
)
|
||||
);
|
||||
|
||||
$this->load->library('dashboard/DashboardLib', null, 'DashboardLib');
|
||||
$this->load->model('dashboard/Widget_model', 'WidgetModel');
|
||||
$this->load->model('dashboard/Dashboard_Widget_model', 'DashboardWidgetModel');
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
$widget_id = $this->input->get('id');
|
||||
|
||||
$widget = $this->WidgetModel->load($widget_id);
|
||||
|
||||
if (isError($widget) || !getData($widget))
|
||||
return $this->outputJsonSuccess([
|
||||
"widget_id" => 0,
|
||||
"widget_kurzbz" => "notfound",
|
||||
"arguments" => [
|
||||
"className" => 'alert-danger',
|
||||
"title" => 'Widget Not Found',
|
||||
"msg" => 'The widget with the id ' . $widget_id . ' could not be found'
|
||||
],
|
||||
"setup" => [
|
||||
"name" => 'Widget Not Found',
|
||||
"file" => absoluteJsImportUrl('public/js/components/DashboardWidget/Default.js'),
|
||||
"width" => 1,
|
||||
"height" => 1
|
||||
]
|
||||
]);
|
||||
|
||||
$widget = current(getData($widget));
|
||||
$widget->arguments = json_decode($widget->arguments);
|
||||
$tmpsetup = json_decode($widget->setup);
|
||||
$tmpsetup->file = absoluteJsImportUrl($tmpsetup->file);
|
||||
$widget->setup = $tmpsetup;
|
||||
|
||||
return $this->outputJsonSuccess($widget);
|
||||
}
|
||||
|
||||
public function getAll()
|
||||
{
|
||||
$dashboard_id = $this->input->get('dashboard_id');
|
||||
$result = $this->WidgetModel->getWithAllowedForDashboard($dashboard_id);
|
||||
|
||||
if (isError($result))
|
||||
return $this->outputJsonError(getError($result));
|
||||
|
||||
$tmpwidgets = getData($result) ?: [];
|
||||
$widgets = array_map(function($widget) {
|
||||
$widget->arguments = json_decode($widget->arguments);
|
||||
$tmpsetup = json_decode($widget->setup);
|
||||
$tmpsetup->file = absoluteJsImportUrl($tmpsetup->file);
|
||||
$widget->setup = $tmpsetup;
|
||||
return $widget;
|
||||
}, $tmpwidgets);
|
||||
|
||||
$this->outputJsonSuccess($widgets);
|
||||
}
|
||||
|
||||
public function getWidgetsForDashboard()
|
||||
{
|
||||
$db = $this->input->get('db');
|
||||
$result = $this->WidgetModel->getForDashboard($db);
|
||||
|
||||
if (isError($result)) {
|
||||
http_response_code(404);
|
||||
$this->terminateWithJsonError([
|
||||
'error' => getError($result)
|
||||
]);
|
||||
}
|
||||
|
||||
$tmpwidgets = getData($result) ?: [];
|
||||
$widgets = array_map(function($widget) {
|
||||
$widget->arguments = json_decode($widget->arguments);
|
||||
$tmpsetup = json_decode($widget->setup);
|
||||
$tmpsetup->file = absoluteJsImportUrl($tmpsetup->file);
|
||||
$widget->setup = $tmpsetup;
|
||||
return $widget;
|
||||
}, $tmpwidgets);
|
||||
|
||||
$this->outputJsonSuccess($widgets);
|
||||
}
|
||||
|
||||
public function setAllowed()
|
||||
{
|
||||
$input = $this->getPostJSON();
|
||||
|
||||
$dashboard_id = $input->dashboard_id;
|
||||
$widget_id = $input->widget_id;
|
||||
$action = $input->action;
|
||||
|
||||
if ($action == 'add') {
|
||||
$result = $this->DashboardWidgetModel->insert([
|
||||
'dashboard_id' => $dashboard_id,
|
||||
'widget_id' => $widget_id
|
||||
]);
|
||||
} elseif ($action == 'delete') {
|
||||
$result = $this->DashboardWidgetModel->delete([
|
||||
'dashboard_id' => $dashboard_id,
|
||||
'widget_id' => $widget_id
|
||||
]);
|
||||
} else {
|
||||
http_response_code(404); // TODO(chris): 400?
|
||||
$this->terminateWithJsonError([
|
||||
'error' => 'action value invalid'
|
||||
]);
|
||||
}
|
||||
if (isError($result)) {
|
||||
http_response_code(404);
|
||||
$this->terminateWithJsonError([
|
||||
'error' => getError($result)
|
||||
]);
|
||||
}
|
||||
return $this->outputJsonSuccess(getData($result));
|
||||
}
|
||||
}
|
||||
@@ -495,6 +495,10 @@ class AbgabetoolJob extends JOB_Controller
|
||||
// get all new or changed termine in interval
|
||||
$result = $this->_ci->PaabgabeModel->findAbgabenNewOrUpdatedSince($interval, $relevantTypes);
|
||||
$retval = getData($result);
|
||||
if(!$retval) {
|
||||
$this->_ci->logInfo("Keine Emails an Betreuer über neue oder veränderte Termine versandt");
|
||||
return;
|
||||
}
|
||||
|
||||
// group changed/new abgaben for projektarbeiten
|
||||
$projektarbeiten = [];
|
||||
@@ -557,6 +561,8 @@ class AbgabetoolJob extends JOB_Controller
|
||||
$anredeFillString = $data->anrede == "Herr" ? "r" : "";
|
||||
$fullFormattedNameString = $data->first;
|
||||
|
||||
$relevantCounter = 0; // workaround to check if a betreuer needs to have any notification about relevant
|
||||
// abgaben at all to avoid sending empty emails since we filter on certain conditions
|
||||
forEach($tupelArr as $tupel) {
|
||||
$projektarbeit_id = $tupel[0];
|
||||
$betreuerRow = $tupel[1];
|
||||
@@ -575,6 +581,8 @@ class AbgabetoolJob extends JOB_Controller
|
||||
continue;
|
||||
}
|
||||
|
||||
$relevantCounter++;
|
||||
|
||||
// format the Student Name
|
||||
$s = $relevantAbgaben[0];
|
||||
$nameParts = [];
|
||||
@@ -633,6 +641,11 @@ class AbgabetoolJob extends JOB_Controller
|
||||
// done with building the change list, now send it
|
||||
$betreuerRow = $tupelArr[0][1];
|
||||
|
||||
if($relevantCounter == 0) {
|
||||
$this->_ci->logInfo('No Relevant Abgaben to notify Betreuer PersonID: "'.$betreuerRow->person_id.'".');
|
||||
continue;
|
||||
}
|
||||
|
||||
$path = $this->_ci->config->item('URL_MITARBEITER');
|
||||
$url = CIS_ROOT.$path;
|
||||
|
||||
|
||||
@@ -0,0 +1,188 @@
|
||||
<?php
|
||||
|
||||
if (!defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Helper function to generate the default documentslist config for the
|
||||
* grades tab.
|
||||
*
|
||||
* The resulting array consists of elements which are associative arrays
|
||||
* that can have the following entries:
|
||||
* title (required) on the first level this can be HTML code.
|
||||
* permissioncheck (optional) an URL to an FHCAPI endpoint which returns
|
||||
* true or false.
|
||||
* link (optional) an URL that will be called if "action" and
|
||||
* "children" are not defined.
|
||||
* action (optional) an associative array that describes an
|
||||
* POST action that will be called if "children" is
|
||||
* not defined.
|
||||
* It can have the following entries:
|
||||
* - url (required) an URL to an FHCAPI endpoint.
|
||||
* - post (optional) an associative array with the POST data to
|
||||
* be sent.
|
||||
* - response (optional) a string that will be displayed on success.
|
||||
* children (optional) an array of child elements
|
||||
*
|
||||
* All strings that start with { and end with } in the URLs and the
|
||||
* actions post parameter will be replaced with the corresponding
|
||||
* attribute of the current dataset (e.G: {uid} will be replaced with the
|
||||
* uid of the current dataset)
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function gradesDocumentsList()
|
||||
{
|
||||
$ci =& get_instance();
|
||||
$ci->load->library('PhrasesLib', array('stv'), 'p');
|
||||
|
||||
$permissioncheck = site_url("api/frontend/v1/documents/permissionAlternativeFormat/{studiengang_kz}");
|
||||
|
||||
$title_ger = $ci->p->t("global", "deutsch");
|
||||
$title_eng = $ci->p->t("global", "englisch");
|
||||
$title_ff = $ci->p->t("stv", "document_certificate");
|
||||
$title_lv = $ci->p->t("stv", "document_coursecertificate");
|
||||
|
||||
$link_ff = "documents/export/" .
|
||||
"zertifikat.rdf.php/" .
|
||||
"Zertifikat" .
|
||||
"?stg_kz={studiengang_kz_lv}" .
|
||||
"&uid={uid}" .
|
||||
"&ss={studiensemester_kurzbz}" .
|
||||
"&lvid={lehrveranstaltung_id}";
|
||||
$link_lv_ger = "documents/export/" .
|
||||
"lehrveranstaltungszeugnis.rdf.php/" .
|
||||
"LVZeugnis" .
|
||||
"?stg_kz={studiengang_kz}" .
|
||||
"&uid={uid}" .
|
||||
"&ss={studiensemester_kurzbz}" .
|
||||
"&lvid={lehrveranstaltung_id}";
|
||||
$link_lv_eng = "documents/export/" .
|
||||
"lehrveranstaltungszeugnis.rdf.php/" .
|
||||
"LVZeugnisEng" .
|
||||
"?stg_kz={studiengang_kz}" .
|
||||
"&uid={uid}" .
|
||||
"&ss={studiensemester_kurzbz}" .
|
||||
"&lvid={lehrveranstaltung_id}";
|
||||
|
||||
$archive_url = "api/frontend/v1/documents/archiveSigned";
|
||||
$archive_response = $ci->p->t("stv", "document_signed_and_archived");
|
||||
$archive_post_ff = [
|
||||
"xml" => "zertifikat.rdf.php",
|
||||
"xsl" => "Zertifikat",
|
||||
"stg_kz" => "{studiengang_kz_lv}",
|
||||
"uid" => "{uid}",
|
||||
"ss" => "{studiensemester_kurzbz}",
|
||||
"lvid" => "{lehrveranstaltung_id}"
|
||||
];
|
||||
$archive_post_lv_ger = [
|
||||
"xml" => "lehrveranstaltungszeugnis.rdf.php",
|
||||
"xsl" => "LVZeugnis",
|
||||
"stg_kz" => "{studiengang_kz}",
|
||||
"uid" => "{uid}",
|
||||
"ss" => "{studiensemester_kurzbz}",
|
||||
"lvid" => "{lehrveranstaltung_id}"
|
||||
];
|
||||
$archive_post_lv_eng = [
|
||||
"xml" => "lehrveranstaltungszeugnis.rdf.php",
|
||||
"xsl" => "LVZeugnisEng",
|
||||
"stg_kz" => "{studiengang_kz}",
|
||||
"uid" => "{uid}",
|
||||
"ss" => "{studiensemester_kurzbz}",
|
||||
"lvid" => "{lehrveranstaltung_id}"
|
||||
];
|
||||
|
||||
$list = [
|
||||
[
|
||||
'title' => '<i class="fa fa-download" title="' . $ci->p->t("stv", "document_download") . '"></i>',
|
||||
'children' => [
|
||||
[
|
||||
'title' => $title_ff,
|
||||
'link' => site_url($link_ff)
|
||||
],
|
||||
[
|
||||
'title' => $title_lv,
|
||||
'children' => [
|
||||
[
|
||||
'title' => $title_ger,
|
||||
'link' => site_url($link_lv_ger),
|
||||
'children' => [
|
||||
[
|
||||
'title' => 'PDF',
|
||||
'permissioncheck' => $permissioncheck,
|
||||
'link' => site_url($link_lv_ger)
|
||||
],
|
||||
[
|
||||
'title' => 'DOC',
|
||||
'permissioncheck' => $permissioncheck,
|
||||
'link' => site_url($link_lv_ger . "&output=doc")
|
||||
],
|
||||
[
|
||||
'title' => 'ODT',
|
||||
'permissioncheck' => $permissioncheck,
|
||||
'link' => site_url($link_lv_ger . "&output=odt")
|
||||
]
|
||||
]
|
||||
],
|
||||
[
|
||||
'title' => $title_eng,
|
||||
'link' => site_url($link_lv_eng),
|
||||
'children' => [
|
||||
[
|
||||
'title' => 'PDF',
|
||||
'permissioncheck' => $permissioncheck,
|
||||
'link' => site_url($link_lv_eng)
|
||||
],
|
||||
[
|
||||
'title' => 'DOC',
|
||||
'permissioncheck' => $permissioncheck,
|
||||
'link' => site_url($link_lv_eng . "&output=doc")
|
||||
],
|
||||
[
|
||||
'title' => 'ODT',
|
||||
'permissioncheck' => $permissioncheck,
|
||||
'link' => site_url($link_lv_eng . "&output=odt")
|
||||
]
|
||||
]
|
||||
]
|
||||
]
|
||||
]
|
||||
]
|
||||
],
|
||||
[
|
||||
'title' => '<i class="fas fa-archive" title="' . $ci->p->t("stv", "document_archive") . '"></i>',
|
||||
'children' => [
|
||||
[
|
||||
'title' => $title_ff,
|
||||
'action' => [
|
||||
'url' => site_url($archive_url),
|
||||
'post' => $archive_post_ff,
|
||||
'response' => $archive_response
|
||||
]
|
||||
],
|
||||
[
|
||||
'title' => $title_lv,
|
||||
'children' => [
|
||||
[
|
||||
'title' => $title_ger,
|
||||
'action' => [
|
||||
'url' => site_url($archive_url),
|
||||
'post' => $archive_post_lv_ger,
|
||||
'response' => $archive_response
|
||||
]
|
||||
],
|
||||
[
|
||||
'title' => $title_eng,
|
||||
'action' => [
|
||||
'url' => site_url($archive_url),
|
||||
'post' => $archive_post_lv_eng,
|
||||
'response' => $archive_response
|
||||
]
|
||||
]
|
||||
]
|
||||
]
|
||||
]
|
||||
]
|
||||
];
|
||||
|
||||
return $list;
|
||||
}
|
||||
@@ -111,9 +111,7 @@ function generateJSDataStorageObject($indexPage, $calledPath, $calledMethod)
|
||||
'theme' => [
|
||||
'name'=>$ci->config->item('theme_name'),
|
||||
'modes'=>$ci->config->item('theme_modes'),
|
||||
],
|
||||
'fhcomplete_build_version' => $ci->config->item('fhcomplete_build_version'),
|
||||
'use_fhcomplete_build_version_in_path' => $ci->config->item('use_fhcomplete_build_version_in_path'),
|
||||
]
|
||||
);
|
||||
|
||||
$toPrint = "\n";
|
||||
@@ -180,8 +178,6 @@ function generateJSModulesInclude($JSModules)
|
||||
|
||||
$ci =& get_instance();
|
||||
$cachetoken = '?'.$ci->config->item('fhcomplete_build_version');
|
||||
$ci->load->config('javascript');
|
||||
$use_bundled_javascript = $ci->config->item('use_bundled_javascript');
|
||||
|
||||
if (isset($JSModules))
|
||||
{
|
||||
@@ -189,20 +185,14 @@ function generateJSModulesInclude($JSModules)
|
||||
|
||||
for ($tmpJSsCounter = 0; $tmpJSsCounter < count($tmpJSs); $tmpJSsCounter++)
|
||||
{
|
||||
$item = $tmpJSs[$tmpJSsCounter];
|
||||
if($use_bundled_javascript && preg_match('#/js/apps/#', $item))
|
||||
{
|
||||
$item = preg_replace('#^public/#', 'public/dist/', $item);
|
||||
}
|
||||
echo "<!--{$item}-->".PHP_EOL;
|
||||
if($ci->config->item('use_fhcomplete_build_version_in_path'))
|
||||
{
|
||||
$relurl = preg_replace('#public/#', 'public/' . $ci->config->item('fhcomplete_build_version') . '/', $item);
|
||||
$relurl = preg_replace('#public/#', 'public/' . $ci->config->item('fhcomplete_build_version') . '/', $tmpJSs[$tmpJSsCounter]);
|
||||
$toPrint = sprintf($jsInclude, base_url($relurl)).PHP_EOL;
|
||||
}
|
||||
else
|
||||
{
|
||||
$toPrint = sprintf($jsInclude, base_url($item.$cachetoken)).PHP_EOL;
|
||||
$toPrint = sprintf($jsInclude, base_url($tmpJSs[$tmpJSsCounter].$cachetoken)).PHP_EOL;
|
||||
}
|
||||
|
||||
if ($tmpJSsCounter > 0) $toPrint = "\t\t".$toPrint;
|
||||
|
||||
@@ -42,7 +42,7 @@ class ExtensionsLib
|
||||
// Directories that are part of the extension archive
|
||||
private $SOFTLINK_TARGET_DIRECTORIES = array(
|
||||
APPPATH => array('config', 'components', 'controllers', 'helpers', 'hooks', 'libraries', 'models', 'views', 'widgets'),
|
||||
DOC_ROOT => array('public', 'public/dist')
|
||||
DOC_ROOT => array('public')
|
||||
);
|
||||
|
||||
private $_errorOccurred; // boolean, true if an error occurred while installing an extension
|
||||
|
||||
@@ -17,7 +17,12 @@ class LektorLib
|
||||
$this->_ci->load->model('organisation/Organisationseinheit_model', 'OrganisationseinheitModel');
|
||||
$this->_ci->load->model('ressource/mitarbeiter_model', 'MitarbeiterModel');
|
||||
$this->_ci->load->model('person/Benutzer_model', 'BenutzerModel');
|
||||
$this->_ci->load->model('ressource/Zeitsperre_model', 'ZeitsperreModel');
|
||||
$this->_ci->load->model('ressource/Reservierung_model', 'ReservierungModel');
|
||||
$this->_ci->load->model('ressource/stundenplandev_model', 'StundenplandevModel');
|
||||
|
||||
$this->_ci->load->library('PhrasesLib', array('lehre'));
|
||||
$this->_ci->load->library('VariableLib', ['uid' => getAuthUID()]);
|
||||
}
|
||||
|
||||
public function addLektorToLehreinheit($lehreinheit_id, $mitarbeiter_uid)
|
||||
@@ -78,10 +83,13 @@ class LektorLib
|
||||
|
||||
public function updateLektorFromLehreinheit($lehreinheit_id, $mitarbeiter_uid, $new_data)
|
||||
{
|
||||
$old_uid = $mitarbeiter_uid;
|
||||
$new_uid = isset($new_data['mitarbeiter_uid']) ? $new_data['mitarbeiter_uid'] : $mitarbeiter_uid;
|
||||
|
||||
$this->_ci->LehreinheitmitarbeiterModel->addSelect('lehre.tbl_lehreinheitmitarbeiter.*, lehre.tbl_lehreinheit.studiensemester_kurzbz, tbl_lehrveranstaltung.studiengang_kz');
|
||||
$this->_ci->LehreinheitmitarbeiterModel->addJoin('lehre.tbl_lehreinheit', 'lehreinheit_id');
|
||||
$this->_ci->LehreinheitmitarbeiterModel->addJoin('lehre.tbl_lehrveranstaltung', 'lehrveranstaltung_id');
|
||||
$lehreinheit_result = $this->_ci->LehreinheitmitarbeiterModel->loadWhere(array('lehreinheit_id' => $lehreinheit_id, 'mitarbeiter_uid' => $mitarbeiter_uid));
|
||||
$lehreinheit_result = $this->_ci->LehreinheitmitarbeiterModel->loadWhere(array('lehreinheit_id' => $lehreinheit_id, 'mitarbeiter_uid' => $old_uid));
|
||||
|
||||
if (isError($lehreinheit_result)) return $lehreinheit_result;
|
||||
|
||||
@@ -89,27 +97,47 @@ class LektorLib
|
||||
|
||||
$lehreinheit = getData($lehreinheit_result)[0];
|
||||
|
||||
$semesterstunden_alt = $lehreinheit->semesterstunden;
|
||||
$semesterstunden_neu = isset($new_data['semesterstunden']) ? $new_data['semesterstunden'] : $semesterstunden_alt;
|
||||
$bismelden_neu = isset($new_data['bismelden']) ? $new_data['bismelden'] : $lehreinheit->bismelden;
|
||||
$neue_stunden_eingerechnet = (bool)$bismelden_neu;
|
||||
$alte_stunden_eingerechnet = (bool)$lehreinheit->bismelden;
|
||||
$stundenplan_update = false;
|
||||
|
||||
//TODO kollision check, wird vorerst nicht implementiert -> nur über das FAS möglich
|
||||
if (isset($new_data['mitarbeiter_uid']) && $new_data['mitarbeiter_uid'] !== $mitarbeiter_uid)
|
||||
if ($old_uid !== $new_uid)
|
||||
{
|
||||
$this->_ci->load->model('ressource/stundenplandev_model', 'StundenplandevModel');
|
||||
$this->_ci->StundenplandevModel->addGroupBy('stundenplandev_id');
|
||||
$this->_ci->StundenplandevModel->addGroupBy('mitarbeiter_uid');
|
||||
$this->_ci->StundenplandevModel->addGroupBy('mitarbeiter_uid');
|
||||
$verplant = $this->_ci->StundenplandevModel->loadWhere(array('lehreinheit_id' => $lehreinheit_id, 'mitarbeiter_uid' => $mitarbeiter_uid));
|
||||
|
||||
if (hasData($verplant))
|
||||
return error($this->_ci->phraseslib->t("lehre", "lektorbereitsverplant"));
|
||||
|
||||
$lehreinheit_data = $this->_ci->LehreinheitmitarbeiterModel->loadWhere(array('mitarbeiter_uid' => $new_data['mitarbeiter_uid'], 'lehreinheit_id' => $lehreinheit_id));
|
||||
$lehreinheit_data = $this->_ci->LehreinheitmitarbeiterModel->loadWhere(array('mitarbeiter_uid' => $new_uid, 'lehreinheit_id' => $lehreinheit_id));
|
||||
|
||||
if (hasData($lehreinheit_data))
|
||||
return error($this->_ci->phraseslib->t("lehre", "bereitzugeteilt"));
|
||||
|
||||
$this->_ci->StundenplandevModel->addGroupBy('stundenplandev_id');
|
||||
$this->_ci->StundenplandevModel->addGroupBy('mitarbeiter_uid');
|
||||
$verplant = $this->_ci->StundenplandevModel->loadWhere(array('lehreinheit_id' => $lehreinheit_id, 'mitarbeiter_uid' => $old_uid));
|
||||
|
||||
if (hasData($verplant))
|
||||
{
|
||||
$kollision = $this->hasKollision(getData($verplant), $new_uid);
|
||||
|
||||
$ignore_kollision = $this->_ci->variablelib->getVar('ignore_kollision');
|
||||
|
||||
if ($kollision === false || $ignore_kollision == 'true')
|
||||
{
|
||||
$stundenplan_update = true;
|
||||
}
|
||||
else if (is_array($kollision))
|
||||
{
|
||||
return error( "Änderung fehlgeschlagen! Die Änderung des Lektors führt zu ".count($kollision)." Kollision(en) im LV-Plan. Deaktivieren Sie die Kollisionspruefung oder wenden Sie sich an die LV-Planung!\n zB. $kollision[0]");
|
||||
}
|
||||
else
|
||||
{
|
||||
return error($kollision);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$warning = '';
|
||||
if (isset($new_data['semesterstunden']))
|
||||
if (($semesterstunden_neu !== '' && $semesterstunden_alt !== '') && (($semesterstunden_neu > $semesterstunden_alt) || $neue_stunden_eingerechnet))
|
||||
{
|
||||
$studiengang_result = $this->_ci->StudiengangModel->loadWhere(array('studiengang_kz' => $lehreinheit->studiengang_kz));
|
||||
if (isError($studiengang_result)) return $studiengang_result;
|
||||
@@ -120,7 +148,7 @@ class LektorLib
|
||||
if (isError($studiensemester_result)) return $studiensemester_result;
|
||||
$studiensemester = getData($studiensemester_result)[0];
|
||||
|
||||
$echter_dv_result = $this->_ci->DienstverhaeltnisModel->existsDienstverhaeltnis($mitarbeiter_uid, $studiensemester->start, $studiensemester->ende, 'echterdv');
|
||||
$echter_dv_result = $this->_ci->DienstverhaeltnisModel->existsDienstverhaeltnis($new_uid, $studiensemester->start, $studiensemester->ende, 'echterdv');
|
||||
|
||||
$echter_dv = false;
|
||||
|
||||
@@ -129,83 +157,78 @@ class LektorLib
|
||||
$echter_dv = true;
|
||||
}
|
||||
|
||||
$neue_stunden_eingerechnet = isset($new_data['bismelden']) ? $new_data['bismelden'] : $lehreinheit->bismelden;
|
||||
$alte_stunden_eingerechnet = $lehreinheit->bismelden;
|
||||
$stundengrenze_result = $this->_ci->OrganisationseinheitModel->getStundengrenze($studiengang->oe_kurzbz, $echter_dv);
|
||||
if (isError($stundengrenze_result)) return $stundengrenze_result;
|
||||
|
||||
if (($new_data['semesterstunden'] > $lehreinheit->semesterstunden) || $neue_stunden_eingerechnet)
|
||||
$stundengrenze = getData($stundengrenze_result)[0];
|
||||
|
||||
$oe_result = $this->_ci->OrganisationseinheitModel->getChilds($stundengrenze->oe_kurzbz);
|
||||
$oe_array = hasData($oe_result) ? array_column(getData($oe_result), 'oe_kurzbz') : array();
|
||||
|
||||
if ($alte_stunden_eingerechnet && $neue_stunden_eingerechnet)
|
||||
$this->_ci->LehreinheitmitarbeiterModel->addSelect("(SUM(tbl_lehreinheitmitarbeiter.semesterstunden) - ($semesterstunden_alt) + {$this->_ci->LehreinheitmitarbeiterModel->db->escape($semesterstunden_neu)}) as summe");
|
||||
else if ($alte_stunden_eingerechnet && !$neue_stunden_eingerechnet)
|
||||
$this->_ci->LehreinheitmitarbeiterModel->addSelect("(SUM(tbl_lehreinheitmitarbeiter.semesterstunden) - ($semesterstunden_alt)) as summe");
|
||||
else if (!$alte_stunden_eingerechnet && $neue_stunden_eingerechnet)
|
||||
$this->_ci->LehreinheitmitarbeiterModel->addSelect("(SUM(tbl_lehreinheitmitarbeiter.semesterstunden) + ({$this->_ci->LehreinheitmitarbeiterModel->db->escape($semesterstunden_neu)})) as summe");
|
||||
else if (!$alte_stunden_eingerechnet && !$neue_stunden_eingerechnet)
|
||||
$this->_ci->LehreinheitmitarbeiterModel->addSelect("(SUM(tbl_lehreinheitmitarbeiter.semesterstunden)) as summe");
|
||||
|
||||
$this->_ci->LehreinheitmitarbeiterModel->addJoin('lehre.tbl_lehreinheit', 'lehreinheit_id');
|
||||
$this->_ci->LehreinheitmitarbeiterModel->addJoin('lehre.tbl_lehrveranstaltung', 'lehrveranstaltung_id');
|
||||
$this->_ci->LehreinheitmitarbeiterModel->addJoin('public.tbl_studiengang', 'studiengang_kz');
|
||||
|
||||
$this->_ci->LehreinheitmitarbeiterModel->db->where('mitarbeiter_uid', $new_uid);
|
||||
$this->_ci->LehreinheitmitarbeiterModel->db->where('studiensemester_kurzbz', $lehreinheit->studiensemester_kurzbz);
|
||||
$this->_ci->LehreinheitmitarbeiterModel->db->where('bismelden', true);
|
||||
$this->_ci->LehreinheitmitarbeiterModel->db->where('lower(mitarbeiter_uid) NOT LIKE', '_dummy%');
|
||||
|
||||
if (count($oe_array) > 0)
|
||||
{
|
||||
$stundengrenze_result = $this->_ci->OrganisationseinheitModel->getStundengrenze($studiengang->oe_kurzbz, $echter_dv);
|
||||
if (isError($stundengrenze_result)) return $stundengrenze_result;
|
||||
|
||||
$stundengrenze = getData($stundengrenze_result)[0];
|
||||
|
||||
$oe_result = $this->_ci->OrganisationseinheitModel->getChilds($stundengrenze->oe_kurzbz);
|
||||
$oe_array = hasData($oe_result) ? array_column(getData($oe_result), 'oe_kurzbz') : array('');
|
||||
|
||||
if ($alte_stunden_eingerechnet && $neue_stunden_eingerechnet)
|
||||
$this->_ci->LehreinheitmitarbeiterModel->addSelect("(SUM(tbl_lehreinheitmitarbeiter.semesterstunden) - ($lehreinheit->semesterstunden) + {$this->_ci->LehreinheitmitarbeiterModel->db->escape($new_data['semesterstunden'])}) as summe");
|
||||
else if ($alte_stunden_eingerechnet && !$neue_stunden_eingerechnet)
|
||||
$this->_ci->LehreinheitmitarbeiterModel->addSelect("(SUM(tbl_lehreinheitmitarbeiter.semesterstunden) - ($lehreinheit->semesterstunden)) as summe");
|
||||
else if (!$alte_stunden_eingerechnet && $neue_stunden_eingerechnet)
|
||||
$this->_ci->LehreinheitmitarbeiterModel->addSelect("(SUM(tbl_lehreinheitmitarbeiter.semesterstunden) + ({$this->_ci->LehreinheitmitarbeiterModel->db->escape($new_data['semesterstunden'])})) as summe");
|
||||
else if (!$alte_stunden_eingerechnet && !$neue_stunden_eingerechnet)
|
||||
$this->_ci->LehreinheitmitarbeiterModel->addSelect("(SUM(tbl_lehreinheitmitarbeiter.semesterstunden)) as summe");
|
||||
|
||||
$this->_ci->LehreinheitmitarbeiterModel->addJoin('lehre.tbl_lehreinheit', 'lehreinheit_id');
|
||||
$this->_ci->LehreinheitmitarbeiterModel->addJoin('lehre.tbl_lehrveranstaltung', 'lehrveranstaltung_id');
|
||||
$this->_ci->LehreinheitmitarbeiterModel->addJoin('public.tbl_studiengang', 'studiengang_kz');
|
||||
|
||||
$this->_ci->LehreinheitmitarbeiterModel->db->where('mitarbeiter_uid', (isset($new_data['mitarbeiter_uid']) ? $new_data['mitarbeiter_uid'] : $mitarbeiter_uid));
|
||||
$this->_ci->LehreinheitmitarbeiterModel->db->where('studiensemester_kurzbz', $lehreinheit->studiensemester_kurzbz);
|
||||
$this->_ci->LehreinheitmitarbeiterModel->db->where('bismelden', true);
|
||||
$this->_ci->LehreinheitmitarbeiterModel->db->where('lower(mitarbeiter_uid) NOT LIKE', '_dummy%');
|
||||
|
||||
$this->_ci->LehreinheitmitarbeiterModel->db->where_in('tbl_studiengang.oe_kurzbz', $oe_array);
|
||||
}
|
||||
|
||||
if(defined('FAS_LV_LEKTORINNENZUTEILUNG_STUNDEN_IGNORE_OE')
|
||||
&& is_array(FAS_LV_LEKTORINNENZUTEILUNG_STUNDEN_IGNORE_OE)
|
||||
&& count(FAS_LV_LEKTORINNENZUTEILUNG_STUNDEN_IGNORE_OE) > 0)
|
||||
{
|
||||
$this->_ci->LehreinheitmitarbeiterModel->db->where_not_in('tbl_studiengang.oe_kurzbz', FAS_LV_LEKTORINNENZUTEILUNG_STUNDEN_IGNORE_OE);
|
||||
}
|
||||
|
||||
if(defined('FAS_LV_LEKTORINNENZUTEILUNG_STUNDEN_IGNORE_OE')
|
||||
&& is_array(FAS_LV_LEKTORINNENZUTEILUNG_STUNDEN_IGNORE_OE)
|
||||
&& count(FAS_LV_LEKTORINNENZUTEILUNG_STUNDEN_IGNORE_OE) > 0)
|
||||
$summe_result = $this->_ci->LehreinheitmitarbeiterModel->load();
|
||||
|
||||
if (isError($summe_result)) return $summe_result;
|
||||
|
||||
if (!hasData($summe_result)) return error('Fehler beim Ermitteln der Gesamtstunden');
|
||||
|
||||
$summe = getData($summe_result)[0]->summe;
|
||||
|
||||
if ($summe > $stundengrenze->stunden)
|
||||
{
|
||||
if (!$echter_dv && (!$this->_ci->permissionlib->isBerechtigt('admin')))
|
||||
{
|
||||
$this->_ci->LehreinheitmitarbeiterModel->db->where_not_in('tbl_studiengang.oe_kurzbz', FAS_LV_LEKTORINNENZUTEILUNG_STUNDEN_IGNORE_OE);
|
||||
if (!$this->LehrauftragAufFirma($new_uid))
|
||||
return error("ACHTUNG: Die maximal erlaubte Semesterstundenanzahl des Lektors von $summe Stunden ($stundengrenze->stunden) wurde ueberschritten!\nDaten wurden NICHT gespeichert!\n\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
$warning .= "ACHTUNG: Die maximal erlaubte Semesterstundenanzahl des Lektors von $summe Stunden ($stundengrenze->stunden) wurde ueberschritten!\nDaten wurden gespeichert!\n\n";
|
||||
}
|
||||
|
||||
$summe_result = $this->_ci->LehreinheitmitarbeiterModel->load();
|
||||
$stunden_limit_result = $this->getStundenInstitut($new_uid, $lehreinheit->studiensemester_kurzbz, $oe_array);
|
||||
|
||||
if (isError($summe_result)) return $summe_result;
|
||||
|
||||
if (!hasData($summe_result)) return error('Fehler beim Ermitteln der Gesamtstunden');
|
||||
|
||||
$summe = getData($summe_result)[0]->summe;
|
||||
|
||||
if ($summe > $stundengrenze->stunden)
|
||||
if (hasData($stunden_limit_result))
|
||||
{
|
||||
|
||||
if (!$echter_dv && (!$this->_ci->permissionlib->isBerechtigt('admin')))
|
||||
$stunden_limit_array = getData($stunden_limit_result);
|
||||
foreach ($stunden_limit_array as $stunden_limit)
|
||||
{
|
||||
if (!$this->LehrauftragAufFirma(isset($formData['mitarbeiter_uid']) ? $formData['mitarbeiter_uid'] : $mitarbeiter_uid))
|
||||
return error("ACHTUNG: Die maximal erlaubte Semesterstundenanzahl des Lektors von $summe Stunden ($stundengrenze->stunden) wurde ueberschritten!\nDaten wurden NICHT gespeichert!\n\n");
|
||||
}
|
||||
else
|
||||
{
|
||||
$warning .= "ACHTUNG: Die maximal erlaubte Semesterstundenanzahl des Lektors von $summe Stunden ($stundengrenze->stunden) wurde ueberschritten!\nDaten wurden gespeichert!\n\n";
|
||||
}
|
||||
|
||||
$stunden_limit_result = $this->getStundenInstitut($mitarbeiter_uid, $lehreinheit->studiensemester_kurzbz, $oe_array);
|
||||
|
||||
if (hasData($stunden_limit_result))
|
||||
{
|
||||
$stunden_limit_array = getData($stunden_limit_result);
|
||||
foreach ($stunden_limit_array as $stunden_limit)
|
||||
{
|
||||
$warning .= $stunden_limit->summe . ' Stunden ' . $stunden_limit->bezeichnung . "\n";
|
||||
}
|
||||
$warning .= $stunden_limit->summe . ' Stunden ' . $stunden_limit->bezeichnung . "\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$benutzer_result = $this->_ci->BenutzerModel->load(array(isset($formData['mitarbeiter_uid']) ? $formData['mitarbeiter_uid'] : $mitarbeiter_uid));
|
||||
$benutzer_result = $this->_ci->BenutzerModel->load(array($new_uid));
|
||||
|
||||
if (isError($benutzer_result)) return $benutzer_result;
|
||||
|
||||
@@ -227,12 +250,23 @@ class LektorLib
|
||||
'bismelden'
|
||||
);
|
||||
|
||||
$nullable_fields = array('stundensatz', 'semesterstunden', 'planstunden');
|
||||
|
||||
$updateData = array();
|
||||
foreach ($updatableFields as $field)
|
||||
{
|
||||
$value = isset($new_data[$field]) ? $new_data[$field] : null;
|
||||
if (!array_key_exists($field, $new_data))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
if ($value !== null)
|
||||
$value = $new_data[$field];
|
||||
|
||||
if (in_array($field, $nullable_fields))
|
||||
{
|
||||
$updateData[$field] = $value;
|
||||
}
|
||||
elseif ($value !== null)
|
||||
{
|
||||
$updateData[$field] = $value;
|
||||
}
|
||||
@@ -240,10 +274,24 @@ class LektorLib
|
||||
$updateData['updatevon'] = getAuthUID();
|
||||
$updateData['updateamum'] = date('Y-m-d H:i:s');
|
||||
|
||||
$result = $this->_ci->LehreinheitmitarbeiterModel->update(array('lehreinheit_id' => $lehreinheit_id, 'mitarbeiter_uid' => $mitarbeiter_uid), $updateData);
|
||||
$result = $this->_ci->LehreinheitmitarbeiterModel->update(array('lehreinheit_id' => $lehreinheit_id, 'mitarbeiter_uid' => $old_uid), $updateData);
|
||||
|
||||
if (isError($result)) return $result;
|
||||
|
||||
if ($stundenplan_update)
|
||||
{
|
||||
$update_result = $this->_ci->StundenplandevModel->update([
|
||||
'lehreinheit_id' => $lehreinheit_id,
|
||||
'mitarbeiter_uid' => $old_uid,
|
||||
], [
|
||||
'mitarbeiter_uid' => $new_uid,
|
||||
'updateamum' => date('Y-m-d H:i:s'),
|
||||
'updatevon' => getAuthUID()
|
||||
]);
|
||||
|
||||
if (isError($update_result)) return $update_result;
|
||||
}
|
||||
|
||||
if ($warning !== '') return success(['warning' => $warning]);
|
||||
|
||||
return success('Erfolgreich geupdated');
|
||||
@@ -347,4 +395,52 @@ class LektorLib
|
||||
$this->_ci->LehreinheitmitarbeiterModel->addGroupBy('tbl_studiengang.bezeichnung');
|
||||
return $this->_ci->LehreinheitmitarbeiterModel->load();
|
||||
}
|
||||
|
||||
private function hasKollision($stunden, $mitarbeiter)
|
||||
{
|
||||
$kollision = array();
|
||||
|
||||
$ignore_zeitsperre = $this->_ci->variablelib->getVar('ignore_zeitsperre');
|
||||
$ignore_reservierung = $this->_ci->variablelib->getVar('ignore_reservierung');
|
||||
|
||||
foreach ($stunden as $stunde)
|
||||
{
|
||||
$stundenplan_result = $this->_ci->StundenplandevModel->lektorHasStundenplandevEintrag($mitarbeiter, $stunde->datum, $stunde->stunde);
|
||||
|
||||
if (isError($stundenplan_result))
|
||||
return $stundenplan_result;
|
||||
|
||||
if (hasData($stundenplan_result))
|
||||
{
|
||||
$stundenplan_result = getData($stundenplan_result)[0];
|
||||
$kollision[] = "Kollision stundenplandev: $stundenplan_result->stundenplandev_id|$stundenplan_result->lektor|$stundenplan_result->ort_kurzbz|$stundenplan_result->stg_kurzbz-$stundenplan_result->semester$stundenplan_result->verband$stundenplan_result->gruppe$stundenplan_result->gruppe_kurzbz - $stundenplan_result->datum/$stundenplan_result->stunde";
|
||||
}
|
||||
else
|
||||
{
|
||||
if ($ignore_zeitsperre == 'false' && (!defined('KOLLISIONSFREIE_USER') || !in_array($mitarbeiter, unserialize(KOLLISIONSFREIE_USER))))
|
||||
{
|
||||
$zeitsperre_result = $this->_ci->ZeitsperreModel->checkIfZeitsperreExists($mitarbeiter, $stunde->datum, $stunde->stunde);
|
||||
|
||||
if (hasData($zeitsperre_result))
|
||||
{
|
||||
$zeitsperre_result = getData($zeitsperre_result)[0];
|
||||
$kollision[] = "Kollision (Zeitsperre): $zeitsperre_result->zeitsperre_id|$zeitsperre_result->mitarbeiter_uid|$zeitsperre_result->zeitsperretyp_kurzbz - $zeitsperre_result->vondatum/$zeitsperre_result->vonstunde|$zeitsperre_result->bisdatum/$zeitsperre_result->bisstunde";
|
||||
}
|
||||
}
|
||||
|
||||
if ($ignore_reservierung == 'false' && (!defined('KOLLISIONSFREIE_USER') || !in_array($mitarbeiter, unserialize(KOLLISIONSFREIE_USER))))
|
||||
{
|
||||
$reservierung_result = $this->_ci->ReservierungModel->lektorHasReservierung($mitarbeiter, $stunde->datum, $stunde->stunde);
|
||||
|
||||
if (hasData($reservierung_result))
|
||||
{
|
||||
$reservierung_result = getData($reservierung_result)[0];
|
||||
$kollision[] = "Kollision (Reservierung): $reservierung_result->reservierung_id|$reservierung_result->uid|$reservierung_result->ort_kurzbz|$reservierung_result->stg_kurzbz-$reservierung_result->semester$reservierung_result->verband$reservierung_result->gruppe$reservierung_result->gruppe_kurzbz - $reservierung_result->datum/$reservierung_result->stunde";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return isEmptyArray($kollision) ? false : $kollision;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -50,6 +50,7 @@ class PermissionLib
|
||||
const LOGINAS_PERSONIDS_BLACKLIST = 'permission_loginas_personids_blacklist';
|
||||
|
||||
private $_ci; // CI instance
|
||||
private $access_rights; // current users access rights
|
||||
private static $bb; // benutzerberechtigung
|
||||
|
||||
/**
|
||||
@@ -61,6 +62,8 @@ class PermissionLib
|
||||
// Loads CI instance
|
||||
$this->_ci =& get_instance();
|
||||
|
||||
$this->access_rights = null;
|
||||
|
||||
$this->_ci->config->load('permission'); // Loads permission configuration
|
||||
|
||||
// If it's NOT called from command line
|
||||
@@ -69,8 +72,10 @@ class PermissionLib
|
||||
// API Caller rights initialization
|
||||
$authObj = $this->_ci->authlib->getAuthObj();
|
||||
self::$bb = new benutzerberechtigung();
|
||||
if ($authObj)
|
||||
if ($authObj) {
|
||||
self::$bb->getBerechtigungen($authObj->{AuthLib::AO_USERNAME});
|
||||
$this->access_rights = self::$bb->berechtigungen;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -340,6 +345,16 @@ class PermissionLib
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the access rights for the current user
|
||||
*
|
||||
* @return array|null
|
||||
*/
|
||||
public function getAccessRights()
|
||||
{
|
||||
return $this->access_rights;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------------------------------------------
|
||||
// Private methods
|
||||
|
||||
|
||||
@@ -181,6 +181,21 @@ class StundenplanLib
|
||||
return success($stundenplan_data);
|
||||
}
|
||||
|
||||
public function getEventsByLE($lehreinheit_id, $start, $end, $stundenplan)
|
||||
{
|
||||
$this->_ci =& get_instance();
|
||||
|
||||
$this->_ci->load->model('ressource/Stundenplan_model', 'StundenplanModel');
|
||||
return $this->_ci->StundenplanModel->getStundenplanLE($lehreinheit_id, $start, $end, $stundenplan);
|
||||
}
|
||||
|
||||
public function getEventsByLV($lehrveranstaltung_id, $start, $end, $stundenplan)
|
||||
{
|
||||
$this->_ci =& get_instance();
|
||||
|
||||
$this->_ci->load->model('ressource/Stundenplan_model', 'StundenplanModel');
|
||||
return $this->_ci->StundenplanModel->getStundenplanLV($lehrveranstaltung_id, $start, $end, $stundenplan);
|
||||
}
|
||||
/**
|
||||
* Get stundenplan for a room
|
||||
*
|
||||
|
||||
@@ -49,7 +49,7 @@ class DashboardLib
|
||||
|
||||
public function getMergedConfig($dashboard_id, $uid)
|
||||
{
|
||||
$defaultconfig = $this->getDefaultConfig($dashboard_id, $uid);
|
||||
$defaultconfig = $this->getDefaultConfig($dashboard_id);
|
||||
$userconfig = $this->getUserConfig($dashboard_id, $uid);
|
||||
|
||||
$mergedconfig = array_replace_recursive($defaultconfig, $userconfig);
|
||||
@@ -57,14 +57,31 @@ class DashboardLib
|
||||
return $mergedconfig;
|
||||
}
|
||||
|
||||
public function getDefaultConfig($dashboard_id, $uid)
|
||||
public function getDefaultConfig($dashboard_id)
|
||||
{
|
||||
$res_presets = $this->_ci->DashboardPresetModel->getPresets($dashboard_id, $uid);
|
||||
$funktion_kurzbzs = [];
|
||||
$rights = $this->_ci->permissionlib->getAccessRights();
|
||||
if ($rights)
|
||||
$funktion_kurzbzs = array_unique(array_map(function ($right) {
|
||||
return $right->funktion_kurzbz;
|
||||
}, $rights));
|
||||
|
||||
$this->_ci->DashboardPresetModel->db
|
||||
->group_start()
|
||||
->where_in('funktion_kurzbz', $funktion_kurzbzs)
|
||||
->or_where('funktion_kurzbz IS NULL')
|
||||
->group_end();
|
||||
|
||||
$this->_ci->DashboardPresetModel->addOrder('funktion_kurzbz', 'DESC');
|
||||
|
||||
$result = $this->_ci->DashboardPresetModel->loadWhere([
|
||||
'dashboard_id' => $dashboard_id
|
||||
]);
|
||||
$defaultconfig = array();
|
||||
|
||||
if (hasData($res_presets))
|
||||
if (hasData($result))
|
||||
{
|
||||
$presets = getData($res_presets);
|
||||
$presets = getData($result);
|
||||
foreach ($presets as $presetobj)
|
||||
{
|
||||
$preset = json_decode($presetobj->preset, true);
|
||||
@@ -137,8 +154,10 @@ class DashboardLib
|
||||
$dashboard = $this->getDashboardByKurzbz($dashboard_kurzbz);
|
||||
|
||||
$funktion_kurzbz = ($section === self::SECTION_IF_FUNKTION_KURZBZ_IS_NULL) ? null : $section;
|
||||
$result = $this->_ci->DashboardPresetModel
|
||||
->getPresetByDashboardAndFunktion($dashboard->dashboard_id, $funktion_kurzbz);
|
||||
$result = $this->_ci->DashboardPresetModel->loadWhere([
|
||||
'dashboard_id' => $dashboard->dashboard_id,
|
||||
'funktion_kurzbz' => $funktion_kurzbz
|
||||
]);
|
||||
|
||||
if (hasData($result))
|
||||
{
|
||||
@@ -195,11 +214,11 @@ class DashboardLib
|
||||
{
|
||||
foreach ($addwigets as $widget)
|
||||
{
|
||||
if(!isset($widget->widgetid))
|
||||
if(!isset($widget['widgetid']))
|
||||
{
|
||||
$widget->widgetid = $this->generateWidgetId($dashboard_kurzbz);
|
||||
$widget['widgetid'] = $this->generateWidgetId($dashboard_kurzbz);
|
||||
}
|
||||
$this->addWidgetToWidgets($widgets, $section, $widget, $widget->widgetid);
|
||||
$this->addWidgetToWidgets($widgets, $section, $widget, $widget['widgetid']);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -11,57 +11,4 @@ class Dashboard_Preset_model extends DB_Model
|
||||
$this->dbTable = 'dashboard.tbl_dashboard_preset';
|
||||
$this->pk = 'preset_id';
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Presets of given uid.
|
||||
* @param integer dashboard_id
|
||||
* @param string $uid
|
||||
* @return array
|
||||
*/
|
||||
public function getPresets($dashboard_id, $uid)
|
||||
{
|
||||
// TODO: get Funktionen for uid and load all preset for all funktionen for uid
|
||||
//return $this->loadWhere(array('dashboard_id' => $dashboard_id, 'funktion_kurzbz'=> null));
|
||||
$sql = <<<EOSQL
|
||||
SELECT
|
||||
*
|
||||
FROM
|
||||
dashboard.tbl_dashboard_preset
|
||||
WHERE
|
||||
dashboard_id = ?
|
||||
AND (
|
||||
funktion_kurzbz IN (
|
||||
SELECT
|
||||
DISTINCT funktion_kurzbz
|
||||
FROM
|
||||
public.tbl_benutzerfunktion
|
||||
WHERE
|
||||
uid = ?
|
||||
AND
|
||||
NOW()::date
|
||||
BETWEEN
|
||||
COALESCE(datum_von, '1970-01-01')
|
||||
AND
|
||||
COALESCE(datum_bis, '2170-12-31')
|
||||
)
|
||||
OR
|
||||
funktion_kurzbz IS NULL
|
||||
)
|
||||
ORDER BY
|
||||
funktion_kurzbz DESC
|
||||
EOSQL;
|
||||
|
||||
return $this->execQuery($sql, array($dashboard_id, $uid));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Preset by Dashboard and Funktion
|
||||
* @param integer dashboard_id
|
||||
* @param string funktion_kurzbz
|
||||
* @return array
|
||||
*/
|
||||
public function getPresetByDashboardAndFunktion($dashboard_id, $funktion_kurzbz)
|
||||
{
|
||||
return $this->loadWhere(array('dashboard_id' => $dashboard_id, 'funktion_kurzbz' => $funktion_kurzbz));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -52,4 +52,53 @@ class LePruefung_model extends DB_Model
|
||||
'student_uid' => $student_uid
|
||||
]);
|
||||
}
|
||||
|
||||
public function getPruefungenByLvStudiensemester($lv_id, $sem_kurzbz) {
|
||||
$qry = "SELECT tbl_pruefung.*, tbl_lehrveranstaltung.bezeichnung as lehrveranstaltung_bezeichnung, tbl_lehrveranstaltung.lehrveranstaltung_id,
|
||||
tbl_note.bezeichnung as note_bezeichnung, tbl_pruefungstyp.beschreibung as typ_beschreibung, tbl_lehreinheit.studiensemester_kurzbz as studiensemester_kurzbz
|
||||
FROM lehre.tbl_pruefung, lehre.tbl_lehreinheit, lehre.tbl_lehrveranstaltung, lehre.tbl_note, lehre.tbl_pruefungstyp
|
||||
WHERE tbl_pruefung.lehreinheit_id=tbl_lehreinheit.lehreinheit_id
|
||||
AND tbl_lehreinheit.lehrveranstaltung_id=tbl_lehrveranstaltung.lehrveranstaltung_id
|
||||
AND tbl_pruefung.note = tbl_note.note
|
||||
AND tbl_pruefung.pruefungstyp_kurzbz=tbl_pruefungstyp.pruefungstyp_kurzbz
|
||||
AND tbl_lehrveranstaltung.lehrveranstaltung_id = ?
|
||||
AND tbl_lehreinheit.studiensemester_kurzbz = ?
|
||||
ORDER BY datum DESC;";
|
||||
|
||||
return $this->execReadOnlyQuery($qry, array($lv_id, $sem_kurzbz));
|
||||
}
|
||||
|
||||
public function getPruefungenByUidTypLvStudiensemester($uid, $typ = null, $lv_id = null, $sem_kurzbz = null) {
|
||||
$params = [$uid];
|
||||
$qry = "SELECT tbl_pruefung.*, tbl_lehrveranstaltung.bezeichnung as lehrveranstaltung_bezeichnung, tbl_lehrveranstaltung.lehrveranstaltung_id,
|
||||
tbl_note.bezeichnung as note_bezeichnung, tbl_pruefungstyp.beschreibung as typ_beschreibung, tbl_lehreinheit.studiensemester_kurzbz as studiensemester_kurzbz
|
||||
FROM lehre.tbl_pruefung, lehre.tbl_lehreinheit, lehre.tbl_lehrveranstaltung, lehre.tbl_note, lehre.tbl_pruefungstyp
|
||||
WHERE student_uid= ?
|
||||
AND tbl_pruefung.lehreinheit_id=tbl_lehreinheit.lehreinheit_id
|
||||
AND tbl_lehreinheit.lehrveranstaltung_id=tbl_lehrveranstaltung.lehrveranstaltung_id
|
||||
AND tbl_pruefung.note = tbl_note.note
|
||||
AND tbl_pruefung.pruefungstyp_kurzbz=tbl_pruefungstyp.pruefungstyp_kurzbz";
|
||||
if ($typ != null)
|
||||
{
|
||||
$qry .= " AND tbl_pruefungstyp.pruefungstyp_kurzbz = ?";
|
||||
$params[] = $typ;
|
||||
}
|
||||
|
||||
if ($lv_id != null)
|
||||
{
|
||||
$qry .= " AND tbl_lehrveranstaltung.lehrveranstaltung_id = ?";
|
||||
$params[] = $lv_id;
|
||||
}
|
||||
|
||||
if ($sem_kurzbz != null)
|
||||
{
|
||||
$qry .= " AND tbl_lehreinheit.studiensemester_kurzbz = ?";
|
||||
$params[] = $sem_kurzbz;
|
||||
}
|
||||
|
||||
|
||||
$qry .= " ORDER BY datum DESC";
|
||||
|
||||
return $this->execReadOnlyQuery($qry, $params);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -314,6 +314,28 @@ EOSQL;
|
||||
return $this->execQuery($query, $params);
|
||||
}
|
||||
|
||||
public function getAllLehreinheitenForLvaAndMaUid($lva_id, $ma_uid, $sem_kurzbz)
|
||||
{
|
||||
$query = "SELECT DISTINCT tbl_lehreinheitmitarbeiter.lehreinheit_id, tbl_lehreinheit.lehrveranstaltung_id, tbl_lehreinheit.lehrform_kurzbz,
|
||||
tbl_lehreinheitmitarbeiter.mitarbeiter_uid,
|
||||
tbl_lehreinheitgruppe.semester,
|
||||
tbl_lehreinheitgruppe.verband,
|
||||
tbl_lehreinheitgruppe.gruppe,
|
||||
tbl_lehreinheitgruppe.gruppe_kurzbz,
|
||||
tbl_lehrveranstaltung.kurzbz,
|
||||
tbl_studiengang.kurzbzlang,
|
||||
(SELECT COUNT(DISTINCT datum) FROM campus.vw_stundenplan WHERE lehreinheit_id = lehre.tbl_lehreinheit.lehreinheit_id) as termincount,
|
||||
(SELECT COUNT(*) FROM campus.vw_student_lehrveranstaltung WHERE lehreinheit_id = lehre.tbl_lehreinheit.lehreinheit_id) as studentcount
|
||||
FROM lehre.tbl_lehreinheit JOIN lehre.tbl_lehreinheitmitarbeiter USING(lehreinheit_id)
|
||||
JOIN lehre.tbl_lehreinheitgruppe USING(lehreinheit_id)
|
||||
JOIN lehre.tbl_lehrveranstaltung USING(lehrveranstaltung_id)
|
||||
JOIN public.tbl_studiengang ON (tbl_lehreinheitgruppe.studiengang_kz = tbl_studiengang.studiengang_kz)
|
||||
WHERE lehrveranstaltung_id = ? AND studiensemester_kurzbz = ? AND mitarbeiter_uid = ?
|
||||
ORDER BY tbl_lehreinheitgruppe.gruppe_kurzbz";
|
||||
|
||||
return $this->execQuery($query, [$lva_id, $sem_kurzbz, $ma_uid]);
|
||||
}
|
||||
|
||||
|
||||
public function getOes($lehreinheit_id)
|
||||
{
|
||||
|
||||
@@ -341,7 +341,7 @@ class Lehreinheitgruppe_model extends DB_Model
|
||||
$this->db->where('lehreinheit_id', $lehreinheit_id);
|
||||
$this->db->where('studiengang_kz', $gruppen_array->studiengang_kz);
|
||||
|
||||
if (!isEmptyString($gruppen_array->semester))
|
||||
if (!isEmptyString((string)$gruppen_array->semester))
|
||||
{
|
||||
$this->db->where('semester', $gruppen_array->semester);
|
||||
}
|
||||
@@ -444,30 +444,37 @@ class Lehreinheitgruppe_model extends DB_Model
|
||||
)
|
||||
ELSE tbl_gruppe.beschreibung
|
||||
END AS beschreibung");
|
||||
$this->addSelect("CASE
|
||||
WHEN tbl_lehreinheitgruppe.gruppe_kurzbz IS NULL THEN
|
||||
(
|
||||
SELECT EXISTS (
|
||||
SELECT 1
|
||||
FROM lehre.tbl_stundenplandev
|
||||
WHERE lehreinheit_id = tbl_lehreinheitgruppe.lehreinheit_id
|
||||
AND studiengang_kz = tbl_lehreinheitgruppe.studiengang_kz
|
||||
AND semester = tbl_lehreinheitgruppe.semester
|
||||
AND TRIM(COALESCE(verband, '')) = TRIM(tbl_lehreinheitgruppe.verband)
|
||||
AND TRIM(COALESCE(gruppe, '')) = TRIM(tbl_lehreinheitgruppe.gruppe)
|
||||
AND (gruppe_kurzbz IS NULL OR gruppe_kurzbz = '')
|
||||
)
|
||||
)
|
||||
ELSE
|
||||
$this->addSelect("
|
||||
CASE
|
||||
WHEN trim(COALESCE(tbl_lehreinheitgruppe.gruppe_kurzbz, '')) = '' THEN
|
||||
(
|
||||
SELECT EXISTS (
|
||||
SELECT 1
|
||||
FROM lehre.tbl_stundenplandev
|
||||
WHERE lehreinheit_id = tbl_lehreinheitgruppe.lehreinheit_id
|
||||
AND gruppe_kurzbz = tbl_lehreinheitgruppe.gruppe_kurzbz
|
||||
FROM lehre.tbl_stundenplandev sp
|
||||
WHERE sp.lehreinheit_id = tbl_lehreinheitgruppe.lehreinheit_id
|
||||
AND sp.studiengang_kz = tbl_lehreinheitgruppe.studiengang_kz
|
||||
AND sp.semester = tbl_lehreinheitgruppe.semester
|
||||
AND trim(COALESCE(sp.verband, '')) = trim(COALESCE(tbl_lehreinheitgruppe.verband, ''))
|
||||
AND trim(COALESCE(sp.gruppe, '')) = trim(COALESCE(tbl_lehreinheitgruppe.gruppe, ''))
|
||||
AND trim(COALESCE(sp.gruppe_kurzbz, '')) = ''
|
||||
)
|
||||
)
|
||||
END AS verplant");
|
||||
ELSE
|
||||
(
|
||||
SELECT EXISTS (
|
||||
SELECT 1
|
||||
FROM lehre.tbl_stundenplandev sp
|
||||
WHERE sp.lehreinheit_id = tbl_lehreinheitgruppe.lehreinheit_id
|
||||
AND sp.studiengang_kz = tbl_lehreinheitgruppe.studiengang_kz
|
||||
AND sp.semester = tbl_lehreinheitgruppe.semester
|
||||
AND trim(COALESCE(sp.verband, '')) = trim(COALESCE(tbl_lehreinheitgruppe.verband, ''))
|
||||
AND trim(COALESCE(sp.gruppe, '')) = trim(COALESCE(tbl_lehreinheitgruppe.gruppe, ''))
|
||||
AND trim(COALESCE(sp.gruppe_kurzbz, '')) = trim(COALESCE(tbl_lehreinheitgruppe.gruppe_kurzbz, ''))
|
||||
)
|
||||
)
|
||||
END AS verplant
|
||||
");
|
||||
|
||||
$this->addJoin('tbl_studiengang', 'studiengang_kz', 'LEFT');
|
||||
$this->addJoin('public.tbl_gruppe', 'gruppe_kurzbz', 'LEFT');
|
||||
|
||||
|
||||
@@ -317,7 +317,9 @@ class Lehrveranstaltung_model extends DB_Model
|
||||
tbl_bisio.bisio_id, tbl_bisio.von, tbl_bisio.bis, tbl_student.studiengang_kz AS stg_kz_student,
|
||||
tbl_zeugnisnote.note, tbl_mitarbeiter.mitarbeiter_uid, tbl_person.matr_nr, tbl_benutzer.uid,
|
||||
UPPER(tbl_studiengang.typ::varchar(1) || tbl_studiengang.kurzbz) as kuerzel, tbl_studiengang.orgform_kurzbz, vw_student_lehrveranstaltung.semester, vw_student_lehrveranstaltung.studiensemester_kurzbz, vw_student_lehrveranstaltung.bezeichnung,
|
||||
tbl_student.prestudent_id
|
||||
tbl_student.prestudent_id,
|
||||
campus.vw_student_lehrveranstaltung.lehreinheit_id
|
||||
|
||||
FROM
|
||||
campus.vw_student_lehrveranstaltung
|
||||
JOIN public.tbl_benutzer USING(uid)
|
||||
@@ -402,14 +404,17 @@ class Lehrveranstaltung_model extends DB_Model
|
||||
SELECT
|
||||
vorname, nachname, mitarbeiter_uid, lehrfunktion_kurzbz
|
||||
FROM
|
||||
lehre.tbl_lehreinheit
|
||||
lehre.tbl_lehreinheit le
|
||||
JOIN lehre.tbl_lehreinheitmitarbeiter lema USING (lehreinheit_id)
|
||||
JOIN public.tbl_benutzer b ON b.uid = lema.mitarbeiter_uid
|
||||
JOIN public.tbl_person p using (person_id)
|
||||
WHERE
|
||||
tbl_lehreinheit.lehrveranstaltung_id= ?
|
||||
AND tbl_lehreinheit.studiensemester_kurzbz = ?
|
||||
le.lehrveranstaltung_id= ?
|
||||
AND le.studiensemester_kurzbz = ?
|
||||
AND lehrfunktion_kurzbz = 'LV-Leitung'
|
||||
AND lema.mitarbeiter_uid NOT like '_Dummy%'
|
||||
AND b.aktiv = TRUE
|
||||
AND p.aktiv = TRUE
|
||||
ORDER BY
|
||||
lema.insertamum DESC
|
||||
LIMIT 1
|
||||
@@ -1051,6 +1056,26 @@ class Lehrveranstaltung_model extends DB_Model
|
||||
return $this->execQuery($qry, $params);
|
||||
}
|
||||
|
||||
public function getLvForLektorInSemester($sem_kurzbz, $uid) {
|
||||
$qry = "SELECT DISTINCT (tbl_lehrveranstaltung.lehrveranstaltung_id),
|
||||
UPPER(tbl_studiengang.typ::varchar(1) || tbl_studiengang.kurzbz) as stg_kurzbz,
|
||||
tbl_lehrveranstaltung.semester as lv_semester,
|
||||
tbl_lehrveranstaltung.bezeichnung as lv_bezeichnung,
|
||||
(SELECT kurzbz FROM public.tbl_mitarbeiter
|
||||
WHERE mitarbeiter_uid=tbl_lehreinheitmitarbeiter.mitarbeiter_uid) as lektor
|
||||
FROM
|
||||
lehre.tbl_lehreinheit JOIN lehre.tbl_lehreinheitmitarbeiter USING(lehreinheit_id)
|
||||
JOIN lehre.tbl_lehrveranstaltung USING(lehrveranstaltung_id)
|
||||
JOIN public.tbl_studiengang USING(studiengang_kz)
|
||||
JOIN lehre.tbl_lehrveranstaltung as lehrfach ON(tbl_lehreinheit.lehrfach_id=lehrfach.lehrveranstaltung_id)
|
||||
WHERE
|
||||
tbl_lehreinheit.studiensemester_kurzbz = ?
|
||||
AND mitarbeiter_uid = ?
|
||||
ORDER BY stg_kurzbz,lv_semester,lv_bezeichnung";
|
||||
|
||||
return $this->execReadOnlyQuery($qry, array($sem_kurzbz, $uid));
|
||||
}
|
||||
|
||||
public function getLvsByOrganization($oe_kurzbz)
|
||||
{
|
||||
$qry="
|
||||
@@ -1242,7 +1267,7 @@ class Lehrveranstaltung_model extends DB_Model
|
||||
{
|
||||
return "
|
||||
SELECT
|
||||
lehrveranstaltung_id, tbl_lehrveranstaltung.kurzbz as lv_kurzbz, tbl_lehrveranstaltung.bezeichnung as lv_bezeichnung, bezeichnung_english as lv_bezeichnung_english, studiengang_kz,
|
||||
distinct on (lehrveranstaltung_id) lehrveranstaltung_id, tbl_lehrveranstaltung.kurzbz as lv_kurzbz, tbl_lehrveranstaltung.bezeichnung as lv_bezeichnung, bezeichnung_english as lv_bezeichnung_english, studiengang_kz,
|
||||
tbl_studienplan_lehrveranstaltung.semester, tbl_lehrveranstaltung.sprache,
|
||||
ects as lv_ects, semesterstunden, anmerkung, lehre, lehreverzeichnis as lv_lehreverzeichnis, tbl_lehrveranstaltung.aktiv,
|
||||
planfaktor as lv_planfaktor, planlektoren as lv_planlektoren, planpersonalkosten as lv_planpersonalkosten,
|
||||
|
||||
@@ -29,10 +29,14 @@ class Lvgesamtnote_model extends DB_Model
|
||||
$this->addSelect("lv.bezeichnung AS lehrveranstaltung_bezeichnung");
|
||||
$this->addSelect("lv.studiengang_kz");
|
||||
$this->addSelect("UPPER(stg.typ || stg.kurzbz) AS studiengang");
|
||||
$this->addSelect("person.vorname");
|
||||
$this->addSelect("person.nachname");
|
||||
|
||||
$this->addJoin("lehre.tbl_note n", "note");
|
||||
$this->addJoin("lehre.tbl_lehrveranstaltung lv", "lehrveranstaltung_id");
|
||||
$this->addJoin("public.tbl_studiengang stg", "studiengang_kz");
|
||||
$this->addJoin("public.tbl_benutzer benutzer", "uid = student_uid", "LEFT");
|
||||
$this->addJoin("public.tbl_person person", "person_id", "LEFT");
|
||||
|
||||
$this->db->where($this->dbTable . ".freigabedatum <", "NOW()", false);
|
||||
|
||||
|
||||
@@ -149,6 +149,8 @@ class Projektarbeit_model extends DB_Model
|
||||
lehre.tbl_projektarbeit.abstract as abstract,
|
||||
lehre.tbl_projektarbeit.abstract_en as abstract_en,
|
||||
lehre.tbl_projektarbeit.insertamum as insertamum,
|
||||
(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
|
||||
@@ -167,7 +169,7 @@ class Projektarbeit_model extends DB_Model
|
||||
(projekttyp_kurzbz='Bachelor' OR projekttyp_kurzbz='Diplom')
|
||||
AND betreuerart_kurzbz IN ('Betreuer', 'Begutachter', 'Erstbegutachter', 'Senatsvorsitz')) as base
|
||||
ORDER BY insertamum DESC";
|
||||
|
||||
|
||||
return $this->execReadOnlyQuery($betreuerQuery, array($studentUID));
|
||||
}
|
||||
|
||||
@@ -216,13 +218,16 @@ class Projektarbeit_model extends DB_Model
|
||||
}
|
||||
|
||||
public function getProjektbetreuerAnrede($bperson_id) {
|
||||
$qry_betr="SELECT DISTINCT ON(public.tbl_person.person_id) trim(COALESCE(titelpre,'')||' '||COALESCE(vorname,'')||' '||COALESCE(nachname,'')||' '||COALESCE(titelpost,'')) as first, anrede
|
||||
FROM public.tbl_person JOIN lehre.tbl_projektbetreuer ON(lehre.tbl_projektbetreuer.person_id=public.tbl_person.person_id)
|
||||
WHERE public.tbl_person.person_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 getProjektbetreuerEmail($projektarbeit_id) {
|
||||
$qry = "SELECT (
|
||||
SELECT kontakt
|
||||
@@ -244,7 +249,7 @@ class Projektarbeit_model extends DB_Model
|
||||
|
||||
return $this->execReadOnlyQuery($qry, [$projektarbeit_id]);
|
||||
}
|
||||
|
||||
|
||||
public function getProjektbetreuerEmailByPersonID($person_id) {
|
||||
$qry = "SELECT (
|
||||
SELECT kontakt
|
||||
@@ -338,8 +343,8 @@ class Projektarbeit_model extends DB_Model
|
||||
|
||||
return $this->execReadOnlyQuery($qry, array($projektarbeit_id));
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
public function getProjektarbeitenForStudiengang($studiengang_kz, $benotet) {
|
||||
$new_qry = "SELECT DISTINCT ON(tmp.projektarbeit_id) *, campus.get_betreuer_details(tmp.zweitbetreuer_person_id) as zweitbetreuer_full_name, campus.get_betreuer_details(tmp.betreuer_person_id) as erstbetreuer_full_name
|
||||
FROM(
|
||||
@@ -499,20 +504,137 @@ class Projektarbeit_model extends DB_Model
|
||||
OR lehre.tbl_projektbetreuer.betreuerart_kurzbz = 'Senatsvorsitz'
|
||||
)
|
||||
AND public.tbl_studiengang.studiengang_kz = ?";
|
||||
|
||||
|
||||
if($benotet == 0) {
|
||||
$new_qry .= " AND lehre.tbl_projektarbeit.note IS NULL ";
|
||||
} else if ($benotet == 1) {
|
||||
$new_qry .= " AND lehre.tbl_projektarbeit.note IS NOT NULL ";
|
||||
}
|
||||
|
||||
|
||||
$new_qry .= " ORDER BY tbl_projektarbeit.projektarbeit_id DESC, student_person.nachname ASC
|
||||
) as tmp";
|
||||
|
||||
|
||||
return $this->execReadOnlyQuery($new_qry, array($studiengang_kz));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Prüft ob Projektarbeit aktuell ist (also zurzeit online bewertet wird).
|
||||
* @param $projektarbeit_id
|
||||
* @return boolean
|
||||
*/
|
||||
public function projektarbeitIsCurrent($projektarbeit_id) {
|
||||
$version = $this->getVersion($projektarbeit_id);
|
||||
// paarbeit sollte nur ab einem Studiensemester online bewertet werden
|
||||
return $version === null ? null : $version->isCurrent;
|
||||
}
|
||||
|
||||
/**
|
||||
* Holt sich Version der Projektarbeit.
|
||||
* Liefert auch mit, ob die Version die aktuellste ist.
|
||||
* z.B.: Masterarbeiten waren ab der Änderung zur Gewichtung der Punkte aktuell,
|
||||
* Bachelorarbeiten waren ab dem Umstieg auf das Online Beurteilungsformular aktuell.
|
||||
* @param $projektarbeit_id
|
||||
* @return objekt mit Versionsinfo, null im Fehlerfall
|
||||
*/
|
||||
private function getVersion($projektarbeit_id) {
|
||||
$_versions_query = array(
|
||||
'Diplom' => array(
|
||||
'SS2025',
|
||||
'SS2023',
|
||||
'SS2022'
|
||||
),
|
||||
'Others' => array(
|
||||
'SS2025',
|
||||
'SS2022',
|
||||
)
|
||||
);
|
||||
|
||||
$_versions_check = array(
|
||||
'Diplom' => array(
|
||||
'SS2025' => 3,
|
||||
'SS2023' => 2,
|
||||
'SS2022' => 1
|
||||
),
|
||||
'Others' => array(
|
||||
'SS2025' => 2,
|
||||
'SS2022' => 1
|
||||
)
|
||||
);
|
||||
|
||||
// paarbeit sollte nur ab einem Studiensemester online bewertet werden
|
||||
$qry="
|
||||
SELECT
|
||||
CASE
|
||||
WHEN semesters_diplom.studiensemester_kurzbz IS NOT NULL
|
||||
THEN semesters_diplom.studiensemester_kurzbz
|
||||
ELSE semesters.studiensemester_kurzbz
|
||||
END AS version_studiensemester_kurzbz,
|
||||
pa.projekttyp_kurzbz
|
||||
FROM
|
||||
lehre.tbl_projektarbeit pa
|
||||
JOIN lehre.tbl_lehreinheit USING(lehreinheit_id)
|
||||
JOIN public.tbl_studiensemester sem USING(studiensemester_kurzbz)
|
||||
LEFT JOIN (
|
||||
SELECT
|
||||
start, studiensemester_kurzbz
|
||||
FROM
|
||||
public.tbl_studiensemester
|
||||
WHERE
|
||||
studiensemester_kurzbz IN ?
|
||||
) semesters ON sem.start >= semesters.start AND pa.projekttyp_kurzbz <> 'Diplom'
|
||||
LEFT JOIN (
|
||||
SELECT
|
||||
start, studiensemester_kurzbz
|
||||
FROM
|
||||
public.tbl_studiensemester
|
||||
WHERE
|
||||
studiensemester_kurzbz IN ?
|
||||
) semesters_diplom ON sem.start >= semesters_diplom.start AND pa.projekttyp_kurzbz = 'Diplom'
|
||||
WHERE
|
||||
projektarbeit_id = ?
|
||||
ORDER BY
|
||||
semesters.start DESC, semesters_diplom.start DESC
|
||||
LIMIT 1";
|
||||
|
||||
$resultociniBambini = $this->execReadOnlyQuery($qry, array($_versions_query['Others'], $_versions_query['Diplom'], $projektarbeit_id));
|
||||
|
||||
if(hasData($resultociniBambini)) {
|
||||
$data = getData($resultociniBambini);
|
||||
if(count($data) > 0) {
|
||||
$row = $data[0];
|
||||
|
||||
// known project types
|
||||
if (isset($_versions_check[$row->projekttyp_kurzbz][$row->version_studiensemester_kurzbz]))
|
||||
{
|
||||
$row->versionNumber = $_versions_check[$row->projekttyp_kurzbz][$row->version_studiensemester_kurzbz];
|
||||
$row->isCurrent =
|
||||
$_versions_check[$row->projekttyp_kurzbz][$row->version_studiensemester_kurzbz]
|
||||
== max($_versions_check[$row->projekttyp_kurzbz]);
|
||||
|
||||
}
|
||||
elseif (isset($_versions_check['Others'][$row->version_studiensemester_kurzbz]))
|
||||
{
|
||||
$row->versionNumber = $_versions_check['Others'][$row->version_studiensemester_kurzbz];
|
||||
$row->isCurrent =
|
||||
$_versions_check['Others'][$row->version_studiensemester_kurzbz]
|
||||
== max($_versions_check['Others']);
|
||||
}
|
||||
else
|
||||
{
|
||||
$row->isCurrent = false;
|
||||
$row->versionNumber = 0;
|
||||
}
|
||||
return $row;
|
||||
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
*
|
||||
* @param
|
||||
* @return object success or error
|
||||
|
||||
@@ -306,4 +306,5 @@ class Pruefung_model extends DB_Model
|
||||
|
||||
return $this->loadWhereCommitteeExamsFailed();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -148,7 +148,7 @@ class Zeugnisnote_model extends DB_Model
|
||||
*
|
||||
* @return object
|
||||
*/
|
||||
public function getZeugnisnoten($student_uid, $studiensemester_kurzbz)
|
||||
public function getZeugnisnoten($student_uid, $studiensemester_kurzbz, $lehrveranstaltung_id = null)
|
||||
{
|
||||
$params = array();
|
||||
$where='';
|
||||
@@ -163,6 +163,11 @@ class Zeugnisnote_model extends DB_Model
|
||||
$where.=" AND vw_student_lehrveranstaltung.studiensemester_kurzbz= ?";
|
||||
$params[] = $studiensemester_kurzbz;
|
||||
}
|
||||
if($lehrveranstaltung_id != null)
|
||||
{
|
||||
$where .= " AND vw_student_lehrveranstaltung.lehrveranstaltung_id = ?";
|
||||
$params[] = $lehrveranstaltung_id;
|
||||
}
|
||||
|
||||
$where2='';
|
||||
|
||||
@@ -176,6 +181,11 @@ class Zeugnisnote_model extends DB_Model
|
||||
$where2 .= " AND studiensemester_kurzbz= ?";
|
||||
$params[] = $studiensemester_kurzbz;
|
||||
}
|
||||
if($lehrveranstaltung_id != null)
|
||||
{
|
||||
$where2 .=" AND lehrveranstaltung_id = ?";
|
||||
$params[] = $lehrveranstaltung_id;
|
||||
}
|
||||
|
||||
$qry = "SELECT
|
||||
a.*,
|
||||
@@ -188,7 +198,10 @@ class Zeugnisnote_model extends DB_Model
|
||||
lv.semester AS semester_lv,
|
||||
lv.ects AS ects_lv,
|
||||
lv.zeugnis,
|
||||
lv.bezeichnung_english AS lehrveranstaltung_bezeichnung_english
|
||||
lv.bezeichnung_english AS lehrveranstaltung_bezeichnung_english,
|
||||
s.verband,
|
||||
person.vorname,
|
||||
person.nachname
|
||||
FROM (
|
||||
SELECT vw_student_lehrveranstaltung.lehrveranstaltung_id, uid,
|
||||
vw_student_lehrveranstaltung.studiensemester_kurzbz, note, punkte, uebernahmedatum, benotungsdatum,
|
||||
@@ -231,6 +244,8 @@ class Zeugnisnote_model extends DB_Model
|
||||
ORDER BY sort
|
||||
) a
|
||||
LEFT JOIN public.tbl_student s ON (a.uid = s.student_uid)
|
||||
LEFT JOIN public.tbl_benutzer benutzer ON benutzer.uid = s.student_uid
|
||||
LEFT JOIN public.tbl_person person ON benutzer.person_id = person.person_id
|
||||
LEFT JOIN public.tbl_studiengang stg1 ON (s.studiengang_kz = stg1.studiengang_kz)
|
||||
LEFT JOIN lehre.tbl_lehrveranstaltung lv USING (lehrveranstaltung_id)
|
||||
LEFT JOIN public.tbl_studiengang stg2 ON (lv.studiengang_kz = stg2.studiengang_kz)";
|
||||
|
||||
@@ -59,6 +59,37 @@ class Studienplan_model extends DB_Model
|
||||
'tbl_studienplan_lehrveranstaltung.semester' => $semester
|
||||
));
|
||||
}
|
||||
|
||||
public function getStudienplanByLvaSemKurzbz($lehrveranstaltung_id, $studiensemester_kurzbz) {
|
||||
$qry= "
|
||||
SELECT
|
||||
DISTINCT tbl_studienplan.*
|
||||
FROM
|
||||
lehre.tbl_studienplan
|
||||
JOIN lehre.tbl_studienplan_lehrveranstaltung
|
||||
USING(studienplan_id)
|
||||
WHERE
|
||||
tbl_studienplan_lehrveranstaltung.lehrveranstaltung_id IN (
|
||||
SELECT
|
||||
lv.lehrveranstaltung_id
|
||||
FROM
|
||||
lehre.tbl_lehrveranstaltung AS lv
|
||||
LEFT JOIN lehre.tbl_lehrveranstaltung AS t ON t.lehrveranstaltung_id=lv.lehrveranstaltung_template_id
|
||||
WHERE
|
||||
lv.lehrtyp_kurzbz<>'tpl'
|
||||
AND (lv.lehrveranstaltung_id= ? OR (lv.lehrveranstaltung_template_id= ? AND t.lehrtyp_kurzbz='tpl'))
|
||||
)
|
||||
AND EXISTS (
|
||||
SELECT 1
|
||||
FROM
|
||||
lehre.tbl_studienplan_semester
|
||||
WHERE studienplan_id=tbl_studienplan.studienplan_id
|
||||
AND studiensemester_kurzbz= ?
|
||||
AND semester = tbl_studienplan_lehrveranstaltung.semester)
|
||||
ORDER BY bezeichnung";
|
||||
|
||||
return $this->execReadOnlyQuery($qry, array($lehrveranstaltung_id, $lehrveranstaltung_id, $studiensemester_kurzbz));
|
||||
}
|
||||
|
||||
public function getStudienplanLehrveranstaltungForPrestudent($studienplan_id, $semester, $prestudent_id)
|
||||
{
|
||||
|
||||
@@ -261,6 +261,42 @@ class Benutzerfunktion_model extends DB_Model
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Get active Kompetenzfeldleitung bei UID.
|
||||
*
|
||||
* @param $uid
|
||||
* @return array|stdClass|null
|
||||
*/
|
||||
public function getKFLByUID($uid)
|
||||
{
|
||||
$query = '
|
||||
SELECT
|
||||
bf.uid,
|
||||
bf.oe_kurzbz,
|
||||
oe.organisationseinheittyp_kurzbz
|
||||
FROM
|
||||
public.tbl_benutzerfunktion bf
|
||||
JOIN public.tbl_organisationseinheit oe USING (oe_kurzbz)
|
||||
JOIN public.tbl_benutzer b USING (uid)
|
||||
WHERE
|
||||
b.uid = ?
|
||||
AND b.aktiv = TRUE
|
||||
AND funktion_kurzbz = \'Leitung\'
|
||||
AND organisationseinheittyp_kurzbz = \'Kompetenzfeld\'
|
||||
AND (datum_von IS NULL OR datum_von <= now())
|
||||
AND (datum_bis IS NULL OR datum_bis >= now())
|
||||
';
|
||||
|
||||
$parameters_array = array();
|
||||
if (is_string($uid))
|
||||
{
|
||||
$parameters_array[] = $uid;
|
||||
}
|
||||
|
||||
return $this->execQuery($query, $parameters_array);
|
||||
}
|
||||
|
||||
|
||||
public function insertBenutzerfunktion($Json)
|
||||
{
|
||||
unset($Json['benutzerfunktion_id']);
|
||||
|
||||
@@ -206,6 +206,7 @@ class Notiz_model extends DB_Model
|
||||
person_bearbeiter.vorname, person_bearbeiter.nachname
|
||||
";
|
||||
|
||||
|
||||
return $this->execQuery($qry, array($type, $id));
|
||||
}
|
||||
|
||||
|
||||
@@ -135,4 +135,15 @@ class Reservierung_model extends DB_Model
|
||||
return $this->execQuery($query, [$uid, $uid]);
|
||||
}
|
||||
|
||||
public function lektorHasReservierung($uid, $datum, $stunde)
|
||||
{
|
||||
$qry = "SELECT reservierung_id, uid, stg_kurzbz, ort_kurzbz, semester, verband, gruppe, gruppe_kurzbz, datum, stunde
|
||||
FROM lehre.vw_reservierung
|
||||
WHERE uid = ?
|
||||
AND datum = ?
|
||||
AND stunde = ?";
|
||||
|
||||
return $this->execReadOnlyQuery($qry, [$uid, $datum, $stunde]);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -333,6 +333,68 @@ class Stundenplan_model extends DB_Model
|
||||
", [$start_date, $end_date, $lv_id]);
|
||||
}
|
||||
|
||||
public function getStundenplanLE($lehreinheit, $start_date, $end_date, $stundenplan)
|
||||
{
|
||||
$qry = "
|
||||
WITH lehreinheiten AS (
|
||||
SELECT lehreinheit_id FROM lehre.tbl_lehreinheit WHERE lehreinheit_id = ?
|
||||
), " . $this->getStundenplanCTE($stundenplan) . "
|
||||
SELECT *
|
||||
FROM stundenplanentries
|
||||
";
|
||||
|
||||
return $this->execReadOnlyQuery($qry, array($lehreinheit, $start_date, $end_date));
|
||||
}
|
||||
|
||||
public function getStundenplanLV($lehrveranstaltung_id, $start_date, $end_date, $stundenplan)
|
||||
{
|
||||
$qry = "
|
||||
WITH lehreinheiten AS (
|
||||
SELECT lehreinheit_id
|
||||
FROM lehre.tbl_lehreinheit
|
||||
JOIN tbl_studiensemester USING(studiensemester_kurzbz)
|
||||
WHERE lehrveranstaltung_id = ?
|
||||
AND tbl_studiensemester.start >= ? AND tbl_studiensemester.ende <= ?
|
||||
), " . $this->getStundenplanCTE($stundenplan) . "
|
||||
SELECT *
|
||||
FROM stundenplanentries
|
||||
";
|
||||
|
||||
return $this->execReadOnlyQuery($qry, array($lehrveranstaltung_id, $start_date, $end_date, $start_date, $end_date));
|
||||
}
|
||||
|
||||
private function getStundenplanCTE($stundenplan)
|
||||
{
|
||||
return "entries AS (
|
||||
SELECT
|
||||
datum, min(stunde) as stunde_beginn, max(stunde) as stunde_ende,
|
||||
array_agg(DISTINCT(
|
||||
CASE WHEN gruppe_kurzbz is not null THEN gruppe_kurzbz
|
||||
ELSE (UPPER(stg_typ || stg_kurzbz) || COALESCE(semester,'0') || COALESCE(verband,'') || COALESCE(gruppe,''))
|
||||
END)) as gruppen_kuerzel,
|
||||
array_agg(DISTINCT CONCAT(vorname || ' ' || nachname)) as lektorname,
|
||||
array_agg(DISTINCT stundenplan.ort_kurzbz) as ort_kurzbz,
|
||||
array_agg(DISTINCT titel) as titel,
|
||||
lehrfach_bez, stundenplan.lehreinheit_id, lehrveranstaltung_id
|
||||
FROM lehre.vw_$stundenplan as stundenplan
|
||||
JOIN public.tbl_mitarbeiter ON stundenplan.uid = tbl_mitarbeiter.mitarbeiter_uid
|
||||
JOIN tbl_benutzer ON tbl_mitarbeiter.mitarbeiter_uid = tbl_benutzer.uid
|
||||
JOIN tbl_person USING(person_id)
|
||||
JOIN lehreinheiten ON stundenplan.lehreinheit_id = lehreinheiten.lehreinheit_id
|
||||
WHERE datum >= ? AND datum <= ?
|
||||
GROUP BY datum, unr, stundenplan.lehreinheit_id, lehrveranstaltung_id, lehrfach_bez, lehrfach_bez
|
||||
ORDER BY datum, min(stunde), unr, lehreinheit_id
|
||||
),
|
||||
stundenplanentries AS (
|
||||
SELECT
|
||||
entries.*,
|
||||
stundeb.beginn AS beginn,
|
||||
stundee.ende AS ende
|
||||
FROM entries
|
||||
JOIN lehre.tbl_stunde stundeb ON stundeb.stunde = entries.stunde_beginn
|
||||
JOIN lehre.tbl_stunde stundee ON stundee.stunde = entries.stunde_ende
|
||||
)";
|
||||
}
|
||||
/**
|
||||
* queries Stundenplan and filters by assigned ma_kurzbz, very similar to get by LVA
|
||||
*
|
||||
|
||||
@@ -241,4 +241,15 @@ class Stundenplandev_model extends DB_Model
|
||||
|
||||
return $this->delete(array('lehreinheit_id' => $lehreinheit_id, 'mitarbeiter_uid' => $mitarbeiter_uid));
|
||||
}
|
||||
|
||||
public function lektorHasStundenplandevEintrag($uid, $datum, $stunde)
|
||||
{
|
||||
$qry = "SELECT stundenplandev_id, lektor, stg_kurzbz, ort_kurzbz, semester, verband, gruppe, gruppe_kurzbz, datum, stunde
|
||||
FROM lehre.vw_stundenplandev
|
||||
WHERE uid = ?
|
||||
AND datum = ?
|
||||
AND stunde = ?";
|
||||
|
||||
return $this->execReadOnlyQuery($qry, [$uid, $datum, $stunde]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,4 +61,40 @@ class Zeitsperre_model extends DB_Model
|
||||
|
||||
return $this->execQuery($qry);
|
||||
}
|
||||
|
||||
public function checkIfZeitsperreExists($uid, $datum, $stunde)
|
||||
{
|
||||
$this->db->select("*");
|
||||
|
||||
$this->db->where('mitarbeiter_uid', $uid);
|
||||
$this->db->where('zeitsperretyp_kurzbz !=', 'ZVerfueg');
|
||||
|
||||
$this->db->group_start();
|
||||
|
||||
$this->db->where('vondatum <', $datum);
|
||||
$this->db->or_group_start();
|
||||
$this->db->where('vondatum', $datum);
|
||||
$this->db->group_start();
|
||||
$this->db->where('vonstunde <=', $stunde);
|
||||
$this->db->or_where('vonstunde IS NULL', null, false);
|
||||
$this->db->group_end();
|
||||
$this->db->group_end();
|
||||
$this->db->group_end();
|
||||
|
||||
|
||||
$this->db->group_start();
|
||||
$this->db->where('bisdatum >', $datum);
|
||||
$this->db->or_group_start();
|
||||
$this->db->where('bisdatum', $datum);
|
||||
$this->db->group_start();
|
||||
$this->db->where('bisstunde >=', $stunde);
|
||||
$this->db->or_where('bisstunde IS NULL', null, false);
|
||||
$this->db->group_end();
|
||||
|
||||
$this->db->group_end();
|
||||
$this->db->group_end();
|
||||
|
||||
return $this->load();
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@ $includesArray = array(
|
||||
'skipID' => '#fhccontent',
|
||||
'vuedatepicker11' => true,
|
||||
'customCSSs' => array(
|
||||
'vendor/vuejs/vuedatepicker_css/main.css',
|
||||
'public/css/components/verticalsplit.css',
|
||||
'public/css/components/searchbar/searchbar.css',
|
||||
'public/css/Fhc.css',
|
||||
@@ -32,14 +33,17 @@ $includesArray = array(
|
||||
'vendor/npm-asset/primevue/inputnumber/inputnumber.min.js',
|
||||
'vendor/npm-asset/primevue/speeddial/speeddial.min.js',
|
||||
'vendor/npm-asset/primevue/textarea/textarea.min.js',
|
||||
'vendor/moment/luxonjs/luxon.min.js',
|
||||
'vendor/npm-asset/primevue/password/password.min.js',
|
||||
'vendor/npm-asset/primevue/multiselect/multiselect.min.js',
|
||||
'vendor/npm-asset/primevue/timeline/timeline.min.js',
|
||||
'vendor/npm-asset/primevue/inplace/inplace.min.js',
|
||||
'vendor/npm-asset/primevue/message/message.min.js',
|
||||
'vendor/npm-asset/primevue/tieredmenu/tieredmenu.js',
|
||||
'vendor/moment/luxonjs/luxon.min.js'
|
||||
),
|
||||
'customJSModules' => array(
|
||||
'public/js/apps/Dashboard/Fhc.js',
|
||||
'vendor/olifolkerd/tabulator5/src/js/modules/ColumnCalcs/ColumnCalcs.js'
|
||||
),
|
||||
|
||||
);
|
||||
|
||||
@@ -31,6 +31,8 @@
|
||||
lv-root="<?= site_url('LVVerwaltung'); ?>"
|
||||
:permissions="<?= htmlspecialchars(json_encode($permissions));?>"
|
||||
:config="<?= htmlspecialchars(json_encode($configs)); ?>"
|
||||
avatar-url="<?= site_url('Cis/Pub/bild/person/' . getAuthPersonId()); ?>"
|
||||
logout-url="<?= site_url('Cis/Auth/logout'); ?>"
|
||||
>
|
||||
</router-view>
|
||||
|
||||
|
||||
+9
-3
@@ -8,9 +8,15 @@ $this->load->view(
|
||||
'axios027' => true,
|
||||
'restclient' => true,
|
||||
'vue3' => true,
|
||||
'customJSModules' => ['public/js/apps/Dashboard.js'],
|
||||
'primevue3' => true,
|
||||
'vuedatepicker11' => true,
|
||||
'customJSs' => [
|
||||
'vendor/moment/luxonjs/luxon.min.js'
|
||||
],
|
||||
'customJSModules' => ['public/js/apps/Dashboard/Admin.js'],
|
||||
'customCSSs' => [
|
||||
'public/css/components/dashboard.css'
|
||||
'public/css/components/dashboard.css',
|
||||
'public/css/components/primevue.css',
|
||||
],
|
||||
'navigationcomponent' => true
|
||||
)
|
||||
@@ -25,7 +31,7 @@ $this->load->view(
|
||||
<div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom">
|
||||
<h1 class="h2">Dashboard</h1>
|
||||
</div>
|
||||
<core-dashboard dashboard="CIS" apiurl="<?= site_url('dashboard'); ?>"></core-dashboard>
|
||||
<dashboard-admin></dashboard-admin>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
+8
-3
@@ -8,7 +8,12 @@ $this->load->view(
|
||||
'axios027' => true,
|
||||
'restclient' => true,
|
||||
'vue3' => true,
|
||||
'customJSModules' => ['public/js/apps/DashboardAdmin.js'],
|
||||
'vuedatepicker11' => true,
|
||||
'primevue3' => true,
|
||||
'customJSs' => [
|
||||
'vendor/moment/luxonjs/luxon.min.js'
|
||||
],
|
||||
'customJSModules' => ['public/js/apps/Dashboard/Preview.js'],
|
||||
'customCSSs' => [
|
||||
'public/css/components/dashboard.css'
|
||||
],
|
||||
@@ -23,9 +28,9 @@ $this->load->view(
|
||||
|
||||
<div id="content">
|
||||
<div class="d-flex justify-content-between flex-wrap flex-md-nowrap align-items-center pt-3 pb-2 mb-3 border-bottom">
|
||||
<h1 class="h2">Dashboard</h1>
|
||||
<h1 class="h2">Dashboard <?= $dashboard_kurzbz ?></h1>
|
||||
</div>
|
||||
<dashboard-admin dashboard="CIS" apiurl="<?= site_url('dashboard'); ?>"></dashboard-admin>
|
||||
<core-dashboard dashboard="<?= $dashboard_kurzbz ?>"></core-dashboard>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
@@ -315,22 +315,15 @@
|
||||
WHERE tpl.app = '.$APP.'
|
||||
) pl USING(person_id)
|
||||
LEFT JOIN (
|
||||
SELECT
|
||||
SELECT DISTINCT ON (tbl_rueckstellung.person_id)
|
||||
tbl_rueckstellung.person_id,
|
||||
tbl_rueckstellung.datum_bis,
|
||||
tbl_rueckstellung.status_kurzbz,
|
||||
array_to_json(bezeichnung_mehrsprachig::varchar[])->>0 as bezeichnung
|
||||
FROM public.tbl_rueckstellung
|
||||
JOIN public.tbl_rueckstellung_status USING(status_kurzbz)
|
||||
JOIN public.tbl_person sp ON tbl_rueckstellung.person_id = sp.person_id
|
||||
WHERE tbl_rueckstellung.rueckstellung_id =
|
||||
(
|
||||
SELECT srueck.rueckstellung_id
|
||||
FROM public.tbl_rueckstellung srueck
|
||||
WHERE srueck.person_id = tbl_rueckstellung.person_id
|
||||
AND datum_bis >= NOW()
|
||||
ORDER BY srueck.datum_bis DESC LIMIT 1
|
||||
)
|
||||
WHERE tbl_rueckstellung.datum_bis >= NOW()
|
||||
ORDER BY tbl_rueckstellung.person_id, tbl_rueckstellung.datum_bis DESC
|
||||
) rueck ON rueck.person_id = p.person_id
|
||||
WHERE
|
||||
EXISTS (
|
||||
|
||||
@@ -24,22 +24,15 @@ $query = '
|
||||
WHERE tpl.app = '.$APP.'
|
||||
) pl ON p.person_id = pl.person_id
|
||||
LEFT JOIN (
|
||||
SELECT
|
||||
SELECT DISTINCT ON (tbl_rueckstellung.person_id)
|
||||
tbl_rueckstellung.person_id,
|
||||
tbl_rueckstellung.datum_bis,
|
||||
tbl_rueckstellung.status_kurzbz,
|
||||
array_to_json(bezeichnung_mehrsprachig::varchar[])->>0 as bezeichnung
|
||||
FROM public.tbl_rueckstellung
|
||||
JOIN public.tbl_rueckstellung_status USING(status_kurzbz)
|
||||
JOIN public.tbl_person sp ON tbl_rueckstellung.person_id = sp.person_id
|
||||
WHERE tbl_rueckstellung.rueckstellung_id =
|
||||
(
|
||||
SELECT srueck.rueckstellung_id
|
||||
FROM public.tbl_rueckstellung srueck
|
||||
WHERE srueck.person_id = tbl_rueckstellung.person_id
|
||||
AND datum_bis >= NOW()
|
||||
ORDER BY srueck.datum_bis DESC LIMIT 1
|
||||
)
|
||||
JOIN public.tbl_rueckstellung_status USING(status_kurzbz)
|
||||
WHERE tbl_rueckstellung.datum_bis >= NOW()
|
||||
ORDER BY tbl_rueckstellung.person_id, tbl_rueckstellung.datum_bis DESC
|
||||
) rueck ON rueck.person_id = p.person_id
|
||||
WHERE p.person_id NOT IN (SELECT person_id FROM public.tbl_prestudent)';
|
||||
|
||||
|
||||
+5
-5
@@ -41,11 +41,11 @@ ob_start();
|
||||
<link href="../skin/style.css.php" rel="stylesheet" type="text/css">
|
||||
<title>Menu</title>
|
||||
<link href="../skin/flexcrollstyles.css" rel="stylesheet" type="text/css" />
|
||||
<link rel="stylesheet" type="text/css" href="../skin/jquery-ui-1.9.2.custom.min.css">
|
||||
<script type="text/javascript" src="../vendor/jquery/jquery1/jquery-1.12.4.min.js"></script>
|
||||
<script type="text/javascript" src="../vendor/christianbach/tablesorter/jquery.tablesorter.min.js"></script>
|
||||
<script type="text/javascript" src="../vendor/components/jqueryui/jquery-ui.min.js"></script>
|
||||
<script type="text/javascript" src="../include/js/jquery.ui.datepicker.translation.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="../skin/jquery-ui-1.9.2.custom.min.css">
|
||||
<script type="text/javascript" src="../vendor/jquery/jquery1/jquery-1.12.4.min.js"></script>
|
||||
<script type="text/javascript" src="../vendor/christianbach/tablesorter/jquery.tablesorter.min.js"></script>
|
||||
<script type="text/javascript" src="../vendor/components/jqueryui/jquery-ui.min.js"></script>
|
||||
<script type="text/javascript" src="../include/js/jquery.ui.datepicker.translation.js"></script>
|
||||
<script type="text/javascript" src="../vendor/jquery/sizzle/sizzle.js"></script>
|
||||
<script type="text/javascript">
|
||||
function treemenu(obj)
|
||||
|
||||
+75
-11
@@ -80,9 +80,17 @@ echo '
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/xhtml; charset=UTF-8" />
|
||||
<link rel="stylesheet" href="../../vendor/components/jqueryui/themes/base/jquery-ui.min.css" type="text/css" />
|
||||
<link rel="stylesheet" href="../../vendor/twbs/bootstrap3/dist/css/bootstrap.min.css" type="text/css"/>
|
||||
<link href="../../skin/style.css.php" rel="stylesheet" type="text/css" />
|
||||
<style>
|
||||
.ui-dialog-titlebar-close
|
||||
{
|
||||
visibility: hidden !important;
|
||||
}
|
||||
</style>
|
||||
<script type="text/javascript" src="../../vendor/components/jquery/jquery.min.js"></script>
|
||||
<script type="text/javascript" src="../../vendor/components/jqueryui/jquery-ui.min.js"></script>
|
||||
<script type="text/javascript" src="../../vendor/twbs/bootstrap3/dist/js/bootstrap.min.js"></script>
|
||||
<script language="Javascript" type="text/javascript">
|
||||
//<![CDATA[
|
||||
@@ -131,22 +139,78 @@ echo '
|
||||
}
|
||||
}
|
||||
|
||||
function GebietStarten(bezeichnung,stunde,minute,sekunde,gebiet_id)
|
||||
function GebietStarten(bezeichnung, stunde, minute, sekunde, gebiet_id)
|
||||
{
|
||||
var check = confirm(<?php echo "'".$p->t('testtool/okKlickenUmZuStarten')."'"?>+' '+stunde+'h '+minute+'m '+sekunde+'s');
|
||||
if (check == true) {
|
||||
var sprache_user = <?php echo "'".$sprache_user."'"?>;
|
||||
document.location.href = 'frage.php?gebiet_id='+gebiet_id+'&start=true';
|
||||
}
|
||||
else {
|
||||
return false;
|
||||
let message = <?php echo "'".$p->t('testtool/okKlickenUmZuStarten')."'"?> + ' ' + stunde + 'h ' + minute + 'm ' + sekunde + 's';
|
||||
let title = <?php echo "'".$p->t('testtool/startGebiet')."'"?>;
|
||||
let abbrechen = <?php echo "'".$p->t('testtool/abbrechen')."'"?>;
|
||||
|
||||
if ($('#gebiet-dialog').length === 0)
|
||||
{
|
||||
$('body').append(
|
||||
'<div id="gebiet-dialog" title="' + title + '">' +
|
||||
'<p id="gebiet-dialog-msg">' + message + '</p>' +
|
||||
'</div>'
|
||||
);
|
||||
}
|
||||
|
||||
$('#gebiet-dialog').dialog({
|
||||
modal: true,
|
||||
width: 400,
|
||||
resizable: false,
|
||||
buttons: [
|
||||
{
|
||||
text: 'OK',
|
||||
click: function() {
|
||||
$(this).dialog('close');
|
||||
document.location.href = 'frage.php?gebiet_id=' + gebiet_id + '&start=true';
|
||||
}
|
||||
},
|
||||
{
|
||||
text: abbrechen,
|
||||
click: function() {
|
||||
$(this).dialog('close');
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
}
|
||||
|
||||
let letzteFrageBestaetigt = false;
|
||||
|
||||
function letzteFrage()
|
||||
{
|
||||
alert(<?php echo "'".$p->t("testtool/alleFragenBeantwortet")."'"?>);
|
||||
return true;
|
||||
if (letzteFrageBestaetigt)
|
||||
return true;
|
||||
|
||||
let message = <?php echo "'".$p->t("testtool/alleFragenBeantwortet")."'"?>;
|
||||
|
||||
if ($('#fertig-dialog').length === 0)
|
||||
{
|
||||
$('body').append(
|
||||
'<div id="fertig-dialog">' +
|
||||
'<p>' + message + '</p>' +
|
||||
'</div>'
|
||||
);
|
||||
}
|
||||
|
||||
$('#fertig-dialog').dialog({
|
||||
modal: true,
|
||||
width: 400,
|
||||
resizable: false,
|
||||
buttons: [
|
||||
{
|
||||
text: 'OK',
|
||||
click: function() {
|
||||
$(this).dialog('close');
|
||||
letzteFrageBestaetigt = true;
|
||||
$('[name="submitantwort"]').click();
|
||||
}
|
||||
}
|
||||
]
|
||||
});
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
$(document).ready(function () {
|
||||
@@ -647,7 +711,7 @@ if($frage->frage_id!='')
|
||||
}
|
||||
|
||||
$letzte = $frage->getNextFrage($gebiet_id, $_SESSION['pruefling_id'], $frage_id, $demo);
|
||||
echo "<form action=\"$PHP_SELF?gebiet_id=$gebiet_id&frage_id=$frage->frage_id\" method=\"POST\" ".(!$letzte && !$levelgebiet?"onsubmit=\"letzteFrage()\"":"").">";
|
||||
echo "<form action=\"$PHP_SELF?gebiet_id=$gebiet_id&frage_id=$frage->frage_id\" method=\"POST\" ".(!$letzte && !$levelgebiet?"onsubmit=\"return letzteFrage()\"":"").">";
|
||||
echo '
|
||||
<div class="row text-center">
|
||||
<table class="table" style="width: 600px; margin-left: auto; margin-right: auto;">
|
||||
|
||||
+11
-2
@@ -142,7 +142,9 @@ if (isset($_REQUEST['prestudent']))
|
||||
}
|
||||
if ($reihungstest_id != '' && $rt->load($reihungstest_id))
|
||||
{
|
||||
if ($rt->freigeschaltet)
|
||||
$pruefling_exist = new Pruefling();
|
||||
$alreadyInRT = $pruefling_exist->personAlreadyInRT($ps->person_id, $rt->reihungstest_id, $ps->prestudent_id);
|
||||
if ($rt->freigeschaltet && !$alreadyInRT)
|
||||
{
|
||||
// regenerate Session ID after Login
|
||||
session_regenerate_id();
|
||||
@@ -282,7 +284,14 @@ if (isset($_REQUEST['prestudent']))
|
||||
}
|
||||
else
|
||||
{
|
||||
$alertmsg .= '<div class="alert alert-danger">'.$p->t('testtool/reihungstestNichtFreigeschalten').'</div>';
|
||||
if ($alreadyInRT)
|
||||
{
|
||||
$alertmsg .= '<div class="alert alert-danger">'.$p->t('testtool/reihungstestNichtRegistriert').'</div>';
|
||||
}
|
||||
else
|
||||
{
|
||||
$alertmsg .= '<div class="alert alert-danger">'.$p->t('testtool/reihungstestNichtFreigeschalten').'</div>';
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
@@ -802,6 +802,10 @@ echo '<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>';
|
||||
class="sortDirectionIndicator"
|
||||
sort="rdf:http://www.technikum-wien.at/prestudentrolle/rdf#fgm" />
|
||||
<splitter class="tree-splitter"/>
|
||||
<treecol id="student-prestudent-tree-rolle-faktiv" label="F-Aktiv" flex="1" hidden="true" persist="hidden, width, ordinal"
|
||||
class="sortDirectionIndicator"
|
||||
sort="rdf:http://www.technikum-wien.at/prestudentrolle/rdf#faktiv" />
|
||||
<splitter class="tree-splitter"/>
|
||||
</treecols>
|
||||
|
||||
<template>
|
||||
@@ -828,6 +832,7 @@ echo '<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>';
|
||||
<treecell properties="Aktiv_rdf:http://www.technikum-wien.at/prestudentrolle/rdf#aktiv rdf:http://www.technikum-wien.at/prestudentrolle/rdf#stichtagsaktiv" label="rdf:http://www.technikum-wien.at/prestudentrolle/rdf#updateamum"/>
|
||||
<treecell properties="Aktiv_rdf:http://www.technikum-wien.at/prestudentrolle/rdf#aktiv rdf:http://www.technikum-wien.at/prestudentrolle/rdf#stichtagsaktiv" label="rdf:http://www.technikum-wien.at/prestudentrolle/rdf#updatevon"/>
|
||||
<treecell properties="Aktiv_rdf:http://www.technikum-wien.at/prestudentrolle/rdf#aktiv rdf:http://www.technikum-wien.at/prestudentrolle/rdf#stichtagsaktiv" label="rdf:http://www.technikum-wien.at/prestudentrolle/rdf#fgm"/>
|
||||
<treecell properties="Aktiv_rdf:http://www.technikum-wien.at/prestudentrolle/rdf#aktiv rdf:http://www.technikum-wien.at/prestudentrolle/rdf#stichtagsaktiv" label="rdf:http://www.technikum-wien.at/prestudentrolle/rdf#faktiv"/>
|
||||
</treerow>
|
||||
</treeitem>
|
||||
</treechildren>
|
||||
|
||||
@@ -3550,9 +3550,11 @@ function StudentZeugnisDokumentArchivieren()
|
||||
case 'microcredentialzertifikat_1':
|
||||
case 'microcredentialzertifikat_2':
|
||||
case 'microcredentialzertifikat_3':
|
||||
case 'microcredentialzertifikat_4':
|
||||
case 'microcredential_1':
|
||||
case 'microcredential_2':
|
||||
case 'microcredential_3':
|
||||
case 'microcredential_4':
|
||||
xml = 'microcredential.xml.php';
|
||||
break;
|
||||
|
||||
|
||||
@@ -552,9 +552,40 @@ class lehreinheitmitarbeiter extends basis_db
|
||||
$beginn = new DateTime($beginn);
|
||||
$ende = new DateTime($ende);
|
||||
|
||||
// get relevant Studiensemester
|
||||
$studiensemester_kurzbz_arr = [];
|
||||
|
||||
$qry = '
|
||||
SELECT
|
||||
studiensemester_kurzbz
|
||||
FROM
|
||||
public.tbl_studiensemester
|
||||
WHERE
|
||||
start BETWEEN
|
||||
'. $this->db_add_param($beginn->format('Y-m-d')). ' AND
|
||||
'. $this->db_add_param($ende->format('Y-m-d'));
|
||||
|
||||
if ($this->db_query($qry))
|
||||
{
|
||||
while($row = $this->db_fetch_object())
|
||||
{
|
||||
$studiensemester_kurzbz_arr[] = $row->studiensemester_kurzbz;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->errormsg = 'Fehler bei der Datenbankabfrage';
|
||||
return false;
|
||||
}
|
||||
|
||||
$lehrgaengeDistr = $this->_getLehrgaengeForDistribution($studiensemester_kurzbz_arr);
|
||||
|
||||
if (!is_array($studiensemester_kurzbz_arr) || empty($studiensemester_kurzbz_arr)) return true;
|
||||
|
||||
$qry = '
|
||||
WITH semester_sws_tbl AS (
|
||||
SELECT DISTINCT lehreinheit_id, studiensemester_kurzbz, lema.semesterstunden, stg.studiengang_kz
|
||||
SELECT DISTINCT lehreinheit_id, studiensemester_kurzbz, lema.semesterstunden,
|
||||
stg.studiengang_kz, stg.melde_studiengang_kz, stg.lgartcode
|
||||
FROM lehre.tbl_lehreinheitmitarbeiter lema
|
||||
JOIN lehre.tbl_lehreinheit USING (lehreinheit_id)
|
||||
JOIN lehre.tbl_lehrveranstaltung lv USING (lehrveranstaltung_id)
|
||||
@@ -564,38 +595,103 @@ class lehreinheitmitarbeiter extends basis_db
|
||||
JOIN public.tbl_studiengang stg ON stg.studiengang_kz = sto.studiengang_kz
|
||||
JOIN public.tbl_studiensemester ss USING (studiensemester_kurzbz)
|
||||
WHERE mitarbeiter_uid = '. $this->db_add_param($uid). '
|
||||
AND (
|
||||
ss.start BETWEEN
|
||||
'. $this->db_add_param($beginn->format('Y-m-d')). ' AND
|
||||
'. $this->db_add_param($ende->format('Y-m-d')). ')
|
||||
AND ss.studiensemester_kurzbz IN ('.$this->implode4SQL($studiensemester_kurzbz_arr).')
|
||||
-- nur lehre, die bisgemeldet wird
|
||||
AND lema.bismelden
|
||||
-- keine lehreinheiten ohne semesterstunden
|
||||
AND lema.semesterstunden != 0
|
||||
AND lema.semesterstunden != 0
|
||||
)
|
||||
|
||||
SELECT
|
||||
studiengang_kz,
|
||||
studiensemester_kurzbz,
|
||||
melde_studiengang_kz,
|
||||
lgartcode,
|
||||
sum(semesterstunden) AS summe,
|
||||
round(sum(semesterstunden) / 15, 2) AS sws
|
||||
FROM
|
||||
semester_sws_tbl
|
||||
GROUP BY
|
||||
studiengang_kz,
|
||||
studiensemester_kurzbz
|
||||
studiensemester_kurzbz,
|
||||
melde_studiengang_kz,
|
||||
lgartcode
|
||||
ORDER BY
|
||||
studiengang_kz;
|
||||
';
|
||||
|
||||
if ($this->db_query($qry))
|
||||
{
|
||||
$additionalLehrgaenge = [];
|
||||
|
||||
while($row = $this->db_fetch_object())
|
||||
{
|
||||
$obj = new StdClass();
|
||||
$obj->studiengang_kz = $row->studiengang_kz;
|
||||
$obj->studiensemester_kurzbz = $row->studiensemester_kurzbz;
|
||||
$obj->melde_studiengang_kz = $row->melde_studiengang_kz;
|
||||
$obj->lgartcode = $row->lgartcode;
|
||||
$obj->sws = $row->sws;
|
||||
|
||||
if (isset($lehrgaengeDistr[$uid][$row->studiensemester_kurzbz]))
|
||||
{
|
||||
$lehrgaenge = $lehrgaengeDistr[$uid][$row->studiensemester_kurzbz];
|
||||
|
||||
foreach ($lehrgaenge as $lehreinheit_id => $lehrgangKzArr)
|
||||
{
|
||||
// wenn lehrgang gefunden, zusammenhängende Lehrgaenge holen und sws aufteilen
|
||||
if (array_key_exists($row->studiengang_kz, $lehrgangKzArr))
|
||||
{
|
||||
foreach ($lehrgangKzArr as $studiengang_kz => $lehrgang)
|
||||
{
|
||||
// check: nur eine Studiengangsverknüpfung pro Mitarbeiter, Semester, und Referenzstudiengang
|
||||
if (
|
||||
$studiengang_kz == $row->studiengang_kz
|
||||
|| isset(
|
||||
$additionalLehrgaenge[$uid][$row->studiensemester_kurzbz][$row->studiengang_kz][$studiengang_kz]
|
||||
)
|
||||
) continue;
|
||||
|
||||
// Lehrgang erstellen
|
||||
$lg = new StdClass();
|
||||
$lg->mitarbeiter_uid = $uid;
|
||||
$lg->melde_studiengang_kz = $lehrgang->melde_studiengang_kz;
|
||||
$lg->lgartcode = $lehrgang->lgartcode;
|
||||
$lg->studiengang_kz = $lehrgang->studiengang_kz;
|
||||
$lg->studiensemester_kurzbz = $lehrgang->studiensemester_kurzbz;
|
||||
$lg->summe = $row->summe;
|
||||
$lg->sws = $row->sws;
|
||||
// Lehrgang, der mit Ursprungsstudiengang aufgrund lehreinheit "verknüpft" ist, hinzufügen
|
||||
$additionalLehrgaenge[$uid][$row->studiensemester_kurzbz][$row->studiengang_kz][$studiengang_kz] = $lg;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// ignorieren, wenn für den Studiengang keine verknüpften Lehrgaenge hat
|
||||
if (isset($additionalLehrgaenge[$uid][$row->studiensemester_kurzbz][$row->studiengang_kz]))
|
||||
{
|
||||
$addLehrgaenge = $additionalLehrgaenge[$uid][$row->studiensemester_kurzbz][$row->studiengang_kz];
|
||||
|
||||
// sws Durchschnitt über alle verknuepften Lehrgaenge berechnet
|
||||
$summeSws = $row->summe/(count($addLehrgaenge) + 1);
|
||||
$sws = $row->sws/(count($addLehrgaenge) + 1);
|
||||
|
||||
// neue sws zuweisen
|
||||
$obj->summe = $summeSws;
|
||||
$obj->sws = $sws;
|
||||
|
||||
foreach ($addLehrgaenge as $conn_ws_studiengang_kz => $lehrgang)
|
||||
{
|
||||
// sws fuer jeden verknuepften Lehrgang zuweisen
|
||||
$lehrgang->summe = $summeSws;
|
||||
$lehrgang->sws = $sws;
|
||||
|
||||
// neue lehrgang sws hinzufuegen
|
||||
$this->result [] = $lehrgang;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->result []= $obj;
|
||||
}
|
||||
return true;
|
||||
@@ -655,4 +751,63 @@ class lehreinheitmitarbeiter extends basis_db
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get "connected" Lehrgaenge for equal sws distribution.
|
||||
* @param $studiensemester_kurzbz_arr all semester for which Lehrgaenge should be retrieved
|
||||
* @return object success or error
|
||||
*/
|
||||
private function _getLehrgaengeForDistribution($studiensemester_kurzbz_arr)
|
||||
{
|
||||
if (!is_array($studiensemester_kurzbz_arr) || empty($studiensemester_kurzbz_arr)) return [];
|
||||
|
||||
$qry = "
|
||||
WITH gruppen AS (
|
||||
SELECT
|
||||
mitarbeiter_uid, lehreinheit_id, lehrveranstaltung_id, studiensemester_kurzbz, sem.start, sem.ende,
|
||||
lehreinheitgruppe_id, studiengang_kz, melde_studiengang_kz, lgartcode
|
||||
FROM
|
||||
lehre.tbl_lehreinheitmitarbeiter lema
|
||||
JOIN lehre.tbl_lehreinheit le USING (lehreinheit_id)
|
||||
JOIN lehre.tbl_lehreinheitgruppe legr USING (lehreinheit_id)
|
||||
JOIN public.tbl_studiengang stg USING (studiengang_kz)
|
||||
JOIN public.tbl_studiensemester sem USING (studiensemester_kurzbz)
|
||||
WHERE
|
||||
bismelden
|
||||
AND stg.melderelevant
|
||||
AND stg.typ = 'l'
|
||||
AND le.studiensemester_kurzbz IN (".$this->implode4SQL($studiensemester_kurzbz_arr).")
|
||||
)
|
||||
SELECT
|
||||
DISTINCT mitarbeiter_uid, studiensemester_kurzbz, lehreinheit_id, studiengang_kz, melde_studiengang_kz, lgartcode
|
||||
FROM
|
||||
gruppen gr
|
||||
GROUP BY
|
||||
mitarbeiter_uid, studiensemester_kurzbz, lehreinheit_id, studiengang_kz, melde_studiengang_kz, lgartcode
|
||||
ORDER BY
|
||||
mitarbeiter_uid, studiensemester_kurzbz, lehreinheit_id, studiengang_kz, melde_studiengang_kz, lgartcode";
|
||||
|
||||
$lehrgaengeDistributions = [];
|
||||
|
||||
if($this->db_query($qry))
|
||||
{
|
||||
while($row = $this->db_fetch_object())
|
||||
{
|
||||
// group by properties
|
||||
$lehrgaengeDistributions
|
||||
[$row->mitarbeiter_uid]
|
||||
[$row->studiensemester_kurzbz]
|
||||
[$row->lehreinheit_id]
|
||||
[$row->studiengang_kz]
|
||||
= $row;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->errormsg = 'Fehler bei der Datenbankabfrage';
|
||||
return false;
|
||||
}
|
||||
|
||||
return $lehrgaengeDistributions;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -270,6 +270,8 @@ class LehreListHelper
|
||||
} else if ($row->bisio_id != '' && $row->status != 'Incoming' && ($row->von > $stsemdatumvon || $row->von == '')) {
|
||||
// if bis datum is not yet known but von is available already
|
||||
$zusatz .= '(o)(ab '.$datum->formatDatum($row->von, 'd.m.Y').')';
|
||||
} else if ($row->bisio_id != '' && $row->status != 'Incoming' && ($row->von <= $stsemdatumvon || $row->von == '') && ($row->bis == '' || $row->bis > date('Y-m-d'))){
|
||||
$zusatz .= '(o)(ab '.$datum->formatDatum($row->von, 'd.m.Y').')';
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -706,6 +706,7 @@ class prestudent extends person
|
||||
$rolle->bestaetigtam = $row->bestaetigtam;
|
||||
$rolle->bestaetigtvon = $row->bestaetigtvon;
|
||||
$rolle->fgm = $row->fgm;
|
||||
$rolle->faktiv = $this->db_parse_bool($row->faktiv);
|
||||
$rolle->anmerkung_status = $row->anmerkung;
|
||||
$rolle->bewerbung_abgeschicktamum = $row->bewerbung_abgeschicktamum;
|
||||
$rolle->rt_stufe = $row->rt_stufe;
|
||||
|
||||
@@ -584,6 +584,32 @@ class pruefling extends basis_db
|
||||
|
||||
$qry .= " LIMIT 1";
|
||||
|
||||
if($result = $this->db_query($qry))
|
||||
{
|
||||
if ($this->db_num_rows($result) == 0)
|
||||
return false;
|
||||
else
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
$this->errormsg = 'Fehler bei einer Abfrage';
|
||||
return false;
|
||||
}
|
||||
}
|
||||
public function personAlreadyInRT($person_id, $reihungstest_id, $prestudent_id)
|
||||
{
|
||||
$qry = "SELECT tbl_prestudent.prestudent_id
|
||||
FROM public.tbl_rt_person
|
||||
JOIN public.tbl_prestudent ON tbl_prestudent.person_id = tbl_rt_person.person_id
|
||||
JOIN public.tbl_prestudentstatus ON tbl_prestudent.prestudent_id = tbl_prestudentstatus.prestudent_id AND status_kurzbz = 'Bewerber'
|
||||
AND tbl_prestudentstatus.studienplan_id = tbl_rt_person.studienplan_id
|
||||
WHERE tbl_rt_person.person_id = " . $this->db_add_param($person_id) . "
|
||||
AND tbl_rt_person.rt_id = " . $this->db_add_param($reihungstest_id) . "
|
||||
AND tbl_prestudent.prestudent_id != " . $this->db_add_param($prestudent_id) . "
|
||||
AND get_rolle_prestudent(tbl_prestudent.prestudent_id, NULL) = 'Bewerber'
|
||||
LIMIT 1";
|
||||
|
||||
if($result = $this->db_query($qry))
|
||||
{
|
||||
if ($this->db_num_rows($result) == 0)
|
||||
|
||||
@@ -17,6 +17,7 @@ $this->phrasen['testtool/basic']='Basic';
|
||||
$this->phrasen['testtool/basisgebiete']='Basisgebiete';
|
||||
$this->phrasen['testtool/semester']='Semester';
|
||||
$this->phrasen['testtool/reihungstestNichtFreigeschalten']='Der zuteilte Reihungstest ist noch nicht freigeschaltet';
|
||||
$this->phrasen['testtool/reihungstestNichtRegistriert']='Sie sind für den Reihungstest nicht registriert';
|
||||
$this->phrasen['testtool/reihungstestKannNichtGeladenWerden']='Der Reihungstest dem Sie zugeteilt sind, kann nicht geladen werden. Melden Sie sich bitte bei der Reihungstestaufsicht.';
|
||||
$this->phrasen['testtool/geburtsdatumStimmtNichtUeberein']='Ihr Geburtsdatum stimmt nicht mit unseren Daten überein. Bitte wenden Sie sich an die Aufsichtsperson';
|
||||
$this->phrasen['testtool/home']='Home';
|
||||
@@ -35,6 +36,8 @@ $this->phrasen['testtool/spracheDerTestfragen']='Gewünschte Sprache der Testfra
|
||||
$this->phrasen['testtool/einleitung']='Einleitung';
|
||||
$this->phrasen['testtool/blaettern']='Blättern';
|
||||
$this->phrasen['testtool/demo']='Demobeispiel ansehen';
|
||||
$this->phrasen['testtool/abbrechen']='Abbrechen';
|
||||
$this->phrasen['testtool/startGebiet']='Gebiet starten';
|
||||
$this->phrasen['testtool/okKlickenUmZuStarten']='Klicken Sie OK um dieses Gebiet zu starten. \nSie haben für die Bearbeitung ein Zeitlimit von';
|
||||
$this->phrasen['testtool/bitteZuerstAnmelden']='Bitte zuerst anmelden!';
|
||||
$this->phrasen['testtool/fehlerBeimGenerierenDesFragenpools']='Fehler beim generieren des Fragenpools';
|
||||
|
||||
@@ -17,6 +17,7 @@ $this->phrasen['testtool/basic']='Basic';
|
||||
$this->phrasen['testtool/basisgebiete']='Basic test';
|
||||
$this->phrasen['testtool/semester']='Semester';
|
||||
$this->phrasen['testtool/reihungstestNichtFreigeschalten']='The entrance examination assigned has not yet been activated.';
|
||||
$this->phrasen['testtool/reihungstestNichtRegistriert']='You are not registered for the placement test.';
|
||||
$this->phrasen['testtool/reihungstestKannNichtGeladenWerden']='The placement test you are assigned to could not be loaded. Please contact the placement test supervisior.';
|
||||
$this->phrasen['testtool/geburtsdatumStimmtNichtUeberein']='Your date of birth does not correspond to the data we have. Please speak to the supervisor. ';
|
||||
$this->phrasen['testtool/home']='Home';
|
||||
@@ -35,6 +36,8 @@ $this->phrasen['testtool/spracheDerTestfragen']='Desired language of questions';
|
||||
$this->phrasen['testtool/einleitung']='Introduction';
|
||||
$this->phrasen['testtool/blaettern']='Browse';
|
||||
$this->phrasen['testtool/demo']='See an example';
|
||||
$this->phrasen['testtool/abbrechen']='Cancel';
|
||||
$this->phrasen['testtool/startGebiet']='Start the section';
|
||||
$this->phrasen['testtool/okKlickenUmZuStarten']='Click OK to start this section. \nYou have a timelimit of';
|
||||
$this->phrasen['testtool/bitteZuerstAnmelden']='Please log in first!';
|
||||
$this->phrasen['testtool/fehlerBeimGenerierenDesFragenpools']='Error in generating the pool of questions.';
|
||||
|
||||
@@ -1,27 +0,0 @@
|
||||
{
|
||||
"name": "fhc-core",
|
||||
"private": true,
|
||||
"version": "0.0.0",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"build": "rollup -c",
|
||||
"watch": "rollup --watch -c"
|
||||
},
|
||||
"dependencies": {
|
||||
},
|
||||
"devDependencies": {
|
||||
"@rollup/plugin-alias": "^5.1.0",
|
||||
"@rollup/plugin-babel": "^6.0.4",
|
||||
"@rollup/plugin-commonjs": "^25.0.7",
|
||||
"@rollup/plugin-json": "^6.1.0",
|
||||
"@rollup/plugin-node-resolve": "^15.2.3",
|
||||
"@rollup/plugin-replace": "^5.0.5",
|
||||
"@rollup/plugin-terser": "^0.4.4",
|
||||
"babel-plugin-transform-class-properties": "^6.24.1",
|
||||
"glob": "^13.0.6",
|
||||
"node-sass": "^9.0.0",
|
||||
"rollup": "^4.52.4",
|
||||
"rollup-plugin-postcss": "^4.0.2",
|
||||
"rollup-plugin-vue": "^6.0.0"
|
||||
}
|
||||
}
|
||||
+19
-1
@@ -407,6 +407,7 @@ html {
|
||||
background-color: var(--fhc-background);
|
||||
border-color: var(--fhc-border);
|
||||
padding: var(--fhc-cis-main-py) var(--fhc-cis-main-px);
|
||||
min-width: 0; /* fix flex-grow with tabulator exceeding width */
|
||||
}
|
||||
|
||||
#cis-main .fa-arrow-up-right-from-square {
|
||||
@@ -856,8 +857,25 @@ html {
|
||||
|
||||
}
|
||||
|
||||
/* styling for editable dropdown column of notenvorschläge in benotungstool*/
|
||||
#notentable .tabulator-tableholder .tabulator-editable {
|
||||
position: relative;
|
||||
background-color: rgba(255, 255, 157, 0.73);
|
||||
cursor: pointer;
|
||||
}
|
||||
|
||||
#notentable .tabulator-tableholder .tabulator-editable::after {
|
||||
content: "▾";
|
||||
position: absolute;
|
||||
right: 6px;
|
||||
color: rgba(176, 176, 106, 0.73);;
|
||||
font-size: x-large;
|
||||
bottom: 6px;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.bordered-modal {
|
||||
border: 1px solid rgba(0, 0, 0, 0.15);
|
||||
border-radius: 0.5rem;
|
||||
box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -38,3 +38,9 @@ textarea[name="anmerkung"] {
|
||||
{
|
||||
border-color: black;
|
||||
}
|
||||
|
||||
.node-verband {
|
||||
user-select: none;
|
||||
-webkit-user-select: none;
|
||||
-moz-user-select: none;
|
||||
}
|
||||
|
||||
@@ -193,3 +193,6 @@
|
||||
word-break: break-word;
|
||||
}
|
||||
|
||||
.news-list-item p {
|
||||
word-break: break-word;
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
-2
@@ -1,2 +0,0 @@
|
||||
const e="error",t="retval",r={get:function(e,t,n=null){return r._axiosCall(e,t,"get",n)},post:function(e,t,n=null){return r._axiosCall(e,t,"post",n)},isSuccess:function(r){return!("object"!=typeof r||!r.hasOwnProperty(e)||!r.hasOwnProperty(t)||0!=r.error)},isError:function(e){return!r.isSuccess(e)},hasData:function(e){return!(!r.isSuccess(e)||!("object"==typeof e[t]&&Object.keys(e[t]).length>0||"array"==typeof e[t]&&e[t].length>0||"string"==typeof e[t]&&""!=e[t].trim()||"number"==typeof e[t]))},getData:function(e){return r.hasData(e)?e[t]:null},getError:function(e){return"object"==typeof e&&Object.keys(e).length>0&&e.hasOwnProperty(t)?e[t]:"Generic error"},getErrorCode:function(t){return"object"==typeof t&&t.hasOwnProperty(e)?t[e]:1},_generateRouterURI:function(e){var t=null;return"undefined"!=typeof FHC_JS_DATA_STORAGE_OBJECT&&(t=FHC_JS_DATA_STORAGE_OBJECT.app_root+FHC_JS_DATA_STORAGE_OBJECT.ci_router+"/"+e),t},_printDebug:function(e,t,r){},_axiosCall:function(e,t,n,i){let o={method:n,url:r._generateRouterURI(e),timeout:5e3};if("get"==n?o.params=t:o.data=t,"object"==typeof i)for(var s in i)o[s]=i[s];return axios(o)}},n=2e3,i={getStudiensemester:function(){return r.get("codex/Bismeldestichtag/getStudiensemester",null,{timeout:n})},getBismeldestichtage:function(){return r.get("codex/Bismeldestichtag/getBismeldestichtage",null,{timeout:n})},addBismeldestichtag:function(e){return r.post("codex/Bismeldestichtag/addBismeldestichtag",{meldestichtag:e.meldestichtag,studiensemester_kurzbz:e.studiensemester_kurzbz},{timeout:n})},deleteBismeldestichtag:function(e){return r.post("codex/Bismeldestichtag/deleteBismeldestichtag",{meldestichtag_id:e.meldestichtag_id},{timeout:n})}};export{i as BismeldestichtagAPIs};
|
||||
//# sourceMappingURL=API.js.map
|
||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,2 +0,0 @@
|
||||
const t={formatDate:function(t){return t.replace(/(.*)-(.*)-(.*)/,"$3.$2.$1")}};export{t as BismeldestichtagHelper};
|
||||
//# sourceMappingURL=BismeldestichtagHelper.js.map
|
||||
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"BismeldestichtagHelper.js","sources":["../../../../js/apps/Bismeldestichtag/BismeldestichtagHelper.js"],"sourcesContent":["/**\n * Copyright (C) 2022 fhcomplete.org\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <https://www.gnu.org/licenses/>.\n */\n\nexport const BismeldestichtagHelper = {\n\tformatDate: function(date) {\n\t\treturn date.replace(/(.*)-(.*)-(.*)/, '$3.$2.$1');\n\t}\n}\n"],"names":["BismeldestichtagHelper","formatDate","date","replace"],"mappings":"AAiBO,MAAMA,EAAyB,CACrCC,WAAY,SAASC,GACpB,OAAOA,EAAKC,QAAQ,iBAAkB,WACvC"}
|
||||
Vendored
-4
File diff suppressed because one or more lines are too long
Vendored
-1
File diff suppressed because one or more lines are too long
Vendored
-4
File diff suppressed because one or more lines are too long
-1
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
-4
File diff suppressed because one or more lines are too long
-1
File diff suppressed because one or more lines are too long
Vendored
-6
File diff suppressed because one or more lines are too long
-1
File diff suppressed because one or more lines are too long
-4
File diff suppressed because one or more lines are too long
-1
File diff suppressed because one or more lines are too long
Vendored
-4
File diff suppressed because one or more lines are too long
-1
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
@@ -1,2 +0,0 @@
|
||||
const e={height:700,layout:"fitColumns",columns:[{title:"Log ID",field:"LogId",headerFilter:!0},{title:"Request ID",field:"RequestId",headerFilter:!0},{title:"Execution time",field:"ExecutionTime",headerFilter:!0},{title:"Executed by",field:"ExecutedBy",headerFilter:!0},{title:"Description",field:"Description",headerFilter:!0},{title:"Data",field:"Data",headerFilter:!0},{title:"Web service type",field:"WebserviceType",headerFilter:!0}],rowFormatter:function(e){let t=e.getData();if(null!=t&&t.hasOwnProperty("RequestId")&&null!=t.RequestId){let l=t.RequestId;l.includes("error")?e.getElement().style.color="red":l.includes("warning")&&(e.getElement().style.color="orange")}}},t=[{event:"rowClick",handler:function(e,t){alert(t.getData().Data)}}];export{t as LogsViewerTabulatorEventHandlers,e as LogsViewerTabulatorOptions};
|
||||
//# sourceMappingURL=TabulatorSetup.js.map
|
||||
@@ -1 +0,0 @@
|
||||
{"version":3,"file":"TabulatorSetup.js","sources":["../../../../js/apps/LogsViewer/TabulatorSetup.js"],"sourcesContent":["/**\n * Copyright (C) 2022 fhcomplete.org\n *\n * This program is free software: you can redistribute it and/or modify\n * it under the terms of the GNU General Public License as published by\n * the Free Software Foundation, either version 3 of the License, or\n * (at your option) any later version.\n *\n * This program is distributed in the hope that it will be useful,\n * but WITHOUT ANY WARRANTY; without even the implied warranty of\n * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the\n * GNU General Public License for more details.\n *\n * You should have received a copy of the GNU General Public License\n * along with this program. If not, see <https://www.gnu.org/licenses/>.\n */\n\n/**\n *\n */\nexport const LogsViewerTabulatorOptions = {\n\theight: 700,\n\tlayout: 'fitColumns',\n\tcolumns: [\n\t\t{title: 'Log ID', field: 'LogId', headerFilter: true},\n\t\t{title: 'Request ID', field: 'RequestId', headerFilter: true},\n\t\t{title: 'Execution time', field: 'ExecutionTime', headerFilter: true},\n\t\t{title: 'Executed by', field: 'ExecutedBy', headerFilter: true},\n\t\t{title: 'Description', field: 'Description', headerFilter: true},\n\t\t{title: 'Data', field: 'Data', headerFilter: true},\n\t\t{title: 'Web service type', field: 'WebserviceType', headerFilter: true}\n\t],\n\trowFormatter: function(row) {\n\n\t\tlet data = row.getData(); // get data for this row\n\n\t\t// If data is not null and provides the property RequestId and it is not null\n\t\tif (data != null && data.hasOwnProperty('RequestId') && data.RequestId != null)\n\t\t{\n\t\t\tlet requestId = data.RequestId;\n\n\t\t\tif (requestId.includes(\"error\"))\n\t\t\t{\n\t\t\t\trow.getElement().style.color = \"red\";\n\t\t\t}\n\t\t\telse if (requestId.includes(\"warning\"))\n\t\t\t{\n\t\t\t\trow.getElement().style.color = \"orange\";\n\t\t\t\n\t\t\t}\n\t\t}\n\t}\n};\n\n/**\n *\n */\nexport const LogsViewerTabulatorEventHandlers = [\n\t{\n\t\tevent: \"rowClick\",\n\t\thandler: function(e, row) {\n\t\t\talert(row.getData().Data);\n\t\t}\n\t}\n];\n\n"],"names":["LogsViewerTabulatorOptions","height","layout","columns","title","field","headerFilter","rowFormatter","row","data","getData","hasOwnProperty","RequestId","requestId","includes","getElement","style","color","LogsViewerTabulatorEventHandlers","event","handler","e","alert","Data"],"mappings":"AAoBO,MAAMA,EAA6B,CACzCC,OAAQ,IACRC,OAAQ,aACRC,QAAS,CACR,CAACC,MAAO,SAAUC,MAAO,QAASC,cAAc,GAChD,CAACF,MAAO,aAAcC,MAAO,YAAaC,cAAc,GACxD,CAACF,MAAO,iBAAkBC,MAAO,gBAAiBC,cAAc,GAChE,CAACF,MAAO,cAAeC,MAAO,aAAcC,cAAc,GAC1D,CAACF,MAAO,cAAeC,MAAO,cAAeC,cAAc,GAC3D,CAACF,MAAO,OAAQC,MAAO,OAAQC,cAAc,GAC7C,CAACF,MAAO,mBAAoBC,MAAO,iBAAkBC,cAAc,IAEpEC,aAAc,SAASC,GAEtB,IAAIC,EAAOD,EAAIE,UAGf,GAAY,MAARD,GAAgBA,EAAKE,eAAe,cAAkC,MAAlBF,EAAKG,UAC7D,CACC,IAAIC,EAAYJ,EAAKG,UAEjBC,EAAUC,SAAS,SAEtBN,EAAIO,aAAaC,MAAMC,MAAQ,MAEvBJ,EAAUC,SAAS,aAE3BN,EAAIO,aAAaC,MAAMC,MAAQ,SAGjC,CACD,GAMYC,EAAmC,CAC/C,CACCC,MAAO,WACPC,QAAS,SAASC,EAAGb,GACpBc,MAAMd,EAAIE,UAAUa,KACrB"}
|
||||
-4
File diff suppressed because one or more lines are too long
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user