diff --git a/application/controllers/api/frontend/v1/stv/Aufnahmetermine.php b/application/controllers/api/frontend/v1/stv/Aufnahmetermine.php
new file mode 100644
index 000000000..538626789
--- /dev/null
+++ b/application/controllers/api/frontend/v1/stv/Aufnahmetermine.php
@@ -0,0 +1,400 @@
+ ['admin:r', 'assistenz:r'],
+ 'loadAufnahmetermin' => ['admin:r', 'assistenz:r'],
+ 'insertAufnahmetermin' => ['admin:rw', 'assistenz:rw'],
+ 'updateAufnahmetermin' => ['admin:rw', 'assistenz:rw'],
+ 'deleteAufnahmetermin' => ['admin:rw', 'assistenz:rw'],
+ 'getListPlacementTests' => ['admin:r', 'assistenz:r'],
+ 'getListStudyPlans' => ['admin:r', 'assistenz:r'],
+ 'loadDataRtPrestudent' => ['admin:r', 'assistenz:r'],
+ 'insertOrUpdateDataRtPrestudent' => ['admin:r', 'assistenz:r'],
+ 'loadAufnahmegruppen' => ['admin:r', 'assistenz:r'],
+ 'getResultReihungstest' => ['admin:r', 'assistenz:r'],
+ 'getZukuenftigeReihungstestStg' => ['admin:r', 'assistenz:r'],
+ ]);
+
+ // Load Libraries
+ $this->load->library('VariableLib', ['uid' => getAuthUID()]);
+ $this->load->library('form_validation');
+
+ // Load language phrases
+ $this->loadPhrases([
+ 'ui',
+ 'admission'
+ ]);
+
+ // Load models
+ $this->load->model('crm/Reihungstest_model', 'ReihungstestModel');
+ $this->load->model('crm/RtPerson_model', 'RtPersonModel');
+ }
+
+ public function getAufnahmetermine($person_id)
+ {
+ $result = $this->ReihungstestModel->getReihungstestPerson($person_id);
+
+ $data = $this->getDataOrTerminateWithError($result);
+
+ $this->terminateWithSuccess($data);
+ }
+
+ public function insertAufnahmetermin()
+ {
+ $this->load->library('form_validation');
+ $authUID = getAuthUID();
+
+ $formData = $this->input->post('formData');
+ $person_id = $this->input->post('person_id');
+
+ if(!$person_id)
+ {
+ return $this->terminateWithError($this->p->t('ui', 'error_missingId', ['id'=> 'Person ID']), self::ERROR_TYPE_GENERAL);
+ }
+
+
+
+ $_POST['rt_id'] = (isset($formData['rt_id']) && !empty($formData['rt_id'])) ? $formData['rt_id'] : null;
+ $_POST['anmeldedatum'] = (isset($formData['anmeldedatum']) && !empty($formData['anmeldedatum'])) ? $formData['anmeldedatum'] : null;
+ $_POST['teilgenommen'] = (isset($formData['teilgenommen']) && !empty($formData['teilgenommen'])) ? $formData['teilgenommen'] : false;
+ $_POST['studienplan_id'] = (isset($formData['studienplan_id']) && !empty($formData['studienplan_id'])) ? $formData['studienplan_id'] : null;
+ $_POST['punkte'] = (isset($formData['punkte']) && !empty($formData['punkte'])) ? $formData['punkte'] : null;
+
+ $this->form_validation->set_rules('punkte', 'Punkte', 'numeric', [
+ 'required' => $this->p->t('ui', 'error_fieldNotNumeric', ['field' => 'Punkte'])
+ ]);
+ $this->form_validation->set_rules('studienplan_id', 'studienplan_id', 'required', [
+ 'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => 'Studienplan'])
+ ]);
+ $this->form_validation->set_rules('rt_id', 'Reihungstest_id', 'required', [
+ 'is_valid_date' => $this->p->t('ui', 'error_fieldRequired', ['field' => 'Reihungstest'])
+ ]);
+
+ $this->form_validation->set_rules('anmeldedatum', 'AnmeldeDatum', 'is_valid_date', [
+ 'is_valid_date' => $this->p->t('ui', 'error_notValidDate', ['field' => 'Anmeldedatum'])
+ ]);
+
+
+ if ($this->form_validation->run() == false)
+ {
+ $this->terminateWithValidationErrors($this->form_validation->error_array());
+ }
+
+ $result = $this->RtPersonModel->insert([
+ 'person_id' => $person_id,
+ 'rt_id' => $_POST['rt_id'],
+ 'anmeldedatum' => $_POST['anmeldedatum'],
+ 'teilgenommen' => $_POST['teilgenommen'],
+ 'studienplan_id' => $_POST['studienplan_id'],
+ 'punkte' => $_POST['punkte'],
+ 'insertamum' => date('c'),
+ 'insertvon' => $authUID,
+ ]);
+
+ $data = $this->getDataOrTerminateWithError($result);
+
+ $this->terminateWithSuccess($data);
+ }
+
+ public function loadAufnahmetermin($rt_person_id)
+ {
+ $result = $this->RtPersonModel->loadWhere(
+ array('rt_person_id' => $rt_person_id)
+ );
+ $data = $this->getDataOrTerminateWithError($result);
+
+ $this->terminateWithSuccess(current($data));
+ }
+
+ public function updateAufnahmetermin()
+ {
+ $this->load->library('form_validation');
+ $authUID = getAuthUID();
+
+ $formData = $this->input->post('formData');
+ $rt_person_id = $this->input->post('rt_person_id');
+ $person_id = (isset($formData['person_id']) && !empty($formData['person_id'])) ? $formData['person_id'] : null;
+
+
+ if(!$person_id)
+ {
+ return $this->terminateWithError($this->p->t('ui', 'error_missingId', ['id'=> 'Person ID']), self::ERROR_TYPE_GENERAL);
+ }
+ if(!$rt_person_id)
+ {
+ return $this->terminateWithError($this->p->t('ui', 'error_missingId', ['id'=> 'RT_Person ID']), self::ERROR_TYPE_GENERAL);
+ }
+
+
+ $_POST['rt_id'] = (isset($formData['rt_id']) && !empty($formData['rt_id'])) ? $formData['rt_id'] : null;
+ $_POST['anmeldedatum'] = (isset($formData['anmeldedatum']) && !empty($formData['anmeldedatum'])) ? $formData['anmeldedatum'] : null;
+ $_POST['teilgenommen'] = (isset($formData['teilgenommen']) && !empty($formData['teilgenommen'])) ? $formData['teilgenommen'] : false;
+ $_POST['studienplan_id'] = (isset($formData['studienplan_id']) && !empty($formData['studienplan_id'])) ? $formData['studienplan_id'] : null;
+ $_POST['punkte'] = (isset($formData['punkte']) && !empty($formData['punkte'])) ? $formData['punkte'] : null;
+
+ $this->form_validation->set_rules('punkte', 'Punkte', 'numeric', [
+ 'required' => $this->p->t('ui', 'error_fieldNotNumeric', ['field' => 'Punkte'])
+ ]);
+ $this->form_validation->set_rules('studienplan_id', 'studienplan_id', 'required', [
+ 'required' => $this->p->t('ui', 'error_fieldRequired', ['field' => 'Studienplan'])
+ ]);
+ $this->form_validation->set_rules('rt_id', 'Reihungstest_id', 'required', [
+ 'is_valid_date' => $this->p->t('ui', 'error_fieldRequired', ['field' => 'Reihungstest'])
+ ]);
+
+ $this->form_validation->set_rules('anmeldedatum', 'AnmeldeDatum', 'is_valid_date', [
+ 'is_valid_date' => $this->p->t('ui', 'error_notValidDate', ['field' => 'Anmeldedatum'])
+ ]);
+
+
+ if ($this->form_validation->run() == false)
+ {
+ $this->terminateWithValidationErrors($this->form_validation->error_array());
+ }
+
+ $result = $this->RtPersonModel->update(
+ [
+ 'rt_person_id' => $rt_person_id,
+ 'person_id' => $person_id,
+ ],
+ [
+ 'rt_id' => $_POST['rt_id'],
+ 'anmeldedatum' => $_POST['anmeldedatum'],
+ 'teilgenommen' => $_POST['teilgenommen'],
+ 'studienplan_id' => $_POST['studienplan_id'],
+ 'punkte' => $_POST['punkte'],
+ 'insertamum' => date('c'),
+ 'insertvon' => $authUID,
+ ]
+ );
+
+ $data = $this->getDataOrTerminateWithError($result);
+
+ $this->terminateWithSuccess($data);
+ }
+
+ public function deleteAufnahmetermin($rt_person_id)
+ {
+ $result = $this->RtPersonModel->delete(
+ array('rt_person_id' => $rt_person_id)
+ );
+
+ $data = $this->getDataOrTerminateWithError($result);
+ $this->terminateWithSuccess($data);
+ }
+
+ public function getListPlacementTests($prestudent_id)
+ {
+ if(!$prestudent_id)
+ {
+ return $this->terminateWithError($this->p->t('ui', 'error_missingId', ['id'=> 'Prestudent ID']), self::ERROR_TYPE_GENERAL);
+ }
+
+ //get studienplan array
+ $this->load->model('crm/Prestudentstatus_model', 'PrestudentstatusModel');
+
+ $this->PrestudentstatusModel->addSelect('*');
+ $this->PrestudentstatusModel->addSelect('sp.studienplan_id');
+
+ $this->PrestudentstatusModel->addJoin('lehre.tbl_studienplan sp', 'studienplan_id', 'LEFT');
+
+ $result = $this->PrestudentstatusModel->loadWhere(
+ array(
+ 'prestudent_id' => $prestudent_id,
+ 'status_kurzbz' => 'Interessent'
+ )
+ );
+
+ $data = $this->getDataOrTerminateWithError($result);
+
+ $studienplan_arr = [];
+ $include_ids = [];
+ foreach ($data as $item)
+ {
+ if($item->studienplan_id != null)
+ $studienplan_arr[] = $item->studienplan_id;
+ }
+
+ //get Placementtests Person
+ $person_id = $this->_getPersonId($prestudent_id);
+ $resultRt = $this->ReihungstestModel->getReihungstestPerson($person_id);
+
+ $dataRt = $this->getDataOrTerminateWithError($resultRt);
+
+ foreach ($dataRt as $item)
+ {
+ if(!in_array($item->studienplan_id, $studienplan_arr))
+ $studienplan_arr[] = $item->studienplan_id;
+ if(!in_array($item->rt_id, $include_ids) && ($item->rt_id != null))
+ $include_ids[] = $item->rt_id;
+ }
+
+ $result = $this->ReihungstestModel->getReihungstestByStudyPlanAndIds($studienplan_arr, $include_ids);
+ $data = $this->getDataOrTerminateWithError($result);
+
+ $this->terminateWithSuccess($data);
+ }
+
+ public function getListStudyPlans($person_id)
+ {
+ $this->load->model('organisation/Studienplan_model', 'StudienplanModel');
+
+ $result = $this->StudienplanModel->getStudienplaeneForPerson($person_id);
+ $data = $this->getDataOrTerminateWithError($result);
+
+ $this->terminateWithSuccess($data);
+ }
+
+ public function loadDataRtPrestudent($prestudent_id)
+ {
+ $this->load->model('crm/Prestudent_model', 'PrestudentModel');
+
+ $this->PrestudentModel->addSelect(["reihungstestangetreten"]);
+ $this->PrestudentModel->addSelect(["rt_gesamtpunkte"]);
+ $this->PrestudentModel->addSelect(["aufnahmegruppe_kurzbz"]);
+ $result = $this->PrestudentModel->loadWhere(
+ array('prestudent_id' => $prestudent_id)
+ );
+ $data = $this->getDataOrTerminateWithError($result);
+
+ $this->terminateWithSuccess(current($data));
+ }
+
+ public function insertOrUpdateDataRtPrestudent()
+ {
+ $this->load->library('form_validation');
+ $authUID = getAuthUID();
+
+ $formData = $this->input->post('formData');
+ $prestudent_id = $this->input->post('prestudent_id');
+
+ if(!$prestudent_id)
+ {
+ return $this->terminateWithError($this->p->t('ui', 'error_missingId', ['id'=> 'Prestudent ID']), self::ERROR_TYPE_GENERAL);
+ }
+ $_POST['rt_gesamtpunkte'] =
+ (isset($formData['rt_gesamtpunkte']) && !empty($formData['rt_gesamtpunkte']))
+ ? $formData['rt_gesamtpunkte']
+ : null;
+ $_POST['reihungstestangetreten'] =
+ (isset($formData['reihungstestangetreten']) && !empty($formData['reihungstestangetreten']))
+ ? $formData['reihungstestangetreten']
+ : null;
+ $_POST['aufnahmegruppe_kurzbz'] =
+ (isset($formData['aufnahmegruppe_kurzbz']) && !empty($formData['aufnahmegruppe_kurzbz']))
+ ? $formData['aufnahmegruppe_kurzbz']
+ : null;
+
+ $this->form_validation->set_rules('rt_gesamtpunkte', 'Rt_gesamtpunkte', 'numeric', [
+ 'required' => $this->p->t('ui', 'error_fieldNotNumeric', ['field' => 'Rt_gesamtpunkte'])
+ ]);
+
+ if ($this->form_validation->run() == false)
+ {
+ $this->terminateWithValidationErrors($this->form_validation->error_array());
+ }
+
+ $this->load->model('crm/Prestudent_model', 'PrestudentModel');
+
+ $result = $this->PrestudentModel->update(
+ [
+ 'prestudent_id' => $prestudent_id,
+ ],
+ [
+ 'reihungstestangetreten' => $_POST['reihungstestangetreten'],
+ 'rt_gesamtpunkte' => $_POST['rt_gesamtpunkte'],
+ 'aufnahmegruppe_kurzbz' => $_POST['aufnahmegruppe_kurzbz'],
+ 'updateamum' => date('c'),
+ 'updatevon' => $authUID,
+ ]
+ );
+
+ $data = $this->getDataOrTerminateWithError($result);
+
+ $this->terminateWithSuccess($data);
+ }
+
+ public function loadAufnahmegruppen()
+ {
+ $uid = $this->input->get('uid');
+ $studiensemester_kurzbz = $this->input->get('studiensemester_kurzbz');
+
+ $this->load->model('person/Benutzergruppe_model', 'BenutzergruppeModel');
+
+ $result = $this->BenutzergruppeModel->loadAufnahmegruppen($uid, $studiensemester_kurzbz);
+
+ $data = $this->getDataOrTerminateWithError($result);
+
+ $this->terminateWithSuccess(($data));
+ }
+
+ public function getResultReihungstest()
+ {
+ $person_id = $this->input->get('person_id');
+ $punkte = $this->input->get('punkte');
+ $reihungstest_id = $this->input->get('reihungstest_id');
+
+ if(!$reihungstest_id)
+ {
+ $this->terminateWithSuccess(null);
+ }
+
+ //for gewichtung
+ $studiengang_kz = $this->input->get('studiengang_kz');
+
+ $this->load->model('testtool/Ablauf_model', 'AblaufModel');
+ $result = $this->AblaufModel->getAblaufGebieteAndGewichte($studiengang_kz);
+ $data = $this->getDataOrTerminateWithError($result);
+
+ $weightedArray = [];
+ foreach ($data as $abl)
+ {
+ $weightedArray[$abl->gebiet_id] = $abl->gewicht;
+ }
+
+ $result = $this->ReihungstestModel->getReihungstestErgebnisPerson($person_id, $punkte, $reihungstest_id, $weightedArray);
+
+/* if (isError($result))
+ {
+ $this->terminateWithError($result, self::ERROR_TYPE_GENERAL);
+ }*/
+
+ $this->terminateWithSuccess($result);
+ }
+
+ public function getZukuenftigeReihungstestStg()
+ {
+ $studiengang_kz = $this->input->get('studiengang_kz');
+ if(!$studiengang_kz)
+ {
+ return $this->terminateWithError($this->p->t('ui', 'error_missingId', ['id'=> 'Studiengang_kz']), self::ERROR_TYPE_GENERAL);
+ }
+
+ $result = $this->ReihungstestModel->getZukuenftigeReihungstestStg($studiengang_kz);
+
+ $data = $this->getDataOrTerminateWithError($result);
+
+ $this->terminateWithSuccess($data);
+ }
+
+ private function _getPersonId($prestudent_id)
+ {
+ $this->load->model('crm/Prestudent_model', 'PrestudentModel');
+ $result = $this->PrestudentModel->loadWhere(
+ ['prestudent_id' => $prestudent_id]
+ );
+
+ $data = $this->getDataOrTerminateWithError($result);
+ $person = current($data);
+
+ return $person->person_id;
+ }
+}
diff --git a/application/controllers/api/frontend/v1/stv/Config.php b/application/controllers/api/frontend/v1/stv/Config.php
index 36276645a..92af856b0 100644
--- a/application/controllers/api/frontend/v1/stv/Config.php
+++ b/application/controllers/api/frontend/v1/stv/Config.php
@@ -165,6 +165,11 @@ class Config extends FHCAPI_Controller
'component' => './Stv/Studentenverwaltung/Details/Lehrveranstaltungstermine.js'
];
+ $result['admissionDates'] = [
+ 'title' => $this->p->t('stv', 'tab_admissionDates'),
+ 'component' => './Stv/Studentenverwaltung/Details/Aufnahmetermine.js'
+ ];
+
Events::trigger('stv_conf_student', function & () use (&$result) {
return $result;
});
diff --git a/application/models/crm/Reihungstest_model.php b/application/models/crm/Reihungstest_model.php
index 86ebfd0af..a685b01cd 100644
--- a/application/models/crm/Reihungstest_model.php
+++ b/application/models/crm/Reihungstest_model.php
@@ -511,4 +511,250 @@ class Reihungstest_model extends DB_Model
return $this->execQuery($query, array($date, $studiengang_kz));
}
-}
\ No newline at end of file
+
+ /**
+ * Loads all placement tests of a given person
+ * @param integer $person_id
+ * @return array Returns object array with data of placement tests
+ */
+ public function getReihungstestPerson($person_id)
+ {
+ $query = '
+ SELECT
+ tbl_rt_person.*,
+ tbl_reihungstest.studiengang_kz,
+ tbl_reihungstest.anmerkung,
+ tbl_reihungstest.datum,
+ tbl_reihungstest.uhrzeit,
+ tbl_reihungstest.ext_id,
+ tbl_reihungstest.max_teilnehmer,
+ tbl_reihungstest.oeffentlich,
+ tbl_reihungstest.freigeschaltet,
+ tbl_reihungstest.studiensemester_kurzbz as studiensemester,
+ tbl_reihungstest.stufe,
+ tbl_reihungstest.anmeldefrist,
+ tbl_reihungstest.aufnahmegruppe_kurzbz,
+ tbl_studiengang.typ,
+ UPPER(typ::varchar(1) || kurzbz) AS stg_kuerzel,
+ so.studiengangbezeichnung,
+ so.studiengangbezeichnung_englisch,
+ so.studiengangkurzbzlang
+ FROM
+ public.tbl_rt_person
+ JOIN public.tbl_reihungstest ON (rt_id=reihungstest_id)
+ JOIN public.tbl_studiengang ON tbl_reihungstest.studiengang_kz = tbl_studiengang.studiengang_kz
+ JOIN lehre.tbl_studienplan sp USING(studienplan_id)
+ JOIN lehre.tbl_studienordnung so USING(studienordnung_id)
+ WHERE
+ tbl_rt_person.person_id = ?
+ ORDER BY datum, uhrzeit ASC';
+
+ return $this->execQuery($query, array($person_id));
+ }
+
+ /**
+ * Calculates Result of Placement Test for a given Person and given placementtest
+ * and with taking account of weighting per area
+ *
+ * @param $person_id ID of Person
+ * @param $punkte if true result is points else result is percentage of sum
+ * @param $reihungstest_id ID of Placementtest
+ * @param $weightedArray array of weighting per area (gewicht per gebiet_id)
+ * @return float result
+ */
+ public function getReihungstestErgebnisPerson($person_id, $punkte, $reihungstest_id, $weightedArray = null)
+ {
+ $parametersArray = array($reihungstest_id);
+
+ $qry = "
+ SELECT DISTINCT ON (vw_auswertung_ablauf.gebiet_id) gebiet_id,
+ vw_auswertung_ablauf.*,
+ tbl_studiengang.typ
+ FROM
+ testtool.vw_auswertung_ablauf
+ JOIN
+ public.tbl_studiengang USING (studiengang_kz)
+ WHERE
+ reihungstest_id = ? ";
+
+ //using prestudent Status to avoid to get the sum of more than 1 placement tests
+ $qry .= "
+ AND prestudent_id = (
+ SELECT
+ prestudent_id
+ FROM
+ public.tbl_rt_person
+ JOIN
+ public.tbl_prestudent USING(person_id)
+ JOIN
+ public.tbl_prestudentstatus USING (prestudent_id, studienplan_id)
+ JOIN
+ tbl_reihungstest ON (
+ tbl_rt_person.rt_id = tbl_reihungstest.reihungstest_id
+ )
+ WHERE
+ tbl_rt_person.person_id = ?
+ AND
+ tbl_rt_person.rt_id = ?
+ AND
+ tbl_prestudentstatus.status_kurzbz = 'Interessent'
+ AND
+ tbl_prestudentstatus.studiensemester_kurzbz = tbl_reihungstest.studiensemester_kurzbz
+ ORDER BY tbl_reihungstest.datum DESC, tbl_prestudent.priorisierung ASC LIMIT 1
+ )
+ ";
+ array_push($parametersArray, $person_id);
+ array_push($parametersArray, $reihungstest_id);
+
+ $resultRtPerson = $this->execQuery($qry, $parametersArray);
+
+ $ergebnis = 0;
+ $summeGewicht = 0;
+
+ foreach ($resultRtPerson->retval as $row)
+ {
+ $prozent = 0;
+ if($row->punkte>=$row->maxpunkte)
+ {
+ $prozent = 100;
+ $row->punkte = $row->maxpunkte;
+ }
+ else
+ $prozent = (($row->punkte + $row->offsetpunkte)/($row->maxpunkte + $row->offsetpunkte))*100;
+
+ if($punkte == 'true')
+ {
+ if($row->punkte)
+ {
+ $ergebnis += $row->punkte;
+ }
+ }
+ else
+ {
+ if ($row->punkte)
+ {
+ $gew = isset($weightedArray[$row->gebiet_id]) ? $weightedArray[$row->gebiet_id] : 1;
+ $ergebnis += $prozent * $gew;
+ $summeGewicht += $gew;
+ }
+ }
+ }
+ $return = $summeGewicht > 0
+ ? number_format($ergebnis/$summeGewicht, 4, '.', '')
+ : number_format($ergebnis, 4, '.', '');
+
+ return $return;
+ }
+
+ /**
+ * returns Reihungstests for given studyplans and include_ids
+ *
+ * @param Array $studienplan_arr array of studienplaene
+ * @param Array $include_ids array of include_ids
+ * @return Array List of Reihungstests
+ */
+ public function getReihungstestByStudyPlanAndIds($studienplan_arr, $include_ids = null)
+ {
+ $studienplan_ids_string = implode(',', $studienplan_arr);
+ $studienplan_arr = explode(',', $studienplan_ids_string);
+
+ $parametersArray = array($studienplan_arr);
+
+ $qry = "
+ SELECT
+ distinct a.*,
+ CASE EXTRACT(DOW FROM a.datum)
+ WHEN 0 THEN 'So'
+ WHEN 1 THEN 'Mo'
+ WHEN 2 THEN 'Di'
+ WHEN 3 THEN 'Mi'
+ WHEN 4 THEN 'Do'
+ WHEN 5 THEN 'Fr'
+ WHEN 6 THEN 'Sa'
+ END AS wochentag,
+ sg.kurzbzlang as stg,
+ (
+ SELECT count(*) FROM public.tbl_rt_person
+ WHERE rt_id = a.reihungstest_id
+ ) as angemeldete_teilnehmer
+ FROM
+ public.tbl_reihungstest a
+ JOIN public.tbl_rt_studienplan USING(reihungstest_id)
+ JOIN public.tbl_studiengang sg USING(studiengang_kz)
+ WHERE studienplan_id IN ?";
+
+ if($include_ids && is_array($include_ids) && count($include_ids) > 0)
+ {
+ $include_ids_string = implode(',', $include_ids);
+ $include_ids = explode(',', $include_ids_string);
+
+ array_push($parametersArray, $include_ids);
+
+ $qry .= "OR reihungstest_id in ?";
+ }
+ $qry .= "ORDER BY a.datum DESC";
+
+ return $this->execQuery($qry, $parametersArray);
+ }
+ /**
+ * returns Reihungstests for given studyplans and include_ids
+ *
+ * @param Integer $studiengang_kz
+ * @param $include_id optional (here null)
+ * @return Array List of Reihungstests
+ */
+ public function getZukuenftigeReihungstestStg($studiengang_kz, $include_id = null)
+ {
+ $parametersArray = array($studiengang_kz, $studiengang_kz, $include_id);
+
+ $qry = "
+ SELECT *,
+ CASE EXTRACT(DOW FROM a.datum)
+ WHEN 0 THEN 'So'
+ WHEN 1 THEN 'Mo'
+ WHEN 2 THEN 'Di'
+ WHEN 3 THEN 'Mi'
+ WHEN 4 THEN 'Do'
+ WHEN 5 THEN 'Fr'
+ WHEN 6 THEN 'Sa'
+ END AS wochentag,
+ (
+ SELECT count(*) FROM public.tbl_prestudent
+ WHERE reihungstest_id=a.reihungstest_id
+ ) as angemeldete_teilnehmer
+ FROM
+ (
+ SELECT *, '1' as sortierung,
+ (
+ SELECT upper(typ || kurzbz) FROM public.tbl_studiengang
+ WHERE studiengang_kz=tbl_reihungstest.studiengang_kz
+ ) as stg
+ FROM
+ public.tbl_reihungstest
+ WHERE
+ datum>=now()-'1 days'::interval AND studiengang_kz=?
+ UNION
+ SELECT *, '2' as sortierung,
+ (
+ SELECT upper(typ || kurzbz) FROM public.tbl_studiengang
+ WHERE studiengang_kz=tbl_reihungstest.studiengang_kz
+ ) as stg
+ FROM
+ public.tbl_reihungstest
+ WHERE datum>=now()-'1 days'::interval AND studiengang_kz!=?
+ UNION
+ SELECT *, '0' as sortierung,
+ (
+ SELECT upper(typ || kurzbz) FROM public.tbl_studiengang
+ WHERE studiengang_kz=tbl_reihungstest.studiengang_kz
+ ) as stg
+ FROM
+ public.tbl_reihungstest
+ WHERE reihungstest_id=?
+ ORDER BY sortierung, stg, datum
+ ) a
+ ";
+
+ return $this->execQuery($qry, $parametersArray);
+ }
+}
diff --git a/application/models/organisation/Studienplan_model.php b/application/models/organisation/Studienplan_model.php
index e35ba52fb..569aebd0b 100644
--- a/application/models/organisation/Studienplan_model.php
+++ b/application/models/organisation/Studienplan_model.php
@@ -134,4 +134,17 @@ class Studienplan_model extends DB_Model
'prestudent_id' => $prestudent_id
]);
}
+
+ public function getStudienplaeneForPerson($person_id)
+ {
+ $this->addDistinct();
+ $this->addSelect($this->dbTable . '.*');
+ $this->addSelect('ps.*');
+ $this->addJoin('public.tbl_prestudentstatus pss', 'studienplan_id');
+ $this->addJoin('public.tbl_prestudent ps', 'prestudent_id');
+
+ return $this->loadWhere([
+ 'person_id' => $person_id
+ ]);
+ }
}
diff --git a/application/models/person/Benutzergruppe_model.php b/application/models/person/Benutzergruppe_model.php
index fba797641..271402ffe 100644
--- a/application/models/person/Benutzergruppe_model.php
+++ b/application/models/person/Benutzergruppe_model.php
@@ -33,4 +33,16 @@ class Benutzergruppe_model extends DB_Model
$uids = (hasData($res)) ? getData($res) : array();
return $uids;
}
+
+ /**
+ * Laedt die Aufnahmegruppe(n) in Abhängigkeit von User und Studiensemester
+ * @param uid, gruppe_kurzbz, studiensemester_kurzbz
+ * @return array
+ */
+ public function loadAufnahmegruppen($uid, $stsem)
+ {
+ $query = "
+ SELECT * FROM tbl_gruppe WHERE aufnahmegruppe=true;";
+ return $this->execReadOnlyQuery($query);
+ }
}
diff --git a/application/models/testtool/Ablauf_model.php b/application/models/testtool/Ablauf_model.php
index 748926658..d6d6ebe74 100644
--- a/application/models/testtool/Ablauf_model.php
+++ b/application/models/testtool/Ablauf_model.php
@@ -11,4 +11,31 @@ class Ablauf_model extends DB_Model
$this->dbTable = 'testtool.tbl_ablauf';
$this->pk = 'ablauf_id';
}
+
+ /**
+ * Returns Weighting of the respective ranking test areas
+ * @param $studiengang_kz Studiengang_kz
+ * @param $semester Integer optional
+ * @return array of weightings per ranking test areas of given studiengang
+ */
+ public function getAblaufGebieteAndGewichte($studiengang_kz, $semester = null)
+ {
+ $parametersArray = array($studiengang_kz);
+
+ $qry = "
+ SELECT
+ tbl_ablauf.gebiet_id, tbl_ablauf.gewicht
+ FROM
+ testtool.tbl_ablauf
+ WHERE
+ tbl_ablauf.studiengang_kz= ?";
+
+ if($semester)
+ {
+ $qry .= " AND semester = ?";
+ array_push($parametersArray, $semester);
+
+ }
+ return $this->execQuery($qry, $parametersArray);
+ }
}
diff --git a/application/views/Studentenverwaltung.php b/application/views/Studentenverwaltung.php
index c10dc475a..8e4c523d6 100644
--- a/application/views/Studentenverwaltung.php
+++ b/application/views/Studentenverwaltung.php
@@ -37,7 +37,10 @@ $configArray = [
//replaced by possibility to hide each formular field via config stv.php
#'showZgvDoktor' => !defined('ZGV_DOKTOR_ANZEIGEN') ? false : ZGV_DOKTOR_ANZEIGEN,
#'showZgvErfuellt' => !defined('ZGV_ERFUELLT_ANZEIGEN') ? false : ZGV_ERFUELLT_ANZEIGEN
- 'showHintKommPrfg' => !defined('FAS_STUDSTATUS_SHOW_KOMM_PRFG_HINT') ? false : FAS_STUDSTATUS_SHOW_KOMM_PRFG_HINT
+ 'showHintKommPrfg' => !defined('FAS_STUDSTATUS_SHOW_KOMM_PRFG_HINT') ? false : FAS_STUDSTATUS_SHOW_KOMM_PRFG_HINT,
+ 'showAufnahmegruppen' => !defined('FAS_REIHUNGSTEST_AUFNAHMEGRUPPEN') ? false : FAS_REIHUNGSTEST_AUFNAHMEGRUPPEN,
+ 'allowUebernahmePunkte' => !defined('FAS_REIHUNGSTEST_PUNKTEUEBERNAHME') ? true : FAS_REIHUNGSTEST_PUNKTEUEBERNAHME,
+ 'useReihungstestPunkte' => !defined('FAS_REIHUNGSTEST_PUNKTE') ? true : FAS_REIHUNGSTEST_PUNKTE,
];
?>
diff --git a/public/js/api/factory/stv.js b/public/js/api/factory/stv.js
index 7ea387263..95bc227f5 100644
--- a/public/js/api/factory/stv.js
+++ b/public/js/api/factory/stv.js
@@ -29,6 +29,7 @@ import exam from './stv/exam.js';
import abschlusspruefung from './stv/abschlusspruefung.js';
import grades from './stv/grades.js';
import mobility from './stv/mobility.js';
+import admissionDates from './stv/admissionDates.js';
export default {
app,
@@ -44,5 +45,6 @@ export default {
exam,
abschlusspruefung,
grades,
- mobility
+ mobility,
+ admissionDates
};
\ No newline at end of file
diff --git a/public/js/api/factory/stv/admissionDates.js b/public/js/api/factory/stv/admissionDates.js
new file mode 100644
index 000000000..a6d743276
--- /dev/null
+++ b/public/js/api/factory/stv/admissionDates.js
@@ -0,0 +1,99 @@
+/**
+ * Copyright (C) 2025 fhcomplete.org
+ *
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see
{{$p.t('admission', 'admission_new')}}
+{{$p.t('admission', 'admission_edit')}}
+ + + +