added myLv lehrenheiten table

This commit is contained in:
adisposkofh
2026-10-05 15:14:04 +02:00
parent 8b58c82385
commit a5aa4c8466
8 changed files with 603 additions and 18 deletions
@@ -19,7 +19,8 @@ class Lehreinheit extends FHCAPI_Controller
'getLehrfach' => ['admin:r', 'assistenz:r'],
'getSprache' => ['admin:r', 'assistenz:r'],
'getRaumtyp' => ['admin:r', 'assistenz:r'],
'getLehrform' => ['admin:r', 'assistenz:r']
'getLehrform' => ['admin:r', 'assistenz:r'],
'getLehreinheitenBySemester' => self::PERM_LOGGED,
]);
$this->_ci = &get_instance();
@@ -438,6 +439,14 @@ class Lehreinheit extends FHCAPI_Controller
$this->terminateWithSuccess($this->p->t('global', 'gespeichert'));
}
public function getLehreinheitenBySemester()
{
$semester = $this->input->get('semester');
$lehreinheiten = $this->LehreinheitModel->getLehrenheitenBySemester(getAuthUID(), $semester);
$lehreinheiten = $this->getDataOrTerminateWithError($lehreinheiten);
$this->terminateWithSuccess($lehreinheiten);
}
private function checkPermission($lehreinheit_id)
{
@@ -763,4 +763,37 @@ EOSQL;
return $this->execQuery($query, [$lva_id, $sem_kurzbz, $ma_uid]);
}
public function getLehrenheitenBySemester($uid, $semester)
{
$query = "SELECT
tbl_lehreinheit.lehreinheit_id,
lehrfach.kurzbz as lehrfach,
tbl_lehreinheit.lehrform_kurzbz as lehrform,
tbl_lehrveranstaltung.bezeichnung as lv_bezeichnung,
(SELECT kurzbz FROM public.tbl_mitarbeiter
WHERE mitarbeiter_uid=tbl_lehreinheitmitarbeiter.mitarbeiter_uid) as lektor,
UPPER(tbl_studiengang.typ::varchar(1) || tbl_studiengang.kurzbz) as stg_kurzbz,
tbl_lehrveranstaltung.semester as lv_semester,
tbl_lehreinheit.raumtyp,
tbl_lehreinheit.raumtypalternativ,
tbl_lehreinheit.stundenblockung,
tbl_lehreinheit.wochenrythmus,
tbl_lehreinheitmitarbeiter.semesterstunden as semesterstunden,
tbl_lehreinheit.start_kw,
lvangebot.anmeldefenster_start,
lvangebot.anmeldefenster_ende
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)
LEFT JOIN lehre.tbl_lvangebot as lvangebot ON(tbl_lehrveranstaltung.lehrveranstaltung_id=lvangebot.lehrveranstaltung_id)
WHERE
tbl_lehreinheit.studiensemester_kurzbz = '$semester'
AND mitarbeiter_uid = '$uid'
ORDER BY stg_kurzbz,lv_semester,lv_bezeichnung";
return $this->execReadOnlyQuery($query);
}
}
+28
View File
@@ -0,0 +1,28 @@
/**
* 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/>.
*/
export default {
getLehreinheitenBySemester(semester) {
return {
method: 'get',
url: '/api/frontend/v1/lv/Lehreinheit/getLehreinheitenBySemester',
params: {
semester
},
};
},
};
@@ -0,0 +1,206 @@
import { CoreFilterCmpt } from "../../filter/Filter.js";
import ApiLehreinheit from "../../../api/factory/lehreinheit.js";
export default {
name: "Lehreinheiten",
components: {
CoreFilterCmpt,
},
props: {
semester: null | String,
},
data() {
return {
lehreinheiten: [],
isFetchingLehreinheiten: false,
lehreinheitTableOptions: {
layout: "fitColumns",
columns: [
{
titlePhrase: "lehreinheiten/inputGrades",
title: "placeholder",
field: "inputGrades",
widthGrow: 2,
},
{
title: "ID",
field: "lehreinheitId",
widthGrow: 2,
},
{
titlePhrase: "lehreinheiten/subject",
title: "placeholder",
field: "subject",
widthGrow: 2,
},
{
titlePhrase: "lehreinheiten/lehrform",
title: "placeholder",
field: "lehrform",
widthGrow: 2,
},
{
titlePhrase: "lehreinheiten/title",
title: "placeholder",
field: "title",
widthGrow: 3,
},
{
titlePhrase: "lehreinheiten/lector",
title: "placeholder",
field: "lector",
widthGrow: 2,
},
{
titlePhrase: "lehreinheiten/dp",
title: "placeholder",
field: "stg",
widthGrow: 2,
},
{
titlePhrase: "lehreinheiten/sem",
title: "placeholder",
field: "semester",
widthGrow: 1,
},
{
titlePhrase: "lehreinheiten/groups",
title: "placeholder",
field: "groups",
widthGrow: 2,
},
{
titlePhrase: "lehreinheiten/room",
title: "placeholder",
field: "room",
widthGrow: 3,
},
{
titlePhrase: "lehreinheiten/alt",
title: "placeholder",
field: "alternativeRoom",
widthGrow: 3,
},
{
titlePhrase: "lehreinheiten/block",
title: "placeholder",
field: "block",
widthGrow: 1,
},
{
titlePhrase: "lehreinheiten/wr",
title: "placeholder",
field: "weeklyRhythm",
widthGrow: 1,
},
{
titlePhrase: "lehreinheiten/hrs",
title: "placeholder",
field: "hours",
widthGrow: 1,
bottomCalc: "sum",
bottomCalcParams: { precision: 2 },
},
{
titlePhrase: "lehreinheiten/cw",
title: "placeholder",
field: "cw",
widthGrow: 1,
},
{
titlePhrase: "lehreinheiten/registrationWindowStart",
title: "placeholder",
field: "registrationWindowStart",
widthGrow: 2,
},
{
titlePhrase: "lehreinheiten/registrationWindowEnd",
title: "placeholder",
field: "registrationWindowEnd",
widthGrow: 2,
},
],
locale: true,
persistence: false,
persistenceID: "supervisorTable",
},
};
},
watch: {
semester() {
this.getLehreinheiten();
},
},
methods: {
async getLehreinheiten() {
if (!this.$props.semester?.length) return;
this.lehreinheiten = [];
this.isFetchingLehreinheiten = true;
const lehreinheitenResponse = await this.$api.call(
ApiLehreinheit.getLehreinheitenBySemester(this.$props.semester),
);
if (lehreinheitenResponse.meta.status === "success") {
this.lehreinheiten = lehreinheitenResponse.data.map(
(lehreinheitData) => {
return {
lehreinheitId: lehreinheitData.lehreinheit_id,
subject: lehreinheitData.lehrfach,
lehrform: lehreinheitData.lehrform,
title: lehreinheitData.lv_bezeichnung,
lector: lehreinheitData.lektor,
stg: lehreinheitData.stg_kurzbz,
semester: lehreinheitData.lv_semester,
room: lehreinheitData.raumtyp,
alternativeRoom: lehreinheitData.raumtypalternativ,
block: lehreinheitData.stundenblockung,
weeklyRhythm: lehreinheitData.wochenrythmus,
hours: lehreinheitData.semesterstunden,
cw: lehreinheitData.start_kw,
registrationWindowStart:
lehreinheitData.anmeldefenster_start,
registrationWindowEnd:
lehreinheitData.anmeldefenster_ende,
};
},
);
}
this.setTableData();
this.isFetchingLehreinheiten = false;
},
handleTableBuilt() {
this.setTableData();
},
setTableData() {
if (this.$refs.lehreinheitenTable && this.lehreinheiten?.length) {
this.$refs.lehreinheitenTable.tabulator.setData(this.lehreinheiten);
}
},
},
mounted() {
this.getLehreinheiten();
},
template: /*html*/ `
<div>
<div v-if="isFetchingLehreinheiten" class="d-flex flex-row justify-content-center pt-3">
<i class="fa-solid fa-spinner fa-pulse fa-3x"></i>
</div>
<div v-else-if="lehreinheiten?.length">
<h5>{{ lehreinheiten.length + " teaching units" }}</h5>
<core-filter-cmpt
@tableBuilt="handleTableBuilt()"
ref="lehreinheitenTable"
tableOnly
:tabulator-options="lehreinheitTableOptions"
:sideMenu="false"
/>
</div>
<div v-else class="d-flex flex-row justify-content-center pt-3">
<h4>No teaching units found!</h4>
</div>
</div>
`,
};
@@ -1,12 +0,0 @@
export default {
name: "Lehrenheiten",
props: ["current"],
data() {
return {};
},
template: /*html*/ `
<div>
LEHRENHEITEN PLACEHOLDER
</div>
`,
}
+3 -3
View File
@@ -1,5 +1,5 @@
import Lvs from "./Lvs.js";
import Lehrenheiten from "./Lehrenheiten.js";
import Lehreinheiten from "./Lehreinheiten.js";
import Supervisor from "./Supervisor.js";
import ApiAddons from "../../../api/factory/addons.js"
@@ -8,7 +8,7 @@ export default {
name: 'MyLv',
components: {
Lvs,
Lehrenheiten,
Lehreinheiten,
Supervisor,
},
data: () => {
@@ -155,7 +155,7 @@ export default {
<div class="pt-4">
<lvs v-if="selectedMode === 'lvs' || selectedMode === 'all'" :current="current" />
<hr v-if="selectedMode === 'all'">
<lehrenheiten v-if="selectedMode === 'lehrenheiten' || selectedMode === 'all'" :current="current" />
<lehreinheiten v-if="selectedMode === 'lehrenheiten' || selectedMode === 'all'" :semester="currentSemester" />
<hr v-if="selectedMode === 'all'">
<supervisor v-if="selectedMode === 'supervision' || selectedMode === 'all'" :semester="currentSemester" />
</div>
+1 -2
View File
@@ -15,7 +15,6 @@ export default {
students: [],
isFetchingStudents: false,
supervisorTableOptions: {
index: "lehrveranstaltung_id",
layout: "fitColumns",
columns: [
{
@@ -131,7 +130,7 @@ export default {
<i class="fa-solid fa-spinner fa-pulse fa-3x"></i>
</div>
<div v-else-if="students?.length">
<span>{{ students.length + " supervised students" }}</span>
<h5>{{ students.length + " supervised students" }}</h5>
<core-filter-cmpt
@tableBuilt="handleTableBuilt()"
ref="supervisorTable"
+322
View File
@@ -67155,6 +67155,328 @@ I have been informed that I am under no obligation to consent to the transmissio
)
),
// BETREUUNGEN PHRASES END
// LEHREINHEITEN PHRASES END
array(
'app' => 'core',
'category' => 'lehreinheiten',
'phrase' => 'inputGrades',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Noten eintragen',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Input grades',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'lehreinheiten',
'phrase' => 'subject',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Lehrfach',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Subject',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'lehreinheiten',
'phrase' => 'lehrform',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Lehrform',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Course Type',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'lehreinheiten',
'phrase' => 'title',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'LV Bezeichnung',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Course Title',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'lehreinheiten',
'phrase' => 'lector',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Lektor/in',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Lector',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'lehreinheiten',
'phrase' => 'dp',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Stg',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'DP',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'lehreinheiten',
'phrase' => 'sem',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Sem',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Sem',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'lehreinheiten',
'phrase' => 'groups',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Gruppen',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Groups',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'lehreinheiten',
'phrase' => 'room',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Raumtyp',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Room',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'lehreinheiten',
'phrase' => 'alt',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Alternativ',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Alternative',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'lehreinheiten',
'phrase' => 'block',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Block',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Block',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'lehreinheiten',
'phrase' => 'wr',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'WR',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'WR',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'lehreinheiten',
'phrase' => 'hrs',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Std',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Hrs',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'lehreinheiten',
'phrase' => 'cw',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'KW',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'CW',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'lehreinheiten',
'phrase' => 'registrationWindowStart',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Anm. von',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Registration Start',
'description' => '',
'insertvon' => 'system'
)
)
),
array(
'app' => 'core',
'category' => 'lehreinheiten',
'phrase' => 'registrationWindowEnd',
'insertvon' => 'system',
'phrases' => array(
array(
'sprache' => 'German',
'text' => 'Anm. bis',
'description' => '',
'insertvon' => 'system'
),
array(
'sprache' => 'English',
'text' => 'Registration End',
'description' => '',
'insertvon' => 'system'
)
)
),
// LEHREINHEITEN PHRASES END
);