diff --git a/application/controllers/api/frontend/v1/stv/Status.php b/application/controllers/api/frontend/v1/stv/Status.php index b14c38eb8..d15a06da1 100644 --- a/application/controllers/api/frontend/v1/stv/Status.php +++ b/application/controllers/api/frontend/v1/stv/Status.php @@ -290,7 +290,7 @@ class Status extends FHCAPI_Controller return !$this->getDataOrTerminateWithError($result); }], - //check if Rolle already exists + //Check if Rolle already exists ['rolle_doesnt_exist', function () use ($prestudent_id, $status_kurzbz, $studiensemester_kurzbz, $ausbildungssemester) { if (!$status_kurzbz || !$studiensemester_kurzbz || !$ausbildungssemester) return true; // Error will be handled by the required statements above @@ -1333,7 +1333,7 @@ class Status extends FHCAPI_Controller // Set Datum to null to prevent multiple is_valid_date checks in the following validation rules $this->form_validation->set_rules('_default', '', [ - //check if Rolle already exists + //Check if Rolle already exists ['new_rolle_doesnt_exist', function () use ( $prestudent_id, $status_kurzbz, @@ -1609,7 +1609,7 @@ class Status extends FHCAPI_Controller ]); $this->form_validation->set_rules('_default', '', [ - //check if Rolle already exists + //Check if Rolle already exists ['rolle_doesnt_exist', function () use ( $prestudent_id, $status_kurzbz, diff --git a/application/libraries/PrestudentstatusCheckLib.php b/application/libraries/PrestudentstatusCheckLib.php index e3320de7e..1ad772eb8 100644 --- a/application/libraries/PrestudentstatusCheckLib.php +++ b/application/libraries/PrestudentstatusCheckLib.php @@ -98,34 +98,6 @@ class PrestudentstatusCheckLib ); } - /** - * Checks if a prestudent role already exists. - * - * @param integer $prestudent_id - * @param string $status_kurzbz - * @param string $studiensemester_kurzbz - * @param integer $ausbildungssemester - * - * @return stdClass - */ - public function checkIfExistingPrestudentRolle( - $prestudent_id, - $status_kurzbz, - $studiensemester_kurzbz, - $ausbildungssemester - ) { - $result = $this->_ci->PrestudentstatusModel->checkIfExistingPrestudentRolle( - $prestudent_id, - $status_kurzbz, - $studiensemester_kurzbz, - $ausbildungssemester - ); - if (isError($result)) - return $result; - - return success(getData($result) != '1'); - } - /** * Checks if a student already exists. * diff --git a/application/models/crm/Prestudentstatus_model.php b/application/models/crm/Prestudentstatus_model.php index 1695d5b02..ddeeba20c 100644 --- a/application/models/crm/Prestudentstatus_model.php +++ b/application/models/crm/Prestudentstatus_model.php @@ -358,56 +358,6 @@ class Prestudentstatus_model extends DB_Model return $this; } - /** - * Check if Rolle already exists - * @param integer $prestudent_id - * @param string $status_kurzbz - * @param string $studiensemester_kurzbz - * @param integer $ausbildungssemester - * @return 1: if Rolle exists, 0: if it doesn't - * Copy from studentDBDML.php - */ - public function checkIfExistingPrestudentRolle($prestudent_id, $status_kurzbz, $studiensemester_kurzbz, $ausbildungssemester) - { - $studentName = ''; - - $nameRes = $this->PersonModel->loadPrestudent($prestudent_id); - - if (hasData($nameRes)) - { - $nameData = getData($nameRes)[0]; - $studentName = $nameData->vorname.' '.$nameData->nachname; - } - - $qry = "SELECT - * - FROM - public.tbl_prestudentstatus - WHERE - prestudent_id = ? - AND - status_kurzbz = ? - AND - studiensemester_kurzbz = ? - AND - ausbildungssemester = ?"; - - $result = $this->execQuery($qry, array($prestudent_id, $status_kurzbz, $studiensemester_kurzbz, $ausbildungssemester)); - - if (isError($result)) - { - return error($result); - } - elseif (!hasData($result)) - { - return success(0); - } - else - { - return success("1", $this->p->t('lehre', 'error_rolleBereitsVorhandenMitNamen', ['name' => $studentName])); - } - } - /** * Check if there is only one prestudentstatus left *