diff --git a/application/controllers/api/frontend/v1/Lehrveranstaltung.php b/application/controllers/api/frontend/v1/Lehrveranstaltung.php index 2e254bfc8..935602391 100644 --- a/application/controllers/api/frontend/v1/Lehrveranstaltung.php +++ b/application/controllers/api/frontend/v1/Lehrveranstaltung.php @@ -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)) diff --git a/application/controllers/api/frontend/v1/lv/Lehreinheit.php b/application/controllers/api/frontend/v1/lv/Lehreinheit.php index 958007901..6329d30ac 100644 --- a/application/controllers/api/frontend/v1/lv/Lehreinheit.php +++ b/application/controllers/api/frontend/v1/lv/Lehreinheit.php @@ -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() diff --git a/application/models/education/Lehreinheit_model.php b/application/models/education/Lehreinheit_model.php index e52af4cba..2f955c295 100644 --- a/application/models/education/Lehreinheit_model.php +++ b/application/models/education/Lehreinheit_model.php @@ -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) diff --git a/public/js/components/LVVerwaltung/Details/Direktinskription.js b/public/js/components/LVVerwaltung/Details/Direktinskription.js index 268b1bf28..73e81bea6 100644 --- a/public/js/components/LVVerwaltung/Details/Direktinskription.js +++ b/public/js/components/LVVerwaltung/Details/Direktinskription.js @@ -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" >