diff --git a/application/controllers/system/infocenter/InfoCenter.php b/application/controllers/system/infocenter/InfoCenter.php index cd88f814a..a97c9ef38 100644 --- a/application/controllers/system/infocenter/InfoCenter.php +++ b/application/controllers/system/infocenter/InfoCenter.php @@ -297,6 +297,13 @@ class InfoCenter extends Auth_Controller } $persondata = $this->_loadPersonData($person_id); + + $checkPerson = $this->PersonModel->checkDuplicate($person_id); + + if (isError($checkPerson)) show_error(getError($checkPerson)); + + $duplicate = array('duplicated' => getData($checkPerson)); + $prestudentdata = $this->_loadPrestudentData($person_id); $this->DokumentModel->addOrder('bezeichnung'); @@ -305,7 +312,8 @@ class InfoCenter extends Auth_Controller $data = array_merge( $persondata, $prestudentdata, - $dokumentdata + $dokumentdata, + $duplicate ); $data[self::FHC_CONTROLLER_ID] = $this->getControllerId(); diff --git a/application/models/person/Person_model.php b/application/models/person/Person_model.php index 085c3f826..ec5522674 100644 --- a/application/models/person/Person_model.php +++ b/application/models/person/Person_model.php @@ -265,4 +265,19 @@ class Person_model extends DB_Model return success($result->vorname. ' '. $result->nachname); } + + public function checkDuplicate($person_id) + { + $qry = "SELECT sp.person_id + FROM public.tbl_person p + LEFT JOIN public.tbl_person sp ON p.vorname = sp.vorname + AND p.nachname = sp.nachname + AND p.gebdatum = sp.gebdatum + JOIN public.tbl_prestudent ps ON sp.person_id = ps.person_id + JOIN public.tbl_prestudentstatus pss ON ps.prestudent_id = pss.prestudent_id + WHERE p.person_id = ? AND sp.person_id != ? AND pss.status_kurzbz = ?"; + + + return $this->execQuery($qry, array($person_id, $person_id, 'Abbrecher')); + } } diff --git a/application/views/system/infocenter/infocenterDetails.php b/application/views/system/infocenter/infocenterDetails.php index 30acb8617..76a371c11 100644 --- a/application/views/system/infocenter/infocenterDetails.php +++ b/application/views/system/infocenter/infocenterDetails.php @@ -101,6 +101,22 @@ + +
+

+ p->t('global', 'bewerberVorhanden') . ':'; ?> +

+
+ person_id . '
'; + } + ?> +
+ +
+
diff --git a/system/phrasesupdate.php b/system/phrasesupdate.php index d41d43c4f..ef12f78c2 100644 --- a/system/phrasesupdate.php +++ b/system/phrasesupdate.php @@ -888,6 +888,26 @@ $phrases = array( ) ) ), + array( + 'app' => 'core', + 'category' => 'global', + 'phrase' => 'bewerberVorhanden', + 'insertvon' => 'system', + 'phrases' => array( + array( + 'sprache' => 'German', + 'text' => 'BewerberIn bereits vorhanden', + 'description' => '', + 'insertvon' => 'system' + ), + array( + 'sprache' => 'English', + 'text' => 'Applicant already available', + 'description' => '', + 'insertvon' => 'system' + ) + ) + ), array( 'app' => 'core', 'category' => 'global',