diff --git a/application/controllers/api/frontend/v1/stv/Config.php b/application/controllers/api/frontend/v1/stv/Config.php index c3aeda49d..42de1b02f 100644 --- a/application/controllers/api/frontend/v1/stv/Config.php +++ b/application/controllers/api/frontend/v1/stv/Config.php @@ -123,6 +123,11 @@ class Config extends FHCAPI_Controller 'config' => $config['finalexam'] ]; + $result['mobility'] = [ + 'title' => $this->p->t('stv', 'tab_mobility'), + 'component' => './Stv/Studentenverwaltung/Details/Mobility.js' + ]; + Events::trigger('stv_conf_student', function & () use (&$result) { return $result; }); diff --git a/application/controllers/api/frontend/v1/stv/Mobility.php b/application/controllers/api/frontend/v1/stv/Mobility.php new file mode 100644 index 000000000..7abe84138 --- /dev/null +++ b/application/controllers/api/frontend/v1/stv/Mobility.php @@ -0,0 +1,522 @@ + ['admin:r', 'assistenz:r'], + 'loadMobility' => ['admin:r', 'assistenz:r'], + 'insertMobility' => ['admin:rw', 'assistenz:rw'], + 'updateMobility' => ['admin:rw', 'assistenz:rw'], + 'deleteMobility' => ['admin:rw', 'assistenz:rw'], + 'getProgramsMobility' => ['admin:r', 'assistenz:r'], + 'getLVList' => ['admin:r', 'assistenz:r'], + 'getAllLehreinheiten' => ['admin:r', 'assistenz:r'], + 'getLvsandLesByStudent' => ['admin:r', 'assistenz:r'], + 'getPurposes' => ['admin:r', 'assistenz:r'], + 'getSupports' => ['admin:r', 'assistenz:r'], + 'getListPurposes' => ['admin:r', 'assistenz:r'], + 'getListSupports' => ['admin:r', 'assistenz:r'], + 'deleteMobilityPurpose' => ['admin:r', 'assistenz:r'], + 'addMobilityPurpose' => ['admin:r', 'assistenz:r'], + 'deleteMobilitySupport' => ['admin:r', 'assistenz:r'], + 'addMobilitySupport' => ['admin:r', 'assistenz:r'], + ]); + + // Load Libraries + $this->load->library('VariableLib', ['uid' => getAuthUID()]); + $this->load->library('form_validation'); + + // Load language phrases + $this->loadPhrases([ + 'ui', + 'mobility' + ]); + + // Load models + $this->load->model('codex/Bisio_model', 'BisioModel'); + } + + public function getMobilitaeten($student_uid) + { + $this->BisioModel->addSelect("*"); + $this->BisioModel->addSelect("TO_CHAR( tbl_bisio.von::timestamp, 'DD.MM.YYYY') AS format_von"); + $this->BisioModel->addSelect("TO_CHAR( tbl_bisio.bis::timestamp, 'DD.MM.YYYY') AS format_bis"); + $this->BisioModel->addJoin('bis.tbl_mobilitaetsprogramm mp', 'ON (mp.mobilitaetsprogramm_code = bis.tbl_bisio.mobilitaetsprogramm_code)', 'LEFT'); + + $result = $this->BisioModel->loadWhere( + array('student_uid' => $student_uid) + ); + + $data = $this->getDataOrTerminateWithError($result); + + $this->terminateWithSuccess($data); + } + + public function getProgramsMobility() + { + $this->load->model('codex/Mobilitaetsprogramm_model', 'MobilitaetsprogrammModel'); + + $result = $this->MobilitaetsprogrammModel->load(); + $data = $this->getDataOrTerminateWithError($result); + + $this->terminateWithSuccess($data); + } + + public function insertMobility() + { + $this->load->library('form_validation'); + $authUID = getAuthUID(); + + $student_uid = $this->input->post('uid'); + + if(!$student_uid) + { + return $this->terminateWithError($this->p->t('ui', 'error_missingId', ['id'=> 'Student UID']), self::ERROR_TYPE_GENERAL); + } + + $formData = $this->input->post('formData'); + + $_POST['von'] = (isset($formData['von']) && !empty($formData['von'])) ? $formData['von'] : null; + $_POST['bis'] = (isset($formData['bis']) && !empty($formData['bis'])) ? $formData['bis'] : null; + $_POST['nation_code'] = (isset($formData['nation_code']) && !empty($formData['nation_code'])) ? $formData['nation_code'] : 'A'; + $_POST['mobilitaetsprogramm_code'] = (isset($formData['mobilitaetsprogramm_code']) && !empty($formData['mobilitaetsprogramm_code'])) ? $formData['mobilitaetsprogramm_code'] : null; + $_POST['herkunftsland_code'] = (isset($formData['herkunftsland_code']) && !empty($formData['herkunftsland_code'])) ? $formData['herkunftsland_code'] : 'A'; + $_POST['ects_erworben'] = (isset($formData['ects_erworben']) && !empty($formData['ects_erworben'])) ? $formData['ects_erworben'] : null; + $_POST['ects_angerechnet'] = (isset($formData['ects_angerechnet']) && !empty($formData['ects_angerechnet'])) ? $formData['ects_angerechnet'] : null; + $_POST['lehreinheit_id'] = (isset($formData['lehreinheit_id']) && !empty($formData['lehreinheit_id'])) ? $formData['lehreinheit_id'] : null; + + $this->form_validation->set_rules('nation_code', 'Nation_code', 'required', [ + 'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => 'Nation_code']) + ]); + $this->form_validation->set_rules('herkunftsland_code', 'Herkunftsland_code', 'required', [ + 'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => 'Herkunftsland_code']) + ]); + $this->form_validation->set_rules('mobilitaetsprogramm_code', 'Mobilitaetsprogramm_code', 'required', [ + 'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => 'Mobilitaetsprogramm_code']) + ]); + $this->form_validation->set_rules('von', 'VonDatum', 'is_valid_date', [ + 'is_valid_date' => $this->p->t('ui', 'error_notValidDate', ['field' => 'VonDatum']) + ]); + + $this->form_validation->set_rules('bis', 'VBisDatum', 'is_valid_date', [ + 'is_valid_date' => $this->p->t('ui', 'error_notValidDate', ['field' => 'VBisDatum']) + ]); + + $this->form_validation->set_rules('ects_erworben', 'Ects_erworben', 'numeric', [ + 'numeric' => $this->p->t('ui', 'error_fieldNotNumeric', ['field' => 'Ects_erworben']) + ]); + + $this->form_validation->set_rules('ects_angerechnet', 'Ects_angerechnet', 'numeric', [ + 'numeric' => $this->p->t('ui', 'error_fieldNotNumeric', ['field' => 'Ects_angerechnet']) + ]); + + $this->form_validation->set_rules('lehreinheit_id', 'Lehreinheit', 'numeric', [ + 'numeric' => $this->p->t('ui', 'error_fieldNotNumeric', ['field' => 'Lehreinheit']) + ]); + + if ($this->form_validation->run() == false) + { + $this->terminateWithValidationErrors($this->form_validation->error_array()); + } + + $ort = (isset($formData['ort']) && !empty($formData['ort'])) ? $formData['ort'] : null; + $universitaet = (isset($formData['universitaet']) && !empty($formData['universitaet'])) ? $formData['universitaet'] : null; + $localPurposes = (isset($formData['localPurposes']) && !empty($formData['localPurposes'])) ? $formData['localPurposes'] : null; + $localSupports = (isset($formData['localSupports']) && !empty($formData['localSupports'])) ? $formData['localSupports'] : null; + + $result = $this->BisioModel->insert([ + 'student_uid' => $student_uid, + 'von' => $_POST['von'], + 'bis' => $_POST['bis'], + 'mobilitaetsprogramm_code' => $_POST['mobilitaetsprogramm_code'], + 'nation_code' => $_POST['nation_code'], + 'herkunftsland_code' => $_POST['herkunftsland_code'], + 'lehreinheit_id' => $_POST['lehreinheit_id'], + 'ort' => $ort, + 'universitaet' => $universitaet, + 'ects_erworben' => $_POST['ects_erworben'] , + 'ects_angerechnet' => $_POST['ects_angerechnet'], + 'insertamum' => date('c'), + 'insertvon' => $authUID, + ]); + + $bisio_id = $this->getDataOrTerminateWithError($result); + + //check if localData (purposes) + if(count($localPurposes) > 0){ + foreach ($localPurposes as $zweck){ + $zweck = (int)$zweck; + $this->addMobilityPurpose($bisio_id, $zweck); + } + } + + //check if localData (supports) + if(count($localSupports) > 0){ + foreach ($localSupports as $support){ + $this->addMobilitySupport($bisio_id, $support); + } + } + + $this->terminateWithSuccess(); + } + + public function loadMobility($bisio_id) + { + $result = $this->BisioModel->load($bisio_id); + + $data = $this->getDataOrTerminateWithError($result); + + $this->terminateWithSuccess(current($data)); + } + + public function updateMobility() + { + $this->load->library('form_validation'); + $authUID = getAuthUID(); + + $student_uid = $this->input->post('uid'); + + if(!$student_uid) + { + return $this->terminateWithError($this->p->t('ui', 'error_missingId', ['id'=> 'Student UID']), self::ERROR_TYPE_GENERAL); + } + $formData = $this->input->post('formData'); + + $_POST['von'] = (isset($formData['von']) && !empty($formData['von'])) ? $formData['von'] : null; + $_POST['bis'] = (isset($formData['bis']) && !empty($formData['bis'])) ? $formData['bis'] : null; + $_POST['nation_code'] = (isset($formData['nation_code']) && !empty($formData['nation_code'])) ? $formData['nation_code'] : 'A'; + $_POST['mobilitaetsprogramm_code'] = (isset($formData['mobilitaetsprogramm_code']) && !empty($formData['mobilitaetsprogramm_code'])) ? $formData['mobilitaetsprogramm_code'] : null; + $_POST['herkunftsland_code'] = (isset($formData['herkunftsland_code']) && !empty($formData['herkunftsland_code'])) ? $formData['herkunftsland_code'] : 'A'; + $_POST['ects_erworben'] = (isset($formData['ects_erworben']) && !empty($formData['ects_erworben'])) ? $formData['ects_erworben'] : null; + $_POST['ects_angerechnet'] = (isset($formData['ects_angerechnet']) && !empty($formData['ects_angerechnet'])) ? $formData['ects_angerechnet'] : null; + $_POST['lehreinheit_id'] = (isset($formData['lehreinheit_id']) && !empty($formData['lehreinheit_id'])) ? $formData['lehreinheit_id'] : null; + + $this->form_validation->set_rules('nation_code', 'Nation_code', 'required', [ + 'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => 'Nation_code']) + ]); + $this->form_validation->set_rules('herkunftsland_code', 'Herkunftsland_code', 'required', [ + 'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => 'Herkunftsland_code']) + ]); + $this->form_validation->set_rules('mobilitaetsprogramm_code', 'Mobilitaetsprogramm_code', 'required', [ + 'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => 'Mobilitaetsprogramm_code']) + ]); + $this->form_validation->set_rules('von', 'VonDatum', 'is_valid_date', [ + 'is_valid_date' => $this->p->t('ui', 'error_notValidDate', ['field' => 'VonDatum']) + ]); + + $this->form_validation->set_rules('bis', 'VBisDatum', 'is_valid_date', [ + 'is_valid_date' => $this->p->t('ui', 'error_notValidDate', ['field' => 'VBisDatum']) + ]); + + $this->form_validation->set_rules('ects_erworben', 'Ects_erworben', 'numeric', [ + 'numeric' => $this->p->t('ui', 'error_fieldNotNumeric', ['field' => 'Ects_erworben']) + ]); + + $this->form_validation->set_rules('ects_angerechnet', 'Ects_angerechnet', 'numeric', [ + 'numeric' => $this->p->t('ui', 'error_fieldNotNumeric', ['field' => 'Ects_angerechnet']) + ]); + + $this->form_validation->set_rules('lehreinheit_id', 'Lehreinheit', 'numeric', [ + 'numeric' => $this->p->t('ui', 'error_fieldNotNumeric', ['field' => 'Lehreinheit']) + ]); + + if ($this->form_validation->run() == false) + { + $this->terminateWithValidationErrors($this->form_validation->error_array()); + } + + $result = $this->BisioModel->update( + [ + 'bisio_id' => $formData['bisio_id'] + ], + [ + 'student_uid' => $student_uid, + 'von' => $_POST['von'], + 'bis' => $_POST['bis'], + 'mobilitaetsprogramm_code' => $_POST['mobilitaetsprogramm_code'], + 'nation_code' => $_POST['nation_code'], + 'herkunftsland_code' => $_POST['herkunftsland_code'], + 'lehreinheit_id' => $_POST['lehreinheit_id'], + 'ort' => $formData['ort'], + 'universitaet' => $formData['universitaet'], + 'ects_erworben' => $_POST['ects_erworben'] , + 'ects_angerechnet' => $_POST['ects_angerechnet'], + 'updateamum' => date('c'), + 'updatevon' => $authUID, + ] + ); + + $data = $this->getDataOrTerminateWithError($result); + + $this->terminateWithSuccess(current($data)); + } + + public function deleteMobility($bisio_id) + { + //check if extension table exists + $result = $this->BisioModel->tableExists('extension', 'tbl_mo_bisioidzuordnung'); + $data = $this->getDataOrTerminateWithError($result); + + //if table exists check if existing entry + if(!empty($data)) + { + $this->BisioModel->addSelect("count(*)"); + $this->BisioModel->addJoin('extension.tbl_mo_bisioidzuordnung mo', 'ON (mo.bisio_id = bis.tbl_bisio.bisio_id)', 'LEFT'); + + $resultCheckMo = $this->BisioModel->loadWhere( + array('mo.bisio_id' => $bisio_id) + ); + + $resultCheckMo = $this->getDataOrTerminateWithError($resultCheckMo); + $count = current($resultCheckMo)->count; + + $existsInExtension = $count > 0 ? true : false; + + if($existsInExtension) + $this->terminateWithError($this->p->t('mobility', 'error_existingEntryInExtension'), self::ERROR_TYPE_GENERAL); + } + + $result = $this->BisioModel->delete( + array('bisio_id' => $bisio_id) + ); + + $data = $this->getDataOrTerminateWithError($result); + $this->terminateWithSuccess($data); + } + + public function getLVList($studiengang_kz) + { + $this->load->model('education/Lehrveranstaltung_model', 'LehrveranstaltungModel'); + + $result = $this->LehrveranstaltungModel->getLvsByStudiengangkz($studiengang_kz); + + $data = $this->getDataOrTerminateWithError($result); + + $this->terminateWithSuccess($data); + } + + public function getAllLehreinheiten() + { + $lv_id = $this->input->post('lv_id'); + $studiensemester_kurzbz = $this->input->post('studiensemester_kurzbz'); + + $this->load->model('education/Lehreinheit_model', 'LehreinheitModel'); + + $result = $this->LehreinheitModel->getLesFromLvIds($lv_id, $studiensemester_kurzbz); + + $data = $this->getDataOrTerminateWithError($result); + + $this->terminateWithSuccess($data); + } + + public function getLvsandLesByStudent($student_uid) + { + $this->load->model('education/Lehrveranstaltung_model', 'LehrveranstaltungModel'); + + $result = $this->LehrveranstaltungModel->getLvsByStudent($student_uid); + + $data = $this->getDataOrTerminateWithError($result); + + $lv_ids = array(); + $allData = array(); + + foreach ($data as $lehrveranstaltung) { + $lv_ids[] = $lehrveranstaltung->lehrveranstaltung_id; + } + + $this->load->model('education/Lehreinheit_model', 'LehreinheitModel'); + + foreach ($lv_ids as $id) + { + $result = $this->LehreinheitModel->getLesFromLvIds($id); + $data = $this->getDataOrTerminateWithError($result); + + if (is_array($data)) { + $allData = array_merge($allData, $data); + } + } + + return $this->terminateWithSuccess($allData); + } + + public function getPurposes($bisio_id) + { + $bisio_id = (int)$bisio_id; + + $this->load->model('codex/Bisiozweck_model', 'BisiozweckModel'); + + $this->BisiozweckModel->addSelect("*"); + $this->BisiozweckModel->addJoin('bis.tbl_zweck zw', 'ON (zw.zweck_code = bis.tbl_bisio_zweck.zweck_code)'); + + $result = $this->BisiozweckModel->loadWhere( + array('bisio_id' => $bisio_id) + ); + + $data = $this->getDataOrTerminateWithError($result); + + $this->terminateWithSuccess($data); + } + + public function getSupports($bisio_id) + { + $bisio_id = (int)$bisio_id; + + $this->load->model('codex/Bisioaufenthaltfoerderung_model', 'BisioaufenthaltfoerderungModel'); + + $this->BisioaufenthaltfoerderungModel->addSelect("*"); + $this->BisioaufenthaltfoerderungModel->addJoin('bis.tbl_aufenthaltfoerderung af', 'ON (af.aufenthaltfoerderung_code = bis.tbl_bisio_aufenthaltfoerderung.aufenthaltfoerderung_code)'); + + $result = $this->BisioaufenthaltfoerderungModel->loadWhere( + array('bisio_id' => $bisio_id) + ); + + $data = $this->getDataOrTerminateWithError($result); + + $this->terminateWithSuccess($data); + } + + public function getListPurposes() + { + $this->load->model('codex/Zweck_model', 'ZweckModel'); + + $result = $this->ZweckModel->load(); + + $data = $this->getDataOrTerminateWithError($result); + + $this->terminateWithSuccess($data); + } + + public function getListSupports() + { + $this->load->model('codex/Aufenthaltfoerderung_model', 'AufenthaltfoerderungModel'); + + $result = $this->AufenthaltfoerderungModel->load(); + + $data = $this->getDataOrTerminateWithError($result); + + $this->terminateWithSuccess($data); + } + + public function addMobilityPurpose($bisio_id, $local_purpose = null) + { + $zweck_code = $this->input->post('zweck_code'); + + if($local_purpose){ + $zweck_code = $local_purpose; + } + + $this->load->model('codex/Bisiozweck_model', 'BisiozweckModel'); + if(!$local_purpose) + { + $check = $this->BisiozweckModel->loadWhere( + [ + 'bisio_id' => $bisio_id, + 'zweck_code' => $zweck_code, + ] + ); + if (hasData($check)) + { + $this->terminateWithError($this->p->t('ui', 'error_entryExisting'), self::ERROR_TYPE_GENERAL); + } + } + + $result = $this->BisiozweckModel->insert( + array( + 'bisio_id' => $bisio_id, + 'zweck_code' => $zweck_code + ) + ); + + $data = $this->getDataOrTerminateWithError($result); + + if($local_purpose) + { + return $data; + } + + return $this->terminateWithSuccess(current($data)); + } + + public function deleteMobilityPurpose($bisio_id) + { + $zweck_code = $this->input->post('zweck_code'); + + $this->load->model('codex/Bisiozweck_model', 'BisiozweckModel'); + + + $result = $this->BisiozweckModel->delete( + array( + 'bisio_id' => $bisio_id, + 'zweck_code' => $zweck_code + ) + ); + + $data = $this->getDataOrTerminateWithError($result); + + return $this->terminateWithSuccess(current($data)); + } + + public function addMobilitySupport($bisio_id, $local_support = null) + { + $aufenthaltfoerderung_code = $this->input->post('aufenthaltfoerderung_code'); + + if($local_support){ + $aufenthaltfoerderung_code = $local_support; + } + + $this->load->model('codex/Bisioaufenthaltfoerderung_model', 'BisioaufenthaltfoerderungModel'); + + if(!$local_support) + { + $check = $this->BisioaufenthaltfoerderungModel->loadWhere( + [ + 'bisio_id' => $bisio_id, + 'aufenthaltfoerderung_code' => $aufenthaltfoerderung_code, + ] + ); + if (hasData($check)) + { + $this->terminateWithError($this->p->t('ui', 'error_entryExisting'), self::ERROR_TYPE_GENERAL); + } + } + + $result = $this->BisioaufenthaltfoerderungModel->insert( + array( + 'bisio_id' => $bisio_id, + 'aufenthaltfoerderung_code' => $aufenthaltfoerderung_code + ) + ); + + $data = $this->getDataOrTerminateWithError($result); + + if($local_support) + { + return $data; + } + + return $this->terminateWithSuccess(current($data)); + } + + public function deleteMobilitySupport($bisio_id) + { + $aufenthaltfoerderung_code = $this->input->post('aufenthaltfoerderung_code'); + + $this->load->model('codex/Bisioaufenthaltfoerderung_model', 'BisioaufenthaltfoerderungModel'); + + $result = $this->BisioaufenthaltfoerderungModel->delete( + array( + 'bisio_id' => $bisio_id, + 'aufenthaltfoerderung_code' => $aufenthaltfoerderung_code + ) + ); + $data = $this->getDataOrTerminateWithError($result); + + return $this->terminateWithSuccess(current($data)); + } +} diff --git a/application/models/codex/Bisio_model.php b/application/models/codex/Bisio_model.php index 1cff1dc54..5ecd4bb51 100644 --- a/application/models/codex/Bisio_model.php +++ b/application/models/codex/Bisio_model.php @@ -44,4 +44,27 @@ class Bisio_model extends DB_Model else return success("Bisio not found"); } + + /** + * checks, if an (extension) table exists to avoid later errors + * @param String $schema like 'extension' + * @param String $table like 'tbl_mo_bisiozuordnung' + * @return boolean + */ + public function tableExists($schema, $table) + { + $params = array($schema, $table); + + $qry = "SELECT + 1 + FROM + information_schema.role_table_grants + WHERE + table_schema = ? + AND table_name = ?"; + + $result = $this->execQuery($qry, $params); + + return $result; + } } diff --git a/application/models/education/Lehreinheit_model.php b/application/models/education/Lehreinheit_model.php index 5b7ab04ba..5303da5a6 100644 --- a/application/models/education/Lehreinheit_model.php +++ b/application/models/education/Lehreinheit_model.php @@ -260,27 +260,27 @@ EOSQL; SELECT lv.lehrveranstaltung_id, le.lehreinheit_id, - le.lehrform_kurzbz, - lv.kurzbz, - lv.bezeichnung, - lv.semester, - ma.mitarbeiter_uid, + le.lehrform_kurzbz, + lv.kurzbz, + lv.bezeichnung, + lv.semester, + ma.mitarbeiter_uid, ( - SELECT - STRING_AGG(CONCAT(leg.semester, leg.verband, leg.gruppe), ' ') - FROM lehre.tbl_lehreinheitgruppe leg + SELECT + STRING_AGG(CONCAT(leg.semester, leg.verband, leg.gruppe), ' ') + FROM lehre.tbl_lehreinheitgruppe leg WHERE leg.lehreinheit_id = le.lehreinheit_id ) AS gruppe, tma.kurzbz as kuerzel - FROM + FROM lehre.tbl_lehreinheit le - JOIN + JOIN lehre.tbl_lehrveranstaltung lv ON lv.lehrveranstaltung_id = le.lehrveranstaltung_id - JOIN + JOIN lehre.tbl_lehreinheitmitarbeiter ma USING (lehreinheit_id) JOIN public.tbl_mitarbeiter tma USING (mitarbeiter_uid) - WHERE + WHERE lv.lehrveranstaltung_id = ? "; @@ -290,12 +290,11 @@ EOSQL; $params[] = $studiensemester_kurzbz; } - $query .=" - ORDER BY + $query .=" + ORDER BY le.lehreinheit_id; "; return $this->execQuery($query, $params); - } } diff --git a/application/models/education/Lehrveranstaltung_model.php b/application/models/education/Lehrveranstaltung_model.php index 962520fa0..0993eb851 100644 --- a/application/models/education/Lehrveranstaltung_model.php +++ b/application/models/education/Lehrveranstaltung_model.php @@ -1048,4 +1048,27 @@ class Lehrveranstaltung_model extends DB_Model $res = $this->execReadOnlyQuery($query); return $res; } + + /** + * Gets lehrveranstaltungen of a studiengang + * @param integer $studiengang_kz + * @return array|null + */ + public function getLvsByStudiengangkz($studiengang_kz) + { + $params = array($studiengang_kz); + + $qry = "SELECT + * + FROM + lehre.tbl_lehrveranstaltung + WHERE lehrveranstaltung_id IN + (SELECT lehrveranstaltung_id + FROM campus.vw_student_lehrveranstaltung + WHERE studiengang_kz = ?"; + + $qry .= ") ORDER BY semester, bezeichnung"; + + return $this->execQuery($qry, $params); + } } diff --git a/public/js/api/stv.js b/public/js/api/stv.js index f6c7831b3..ae88b0516 100644 --- a/public/js/api/stv.js +++ b/public/js/api/stv.js @@ -9,6 +9,7 @@ import details from './stv/details.js'; import exam from './stv/exam.js'; import abschlusspruefung from './stv/abschlusspruefung.js'; import grades from './stv/grades.js'; +import mobility from './stv/mobility.js'; export default { verband, @@ -22,6 +23,7 @@ export default { exam, abschlusspruefung, grades, + mobility, configStudent() { return this.$fhcApi.get('api/frontend/v1/stv/config/student'); }, diff --git a/public/js/api/stv/mobility.js b/public/js/api/stv/mobility.js new file mode 100644 index 000000000..c680dc70b --- /dev/null +++ b/public/js/api/stv/mobility.js @@ -0,0 +1,54 @@ +export default { + getMobilitaeten (url, config, params){ + return this.$fhcApi.get('api/frontend/v1/stv/mobility/getMobilitaeten/' + params.id); + }, + getProgramsMobility(){ + return this.$fhcApi.get('api/frontend/v1/stv/mobility/getProgramsMobility/'); + }, + addNewMobility(data){ + return this.$fhcApi.post('api/frontend/v1/stv/mobility/insertMobility/', data); + }, + loadMobility(bisio_id){ + return this.$fhcApi.get('api/frontend/v1/stv/mobility/loadMobility/' + bisio_id); + }, + updateMobility(data){ + return this.$fhcApi.post('api/frontend/v1/stv/mobility/updateMobility/', data); + }, + deleteMobility(bisio_id){ + return this.$fhcApi.post('api/frontend/v1/stv/mobility/deleteMobility/' + bisio_id); + }, + getLVList(studiengang_kz){ + return this.$fhcApi.get('api/frontend/v1/stv/mobility/getLVList/' + studiengang_kz); + }, + getAllLehreinheiten(data){ + return this.$fhcApi.post('api/frontend/v1/stv/mobility/getAllLehreinheiten/', data) + }, + getLvsandLesByStudent(uid){ + return this.$fhcApi.get('api/frontend/v1/stv/mobility/getLvsandLesByStudent/' + uid); + }, + getPurposes(url, config, params){ + return this.$fhcApi.get('api/frontend/v1/stv/mobility/getPurposes/' + params.id); + }, + getSupports(url, config, params){ + return this.$fhcApi.get('api/frontend/v1/stv/mobility/getSupports/' + params.id); + }, + getListPurposes() { + return this.$fhcApi.get('api/frontend/v1/stv/mobility/getListPurposes/'); + }, + getListSupports() { + return this.$fhcApi.get('api/frontend/v1/stv/mobility/getListSupports/'); + }, + deleteMobilityPurpose(params) { + return this.$fhcApi.post('api/frontend/v1/stv/mobility/deleteMobilityPurpose/' + params.bisio_id, params); + }, + addMobilityPurpose(params) { + return this.$fhcApi.post('api/frontend/v1/stv/mobility/addMobilityPurpose/' + params.bisio_id, params); + }, + deleteMobilitySupport(params) { + return this.$fhcApi.post('api/frontend/v1/stv/mobility/deleteMobilitySupport/' + params.bisio_id, params); + }, + addMobilitySupport(params) { + return this.$fhcApi.post('api/frontend/v1/stv/mobility/addMobilitySupport/' + params.bisio_id, params); + }, + +} \ No newline at end of file diff --git a/public/js/components/Stv/Studentenverwaltung/Details/Mobility.js b/public/js/components/Stv/Studentenverwaltung/Details/Mobility.js new file mode 100644 index 000000000..d4398bf82 --- /dev/null +++ b/public/js/components/Stv/Studentenverwaltung/Details/Mobility.js @@ -0,0 +1,22 @@ +import TableMobility from "./Mobility/Mobility.js"; + +export default { + components: { + TableMobility + }, + provide() { + return { + config: this.config + }; + }, + props: { + modelValue: Object, + }, + data(){ + return {} + }, + template: ` +
+ +
` +}; \ No newline at end of file diff --git a/public/js/components/Stv/Studentenverwaltung/Details/Mobility/List/Purpose.js b/public/js/components/Stv/Studentenverwaltung/Details/Mobility/List/Purpose.js new file mode 100644 index 000000000..2515b5865 --- /dev/null +++ b/public/js/components/Stv/Studentenverwaltung/Details/Mobility/List/Purpose.js @@ -0,0 +1,255 @@ +import {CoreFilterCmpt} from "../../../../../filter/Filter.js"; + +import BsModal from "../../../../../Bootstrap/Modal.js"; +import CoreForm from '../../../../../Form/Form.js'; +import FormInput from '../../../../../Form/Input.js'; + +export default { + components: { + CoreFilterCmpt, + BsModal, + CoreForm, + FormInput + }, + props: { + bisio_id: { + type: [Number], + required: true + }, + listPurposes: { + type: Array, + required: true + }, + }, + data() { + return { + tabulatorOptions: { + ajaxURL: 'dummy', + ajaxRequestFunc: (url, config, params) => { + if (this.bisio_id) { + //fake params for getting api call with tabulator to run + const config = { + method: "get", + }; + const params = { + id: this.bisio_id, + }; + return this.$fhcApi.factory.stv.mobility.getPurposes('dummy', config, params) + } + else + { + // use local data + return new Promise((resolve) => { + const localData = this.localData; + resolve(localData); + }); + } + }, + ajaxParams: () => { + return { + id: this.bisio_id || "local" + }; + }, + ajaxResponse: (url, params, response) => response.data || this.localData, + + + columns: [ + {title: "Zweck_code", field: "zweck_code", visible: false}, + {title: "Kurzbz", field: "kurzbz", visible: false}, + {title: "Bezeichnung", field: "bezeichnung"}, + { + title: 'Aktionen', field: 'actions', + minWidth: 50, + formatter: (cell, formatterParams, onRendered) => { + + let container = document.createElement('div'); + container.className = "d-flex gap-2"; + + let button = document.createElement('button'); + button.className = 'btn btn-outline-secondary btn-action'; + button.innerHTML = ''; + button.title = this.$p.t('global', 'loeschen'); + button.addEventListener( + 'click', + () => + this.actionDeletePurpose(cell.getData().zweck_code) + ); + container.append(button); + + return container; + }, + frozen: true + }, + ], + layout: 'fitColumns', + layoutColumnsOnNewData: false, + height: '250', + selectableRangeMode: 'click', + selectable: true, + persistenceID: 'core-mobility-purpose' + }, + tabulatorEvents: [ + { + event: 'tableBuilt', + handler: async() => { + + await this.$p.loadCategory(['ui', 'global', 'mobility']); + + let cm = this.$refs.table.tabulator.columnManager; + + cm.getColumnByField('bezeichnung').component.updateDefinition({ + title: this.$p.t('ui', 'bezeichnung') + }); + cm.getColumnByField('kurzbz').component.updateDefinition({ + title: this.$p.t('mobility', 'kurzbz') + }); +/* cm.getColumnByField('actions').component.updateDefinition({ + title: this.$p.t('global', 'aktionen') + });*/ + } + } + ], + clickedRows: [], + formData: { + zweck_code: "" + }, + localData: [], + } + }, + watch: { + bisio_id() { + if (this.$refs.table) { + this.$refs.table.reloadTable(); + } + }, + }, + methods: { + actionNewPurpose() { + this.resetModal(); + this.$refs.mobilityPurpose.show(); + }, + actionDeletePurpose(zweck_code) { + if (this.bisio_id) + { + this.$emit('deleteMobilityPurpose', { + bisio_id: this.bisio_id, + zweck_code: zweck_code + }); + } + else + { + const data = this.$refs.table.tabulator.getData(); + const rowExists = data.some(item => item.zweck_code === zweck_code); + + if (rowExists) { + this.$refs.table.tabulator.deleteRow(zweck_code); + } + } + }, + handleSubmitAction() { + if (this.bisio_id) { + this.$emit('setMobilityPurpose', { + zweck_code: this.formData.zweck_code, + bisio_id: this.bisio_id + }); + } else { + const purpose = this.listPurposes.find(item => item.zweck_code === this.formData.zweck_code); + const newEntry = { + id: Number (this.formData.zweck_code), //id necessary due to tabulator deleteRow-Action + zweck_code: Number (this.formData.zweck_code), + kurzbz: purpose.kurzbz, + bezeichnung: purpose.bezeichnung + }; + + const data = this.$refs.table.tabulator.getData(); + const rowExists = data.some(item => item.zweck_code === Number (this.formData.zweck_code)); + + if(rowExists){ + this.$fhcAlert.alertError(this.$p.t('ui', 'error_entryExisting')); + } + else + { + this.localData.push(newEntry); + + this.$emit('setMobilityPurposeToNewMobility', { + zweck_code: this.formData.zweck_code, + }); + } + + } + this.closeModal(); + }, + + closeModal(){ + this.$refs.mobilityPurpose.hide(); + this.$emit('close-modal'); + }, + openModal(){ + this.$refs.mobilityPurpose.show(); + this.$emit('open-modal'); + }, + reload() { + this.$refs.table.reloadTable(); + this.$emit('reload'); + }, + resetModal(){ + this.formData = {}; + this.formData.zweck_code = null; + }, + resetLocalData() { + this.$refs.table.tabulator.clearData(); + } + }, + template: ` +
+
+ + + + +
+ + + + +
+ + + + +
+
+ + + +
+
+ +
` + } \ No newline at end of file diff --git a/public/js/components/Stv/Studentenverwaltung/Details/Mobility/List/Support.js b/public/js/components/Stv/Studentenverwaltung/Details/Mobility/List/Support.js new file mode 100644 index 000000000..443fa5098 --- /dev/null +++ b/public/js/components/Stv/Studentenverwaltung/Details/Mobility/List/Support.js @@ -0,0 +1,247 @@ +import {CoreFilterCmpt} from "../../../../../filter/Filter.js"; + +import BsModal from "../../../../../Bootstrap/Modal.js"; +import CoreForm from '../../../../../Form/Form.js'; +import FormInput from '../../../../../Form/Input.js'; + +export default { + components: { + CoreFilterCmpt, + BsModal, + CoreForm, + FormInput + }, + props: { + bisio_id: { + type: [Number], + required: true + }, + listSupports: { + type: Array, + required: true + }, + }, + data() { + return { + tabulatorOptions: { + ajaxURL: 'dummy', + ajaxRequestFunc: (url, config, params) => { + if (this.bisio_id) { + //fake params for getting api call with tabulator to run + const config = { + method: "get", + }; + const params = { + id: this.bisio_id, + }; + return this.$fhcApi.factory.stv.mobility.getSupports('dummy', config, params) + } + else + { + // use local data + return new Promise((resolve) => { + const localData = this.localData; + resolve(localData); + }); + } + }, + ajaxParams: () => { + return { + id: this.bisio_id || "local" + }; + }, + ajaxResponse: (url, params, response) => response.data || this.localData, + + columns: [ + {title: "Aufenthaltsförderung_code", field: "aufenthaltfoerderung_code", visible: false}, + {title: "Bezeichnung", field: "bezeichnung"}, + { + title: 'Aktionen', field: 'actions', + minWidth: 50, + formatter: (cell, formatterParams, onRendered) => { + + let container = document.createElement('div'); + container.className = "d-flex gap-2"; + + let button = document.createElement('button'); + button.className = 'btn btn-outline-secondary btn-action'; + button.innerHTML = ''; + button.title = this.$p.t('global', 'loeschen'); + button.addEventListener( + 'click', + () => + this.actionDeleteSupport(cell.getData().aufenthaltfoerderung_code) + ); + container.append(button); + + return container; + }, + frozen: true + }, + ], + layout: 'fitColumns', + layoutColumnsOnNewData: false, + height: '250', + selectableRangeMode: 'click', + selectable: true, + persistenceID: 'core-mobility-support' + }, + tabulatorEvents: [ + { + event: 'tableBuilt', + handler: async() => { + + await this.$p.loadCategory(['ui', 'global', 'mobility']); + + let cm = this.$refs.table.tabulator.columnManager; + + cm.getColumnByField('bezeichnung').component.updateDefinition({ + title: this.$p.t('ui', 'bezeichnung') + }); + /* cm.getColumnByField('actions').component.updateDefinition({ + title: this.$p.t('global', 'aktionen') + });*/ + } + } + ], + clickedRows: [], + formData: { + aufenthaltfoerderung_code: "", + }, + localData: [], + } + }, + watch: { + bisio_id() { + if (this.$refs.table) { + this.$refs.table.reloadTable(); + } + }, + }, + methods: { + actionNewSupport() { + this.resetModal(); + this.$refs.mobilitySupport.show(); + }, + actionDeleteSupport(aufenthaltfoerderung_code) { + if (this.bisio_id) + { + this.$emit('deleteMobilitySupport', { + bisio_id: this.bisio_id, + aufenthaltfoerderung_code: aufenthaltfoerderung_code + }); + } + else + { + const data = this.$refs.table.tabulator.getData(); + const rowExists = data.some(item => item.aufenthaltfoerderung_code === aufenthaltfoerderung_code); + + if (rowExists) { + this.$refs.table.tabulator.deleteRow(aufenthaltfoerderung_code); + } + } + }, + handleSubmitAction() { + if (this.bisio_id) { + this.$emit('setMobilitySupport', { + aufenthaltfoerderung_code: this.formData.aufenthaltfoerderung_code, + bisio_id: this.bisio_id + }); + } else { + const support = this.listSupports.find(item => item.aufenthaltfoerderung_code === this.formData.aufenthaltfoerderung_code); + const newEntry = { + id: Number (this.formData.aufenthaltfoerderung_code), //id necessary due to tabulator deleteRow-Action + aufenthaltfoerderung_code: this.formData.aufenthaltfoerderung_code, + bezeichnung: support.bezeichnung + }; + + const data = this.$refs.table.tabulator.getData(); + const rowExists = data.some(item => item.aufenthaltfoerderung_code === Number (this.formData.aufenthaltfoerderung_code)); + + if(rowExists){ + this.$fhcAlert.alertError(this.$p.t('ui', 'error_entryExisting')); + } + else + { + this.localData.push(newEntry); + + this.$emit('setMobilitySupportToNewMobility', { + aufenthaltfoerderung_code: this.formData.aufenthaltfoerderung_code, + }); + } + + } + this.closeModal(); + }, + closeModal(){ + this.$refs.mobilitySupport.hide(); + this.$emit('close-modal'); + }, + openModal(){ + this.$refs.mobilitySupport.show(); + this.$emit('open-modal'); + }, + reload() { + this.$refs.table.reloadTable(); + this.$emit('reload'); + }, + resetModal(){ + this.formData = {}; + this.formData.aufenthaltfoerderung_code = null; + }, + resetLocalData() { + this.$refs.table.tabulator.clearData(); + } + }, + template: ` +
+
+ + + + +
+ + + + +
+ + + + +
+
+ + + +
+
+ +
` +} \ No newline at end of file diff --git a/public/js/components/Stv/Studentenverwaltung/Details/Mobility/Mobility.js b/public/js/components/Stv/Studentenverwaltung/Details/Mobility/Mobility.js new file mode 100644 index 000000000..0cd30ec42 --- /dev/null +++ b/public/js/components/Stv/Studentenverwaltung/Details/Mobility/Mobility.js @@ -0,0 +1,578 @@ +import {CoreFilterCmpt} from "../../../../filter/Filter.js"; +import BsModal from "../../../../Bootstrap/Modal.js"; +import FormForm from '../../../../Form/Form.js'; +import FormInput from '../../../../Form/Input.js'; +import MobilityPurpose from './List/Purpose.js'; +import MobilitySupport from './List/Support.js'; + + +export default { + components: { + CoreFilterCmpt, + BsModal, + FormForm, + FormInput, + MobilityPurpose, + MobilitySupport + }, + inject: { + $reloadList: { + from: '$reloadList', + required: true + }, + lists: { + from: 'lists' + }, + currentSemester: { + from: 'currentSemester', + }, + }, + props: { + student: Object + }, + data() { + return { + tabulatorOptions: { + ajaxURL: 'dummy', + ajaxRequestFunc: this.$fhcApi.factory.stv.mobility.getMobilitaeten, + ajaxParams: () => { + return { + id: this.student.uid + }; + }, + ajaxResponse: (url, params, response) => response.data, + columns: [ + {title: "Kurzbz", field: "kurzbz"}, + {title: "Nation", field: "nation_code"}, + {title: "Von", field: "format_von"}, + {title: "Bis", field: "format_bis"}, + {title: "bisio_id", field: "bisio_id"}, + { + title: 'Aktionen', field: 'actions', + minWidth: 150, // Ensures Action-buttons will be always fully displayed + formatter: (cell, formatterParams, onRendered) => { + let container = document.createElement('div'); + container.className = "d-flex gap-2"; + + let button = document.createElement('button'); + button.className = 'btn btn-outline-secondary btn-action'; + button.innerHTML = ''; + button.title = this.$p.t('ui', 'bearbeiten'); + button.addEventListener('click', (event) => + this.actionEditMobility(cell.getData().bisio_id) + ); + container.append(button); + + button = document.createElement('button'); + button.className = 'btn btn-outline-secondary btn-action'; + button.innerHTML = ''; + button.title = this.$p.t('ui', 'loeschen'); + button.addEventListener('click', () => + this.actionDeleteMobility(cell.getData().bisio_id) + ); + container.append(button); + + return container; + }, + frozen: true + }, + ], + layout: 'fitDataFill', + layoutColumnsOnNewData: false, + height: 'auto', + selectable: true, + index: 'bisio_id', + persistenceID: 'stv-details-table_mobiliy' + }, + tabulatorEvents: [ + { + event: 'dataLoaded', + handler: data => this.tabulatorData = data.map(item => { + // item.actionDiv = document.createElement('div'); + return item; + }), + }, + { + event: 'tableBuilt', + handler: async() => { + await this.$p.loadCategory(['global', 'person', 'stv', 'mobility', 'ui']); + + + let cm = this.$refs.table.tabulator.columnManager; + + cm.getColumnByField('kurzbz').component.updateDefinition({ + title: this.$p.t('mobility', 'kurzbz_program') + }); + cm.getColumnByField('nation_code').component.updateDefinition({ + title: this.$p.t('mobility', 'gastnation') + }); + cm.getColumnByField('format_von').component.updateDefinition({ + title: this.$p.t('ui', 'von') + }); + cm.getColumnByField('format_bis').component.updateDefinition({ + title: this.$p.t('global', 'bis') + }); + cm.getColumnByField('bisio_id').component.updateDefinition({ + title: this.$p.t('mobility', 'bisio_id') + }); + +/* cm.getColumnByField('actions').component.updateDefinition({ + title: this.$p.t('global', 'aktionen') + });*/ + } + } + ], + formData: { + von: new Date(), + bis: new Date(), + mobilitaetsprogramm_code: 7, + nation_code: 'A', + herkunftsland_code: 'A', + bisio_id: null, + localPurposes: [], + localSupports: [] + }, + statusNew: true, + programsMobility: [], + listLvs: [], + listLes: [], + listLvsAndLes: [], + listPurposes: [], + listSupports: [], + tabulatorData: [] + } + }, + watch: { + student(){ + if (this.$refs.table) { + this.$refs.table.reloadTable(); + } + }, +/* formData.lehrveranstaltung_id(){ + + }*/ + }, + computed:{ + lv_teile(){ + return this.listLvsAndLes.filter(lv => lv.lehreinheit_id == this.formData.lehreinheit_id); + }, + }, + methods: { + actionNewMobility() { + this.resetForm(); + this.statusNew = true; + }, + actionEditMobility(bisio_id) { + this.resetForm(); + this.statusNew = false; + this.loadMobility(bisio_id); + }, + actionDeleteMobility(bisio_id) { + this.$fhcAlert + .confirmDelete() + .then(result => result + ? bisio_id + : Promise.reject({handled: true})) + .then(this.deleteMobility) + .catch(this.$fhcAlert.handleSystemError); + }, + addNewMobility() { + const dataToSend = { + uid: this.student.uid, + formData: this.formData + }; + return this.$refs.formMobility.factory.stv.mobility.addNewMobility(dataToSend) + .then(response => { + this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successSave')); + this.resetForm(); + }) + .catch(this.$fhcAlert.handleSystemError) + .finally(() => { + this.reload(); + this.$refs.purposes.resetLocalData(); + this.$refs.supports.resetLocalData(); + }); + }, + loadItems(){ + if(this.formData.lehrveranstaltung) { + this.getLehreinheiten(this.formData.lehrveranstaltung, this.currentSemester); + } + }, + getLehreinheiten(lv_id, studiensemester_kurzbz) { + const data = { + lv_id: lv_id, + studiensemester_kurzbz: studiensemester_kurzbz + }; + return this.$fhcApi.factory.stv.mobility.getAllLehreinheiten(data) + .then(response => { + this.listLes = response.data; + }) + .catch(this.$fhcAlert.handleSystemError); + }, + reload() { + this.$refs.table.reloadTable(); + }, + loadMobility(bisio_id) { + return this.$fhcApi.factory.stv.mobility.loadMobility(bisio_id) + .then(result => { + this.formData = result.data; + }) + .catch(this.$fhcAlert.handleSystemError); + }, + updateMobility(bisio_id) { + const dataToSend = { + formData: this.formData, + uid: this.student.uid, + }; + this.$refs.formMobility.factory.stv.mobility.updateMobility(dataToSend) + .then(response => { + this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successSave')); + this.resetForm(); + }) + .catch(this.$fhcAlert.handleSystemError) + .finally(() => { + this.reload(); + }); + }, + deleteMobility(bisio_id) { + return this.$fhcApi.factory.stv.mobility.deleteMobility(bisio_id) + .then(response => { + this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successDelete')); + }) + .catch(this.$fhcAlert.handleSystemError) + .finally(() => { + this.reload(); + }); + }, + resetForm() { + this.formData = {}; + this.formData.von = new Date(); + this.formData.bis = new Date(); + this.formData.mobilitaetsprogramm_code = 7; + this.formData.nation_code = 'A'; + this.formData.herkunftsland_code = 'A'; + this.formData.bisio_id = null; + this.formData.localPurposes = []; + this.formData.localSupports = []; + }, + // ----------------------------------- methods purposes ----------------------------------- + addMobilityPurpose({zweck_code, bisio_id}){ + let params = { + bisio_id : bisio_id, + zweck_code: zweck_code + }; + return this.$fhcApi.factory.stv.mobility.addMobilityPurpose(params) + .then(response => { + this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successSave')); + + this.$refs.purposes.reload(); + }) + .catch(this.$fhcAlert.handleSystemError); + }, + deleteMobilityPurpose({zweck_code, bisio_id}){ + let params = { + bisio_id : bisio_id, + zweck_code: zweck_code + }; + return this.$fhcApi.factory.stv.mobility.deleteMobilityPurpose(params) + .then(response => { + this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successDelete')); + + this.$refs.purposes.reload(); + }) + .catch(this.$fhcAlert.handleSystemError); + }, + addPurposeToMobility({zweck_code}){ + this.formData.localPurposes.push(zweck_code); + }, + // ----------------------------------- methods supports ----------------------------------- + addMobilitySupport({aufenthaltfoerderung_code, bisio_id}){ + let params = { + bisio_id : bisio_id, + aufenthaltfoerderung_code: aufenthaltfoerderung_code + }; + return this.$fhcApi.factory.stv.mobility.addMobilitySupport(params) + .then(response => { + this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successSave')); + + this.$refs.supports.reload(); + }) + .catch(this.$fhcAlert.handleSystemError); + }, + deleteMobilitySupport({aufenthaltfoerderung_code, bisio_id}){ + let params = { + bisio_id : bisio_id, + aufenthaltfoerderung_code: aufenthaltfoerderung_code + }; + return this.$fhcApi.factory.stv.mobility.deleteMobilitySupport(params) + .then(response => { + this.$fhcAlert.alertSuccess(this.$p.t('ui', 'successDelete')); + + this.$refs.supports.reload(); + }) + .catch(this.$fhcAlert.handleSystemError); + }, + addSupportToMobility({aufenthaltfoerderung_code}){ + this.formData.localSupports.push(aufenthaltfoerderung_code); + }, + }, + created() { + this.$fhcApi.factory.stv.mobility.getProgramsMobility() + .then(result => { + this.programsMobility = result.data; + }) + .catch(this.$fhcAlert.handleSystemError); + this.$fhcApi.factory.stv.mobility.getLVList(this.student.studiengang_kz) + .then(result => { + this.listLvs = result.data; + }) + .catch(this.$fhcAlert.handleSystemError); + this.$fhcApi.factory.stv.mobility.getListPurposes() + .then(result => { + this.listPurposes = result.data; + }) + .catch(this.$fhcAlert.handleSystemError); + this.$fhcApi.factory.stv.mobility.getListSupports() + .then(result => { + this.listSupports = result.data; + }) + .catch(this.$fhcAlert.handleSystemError); + this.$fhcApi.factory.stv.mobility.getLvsandLesByStudent(this.student.uid) + .then(result => { + this.listLvsAndLes = result.data; + }) + .catch(this.$fhcAlert.handleSystemError); + }, + template: ` +
+

