From 6e9ee7cf814f7d8cba1e95b481abc6dbf7c9af89 Mon Sep 17 00:00:00 2001 From: ma0068 Date: Fri, 3 May 2024 09:43:49 +0200 Subject: [PATCH 001/165] Notizcomponent: Api Controller for Notizzuordnungs_ids --- .../api/frontend/v1/notiz/Notiz.php | 384 ------------------ .../api/frontend/v1/notiz/NotizAnrechnung.php | 44 ++ .../api/frontend/v1/notiz/NotizBestellung.php | 43 ++ .../frontend/v1/notiz/NotizLehreinheit.php | 44 ++ .../frontend/v1/notiz/NotizMitarbeiter.php | 44 ++ .../api/frontend/v1/notiz/NotizPerson.php | 33 ++ .../api/frontend/v1/notiz/NotizPrestudent.php | 44 ++ .../api/frontend/v1/notiz/NotizProjekt.php | 32 ++ .../frontend/v1/notiz/NotizProjektphase.php | 32 ++ .../frontend/v1/notiz/NotizProjekttask.php | 32 ++ application/core/Notiz_Controller.php | 79 ++-- public/js/api/notiz.js | 22 +- public/js/api/notiz/anrechnung.js | 38 ++ public/js/api/notiz/bestellung.js | 38 ++ public/js/api/notiz/lehreinheit.js | 38 ++ public/js/api/notiz/mitarbeiter.js | 38 ++ public/js/api/notiz/person.js | 19 +- public/js/api/notiz/prestudent.js | 38 ++ public/js/api/notiz/projekt.js | 38 ++ public/js/api/notiz/projektphase.js | 38 ++ public/js/api/notiz/projekttask.js | 38 ++ .../Studentenverwaltung/Details/Notizen.js | 72 ++-- system/phrasesupdate.php | 22 + 23 files changed, 786 insertions(+), 464 deletions(-) delete mode 100644 application/controllers/api/frontend/v1/notiz/Notiz.php create mode 100644 application/controllers/api/frontend/v1/notiz/NotizAnrechnung.php create mode 100644 application/controllers/api/frontend/v1/notiz/NotizBestellung.php create mode 100644 application/controllers/api/frontend/v1/notiz/NotizLehreinheit.php create mode 100644 application/controllers/api/frontend/v1/notiz/NotizMitarbeiter.php create mode 100644 application/controllers/api/frontend/v1/notiz/NotizPerson.php create mode 100644 application/controllers/api/frontend/v1/notiz/NotizPrestudent.php create mode 100644 application/controllers/api/frontend/v1/notiz/NotizProjekt.php create mode 100644 application/controllers/api/frontend/v1/notiz/NotizProjektphase.php create mode 100644 application/controllers/api/frontend/v1/notiz/NotizProjekttask.php create mode 100644 public/js/api/notiz/anrechnung.js create mode 100644 public/js/api/notiz/bestellung.js create mode 100644 public/js/api/notiz/lehreinheit.js create mode 100644 public/js/api/notiz/mitarbeiter.js create mode 100644 public/js/api/notiz/prestudent.js create mode 100644 public/js/api/notiz/projekt.js create mode 100644 public/js/api/notiz/projektphase.js create mode 100644 public/js/api/notiz/projekttask.js diff --git a/application/controllers/api/frontend/v1/notiz/Notiz.php b/application/controllers/api/frontend/v1/notiz/Notiz.php deleted file mode 100644 index 2288766c4..000000000 --- a/application/controllers/api/frontend/v1/notiz/Notiz.php +++ /dev/null @@ -1,384 +0,0 @@ - ['admin:r', 'assistenz:r'], - 'getNotizen' => ['admin:r', 'assistenz:r'], - 'loadNotiz' => 'assistenz:r', // TODO(manu): self::PERM_LOGGED - 'addNewNotiz' => 'assistenz:r', // TODO(manu): self::PERM_LOGGED - 'updateNotiz' => 'assistenz:r', // TODO(manu): self::PERM_LOGGED - 'deleteNotiz' => ['admin:r', 'assistenz:r'], - 'loadDokumente' => ['admin:r', 'assistenz:r'], - 'getMitarbeiter' => ['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 getUid() - { - $this->terminateWithSuccess(getAuthUID()); - }*/ - - - public function getNotizen($id, $type) - { - - //check if valid type - $result = $this->NotizzuordnungModel->isValidType($type); - if(isError($result)) - $this->terminateWithError($result->retval, self::ERROR_TYPE_GENERAL); - - //$this->terminateWithError(" after check type not valid", self::ERROR_TYPE_GENERAL); - $result = $this->NotizModel->getNotizWithDocEntries($id, $type); - - if (isError($result)) { - $this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL); - } - return $this->terminateWithSuccess(getData($result) ?: []); - - // return $this->terminateWithError("type not valid", self::ERROR_TYPE_GENERAL); - - } - - /* public function loadNotiz() - { - $_POST = json_decode(utf8_encode($this->input->raw_input_stream), true); - - $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 - THEN public.tbl_notiz.updateamum ELSE public.tbl_notiz.insertamum END::timestamp, 'DD.MM.YYYY HH24:MI:SS') AS lastUpdate"); - $this->NotizModel->addLimit(1); - - $result = $this->NotizModel->loadWhere( - array('notiz_id' => $notiz_id) - ); - if (isError($result)) - { - $this->terminateWithError($result, self::ERROR_TYPE_GENERAL); - } - elseif (!hasData($result)) - { - $this->terminateWithError($this->p->t('ui', 'error_missingId', ['id'=>'Notiz_id']), self::ERROR_TYPE_GENERAL); - } - else - { - $this->terminateWithSuccess(current(getData($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; - } - } - - $notiz_id = $this->input->post('notiz_id'); - - if(!$notiz_id) - { - $this->terminateWithError($this->p->t('ui','error_missingId',['id'=>'Notiz_id']), self::ERROR_TYPE_GENERAL); - } - - //Form Validation - $this->form_validation->set_rules('titel', 'Titel', 'required', [ - 'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => 'Titel']) - ]); - - $this->form_validation->set_rules('text', 'Text', 'required', [ - 'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => 'Text']) - ]); - - if ($this->form_validation->run() == false) - { - $this->terminateWithValidationErrors($this->form_validation->error_array()); - } - - //update Notiz - $uid = getAuthUID(); - $titel = $this->input->post('titel'); - $text = $this->input->post('text'); - $verfasser_uid = $this->input->post('verfasser'); - $bearbeiter_uid = isset($_POST['bearbeiter']) ? $_POST['bearbeiter'] : $uid; - $erledigt = $this->input->post('erledigt'); - $start = $this->input->post('start'); - $ende = $this->input->post('ende'); - - $result = $this->NotizModel->update( - [ - 'notiz_id' => $notiz_id - ], - [ - 'titel' => $titel, - 'updatevon' => $uid, - 'updateamum' => date('c'), - 'text' => $text, - 'verfasser_uid' => $verfasser_uid, - 'bearbeiter_uid' => $bearbeiter_uid, - 'start' => $start, - 'ende' => $ende, - 'erledigt' => $erledigt - ] - ); - if (isError($result)) - { - return $this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL); - } - - //update(1) laden aller bereits mit dieser notiz_id verknüpften DMS-Einträge - $this->load->model('person/Notizdokument_model', 'NotizdokumentModel'); - $this->NotizdokumentModel->addJoin('campus.tbl_dms_version', 'dms_id'); - $dms_uploaded = null; - - $result = $this->NotizdokumentModel->loadWhere(array('notiz_id' => $notiz_id)); - if (isError($result)) - { - $this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL); - } - elseif (!hasData($result)) - { - $dms_id_arr = null; - } - else - { - $result = getData($result); - foreach($result as $doc) { - $dms_id_arr[] = array( - 'name' => $doc->name, - 'dms_id' => $doc->dms_id - ); - } - } - - foreach ($_FILES as $k => $file) - { - //update(2) alle neuen files (alle außer type application/x.fhc-dms+json) anhängen - if($file["type"] == 'application/x.fhc-dms+json') - { - $dms_uploaded[] = array( - 'name' => $file["name"] - ); - } - else - { - $dms = array( - 'kategorie_kurzbz' => 'notiz', - 'version' => 0, - 'name' => $file["name"], - 'mimetype' => $file["type"], - 'insertamum' => date('c'), - 'insertvon' => $uid - ); - - //Todo(manu) check if filetypes weiter eingeschränkt werden sollen - //Todo(manu)check name files: nicht gleiches file 2mal hochladen - $result = $this->dmslib->upload($dms, $k, array('*')); - - if (isError($result)) - { - return $this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL); - } - $dms_id = $result->retval['dms_id']; - - $result = $this->NotizdokumentModel->insert(array('notiz_id' => $notiz_id, 'dms_id' => $dms_id)); - if (isError($result)) - { - return $this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL); - } - } - } - - //update(3) check if Dateien gelöscht wurden - if(count($dms_uploaded) != count($dms_id_arr)) - { - if (count($dms_uploaded) == 0) - { - $filesDeleted = $dms_id_arr; - } - else - { - $upload_new_names = array_column($dms_uploaded, "name"); - - $filesDeleted = array_filter($dms_id_arr, function ($file) use ($upload_new_names) { - return !in_array($file["name"], $upload_new_names); - }); - } - - foreach ($filesDeleted as $file) - { - $result = $this->dmslib->removeAll($file['dms_id']); - - if (isError($result)) - { - return $this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL); - } - else - $this->outputJson($result); - } - } - return $this->terminateWithSuccess($result); - }*/ - - - /* public function deleteNotiz() - { - $_POST = json_decode(utf8_encode($this->input->raw_input_stream), true); - $notiz_id = $this->input->post('notiz_id'); - $type = $this->input->post('type_id'); - $id = $this->input->post('id'); - - //dms_id auslesen aus notizdokument wenn vorhanden - $dms_id_arr = []; - $this->load->model('person/Notizdokument_model', 'NotizdokumentModel'); - - $result = $this->NotizdokumentModel->loadWhere(array('notiz_id' => $notiz_id)); - - if (isError($result)) - { - return $this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL); - } - - if(hasData($result)) - { - $result = getData($result); - foreach ($result as $doc) { - $dms_id_arr[] = $doc->dms_id; - } - } - - if($dms_id_arr) - { - $this->load->library('DmsLib'); - foreach($dms_id_arr as $dms_id) - { - $result = $this->dmslib->removeAll($dms_id); - - if (isError($result)) - { - return $this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL); - } - - $this->outputJson($result); - } - } - - //delete Notizzuordnung - if($type == "software_id") - { - // Loads extension Model - $this->load->model('extensions/FHC-Core-Softwarebereitstellung/Softwarenotizzuordnung_model', 'ExtensionnotizzuordnungModel'); - $result = $this->ExtensionnotizzuordnungModel->delete([ - 'notiz_id' => $notiz_id, - 'id' => strval($id) - ], - [ - 'type_id' => $type - ]); - - } - else - { - //notizzuordnungsid! - $result = $this->NotizzuordnungModel->delete(['notiz_id' => $notiz_id, $type => $id]); - } - - - $this->load->model('person/Notiz_model', 'NotizModel'); - //$this->NotizModel->addJoin('public.tbl_notizzuordnung', 'notiz_id'); - - //TODO (erweitern um Type_id) für Extensions, damit auch Notizzuordnung gelöscht werden kann - - //Löschen von Notiz - $result = $this->NotizModel->delete( - array('notiz_id' => $notiz_id) - ); - - if (isError($result)) - { - return $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); - } - - return $this->terminateWithSuccess(current(getData($result))); - }*/ - - /* public function loadDokumente() - { - $_POST = json_decode(utf8_encode($this->input->raw_input_stream), true); - $notiz_id = $this->input->post('notiz_id'); - - $this->NotizModel->addSelect('campus.tbl_dms_version.*'); - - $this->NotizModel->addJoin('public.tbl_notiz_dokument', 'ON (public.tbl_notiz_dokument.notiz_id = public.tbl_notiz.notiz_id)'); - $this->NotizModel->addJoin('campus.tbl_dms_version', 'ON (public.tbl_notiz_dokument.dms_id = campus.tbl_dms_version.dms_id)'); - - $result = $this->NotizModel->loadWhere( - array('public.tbl_notiz.notiz_id' => $notiz_id) - ); - if (isError($result)) { - return $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); - } - return $this->terminateWithSuccess(getData($result)); - }*/ - - /* public function getMitarbeiter($searchString) - { - $this->load->model('ressource/Mitarbeiter_model', 'MitarbeiterModel'); - $result = $this->MitarbeiterModel->searchMitarbeiter($searchString); - if (isError($result)) { - $this->terminateWithError($result, self::ERROR_TYPE_GENERAL); - } - return $this->terminateWithSuccess($result); - }*/ - - public function isBerechtigt($id, $typeId) - { - 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); - } - return success("berechtigt in überschreibender Funktion"); - /* return $this->terminateWithError('keine Berechtigung bro', self::ERROR_TYPE_GENERAL);*/ - } - -} \ No newline at end of file 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..b58020507 --- /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") + { + return $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); + } + return $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..483efd619 --- /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") + { + return $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); + } + return $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 new file mode 100644 index 000000000..5c40af368 --- /dev/null +++ b/application/controllers/api/frontend/v1/notiz/NotizLehreinheit.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 != "lehreinheit_id") + { + return $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); + } + return $this->terminateWithSuccess("berechtigt in überschreibender Funktion"); + } +} \ No newline at end of file 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..fd8ee3bbb --- /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") + { + return $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); + } + return $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 new file mode 100644 index 000000000..2cf1f2519 --- /dev/null +++ b/application/controllers/api/frontend/v1/notiz/NotizPerson.php @@ -0,0 +1,33 @@ + ['admin:r', 'assistenz:r'], + ]); + } + + public function isBerechtigt($id, $typeId) + { + if($typeId != "person_id") + { + return $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); + } + + return $this->outputJsonSuccess(true); + } +} \ No newline at end of file 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..d4f50e69c --- /dev/null +++ b/application/controllers/api/frontend/v1/notiz/NotizPrestudent.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 != "prestudent_id") + { + return $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); + } + return $this->terminateWithSuccess("berechtigt in überschreibender Funktion"); + } +} \ 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..180f58b1b --- /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") + { + return $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); + } + return $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..071aae6a5 --- /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") + { + return $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); + } + return $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..4d407051a --- /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") + { + return $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); + } + return $this->terminateWithSuccess("berechtigt in überschreibender Funktion"); + } +} \ No newline at end of file diff --git a/application/core/Notiz_Controller.php b/application/core/Notiz_Controller.php index 51d6854b7..8a93c4f0f 100644 --- a/application/core/Notiz_Controller.php +++ b/application/core/Notiz_Controller.php @@ -10,19 +10,20 @@ abstract class Notiz_Controller extends FHCAPI_Controller public function __construct() { parent::__construct([ - 'getUid' => ['admin:r', 'assistenz:r'], - 'getNotizen' => ['admin:r', 'assistenz:r'], - 'loadNotiz' => 'assistenz:r', // TODO(manu): self::PERM_LOGGED - 'addNewNotiz' => 'assistenz:r', // TODO(manu): self::PERM_LOGGED - 'updateNotiz' => 'assistenz:r', // TODO(manu): self::PERM_LOGGED - 'deleteNotiz' => ['admin:r', 'assistenz:r'], - 'loadDokumente' => ['admin:r', 'assistenz:r'], - 'getMitarbeiter' => ['admin:r', 'assistenz:r'], - 'isBerechtigt' => ['admin:r', 'assistenz:r'] + 'getUid' => self::PERM_LOGGED, + 'getNotizen' => self::PERM_LOGGED, + 'loadNotiz' => self::PERM_LOGGED, + 'addNewNotiz' => self::PERM_LOGGED, + 'updateNotiz' => self::PERM_LOGGED, + 'deleteNotiz' => ['admin:w', 'assistenz:w'], + 'loadDokumente' => ['admin:w', 'assistenz:w'], + 'getMitarbeiter' => self::PERM_LOGGED, + 'isBerechtigt' => self::PERM_LOGGED, ]); //Load Models $this->load->model('person/Notiz_model', 'NotizModel'); + $this->load->model('person/Notizzuordnung_model', 'NotizzuordnungModel'); // Load Libraries $this->load->library('VariableLib', ['uid' => getAuthUID()]); @@ -39,7 +40,7 @@ abstract class Notiz_Controller extends FHCAPI_Controller } - //Standardfall: für extensions überschreiben: speichern der Zuordnung in eigene Extensiontabelle angeben + //Override function for extensions protected function assignNotiz($notiz_id, $id, $type) { $this->load->model('person/Notizzuordnung_model', 'NotizzuordnungModel'); @@ -55,7 +56,7 @@ abstract class Notiz_Controller extends FHCAPI_Controller return success(getData($result)); } - //Standardfall: für extensions überschreiben: speichern der Zuordnung in eigene Extensiontabelle angeben + //Override function for extensions protected function deleteNotizzuordnung($notiz_id, $id, $type) { $this->load->model('person/Notizzuordnung_model', 'NotizzuordnungModel'); @@ -72,11 +73,23 @@ abstract class Notiz_Controller extends FHCAPI_Controller } + //Override function for extensions + public function getNotizen($id, $type) + { + $result = $this->NotizzuordnungModel->isValidType($type); + if(isError($result)) + $this->terminateWithError($result->retval, self::ERROR_TYPE_GENERAL); - //TODO(manu) abstract - protected function getNotizen($id, $type) {} + $result = $this->NotizModel->getNotizWithDocEntries($id, $type); - //TODO(manu) to abstract + if (isError($result)) { + $this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL); + } + return $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); } @@ -144,7 +157,8 @@ abstract class Notiz_Controller extends FHCAPI_Controller $titel = $this->input->post('titel'); $text = $this->input->post('text'); $erledigt = $this->input->post('erledigt'); - $verfasser_uid = isset($_POST['verfasser_uid']) ? $_POST['verfasser_uid'] : $uid; + $verfasser_uid = isset($_POST['verfasser']) ? $_POST['verfasser'] : $uid; + //$verfasser_uid = isset($_POST['verfasser_uid']) ? $_POST['verfasser_uid'] : $uid; $bearbeiter_uid = isset($_POST['bearbeiter_uid']) ? $_POST['bearbeiter_uid'] : null; $type = $this->input->post('typeId'); $start = $this->input->post('start'); @@ -153,7 +167,7 @@ abstract class Notiz_Controller extends FHCAPI_Controller // Start DB transaction $this->db->trans_start(); - //Speichern der Notiz + //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)); @@ -165,7 +179,7 @@ abstract class Notiz_Controller extends FHCAPI_Controller $notiz_id = $result->retval; - //Speichern der Notizzuordnung + //save Notizzuordnung $result = $this->assignNotiz($notiz_id, $id, $type); if (isError($result)) @@ -174,7 +188,7 @@ abstract class Notiz_Controller extends FHCAPI_Controller $this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL); } - //Speichern der Dokumente + //save Documents $dms_id_arr = []; foreach ($_FILES as $k => $file) { @@ -189,6 +203,7 @@ abstract class Notiz_Controller extends FHCAPI_Controller //Todo(manu) check if filetypes weiter eingeschränkt werden sollen //Todo(manu)check name files: nicht gleiches file 2mal hochladen + //Todo define in dms component: readFile, downloadFile $result = $this->dmslib->upload($dms, $k, ['*']); /* $result = $this->dmslib->upload($dms, $k, ['application/pdf','application/x.fhc-dms+json']);*/ if (isError($result)) @@ -199,10 +214,9 @@ abstract class Notiz_Controller extends FHCAPI_Controller $dms_id_arr[] = $result->retval['dms_id']; } - //Eintrag in Notizdokument speichern + //save entry in Notizdokument if($dms_id_arr) { - // Loads model Notizdokument_model $this->load->model('person/Notizdokument_model', 'NotizdokumentModel'); foreach($dms_id_arr as $dms_id) { @@ -257,8 +271,8 @@ abstract class Notiz_Controller extends FHCAPI_Controller $uid = getAuthUID(); $titel = $this->input->post('titel'); $text = $this->input->post('text'); - $verfasser_uid = $this->input->post('verfasser_uid'); - $bearbeiter_uid = isset($_POST['bearbeiter_uid']) ? $_POST['bearbeiter_uid'] : $uid; + $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'); @@ -284,7 +298,7 @@ abstract class Notiz_Controller extends FHCAPI_Controller return $this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL); } - //update(1) laden aller bereits mit dieser notiz_id verknüpften DMS-Einträge + //update(1) loading all dms-entries with this notiz_id $this->load->model('person/Notizdokument_model', 'NotizdokumentModel'); $this->NotizdokumentModel->addJoin('campus.tbl_dms_version', 'dms_id'); $dms_uploaded = null; @@ -311,7 +325,7 @@ abstract class Notiz_Controller extends FHCAPI_Controller foreach ($_FILES as $k => $file) { - //update(2) alle neuen files (alle außer type application/x.fhc-dms+json) anhängen + //update(2) attach all new files (except type application/x.fhc-dms+json) if($file["type"] == 'application/x.fhc-dms+json') { $dms_uploaded[] = array( @@ -331,6 +345,7 @@ abstract class Notiz_Controller extends FHCAPI_Controller //Todo(manu) check if filetypes weiter eingeschränkt werden sollen //Todo(manu)check name files: nicht gleiches file 2mal hochladen + //Todo define in dms component: readFile, downloadFile $result = $this->dmslib->upload($dms, $k, array('*')); if (isError($result)) @@ -347,7 +362,7 @@ abstract class Notiz_Controller extends FHCAPI_Controller } } - //update(3) check if Dateien gelöscht wurden + //update(3) check if all files have been deleted if(count($dms_uploaded) != count($dms_id_arr)) { if (count($dms_uploaded) == 0) @@ -387,12 +402,9 @@ abstract class Notiz_Controller extends FHCAPI_Controller $typeId = $this->input->post('type_id'); $id = $this->input->post('id'); - if(!$this->isBerechtigt($id, $typeId)) - { - $this->terminateWithError($this->p->t('ui', 'keineBerechtigung'), self::ERROR_TYPE_GENERAL); - } + //TODO(manu): define Permissions for deletion document if filecomponent finished - //dms_id auslesen aus notizdokument wenn vorhanden + //get dms_id from notizdokument $dms_id_arr = []; $this->load->model('person/Notizdokument_model', 'NotizdokumentModel'); @@ -416,7 +428,6 @@ abstract class Notiz_Controller extends FHCAPI_Controller // Start DB transaction $this->db->trans_start(); - //return $this->terminateWithError("dms_id kommt: " . $notiz_id, self::ERROR_TYPE_GENERAL); $this->load->library('DmsLib'); @@ -444,7 +455,7 @@ abstract class Notiz_Controller extends FHCAPI_Controller $this->load->model('person/Notiz_model', 'NotizModel'); - //Löschen von Notiz + //Delete Note $result = $this->NotizModel->delete( array('notiz_id' => $notiz_id) ); @@ -465,10 +476,6 @@ abstract class Notiz_Controller extends FHCAPI_Controller public function loadDokumente() { - if(!$this->isBerechtigt('$id', '$typeId')) - { - $this->terminateWithError($this->p->t('ui', 'keineBerechtigung'), self::ERROR_TYPE_GENERAL); - } $_POST = json_decode(utf8_encode($this->input->raw_input_stream), true); $notiz_id = $this->input->post('notiz_id'); diff --git a/public/js/api/notiz.js b/public/js/api/notiz.js index 9d210a8f9..b0a01e989 100644 --- a/public/js/api/notiz.js +++ b/public/js/api/notiz.js @@ -1,13 +1,29 @@ -//TODO(Manu) refactor with require or async +//TODO(Manu) refactor for extensions with require or async //sonst Error wenn extension file nicht vorhanden import person from "./notiz/person.js"; -import softwarenotiz from "../../extensions/FHC-Core-Softwarebereitstellung/js/api/softwarenotiz.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"; +//import softwarenotiz from "../../extensions/FHC-Core-Softwarebereitstellung/js/api/softwarenotiz.js"; //import pppnotiz from "../../extensions/FHC-Core-PEP/js/api/pppnotiz.js"; export default { person, - softwarenotiz, + prestudent, + mitarbeiter, + anrechnung, + bestellung, + lehreinheit, + projekt, + projektphase, + projekttask, +// softwarenotiz, // pppnotiz } \ No newline at end of file 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 be19b4ed9..62a3640f0 100644 --- a/public/js/api/notiz/person.js +++ b/public/js/api/notiz/person.js @@ -1,38 +1,41 @@ export default { getNotizen(url, config, params){ - return this.$fhcApi.get('api/frontend/v1/notiz/notiz/getNotizen/' + params.id + '/' + params.type); + return this.$fhcApi.get('api/frontend/v1/notiz/notizPerson/getNotizen/' + params.id + '/' + params.type); }, getUid(){ - return this.$fhcApi.get('api/frontend/v1/notiz/notiz/getUid/'); + return this.$fhcApi.get('api/frontend/v1/notiz/notizPerson/getUid/'); }, addNewNotiz(id, formData) { - return this.$fhcApi.post('api/frontend/v1/notiz/notiz/addNewNotiz/' + id, + return this.$fhcApi.post('api/frontend/v1/notiz/notizPerson/addNewNotiz/' + id, formData ); }, loadNotiz(notiz_id){ - return this.$fhcApi.post('api/frontend/v1/notiz/notiz/loadNotiz/', { + return this.$fhcApi.post('api/frontend/v1/notiz/notizPerson/loadNotiz/', { notiz_id }); }, loadDokumente(notiz_id){ - return this.$fhcApi.post('api/frontend/v1/notiz/notiz/loadDokumente/', { + return this.$fhcApi.post('api/frontend/v1/notiz/notizPerson/loadDokumente/', { notiz_id }); }, deleteNotiz(notiz_id, type_id, id){ - return this.$fhcApi.post('api/frontend/v1/notiz/notiz/deleteNotiz/', { + return this.$fhcApi.post('api/frontend/v1/notiz/notizPerson/deleteNotiz/', { notiz_id, type_id, id }); }, updateNotiz(notiz_id, formData){ - return this.$fhcApi.post('api/frontend/v1/notiz/notiz/updateNotiz/' + notiz_id, + return this.$fhcApi.post('api/frontend/v1/notiz/notizPerson/updateNotiz/' + notiz_id, formData ); }, getMitarbeiter(event){ - return this.$fhcApi.get('api/frontend/v1/notiz/notiz/getMitarbeiter/' + event); + return this.$fhcApi.get('api/frontend/v1/notiz/notizPerson/getMitarbeiter/' + event); + }, + 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/Stv/Studentenverwaltung/Details/Notizen.js b/public/js/components/Stv/Studentenverwaltung/Details/Notizen.js index 4c128bfea..185b8d0d5 100644 --- a/public/js/components/Stv/Studentenverwaltung/Details/Notizen.js +++ b/public/js/components/Stv/Studentenverwaltung/Details/Notizen.js @@ -11,20 +11,6 @@ export default {

