mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-19 16:02:15 +00:00
addgroup/addperson immer anzeigen
gruppen sortierung angepasst fehlende les anzeigen
This commit is contained in:
@@ -119,7 +119,19 @@ class Lehrveranstaltung extends FHCAPI_Controller
|
||||
if (hasData($lehreinheiten_data))
|
||||
{
|
||||
$lehreinheiten = getData($lehreinheiten_data);
|
||||
$rowData->_children = $lehreinheiten;
|
||||
|
||||
if (!isset($row->_children))
|
||||
{
|
||||
$row->_children = $lehreinheiten;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!is_array($row->_children))
|
||||
{
|
||||
$row->_children = [$row->_children];
|
||||
}
|
||||
$row->_children = array_merge($row->_children, $lehreinheiten);
|
||||
}
|
||||
}
|
||||
|
||||
if (!isEmptyString($row->studienplan_lehrveranstaltung_id_parent))
|
||||
|
||||
@@ -169,6 +169,10 @@ class Lehreinheit extends FHCAPI_Controller
|
||||
{
|
||||
$value = $this->input->post($field);
|
||||
|
||||
if ($field === 'lehre')
|
||||
{
|
||||
$value = (bool)$value;
|
||||
}
|
||||
if ($value !== null)
|
||||
{
|
||||
$updateData[$field] = $value;
|
||||
@@ -281,15 +285,43 @@ class Lehreinheit extends FHCAPI_Controller
|
||||
public function delete()
|
||||
{
|
||||
$lehreinheit_id = $this->input->post('lehreinheit_id');
|
||||
$lehreinheit = $this->checkLehreinheit($lehreinheit_id);
|
||||
$this->checkPermission($lehreinheit->lehreinheit_id);
|
||||
|
||||
$result = $this->_ci->LehreinheitModel->deleteLehreinheit($lehreinheit->lehreinheit_id);
|
||||
$errors = array();
|
||||
if (is_array($lehreinheit_id))
|
||||
{
|
||||
foreach ($lehreinheit_id as $le_id)
|
||||
{
|
||||
$lehreinheit = $this->checkLehreinheit($le_id);
|
||||
$this->checkPermission($lehreinheit->lehreinheit_id);
|
||||
|
||||
if (isError($result))
|
||||
$this->terminateWithValidationErrors(getError($result));
|
||||
$result = $this->_ci->LehreinheitModel->deleteLehreinheit($lehreinheit->lehreinheit_id);
|
||||
|
||||
$this->terminateWithSuccess('Erfolgreich geloescht');
|
||||
if (isError($result))
|
||||
{
|
||||
$errors[] = getError($result);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
$lehreinheit = $this->checkLehreinheit($lehreinheit_id);
|
||||
$this->checkPermission($lehreinheit->lehreinheit_id);
|
||||
|
||||
$result = $this->_ci->LehreinheitModel->deleteLehreinheit($lehreinheit->lehreinheit_id);
|
||||
|
||||
if (isError($result))
|
||||
$this->terminateWithError(getError($result));
|
||||
}
|
||||
|
||||
if (!isEmptyArray($errors))
|
||||
{
|
||||
if (count($errors) !== count($lehreinheit_id))
|
||||
$this->terminateWithSuccess(array('errors' => $errors));
|
||||
else
|
||||
$this->terminateWithError($errors);
|
||||
}
|
||||
else
|
||||
$this->terminateWithSuccess('Erfolgreich geloescht');
|
||||
}
|
||||
|
||||
public function update()
|
||||
|
||||
@@ -651,7 +651,13 @@ EOSQL;
|
||||
ELSE NULL
|
||||
END
|
||||
END,
|
||||
' '
|
||||
' '
|
||||
ORDER BY
|
||||
UPPER(tbl_studiengang.typ::varchar(1) || tbl_studiengang.kurzbz),
|
||||
COALESCE(TRIM(tbl_lehreinheitgruppe.semester::text), ''),
|
||||
COALESCE(TRIM(tbl_lehreinheitgruppe.verband), ''),
|
||||
COALESCE(TRIM(tbl_lehreinheitgruppe.gruppe), ''),
|
||||
COALESCE(tbl_lehreinheitgruppe.gruppe_kurzbz, '')
|
||||
) AS gruppen
|
||||
FROM lehre.tbl_lehreinheitgruppe
|
||||
LEFT JOIN public.tbl_studiengang USING (studiengang_kz)
|
||||
|
||||
@@ -62,7 +62,6 @@ export default{
|
||||
lastSelected: null,
|
||||
gruppen: [],
|
||||
tabulatorEvents: [],
|
||||
showAutocomplete: false,
|
||||
selectedUser: null,
|
||||
filteredUsers: [],
|
||||
abortController: null,
|
||||
@@ -150,13 +149,9 @@ export default{
|
||||
table-only
|
||||
:side-menu="false"
|
||||
:reload=true
|
||||
:new-btn-label="$p.t('lehre', 'assignPerson')"
|
||||
new-btn-show
|
||||
@click:new="showAutocomplete = !showAutocomplete"
|
||||
>
|
||||
<template #search> <!--TODO (david) Slot prüfen -->
|
||||
<form-input
|
||||
v-if="showAutocomplete"
|
||||
type="autocomplete"
|
||||
:suggestions="filteredUsers"
|
||||
:placeholder="$p.t('lehre', 'assignPerson')"
|
||||
|
||||
@@ -88,7 +88,6 @@ export default{
|
||||
data() {
|
||||
return{
|
||||
tabulatorEvents: [],
|
||||
showAutocomplete: false,
|
||||
filteredGroups: [],
|
||||
selectedGroup: null,
|
||||
abortController: null
|
||||
@@ -197,13 +196,9 @@ export default{
|
||||
table-only
|
||||
:side-menu="false"
|
||||
:reload=true
|
||||
:new-btn-label="$p.t('lehre', 'addGroup')"
|
||||
new-btn-show
|
||||
@click:new="showAutocomplete = !showAutocomplete"
|
||||
>
|
||||
<template #search> <!--TODO (david) Slot prüfen -->
|
||||
<form-input
|
||||
v-if="showAutocomplete"
|
||||
type="autocomplete"
|
||||
:suggestions="filteredGroups"
|
||||
:placeholder="$p.t('lehre', 'addGroup')"
|
||||
|
||||
@@ -39,7 +39,7 @@ export default {
|
||||
dropdowns: this.dropdowns,
|
||||
configShowVertragsdetails: this.config.showVertragsdetails,
|
||||
configShowGewichtung: this.config.showGewichtung,
|
||||
lehreinheitAnmerkungDefault: this.config.lehreinheitAnmerkungDefault,
|
||||
lehreinheitAnmerkungDefault: (this.config.lehreinheitAnmerkungDefault || '').replace(/\\n/g, '\n'),
|
||||
lehreinheitRaumtypDefault: this.config.lehreinheitRaumtypDefault,
|
||||
lehreinheitRaumtypAlternativeDefault: this.config.lehreinheitRaumtypAlternativeDefault,
|
||||
|
||||
|
||||
@@ -33,7 +33,6 @@ export default{
|
||||
handler: this.lektorSelected
|
||||
}
|
||||
],
|
||||
showAutocomplete: false,
|
||||
filteredLektor: [],
|
||||
selectedLektor: '',
|
||||
abortController: null
|
||||
@@ -219,13 +218,9 @@ export default{
|
||||
table-only
|
||||
:side-menu="false"
|
||||
reload
|
||||
:new-btn-label="$p.t('lehre', 'addLektor')"
|
||||
new-btn-show
|
||||
@click:new="showAutocomplete = !showAutocomplete"
|
||||
>
|
||||
<template #search> <!--TODO (david) Slot prüfen -->
|
||||
<form-input
|
||||
v-if="showAutocomplete"
|
||||
type="autocomplete"
|
||||
:suggestions="filteredLektor"
|
||||
:placeholder="$p.t('lehre', 'addLektor')"
|
||||
|
||||
@@ -324,7 +324,7 @@ export default {
|
||||
{title: this.$p.t('lehre', 'lehreinheit_id'), field: "lehreinheit_id", headerFilter: true, headerFilterFuncParams: {field: 'lehreinheit_id'}, visible: false},
|
||||
{title: this.$p.t('lehre', 'studiensemester'), field: "studiensemester_kurzbz", headerFilter: true, headerFilterFuncParams: {field: 'studiensemester_kurzbz'}, visible: false},
|
||||
{title: this.$p.t('lehre', 'unr'), field: "unr", headerFilter: true, headerFilterFuncParams: {field: 'unr'}, visible: false},
|
||||
{title: this.$p.t('lehre', 'fachbereich'), field: "fachbereich", headerFilter: true, headerFilterFuncParams: {field: 'fachbereich'}, visible: false},
|
||||
{title: this.$p.t('lehre', 'organisationseinheit'), field: "fachbereich", headerFilter: true, headerFilterFuncParams: {field: 'fachbereich'}, visible: false},
|
||||
{title: this.$p.t('lehre', 'stundenblockung'), field: "stundenblockung", headerFilter: true, headerFilterFuncParams: {field: 'stundenblockung'}, visible: false},
|
||||
{title: this.$p.t('lehre', 'wochenrhythmus'), field: "wochenrythmus", headerFilter: true, headerFilterFuncParams: {field: 'wochenrythmus'}, visible: false},
|
||||
{title: this.$p.t('lehre', 'startkw'), field: "start_kw", headerFilter: true, headerFilterFuncParams: {field: 'startkw'}, visible: false},
|
||||
@@ -596,11 +596,21 @@ export default {
|
||||
},
|
||||
deleteLehreinheit(row)
|
||||
{
|
||||
let deleteData = {
|
||||
lehreinheit_id: row.getData().lehreinheit_id,
|
||||
}
|
||||
let lehreinheit_id = row.getData().lehreinheit_id;
|
||||
|
||||
let is_selected = this.selectedColumnValues.length > 0 && this.selectedColumnValues.includes(lehreinheit_id);
|
||||
|
||||
let deleteData = is_selected ? {lehreinheit_id: [...new Set(this.selectedColumnValues)]} : {lehreinheit_id: lehreinheit_id};
|
||||
|
||||
return this.$api.call(ApiLehreinheit.delete(deleteData))
|
||||
.then(result => {
|
||||
|
||||
if (result?.data?.errors)
|
||||
{
|
||||
result.data.errors.forEach(error => {
|
||||
this.$fhcAlert.alertError(error)
|
||||
})
|
||||
}
|
||||
this.reload()
|
||||
})
|
||||
.catch(this.$fhcAlert.handleSystemError);
|
||||
|
||||
Reference in New Issue
Block a user