Merge branch 'master' into feature-17512/Issues_Plausibilitaetspruefungen

This commit is contained in:
Andreas Österreicher
2023-02-09 16:04:33 +01:00
77 changed files with 2963 additions and 1190 deletions
@@ -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,11 +173,16 @@ 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');
$this->load->model('person/adresse_model', 'AdresseModel');
// Loads libraries
$this->load->library('PersonLogLib');
$this->load->library('WidgetLib');
$this->load->config('infocenter');
$this->loadPhrases(
array(
'global',
@@ -1111,14 +1117,14 @@ class InfoCenter extends Auth_Controller
public function reloadDoks($person_id)
{
$dokumente_nachgereicht = $this->AkteModel->getAktenWithDokInfo($person_id, null, true);
$dokumente_nachgereicht = $this->AkteModel->getAktenWithDokInfo($person_id, null, true, false);
$this->load->view('system/infocenter/dokNachzureichend.php', array('dokumente_nachgereicht' => $dokumente_nachgereicht->retval));
}
public function reloadUebersichtDoks($person_id)
{
$dokumente = $this->AkteModel->getAktenWithDokInfo($person_id, null, false);
$dokumente = $this->AkteModel->getAktenWithDokInfo($person_id, null, false, false);
$this->DokumentModel->addOrder('bezeichnung');
$dokumentdata = array('dokumententypen' => (getData($this->DokumentModel->load())));
@@ -1320,6 +1326,126 @@ 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'));
}
}
$adressen = $this->input->post('adresse');
foreach ($adressen as $adresse)
{
$adresseExists = $this->AdresseModel->loadWhere(array(
'adresse_id' => $adresse['id'],
'person_id' => $person_id,
));
if (hasData($adresseExists))
{
$adresse = $adresse['value'];
$adresseExists = getData($adresseExists)[0];
if ($adresseExists->strasse !== $adresse['strasse'] ||
$adresseExists->plz !== $adresse['plz'] ||
$adresseExists->ort !== $adresse['ort'] ||
$adresseExists->nation !== $adresse['nation'])
{
$update = $this->AdresseModel->update(
array
(
'adresse_id' => $adresseExists->adresse_id
),
array
(
'strasse' => isEmptyString($adresse['strasse']) ? null : $adresse['strasse'],
'plz' => isEmptyString($adresse['plz']) ? null : $adresse['plz'],
'ort' => isEmptyString($adresse['ort']) ? null : $adresse['ort'],
'nation' => isEmptyString($adresse['nation']) ? null : $adresse['nation'],
'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');
@@ -1794,14 +1920,14 @@ class InfoCenter extends Auth_Controller
if (!isset($stammdaten->retval))
return null;
$dokumente = $this->AkteModel->getAktenWithDokInfo($person_id, null, false);
$dokumente = $this->AkteModel->getAktenWithDokInfo($person_id, null, false, false);
if (isError($dokumente))
{
show_error(getError($dokumente));
}
$dokumente_nachgereicht = $this->AkteModel->getAktenWithDokInfo($person_id, null, true);
$dokumente_nachgereicht = $this->AkteModel->getAktenWithDokInfo($person_id, null, true, false);
if (isError($dokumente_nachgereicht))
{
@@ -1996,6 +2122,12 @@ class InfoCenter extends Auth_Controller
$this->NationModel->addOrder('langtext');
$allNations = getData($this->NationModel->load());
$additional_stg = explode(',', ($this->config->item('infocenter_studiengang_kz')));
$this->GeschlechtModel->addOrder('sort');
$allGenders = getData($this->GeschlechtModel->load());
$data = array (
'zgvpruefungen' => $zgvpruefungen,
'abwstatusgruende' => $abwstatusgruende,
@@ -2004,6 +2136,8 @@ class InfoCenter extends Auth_Controller
'all_zgvs' => $allZGVs,
'all_zgvs_master' => $allZGVsMaster,
'all_nations' => $allNations,
'additional_stg' => $additional_stg,
'all_genders' => $allGenders
);
return $data;
@@ -2164,8 +2298,8 @@ class InfoCenter extends Auth_Controller
$prestudentstatus = $prestudent->prestudentstatus;
$person_id = $prestudent->person_id;
$person = $this->PersonModel->getPersonStammdaten($person_id, true)->retval;
$dokumente = $this->AkteModel->getAktenWithDokInfo($person_id, null, false)->retval;
$dokumenteNachzureichen = $this->AkteModel->getAktenWithDokInfo($person_id, null, true)->retval;
$dokumente = $this->AkteModel->getAktenWithDokInfo($person_id, null, false, false)->retval;
$dokumenteNachzureichen = $this->AkteModel->getAktenWithDokInfo($person_id, null, true, false)->retval;
//fill mail variables
$interessentbez = $person->geschlecht == 'm' ? 'Ein Interessent' : 'Eine Interessentin';
@@ -2262,12 +2396,10 @@ class InfoCenter extends Auth_Controller
public function getAbsageData()
{
$studiengang_kz_all = $this->permissionlib->getSTG_isEntitledFor('infocenter');
$stg_typ = $this->StudiengangModel->getStudiengangTyp($studiengang_kz_all, ['b', 'm']);
$stg_typ = $this->getStudienArtBerechtigung(['b', 'm']);
if (hasData($stg_typ))
if (!is_null($stg_typ))
{
$stg_typ = getData($stg_typ);
$statusgruende = $this->StatusgrundModel->getStatus(self::ABGEWIESENERSTATUS, true)->retval;
$studienSemester = $this->variablelib->getVar('infocenter_studiensemester');
$studiengaenge = $this->StudiengangModel->getStudiengaengeWithOrgForm(array_column($stg_typ, 'typ'), $studienSemester);
@@ -2283,15 +2415,16 @@ class InfoCenter extends Auth_Controller
$this->outputJsonSuccess(null);
}
public function getStudienArtBerechtigung()
public function getStudienArtBerechtigung($typ = null)
{
$studiengang_kz_all = $this->permissionlib->getSTG_isEntitledFor('infocenter');
$stg_typ = $this->StudiengangModel->getStudiengangTyp($studiengang_kz_all, ['b', 'm', 'l']);
$stg_typ = $this->StudiengangModel->getStudiengangTyp($studiengang_kz_all, $typ);
return getData($stg_typ);
}
public function getStudienartData()
{
$this->outputJsonSuccess($this->getStudienArtBerechtigung());
$this->outputJsonSuccess($this->getStudienArtBerechtigung(['b', 'm', 'l']));
}
public function saveAbsageForAll()
+4 -1
View File
@@ -171,7 +171,7 @@ class Akte_model extends DB_Model
* @param bool $nachgereicht if true, retrieves only nachgereichte Dokumente. if false, only not nachgereichte. default: null, all Dokumente
* @return array
*/
public function getAktenWithDokInfo($person_id, $dokument_kurzbz = null, $nachgereicht = null)
public function getAktenWithDokInfo($person_id, $dokument_kurzbz = null, $nachgereicht = null, $archiv = null)
{
$this->addSelect('public.tbl_akte.*, bezeichnung_mehrsprachig, dokumentbeschreibung_mehrsprachig, public.tbl_dokument.bezeichnung as dokument_bezeichnung, bis.tbl_nation.*, ausstellungsdetails');
$this->addJoin('public.tbl_dokument', 'dokument_kurzbz');
@@ -184,6 +184,9 @@ class Akte_model extends DB_Model
if(is_bool($nachgereicht))
$where['nachgereicht'] = $nachgereicht;
if (is_bool($archiv))
$where['archiv'] = $archiv;
$dokumente = $this->loadWhere($where);
if($dokumente->error) return $dokumente;
+29 -3
View File
@@ -309,13 +309,39 @@ class Prestudent_model extends DB_Model
*/
public function getLastPrestudent($person_id, $withzgv = false)
{
$qry = 'SELECT * FROM public.tbl_prestudent
WHERE person_id = ?
$qry = 'SELECT * FROM public.tbl_prestudent ps
%s
WHERE ps.person_id = ?
ORDER BY updateamum DESC NULLS LAST, insertamum DESC NULLS LAST
LIMIT 1';
$zgvwhere = $withzgv === true ? 'AND zgv_code IS NOT NULL' : '';
$zgvwhere = '';
if ($withzgv === true)
{
$zgvwhere = '
LEFT JOIN (
SELECT ps2.zgvmas_code,
ps2.zgvmanation,
ps2.zgvmadatum,
ps2.zgvmaort,
ps2.zgvmas_erfuellt,
ps2.person_id
FROM tbl_prestudent ps2
WHERE zgvmas_code IS NOT NULL
ORDER BY updateamum DESC NULLS LAST, insertamum DESC NULLS LAST
) zgvmas ON zgvmas.person_id = ps.person_id
LEFT JOIN (
SELECT ps2.zgv_code,
ps2.zgvnation,
ps2.zgvdatum,
ps2.zgvort,
ps2.zgv_erfuellt,
ps2.person_id
FROM tbl_prestudent ps2
WHERE zgv_code IS NOT NULL
ORDER BY updateamum DESC NULLS LAST, insertamum DESC NULLS LAST
)zgv ON zgv.person_id = ps.person_id';
}
$qry = sprintf($qry, $zgvwhere);
@@ -508,13 +508,20 @@ class Studiengang_model extends DB_Model
return $this->execQuery($query, array($typ, $semester));
}
public function getStudiengangTyp($studiengang_kz, $typ)
public function getStudiengangTyp($studiengang_kz, $typ = null)
{
$query = "SELECT DISTINCT(sgt.*)
FROM tbl_studiengangstyp sgt JOIN tbl_studiengang sg on sgt.typ = sg.typ
WHERE studiengang_kz IN ? and sgt.typ IN ?";
WHERE studiengang_kz IN ?";
return $this->execQuery($query, array($studiengang_kz, $typ));
$params[] = $studiengang_kz;
if (!is_null($typ))
{
$query .= " AND sgt.typ IN ?";
$params[] = $typ;
}
return $this->execQuery($query, $params);
}
}
@@ -0,0 +1,14 @@
<?php
class Geschlecht_model extends DB_Model
{
/**
*
*/
public function __construct()
{
parent::__construct();
$this->dbTable = 'public.tbl_geschlecht';
$this->pk = 'geschlecht';
}
}
@@ -25,7 +25,8 @@
'public/js/infocenter/messageList.js',
'public/js/infocenter/infocenterDetails.js',
'public/js/infocenter/zgvUeberpruefung.js',
'public/js/infocenter/docUeberpruefung.js'
'public/js/infocenter/docUeberpruefung.js',
'public/js/infocenter/stammdaten.js'
),
'phrases' => array(
'infocenter' => array(
@@ -1,60 +1,104 @@
<div class="row">
<div class="col-lg-6 table-responsive">
<div class="col-lg-6 table-responsive stammdaten_form">
<table class="table">
<?php if (!empty($stammdaten->titelpre)): ?>
<tr>
<td><strong><?php echo ucfirst($this->p->t('person','titelpre')) ?></strong></td>
<td><?php echo $stammdaten->titelpre ?></td>
<td>
<div class='stammdaten' id="titelpre"><?php echo $stammdaten->titelpre ?></div>
</td>
</tr>
<?php endif; ?>
<tr>
<td><strong><?php echo ucfirst($this->p->t('person','vorname')) ?></strong></td>
<td><?php echo $stammdaten->vorname ?></td>
<td>
<div class='stammdaten' id="vorname"><?php echo $stammdaten->vorname ?></div>
</td>
</tr>
<tr>
<td><strong><?php echo ucfirst($this->p->t('person','nachname')) ?></strong></td>
<td>
<?php echo $stammdaten->nachname ?></td>
<div class='stammdaten' id="nachname"><?php echo $stammdaten->nachname ?></div>
</td>
</tr>
<tr>
<td><strong><?php echo ucfirst($this->p->t('person','titelpost')) ?></strong></td>
<td>
<div class='stammdaten' id="titelpost"><?php echo $stammdaten->titelpost ?></div>
</td>
</tr>
<?php if (!empty($stammdaten->titelpost)): ?>
<tr>
<td><strong><?php echo ucfirst($this->p->t('person','titelpost')) ?></strong></td>
<td><?php echo $stammdaten->titelpost ?></td>
</tr>
<?php endif; ?>
<tr>
<td><strong><?php echo ucfirst($this->p->t('person','geburtsdatum')) ?></strong></td>
<td>
<?php echo date_format(date_create($stammdaten->gebdatum), 'd.m.Y') ?></td>
<div class='stammdaten' id="gebdatum"><?php echo date_format(date_create($stammdaten->gebdatum), 'd.m.Y') ?></div>
</td>
</tr>
<tr>
<td><strong><?php echo ucfirst($this->p->t('person','svnr')) ?></strong></td>
<td>
<?php echo $stammdaten->svnr ?></td>
<div class='stammdaten' id="svnr"><?php echo $stammdaten->svnr ?></div>
</td>
</tr>
<tr>
<td><strong><?php echo ucfirst($this->p->t('person','staatsbuergerschaft')) ?></strong></td>
<td>
<?php echo $stammdaten->staatsbuergerschaft ?></td>
<select id="buergerschaft" disabled>
<?php
foreach ($all_nations as $nation)
{
$selected = '';
if ($nation->nation_code === $stammdaten->staatsbuergerschaft_code)
$selected = 'selected';
echo "<option value='". $nation->nation_code ."' " . $selected . ">". $nation->langtext . "</option>";
}
?>
</select>
</tr>
<tr>
<td><strong><?php echo ucfirst($this->p->t('person','geschlecht')) ?></strong></td>
<td>
<?php echo $stammdaten->geschlecht ?></td>
<?php
$language = getUserLanguage() == 'German' ? 0 : 1;
?>
<select id="geschlecht" disabled>
<?php
foreach ($all_genders as $gender)
{
$selected = '';
if ($gender->geschlecht === $stammdaten->geschlecht)
$selected = 'selected';
echo "<option value='". $gender->geschlecht ."' " . $selected . ">". ucfirst($gender->bezeichnung_mehrsprachig[$language]) . "</option>";
}
?>
</select>
</td>
</tr>
<tr>
<td><strong><?php echo ucfirst($this->p->t('person','geburtsnation')) ?></strong></td>
<td>
<?php echo $stammdaten->geburtsnation ?></td>
<select id="gebnation" disabled>
<?php
foreach ($all_nations as $nation)
{
$selected = '';
if ($nation->nation_code === $stammdaten->geburtsnation_code)
$selected = 'selected';
echo "<option value='". $nation->nation_code ."' " . $selected . ">". $nation->langtext . "</option>";
}
?>
</select>
</tr>
<tr>
<td><strong><?php echo ucfirst($this->p->t('person','geburtsort')) ?></strong></td>
<td><?php echo $stammdaten->gebort ?></td>
<td>
<div class='stammdaten' id="gebort"><?php echo $stammdaten->gebort ?></div>
</td>
</tr>
</table>
</div>
<div class="col-lg-6 table-responsive">
<table class="table table-bordered">
<table class="table table-bordered stammdaten_form">
<thead>
<tr>
<th colspan="4" class="text-center"><?php echo ucfirst($this->p->t('global','kontakt')) ?></th>
@@ -78,7 +122,7 @@
<td><?php echo ucfirst($kontakt->kontakttyp) ?></td>
<?php endif; ?>
<td>
<?php echo '<span class="'.$kontakt->kontakttyp.'">';?>
<?php echo '<span class="kontakt '.$kontakt->kontakttyp.'" data-id="'. $kontakt->kontakt_id .'" data-value="' . $kontakt->kontakt .'">';?>
<?php if ($kontakt->kontakttyp === 'email'): ?>
<a href="mailto:<?php echo $kontakt->kontakt; ?>" target="_top">
<?php $lastMailAdress = $kontakt->kontakt;
@@ -99,8 +143,30 @@
<?php echo ucfirst($this->p->t('person','adresse')) ?>
</td>
<td>
<?php echo isset($adresse) ? $adresse->strasse.', '.$adresse->plz.' '.$adresse->ort : '' ?>
<?php echo isset($adresse->nationkurztext) ? '<br />'.$adresse->nationkurztext : '' ?>
<?php if (isset($adresse)): ?>
<div class="row adresse col-sm-12" data-id="<?php echo $adresse->adresse_id ?>">
<div class="float-left" data-value="<?php echo $adresse->strasse ?>" data-type="strasse"><?php echo $adresse->strasse ?></div>
<div class="float-left" data-value="<?php echo $adresse->plz ?>" data-type="plz"><?php echo $adresse->plz ?></div>
<div class="float-left" data-value="<?php echo $adresse->ort ?>" data-type="ort"><?php echo $adresse->ort ?></div>
<?php if (isset($adresse->nationkurztext)): ?>
<select id="nation_<?php echo $adresse->adresse_id ?>" disabled>
<?php
foreach ($all_nations as $nation)
{
$selected = '';
if ($nation->nation_code === $adresse->nation)
$selected = 'selected';
echo "<option value='". $nation->nation_code ."' " . $selected . ">". $nation->langtext . "</option>";
}
?>
</select>
</div>
<br />
<?php endif; ?>
<?php endif; ?>
</td>
<td>
<?php echo ($adresse->heimatadresse === true ? 'Heimatadresse' : '').
@@ -126,6 +192,16 @@
target='_blank'><i class="glyphicon glyphicon-new-window"></i>&nbsp;<?php echo $this->p->t('infocenter','zugangBewerbung') ?></a>
</div>
<?php endif; ?>
<div class="col-xs-6">
<a class="editStammdaten">
<i class="fa fa-edit"></i>&nbsp;<?php echo $this->p->t('ui','bearbeiten'); ?></a>
<div class="editActionStammdaten" style="display:none">
<a class="cancelStammdaten">
<i class="fa fa-trash"></i>&nbsp;<?php echo $this->p->t('ui','abbrechen');?></a>
<a class="saveStammdaten">
<i class="fa fa-save"></i>&nbsp;<?php echo $this->p->t('ui','speichern'); ?></a>
</div>
</div>
</div>
</div>
</div>
@@ -2,7 +2,7 @@
<?php
$unique_studsemester = array();
$first = true;
$fit_programme_studiengaenge = array(10021, 10027);
$fit_programme_studiengaenge = $additional_stg;
foreach ($zgvpruefungen as $zgvpruefung):
$infoonly = $zgvpruefung->infoonly;
$studiengangkurzbz = $studiengangbezeichnung = $studiengangtyp = '';
+17 -3
View File
@@ -56,7 +56,7 @@ $query .= "SELECT issue_id, fehlercode AS \"Fehlercode\", iss.fehlercode_extern
WHERE person_id = pers.person_id
ORDER BY prestudent_id DESC
) prestudents
WHERE last_status IN ('Aufgenommener', 'Student', 'Incoming', 'Diplomand', 'Abbrecher', 'Unterbrecher', 'Absolvent')
WHERE last_status IN ('Abgewiesener','Aufgenommener', 'Student', 'Incoming', 'Diplomand', 'Abbrecher', 'Unterbrecher', 'Absolvent')
GROUP BY person_id
LIMIT 1;
) AS \"Zugehörigkeit\",
@@ -89,7 +89,9 @@ $query .= "SELECT issue_id, fehlercode AS \"Fehlercode\", iss.fehlercode_extern
LEFT JOIN public.tbl_funktion fu USING (funktion_kurzbz)
WHERE fehlercode = fr.fehlercode
GROUP BY fehlercode
) AS \"Organisationseinheit Zuständigkeiten\"
) AS \"Organisationseinheit Zuständigkeiten\",
pers.bpk AS \"BPK\",
pers.matr_nr AS \"Matrikelnummer\"
FROM system.tbl_issue iss
JOIN system.tbl_fehler fr USING (fehlercode)
JOIN system.tbl_fehlertyp ftyp USING (fehlertyp_kurzbz)
@@ -173,7 +175,9 @@ $filterWidgetArray = array(
ucfirst($this->p->t('fehlermonitoring', 'zugehoerigkeit')),
ucfirst($this->p->t('fehlermonitoring', 'hauptzustaendig')),
ucfirst($this->p->t('fehlermonitoring', 'zustaendigePersonen')),
ucfirst($this->p->t('fehlermonitoring', 'zustaendigeOrganisationseinheiten'))
ucfirst($this->p->t('fehlermonitoring', 'zustaendigeOrganisationseinheiten')),
'BPK',
'Matrikelnummer'
),
'formatRow' => function($datasetRaw) {
@@ -222,6 +226,16 @@ $filterWidgetArray = array(
$datasetRaw->{'Organisationseinheit Zuständigkeiten'} = '-';
}
if ($datasetRaw->{'BPK'} == null)
{
$datasetRaw->{'BPK'} = '-';
}
if ($datasetRaw->{'Matrikelnummer'} == null)
{
$datasetRaw->{'Matrikelnummer'} = '-';
}
return $datasetRaw;
},
'markRow' => function($datasetRaw) {