diff --git a/application/controllers/api/frontend/v1/tempus/Config.php b/application/controllers/api/frontend/v1/tempus/Config.php
index 0bea310c3..27a4958cb 100644
--- a/application/controllers/api/frontend/v1/tempus/Config.php
+++ b/application/controllers/api/frontend/v1/tempus/Config.php
@@ -27,6 +27,11 @@ class Config extends FHCAPI_Controller
public function get()
{
+
+ $language = getUserLanguage() == 'German' ? 0 : 1;
+
+ $this->_ci->KalenderStatusModel->addSelect('*, array_to_json(bezeichnung_mehrsprachig::varchar[])->>' . $language .' AS status');
+ $this->_ci->KalenderStatusModel->addOrder('sort');
$visible_status = $this->_ci->KalenderStatusModel->load();
$visible_status = getData($visible_status);
@@ -34,28 +39,32 @@ class Config extends FHCAPI_Controller
$config['visible_status'] = [
"type" => "select",
"label" => $this->p->t('ui', 'status'),
- "multiple" => true,
"value" => 'all'
];
+
+
foreach ($visible_status as $status)
{
- $config['visible_status']['options'][$status->status_kurzbz] = $status->status_kurzbz;
+ $config['visible_status']['options'][$status->status_kurzbz] = $status->status;
}
$this->terminateWithSuccess($config);
}
public function getHeader()
{
+ $language = getUserLanguage() == 'German' ? 0 : 1;
+
+ $this->_ci->KalenderStatusModel->addSelect('*, array_to_json(bezeichnung_mehrsprachig::varchar[])->>' . $language .' AS status');
+ $this->_ci->KalenderStatusModel->addOrder('sort');
$visible_status = $this->_ci->KalenderStatusModel->load();
$visible_status = getData($visible_status);
-
- $config['visible_status']['all'] = 'all';
+ $config['visible_status']['all'] = 'Alle';
foreach ($visible_status as $status)
{
- $config['visible_status'][$status->status_kurzbz] = $status->bezeichnung;
+ $config['visible_status'][$status->status_kurzbz] = $status->status;
}
$this->terminateWithSuccess($config);
diff --git a/application/controllers/api/frontend/v1/tempus/Coursepicker.php b/application/controllers/api/frontend/v1/tempus/Coursepicker.php
index 0774fc300..73414c75e 100644
--- a/application/controllers/api/frontend/v1/tempus/Coursepicker.php
+++ b/application/controllers/api/frontend/v1/tempus/Coursepicker.php
@@ -9,6 +9,7 @@ class Coursepicker extends FHCAPI_Controller
{
parent::__construct([
'search' => self::PERM_LOGGED,
+ 'getByStg' => self::PERM_LOGGED
]);
$this->_ci = &get_instance();
@@ -18,9 +19,7 @@ class Coursepicker extends FHCAPI_Controller
$this->_ci->load->model('education/Lehreinheitmitarbeiter_model', 'LehreinheitmitarbeiterModel');
- $this->loadPhrases([
- 'ui'
- ]);
+ $this->loadPhrases(['ui']);
}
public function search()
@@ -93,4 +92,163 @@ class Coursepicker extends FHCAPI_Controller
$this->terminateWithSuccess(hasData($result) ? getData($result) : array());
}
+
+ public function getByStg()
+ {
+ //TODO check einbauen ob studiensemester und stg vorhanden ist
+ $stg = $this->input->get('stg');
+ $studiensemester_kurzbz = $this->input->get('studiensemester_kurzbz');
+ if (is_null($stg) || is_null($studiensemester_kurzbz))
+ $this->terminateWithError($this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
+
+ $this->_ci->LehreinheitModel->addSelect('
+ tbl_lehreinheit.lehreinheit_id,
+ tbl_lehreinheit.unr,
+ tbl_lehreinheit.lvnr,
+ tbl_lehreinheit.lehrfach_id,
+ lehrfach.kurzbz AS lehrfach,
+ lehrfach.bezeichnung AS lehrfach_bez,
+ lehrfach.farbe AS lehrfach_farbe,
+ tbl_lehreinheit.lehrform_kurzbz AS lehrform,
+ lema.mitarbeiter_uid AS lektor_uid,
+ ma.kurzbz AS lektor,
+ tbl_person.vorname,
+ tbl_person.nachname,
+ tbl_studiengang.studiengang_kz,
+ upper(tbl_studiengang.typ::character varying::text || tbl_studiengang.kurzbz::text) AS studiengang,
+ lvb.semester,
+ lvb.verband,
+ lvb.gruppe,
+ lvb.gruppe_kurzbz,
+ tbl_lehreinheit.raumtyp,
+ tbl_lehreinheit.raumtypalternativ,
+ tbl_lehreinheit.stundenblockung,
+ tbl_lehreinheit.wochenrythmus,
+ lema.semesterstunden,
+ lema.planstunden,
+ tbl_lehreinheit.start_kw,
+ tbl_lehreinheit.anmerkung,
+ tbl_lehreinheit.studiensemester_kurzbz
+ ');
+ $this->_ci->LehreinheitModel->addJoin('lehre.tbl_lehreinheitmitarbeiter lema', 'tbl_lehreinheit.lehreinheit_id = lema.lehreinheit_id');
+ $this->_ci->LehreinheitModel->addJoin('lehre.tbl_lehreinheitgruppe lvb', 'tbl_lehreinheit.lehreinheit_id = lvb.lehreinheit_id');
+ $this->_ci->LehreinheitModel->addJoin('public.tbl_studiengang', 'lvb.studiengang_kz = tbl_studiengang.studiengang_kz');
+ $this->_ci->LehreinheitModel->addJoin('lehre.tbl_lehrveranstaltung lehrfach', 'tbl_lehreinheit.lehrfach_id = lehrfach.lehrveranstaltung_id');
+ $this->_ci->LehreinheitModel->addJoin('public.tbl_mitarbeiter ma', 'lema.mitarbeiter_uid = ma.mitarbeiter_uid');
+ $this->_ci->LehreinheitModel->addJoin('lehre.tbl_lehrform', 'tbl_lehrform.lehrform_kurzbz = tbl_lehreinheit.lehrform_kurzbz');
+ $this->_ci->LehreinheitModel->addJoin('public.tbl_benutzer', 'ma.mitarbeiter_uid = tbl_benutzer.uid');
+ $this->_ci->LehreinheitModel->addJoin('public.tbl_person', 'tbl_benutzer.person_id = tbl_person.person_id');
+
+ $result = $this->_ci->LehreinheitModel->loadWhere(array(
+ 'tbl_lehrform.verplanen' => true,
+ 'tbl_studiengang.studiengang_kz' => $stg,
+ 'tbl_lehreinheit.studiensemester_kurzbz' => $studiensemester_kurzbz
+ ));
+
+ $result = hasData($result) ? getData($result) : array();
+ $grouped = array();
+
+ foreach ($result as $row)
+ {
+ $unr = $row->unr;
+ if (!isset($grouped[$unr]))
+ {
+ $grouped[$unr] = (object)array(
+ 'unr' => $row->unr,
+ 'lehrfach_id' => $row->lehrfach_id,
+ 'lehrfach_bez' => $row->lehrfach_bez,
+ 'lehrfach_farbe' => $row->lehrfach_farbe,
+ 'studiengang_kz' => $row->studiengang_kz,
+ 'studiengang' => $row->studiengang,
+ 'semester' => $row->semester,
+ 'verband' => $row->verband,
+ 'gruppe' => $row->gruppe,
+ 'gruppe_kurzbz' => $row->gruppe_kurzbz,
+ 'raumtyp' => $row->raumtyp,
+ 'raumtypalternativ' => $row->raumtypalternativ,
+ 'anmerkung' => $row->anmerkung,
+ 'studiensemester_kurzbz' => $row->studiensemester_kurzbz,
+ 'fachbereich_kurzbz' => isset($row->fachbereich_kurzbz) ? $row->fachbereich_kurzbz : null,
+ 'lektoren' => array(),
+ 'lehreinheit_id' => array(),
+ 'lvnr' => array(),
+ 'lehrfach' => array(),
+ 'lehrform' => array(),
+ 'stundenblockung' => array(),
+ 'wochenrythmus' => array(),
+ 'planstunden' => array(),
+ 'start_kw' => array(),
+ 'verplant' => array(),
+ 'offenestunden' => array(),
+ 'lehrverband' => array(),
+ 'lem' => array(),
+ 'verplant_gesamt' => 0,
+ );
+ }
+
+ $group = $grouped[$unr];
+
+ $group->lektoren[$row->lektor_uid] = (object)array(
+ 'uid' => $row->lektor_uid,
+ 'kurzbz' => trim($row->lektor),
+ 'name' => $row->vorname . ' ' . $row->nachname,
+ );
+
+ $group->lehreinheit_id[] = $row->lehreinheit_id;
+ $group->lvnr[] = $row->lvnr;
+ $group->lehrfach[] = $row->lehrfach;
+ $group->lehrform[] = $row->lehrform;
+ $group->stundenblockung[] = $row->stundenblockung;
+ $group->wochenrythmus[] = $row->wochenrythmus;
+ $group->planstunden[] = $row->planstunden;
+ $group->start_kw[] = $row->start_kw;
+ $group->verplant[] = isset($row->verplant) ? $row->verplant : 0;
+ $group->offenestunden[] = isset($row->offenestunden) ? $row->offenestunden : 0;
+ $group->verplant_gesamt += isset($row->verplant) ? $row->verplant : 0;
+
+ $lvb = $row->studiengang . '-' . $row->semester;
+
+ if ($row->verband != '' && $row->verband != ' ' && $row->verband != '0' && $row->verband != null)
+ $lvb .= $row->verband;
+
+ if ($row->gruppe != '' && $row->gruppe != ' ' && $row->gruppe != '0' && $row->gruppe != null)
+ $lvb .= $row->gruppe;
+
+ $group->lehrverband[] = ($row->gruppe_kurzbz != '' && $row->gruppe_kurzbz != null) ? $row->gruppe_kurzbz : $lvb;
+
+ $group->lem[] = array(
+ 'lehreinheit_id' => $row->lehreinheit_id,
+ 'mitarbeiter_uid' => $row->lektor_uid,
+ );
+ }
+
+ foreach ($grouped as $group)
+ {
+ $group->lektoren = array_values($group->lektoren);
+ $group->lehrverband = array_values(array_unique($group->lehrverband));
+ $group->lehrfach = $this->_formatArr($group->lehrfach);
+ $group->lehrform = $this->_formatArr($group->lehrform);
+ $group->stundenblockung = $this->_formatArr($group->stundenblockung);
+ $group->wochenrythmus = $this->_formatArr($group->wochenrythmus);
+ $group->planstunden = $this->_formatArr($group->planstunden);
+ $group->start_kw = $this->_formatArr($group->start_kw);
+ $group->verplant = $this->_formatArr($group->verplant);
+ $group->offenestunden = $this->_formatArr($group->offenestunden);
+ }
+
+ $this->terminateWithSuccess(array_values($grouped));
+ }
+
+ private function _formatArr($arr)
+ {
+ $values = array_values(array_unique($arr));
+ $formatted = implode(' ', $values);
+
+ if (count($formatted) > 1)
+ $formatted .= ' ?';
+
+ return $formatted;
+ }
+
+
}
diff --git a/application/libraries/KalenderLib.php b/application/libraries/KalenderLib.php
index bd0bd71cf..5e33d40e1 100644
--- a/application/libraries/KalenderLib.php
+++ b/application/libraries/KalenderLib.php
@@ -5,9 +5,6 @@ if (! defined("BASEPATH")) exit("No direct script access allowed");
class KalenderLib
{
private $_ci;
- /**
- * Loads model OrganisationseinheitModel
- */
public function __construct()
{
$this->_ci =& get_instance();
@@ -453,8 +450,8 @@ class KalenderLib
{
return $this->_ci->KalenderOrtModel->insert(
array (
- 'kalender_id'=>$kalender_id,
- 'ort_kurzbz'=>$ort_kurzbz
+ 'kalender_id' => $kalender_id,
+ 'ort_kurzbz' => $ort_kurzbz
)
);
}
diff --git a/public/css/Tempus.css b/public/css/Tempus.css
index 7e88e0a42..66c4562a7 100644
--- a/public/css/Tempus.css
+++ b/public/css/Tempus.css
@@ -82,12 +82,32 @@ body {
#parkingslot {
border: 1px dashed;
- max-height: 400px;
+ min-height: 5vh;
+ max-height: 15vh;
color: #AAAAAA;
text-align: center;
font-size: large;
- margin-top: 20px;
- padding-top: 0.5rem;
+ margin-top: 1.25rem;
+ overflow-y: auto;
+ display: flex;
+ align-items: center;
+ justify-content: center;
+ flex-wrap: wrap;
+}
+
+.course-picker {
+ border: 1px dashed #AAAAAA;
+ display: flex;
+ flex-direction: column;
+ flex: 1 1 0;
+ min-height: 0;
+}
+
+.course-picker-row {
+ padding: 0.5rem;
+ margin-bottom: 0.5rem;
+ border: 1px solid var(--bs-border-color);
+ background-color: var(--bs-tertiary-bg);
}
.parkingevent {
@@ -148,30 +168,16 @@ body {
.lecture-selection {
border: 1px dashed #AAAAAA;
margin-bottom: 0.5rem;
- max-height: 300px;
+ max-height: 20vh;
overflow-y: auto;
display: flex;
flex-direction: column;
}
-.course-picker {
- border: 1px dashed #AAAAAA;
- height: 400px;
- max-height: 400px;
- display: flex;
- flex-direction: column;
-}
-.course-picker-row {
- padding: 0.5rem;
- margin-bottom: 0.5rem;
- border: 1px solid var(--bs-border-color);
- background-color: var(--bs-tertiary-bg);
-}
-
.room-selection {
border: 1px dashed #AAAAAA;
margin-bottom: 0.5rem;
- padding: 0.5rem 0.0rem 0.5rem 0.5rem;
+ padding: 0.5rem 0 0.5rem 0.5rem;
}
.btn-link.text-danger {
diff --git a/public/js/api/factory/tempus/coursepicker.js b/public/js/api/factory/tempus/coursepicker.js
index 637caf732..82e1a6965 100644
--- a/public/js/api/factory/tempus/coursepicker.js
+++ b/public/js/api/factory/tempus/coursepicker.js
@@ -3,7 +3,15 @@ export default {
return {
method: 'get',
url: 'api/frontend/v1/tempus/coursepicker/search',
- params: { query }
+ params: { query }
};
- }
+ },
+ getByStg(stg, studiensemester_kurzbz) {
+ return {
+ method: 'get',
+ url: 'api/frontend/v1/tempus/coursepicker/getByStg',
+ params: { stg, studiensemester_kurzbz }
+ };
+ },
+
};
diff --git a/public/js/apps/Tempus.js b/public/js/apps/Tempus.js
index 1faf50956..0cf61f533 100644
--- a/public/js/apps/Tempus.js
+++ b/public/js/apps/Tempus.js
@@ -39,4 +39,5 @@ app
}
})
.use(Phrasen)
+ .directive('tooltip', primevue.tooltip)
.mount('#main');
diff --git a/public/js/components/Calendar/Base.js b/public/js/components/Calendar/Base.js
index 7b770e55c..b83bf722c 100644
--- a/public/js/components/Calendar/Base.js
+++ b/public/js/components/Calendar/Base.js
@@ -63,7 +63,8 @@ export default {
return () => true;
}),
hasDragoverFunc: Vue.computed(() => this.onDragover),
- mode: Vue.computed(() => this.mode)
+ mode: Vue.computed(() => this.mode),
+ onResize: Vue.computed(() => this.onResize || null),
};
},
props: {
@@ -121,7 +122,8 @@ export default {
dropableEvents: [Boolean, Array, Function],
resizableEvents: [Boolean, Array, Function],
onDragover: Function,
- onDrop: Function
+ onDrop: Function,
+ onResize: Function
},
emits: [
"click:next",
@@ -212,7 +214,7 @@ export default {
},
watch: {
sDate(n, o) {
- if (this.sDate.isValid && !this.sDate.hasSame(this.internalDate, 'day'))
+ if (this.sDate.isValid && (!this.internalDate || !this.sDate.hasSame(this.internalDate, 'day')))
this.internalDate = this.sDate;
},
sMode() {
diff --git a/public/js/components/Calendar/Base/Grid.js b/public/js/components/Calendar/Base/Grid.js
index 0c3604669..841908004 100644
--- a/public/js/components/Calendar/Base/Grid.js
+++ b/public/js/components/Calendar/Base/Grid.js
@@ -18,6 +18,7 @@ export default {
originalBackgrounds: "backgrounds",
dropAllowed: "dropAllowed",
onDrop: "onDrop",
+ onResize: "onResize",
timeGrid: {
from: "timeGrid",
default: () => []
@@ -454,7 +455,7 @@ export default {
if (!orig || !newStart || !newEnd)
return;
- this.onDrop?.({
+ this.onResize?.({
item: [{ type: 'kalender', id: orig.kalender_id, orig }],
start: newStart,
end: newEnd
diff --git a/public/js/components/Calendar/Tempus.js b/public/js/components/Calendar/Tempus.js
index ffdce126a..90a25dcc9 100644
--- a/public/js/components/Calendar/Tempus.js
+++ b/public/js/components/Calendar/Tempus.js
@@ -54,13 +54,18 @@ export default {
extraBackgrounds: {
type: Array,
default: () => []
- }
+ },
+ visibleStatus: {
+ type: Array,
+ default: () => ['all']
+ },
},
emits: [
"update:date",
"update:mode",
"update:range",
- "drop"
+ "drop",
+ "resize"
],
data() {
@@ -80,8 +85,7 @@ export default {
}
},
teachingunits: null,
- visibleStatusArray: [],
- visibleStatus: []
+ showRaster: true,
};
},
computed: {
@@ -132,25 +136,6 @@ export default {
},
},
methods: {
- toggleStatus(status) {
- if (status === 'all')
- {
- this.visibleStatus = ['all'];
- return;
- }
-
- this.visibleStatus = this.visibleStatus.filter(visibleStatus => visibleStatus !== 'all');
-
- let found = this.visibleStatus.indexOf(status);
-
- if (found === -1)
- this.visibleStatus.push(status);
- else
- this.visibleStatus.splice(found, 1);
-
- if (this.visibleStatus.length < 1)
- this.visibleStatus.push('all');
- },
eventStyle(event) {
if (!event.farbe)
return undefined;
@@ -163,6 +148,9 @@ export default {
ondrop(payload){
this.$emit('drop', payload);
},
+ onresize(payload){
+ this.$emit('resize', payload);
+ },
resetEventLoader() {
this.reset();
},
@@ -177,6 +165,14 @@ export default {
context.emit('update:lv', newValue);
});
+ const bcc = new BroadcastChannel('fhc-dnd');
+ bcc.onmessage = e => {
+ if (e.data === 'dropped')
+ {
+ reset()
+ }
+ };
+
return {
rangeInterval,
events,
@@ -195,11 +191,6 @@ export default {
end: el.ende
}));
});
- this.$api.call(ApiTempusConfig.getHeader())
- .then(res => {
- this.visibleStatusArray = res.data.visible_status
- this.visibleStatus = ['all']
- });
},
template: /* html */`