Notizen

- - - + - - diff --git a/system/phrasesupdate.php b/system/phrasesupdate.php index ba4dcfa01..e4d6d1870 100644 --- a/system/phrasesupdate.php +++ b/system/phrasesupdate.php @@ -27781,6 +27781,28 @@ array( ) ) ), + + //**************************** FHC-Core-Notizcomponent + array( + 'app' => 'core', + 'category' => 'ui', + 'phrase' => 'error_typeNotizIdIncorrect', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Id-Typ der Notiz ist nicht korrekt', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Id type of note is incorrect', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), ); From b1452698f842aefb7030d9c529a4415a023b616a Mon Sep 17 00:00:00 2001 From: ma0068 Date: Mon, 4 Nov 2024 12:54:34 +0100 Subject: [PATCH 002/165] Start View Karteireiter, Components Unassigned, Details and Stati --- .../api/frontend/v1/vertraege/Vertraege.php | 224 ++++++++++ .../models/accounting/Vertrag_model.php | 159 +++++++ .../models/accounting/Vertragstyp_model.php | 1 + .../Vertragvertragsstatus_model.php | 2 + public/js/api/fhcapifactory.js | 4 +- public/js/api/vertraege.js | 5 + public/js/api/vertraege/person.js | 36 ++ .../Stv/Studentenverwaltung/Details.js | 1 + .../Details/Prestudent/MultiStatus.js | 5 + .../js/components/Vertraege/List/Details.js | 113 +++++ public/js/components/Vertraege/List/Status.js | 75 ++++ .../components/Vertraege/List/Unassigned.js | 113 +++++ public/js/components/Vertraege/Vertraege.js | 389 ++++++++++++++++++ 13 files changed, 1126 insertions(+), 1 deletion(-) create mode 100644 application/controllers/api/frontend/v1/vertraege/Vertraege.php create mode 100644 public/js/api/vertraege.js create mode 100644 public/js/api/vertraege/person.js create mode 100644 public/js/components/Vertraege/List/Details.js create mode 100644 public/js/components/Vertraege/List/Status.js create mode 100644 public/js/components/Vertraege/List/Unassigned.js create mode 100644 public/js/components/Vertraege/Vertraege.js diff --git a/application/controllers/api/frontend/v1/vertraege/Vertraege.php b/application/controllers/api/frontend/v1/vertraege/Vertraege.php new file mode 100644 index 000000000..eaf3062f5 --- /dev/null +++ b/application/controllers/api/frontend/v1/vertraege/Vertraege.php @@ -0,0 +1,224 @@ + ['admin:r', 'assistenz:r'], + 'getAllContractsNotAssigned' => ['admin:r', 'assistenz:r'], + 'getAllContractsAssigned' => ['admin:r', 'assistenz:r'], + 'getAllContractTypes' => self::PERM_LOGGED, + 'getStatiOfContract' => self::PERM_LOGGED, + 'loadContract' => ['admin:r', 'assistenz:r'], + 'updateContract' => ['admin:r', 'assistenz:r'], + 'addNewContract' => ['admin:r', 'assistenz:r'], + 'deleteContract' => ['admin:r', 'assistenz:r'], + + ]); + + //Load Models + $this->load->model('accounting/Vertrag_model', 'VertragModel'); + $this->load->model('accounting/Vertragsstatus_model', 'VertragsstatusModel'); + $this->load->model('accounting/Vertragstyp_model', 'VertragstypModel'); + $this->load->model('accounting/Vertragvertragsstatus_model', 'VertragvertragsstatusModel'); + } + + public function getAllVertraege($person_id) + { + $result = $this->VertragModel->loadContractsOfPerson($person_id); + + if (isError($result)) { + $this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL); + } + + $this->terminateWithSuccess((getData($result) ?: [])); + } + + public function getAllContractsNotAssigned($person_id) + { + $result = $this->VertragModel->loadContractsOfPersonNotAssigned($person_id); + + if (isError($result)) { + $this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL); + } + + $this->terminateWithSuccess((getData($result) ?: [])); + } + + public function getAllContractsAssigned($person_id, $vertrag_id) + { + $result = $this->VertragModel->loadContractsOfPersonAssigned($person_id, $vertrag_id); + + if (isError($result)) { + $this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL); + } + + $this->terminateWithSuccess((getData($result) ?: [])); + } + + public function getStatiOfContract($vertrag_id) + { + $result = $this->VertragModel->getStatiOfContract($vertrag_id); + + if (isError($result)) { + $this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL); + } + + $this->terminateWithSuccess((getData($result) ?: [])); + } + + public function getAllContractTypes() + { + $result = $this->VertragstypModel->load(); + if (isError($result)) + { + $this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL); + } + $this->terminateWithSuccess(getData($result) ?: []); + } + + public function addNewContract($person_id) + { + //$this->validateNewOrUpdate(); + //TODO(Manu) check validations + + //$person_id = $this->input->post('person_id'); + $vertragsdatum = $this->input->post('vertragsdatum'); + $bezeichnung = $this->input->post('bezeichnung'); + $vertragstyp_kurzbz = $this->input->post('vertragstyp_kurzbz'); + $betrag = $this->input->post('betrag'); + $vertragsstunden = $this->input->post('vertragsstunden'); + $vertragsstunden_studiensemester_kurzbz = $this->input->post('vertragsstunden_studiensemester_kurzbz'); + $anmerkung = $this->input->post('anmerkung'); + + $this->db->trans_start(); + + $result = $this->VertragModel->insert( [ + 'person_id' => $person_id, + 'vertragsdatum' => $vertragsdatum, + 'bezeichnung' => $bezeichnung, + 'vertragstyp_kurzbz' => $vertragstyp_kurzbz, + 'betrag' => $betrag, + 'vertragsstunden' => $vertragsstunden, + 'vertragsstunden_studiensemester_kurzbz' => $vertragsstunden_studiensemester_kurzbz, + 'anmerkung' => $anmerkung, + 'insertamum' => date('c'), + 'insertvon' => getAuthUID() + ]); + + //add entry with status neu in lehre.tbl_vertrag_vertragsstatus + //TODO(Manu) validation, dass status nicht schon bereits vorhanden + $status_result = $this->VertragvertragsstatusModel->insert([ + 'vertrag_id' => $result->retval, + 'uid' => getAuthUID(), + 'vertragsstatus_kurzbz' => 'neu', + 'insertamum' => date('c'), + 'insertvon' => getAuthUID(), + 'datum' => date('c') + ]); + + if (!$status_result) { + $this->db->trans_rollback(); + $this->terminateWithError('Fehler beim Hinzufügen des Vertragsstatus.'); + } + + $this->db->trans_complete(); + + $this->terminateWithSuccess(true); + } + + public function loadContract($vertrag_id) + { + $result = $this->VertragModel->load($vertrag_id); + + if (isError($result)) { + $this->terminateWithError($result, self::ERROR_TYPE_GENERAL); + } + + if (!hasData($result)) { + $this->terminateWithError($this->p->t('ui', 'error_missingId', ['id' => 'Vertrag_id']), self::ERROR_TYPE_GENERAL); + } + + $this->terminateWithSuccess(current(getData($result))); + } + + public function updateContract($vertrag_id) + { + //$this->validateNewOrUpdate(); + //TODO(Manu)validations + + + $vertrag_id = $this->input->post('vertrag_id'); + $person_id = $this->input->post('person_id'); + $vertragsdatum = $this->input->post('vertragsdatum'); + $bezeichnung = $this->input->post('bezeichnung'); + $vertragstyp_kurzbz = $this->input->post('vertragstyp_kurzbz'); + $betrag = $this->input->post('betrag'); + $vertragsstunden = $this->input->post('vertragsstunden'); + $vertragsstunden_studiensemester_kurzbz = $this->input->post('vertragsstunden_studiensemester_kurzbz'); + $anmerkung = $this->input->post('anmerkung'); + + $this->db->trans_start(); + + $result = $this->VertragModel->update($vertrag_id, [ + 'person_id' => $person_id, + 'vertragsdatum' => $vertragsdatum, + 'bezeichnung' => $bezeichnung, + 'vertragstyp_kurzbz' => $vertragstyp_kurzbz, + 'betrag' => $betrag, + 'vertragsstunden' => $vertragsstunden, + 'vertragsstunden_studiensemester_kurzbz' => $vertragsstunden_studiensemester_kurzbz, + 'anmerkung' => $anmerkung, + 'vertragsstunden' => $vertragsstunden, + 'updateamum' => date('c'), + 'updatevon' => getAuthUID() + ]); + + $this->getDataOrTerminateWithError($result); + + $this->db->trans_complete(); + + $this->terminateWithSuccess(true); + } + + public function deleteContract($vertrag_id) + { + //TODO(Manu) validations, + $result = $this->VertragvertragsstatusModel->load([ + 'vertrag_id' => $vertrag_id + ]); + + if(hasData($result)){ + $data = getData($result); + foreach ($data as $item) { + //delete all entries in lehre.tbl_vertrag_vertragsstatus + $result = $this->VertragvertragsstatusModel->delete([ + 'vertrag_id' => $vertrag_id, + 'vertragsstatus_kurzbz' => $item->vertragsstatus_kurzbz, + 'uid' => $item->uid + ]); + if(isError($result)) + $this->terminateWithError($result, self::ERROR_TYPE_GENERAL); + } + } + + //delete Contract + $result = $this->VertragModel->delete( + array('vertrag_id' => $vertrag_id, + ) + ); + + if (isError($result)) { + return $this->terminateWithError($result, self::ERROR_TYPE_GENERAL); + } + if (!hasData($result)) { + return $this->terminateWithError($this->p->t('ui', 'error_missingId', ['id' => 'Vertrag_id']), self::ERROR_TYPE_GENERAL); + } + return $this->outputJsonSuccess(current(getData($result))); + } +} \ No newline at end of file diff --git a/application/models/accounting/Vertrag_model.php b/application/models/accounting/Vertrag_model.php index 8725cd98d..62b109922 100644 --- a/application/models/accounting/Vertrag_model.php +++ b/application/models/accounting/Vertrag_model.php @@ -330,4 +330,163 @@ class Vertrag_model extends DB_Model return $bezeichnung; } + + /** + * Loads all Contracts of a Person + * @param $person_id + * @return array of objects + */ + public function loadContractsOfPerson($person_id) + { + $query = " + SELECT + *, + tbl_vertrag.bezeichnung as bezeichnung, + tbl_vertragstyp.bezeichnung as vertragstyp_bezeichnung, + TO_CHAR(tbl_vertrag.vertragsdatum::timestamp, 'DD.MM.YYYY') AS format_vertragsdatum, + (SELECT bezeichnung FROM lehre.tbl_vertragsstatus + JOIN lehre.tbl_vertrag_vertragsstatus USING(vertragsstatus_kurzbz) + WHERE vertrag_id=tbl_vertrag.vertrag_id ORDER BY datum desc limit 1) as status, anmerkung + FROM + lehre.tbl_vertrag + LEFT JOIN lehre.tbl_vertragstyp USING(vertragstyp_kurzbz) + WHERE person_id= ?"; + + + return $this->execQuery($query, array($person_id)); + } + + /** + * Loads all Contracts of a Person that are not assigned yet + * @param $person_id + * @return array of objects + */ + public function loadContractsOfPersonNotAssigned($person_id) + { + $query = " +SELECT + 'Lehrauftrag' as type, + lehreinheit_id, + mitarbeiter_uid, + null as pruefung_id, + null as projektarbeit_id, + (tbl_lehreinheitmitarbeiter.semesterstunden*tbl_lehreinheitmitarbeiter.stundensatz) as betrag, + tbl_lehreinheit.studiensemester_kurzbz, + null as betreuerart_kurzbz, + ( SELECT + upper(tbl_studiengang.typ || tbl_studiengang.kurzbz) || tbl_lehrveranstaltung.semester || '-' || tbl_lehrveranstaltung.kurzbz || '-' || tbl_lehreinheit.lehrform_kurzbz + FROM + lehre.tbl_lehrveranstaltung + JOIN public.tbl_studiengang USING(studiengang_kz) + WHERE + lehrveranstaltung_id=tbl_lehreinheit.lehrveranstaltung_id) + as bezeichnung + FROM + lehre.tbl_lehreinheitmitarbeiter + JOIN lehre.tbl_lehreinheit USING(lehreinheit_id) + WHERE + mitarbeiter_uid IN (SELECT uid FROM public.tbl_benutzer WHERE person_id=?) + AND vertrag_id IS NULL + UNION + SELECT + 'Betreuung' as type, + tbl_projektarbeit.lehreinheit_id as lehreinheit_id, + null as mitarbeiter_uid, + null::integer as pruefung_id, + projektarbeit_id, + (tbl_projektbetreuer.stunden*tbl_projektbetreuer.stundensatz) as betrag, + tbl_lehreinheit.studiensemester_kurzbz, + tbl_projektbetreuer.betreuerart_kurzbz, + (SELECT nachname || ' ' || vorname FROM public.tbl_person JOIN public.tbl_benutzer USING(person_id) WHERE uid=tbl_projektarbeit.student_uid) + as bezeichnung + FROM + lehre.tbl_projektbetreuer + JOIN lehre.tbl_projektarbeit USING(projektarbeit_id) + JOIN lehre.tbl_lehreinheit USING(lehreinheit_id) + WHERE + tbl_projektbetreuer.person_id=? + AND vertrag_id IS NULL + "; + + return $this->execQuery($query, array($person_id, $person_id)); + } + + /** + * Loads all Contracts of a Person that are assigned yet + * @param $person_id, $vertrag_id + * @return array of objects + */ + //TODO(Manu) vereinfachen! + public function loadContractsOfPersonAssigned($person_id, $vertrag_id) + { + $query = " + SELECT + 'Lehrauftrag' as type, + lehreinheit_id, + mitarbeiter_uid, + null as pruefung_id, + null as projektarbeit_id, + (tbl_lehreinheitmitarbeiter.semesterstunden * tbl_lehreinheitmitarbeiter.stundensatz) as betrag, + tbl_lehreinheit.studiensemester_kurzbz, + null as betreuerart_kurzbz, + ( SELECT + upper(tbl_studiengang.typ || tbl_studiengang.kurzbz) || tbl_lehrveranstaltung.semester || '-' || tbl_lehrveranstaltung.kurzbz || '-' || tbl_lehreinheit.lehrform_kurzbz + FROM + lehre.tbl_lehrveranstaltung + JOIN public.tbl_studiengang USING(studiengang_kz) + WHERE + lehrveranstaltung_id=tbl_lehreinheit.lehrveranstaltung_id) + as bezeichnung + FROM + lehre.tbl_lehreinheitmitarbeiter + JOIN lehre.tbl_lehreinheit USING(lehreinheit_id) + WHERE + mitarbeiter_uid IN (SELECT uid FROM public.tbl_benutzer WHERE person_id=?) + AND vertrag_id = ? + UNION + SELECT + 'Betreuung' as type, + tbl_projektarbeit.lehreinheit_id as lehreinheit_id, + null as mitarbeiter_uid, + null::integer as pruefung_id, + projektarbeit_id, + (tbl_projektbetreuer.stunden * tbl_projektbetreuer.stundensatz) as betrag, + tbl_lehreinheit.studiensemester_kurzbz, + tbl_projektbetreuer.betreuerart_kurzbz, + (SELECT nachname || ' ' || vorname FROM public.tbl_person JOIN public.tbl_benutzer USING(person_id) WHERE uid=tbl_projektarbeit.student_uid) + as bezeichnung + FROM + lehre.tbl_projektbetreuer + JOIN lehre.tbl_projektarbeit USING(projektarbeit_id) + JOIN lehre.tbl_lehreinheit USING(lehreinheit_id) + WHERE + tbl_projektbetreuer.person_id=? + AND vertrag_id = ? + "; + + return $this->execQuery($query, array($person_id, $vertrag_id, $person_id, $vertrag_id)); + } + + /** + * Returns all stati of a contract + * + * @param $vertrag_id + * @return array + */ + public function getStatiOfContract($vertrag_id) + { + $query = " + SELECT + * + FROM + lehre.tbl_vertrag_vertragsstatus + JOIN lehre.tbl_vertragsstatus USING(vertragsstatus_kurzbz) + WHERE + tbl_vertrag_vertragsstatus.vertrag_id = ? + ORDER BY datum DESC"; + + return $this->execQuery($query, array($vertrag_id)); + } + + } diff --git a/application/models/accounting/Vertragstyp_model.php b/application/models/accounting/Vertragstyp_model.php index 42d248217..a3275af6e 100644 --- a/application/models/accounting/Vertragstyp_model.php +++ b/application/models/accounting/Vertragstyp_model.php @@ -11,4 +11,5 @@ class Vertragstyp_model extends DB_Model $this->dbTable = 'lehre.tbl_vertragstyp'; $this->pk = 'vertragstyp_kurzbz'; } + } diff --git a/application/models/accounting/Vertragvertragsstatus_model.php b/application/models/accounting/Vertragvertragsstatus_model.php index 78a065540..75b0794cc 100644 --- a/application/models/accounting/Vertragvertragsstatus_model.php +++ b/application/models/accounting/Vertragvertragsstatus_model.php @@ -190,4 +190,6 @@ class Vertragvertragsstatus_model extends DB_Model return $this->loadWhere($condition); } + + } diff --git a/public/js/api/fhcapifactory.js b/public/js/api/fhcapifactory.js index e30772ca7..45a172302 100644 --- a/public/js/api/fhcapifactory.js +++ b/public/js/api/fhcapifactory.js @@ -24,6 +24,7 @@ import stv from "./stv.js"; import notiz from "./notiz.js"; import betriebsmittel from "./betriebsmittel.js"; import checkperson from "./checkperson.js"; +import vertraege from "./vertraege.js"; export default { search, @@ -34,5 +35,6 @@ export default { stv, notiz, betriebsmittel, - checkperson + checkperson, + vertraege }; \ No newline at end of file diff --git a/public/js/api/vertraege.js b/public/js/api/vertraege.js new file mode 100644 index 000000000..1c23316ef --- /dev/null +++ b/public/js/api/vertraege.js @@ -0,0 +1,5 @@ +import person from "./vertraege/person.js"; + +export default { + person +} \ No newline at end of file diff --git a/public/js/api/vertraege/person.js b/public/js/api/vertraege/person.js new file mode 100644 index 000000000..cff6ea87d --- /dev/null +++ b/public/js/api/vertraege/person.js @@ -0,0 +1,36 @@ +export default { + getAllVertraege(url, config, params){ + return this.$fhcApi.get('api/frontend/v1/vertraege/vertraege/getAllVertraege/' + params.person_id); + }, + getAllContractsNotAssigned(url, config, params){ + return this.$fhcApi.get('api/frontend/v1/vertraege/vertraege/getAllContractsNotAssigned/' + params.person_id); + }, + getAllContractsAssigned(url, config, params){ + console.log(params.person_id, params.vertrag_id); + return this.$fhcApi.get('api/frontend/v1/vertraege/vertraege/getAllContractsAssigned/' + params.person_id + '/' + params.vertrag_id); + }, + getAllContractsNotAssigned2(person_id){ + return this.$fhcApi.get('api/frontend/v1/vertraege/vertraege/getAllContractsNotAssigned/' + person_id); + }, + getStatiOfContract(url, config, params){ + return this.$fhcApi.get('api/frontend/v1/vertraege/vertraege/getStatiOfContract/' + params.vertrag_id); + }, + getAllContractTypes(){ + return this.$fhcApi.get('api/frontend/v1/vertraege/vertraege/getAllContractTypes/'); + }, + addNewContract(person_id, formData) { + return this.$fhcApi.post('api/frontend/v1/vertraege/vertraege/addNewContract/' + + person_id, formData + ); + }, + loadContract(vertrag_id){ + return this.$fhcApi.post('api/frontend/v1/vertraege/vertraege/loadContract/' + vertrag_id); + }, + updateContract(vertrag_id, formData) { + return this.$fhcApi.post( 'api/frontend/v1/vertraege/vertraege/updateContract/' + vertrag_id, + formData); + }, + deleteContract(vertrag_id){ + return this.$fhcApi.post('api/frontend/v1/vertraege/vertraege/deleteContract/' + vertrag_id); + }, +} \ No newline at end of file diff --git a/public/js/components/Stv/Studentenverwaltung/Details.js b/public/js/components/Stv/Studentenverwaltung/Details.js index 4df148063..dfa7e92ed 100644 --- a/public/js/components/Stv/Studentenverwaltung/Details.js +++ b/public/js/components/Stv/Studentenverwaltung/Details.js @@ -43,6 +43,7 @@ export default { }, template: `
+
Bitte StudentIn auswählen!
diff --git a/public/js/components/Stv/Studentenverwaltung/Details/Prestudent/MultiStatus.js b/public/js/components/Stv/Studentenverwaltung/Details/Prestudent/MultiStatus.js index ac4a2dd9e..4cf826bb3 100644 --- a/public/js/components/Stv/Studentenverwaltung/Details/Prestudent/MultiStatus.js +++ b/public/js/components/Stv/Studentenverwaltung/Details/Prestudent/MultiStatus.js @@ -318,6 +318,9 @@ export default{ @saved="reload" > + TEST1: Anzahl Students: + {{modelValue.length}} + + TEST 2 +