In / Out

+ + + + + + +
+ BIS + Outgoing +
+ +
+ + + + + + +
+ +
+ + + + +
+ +
+ + + + + + +
+ +
+ + + + + + +
+ +
+ + + + + + + +
+ +
+
+ +
+ +
+ +
+
+ +
+ + +
+ +
+ + +
+` +} + diff --git a/system/phrasesupdate.php b/system/phrasesupdate.php index d8e93ce2a..b699e003c 100644 --- a/system/phrasesupdate.php +++ b/system/phrasesupdate.php @@ -39750,6 +39750,328 @@ array( ) ), // FHC4 Phrases CleanUpTasks End + // FHC4 Phrases Mobility Start + array( + 'app' => 'core', + 'category' => 'stv', + 'phrase' => 'tab_mobility', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Mobilität', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Mobility', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'mobility', + 'phrase' => 'mobilitaetsprogramm', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Mobilitätsprogramm', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Mobility program', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'mobility', + 'phrase' => 'gastnation', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Gastnation', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Host nation', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'mobility', + 'phrase' => 'herkunftsland', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Herkunftsland', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Country of origin', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'mobility', + 'phrase' => 'universitaet', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Universität', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'University', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'mobility', + 'phrase' => 'ects_erworben', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Erworbene ECTS', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'ECTS acquired', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'mobility', + 'phrase' => 'ects_angerechnet', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Angerechnete ECTS', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'ECTS credited', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'mobility', + 'phrase' => 'zweck', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Zweck', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Purpose', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'mobility', + 'phrase' => 'aufenthalt', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Aufenthalt Förderung', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Residency funding', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'mobility', + 'phrase' => 'zweck_neu', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Mobilitätszweck anlegen', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Create motivation for mobility', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'mobility', + 'phrase' => 'foerderung_neu', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Förderung für Aufenthalt anlegen', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Create funding for mobility', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'mobility', + 'phrase' => 'kurzbz_program', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Programmkurzbezeichnung', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Program short description', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'mobility', + 'phrase' => 'bisio_id', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Bisio ID', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Bisio ID', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'mobility', + 'phrase' => 'kurzbz', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Kurzbezeichnung', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Short Name', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'ui', + 'phrase' => 'error_entryExisting', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Eintrag bereits vorhanden', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Entry already existing', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + array( + 'app' => 'core', + 'category' => 'mobility', + 'phrase' => 'error_existingEntryInExtension', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'Dieser Datensatz wird von der Mobility Extension verwendet und muss zuerst dort gelöscht werden.', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'This record is used by the Mobility Extension and must first be deleted there.', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), + // FHC4 Phrases Mobility End );