Status insert/edit: Orgform in Mischform Stg

This commit is contained in:
cgfhtw
2024-07-31 15:09:09 +02:00
parent 009360a127
commit e548e17776
2 changed files with 45 additions and 4 deletions
@@ -19,7 +19,8 @@ class Prestudent extends FHCAPI_Controller
'getAufmerksamdurch' => self::PERM_LOGGED,
'getBerufstaetigkeit' => self::PERM_LOGGED,
'getTypenStg' => self::PERM_LOGGED,
'getStudienplaene' => self::PERM_LOGGED
'getStudienplaene' => self::PERM_LOGGED,
'getStudiengang' => self::PERM_LOGGED
]);
// Load Libraries
@@ -266,8 +267,6 @@ class Prestudent extends FHCAPI_Controller
public function getStudienplaene($prestudent_id)
{
if (!is_int((int)$prestudent_id) || (int)$prestudent_id . '' != $prestudent_id)
show_404();
$this->load->model('organisation/Studienplan_model', 'StudienplanModel');
$result = $this->StudienplanModel->getStudienplaeneByPrestudents($prestudent_id);
@@ -275,4 +274,26 @@ class Prestudent extends FHCAPI_Controller
return $this->terminateWithSuccess($data);
}
/**
* Gets details for the Studiengang of the Prestudent
*
* @param integer $prestudent_id
*
* @return stdClass
*/
public function getStudiengang($prestudent_id)
{
$this->load->model('crm/Prestudent_model', 'PrestudentModel');
$this->PrestudentModel->addSelect('stg.*');
$this->PrestudentModel->addJoin('public.tbl_studiengang stg', 'studiengang_kz');
$result = $this->PrestudentModel->load($prestudent_id);
$stg = $this->getDataOrTerminateWithError($result);
$this->terminateWithSuccess(current($stg));
}
}
@@ -44,6 +44,7 @@ export default{
prestudent: {},
originalDatum: null,
statusNew: true,
mischform: false,
statusId: {},
formData: {},
studienplaene: [],
@@ -171,7 +172,9 @@ export default{
return this.$fhcApi
.get('api/frontend/v1/stv/prestudent/getStudienplaene/' + prestudent.prestudent_id)
.then(result => this.studienplaene = result.data);
.then(result => this.studienplaene = result.data)
.then(() => this.$fhcApi.get('api/frontend/v1/stv/prestudent/getStudiengang/' + prestudent.prestudent_id))
.then(result => this.mischform = result.data.mischform);
}
},
created() {
@@ -263,6 +266,23 @@ export default{
{{ number }}
</option>
</form-input>
<form-input
v-if="mischform"
container-class="mb-3"
type="select"
v-model="formData.orgform_kurzbz"
name="orgform_kurzbz"
:label="$p.t('lehre/organisationsform')"
:disabled="bisLocked && !isStatusBeforeStudent"
>
<option
v-for="orgform in lists.orgforms"
:key="orgform.orgform_kurzbz"
:value="orgform.orgform_kurzbz"
>
{{ orgform.bezeichnung }}
</option>
</form-input>
<form-input
container-class="mb-3"
type="DatePicker"