diff --git a/application/controllers/system/infocenter/InfoCenter.php b/application/controllers/system/infocenter/InfoCenter.php
index 48c50bb4a..deaee0e10 100644
--- a/application/controllers/system/infocenter/InfoCenter.php
+++ b/application/controllers/system/infocenter/InfoCenter.php
@@ -121,6 +121,7 @@ class InfoCenter extends Auth_Controller
'unlockPerson' => 'infocenter:rw',
'saveFormalGeprueft' => 'infocenter:rw',
'saveDocTyp' => 'infocenter:rw',
+ 'updateStammdaten' => 'infocenter:rw',
'saveNachreichung' => 'infocenter:rw',
'getPrestudentData' => 'infocenter:r',
'getLastPrestudentWithZgvJson' => 'infocenter:r',
@@ -172,6 +173,8 @@ class InfoCenter extends Auth_Controller
$this->load->model('codex/Zgv_model', 'ZgvModel');
$this->load->model('codex/Zgvmaster_model', 'ZgvmasterModel');
$this->load->model('codex/Nation_model', 'NationModel');
+ $this->load->model('person/Kontakt_model', 'KontaktModel');
+ $this->load->model('person/Geschlecht_model', 'GeschlechtModel');
// Loads libraries
$this->load->library('PersonLogLib');
@@ -1320,6 +1323,85 @@ class InfoCenter extends Auth_Controller
$this->outputJsonSuccess('success');
}
+ public function updateStammdaten()
+ {
+ if (isEmptyString($this->input->post('nachname')) ||
+ isEmptyString($this->input->post('geschlecht')) ||
+ isEmptyString($this->input->post('gebdatum')))
+ {
+ $this->terminateWithJsonError($this->p->t('infocenter', 'stammdatenFeldFehlt'));
+ }
+
+ $datum = explode('.', $this->input->post('gebdatum'));
+
+ if (!checkdate($datum[1], $datum[0], $datum[2]))
+ {
+ $this->terminateWithJsonError($this->p->t('infocenter', 'datumUngueltig'));
+ }
+
+ $person_id = $this->input->post('personid');
+
+ $update = $this->PersonModel->update(
+ array
+ (
+ 'person_id' => $person_id
+ ),
+ array
+ (
+ 'titelpre' => isEmptyString($this->input->post('titelpre')) ? null : $this->input->post('titelpre'),
+ 'vorname' => isEmptyString($this->input->post('vorname')) ? null : $this->input->post('vorname'),
+ 'nachname' => $this->input->post('nachname'),
+ 'titelpost' => isEmptyString($this->input->post('titelpost')) ? null : $this->input->post('titelpost'),
+ 'gebdatum' => isEmptyString($this->input->post('gebdatum')) ? null : date("Y-m-d", strtotime($this->input->post('gebdatum'))),
+ 'svnr' => isEmptyString($this->input->post('svnr')) ? null : $this->input->post('svnr'),
+ 'staatsbuergerschaft' => isEmptyString($this->input->post('buergerschaft')) ? null : $this->input->post('buergerschaft'),
+ 'geschlecht' => $this->input->post('geschlecht'),
+ 'geburtsnation' => isEmptyString($this->input->post('gebnation')) ? null : $this->input->post('gebnation'),
+ 'gebort' => isEmptyString($this->input->post('gebort')) ? null : $this->input->post('gebort'),
+ 'updateamum' => date('Y-m-d H:i:s'),
+ 'updatevon' => $this->_uid
+ )
+ );
+
+ if (isError($update))
+ $this->terminateWithJsonError($this->p->t('ui', 'fehlerBeimSpeichern'));
+
+ $kontakte = $this->input->post('kontakt');
+ foreach($kontakte as $kontakt)
+ {
+ $kontaktExists = $this->KontaktModel->loadWhere(array(
+ 'kontakt_id' => $kontakt['id'],
+ 'person_id' => $person_id,
+ ));
+
+ if (hasData($kontaktExists))
+ {
+ $kontaktExists = getData($kontaktExists)[0];
+
+ if ($kontaktExists->kontakt === $kontakt['value'])
+ continue;
+
+ $update = $this->KontaktModel->update(
+ array
+ (
+ 'kontakt_id' => $kontakt['id']
+ ),
+ array
+ (
+ 'kontakt' => isEmptyString($kontakt['value']) ? null : $kontakt['value'],
+ 'updateamum' => date('Y-m-d H:i:s'),
+ 'updatevon' => $this->_uid
+ )
+ );
+
+ if (isError($update))
+ $this->terminateWithJsonError($this->p->t('ui', 'fehlerBeimSpeichern'));
+ }
+ }
+
+ $this->outputJsonSuccess('Success');
+ }
+
public function saveNachreichung($person_id)
{
$nachreichungAm = $this->input->post('nachreichungAm');
@@ -1996,6 +2078,9 @@ class InfoCenter extends Auth_Controller
$this->NationModel->addOrder('langtext');
$allNations = getData($this->NationModel->load());
+ $this->GeschlechtModel->addOrder('sort');
+ $allGenders = getData($this->GeschlechtModel->load());
+
$data = array (
'zgvpruefungen' => $zgvpruefungen,
'abwstatusgruende' => $abwstatusgruende,
@@ -2004,6 +2089,7 @@ class InfoCenter extends Auth_Controller
'all_zgvs' => $allZGVs,
'all_zgvs_master' => $allZGVsMaster,
'all_nations' => $allNations,
+ 'all_genders' => $allGenders
);
return $data;
diff --git a/application/models/person/Geschlecht_model.php b/application/models/person/Geschlecht_model.php
new file mode 100644
index 000000000..60ac3ba15
--- /dev/null
+++ b/application/models/person/Geschlecht_model.php
@@ -0,0 +1,14 @@
+dbTable = 'public.tbl_geschlecht';
+ $this->pk = 'geschlecht';
+ }
+}
diff --git a/application/views/system/infocenter/stammdaten.php b/application/views/system/infocenter/stammdaten.php
index a80439bfe..595f86b1a 100644
--- a/application/views/system/infocenter/stammdaten.php
+++ b/application/views/system/infocenter/stammdaten.php
@@ -1,60 +1,93 @@