diff --git a/application/controllers/system/infocenter/InfoCenter.php b/application/controllers/system/infocenter/InfoCenter.php index 5ad5e6066..87f3421a0 100644 --- a/application/controllers/system/infocenter/InfoCenter.php +++ b/application/controllers/system/infocenter/InfoCenter.php @@ -19,8 +19,8 @@ class InfoCenter extends VileSci_Controller private $logparams = array( 'saveformalgep' => array( 'logtype' => 'Action', - 'name' => 'document formally checked', - 'message' => 'document %s formally checked, set to %s' + 'name' => 'Document formally checked', + 'message' => 'Document %s formally checked, set to %s' ), 'savezgv' => array( 'logtype' => 'Action', @@ -35,12 +35,12 @@ class InfoCenter extends VileSci_Controller 'freigegeben' => array( 'logtype' => 'Processstate', 'name' => 'Interessent confirmed', - 'message' => 'status Interessent for prestudentid %s was confirmed for degree program %s' + 'message' => 'Status Interessent for prestudentid %s was confirmed for degree program %s' ), 'savenotiz' => array( 'logtype' => 'Action', - 'name' => 'note added', - 'message' => 'note with title %s was added' + 'name' => 'Note added', + 'message' => 'Note with title %s was added' ) ); private $uid; // contains the UID of the logged user @@ -232,40 +232,43 @@ class InfoCenter extends VileSci_Controller show_error($lastStatus->retval); } - $result = $this->PrestudentstatusModel->insert( - array( - 'prestudent_id' => $prestudent_id, - 'studiensemester_kurzbz' => $lastStatus->retval[0]->studiensemester_kurzbz, - 'ausbildungssemester' => $lastStatus->retval[0]->ausbildungssemester, - 'datum' => date('Y-m-d'), - 'orgform_kurzbz' => $lastStatus->retval[0]->orgform_kurzbz, - 'studienplan_id' => $lastStatus->retval[0]->studienplan_id, - 'status_kurzbz' => 'Abgewiesener', - 'statusgrund_id' => $statusgrund, - 'insertvon' => $this->uid, - 'insertamum' => date('Y-m-d H:i:s') - ) - ); - - if (isError($result)) + //check if still Interessent and not freigegeben yet + if($lastStatus->retval[0]->status_kurzbz === 'Interessent' && !isset($lastStatus->retval[0]->bestaetigtam)) { - show_error($result->retval); + $result = $this->PrestudentstatusModel->insert( + array( + 'prestudent_id' => $prestudent_id, + 'studiensemester_kurzbz' => $lastStatus->retval[0]->studiensemester_kurzbz, + 'ausbildungssemester' => $lastStatus->retval[0]->ausbildungssemester, + 'datum' => date('Y-m-d'), + 'orgform_kurzbz' => $lastStatus->retval[0]->orgform_kurzbz, + 'studienplan_id' => $lastStatus->retval[0]->studienplan_id, + 'status_kurzbz' => 'Abgewiesener', + 'statusgrund_id' => $statusgrund, + 'insertvon' => $this->uid, + 'insertamum' => date('Y-m-d H:i:s') + ) + ); + + if (isError($result)) + { + show_error($result->retval); + } + + $logdata = $this->_getPersonAndStudiengangFromPrestudent($prestudent_id); + + //statusgrund bezeichnung for logging + $this->StatusgrundModel->addSelect('bezeichnung_mehrsprachig'); + $result = $this->StatusgrundModel->load($statusgrund); + if (isError($result)) + { + show_error($result->retval); + } + + $statusgrund_bez = $result->retval[0]->bezeichnung_mehrsprachig[1]; + + $this->_log($logdata['person_id'], 'abgewiesen', array($prestudent_id, $logdata['studiengang_kurzbz'], $statusgrund_bez)); } - - $logdata = $this->_getPersonAndStudiengangFromPrestudent($prestudent_id); - - //statusgrund bezeichnung for logging - $this->StatusgrundModel->addSelect('bezeichnung_mehrsprachig'); - $result = $this->StatusgrundModel->load($statusgrund); - if (isError($result)) - { - show_error($result->retval); - } - - $statusgrund_bez = $result->retval[0]->bezeichnung_mehrsprachig[1]; - - $this->_log($logdata['person_id'], 'abgewiesen', array($prestudent_id, $logdata['studiengang_kurzbz'], $statusgrund_bez)); - $this->_redirectToStart($prestudent_id, 'ZgvPruef'); } @@ -282,31 +285,35 @@ class InfoCenter extends VileSci_Controller { $lastStatus = $lastStatus->retval[0]; - $result = $this->PrestudentstatusModel->update( - array( - 'prestudent_id' => $prestudent_id, - 'status_kurzbz' => $lastStatus->status_kurzbz, - 'studiensemester_kurzbz' => $lastStatus->studiensemester_kurzbz, - 'ausbildungssemester' => $lastStatus->ausbildungssemester - ), - array( - 'bestaetigtvon' => $this->uid, - 'bestaetigtam' => date('Y-m-d'), - 'updatevon' => $this->uid, - 'updateamum' => date('Y-m-d H:i:s') - ) - ); - - if (isError($result)) + //check if still Interessent and not freigegeben yet + if($lastStatus->status_kurzbz === 'Interessent' && !isset($lastStatus->bestaetigtam)) { - show_error($result->retval); + $result = $this->PrestudentstatusModel->update( + array( + 'prestudent_id' => $prestudent_id, + 'status_kurzbz' => $lastStatus->status_kurzbz, + 'studiensemester_kurzbz' => $lastStatus->studiensemester_kurzbz, + 'ausbildungssemester' => $lastStatus->ausbildungssemester + ), + array( + 'bestaetigtvon' => $this->uid, + 'bestaetigtam' => date('Y-m-d'), + 'updatevon' => $this->uid, + 'updateamum' => date('Y-m-d H:i:s') + ) + ); + + if (isError($result)) + { + show_error($result->retval); + } + + $logdata = $this->_getPersonAndStudiengangFromPrestudent($prestudent_id); + + $this->_log($logdata['person_id'], 'freigegeben', array($prestudent_id, $logdata['studiengang_kurzbz'])); } } - $logdata = $this->_getPersonAndStudiengangFromPrestudent($prestudent_id); - - $this->_log($logdata['person_id'], 'freigegeben', array($prestudent_id, $logdata['studiengang_kurzbz'])); - $this->_redirectToStart($prestudent_id, 'ZgvPruef'); } @@ -453,7 +460,7 @@ class InfoCenter extends VileSci_Controller */ private function _loadPersonData($person_id) { - $stammdaten = $this->PersonModel->getPersonStammdaten($person_id); + $stammdaten = $this->PersonModel->getPersonStammdaten($person_id, true); if (isError($stammdaten)) { diff --git a/application/models/person/Person_model.php b/application/models/person/Person_model.php index 81de63d49..9c6f14f89 100644 --- a/application/models/person/Person_model.php +++ b/application/models/person/Person_model.php @@ -157,9 +157,10 @@ class Person_model extends DB_Model * gets Stammdaten for a person, including contactdata in textform from other tables * nation, kontakt, adresse * @param $person_id + * @param bool $zustellung_only, when true, retrieve only Zustellkontakte * @return array, null when no person found */ - public function getPersonStammdaten($person_id) + public function getPersonStammdaten($person_id, $zustellung_only = false) { $this->addSelect('public.tbl_person.*, s.kurztext as staatsbuergerschaft, g.kurztext as geburtsnation'); $this->addJoin('bis.tbl_nation s', 'public.tbl_person.staatsbuergerschaft = s.nation_code', 'LEFT'); @@ -180,11 +181,12 @@ class Person_model extends DB_Model $this->KontaktModel->addDistinct(); $this->KontaktModel->addSelect('kontakttyp, anmerkung, kontakt, zustellung'); $this->KontaktModel->addOrder('kontakttyp'); - $kontakte = $this->KontaktModel->loadWhere(array('person_id' => $person_id)); + $where = $zustellung_only === true ? array('person_id' => $person_id, 'zustellung' => true) : array('person_id' => $person_id); + $kontakte = $this->KontaktModel->loadWhere($where); if($kontakte->error) return error($kontakte->retval); - - $adressen = $this->AdresseModel->loadWhere(array('person_id' => $person_id)); + $where = $zustellung_only === true ? array('person_id' => $person_id, 'zustelladresse' => true) : array('person_id' => $person_id); + $adressen = $this->AdresseModel->loadWhere($where); if($adressen->error) return error($adressen->retval); diff --git a/application/views/system/infocenter/infocenterDetails.php b/application/views/system/infocenter/infocenterDetails.php index e540e22b9..563069962 100644 --- a/application/views/system/infocenter/infocenterDetails.php +++ b/application/views/system/infocenter/infocenterDetails.php @@ -91,7 +91,6 @@ $this->load->view( Typ Kontakt - Zustellung Anmerkung @@ -111,7 +110,6 @@ $this->load->view( - zustellung === true ? '' : ''; ?> anmerkung; ?> @@ -123,9 +121,6 @@ $this->load->view( strasse.', '.$adresse->plz.' '.$adresse->ort : '' ?> - - zustelladresse === true ? '' : '' ?> - heimatadresse === true ? 'Heimatadresse' : '').($adresse->heimatadresse === true && $adresse->rechnungsadresse === true ? ', ' : '').($adresse->rechnungsadresse === true ? 'Rechnungsadresse' : ''); ?> @@ -148,7 +143,7 @@ $this->load->view(  Zugang + class="glyphicon glyphicon-new-window"> Zugang Bewerbung diff --git a/vilesci/stammdaten/personen_wartung.php b/vilesci/stammdaten/personen_wartung.php index 0b9cf1184..1413a1599 100644 --- a/vilesci/stammdaten/personen_wartung.php +++ b/vilesci/stammdaten/personen_wartung.php @@ -128,7 +128,7 @@ if(isset($radio_1) && isset($radio_2) && $radio_1>=0 && $radio_2>=0) $msg .= "
".mb_eregi_replace(';',';
',$sql_query_upd1); $db->db_query("COMMIT;"); //Logeintrag schreiben - PersonLog($radio_2, 'Action', array('name' => 'Persons merged', 'message' => 'person with id '.$radio_1.' merged into person with id '.$radio_2, 'success' => 'true'), 'datenwartung', 'core', null, $uid); + PersonLog($radio_2, 'Action', array('name' => 'Persons merged', 'message' => 'Person with id '.$radio_1.' merged into person with id '.$radio_2, 'success' => 'true'), 'datenwartung', 'core', null, $uid); } else {