mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-22 09:22:22 +00:00
Refactor status for api-controller, add phrases for alerts
This commit is contained in:
@@ -12,24 +12,23 @@ class Prestudent extends FHCAPI_Controller
|
||||
'get' => ['admin:r', 'assistenz:r'],
|
||||
'updatePrestudent' => ['admin:w', 'assistenz:w'],
|
||||
'getHistoryPrestudents' => ['admin:r', 'assistenz:r'],
|
||||
'getBezeichnungZGV' => 'admin:r', // TODO(manu): self::PERM_LOGGED
|
||||
'getBezeichnungDZgv' => 'admin:r', // TODO(manu): self::PERM_LOGGED
|
||||
'getBezeichnungMZgv' => 'admin:r', // TODO(manu): self::PERM_LOGGED
|
||||
'getAusbildung' => 'admin:r', // TODO(manu): self::PERM_LOGGED
|
||||
'getAufmerksamdurch' => 'admin:r', // TODO(manu): self::PERM_LOGGED
|
||||
'getBerufstaetigkeit' => 'admin:r', // TODO(manu): self::PERM_LOGGED
|
||||
'getTypenStg' => 'admin:r', // TODO(manu): self::PERM_LOGGED
|
||||
'getStudiensemester' => 'admin:r', // TODO(manu): self::PERM_LOGGED
|
||||
'getStudienplaene' => 'admin:r', // TODO(manu): self::PERM_LOGGED
|
||||
'getBezeichnungZGV' => 'assistenz:r', // TODO(manu): self::PERM_LOGGED
|
||||
'getBezeichnungDZgv' => 'assistenz:r', // TODO(manu): self::PERM_LOGGED
|
||||
'getBezeichnungMZgv' => 'assistenz:r', // TODO(manu): self::PERM_LOGGED
|
||||
'getAusbildung' => 'assistenz:r', // TODO(manu): self::PERM_LOGGED
|
||||
'getAufmerksamdurch' => 'assistenz:r', // TODO(manu): self::PERM_LOGGED
|
||||
'getBerufstaetigkeit' => 'assistenz:r', // TODO(manu): self::PERM_LOGGED
|
||||
'getTypenStg' => 'assistenz:r', // TODO(manu): self::PERM_LOGGED
|
||||
'getStudiensemester' => 'assistenz:r', // TODO(manu): self::PERM_LOGGED
|
||||
'getStudienplaene' => 'assistenz:r', // TODO(manu): self::PERM_LOGGED
|
||||
]);
|
||||
|
||||
// Load Libraries
|
||||
$this->load->library('VariableLib', ['uid' => getAuthUID()]);
|
||||
|
||||
|
||||
// Load language phrases
|
||||
$this->loadPhrases([
|
||||
'ui', 'studierendenantrag'
|
||||
'ui', 'studierendenantrag', 'lehre'
|
||||
]);
|
||||
}
|
||||
|
||||
@@ -40,13 +39,15 @@ class Prestudent extends FHCAPI_Controller
|
||||
$this->PrestudentModel->addSelect('*');
|
||||
$result = $this->PrestudentModel->loadWhere(['prestudent_id' => $prestudent_id]);
|
||||
|
||||
if (isError($result)) {
|
||||
if (isError($result))
|
||||
{
|
||||
$this->terminateWithError(getError($result), self::ERROR_TYPE_GENERAL);
|
||||
} elseif (!hasData($result)) {
|
||||
return show_404();
|
||||
} else {
|
||||
$this->terminateWithSuccess(current(getData($result)));
|
||||
}
|
||||
if(!hasData($result))
|
||||
{
|
||||
return show_404();
|
||||
}
|
||||
$this->terminateWithSuccess(current(getData($result)));
|
||||
}
|
||||
|
||||
public function updatePrestudent($prestudent_id)
|
||||
@@ -67,6 +68,11 @@ class Prestudent extends FHCAPI_Controller
|
||||
|
||||
$stg = $result->studiengang_kz;
|
||||
|
||||
if(!$this->permissionlib->isBerechtigt('admin', 'suid', $stg) && !$this->permissionlib->isBerechtigt('assistenz', 'suid', $stg))
|
||||
{
|
||||
return $this->terminateWithError($this->p->t('lehre','error_keineSchreibrechte'), self::ERROR_TYPE_GENERAL);
|
||||
}
|
||||
|
||||
//Form validation
|
||||
$this->form_validation->set_rules('priorisierung', 'Priorisierung', 'numeric', [
|
||||
'numeric' => $this->p->t('ui','error_fieldNotNumeric',['field' => 'Priorisierung'])
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,316 +0,0 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
use \DateTime as DateTime;
|
||||
|
||||
class Prestudent extends FHC_Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
// Load Libraries
|
||||
$this->load->library('AuthLib');
|
||||
$this->load->library('VariableLib', ['uid' => getAuthUID()]);
|
||||
|
||||
|
||||
// Load language phrases
|
||||
$this->loadPhrases([
|
||||
'ui', 'studierendenantrag'
|
||||
]);
|
||||
}
|
||||
|
||||
public function get($prestudent_id)
|
||||
{
|
||||
$this->load->model('crm/Prestudent_model', 'PrestudentModel');
|
||||
|
||||
$this->PrestudentModel->addSelect('*');
|
||||
$result = $this->PrestudentModel->loadWhere(['prestudent_id' => $prestudent_id]);
|
||||
|
||||
if (isError($result)) {
|
||||
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
$this->outputJson(getError($result));
|
||||
} elseif (!hasData($result)) {
|
||||
$this->output->set_status_header(REST_Controller::HTTP_NOT_FOUND);
|
||||
$this->outputJson('NOT FOUND');
|
||||
} else {
|
||||
$this->outputJson(current(getData($result)));
|
||||
}
|
||||
}
|
||||
|
||||
public function updatePrestudent($prestudent_id)
|
||||
{
|
||||
$this->load->library('form_validation');
|
||||
$this->load->model('crm/Prestudent_model', 'PrestudentModel');
|
||||
|
||||
//get Studiengang von prestudent_id
|
||||
$this->load->model('crm/Prestudent_model', 'PrestudentModel');
|
||||
$result = $this->PrestudentModel->load([
|
||||
'prestudent_id'=> $prestudent_id,
|
||||
]);
|
||||
if(isError($result))
|
||||
{
|
||||
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
return $this->outputJson(getError($result));
|
||||
}
|
||||
$result = current(getData($result));
|
||||
|
||||
$stg = $result->studiengang_kz;
|
||||
|
||||
if (!$this->permissionlib->isBerechtigt('admin', 'suid', $stg) && !$this->permissionlib->isBerechtigt('assistenz', 'suid', $stg))
|
||||
{
|
||||
$result = $this->p->t('lehre','error_keineSchreibrechte');
|
||||
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
return $this->outputJson($result);
|
||||
}
|
||||
|
||||
//TODO(Manu) API Controller
|
||||
$_POST = json_decode(utf8_encode($this->input->raw_input_stream), true);
|
||||
|
||||
|
||||
//Form validation
|
||||
$this->form_validation->set_rules('priorisierung', 'Priorisierung', 'numeric', [
|
||||
'numeric' => $this->p->t('ui','error_fieldNotNumeric',['field' => 'Priorisierung'])
|
||||
]);
|
||||
|
||||
if ($this->form_validation->run() == false)
|
||||
{
|
||||
return $this->outputJsonError($this->form_validation->error_array());
|
||||
}
|
||||
|
||||
$deltaData = $_POST;
|
||||
|
||||
if(!$prestudent_id)
|
||||
{
|
||||
return $this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
}
|
||||
|
||||
$uid = getAuthUID();
|
||||
|
||||
$array_allowed_props_prestudent = [
|
||||
'aufmerksamdurch_kurzbz',
|
||||
'studiengang_kz',
|
||||
'gsstudientyp_kurzbz',
|
||||
'person_id',
|
||||
'berufstaetigkeit_code',
|
||||
'ausbildungcode',
|
||||
'zgv_code',
|
||||
'zgvort',
|
||||
'zgvdatum',
|
||||
'zgvnation',
|
||||
'zgvmas_code',
|
||||
'zgvmaort',
|
||||
'zgvmadatum',
|
||||
'zgvmanation',
|
||||
'facheinschlberuf',
|
||||
'bismelden',
|
||||
'anmerkung',
|
||||
'dual',
|
||||
'zgvdoktor_code',
|
||||
'zgvdoktorort',
|
||||
'zgvdoktordatum',
|
||||
'zgvdoktornation',
|
||||
'aufnahmegruppe_kurzbz',
|
||||
'priorisierung',
|
||||
'foerderrelevant',
|
||||
'zgv_erfuellt',
|
||||
'zgvmas_erfuellt',
|
||||
'zgvdoktor_erfuellt',
|
||||
'mentor',
|
||||
'aufnahmeschluessel',
|
||||
'standort_code'
|
||||
];
|
||||
|
||||
$update_prestudent = array();
|
||||
foreach ($array_allowed_props_prestudent as $prop)
|
||||
{
|
||||
$val = isset($deltaData[$prop]) ? $deltaData[$prop] : null;
|
||||
if ($val !== null || $prop == 'foerderrelevant') {
|
||||
$update_prestudent[$prop] = $val;
|
||||
}
|
||||
}
|
||||
|
||||
$update_prestudent['updateamum'] = date('c');
|
||||
$update_prestudent['updatevon'] = $uid;
|
||||
|
||||
//utf8-decode for special chars (eg tag der offenen Tür, FH-Führer)
|
||||
function utf8_decode_if_string($value)
|
||||
{
|
||||
if (is_string($value)) {
|
||||
return utf8_decode($value);
|
||||
} else {
|
||||
return $value;
|
||||
}
|
||||
}
|
||||
$update_prestudent_encoded = array_map('utf8_decode_if_string', $update_prestudent);
|
||||
|
||||
if (count($update_prestudent) && $prestudent_id === null) {
|
||||
$this->output->set_status_header(REST_Controller::HTTP_BAD_REQUEST);
|
||||
// TODO(manu): check phrase
|
||||
//return $this->outputJson("Kein/e PrestudentIn vorhanden!");
|
||||
return $this->outputJson($this->p->t('studierendenantrag','error_no_prestudent', $prestudent_id));
|
||||
}
|
||||
|
||||
if (count($update_prestudent))
|
||||
{
|
||||
$result = $this->PrestudentModel->update(
|
||||
$prestudent_id,
|
||||
$update_prestudent_encoded
|
||||
);
|
||||
if (isError($result)) {
|
||||
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
return $this->outputJson(getError($result));
|
||||
}
|
||||
return $this->outputJsonSuccess(true);
|
||||
}
|
||||
}
|
||||
|
||||
public function getHistoryPrestudents($person_id)
|
||||
{
|
||||
$this->load->model('crm/Prestudent_model', 'PrestudentModel');
|
||||
|
||||
$result = $this->PrestudentModel->getHistoryPrestudents($person_id);
|
||||
if (isError($result))
|
||||
{
|
||||
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
}
|
||||
$this->outputJson(getData($result) ?: []);
|
||||
}
|
||||
|
||||
public function getBezeichnungZgv()
|
||||
{
|
||||
$this->load->model('codex/Zgv_model', 'ZgvModel');
|
||||
|
||||
$this->ZgvModel->addOrder('zgv_code');
|
||||
|
||||
$result = $this->ZgvModel->load();
|
||||
if (isError($result))
|
||||
{
|
||||
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
}
|
||||
$this->outputJson($result);
|
||||
}
|
||||
|
||||
public function getBezeichnungDZgv()
|
||||
{
|
||||
$this->load->model('codex/Zgvdoktor_model', 'ZgvdoktorModel');
|
||||
|
||||
$this->ZgvdoktorModel->addOrder('zgvdoktor_code');
|
||||
|
||||
$result = $this->ZgvdoktorModel->load();
|
||||
if (isError($result))
|
||||
{
|
||||
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
}
|
||||
$this->outputJson($result);
|
||||
}
|
||||
|
||||
public function getBezeichnungMZgv()
|
||||
{
|
||||
$this->load->model('codex/Zgvmaster_model', 'ZgvmasterModel');
|
||||
|
||||
$this->ZgvmasterModel->addOrder('zgvmas_code');
|
||||
|
||||
$result = $this->ZgvmasterModel->load();
|
||||
if (isError($result))
|
||||
{
|
||||
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
}
|
||||
$this->outputJson($result);
|
||||
}
|
||||
|
||||
public function getAusbildung()
|
||||
{
|
||||
$this->load->model('codex/Ausbildung_model', 'AusbildungModel');
|
||||
|
||||
$this->AusbildungModel->addOrder('ausbildungcode');
|
||||
|
||||
$result = $this->AusbildungModel->load();
|
||||
if (isError($result))
|
||||
{
|
||||
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
}
|
||||
$this->outputJson($result);
|
||||
}
|
||||
|
||||
public function getAufmerksamdurch()
|
||||
{
|
||||
$this->load->model('codex/Aufmerksamdurch_model', 'AufmerksamdurchModel');
|
||||
|
||||
$this->AufmerksamdurchModel->addOrder('aufmerksamdurch_kurzbz');
|
||||
|
||||
$result = $this->AufmerksamdurchModel->load();
|
||||
if (isError($result))
|
||||
{
|
||||
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
}
|
||||
$this->outputJson($result);
|
||||
}
|
||||
|
||||
public function getBerufstaetigkeit()
|
||||
{
|
||||
$this->load->model('codex/Berufstaetigkeit_model', 'BerufstaetigkeitModel');
|
||||
|
||||
$this->BerufstaetigkeitModel->addOrder('berufstaetigkeit_code');
|
||||
|
||||
$result = $this->BerufstaetigkeitModel->load();
|
||||
if (isError($result)) {
|
||||
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
}
|
||||
$this->outputJson($result);
|
||||
}
|
||||
|
||||
public function getTypenStg()
|
||||
{
|
||||
$this->load->model('education/Gsstudientyp_model', 'GsstudientypModel');
|
||||
|
||||
$this->GsstudientypModel->addOrder('gsstudientyp_kurzbz');
|
||||
|
||||
$result = $this->GsstudientypModel->load();
|
||||
if (isError($result)) {
|
||||
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
}
|
||||
$this->outputJson($result);
|
||||
}
|
||||
|
||||
public function getStudiensemester()
|
||||
{
|
||||
$this->load->model('organisation/Studiensemester_model', 'StudiensemesterModel');
|
||||
|
||||
$this->StudiensemesterModel->addOrder('start', 'DESC');
|
||||
$this->StudiensemesterModel->addLimit(20);
|
||||
|
||||
$result = $this->StudiensemesterModel->load();
|
||||
if (isError($result)) {
|
||||
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
}
|
||||
$this->outputJson($result);
|
||||
}
|
||||
|
||||
public function getStudienplaene($prestudent_id)
|
||||
{
|
||||
$this->load->model('crm/Prestudent_model', 'PrestudentModel');
|
||||
|
||||
$result = $this->PrestudentModel->loadWhere(
|
||||
array('prestudent_id' => $prestudent_id)
|
||||
);
|
||||
if (isError($result)) {
|
||||
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
}
|
||||
|
||||
$result = current(getData($result));
|
||||
$studiengang_kz = $result->studiengang_kz;
|
||||
|
||||
$this->load->model('organisation/Studienplan_model', 'StudienplanModel');
|
||||
|
||||
$this->StudienplanModel->addOrder('studienplan_id', 'DESC');
|
||||
|
||||
$result = $this->StudienplanModel->getStudienplaene($studiengang_kz);
|
||||
|
||||
if (isError($result)) {
|
||||
$this->output->set_status_header(REST_Controller::HTTP_INTERNAL_SERVER_ERROR);
|
||||
}
|
||||
$this->outputJson($result);
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -384,7 +384,8 @@ class Prestudentstatus_model extends DB_Model
|
||||
}
|
||||
else
|
||||
{
|
||||
return success("1", $this->p->t('studierendenantrag','error_rolleBereitsVorhanden'));
|
||||
//TODO(manu) nur retval übergeben
|
||||
return success("1", $this->p->t('lehre','error_rolleBereitsVorhanden'));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -426,14 +427,20 @@ class Prestudentstatus_model extends DB_Model
|
||||
* @param integer $prestudent_id
|
||||
* @return success("1") if last prestudentstatusentry, else success("0")
|
||||
*/
|
||||
public function checkIfLastStatusEntry($prestudent_id)
|
||||
public function checkIfLastStatusEntry($prestudent_id, $isStudent=false )
|
||||
{
|
||||
$qry = "SELECT
|
||||
COUNT(*) as anzahl
|
||||
FROM
|
||||
public.tbl_prestudentstatus
|
||||
WHERE
|
||||
prestudent_id = ? ";
|
||||
prestudent_id = ?
|
||||
";
|
||||
|
||||
if($isStudent)
|
||||
{
|
||||
$qry .= "AND status_kurzbz = 'Student'";
|
||||
}
|
||||
|
||||
$result = $this->execQuery($qry, array($prestudent_id));
|
||||
|
||||
@@ -451,11 +458,9 @@ class Prestudentstatus_model extends DB_Model
|
||||
if ($anzahl <= 1 )
|
||||
{
|
||||
return success ("1", "Die letzte Rolle kann nur durch den Administrator geloescht werden");
|
||||
//return error("Die letzte Rolle kann nur durch den Administrator geloescht werden");
|
||||
}
|
||||
else
|
||||
return success("0", $anzahl . " Rollen vorhanden");
|
||||
//return success($anzahl);
|
||||
|
||||
}
|
||||
else
|
||||
@@ -479,7 +484,6 @@ class Prestudentstatus_model extends DB_Model
|
||||
{
|
||||
return error("Datum eines neuen Statuseintrags darf nicht in der Vergangenheit liegen ");
|
||||
}
|
||||
|
||||
else
|
||||
{
|
||||
return success();
|
||||
|
||||
@@ -81,7 +81,6 @@ export default {
|
||||
this.actionUpdate = true;
|
||||
}
|
||||
}
|
||||
//this.deltaArray.push(delta);
|
||||
this.deltaArray = delta;
|
||||
},
|
||||
deep: true
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import {CoreFilterCmpt} from "../../../../filter/Filter.js";
|
||||
import {CoreRESTClient} from "../../../../../RESTClient";
|
||||
import BsModal from "../../../../Bootstrap/Modal.js";
|
||||
import FormForm from '../../../../Form/Form.js';
|
||||
import FormInput from '../../../../Form/Input.js';
|
||||
@@ -47,8 +46,9 @@ export default{
|
||||
data() {
|
||||
return {
|
||||
tabulatorOptions: {
|
||||
ajaxURL: CoreRESTClient._generateRouterURI('components/stv/Status/getHistoryPrestudent/' + this.prestudent_id),
|
||||
//autoColumns: true,
|
||||
ajaxURL: 'api/frontend/v1/stv/Status/getHistoryPrestudent/' + this.prestudent_id,
|
||||
ajaxRequestFunc: this.$fhcApi.get,
|
||||
ajaxResponse: (url, params, response) => response.data,
|
||||
columns: [
|
||||
{title: "Kurzbz", field: "status_kurzbz", tooltip: true},
|
||||
{title: "StSem", field: "studiensemester_kurzbz"},
|
||||
@@ -237,7 +237,6 @@ export default{
|
||||
},
|
||||
methods: {
|
||||
actionNewStatus() {
|
||||
console.log("Action: Neuen Status hinzufügen");
|
||||
this.statusData.status_kurzbz = 'Interessent';
|
||||
this.statusData.studiensemester_kurzbz = this.defaultSemester;
|
||||
this.statusData.ausbildungssemester = 1;
|
||||
@@ -246,7 +245,6 @@ export default{
|
||||
this.$refs.newStatusModal.show();
|
||||
},
|
||||
actionEditStatus(status, stdsem, ausbildungssemester){
|
||||
console.log("Action: Status bearbeiten: (" + status + ": " + stdsem + "/" + ausbildungssemester + ")")
|
||||
this.statusId = {
|
||||
'prestudent_id': this.prestudent_id,
|
||||
'status_kurzbz': status,
|
||||
@@ -259,8 +257,6 @@ export default{
|
||||
});
|
||||
},
|
||||
actionDeleteStatus(status, stdsem, ausbildungssemester){
|
||||
console.log("Action: Status löschen: (" + status + ": " + stdsem + "/" + ausbildungssemester + ")")
|
||||
//this.$refs.deleteStatusModal.show();
|
||||
this.statusId = {
|
||||
'prestudent_id': this.prestudent_id,
|
||||
'status_kurzbz': status,
|
||||
@@ -276,8 +272,6 @@ export default{
|
||||
});
|
||||
},
|
||||
actionAdvanceStatus(status, stdsem, ausbildungssemester){
|
||||
console.log("Action: Status vorrücken: (" + status + ": " + stdsem + "/" + ausbildungssemester + ")")
|
||||
//this.$refs.deleteStatusModal.show();
|
||||
this.statusId = {
|
||||
'prestudent_id': this.prestudent_id,
|
||||
'status_kurzbz': status,
|
||||
@@ -290,8 +284,6 @@ export default{
|
||||
});
|
||||
},
|
||||
actionConfirmStatus(status, stdsem, ausbildungssemester){
|
||||
console.log("Action: Status bestätigen: (" + status + ": " + stdsem + "/" + ausbildungssemester + ")")
|
||||
//this.$refs.deleteStatusModal.show();
|
||||
this.statusId = {
|
||||
'prestudent_id': this.prestudent_id,
|
||||
'status_kurzbz': status,
|
||||
@@ -304,112 +296,67 @@ export default{
|
||||
});
|
||||
},
|
||||
addNewStatus(){
|
||||
CoreRESTClient.post('components/stv/Status/addNewStatus/' + this.prestudent_id,
|
||||
this.$fhcApi.post('api/frontend/v1/stv/status/addNewStatus/' + this.prestudent_id,
|
||||
this.statusData
|
||||
).then(response => {
|
||||
if (!response.data.error) {
|
||||
this.$fhcAlert.alertSuccess('Speichern erfolgreich');
|
||||
this.hideModal('newStatusModal');
|
||||
this.resetModal();
|
||||
} else {
|
||||
const errorData = response.data.retval;
|
||||
Object.entries(errorData).forEach(entry => {
|
||||
const [key, value] = entry;
|
||||
this.$fhcAlert.alertError(value);
|
||||
});
|
||||
}
|
||||
}).catch(error => {
|
||||
if (error.response) {
|
||||
console.log(error.response);
|
||||
this.$fhcAlert.alertError(error.response.data);
|
||||
}
|
||||
}).finally(() => {
|
||||
}).catch(this.$fhcAlert.handleSystemError)
|
||||
.finally(() => {
|
||||
window.scrollTo(0, 0);
|
||||
this.reload();
|
||||
});
|
||||
},
|
||||
advanceStatus(statusId){
|
||||
return CoreRESTClient.post('components/stv/Status/advanceStatus/' +
|
||||
return this.$fhcApi.post('api/frontend/v1/stv/status/advanceStatus/' +
|
||||
this.statusId.prestudent_id + '/' +
|
||||
this.statusId.status_kurzbz + '/' +
|
||||
this.statusId.studiensemester_kurzbz + '/' +
|
||||
this.statusId.ausbildungssemester)
|
||||
.then(
|
||||
result => {
|
||||
if(!result.data.error) {
|
||||
this.$fhcAlert.alertSuccess('Vorrückung Status erfolgreich');
|
||||
}
|
||||
else
|
||||
{
|
||||
const errorData = result.data.retval;
|
||||
this.$fhcAlert.alertError('Kein Status mit Id ' + status_id + ' gefunden');
|
||||
}
|
||||
/* return result;*/
|
||||
}).catch(error => {
|
||||
if (error.response) {
|
||||
console.log(error.response);
|
||||
this.$fhcAlert.alertError(error.response.data);
|
||||
}
|
||||
}).finally(() => {
|
||||
})
|
||||
.catch(this.$fhcAlert.handleSystemError)
|
||||
.finally(() => {
|
||||
window.scrollTo(0, 0);
|
||||
this.reload();
|
||||
});
|
||||
},
|
||||
confirmStatus(statusId){
|
||||
return CoreRESTClient.post('components/stv/Status/confirmStatus/' +
|
||||
return this.$fhcApi.post('api/frontend/v1/stv/status/confirmStatus/' +
|
||||
this.statusId.prestudent_id + '/' +
|
||||
this.statusId.status_kurzbz + '/' +
|
||||
this.statusId.studiensemester_kurzbz + '/' +
|
||||
this.statusId.ausbildungssemester)
|
||||
.then(
|
||||
result => {
|
||||
if(!result.data.error) {
|
||||
this.$fhcAlert.alertSuccess('Bestätigung Status erfolgreich');
|
||||
}
|
||||
else
|
||||
{
|
||||
const errorData = result.data.retval;
|
||||
this.$fhcAlert.alertError('Kein Status mit Id ' + status_id + ' gefunden');
|
||||
}
|
||||
}
|
||||
).catch(error => {
|
||||
if (error.response) {
|
||||
console.log(error.response);
|
||||
this.$fhcAlert.alertError(error.response.data);
|
||||
}
|
||||
}).finally(() => {
|
||||
window.scrollTo(0, 0);
|
||||
})
|
||||
.catch(this.$fhcAlert.handleSystemError)
|
||||
.finally(() => {
|
||||
/* window.scrollTo(0, 0);*/
|
||||
this.reload();
|
||||
});
|
||||
},
|
||||
deleteStatus(status_id){
|
||||
return CoreRESTClient.post('components/stv/Status/deleteStatus/',
|
||||
return this.$fhcApi.post('api/frontend/v1/stv/status/deleteStatus/',
|
||||
status_id)
|
||||
.then(
|
||||
result => {
|
||||
if(!result.data.error) {
|
||||
this.$fhcAlert.alertSuccess('Löschen erfolgreich');
|
||||
this.hideModal('deleteStatusModal');
|
||||
this.resetModal();
|
||||
}
|
||||
else
|
||||
{
|
||||
const errorData = result.data.retval;
|
||||
this.$fhcAlert.alertError('Kein Status mit Id ' + status_id + ' gefunden');
|
||||
}
|
||||
/* return result;*/
|
||||
}).catch(error => {
|
||||
if (error.response) {
|
||||
//console.log(error.response);
|
||||
this.$fhcAlert.alertError(error.response.data);
|
||||
}
|
||||
}).finally(() => {
|
||||
})
|
||||
.catch(this.$fhcAlert.handleSystemError)
|
||||
.finally(() => {
|
||||
window.scrollTo(0, 0);
|
||||
this.reload();
|
||||
});
|
||||
},
|
||||
editStatus(){
|
||||
return CoreRESTClient.post('components/stv/Status/updateStatus/' +
|
||||
return this.$fhcApi.post('api/frontend/v1/stv/status/updateStatus/' +
|
||||
this.statusId.prestudent_id + '/' +
|
||||
this.statusId.status_kurzbz + '/' +
|
||||
this.statusId.studiensemester_kurzbz + '/' +
|
||||
@@ -417,33 +364,19 @@ export default{
|
||||
this.statusData)
|
||||
.then(
|
||||
result => {
|
||||
if(!result.data.error) {
|
||||
this.$fhcAlert.alertSuccess('Bearbeitung Status erfolgreich');
|
||||
this.hideModal('editStatusModal');
|
||||
this.resetModal();
|
||||
}
|
||||
else
|
||||
{
|
||||
/* const errorData = result.data.retval;
|
||||
Object.entries(errorData).forEach(entry => {
|
||||
const [key, value] = entry;
|
||||
this.$fhcAlert.alertError(value);
|
||||
});*/
|
||||
this.$fhcAlert.alertError('Kein Status mit Id ' + status_id + ' gefunden');
|
||||
}
|
||||
/* return result;*/
|
||||
}).catch(error => {
|
||||
if (error.response) {
|
||||
console.log(error.response);
|
||||
this.$fhcAlert.alertError(error.response.data);
|
||||
}
|
||||
}).finally(() => {
|
||||
})
|
||||
.catch(this.$fhcAlert.handleSystemError)
|
||||
.finally(() => {
|
||||
window.scrollTo(0, 0);
|
||||
this.reload();
|
||||
});
|
||||
},
|
||||
checkIfLastStatus(){
|
||||
return CoreRESTClient.get('components/stv/Status/isLastStatus/' + this.prestudent_id)
|
||||
return this.$fhcApi
|
||||
.get('api/frontend/v1/stv/status/isLastStatus/' + this.prestudent_id)
|
||||
.then(
|
||||
result => {
|
||||
if(result.data){
|
||||
@@ -452,29 +385,17 @@ export default{
|
||||
this.isLastStatus = {};
|
||||
}
|
||||
return result;
|
||||
}).catch(error => {
|
||||
if (error.response) {
|
||||
console.log(error.response);
|
||||
this.$fhcAlert.alertError(error.response.data);
|
||||
}
|
||||
}
|
||||
);
|
||||
})
|
||||
.catch(this.$fhcAlert.handleSystemError);
|
||||
},
|
||||
loadStatus(status_id){
|
||||
return CoreRESTClient.post('components/stv/Status/loadStatus/',
|
||||
return this.$fhcApi.post('api/frontend/v1/stv/status/loadStatus/',
|
||||
status_id)
|
||||
.then(
|
||||
result => {
|
||||
if(result.data.retval)
|
||||
this.statusData = result.data.retval;
|
||||
else
|
||||
{
|
||||
this.statusData = {};
|
||||
this.$fhcAlert.alertError('Kein Status mit Id ' + status_id + ' gefunden');
|
||||
}
|
||||
.then(result => {
|
||||
this.statusData = result.data;
|
||||
return result;
|
||||
}
|
||||
);
|
||||
})
|
||||
.catch(this.$fhcAlert.handleSystemError);
|
||||
},
|
||||
reload(){
|
||||
this.$refs.table.reloadTable();
|
||||
@@ -492,32 +413,32 @@ export default{
|
||||
}
|
||||
},
|
||||
created(){
|
||||
CoreRESTClient
|
||||
.get('components/stv/Prestudent/getStudiensemester')
|
||||
.then(result => CoreRESTClient.getData(result.data) || [])
|
||||
this.$fhcApi
|
||||
.get('api/frontend/v1/stv/prestudent/getStudiensemester')
|
||||
.then(result => result.data)
|
||||
.then(result => {
|
||||
this.listStudiensemester = result;
|
||||
})
|
||||
.catch(this.$fhcAlert.handleSystemError);
|
||||
CoreRESTClient
|
||||
.get('components/stv/Prestudent/getStudienplaene/' + this.prestudent_id)
|
||||
.then(result => CoreRESTClient.getData(result.data) || [])
|
||||
this.$fhcApi
|
||||
.get('api/frontend/v1/stv/prestudent/getStudienplaene/' + this.prestudent_id)
|
||||
.then(result => result.data)
|
||||
.then(result => {
|
||||
this.listStudienplaene = result;
|
||||
})
|
||||
.catch(this.$fhcAlert.handleSystemError);
|
||||
CoreRESTClient
|
||||
.get('components/stv/Status/getStatusgruende/')
|
||||
.then(result => CoreRESTClient.getData(result.data) || [])
|
||||
this.$fhcApi
|
||||
.get('api/frontend/v1/stv/status/getStatusgruende/')
|
||||
.then(result => result.data)
|
||||
.then(result => {
|
||||
this.listStatusgruende = result;
|
||||
})
|
||||
.catch(this.$fhcAlert.handleSystemError);
|
||||
CoreRESTClient
|
||||
.get('components/stv/Status/getLastBismeldestichtag/')
|
||||
.then(result => CoreRESTClient.getData(result.data) || [])
|
||||
this.$fhcApi
|
||||
.get('api/frontend/v1/stv/status/getLastBismeldestichtag/')
|
||||
.then(result => result.data)
|
||||
.then(result => {
|
||||
this.dataMeldestichtag = result[0].meldestichtag;
|
||||
this.dataMeldestichtag = result.retval[0].meldestichtag;
|
||||
})
|
||||
.catch(this.$fhcAlert.handleSystemError);
|
||||
},
|
||||
@@ -526,7 +447,6 @@ export default{
|
||||
},
|
||||
template: `
|
||||
<div class="stv-list h-100 pt-3">
|
||||
|
||||
|
||||
<!--Modal: Add New Status-->
|
||||
<BsModal ref="newStatusModal">
|
||||
|
||||
+249
-2
@@ -21991,7 +21991,7 @@ array(
|
||||
),
|
||||
array(
|
||||
'app' => 'core',
|
||||
'category' => 'studierendenantrag',q
|
||||
'category' => 'studierendenantrag',
|
||||
'phrase' => 'error_no_prestudent',
|
||||
'insertvon' => 'system',
|
||||
'phrases' => array(
|
||||
@@ -25893,7 +25893,7 @@ array(
|
||||
'phrases' => array(
|
||||
array(
|
||||
'sprache' => 'German',
|
||||
'text' => 'Sie haben keine Schreibrechte fuer diesen Studiengang!',
|
||||
'text' => 'Sie haben keine Schreibrechte für diesen Studiengang!',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
),
|
||||
@@ -25924,6 +25924,253 @@ array(
|
||||
)
|
||||
)
|
||||
),
|
||||
array(
|
||||
'app' => 'core',
|
||||
'category' => 'lehre',
|
||||
'phrase' => 'error_keinReihungstestverfahren',
|
||||
'phrases' => array(
|
||||
array(
|
||||
'sprache' => 'German',
|
||||
'text' => '{name}: Um einen Interessenten zum Bewerber zu machen, muss die Person das Reihungstestverfahren abgeschlossen haben!',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
),
|
||||
array(
|
||||
'sprache' => 'English',
|
||||
'text' => '{name}: In order to turn an interested party into an applicant the person must have completed the ranking test process!',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
)
|
||||
)
|
||||
),
|
||||
array(
|
||||
'app' => 'core',
|
||||
'category' => 'lehre',
|
||||
'phrase' => 'error_ZGVNichtEingetragen',
|
||||
'phrases' => array(
|
||||
array(
|
||||
'sprache' => 'German',
|
||||
'text' => '{name}: Um einen Interessenten zum Bewerber zu machen, muss die Zugangsvoraussetzung eingetragen sein!',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
),
|
||||
array(
|
||||
'sprache' => 'English',
|
||||
'text' => '{name}: In order to turn an interested party into an applicant, the entry requirements must be entered!',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
)
|
||||
)
|
||||
),
|
||||
array(
|
||||
'app' => 'core',
|
||||
'category' => 'lehre',
|
||||
'phrase' => 'error_ZGVMasterNichtEingetragen',
|
||||
'phrases' => array(
|
||||
array(
|
||||
'sprache' => 'German',
|
||||
'text' => '{name}: Um einen Interessenten zum Bewerber zu machen, muss die Zugangsvoraussetzung Master eingetragen sein!',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
),
|
||||
array(
|
||||
'sprache' => 'English',
|
||||
'text' => '{name}: In order to turn an interested party into an applicant, the entry requirements for master studies must be entered!',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
)
|
||||
)
|
||||
),
|
||||
array(
|
||||
'app' => 'core',
|
||||
'category' => 'lehre',
|
||||
'phrase' => 'error_keinBewerber',
|
||||
'phrases' => array(
|
||||
array(
|
||||
'sprache' => 'German',
|
||||
'text' => '{name} muss zuerst zum Bewerber gemacht werden!',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
),
|
||||
array(
|
||||
'sprache' => 'English',
|
||||
'text' => '{name} must be made an applicant first!',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
)
|
||||
)
|
||||
),
|
||||
array(
|
||||
'app' => 'core',
|
||||
'category' => 'lehre',
|
||||
'phrase' => 'error_noStudstatus',
|
||||
'phrases' => array(
|
||||
array(
|
||||
'sprache' => 'German',
|
||||
'text' => 'Ein Studentenstatus kann hier nur hinzugefuegt werden wenn die Person bereits Student ist. Um einen Bewerber zum Studenten zu machen waehlen Sie bitte unter "Status aendern" den Punkt "Student"',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
),
|
||||
array(
|
||||
'sprache' => 'English',
|
||||
'text' => 'Student status can only be added here if the person is already a student. To turn an applicant into a student, please select "Student" under "Change status".',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
)
|
||||
)
|
||||
),
|
||||
array(
|
||||
'app' => 'core',
|
||||
'category' => 'lehre',
|
||||
'phrase' => 'error_dataVorMeldestichtag',
|
||||
'phrases' => array(
|
||||
array(
|
||||
'sprache' => 'German',
|
||||
'text' => 'Studentstatus mit Datum oder Semesterende vor erreichtem Meldestichtag kann nicht hinzugefügt werden',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
),
|
||||
array(
|
||||
'sprache' => 'English',
|
||||
'text' => 'Student status with a date or end of semester before the reporting deadline cannot be added',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
)
|
||||
)
|
||||
),
|
||||
array(
|
||||
'app' => 'core',
|
||||
'category' => 'lehre',
|
||||
'phrase' => 'error_duringInsertUpdateLehrverband',
|
||||
'phrases' => array(
|
||||
array(
|
||||
'sprache' => 'German',
|
||||
'text' => 'Fehler beim Ermitteln bzw Aktualisieren des Lehrverbands: es wurden keine Änderungen in der Datenbank gespeichert',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
),
|
||||
array(
|
||||
'sprache' => 'English',
|
||||
'text' => 'Error during insert or update of Lehrverband: no changes were saved in the database',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
)
|
||||
)
|
||||
),
|
||||
array(
|
||||
'app' => 'core',
|
||||
'category' => 'lehre',
|
||||
'phrase' => 'error_duringDeleteLehrverband',
|
||||
'phrases' => array(
|
||||
array(
|
||||
'sprache' => 'German',
|
||||
'text' => 'Fehler beim Löschen des Lehrverbands: es wurden keine Änderungen in der Datenbank gespeichert',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
),
|
||||
array(
|
||||
'sprache' => 'English',
|
||||
'text' => 'Error during deletion of Lehrverband: no changes were saved in the database',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
)
|
||||
)
|
||||
),
|
||||
array(
|
||||
'app' => 'core',
|
||||
'category' => 'lehre',
|
||||
'phrase' => 'error_onlyAdminDeleteRolleStudent',
|
||||
'phrases' => array(
|
||||
array(
|
||||
'sprache' => 'German',
|
||||
'text' => 'Studentenrolle kann nur durch den Administrator geloescht werden',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
),
|
||||
array(
|
||||
'sprache' => 'English',
|
||||
'text' => 'Error during insert or update of Lehrverband: no changes were saved in the database',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
)
|
||||
)
|
||||
),
|
||||
array(
|
||||
'app' => 'core',
|
||||
'category' => 'lehre',
|
||||
'phrase' => 'error_onlyAdminDeleteLastStatus',
|
||||
'phrases' => array(
|
||||
array(
|
||||
'sprache' => 'German',
|
||||
'text' => 'Die letzte Rolle kann nur durch den Administrator geloescht werden',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
),
|
||||
array(
|
||||
'sprache' => 'English',
|
||||
'text' => 'The last role can only be deleted by the administrator',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
)
|
||||
)
|
||||
),
|
||||
array(
|
||||
'app' => 'core',
|
||||
'category' => 'lehre',
|
||||
'phrase' => 'error_noStatusFound',
|
||||
'phrases' => array(
|
||||
array(
|
||||
'sprache' => 'German',
|
||||
'text' => 'Fehler: Status nicht gefunden',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
),
|
||||
array(
|
||||
'sprache' => 'English',
|
||||
'text' => 'Error: Status not found',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
)
|
||||
)
|
||||
),
|
||||
array(
|
||||
'app' => 'core',
|
||||
'category' => 'lehre',
|
||||
'phrase' => 'error_statusConfirmedYet',
|
||||
'phrases' => array(
|
||||
array(
|
||||
'sprache' => 'German',
|
||||
'text' => 'Der Status ist bereits bestätigt!',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
),
|
||||
array(
|
||||
'sprache' => 'English',
|
||||
'text' => 'The status is already confirmed!',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
)
|
||||
)
|
||||
),
|
||||
array(
|
||||
'app' => 'core',
|
||||
'category' => 'lehre',
|
||||
'phrase' => 'error_bewerbungNochNichtAbgeschickt',
|
||||
'phrases' => array(
|
||||
array(
|
||||
'sprache' => 'German',
|
||||
'text' => 'Die Bewerbung wurde noch nicht abgeschickt und kann deshalb nicht bestaetigt werden!',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
),
|
||||
array(
|
||||
'sprache' => 'English',
|
||||
'text' => 'The application has not yet been sent and therefore cannot be confirmed!',
|
||||
'description' => '',
|
||||
'insertvon' => 'system'
|
||||
)
|
||||
)
|
||||
),
|
||||
);
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user