diff --git a/application/config/Events.php b/application/config/Events.php index 3e0a5248f..80a8f03b3 100644 --- a/application/config/Events.php +++ b/application/config/Events.php @@ -6,30 +6,30 @@ use CI3_Events as Events; Events::on('loadRenderers', function ($renderers) { $fhc_core_renderers =& $renderers(); $fhc_core_renderers["lehreinheit"] = array( - 'calendarEvent' => APP_ROOT.'public/js/components/Cis/Renderer/Lehreinheit/calendarEvent.js', - 'modalTitle' => APP_ROOT.'public/js/components/Cis/Renderer/Lehreinheit/modalTitle.js', - 'modalContent' => APP_ROOT.'public/js/components/Cis/Renderer/Lehreinheit/modalContent.js', - 'calendarEventStyles' => APP_ROOT.'public/css/Cis4/CoreCalendarEvents.css' + 'calendarEvent' => absoluteJsImportUrl('public/js/components/Cis/Renderer/Lehreinheit/calendarEvent.js'), + 'modalTitle' => absoluteJsImportUrl('public/js/components/Cis/Renderer/Lehreinheit/modalTitle.js'), + 'modalContent' => absoluteJsImportUrl('public/js/components/Cis/Renderer/Lehreinheit/modalContent.js'), + 'calendarEventStyles' => APP_ROOT . 'public/css/Cis4/CoreCalendarEvents.css' ); }); Events::on('loadRenderers', function ($renderers) { $fhc_core_renderers =& $renderers(); $fhc_core_renderers["reservierung"] = array( - 'calendarEvent' => APP_ROOT.'public/js/components/Cis/Renderer/Reservierungen/calendarEvent.js', - 'modalTitle' => APP_ROOT.'public/js/components/Cis/Renderer/Reservierungen/modalTitle.js', - 'modalContent' => APP_ROOT.'public/js/components/Cis/Renderer/Reservierungen/modalContent.js', - 'calendarEventStyles' => APP_ROOT.'public/css/Cis4/CoreCalendarEvents.css' + 'calendarEvent' => absoluteJsImportUrl('public/js/components/Cis/Renderer/Reservierungen/calendarEvent.js'), + 'modalTitle' => absoluteJsImportUrl('public/js/components/Cis/Renderer/Reservierungen/modalTitle.js'), + 'modalContent' => absoluteJsImportUrl('public/js/components/Cis/Renderer/Reservierungen/modalContent.js'), + 'calendarEventStyles' => APP_ROOT . 'public/css/Cis4/CoreCalendarEvents.css' ); }); Events::on('loadRenderers', function ($renderers) { $fhc_core_renderers =& $renderers(); $fhc_core_renderers["ferien"] = array( - 'calendarEvent' => APP_ROOT.'public/js/components/Cis/Renderer/Feiertage/calendarEvent.js', - 'modalTitle' => APP_ROOT.'public/js/components/Cis/Renderer/Feiertage/modalTitle.js', - 'modalContent' => APP_ROOT.'public/js/components/Cis/Renderer/Feiertage/modalContent.js', - 'calendarEventStyles' => APP_ROOT.'public/css/Cis4/CoreCalendarEvents.css' + 'calendarEvent' => absoluteJsImportUrl('public/js/components/Cis/Renderer/Feiertage/calendarEvent.js'), + 'modalTitle' => absoluteJsImportUrl('public/js/components/Cis/Renderer/Feiertage/modalTitle.js'), + 'modalContent' => absoluteJsImportUrl('public/js/components/Cis/Renderer/Feiertage/modalContent.js'), + 'calendarEventStyles' => APP_ROOT . 'public/css/Cis4/CoreCalendarEvents.css' ); }); diff --git a/application/config/javascript.php b/application/config/javascript.php index 6f82810e2..7b8342ef8 100644 --- a/application/config/javascript.php +++ b/application/config/javascript.php @@ -7,3 +7,6 @@ $config['use_vuejs_dev_version'] = false; $config['use_bundled_javascript'] = false; // systemerror_mailto use in FHC-Alert Plugin - if empty Link will not be rendered $config['systemerror_mailto'] = ''; +// use fhcomplete_build_version as path element after public (requires apache mod_rewrite) +// see /public/.htaccess_sample for details +$config['use_fhcomplete_build_version_in_path'] = false; diff --git a/application/config/stv.php b/application/config/stv.php index 8942c35e6..34a30a96e 100644 --- a/application/config/stv.php +++ b/application/config/stv.php @@ -130,3 +130,16 @@ $config['students_tab_order'] = [ 'combinePeople', 'archive', ]; + +$config['stv_prestudent_tags'] = [ + 'prioone' => ['readonly' => false], + 'priotwo' => ['readonly' => true], + 'hinweis' => ['readonly' => false], + 'hinweis_assistenz' => ['readonly' => true], + 'hinweis_kf' => ['readonly' => true], + 'hinweis_lehrende' => ['readonly' => false], + 'hinweis_stg_kf' => ['readonly' => true], + 'finished_stg' => ['readonly' => true], + 'finished_kf' => ['readonly' => true], + 'inwork_kf' => ['readonly' => true], +]; diff --git a/application/controllers/Studentenverwaltung.php b/application/controllers/Studentenverwaltung.php index 36c91d5f6..1699ba740 100644 --- a/application/controllers/Studentenverwaltung.php +++ b/application/controllers/Studentenverwaltung.php @@ -28,7 +28,7 @@ class Studentenverwaltung extends Auth_Controller 'basis/prestudentstatus' => $this->permissionlib->isBerechtigt('basis/prestudentstatus'), 'assistenz_stgs' => $this->permissionlib->getSTG_isEntitledFor('assistenz'), 'admin' => $this->permissionlib->isBerechtigt('admin'), - 'assistenz_schreibrechte' => $this->permissionlib->isBerechtigt('assistenz','suid'), + 'assistenz_schreibrechte' => $this->permissionlib->isBerechtigt('assistenz', 'suid'), 'student/keine_studstatuspruefung' => $this->permissionlib->isBerechtigt('student/keine_studstatuspruefung'), 'lehre/reihungstestAufsicht' => $this->permissionlib->isBerechtigt('lehre/reihungstestAufsicht'), 'system/change_outputformat' => $this->permissionlib->getOE_isEntitledFor('system/change_outputformat'), @@ -43,3 +43,5 @@ class Studentenverwaltung extends Auth_Controller ]); } } + + diff --git a/application/controllers/api/frontend/v1/lv/Setup.php b/application/controllers/api/frontend/v1/lv/Setup.php index a2c167dd6..eea4befa5 100644 --- a/application/controllers/api/frontend/v1/lv/Setup.php +++ b/application/controllers/api/frontend/v1/lv/Setup.php @@ -47,22 +47,22 @@ class Setup extends FHCAPI_Controller { $tabs['details'] = array ( 'title' => 'Details', - 'component' => APP_ROOT . 'public/js/components/LVVerwaltung/Tabs/Details.js', + 'component' => absoluteJsImportUrl('public/js/components/LVVerwaltung/Tabs/Details.js'), 'config' => [] ); $tabs['gruppen'] = array ( 'title' => 'Gruppen', - 'component' => APP_ROOT . 'public/js/components/LVVerwaltung/Tabs/Gruppen.js', + 'component' => absoluteJsImportUrl('public/js/components/LVVerwaltung/Tabs/Gruppen.js'), 'config' => [] ); $tabs['lektor'] = array ( 'title' => 'LektorInnenzuteilung', - 'component' => APP_ROOT . 'public/js/components/LVVerwaltung/Tabs/Lektor.js', + 'component' => absoluteJsImportUrl('public/js/components/LVVerwaltung/Tabs/Lektor.js'), 'config' => [] ); $tabs['notiz'] = array ( 'title' => 'Notizen', - 'component' => APP_ROOT . 'public/js/components/LVVerwaltung/Tabs/Notiz.js', + 'component' => absoluteJsImportUrl('public/js/components/LVVerwaltung/Tabs/Notiz.js'), 'config' => [] ); $this->terminateWithSuccess($tabs); diff --git a/application/controllers/api/frontend/v1/notiz/NotizAnrechnung.php b/application/controllers/api/frontend/v1/notiz/NotizAnrechnung.php new file mode 100644 index 000000000..30dae9a50 --- /dev/null +++ b/application/controllers/api/frontend/v1/notiz/NotizAnrechnung.php @@ -0,0 +1,44 @@ + ['admin:r', 'assistenz:r'], + ]); + + //Load Models + $this->load->model('person/Notiz_model', 'NotizModel'); + $this->load->model('person/Notizzuordnung_model', 'NotizzuordnungModel'); + + // Load Libraries + $this->load->library('VariableLib', ['uid' => getAuthUID()]); + + // Load language phrases + $this->loadPhrases([ + 'ui' + ]); + } + + public function isBerechtigt($id, $typeId) + { + if($typeId != "anrechnung_id") + { + $this->terminateWithError($this->p->t('ui','error_typeNotizIdIncorrect'), self::ERROR_TYPE_GENERAL); + } + + //TODO define permission + if(!$this->permissionlib->isBerechtigt('admin', 'suid') && !$this->permissionlib->isBerechtigt('assistenz', 'suid')) + { + $result = $this->p->t('lehre','error_keineSchreibrechte'); + + $this->terminateWithError($result, self::ERROR_TYPE_GENERAL); + } + $this->terminateWithSuccess("berechtigt in überschreibender Funktion"); + } +} \ No newline at end of file diff --git a/application/controllers/api/frontend/v1/notiz/NotizBestellung.php b/application/controllers/api/frontend/v1/notiz/NotizBestellung.php new file mode 100644 index 000000000..e30628f33 --- /dev/null +++ b/application/controllers/api/frontend/v1/notiz/NotizBestellung.php @@ -0,0 +1,43 @@ + ['admin:r', 'assistenz:r'], + ]); + + //Load Models + $this->load->model('person/Notiz_model', 'NotizModel'); + $this->load->model('person/Notizzuordnung_model', 'NotizzuordnungModel'); + + // Load Libraries + $this->load->library('VariableLib', ['uid' => getAuthUID()]); + + // Load language phrases + $this->loadPhrases([ + 'ui' + ]); + } + + public function isBerechtigt($id, $typeId) + { + if($typeId != "bestellung_id") + { + $this->terminateWithError($this->p->t('ui','error_typeNotizIdIncorrect'), self::ERROR_TYPE_GENERAL); + } + //TODO define permission + if(!$this->permissionlib->isBerechtigt('admin', 'suid') && !$this->permissionlib->isBerechtigt('assistenz', 'suid')) + { + $result = $this->p->t('lehre','error_keineSchreibrechte'); + + $this->terminateWithError($result, self::ERROR_TYPE_GENERAL); + } + $this->terminateWithSuccess("berechtigt in überschreibender Funktion"); + } +} \ No newline at end of file diff --git a/application/controllers/api/frontend/v1/notiz/NotizLehreinheit.php b/application/controllers/api/frontend/v1/notiz/NotizLehreinheit.php index f8e1f816b..a3b96d477 100644 --- a/application/controllers/api/frontend/v1/notiz/NotizLehreinheit.php +++ b/application/controllers/api/frontend/v1/notiz/NotizLehreinheit.php @@ -17,5 +17,106 @@ class NotizLehreinheit extends Notiz_Controller 'getMitarbeiter' => ['admin:r', 'assistenz:r'], 'isBerechtigt' => ['admin:r', 'assistenz:r'], ]); + + //Load Models + $this->load->model('person/Notiz_model', 'NotizModel'); + $this->load->model('person/Notizzuordnung_model', 'NotizzuordnungModel'); + $this->load->model('education/Lehreinheit_model', 'LehreinheitModel'); + + // Load Libraries + $this->load->library('VariableLib', ['uid' => getAuthUID()]); + + //Permission checks for allowed Oes + $allowedOes = $this->permissionlib->getOE_isEntitledFor('assistenz') ?: []; + + if ($this->router->method == 'addNewNotiz') + { + $json = $this->input->post('data'); + $post_data = json_decode($json, true); + $lehreinheit_id = $post_data['id']; + + if(!$lehreinheit_id) + { + return $this->terminateWithError($this->p->t('ui', 'error_missingId', ['id'=> 'Lehreinheit ID']), self::ERROR_TYPE_GENERAL); + } + $this->_checkAllowedOesFromLehreinheit($lehreinheit_id, $allowedOes); + } + + if ($this->router->method == 'updateNotiz') + { + $json = $this->input->post('data'); + $post_data = json_decode($json, true); + $notiz_id = $post_data['notiz_id']; + + if(!$notiz_id) + { + return $this->terminateWithError($this->p->t('ui', 'error_missingId', ['id'=> 'Notiz ID']), self::ERROR_TYPE_GENERAL); + } + + //get lehreinheit_id + $result = $this->NotizzuordnungModel->loadWhere(['notiz_id' => $notiz_id]); + + $data = $this->getDataOrTerminateWithError($result); + $lehreinheit_id = current($data)->lehreinheit_id; + + if(!$lehreinheit_id) + { + return $this->terminateWithError($this->p->t('ui', 'error_missingId', ['id'=> 'Lehreinheit ID']), self::ERROR_TYPE_GENERAL); + } + $this->_checkAllowedOesFromLehreinheit($lehreinheit_id, $allowedOes); + } + + if ($this->router->method == 'deleteNotiz') + { + $notiz_id = $this->input->post('notiz_id'); + $lehreinheit_id = $this->input->post('id'); + + if(!$notiz_id) + { + return $this->terminateWithError($this->p->t('ui', 'error_missingId', ['id'=> 'Notiz ID']), self::ERROR_TYPE_GENERAL); + } + + if(!$lehreinheit_id) + { + return $this->terminateWithError($this->p->t('ui', 'error_missingId', ['id'=> 'Lehreinheit ID']), self::ERROR_TYPE_GENERAL); + } + $this->_checkAllowedOesFromLehreinheit($lehreinheit_id, $allowedOes); + } + + // Load language phrases + $this->loadPhrases([ + 'ui' + ]); } -} \ No newline at end of file + + private function _checkAllowedOesFromLehreinheit($lehreinheit_id, $allowedOes) + { + //get oe from lehreinheit + $result = $this->LehreinheitModel->getOes($lehreinheit_id); + $data = $this->getDataOrTerminateWithError($result); + $oes = current($data); + + if (!in_array($oes, $allowedOes)) + { + return $this->terminateWithError($this->p->t('ui', 'error_keineBerechtigungStg') . " " . $oes, self::ERROR_TYPE_GENERAL); + } + } + + public function isBerechtigt($id, $typeId) + { + if($typeId != "lehreinheit_id") + { + $this->terminateWithError($this->p->t('ui','error_typeNotizIdIncorrect'), self::ERROR_TYPE_GENERAL); + } + + if(!$this->permissionlib->isBerechtigt('admin', 'suid') && !$this->permissionlib->isBerechtigt('assistenz', 'suid')) + { + $result = $this->p->t('lehre','error_keineSchreibrechte'); + + $this->terminateWithError($result, self::ERROR_TYPE_GENERAL); + } + $this->terminateWithSuccess("berechtigt in überschreibender Funktion"); + } + + +} diff --git a/application/controllers/api/frontend/v1/notiz/NotizMitarbeiter.php b/application/controllers/api/frontend/v1/notiz/NotizMitarbeiter.php new file mode 100644 index 000000000..f7de4b47b --- /dev/null +++ b/application/controllers/api/frontend/v1/notiz/NotizMitarbeiter.php @@ -0,0 +1,44 @@ + ['admin:r', 'assistenz:r'], + ]); + + //Load Models + $this->load->model('person/Notiz_model', 'NotizModel'); + $this->load->model('person/Notizzuordnung_model', 'NotizzuordnungModel'); + + // Load Libraries + $this->load->library('VariableLib', ['uid' => getAuthUID()]); + + // Load language phrases + $this->loadPhrases([ + 'ui' + ]); + } + + public function isBerechtigt($id, $typeId) + { + if($typeId != "mitarbeiter_uid") + { + $this->terminateWithError($this->p->t('ui','error_typeNotizIdIncorrect'), self::ERROR_TYPE_GENERAL); + } + + //TODO define permission + if(!$this->permissionlib->isBerechtigt('admin', 'suid') && !$this->permissionlib->isBerechtigt('assistenz', 'suid')) + { + $result = $this->p->t('lehre','error_keineSchreibrechte'); + + $this->terminateWithError($result, self::ERROR_TYPE_GENERAL); + } + $this->terminateWithSuccess("berechtigt in überschreibender Funktion"); + } +} \ No newline at end of file diff --git a/application/controllers/api/frontend/v1/notiz/NotizPerson.php b/application/controllers/api/frontend/v1/notiz/NotizPerson.php index 23a8fd199..7f0645bc6 100644 --- a/application/controllers/api/frontend/v1/notiz/NotizPerson.php +++ b/application/controllers/api/frontend/v1/notiz/NotizPerson.php @@ -20,33 +20,123 @@ class NotizPerson extends Notiz_Controller 'isBerechtigt' => ['admin:r', 'assistenz:r'], 'getCountNotes' => ['admin:r', 'assistenz:r'], ]); + + //Load Models + $this->load->model('person/Benutzer_model', 'BenutzerModel'); + $this->load->model('crm/Student_model', 'StudentModel'); + + //Permission checks for allowed Oes + if ($this->router->method == 'addNewNotiz') + { + $json = $this->input->post('data'); + $post_data = json_decode($json, true); + $person_id = $post_data['id']; + + $allowedStgs = $this->permissionlib->getSTG_isEntitledFor('assistenz') ?: []; + + if(!$person_id) + { + return $this->terminateWithError($this->p->t('ui', 'error_missingId', ['id'=> 'Person ID']), self::ERROR_TYPE_GENERAL); + } + $this->_checkIfBerechtigungForOneUidExists($person_id, $allowedStgs); + } + + if ( $this->router->method == 'updateNotiz') + { + $json = $this->input->post('data'); + $post_data = json_decode($json, true); + $notiz_id = $post_data['notiz_id']; + + if(!$notiz_id) + { + return $this->terminateWithError($this->p->t('ui', 'error_missingId', ['id'=> 'Notiz ID']), self::ERROR_TYPE_GENERAL); + } + + //get person_id + $result = $this->NotizzuordnungModel->loadWhere(['notiz_id' => $notiz_id]); + + $data = $this->getDataOrTerminateWithError($result); + $person_id = current($data)->person_id; + + $allowedStgs = $this->permissionlib->getSTG_isEntitledFor('assistenz') ?: []; + $this->_checkIfBerechtigungForOneUidExists($person_id, $allowedStgs); + } + + if ($this->router->method == 'deleteNotiz' ) + { + $notiz_id = $this->input->post('notiz_id'); + $person_id = $this->input->post('id'); + + if(!$notiz_id) + { + return $this->terminateWithError($this->p->t('ui', 'error_missingId', ['id'=> 'Notiz ID']), self::ERROR_TYPE_GENERAL); + } + + if(!$person_id) + { + return $this->terminateWithError($this->p->t('ui', 'error_missingId', ['id'=> 'person ID']), self::ERROR_TYPE_GENERAL); + } + + $allowedStgs = $this->permissionlib->getSTG_isEntitledFor('assistenz') ?: []; + $this->_checkIfBerechtigungForOneUidExists($person_id, $allowedStgs); + } } public function isBerechtigt($id, $typeId) { if($typeId != "person_id") { - return $this->terminateWithError($this->p->t('ui', 'error_typeNotizIdIncorrect'), self::ERROR_TYPE_GENERAL); + $this->terminateWithError($this->p->t('ui', 'error_typeNotizIdIncorrect'), self::ERROR_TYPE_GENERAL); } - //TODO define permission if (!$this->permissionlib->isBerechtigt('admin', 'suid') && !$this->permissionlib->isBerechtigt('assistenz', 'suid')) { $result = $this->p->t('lehre', 'error_keineSchreibrechte'); - - return $this->terminateWithError($result, self::ERROR_TYPE_GENERAL); + $this->terminateWithError($result, self::ERROR_TYPE_GENERAL); } - return $this->outputJsonSuccess(true); + $this->terminateWithSuccess("berechtigt in überschreibender Funktion"); } - public function loadDokumente() + //stv: if person has permission of one studiengang of person -> permission to add/update/delete Note + private function _checkIfBerechtigungForOneUidExists($person_id, $allowedStgs) { - $notiz_id = $this->input->post('notiz_id'); + //get all studentUids of person_id + $result = $this->BenutzerModel->loadWhere(['person_id' => $person_id]); + $data = $this->getDataOrTerminateWithError($result); - // TODO(chris): make CI variant of endpoint - $this->NotizModel->addSelect($this->NotizModel->escape(base_url('content/notizdokdownload.php?id=')) . ' || campus.tbl_dms_version.dms_id AS preview'); - - return parent::loadDokumente(); + $checkarray = []; + foreach ($data as $item) + { + //check if isStudent + $result = $this->StudentModel->isStudent($item->uid); + + $isStudent = $this->getDataOrTerminateWithError($result); + if($isStudent) + { + $checkarray[] = $this->_checkAllowedStgsFromUid($item->uid, $allowedStgs); + } + + } + if (!in_array(1, $checkarray)) + return $this->terminateWithError($this->p->t('ui', 'error_keineBerechtigungStg'), self::ERROR_TYPE_GENERAL); } -} \ No newline at end of file + + private function _checkAllowedStgsFromUid($student_uid, $allowedStgs) + { + $this->load->model('crm/Student_model', 'StudentModel'); + $result = $this->StudentModel->loadWhere(['student_uid' => $student_uid]); + + $data = $this->getDataOrTerminateWithError($result); + $studiengang_kz = current($data)->studiengang_kz; + + if (!in_array($studiengang_kz, $allowedStgs)) + { + return 0; + } + else + { + return 1; + } + } +} diff --git a/application/controllers/api/frontend/v1/notiz/NotizPrestudent.php b/application/controllers/api/frontend/v1/notiz/NotizPrestudent.php new file mode 100644 index 000000000..5e6cd747c --- /dev/null +++ b/application/controllers/api/frontend/v1/notiz/NotizPrestudent.php @@ -0,0 +1,117 @@ + ['admin:r', 'assistenz:r'], + ]); + + //Load Models + $this->load->model('person/Notiz_model', 'NotizModel'); + $this->load->model('person/Notizzuordnung_model', 'NotizzuordnungModel'); + $this->load->model('crm/Student_model', 'StudentModel'); + + // Load Libraries + $this->load->library('VariableLib', ['uid' => getAuthUID()]); + + // Load language phrases + $this->loadPhrases([ + 'ui' + ]); + + //Permission checks for Studiengangsarray + $allowedStgs = $this->permissionlib->getSTG_isEntitledFor('assistenz') ?: []; + + if ($this->router->method == 'addNewNotiz') + { + $json = $this->input->post('data'); + $post_data = json_decode($json, true); + $prestudent_id = $post_data['id']; + + if(!$prestudent_id) + { + return $this->terminateWithError($this->p->t('ui', 'error_missingId', ['id'=> 'Lehreinheit ID']), self::ERROR_TYPE_GENERAL); + } + $this->_checkAllowedOesFromPrestudent($prestudent_id, $allowedStgs); + } + + if ($this->router->method == 'updateNotiz') + { + $json = $this->input->post('data'); + $post_data = json_decode($json, true); + $notiz_id = $post_data['notiz_id']; + + if(!$notiz_id) + { + return $this->terminateWithError($this->p->t('ui', 'error_missingId', ['id'=> 'Notiz ID']), self::ERROR_TYPE_GENERAL); + } + + //get prestudent_id + $result = $this->NotizzuordnungModel->loadWhere(['notiz_id' => $notiz_id]); + + $data = $this->getDataOrTerminateWithError($result); + $prestudent_id = current($data)->prestudent_id; + + if(!$prestudent_id) + { + return $this->terminateWithError($this->p->t('ui', 'error_missingId', ['id'=> 'Prestudent ID']), self::ERROR_TYPE_GENERAL); + } + $this->_checkAllowedOesFromPrestudent($prestudent_id, $allowedStgs); + } + + if ($this->router->method == 'deleteNotiz') + { + $notiz_id = $this->input->post('notiz_id'); + $prestudent_id = $this->input->post('id'); + + if(!$notiz_id) + { + return $this->terminateWithError($this->p->t('ui', 'error_missingId', ['id'=> 'Notiz ID']), self::ERROR_TYPE_GENERAL); + } + + if(!$prestudent_id) + { + return $this->terminateWithError($this->p->t('ui', 'error_missingId', ['id'=> 'Prestudent ID']), self::ERROR_TYPE_GENERAL); + } + $this->_checkAllowedOesFromPrestudent($prestudent_id, $allowedStgs); + } + } + + public function isBerechtigt($id, $typeId) + { + if($typeId != "prestudent_id") + { + $this->terminateWithError($this->p->t('ui','error_typeNotizIdIncorrect'), self::ERROR_TYPE_GENERAL); + } + + if(!$this->permissionlib->isBerechtigt('admin', 'suid') && !$this->permissionlib->isBerechtigt('assistenz', 'suid')) + { + $result = $this->p->t('lehre','error_keineSchreibrechte'); + + $this->terminateWithError($result, self::ERROR_TYPE_GENERAL); + } + $this->terminateWithSuccess("berechtigt in überschreibender Funktion"); + } + + private function _checkAllowedOesFromPrestudent($prestudent_id, $allowedStgs) + { + $student_uid = $this->StudentModel->getUID($prestudent_id); + + $result = $this->StudentModel->loadWhere(['student_uid' => $student_uid]); + + $data = $this->getDataOrTerminateWithError($result); + $studiengang_kz = current($data)->studiengang_kz; + + if (!in_array($studiengang_kz, $allowedStgs)) + { + return $this->terminateWithError($this->p->t('ui', 'error_keineBerechtigungStg'), self::ERROR_TYPE_GENERAL); + } + } + +} \ No newline at end of file diff --git a/application/controllers/api/frontend/v1/notiz/NotizProjekt.php b/application/controllers/api/frontend/v1/notiz/NotizProjekt.php new file mode 100644 index 000000000..9cdde36ae --- /dev/null +++ b/application/controllers/api/frontend/v1/notiz/NotizProjekt.php @@ -0,0 +1,32 @@ + ['admin:r', 'assistenz:r'], + ]); + } + + public function isBerechtigt($id, $typeId) + { + if($typeId != "projekt_kurzbz") + { + $this->terminateWithError($this->p->t('ui','error_typeNotizIdIncorrect'), self::ERROR_TYPE_GENERAL); + } + + //TODO define permission + if(!$this->permissionlib->isBerechtigt('admin', 'suid') && !$this->permissionlib->isBerechtigt('assistenz', 'suid')) + { + $result = $this->p->t('lehre','error_keineSchreibrechte'); + + $this->terminateWithError($result, self::ERROR_TYPE_GENERAL); + } + $this->terminateWithSuccess("berechtigt in überschreibender Funktion"); + } +} \ No newline at end of file diff --git a/application/controllers/api/frontend/v1/notiz/NotizProjektphase.php b/application/controllers/api/frontend/v1/notiz/NotizProjektphase.php new file mode 100644 index 000000000..7a82c658e --- /dev/null +++ b/application/controllers/api/frontend/v1/notiz/NotizProjektphase.php @@ -0,0 +1,32 @@ + ['admin:r', 'assistenz:r'], + ]); + } + + public function isBerechtigt($id, $typeId) + { + if($typeId != "projektphase_id") + { + $this->terminateWithError($this->p->t('ui','error_typeNotizIdIncorrect'), self::ERROR_TYPE_GENERAL); + } + + //TODO define permission + if(!$this->permissionlib->isBerechtigt('admin', 'suid') && !$this->permissionlib->isBerechtigt('assistenz', 'suid')) + { + $result = $this->p->t('lehre','error_keineSchreibrechte'); + + $this->terminateWithError($result, self::ERROR_TYPE_GENERAL); + } + $this->terminateWithSuccess("berechtigt in überschreibender Funktion"); + } +} \ No newline at end of file diff --git a/application/controllers/api/frontend/v1/notiz/NotizProjekttask.php b/application/controllers/api/frontend/v1/notiz/NotizProjekttask.php new file mode 100644 index 000000000..aadb04f40 --- /dev/null +++ b/application/controllers/api/frontend/v1/notiz/NotizProjekttask.php @@ -0,0 +1,32 @@ + ['admin:r', 'assistenz:r'], + ]); + } + + public function isBerechtigt($id, $typeId) + { + if($typeId != "projekttask_id") + { + $this->terminateWithError($this->p->t('ui','error_typeNotizIdIncorrect'), self::ERROR_TYPE_GENERAL); + } + + //TODO define permission + if(!$this->permissionlib->isBerechtigt('admin', 'suid') && !$this->permissionlib->isBerechtigt('assistenz', 'suid')) + { + $result = $this->p->t('lehre','error_keineSchreibrechte'); + + $this->terminateWithError($result, self::ERROR_TYPE_GENERAL); + } + $this->terminateWithSuccess("berechtigt in überschreibender Funktion"); + } +} \ No newline at end of file diff --git a/application/controllers/api/frontend/v1/stv/Aufnahmetermine.php b/application/controllers/api/frontend/v1/stv/Aufnahmetermine.php index 26033908d..437ba42ad 100644 --- a/application/controllers/api/frontend/v1/stv/Aufnahmetermine.php +++ b/application/controllers/api/frontend/v1/stv/Aufnahmetermine.php @@ -36,15 +36,44 @@ class Aufnahmetermine extends FHCAPI_Controller // Load models $this->load->model('crm/Reihungstest_model', 'ReihungstestModel'); $this->load->model('crm/RtPerson_model', 'RtPersonModel'); + $this->load->model('organisation/Studienplan_model', 'StudienplanModel'); + $this->load->model('organisation/Studienordnung_model', 'StudienordnungModel'); + $this->load->model('organisation/Studiengang_model', 'StudiengangModel'); } public function getAufnahmetermine($person_id) { $result = $this->ReihungstestModel->getReihungstestPerson($person_id); + $arrayRt = $this->getDataOrTerminateWithError($result); - $data = $this->getDataOrTerminateWithError($result); + foreach ($arrayRt as $item) { + //Studienplan + $result = $this->StudienplanModel->loadWhere([ + 'studienplan_id' => $item->studienplan_id + ]); + $data = $this->getDataOrTerminateWithError($result); + $studienordnung_id_ber = current($data)->studienordnung_id; - $this->terminateWithSuccess($data); + //Studienordnung + $result = $this->StudienordnungModel->loadWhere([ + 'studienordnung_id' => $studienordnung_id_ber + ]); + $data = $this->getDataOrTerminateWithError($result); + $studiengang_kz_ber = current($data)->studiengang_kz; + + //Studiengang von studiengang_kz_ber + $result = $this->StudiengangModel->load($studiengang_kz_ber); + $data = $this->getDataOrTerminateWithError($result); + + $studiengangkurzbzlang_ber = current($data)->kurzbzlang; + $typ_ber = current($data)->typ; + + //add to Array + $item->studiengang_kz_ber = $studiengang_kz_ber; + $item->studiengangkurzbzlang_ber = $studiengangkurzbzlang_ber; + $item->studiengangtyp_ber = $typ_ber; + } + $this->terminateWithSuccess($arrayRt); } public function insertAufnahmetermin() @@ -60,7 +89,6 @@ class Aufnahmetermine extends FHCAPI_Controller return $this->terminateWithError($this->p->t('ui', 'error_missingId', ['id'=> 'Person ID']), self::ERROR_TYPE_GENERAL); } - $rt_id = (isset($formData['rt_id']) && !empty($formData['rt_id'])) ? $formData['rt_id'] : null; $anmeldedatum = (isset($formData['anmeldedatum']) && !empty($formData['anmeldedatum'])) ? $formData['anmeldedatum'] : null; $teilgenommen = (isset($formData['teilgenommen']) && !empty($formData['teilgenommen'])) ? $formData['teilgenommen'] : false; @@ -224,7 +252,11 @@ class Aufnahmetermine extends FHCAPI_Controller ) ); - $data = $this->getDataOrTerminateWithError($result); + //check if existing placementtest + if(!hasData($result)) + $this->terminateWithSuccess([]); + else + $data = getData($result); $studienplan_arr = []; $include_ids = []; @@ -233,12 +265,18 @@ class Aufnahmetermine extends FHCAPI_Controller if($item->studienplan_id != null) $studienplan_arr[] = $item->studienplan_id; } + if(!hasData($studienplan_arr)) + $this->terminateWithSuccess([]); //get Placementtests Person $person_id = $this->_getPersonId($prestudent_id); $resultRt = $this->ReihungstestModel->getReihungstestPerson($person_id); - $dataRt = $this->getDataOrTerminateWithError($resultRt); + //check if existing placementtest + if(!hasData($result)) + $this->terminateWithSuccess([]); + else + $dataRt = getData($resultRt); foreach ($dataRt as $item) { @@ -354,6 +392,7 @@ class Aufnahmetermine extends FHCAPI_Controller $person_id = $this->input->get('person_id'); $punkte = $this->input->get('punkte'); $reihungstest_id = $this->input->get('reihungstest_id'); + $has_excluded_gebiete = $this->input->get('hasExcludedAreas'); if(!$reihungstest_id) { @@ -364,22 +403,27 @@ class Aufnahmetermine extends FHCAPI_Controller $studiengang_kz = $this->input->get('studiengang_kz'); $this->load->model('testtool/Ablauf_model', 'AblaufModel'); - $result = $this->AblaufModel->getAblaufGebieteAndGewichte($studiengang_kz); + $result = $this->AblaufModel->getAblaufGebieteAndGewichte($studiengang_kz, 1); $data = $this->getDataOrTerminateWithError($result); $weightedArray = []; + $basis_gebiet_id_arr = []; + $basis_gebiet_id_toString = ''; foreach ($data as $abl) { $weightedArray[$abl->gebiet_id] = $abl->gewicht; + $basis_gebiet_id_arr[]= $abl->gebiet_id; } + $basis_gebiet_id_toString = implode(', ', $basis_gebiet_id_arr); - $result = $this->ReihungstestModel->getReihungstestErgebnisPerson($person_id, $punkte, $reihungstest_id, $weightedArray); - -/* if (isError($result)) - { - $this->terminateWithError($result, self::ERROR_TYPE_GENERAL); - }*/ - + $result = $this->ReihungstestModel->getReihungstestErgebnisPerson( + $person_id, + $punkte, + $reihungstest_id, + $weightedArray, + $has_excluded_gebiete, + $basis_gebiet_id_toString + ); $this->terminateWithSuccess($result); } diff --git a/application/controllers/api/frontend/v1/stv/Config.php b/application/controllers/api/frontend/v1/stv/Config.php index 17b360f8c..bc1fbebfe 100644 --- a/application/controllers/api/frontend/v1/stv/Config.php +++ b/application/controllers/api/frontend/v1/stv/Config.php @@ -200,7 +200,8 @@ class Config extends FHCAPI_Controller 'type' => 'select', 'values' => $buchungstyp_kurzbz_plus_all, 'value_key' => 'buchungstyp_kurzbz', - 'label_key' => 'beschreibung' + 'label_key' => 'beschreibung', + 'default' => 'all' ], 'samestg' => [ 'type' => 'bool', @@ -226,7 +227,8 @@ class Config extends FHCAPI_Controller 'type' => 'select', 'values' => $buchungstyp_kurzbz_plus_all, 'value_key' => 'buchungstyp_kurzbz', - 'label_key' => 'beschreibung' + 'label_key' => 'beschreibung', + 'default' => 'all' ], 'samestg' => [ 'type' => 'bool', @@ -504,7 +506,7 @@ class Config extends FHCAPI_Controller { $result['combinePeople'] = [ 'title' => $this->p->t('stv', 'tab_combine_people'), - 'component' => './Stv/Studentenverwaltung/Details/CombinePeople.js', + 'component' => absoluteJsImportUrl('public/js/components/Stv/Studentenverwaltung/Details/CombinePeople.js'), 'config' => $config['combinePeople'] ]; } diff --git a/application/controllers/api/frontend/v1/stv/Students.php b/application/controllers/api/frontend/v1/stv/Students.php index 75302a597..2829828dc 100644 --- a/application/controllers/api/frontend/v1/stv/Students.php +++ b/application/controllers/api/frontend/v1/stv/Students.php @@ -611,7 +611,7 @@ class Students extends FHCAPI_Controller if (!$verband && !$gruppe && $orgform_kurzbz !== null) { $this->PrestudentModel->db->where( "( - SELECT orgform_kurzbz + SELECT orgform_kurzbz FROM public.tbl_prestudentstatus WHERE prestudent_id=tbl_prestudent.prestudent_id AND studiensemester_kurzbz=" . $this->PrestudentModel->escape($studiensemester_kurzbz) . " @@ -855,6 +855,41 @@ 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); + + foreach ($tags as $key => $tag) { + $tags[$key] = $this->db->escape($tag); + } + $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 + "; $this->PrestudentModel->addJoin('public.tbl_studiengang stg', 'studiengang_kz', 'LEFT'); $this->PrestudentModel->addJoin('public.tbl_person p', 'person_id'); @@ -877,8 +912,11 @@ 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'); + $this->PrestudentModel->addSelect("b.uid"); + $this->PrestudentModel->addSelect('tag_data_agg.tags'); $this->PrestudentModel->addSelect('titelpre'); $this->PrestudentModel->addSelect('nachname'); $this->PrestudentModel->addSelect('vorname'); diff --git a/application/controllers/api/frontend/v1/stv/Tags.php b/application/controllers/api/frontend/v1/stv/Tags.php new file mode 100644 index 000000000..3004a1f3b --- /dev/null +++ b/application/controllers/api/frontend/v1/stv/Tags.php @@ -0,0 +1,48 @@ + self::BERECHTIGUNG_KURZBZ, + 'getTags' => self::BERECHTIGUNG_KURZBZ, + 'addTag' => self::BERECHTIGUNG_KURZBZ, + 'updateTag' => self::BERECHTIGUNG_KURZBZ, + 'doneTag' => self::BERECHTIGUNG_KURZBZ, + 'deleteTag' => self::BERECHTIGUNG_KURZBZ + ]); + + $this->config->load('stv'); + } + + public function getTag($readonly_tags = null) + { + parent::getTag($this->config->item('stv_prestudent_tags')); + } + public function getTags($tags = null) + { + parent::getTags($this->config->item('stv_prestudent_tags')); + } + public function addTag($withZuordnung = true, $updatable_tags = null) + { + parent::addTag(true, $this->config->item('stv_prestudent_tags')); + } + public function updateTag($updatable_tags = null) + { + parent::updateTag($this->config->item('stv_prestudent_tags')); + } + public function deleteTag($withZuordnung = true, $updatable_tags = null) + { + parent::deleteTag(true, $this->config->item('stv_prestudent_tags')); + } + public function doneTag($updatable_tags = null) + { + parent::doneTag($this->config->item('stv_prestudent_tags')); + } +} diff --git a/application/controllers/dashboard/Widget.php b/application/controllers/dashboard/Widget.php index 0da6fe8da..9966ddc12 100644 --- a/application/controllers/dashboard/Widget.php +++ b/application/controllers/dashboard/Widget.php @@ -33,19 +33,26 @@ class Widget extends Auth_Controller return $this->outputJsonSuccess([ "widget_id" => 0, "widget_kurzbz" => "notfound", - "arguments" => json_encode([ + "arguments" => [ "className" => 'alert-danger', "title" => 'Widget Not Found', "msg" => 'The widget with the id ' . $widget_id . ' could not be found' - ]), - "setup" => json_encode([ + ], + "setup" => [ "name" => 'Widget Not Found', - "file" => 'DashboardWidget/Default.js', + "file" => absoluteJsImportUrl('public/js/components/DashboardWidget/Default.js'), "width" => 1, "height" => 1 - ]) + ] ]); - return $this->outputJsonSuccess(current(getData($widget))); + + $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() @@ -56,7 +63,16 @@ class Widget extends Auth_Controller if (isError($result)) return $this->outputJsonError(getError($result)); - $this->outputJsonSuccess(getData($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() @@ -71,7 +87,16 @@ class Widget extends Auth_Controller ]); } - $this->outputJsonSuccess(getData($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() diff --git a/application/core/Notiz_Controller.php b/application/core/Notiz_Controller.php index cfc54d5f5..923970923 100644 --- a/application/core/Notiz_Controller.php +++ b/application/core/Notiz_Controller.php @@ -8,7 +8,7 @@ abstract class Notiz_Controller extends FHCAPI_Controller { const DEFAULT_PERMISSION_R = 'admin:r'; const DEFAULT_PERMISSION_RW = 'admin:rw'; - //public function __construct($zuordnung = 'person/Notizzuordnung_model') + public function __construct($permissions) { $default_permissions = [ @@ -97,13 +97,13 @@ abstract class Notiz_Controller extends FHCAPI_Controller if (isError($result)) { $this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL); } - return $this->terminateWithSuccess(getData($result) ?: []); + $this->terminateWithSuccess(getData($result) ?: []); } //Override function protected function isBerechtigt($id, $typeId){ - return $this->terminateWithError("in abstract function: define right in extension", self::ERROR_TYPE_GENERAL); + $this->terminateWithError("in abstract function: define right in extension", self::ERROR_TYPE_GENERAL); } public function loadNotiz() @@ -112,7 +112,6 @@ abstract class Notiz_Controller extends FHCAPI_Controller $notiz_id = $this->input->post('notiz_id'); - //$this->load->model('person/Notiz_model', 'NotizModel'); $this->NotizModel->addJoin('public.tbl_notiz_dokument', 'notiz_id', 'LEFT'); $this->NotizModel->addSelect('*'); $this->NotizModel->addSelect("TO_CHAR(CASE WHEN public.tbl_notiz.updateamum >= public.tbl_notiz.insertamum @@ -143,14 +142,9 @@ abstract class Notiz_Controller extends FHCAPI_Controller $uid = getAuthUID(); - if (isset($_POST['data'])) - { - $data = json_decode($_POST['data']); - unset($_POST['data']); - foreach ($data as $k => $v) { - $_POST[$k] = $v; - } - } + $json = $this->input->post('data'); + $post_data = json_decode($json, true); + $this->form_validation->set_data($post_data); //Form Validation $this->form_validation->set_rules('titel', 'Titel', 'required', [ @@ -166,26 +160,25 @@ abstract class Notiz_Controller extends FHCAPI_Controller $this->terminateWithValidationErrors($this->form_validation->error_array()); } - $titel = $this->input->post('titel'); - $text = $this->input->post('text'); - $erledigt = $this->input->post('erledigt'); - $verfasser_uid = isset($_POST['verfasser']) ? $_POST['verfasser'] : $uid; - $bearbeiter_uid = isset($_POST['bearbeiter']) ? $_POST['bearbeiter'] : null; - $type = $this->input->post('typeId'); - $start = $this->input->post('start'); - $ende = $this->input->post('ende'); + $titel = $post_data['titel']; + $text = $post_data['text']; + $erledigt = $post_data['erledigt']; + $bearbeiter_uid = isset($post_data['bearbeiter']) ? $post_data['bearbeiter'] : null; + $type = $post_data['typeId']; + $start = isset($post_data['start']) ? $post_data['start'] : null; + $ende = isset($post_data['ende']) ? $post_data['ende'] : null; // Start DB transaction $this->db->trans_start(); //Save note - $result = $this->NotizModel->insert(array('titel' => $titel, 'text' => $text, 'erledigt' => $erledigt, 'verfasser_uid' => $verfasser_uid, - "insertvon" => $verfasser_uid, 'start' => $start, 'ende' => $ende, 'bearbeiter_uid' => $bearbeiter_uid)); + $result = $this->NotizModel->insert(array('titel' => $titel, 'text' => $text, 'erledigt' => $erledigt, 'verfasser_uid' => $uid, + "insertvon" => $uid, 'start' => $start, 'ende' => $ende, 'bearbeiter_uid' => $bearbeiter_uid)); if (isError($result)) { $this->db->trans_rollback(); - return $this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL); + $this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL); } $notiz_id = $result->retval; @@ -220,7 +213,7 @@ abstract class Notiz_Controller extends FHCAPI_Controller if (isError($result)) { $this->db->trans_rollback(); - return $this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL); + $this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL); } $dms_id_arr[] = $result->retval['dms_id']; } @@ -235,34 +228,28 @@ abstract class Notiz_Controller extends FHCAPI_Controller if (isError($result)) { $this->db->trans_rollback(); - return $this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL); + $this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL); } } } $this->db->trans_commit(); - return $this->terminateWithSuccess($result); + $this->terminateWithSuccess($result); } public function updateNotiz() { + $this->load->library('form_validation'); $this->load->library('DmsLib'); - if (isset($_POST['data'])) - { - $data = json_decode($_POST['data']); - unset($_POST['data']); - foreach ($data as $k => $v) { - $_POST[$k] = $v; - } - } + $json = $this->input->post('data'); + $post_data = json_decode($json, true); - $notiz_id = $this->input->post('notiz_id'); + $this->form_validation->set_data($post_data); - if(!$notiz_id) - { - $this->terminateWithError($this->p->t('ui','error_missingId',['id'=>'Notiz_id']), self::ERROR_TYPE_GENERAL); - } + $this->form_validation->set_rules('notiz_id', 'Notiz ID', 'required', [ + 'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => 'notiz_id']) + ]); //Form Validation $this->form_validation->set_rules('titel', 'Titel', 'required', [ @@ -280,25 +267,23 @@ abstract class Notiz_Controller extends FHCAPI_Controller //update Notiz $uid = getAuthUID(); - $titel = $this->input->post('titel'); - $text = $this->input->post('text'); - $verfasser_uid = isset($_POST['verfasser']) ? $_POST['verfasser'] : $uid; - $bearbeiter_uid = isset($_POST['bearbeiter']) ? $_POST['bearbeiter'] : $uid; - $erledigt = $this->input->post('erledigt'); - $start = $this->input->post('start'); - $ende = $this->input->post('ende'); + $titel = $post_data['titel']; + $text = $post_data['text']; + $bearbeiter_uid = isset($post_data['bearbeiter']) ? $post_data['bearbeiter'] : $post_data['bearbeiter_uid']; + $erledigt = $post_data['erledigt']; + $start = $post_data['start']; + $ende = $post_data['ende']; $result = $this->NotizModel->update( [ - 'notiz_id' => $notiz_id + 'notiz_id' => $post_data['notiz_id'], ], [ 'titel' => $titel, 'updatevon' => $uid, 'updateamum' => date('c'), 'text' => $text, - 'verfasser_uid' => $verfasser_uid, - 'bearbeiter_uid' => $bearbeiter_uid, + 'bearbeiter_uid' => isEmptyString($bearbeiter_uid) ? null : $bearbeiter_uid, 'start' => $start, 'ende' => $ende, 'erledigt' => $erledigt @@ -306,7 +291,7 @@ abstract class Notiz_Controller extends FHCAPI_Controller ); if (isError($result)) { - return $this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL); + $this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL); } //update(1) loading all dms-entries with this notiz_id @@ -314,7 +299,7 @@ abstract class Notiz_Controller extends FHCAPI_Controller $this->load->model('person/Notizdokument_model', 'NotizdokumentModel'); $this->NotizdokumentModel->addJoin('campus.tbl_dms_version', 'dms_id'); - $result = $this->NotizdokumentModel->loadWhere(array('notiz_id' => $notiz_id)); + $result = $this->NotizdokumentModel->loadWhere(array('notiz_id' => $post_data['notiz_id'])); $result = $this->getDataOrTerminateWithError($result); foreach ($result as $doc) { $dms_id_arr[$doc->dms_id] = array( @@ -351,7 +336,7 @@ abstract class Notiz_Controller extends FHCAPI_Controller $result = $this->getDataOrTerminateWithError($result); $dms_id = $result['dms_id']; - $result = $this->NotizdokumentModel->insert(array('notiz_id' => $notiz_id, 'dms_id' => $dms_id)); + $result = $this->NotizdokumentModel->insert(array('notiz_id' => $post_data['notiz_id'], 'dms_id' => $dms_id)); $this->getDataOrTerminateWithError($result); } @@ -365,7 +350,7 @@ abstract class Notiz_Controller extends FHCAPI_Controller $this->getDataOrTerminateWithError($result); } - return $this->terminateWithSuccess($result); + $this->terminateWithSuccess($result); } public function deleteNotiz() @@ -416,15 +401,15 @@ abstract class Notiz_Controller extends FHCAPI_Controller if (isError($result)) { $this->db->trans_rollback(); - return $this->terminateWithError($result, self::ERROR_TYPE_GENERAL); + $this->terminateWithError($result, self::ERROR_TYPE_GENERAL); } if(!hasData($result)) { - return $this->terminateWithError($this->p->t('ui','error_missingId', ['id'=> 'Notiz_id']), self::ERROR_TYPE_GENERAL); + $this->terminateWithError($this->p->t('ui','error_missingId', ['id'=> 'Notiz_id']), self::ERROR_TYPE_GENERAL); } $this->db->trans_complete(); - return $this->terminateWithSuccess(getData($result)); + $this->terminateWithSuccess(getData($result)); } public function loadDokumente() @@ -440,14 +425,14 @@ abstract class Notiz_Controller extends FHCAPI_Controller array('public.tbl_notiz.notiz_id' => $notiz_id) ); if (isError($result)) { - return $this->terminateWithError($result, self::ERROR_TYPE_GENERAL); + $this->terminateWithError($result, self::ERROR_TYPE_GENERAL); } if(!hasData($result)) { - return $this->terminateWithError($this->p->t('ui','error_missingId', ['id'=> 'Notiz_id']), self::ERROR_TYPE_GENERAL); + $this->terminateWithError($this->p->t('ui','error_missingId', ['id'=> 'Notiz_id']), self::ERROR_TYPE_GENERAL); } - return $this->terminateWithSuccess(getData($result)); + $this->terminateWithSuccess(getData($result)); } public function getMitarbeiter($searchString) @@ -457,7 +442,7 @@ abstract class Notiz_Controller extends FHCAPI_Controller if (isError($result)) { $this->terminateWithError($result, self::ERROR_TYPE_GENERAL); } - return $this->terminateWithSuccess($result); + $this->terminateWithSuccess($result); } public function getCountNotes($person_id) @@ -476,4 +461,4 @@ abstract class Notiz_Controller extends FHCAPI_Controller return $this->terminateWithSuccess($anzahl->anzahl ?: 0); } -} \ No newline at end of file +} diff --git a/application/helpers/hlp_header_helper.php b/application/helpers/hlp_header_helper.php index 309bdedbd..41d40ca0d 100644 --- a/application/helpers/hlp_header_helper.php +++ b/application/helpers/hlp_header_helper.php @@ -185,7 +185,15 @@ function generateJSModulesInclude($JSModules) for ($tmpJSsCounter = 0; $tmpJSsCounter < count($tmpJSs); $tmpJSsCounter++) { - $toPrint = sprintf($jsInclude, base_url($tmpJSs[$tmpJSsCounter].$cachetoken)).PHP_EOL; + if($ci->config->item('use_fhcomplete_build_version_in_path')) + { + $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($tmpJSs[$tmpJSsCounter].$cachetoken)).PHP_EOL; + } if ($tmpJSsCounter > 0) $toPrint = "\t\t".$toPrint; @@ -250,6 +258,14 @@ function generateSkipLink($skipID) function absoluteJsImportUrl($relurl) { $ci =& get_instance(); - $url = base_url($relurl) . '?'. $ci->config->item('fhcomplete_build_version'); + $ci->load->config('javascript'); + if($ci->config->item('use_fhcomplete_build_version_in_path')) + { + $url = base_url(preg_replace('#^public/#', 'public/' . $ci->config->item('fhcomplete_build_version') . '/', $relurl)); + } + else + { + $url = base_url($relurl) . '?'. $ci->config->item('fhcomplete_build_version'); + } return $url; -} \ No newline at end of file +} diff --git a/application/models/crm/Reihungstest_model.php b/application/models/crm/Reihungstest_model.php index a685b01cd..efef0a8fa 100644 --- a/application/models/crm/Reihungstest_model.php +++ b/application/models/crm/Reihungstest_model.php @@ -10,7 +10,7 @@ class Reihungstest_model extends DB_Model parent::__construct(); $this->dbTable = 'public.tbl_reihungstest'; $this->pk = 'reihungstest_id'; - } + } /** * Gets a test from a test id only if it is available @@ -42,8 +42,8 @@ class Reihungstest_model extends DB_Model /** * Checks if there are active studyplans which have no public placement tests assigned yet. * Only check assignment to studyplans that are - * - Bachelor, - * - active, + * - Bachelor, + * - active, * - set as online application * - valid for 1st terms * @return array Returns object array with studyplans that have no public placement tests assigned yet. @@ -97,7 +97,7 @@ class Reihungstest_model extends DB_Model USING (reihungstest_id) WHERE datum >= now() - AND + AND oeffentlich = \'t\' ) '; @@ -105,7 +105,7 @@ class Reihungstest_model extends DB_Model return $this->execQuery($query); } - /** + /** * Gets amount of free places. * @return array Returns object array with faculty and amount of free places * for each public actual placement test date. @@ -432,10 +432,10 @@ class Reihungstest_model extends DB_Model } /** - * Loads all applicants of a placement test - * @param integer $reihungstest_id ID of placement test - * @return array Returns object array with data of applicants. - */ + * Loads all applicants of a placement test + * @param integer $reihungstest_id ID of placement test + * @return array Returns object array with data of applicants. + */ public function getApplicantsOfPlacementTest($reihungstest_id) { $query = ' @@ -556,13 +556,22 @@ class Reihungstest_model extends DB_Model * Calculates Result of Placement Test for a given Person and given placementtest * and with taking account of weighting per area * - * @param $person_id ID of Person - * @param $punkte if true result is points else result is percentage of sum - * @param $reihungstest_id ID of Placementtest - * @param $weightedArray array of weighting per area (gewicht per gebiet_id) - * @return float result + * @param Number $person_id ID of Person + * @param Boolean $punkte if true result is points else result is percentage of sum + * @param Number $reihungstest_id ID of Placementtest + * @param Array $weightedArray array of weighting per area (gewicht per gebiet_id) + * @param Boolean $has_excluded_gebiete if true, areas in the configArray will be excluded + * @param Array $basis_gebiet_id_toString areas to exclude + * @return float result points of RT */ - public function getReihungstestErgebnisPerson($person_id, $punkte, $reihungstest_id, $weightedArray = null) + public function getReihungstestErgebnisPerson( + $person_id, + $punkte, + $reihungstest_id, + $weightedArray = null, + $has_excluded_gebiete = false, + $basis_gebiet_id_toString = null + ) { $parametersArray = array($reihungstest_id); @@ -577,6 +586,35 @@ class Reihungstest_model extends DB_Model WHERE reihungstest_id = ? "; + //areas of Studiengang + if (!empty($basis_gebiet_id_toString)) + { + $qry .= " + AND + gebiet_id IN (". $basis_gebiet_id_toString. ") + "; + } + + //areas to exclude + if($has_excluded_gebiete) + { + if (defined('FAS_REIHUNGSTEST_EXCLUDE_GEBIETE') && !empty(FAS_REIHUNGSTEST_EXCLUDE_GEBIETE)) + { + $excluded_gebiete = unserialize(FAS_REIHUNGSTEST_EXCLUDE_GEBIETE); + $exclude_gebiet_id_arr = $excluded_gebiete; + if (is_array($exclude_gebiet_id_arr) && count($exclude_gebiet_id_arr) > 0) + { + $exclude_gebiet_id_toString = implode(', ', $exclude_gebiet_id_arr); + $qry .= " + AND + gebiet_id NOT IN (". $exclude_gebiet_id_toString. ") + -- AND + -- typ = 'b' + "; + } + } + } + //using prestudent Status to avoid to get the sum of more than 1 placement tests $qry .= " AND prestudent_id = ( diff --git a/application/views/Studentenverwaltung.php b/application/views/Studentenverwaltung.php index ee5d9fb85..09d02bfbd 100644 --- a/application/views/Studentenverwaltung.php +++ b/application/views/Studentenverwaltung.php @@ -14,6 +14,7 @@ 'ui', 'notiz', ), + 'tags' => true, 'customCSSs' => [ #datepicker fuer component functions 'public/css/components/vue-datepicker.css', @@ -46,6 +47,7 @@ $configArray = [ 'showAufnahmegruppen' => !defined('FAS_REIHUNGSTEST_AUFNAHMEGRUPPEN') ? false : FAS_REIHUNGSTEST_AUFNAHMEGRUPPEN, 'allowUebernahmePunkte' => !defined('FAS_REIHUNGSTEST_PUNKTEUEBERNAHME') ? true : FAS_REIHUNGSTEST_PUNKTEUEBERNAHME, 'useReihungstestPunkte' => !defined('FAS_REIHUNGSTEST_PUNKTE') ? true : FAS_REIHUNGSTEST_PUNKTE, + 'hasExcludedAreas' => defined('FAS_REIHUNGSTEST_EXCLUDE_GEBIETE') && !empty(FAS_REIHUNGSTEST_EXCLUDE_GEBIETE), ]; ?> diff --git a/public/.htaccess_sample b/public/.htaccess_sample new file mode 100644 index 000000000..e3f3485f6 --- /dev/null +++ b/public/.htaccess_sample @@ -0,0 +1,9 @@ + + RewriteEngine On + RewriteCond %{REQUEST_FILENAME} !-f + RewriteCond %{REQUEST_FILENAME} !-d + RewriteRule ^[0-9]{10}/(.*)$ $1 [L] + RewriteCond %{REQUEST_URI} ^(.*?)/public/index.ci.php/ + RewriteRule ^index.ci.php/(.*)$ %1/index.ci.php/$1 [R=303] + + diff --git a/public/css/Studentenverwaltung.css b/public/css/Studentenverwaltung.css index eb6becc15..48d36e99a 100644 --- a/public/css/Studentenverwaltung.css +++ b/public/css/Studentenverwaltung.css @@ -74,6 +74,12 @@ html.fs_huge { color: var(--gray-500); } +/* Aufnahme Termine: background color green*/ +.stv-details-admission-table .row-green{ + background-color: lightgreen !important; + //color: var(--green-200); +} + /* Dropdown Toolbar Interessent, submenu */ .dropend .dropdown-toggle.d-flex::after { height: 0; @@ -116,6 +122,15 @@ html.fs_huge { position: inherit; z-index: 1; } + + .sidebar-collapsed #sidebarMenu { + display: none !important; + } + + .sidebar-collapsed .container-fluid > .row > main { + flex: 0 0 100%; + max-width: 100%; + } } diff --git a/public/js/api/factory/notiz/anrechnung.js b/public/js/api/factory/notiz/anrechnung.js new file mode 100644 index 000000000..ba458abf5 --- /dev/null +++ b/public/js/api/factory/notiz/anrechnung.js @@ -0,0 +1,29 @@ +/** + * Copyright (C) 2025 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 . + */ + +import Person from './person.js'; + +export default { + + ...Person, + getNotizen(id, type) { + return { + method: 'get', + url: 'api/frontend/v1/notiz/notizAnrechnung/getNotizen/' + encodeURIComponent(id) + '/' + encodeURIComponent(type) + }; + }, +}; diff --git a/public/js/api/factory/notiz/bestellung.js b/public/js/api/factory/notiz/bestellung.js new file mode 100644 index 000000000..3d94a7c25 --- /dev/null +++ b/public/js/api/factory/notiz/bestellung.js @@ -0,0 +1,29 @@ +/** + * Copyright (C) 2025 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 . + */ + +import Person from './person.js'; + +export default { + + ...Person, + getNotizen(id, type) { + return { + method: 'get', + url: 'api/frontend/v1/notiz/notizBestellung/getNotizen/' + encodeURIComponent(id) + '/' + encodeURIComponent(type) + }; + }, +}; \ No newline at end of file diff --git a/public/js/api/factory/notiz/lehreinheit.js b/public/js/api/factory/notiz/lehreinheit.js index d93bb50f9..762e5c596 100644 --- a/public/js/api/factory/notiz/lehreinheit.js +++ b/public/js/api/factory/notiz/lehreinheit.js @@ -26,4 +26,29 @@ export default { url: 'api/frontend/v1/notiz/notizLehreinheit/getNotizen/' + encodeURIComponent(id) + '/' + encodeURIComponent(type) }; }, + addNewNotiz(lehreinheit_id, params) { + return { + method: 'post', + url: 'api/frontend/v1/notiz/notizLehreinheit/addNewNotiz/' + lehreinheit_id, + params + }; + }, + updateNotiz(notiz_id, params) { + return { + method: 'post', + url: 'api/frontend/v1/notiz/notizLehreinheit/updateNotiz/' + notiz_id, + params + }; + }, + deleteNotiz(notiz_id, type_id, id) { + return { + method: 'post', + url: 'api/frontend/v1/notiz/notizLehreinheit/deleteNotiz/', + params: { + notiz_id, + type_id, + id + } + }; + }, }; diff --git a/public/js/api/factory/notiz/mitarbeiter.js b/public/js/api/factory/notiz/mitarbeiter.js new file mode 100644 index 000000000..6ddb89af7 --- /dev/null +++ b/public/js/api/factory/notiz/mitarbeiter.js @@ -0,0 +1,29 @@ +/** + * Copyright (C) 2025 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 . + */ + +import Person from './person.js'; + +export default { + + ...Person, + getNotizen(id, type) { + return { + method: 'get', + url: 'api/frontend/v1/notiz/notizMitarbeiter/getNotizen/' + encodeURIComponent(id) + '/' + encodeURIComponent(type) + }; + }, +}; \ No newline at end of file diff --git a/public/js/api/factory/notiz/prestudent.js b/public/js/api/factory/notiz/prestudent.js new file mode 100644 index 000000000..f117a77ff --- /dev/null +++ b/public/js/api/factory/notiz/prestudent.js @@ -0,0 +1,29 @@ +/** + * Copyright (C) 2025 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 . + */ + +import Person from './person.js'; + +export default { + + ...Person, + getNotizen(id, type) { + return { + method: 'get', + url: 'api/frontend/v1/notiz/notizPrestudent/getNotizen/' + encodeURIComponent(id) + '/' + encodeURIComponent(type) + }; + }, +}; \ No newline at end of file diff --git a/public/js/api/factory/notiz/projekt.js b/public/js/api/factory/notiz/projekt.js new file mode 100644 index 000000000..f1dab754d --- /dev/null +++ b/public/js/api/factory/notiz/projekt.js @@ -0,0 +1,29 @@ +/** + * Copyright (C) 2025 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 . + */ + +import Person from './person.js'; + +export default { + + ...Person, + getNotizen(id, type) { + return { + method: 'get', + url: 'api/frontend/v1/notiz/notizProjekt/getNotizen/' + encodeURIComponent(id) + '/' + encodeURIComponent(type) + }; + }, +}; \ No newline at end of file diff --git a/public/js/api/factory/notiz/projektphase.js b/public/js/api/factory/notiz/projektphase.js new file mode 100644 index 000000000..6762e8456 --- /dev/null +++ b/public/js/api/factory/notiz/projektphase.js @@ -0,0 +1,29 @@ +/** + * Copyright (C) 2025 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 . + */ + +import Person from './person.js'; + +export default { + + ...Person, + getNotizen(id, type) { + return { + method: 'get', + url: 'api/frontend/v1/notiz/notizProjektphase/getNotizen/' + encodeURIComponent(id) + '/' + encodeURIComponent(type) + }; + }, +}; \ No newline at end of file diff --git a/public/js/api/factory/notiz/projekttask.js b/public/js/api/factory/notiz/projekttask.js new file mode 100644 index 000000000..27a74bb08 --- /dev/null +++ b/public/js/api/factory/notiz/projekttask.js @@ -0,0 +1,29 @@ +/** + * Copyright (C) 2025 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 . + */ + +import Person from './person.js'; + +export default { + + ...Person, + getNotizen(id, type) { + return { + method: 'get', + url: 'api/frontend/v1/notiz/notizProjekttask/getNotizen/' + encodeURIComponent(id) + '/' + encodeURIComponent(type) + }; + }, +}; \ No newline at end of file diff --git a/public/js/api/factory/stv/tag.js b/public/js/api/factory/stv/tag.js new file mode 100644 index 000000000..29675f6d4 --- /dev/null +++ b/public/js/api/factory/stv/tag.js @@ -0,0 +1,54 @@ +export default { + + getTag(data) + { + return { + method: 'get', + url: 'api/frontend/v1/stv/Tags/getTag', + params: data + }; + }, + + getTags(data) + { + return { + method: 'get', + url: 'api/frontend/v1/stv/Tags/getTags' + }; + }, + + addTag(data) + { + return { + method: 'post', + url: 'api/frontend/v1/stv/Tags/addTag', + params: data + }; + }, + + updateTag(data) + { + return { + method: 'post', + url: 'api/frontend/v1/stv/Tags/updateTag', + params: data + }; + }, + doneTag(data) + { + return { + method: 'post', + url: 'api/frontend/v1/stv/Tags/doneTag', + params: data + }; + }, + + deleteTag(data) + { + return { + method: 'post', + url: 'api/frontend/v1/stv/Tags/deleteTag', + params: data + }; + }, +}; \ No newline at end of file diff --git a/public/js/api/notiz.js b/public/js/api/notiz.js index 0a1034703..a75eb6f2d 100644 --- a/public/js/api/notiz.js +++ b/public/js/api/notiz.js @@ -1,5 +1,22 @@ import person from "./notiz/person.js"; +import prestudent from "./notiz/prestudent.js"; +import mitarbeiter from "./notiz/mitarbeiter.js"; +import projekt from "./notiz/projekt.js"; +import anrechnung from "./notiz/anrechnung.js"; +import bestellung from "./notiz/bestellung.js"; +import lehreinheit from "./notiz/lehreinheit.js"; +import projektphase from "./notiz/projektphase.js"; +import projekttask from "./notiz/projekttask.js"; + export default { - person -} \ No newline at end of file + person, + prestudent, + mitarbeiter, + anrechnung, + bestellung, + lehreinheit, + projekt, + projektphase, + projekttask, +} diff --git a/public/js/api/notiz/anrechnung.js b/public/js/api/notiz/anrechnung.js new file mode 100644 index 000000000..843017687 --- /dev/null +++ b/public/js/api/notiz/anrechnung.js @@ -0,0 +1,38 @@ +export default { + getNotizen(url, config, params){ + return this.$fhcApi.get('api/frontend/v1/notiz/notizAnrechnung/getNotizen/' + params.id + '/' + params.type); + }, + getUid(){ + return this.$fhcApi.get('api/frontend/v1/notiz/notizAnrechnung/getUid/'); + }, + addNewNotiz(id, formData) { + return this.$fhcApi.post('api/frontend/v1/notiz/notizAnrechnung/addNewNotiz/' + id, + formData + ); + }, + loadNotiz(notiz_id){ + return this.$fhcApi.post('api/frontend/v1/notiz/notizAnrechnung/loadNotiz/', { + notiz_id + }); + }, + loadDokumente(notiz_id){ + return this.$fhcApi.post('api/frontend/v1/notiz/notizAnrechnung/loadDokumente/', { + notiz_id + }); + }, + deleteNotiz(notiz_id, type_id, id){ + return this.$fhcApi.post('api/frontend/v1/notiz/notizAnrechnung/deleteNotiz/', { + notiz_id, + type_id, + id + }); + }, + updateNotiz(notiz_id, formData){ + return this.$fhcApi.post('api/frontend/v1/notiz/notizAnrechnung/updateNotiz/' + notiz_id, + formData + ); + }, + getMitarbeiter(event){ + return this.$fhcApi.get('api/frontend/v1/notiz/notizAnrechnung/getMitarbeiter/' + event); + } +} \ No newline at end of file diff --git a/public/js/api/notiz/bestellung.js b/public/js/api/notiz/bestellung.js new file mode 100644 index 000000000..3f0f5268c --- /dev/null +++ b/public/js/api/notiz/bestellung.js @@ -0,0 +1,38 @@ +export default { + getNotizen(url, config, params){ + return this.$fhcApi.get('api/frontend/v1/notiz/notizBestellung/getNotizen/' + params.id + '/' + params.type); + }, + getUid(){ + return this.$fhcApi.get('api/frontend/v1/notiz/notizBestellung/getUid/'); + }, + addNewNotiz(id, formData) { + return this.$fhcApi.post('api/frontend/v1/notiz/notizBestellung/addNewNotiz/' + id, + formData + ); + }, + loadNotiz(notiz_id){ + return this.$fhcApi.post('api/frontend/v1/notiz/notizBestellung/loadNotiz/', { + notiz_id + }); + }, + loadDokumente(notiz_id){ + return this.$fhcApi.post('api/frontend/v1/notiz/notizBestellung/loadDokumente/', { + notiz_id + }); + }, + deleteNotiz(notiz_id, type_id, id){ + return this.$fhcApi.post('api/frontend/v1/notiz/notizBestellung/deleteNotiz/', { + notiz_id, + type_id, + id + }); + }, + updateNotiz(notiz_id, formData){ + return this.$fhcApi.post('api/frontend/v1/notiz/notizBestellung/updateNotiz/' + notiz_id, + formData + ); + }, + getMitarbeiter(event){ + return this.$fhcApi.get('api/frontend/v1/notiz/notizBestellung/getMitarbeiter/' + event); + } +} \ No newline at end of file diff --git a/public/js/api/notiz/lehreinheit.js b/public/js/api/notiz/lehreinheit.js new file mode 100644 index 000000000..85b3187ae --- /dev/null +++ b/public/js/api/notiz/lehreinheit.js @@ -0,0 +1,38 @@ +export default { + getNotizen(url, config, params){ + return this.$fhcApi.get('api/frontend/v1/notiz/notizLehreinheit/getNotizen/' + params.id + '/' + params.type); + }, + getUid(){ + return this.$fhcApi.get('api/frontend/v1/notiz/notizLehreinheit/getUid/'); + }, + addNewNotiz(id, formData) { + return this.$fhcApi.post('api/frontend/v1/notiz/notizLehreinheit/addNewNotiz/' + id, + formData + ); + }, + loadNotiz(notiz_id){ + return this.$fhcApi.post('api/frontend/v1/notiz/notizLehreinheit/loadNotiz/', { + notiz_id + }); + }, + loadDokumente(notiz_id){ + return this.$fhcApi.post('api/frontend/v1/notiz/notizLehreinheit/loadDokumente/', { + notiz_id + }); + }, + deleteNotiz(notiz_id, type_id, id){ + return this.$fhcApi.post('api/frontend/v1/notiz/notizLehreinheit/deleteNotiz/', { + notiz_id, + type_id, + id + }); + }, + updateNotiz(notiz_id, formData){ + return this.$fhcApi.post('api/frontend/v1/notiz/notizLehreinheit/updateNotiz/' + notiz_id, + formData + ); + }, + getMitarbeiter(event){ + return this.$fhcApi.get('api/frontend/v1/notiz/notizLehreinheit/getMitarbeiter/' + event); + } +} \ No newline at end of file diff --git a/public/js/api/notiz/mitarbeiter.js b/public/js/api/notiz/mitarbeiter.js new file mode 100644 index 000000000..ada9b0ae8 --- /dev/null +++ b/public/js/api/notiz/mitarbeiter.js @@ -0,0 +1,38 @@ +export default { + getNotizen(url, config, params){ + return this.$fhcApi.get('api/frontend/v1/notiz/notizMitarbeiter/getNotizen/' + params.id + '/' + params.type); + }, + getUid(){ + return this.$fhcApi.get('api/frontend/v1/notiz/notizMitarbeiter/getUid/'); + }, + addNewNotiz(id, formData) { + return this.$fhcApi.post('api/frontend/v1/notiz/notizMitarbeiter/addNewNotiz/' + id, + formData + ); + }, + loadNotiz(notiz_id){ + return this.$fhcApi.post('api/frontend/v1/notiz/notizMitarbeiter/loadNotiz/', { + notiz_id + }); + }, + loadDokumente(notiz_id){ + return this.$fhcApi.post('api/frontend/v1/notiz/notizMitarbeiter/loadDokumente/', { + notiz_id + }); + }, + deleteNotiz(notiz_id, type_id, id){ + return this.$fhcApi.post('api/frontend/v1/notiz/notizMitarbeiter/deleteNotiz/', { + notiz_id, + type_id, + id + }); + }, + updateNotiz(notiz_id, formData){ + return this.$fhcApi.post('api/frontend/v1/notiz/notizMitarbeiter/updateNotiz/' + notiz_id, + formData + ); + }, + getMitarbeiter(event){ + return this.$fhcApi.get('api/frontend/v1/notiz/notizMitarbeiter/getMitarbeiter/' + event); + } +} \ No newline at end of file diff --git a/public/js/api/notiz/person.js b/public/js/api/notiz/person.js index 04812eacc..cce0ff8c0 100644 --- a/public/js/api/notiz/person.js +++ b/public/js/api/notiz/person.js @@ -38,4 +38,4 @@ export default { isBerechtigt(id, type_id){ return this.$fhcApi.get('api/frontend/v1/notiz/notizPerson/isBerechtigt/'); } -} \ No newline at end of file +} diff --git a/public/js/api/notiz/prestudent.js b/public/js/api/notiz/prestudent.js new file mode 100644 index 000000000..c529ea44e --- /dev/null +++ b/public/js/api/notiz/prestudent.js @@ -0,0 +1,38 @@ +export default { + getNotizen(url, config, params){ + return this.$fhcApi.get('api/frontend/v1/notiz/notizPrestudent/getNotizen/' + params.id + '/' + params.type); + }, + getUid(){ + return this.$fhcApi.get('api/frontend/v1/notiz/notizPrestudent/getUid/'); + }, + addNewNotiz(id, formData) { + return this.$fhcApi.post('api/frontend/v1/notiz/notizPrestudent/addNewNotiz/' + id, + formData + ); + }, + loadNotiz(notiz_id){ + return this.$fhcApi.post('api/frontend/v1/notiz/notizPrestudent/loadNotiz/', { + notiz_id + }); + }, + loadDokumente(notiz_id){ + return this.$fhcApi.post('api/frontend/v1/notiz/notizPrestudent/loadDokumente/', { + notiz_id + }); + }, + deleteNotiz(notiz_id, type_id, id){ + return this.$fhcApi.post('api/frontend/v1/notiz/notizPrestudent/deleteNotiz/', { + notiz_id, + type_id, + id + }); + }, + updateNotiz(notiz_id, formData){ + return this.$fhcApi.post('api/frontend/v1/notiz/notizPrestudent/updateNotiz/' + notiz_id, + formData + ); + }, + getMitarbeiter(event){ + return this.$fhcApi.get('api/frontend/v1/notiz/notizPrestudent/getMitarbeiter/' + event); + } +} \ No newline at end of file diff --git a/public/js/api/notiz/projekt.js b/public/js/api/notiz/projekt.js new file mode 100644 index 000000000..ac8b71623 --- /dev/null +++ b/public/js/api/notiz/projekt.js @@ -0,0 +1,38 @@ +export default { + getNotizen(url, config, params){ + return this.$fhcApi.get('api/frontend/v1/notiz/NotizProjekt/getNotizen/' + params.id + '/' + params.type); + }, + getUid(){ + return this.$fhcApi.get('api/frontend/v1/notiz/NotizProjekt/getUid/'); + }, + addNewNotiz(id, formData) { + return this.$fhcApi.post('api/frontend/v1/notiz/NotizProjekt/addNewNotiz/' + id, + formData + ); + }, + loadNotiz(notiz_id){ + return this.$fhcApi.post('api/frontend/v1/notiz/NotizProjekt/loadNotiz/', { + notiz_id + }); + }, + loadDokumente(notiz_id){ + return this.$fhcApi.post('api/frontend/v1/notiz/NotizProjekt/loadDokumente/', { + notiz_id + }); + }, + deleteNotiz(notiz_id, type_id, id){ + return this.$fhcApi.post('api/frontend/v1/notiz/NotizProjekt/deleteNotiz/', { + notiz_id, + type_id, + id + }); + }, + updateNotiz(notiz_id, formData){ + return this.$fhcApi.post('api/frontend/v1/notiz/NotizProjekt/updateNotiz/' + notiz_id, + formData + ); + }, + getMitarbeiter(event){ + return this.$fhcApi.get('api/frontend/v1/notiz/NotizProjekt/getMitarbeiter/' + event); + } +} \ No newline at end of file diff --git a/public/js/api/notiz/projektphase.js b/public/js/api/notiz/projektphase.js new file mode 100644 index 000000000..8b85106a3 --- /dev/null +++ b/public/js/api/notiz/projektphase.js @@ -0,0 +1,38 @@ +export default { + getNotizen(url, config, params){ + return this.$fhcApi.get('api/frontend/v1/notiz/notizProjektphase/getNotizen/' + params.id + '/' + params.type); + }, + getUid(){ + return this.$fhcApi.get('api/frontend/v1/notiz/notizProjektphase/getUid/'); + }, + addNewNotiz(id, formData) { + return this.$fhcApi.post('api/frontend/v1/notiz/notizProjektphase/addNewNotiz/' + id, + formData + ); + }, + loadNotiz(notiz_id){ + return this.$fhcApi.post('api/frontend/v1/notiz/notizProjektphase/loadNotiz/', { + notiz_id + }); + }, + loadDokumente(notiz_id){ + return this.$fhcApi.post('api/frontend/v1/notiz/notizProjektphase/loadDokumente/', { + notiz_id + }); + }, + deleteNotiz(notiz_id, type_id, id){ + return this.$fhcApi.post('api/frontend/v1/notiz/notizProjektphase/deleteNotiz/', { + notiz_id, + type_id, + id + }); + }, + updateNotiz(notiz_id, formData){ + return this.$fhcApi.post('api/frontend/v1/notiz/notizProjektphase/updateNotiz/' + notiz_id, + formData + ); + }, + getMitarbeiter(event){ + return this.$fhcApi.get('api/frontend/v1/notiz/notizProjektphase/getMitarbeiter/' + event); + } +} \ No newline at end of file diff --git a/public/js/api/notiz/projekttask.js b/public/js/api/notiz/projekttask.js new file mode 100644 index 000000000..6b6db3c77 --- /dev/null +++ b/public/js/api/notiz/projekttask.js @@ -0,0 +1,38 @@ +export default { + getNotizen(url, config, params){ + return this.$fhcApi.get('api/frontend/v1/notiz/notizProjekttask/getNotizen/' + params.id + '/' + params.type); + }, + getUid(){ + return this.$fhcApi.get('api/frontend/v1/notiz/notizProjekttask/getUid/'); + }, + addNewNotiz(id, formData) { + return this.$fhcApi.post('api/frontend/v1/notiz/notizProjekttask/addNewNotiz/' + id, + formData + ); + }, + loadNotiz(notiz_id){ + return this.$fhcApi.post('api/frontend/v1/notiz/notizProjekttask/loadNotiz/', { + notiz_id + }); + }, + loadDokumente(notiz_id){ + return this.$fhcApi.post('api/frontend/v1/notiz/notizProjekttask/loadDokumente/', { + notiz_id + }); + }, + deleteNotiz(notiz_id, type_id, id){ + return this.$fhcApi.post('api/frontend/v1/notiz/notizProjekttask/deleteNotiz/', { + notiz_id, + type_id, + id + }); + }, + updateNotiz(notiz_id, formData){ + return this.$fhcApi.post('api/frontend/v1/notiz/notizProjekttask/updateNotiz/' + notiz_id, + formData + ); + }, + getMitarbeiter(event){ + return this.$fhcApi.get('api/frontend/v1/notiz/notizProjekttask/getMitarbeiter/' + event); + } +} \ No newline at end of file diff --git a/public/js/components/Betriebsmittel/Betriebsmittel.js b/public/js/components/Betriebsmittel/Betriebsmittel.js index 148d7a83c..686caa1ac 100644 --- a/public/js/components/Betriebsmittel/Betriebsmittel.js +++ b/public/js/components/Betriebsmittel/Betriebsmittel.js @@ -43,12 +43,27 @@ export default { }, data() { return { - tabulatorOptions: { + listBetriebsmitteltyp: [], + formData: { + ausgegebenam : new Date(), + betriebsmitteltyp: 'Zutrittskarte' + }, + statusNew: true, + filteredInventar: [], + layout: 'fitColumns', + layoutColumnsOnNewData: false, + height: '550', + } + }, + computed: { + tabulatorOptions() { + const options = { ajaxURL: 'dummy', ajaxRequestFunc: () => this.$api.call( this.endpoint.getAllBetriebsmittel(this.typeId, this.id, (this.filterByProvidedTypes ? this.betriebsmittelTypes : null)) ), ajaxResponse: (url, params, response) => response.data, + persistenceID: 'core-betriebsmittel', columns: [ {title: "Nummer", field: "nummer", width: 150}, {title: "PersonId", field: "person_id", visible: false}, @@ -115,7 +130,7 @@ export default { '/content/pdfExport.php?xml=betriebsmittelperson.rdf.php&xsl=Uebernahme&id=' + cellData.betriebsmittelperson_id + '&output=pdf'; window.open(linkToPdf, '_blank'); - }); + }); container.append(button); button = document.createElement('button'); @@ -143,64 +158,47 @@ export default { return container; }, frozen: true - }], - layout: 'fitColumns', - layoutColumnsOnNewData: false, - height: '550', - persistenceID: 'core-betriebsmittel' - }, - tabulatorEvents: [ + } + ], + }; + return options; + }, + tabulatorEvents() { + const events = [ { event: 'tableBuilt', handler: async() => { await this.$p.loadCategory(['wawi', 'global', 'infocenter', 'betriebsmittel', 'person']); - let cm = this.$refs.table.tabulator.columnManager; + const setHeader = (field, text) => { + const col = this.$refs.table.tabulator.getColumn(field); + if (!col) return; - cm.getColumnByField('nummer').component.updateDefinition({ - title: this.$p.t('wawi', 'nummer') - }); - cm.getColumnByField('betriebsmitteltyp').component.updateDefinition({ - title: this.$p.t('global', 'typ') - }); - cm.getColumnByField('anmerkung').component.updateDefinition({ - title: this.$p.t('global', 'anmerkung') - }); - cm.getColumnByField('retouram').component.updateDefinition({ - title: this.$p.t('wawi', 'retourdatum') - }); - cm.getColumnByField('beschreibung').component.updateDefinition({ - title: this.$p.t('global', 'beschreibung') - }); - cm.getColumnByField('kaution').component.updateDefinition({ - title: this.$p.t('infocenter', 'kaution') - }); - cm.getColumnByField('ausgegebenam').component.updateDefinition({ - title: this.$p.t('wawi', 'ausgabedatum') - }); - cm.getColumnByField('betriebsmittel_id').component.updateDefinition({ - title: this.$p.t('ui', 'betriebsmittel_id') - }); - cm.getColumnByField('betriebsmittelperson_id').component.updateDefinition({ - title: this.$p.t('ui', 'betriebsmittelperson_id') - }); - cm.getColumnByField('person_id').component.updateDefinition({ - title: this.$p.t('person', 'person_id') - }); - cm.getColumnByField('uid').component.updateDefinition({ - title: this.$p.t('person', 'uid') - }); + const el = col.getElement(); + if (!el || !el.querySelector) return; + + const titleEl = el.querySelector('.tabulator-col-title'); + if (titleEl) { + titleEl.textContent = text; + } + }; + + setHeader('nummer', this.$p.t('wawi', 'nummer')); + setHeader('betriebsmitteltyp', this.$p.t('global', 'typ')); + setHeader('anmerkung', this.$p.t('global', 'anmerkung')); + setHeader('retouram', this.$p.t('wawi', 'retourdatum')); + setHeader('beschreibung', this.$p.t('global', 'beschreibung')); + setHeader('kaution', this.$p.t('infocenter', 'kaution')); + setHeader('ausgegebenam', this.$p.t('wawi', 'ausgabedatum')); + setHeader('betriebsmittel_id', this.$p.t('ui', 'betriebsmittel_id')); + setHeader('betriebsmittelperson_id', this.$p.t('ui', 'betriebsmittelperson_id')); + setHeader('person_id', this.$p.t('person', 'person_id')); + setHeader('uid', this.$p.t('person', 'uid')); } } - ], - listBetriebsmitteltyp: [], - formData: { - ausgegebenam : new Date(), - betriebsmitteltyp: 'Zutrittskarte' - }, - statusNew: true, - filteredInventar: [] + ]; + return events; } }, watch: { @@ -466,5 +464,4 @@ export default { ` -} - +} \ No newline at end of file diff --git a/public/js/components/Dashboard/Dashboard.js b/public/js/components/Dashboard/Dashboard.js index 3d781ac72..652a2778e 100644 --- a/public/js/components/Dashboard/Dashboard.js +++ b/public/js/components/Dashboard/Dashboard.js @@ -151,10 +151,6 @@ export default { db: this.dashboard } }).then(res => { - res.data.retval.forEach(widget => { - widget.arguments = JSON.parse(widget.arguments); - widget.setup = JSON.parse(widget.setup); - }); this.widgets = res.data.retval; }).catch(err => console.error('ERROR:', err)); diff --git a/public/js/components/Dashboard/Item.js b/public/js/components/Dashboard/Item.js index d2ad4ae75..06a03ae3a 100644 --- a/public/js/components/Dashboard/Item.js +++ b/public/js/components/Dashboard/Item.js @@ -144,7 +144,7 @@ export default { }, async created() { this.widget = await CachedWidgetLoader.loadWidget(this.id); - let component = (await import("../" + this.widget.setup.file)).default; + let component = (await import(this.widget.setup.file)).default; this.$options.components["widget" + this.widget.widget_id] = component; this.component = "widget" + this.widget.widget_id; this.arguments = { ...this.widget.arguments, ...this.config }; diff --git a/public/js/components/Funktionen/Funktionen.js b/public/js/components/Funktionen/Funktionen.js index e83eca7e4..170747e5f 100644 --- a/public/js/components/Funktionen/Funktionen.js +++ b/public/js/components/Funktionen/Funktionen.js @@ -33,26 +33,71 @@ export default { }, data(){ return { - tabulatorOptions: { + isFilterSet: true, + listOrgHeads: [], + listOrgUnits: [], //Old + listAllOrgUnits: [], + listOrgUnits_GST: [], + listOrgUnits_GMBH: [], + formData: { + head: 'gst', + oe_kurzbz: '', + funktion_kurzbz: null, + label:'', + //funktion_label: '', + funktion: null, + }, + statusNew: true, + listAllFunctions: [], + abortController: { + oes: null, + functions: null + }, + filteredOes: [], + filteredFunctions: [], + newBtnStyle: '', + selectedFunction: null, + selectedOe: null, + layout: 'fitDataFill', + layoutColumnsOnNewData: false, + height: '300' + } + }, + computed: { + tabulatorOptions() { + const options = { ajaxURL: 'dummy', ajaxRequestFunc: () => this.$api.call( ApiCoreFunktion.getAllUserFunctions(this.personUID) ), ajaxResponse: (url, params, response) => response.data, + persistenceID: 'core-functions', columns: [ { title: "dienstverhaeltnis_unternehmen", field: "dienstverhaeltnis_unternehmen", headerFilter: "list", - headerFilterParams: {valuesLookup: true, autocomplete: true, sort: "asc"}, + headerFilterParams: { + valuesLookup: true, autocomplete: true, sort: "asc" + }, + width: 140, + //Field Company: if visible show link to dv + visible: this.showDvCompany, + formatter: this.companyLinkFormatter }, { title: "funktion_beschreibung", field: "funktion_beschreibung", headerFilter: "list", - headerFilterParams: {valuesLookup: true, autocomplete: true, sort: "asc"}, + headerFilterParams: { + valuesLookup: true, autocomplete: true, sort: "asc" + }, + width: 140 }, { title: "funktion_oebezeichnung", field: "funktion_oebezeichnung", headerFilter: "list", - headerFilterParams: {valuesLookup: true, autocomplete: true, sort: "asc"} + headerFilterParams: { + valuesLookup: true, autocomplete: true, sort: "asc" + }, + width: 140 }, {title: "wochenstunden", field: "wochenstunden", headerFilter: true}, { @@ -87,7 +132,7 @@ export default { }); }, }, - {title: "bezeichnung", field: "bezeichnung", headerFilter: true}, + {title: "bezeichnung", field: "bezeichnung", headerFilter: true, width: 140}, {title: "aktiv", field: "aktiv", visible: false}, {title: "benutzerfunktion_id", field: "benutzerfunktion_id", visible: false}, {title: "uid", field: "uid", visible: false}, @@ -142,87 +187,41 @@ export default { frozen: true } ], - layout: 'fitDataFill', - layoutColumnsOnNewData: false, - height: '300', - persistenceID: 'core-functions', - }, - tabulatorEvents: [ + }; + return options; + }, + tabulatorEvents() { + const events = [ { event: 'tableBuilt', handler: async () => { await this.$p.loadCategory(['global', 'lehre', 'person', 'ui']); - let cm = this.$refs.table.tabulator.columnManager; - //Field Company: if visible show link to dv - const column = cm.getColumnByField('dienstverhaeltnis_unternehmen'); - const companyDv = { - title: this.$p.t('person', 'dv_unternehmen'), - width: 140, - visible: this.showDvCompany, - formatter: this.companyLinkFormatter - }; - column.component.updateDefinition(companyDv); + const setHeader = (field, text) => { + const col = this.$refs.table.tabulator.getColumn(field); + if (!col) return; - cm.getColumnByField('funktion_beschreibung').component.updateDefinition({ - title: this.$p.t('person', 'zuordnung_taetigkeit'), - width: 140 - }); - cm.getColumnByField('funktion_oebezeichnung').component.updateDefinition({ - title: this.$p.t('lehre', 'organisationseinheit'), - width: 140 - }); - cm.getColumnByField('wochenstunden').component.updateDefinition({ - title: this.$p.t('person', 'wochenstunden') - }); + const el = col.getElement(); + if (!el || !el.querySelector) return; - const columnDatumVon = cm.getColumnByField('datum_von'); - const fieldVonDatum = { - title: this.$p.t('ui', 'from') + const titleEl = el.querySelector('.tabulator-col-title'); + if (titleEl) { + titleEl.textContent = text; + } }; - columnDatumVon.component.updateDefinition(fieldVonDatum); - - const columnDatumBis = cm.getColumnByField('datum_bis'); - const fieldBisDatum = { - title: this.$p.t('global', 'bis'), - }; - columnDatumBis.component.updateDefinition(fieldBisDatum); - - cm.getColumnByField('bezeichnung').component.updateDefinition({ - title: this.$p.t('ui', 'bezeichnung'), - width: 140 - }); - + setHeader('dienstverhaeltnis_unternehmen', this.$p.t('person', 'dv_unternehmen')); + setHeader('funktion_beschreibung', this.$p.t('person', 'zuordnung_taetigkeit')); + setHeader('funktion_oebezeichnung', this.$p.t('lehre', 'organisationseinheit')); + setHeader('wochenstunden', this.$p.t('person', 'wochenstunden')); + setHeader('datum_von', this.$p.t('ui', 'from')); + setHeader('datum_bis', this.$p.t('global', 'bis')); + setHeader('bezeichnung', this.$p.t('ui', 'bezeichnung')); } } - ], - isFilterSet: true, - listOrgHeads: [], - listOrgUnits: [], //Old - listAllOrgUnits: [], - listOrgUnits_GST: [], - listOrgUnits_GMBH: [], - formData: { - head: 'gst', - oe_kurzbz: '', - funktion_kurzbz: null, - label:'', - //funktion_label: '', - funktion: null, - }, - statusNew: true, - listAllFunctions: [], - abortController: { - oes: null, - functions: null - }, - filteredOes: [], - filteredFunctions: [], - newBtnStyle: '', - selectedFunction: null, - selectedOe: null - } + ]; + return events; + }, }, watch: { selectedFunction(newVal) { @@ -340,6 +339,8 @@ export default { this.formData.head = 'gst'; this.formData.oe_kurzbz = ''; this.formData.funktion_kurzbz = ''; + this.selectedFunction = null; + this.selectedOe= null; }, filterFunctions(event) { const query = event.query.toLowerCase(); @@ -460,14 +461,12 @@ export default { -