Merge remote-tracking branch 'origin/master' into feature-60873/GesamtnoteneingabeCis4

This commit is contained in:
Johann Hoffmann
2025-07-15 09:51:11 +02:00
42 changed files with 1336 additions and 191 deletions
+11
View File
@@ -0,0 +1,11 @@
<?php
if (! defined('BASEPATH')) exit('No direct script access allowed');
// apps for which issues should be displayed
$config['issues_list_apps'] = array('core', 'dvuh');
// functions which enable users to see issues
$config['issues_list_functions'] = array('ass');
// functions which enable users to see issues
$config['issues_list_status'] = array('Aufgenommener', 'Student', 'Incoming', 'Diplomand', 'Abbrecher', 'Unterbrecher', 'Absolvent');
+3 -1
View File
@@ -4,4 +4,6 @@ if (! defined('BASEPATH')) exit('No direct script access allowed');
// use vuejs dev version
$config['use_vuejs_dev_version'] = false;
// use bundled javascript
$config['use_bundled_javascript'] = false;
$config['use_bundled_javascript'] = false;
// systemerror_mailto use in FHC-Alert Plugin - if empty Link will not be rendered
$config['systemerror_mailto'] = '';
@@ -85,7 +85,10 @@ class Kontakt extends FHCAPI_Controller
|| $this->router->method == 'addNewBankverbindung'
) {
$person_id = current(array_slice($this->uri->rsegments, 2));
if (is_null($person_id) || !ctype_digit((string)$person_id))
$this->terminateWithError( $this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
$this->checkPermissionsForPerson($person_id, $permsMa, $permsStud);
} elseif ($this->router->method == 'loadAddress'
|| $this->router->method == 'loadContact'
@@ -119,6 +122,9 @@ class Kontakt extends FHCAPI_Controller
$model = 'person/Bankverbindung_model';
}
if (!isset($id) || !ctype_digit((string)$id))
$this->terminateWithError($this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
$this->load->model($model, 'TempModel');
$result = $this->TempModel->load($id);
$data = $this->getDataOrTerminateWithError($result);
@@ -387,8 +393,11 @@ class Kontakt extends FHCAPI_Controller
$this->terminateWithSuccess(getData($result) ?: []);
}
public function getFirmen($searchString)
public function getFirmen($searchString = null)
{
if (is_null($searchString))
$this->terminateWithError($this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
$this->load->model('ressource/firma_model', 'FirmaModel');
$result = $this->FirmaModel->searchFirmen($searchString);
@@ -398,8 +407,11 @@ class Kontakt extends FHCAPI_Controller
$this->terminateWithSuccess($result ?: []);
}
public function getStandorte($searchString)
public function getStandorte($searchString = null)
{
if (is_null($searchString))
$this->terminateWithError($this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
$this->load->model('organisation/standort_model', 'StandortModel');
$result = $this->StandortModel->searchStandorte($searchString);
@@ -409,8 +421,11 @@ class Kontakt extends FHCAPI_Controller
$this->terminateWithSuccess($data);
}
public function getStandorteByFirma($firma_id)
public function getStandorteByFirma($firma_id = null)
{
if (is_null($firma_id) || !ctype_digit((string)$firma_id))
$this->terminateWithError($this->p->t('ui', 'ungueltigeParameter'), self::ERROR_TYPE_GENERAL);
$this->load->model('organisation/standort_model', 'StandortModel');
$result = $this->StandortModel->getStandorteByFirma($firma_id);
@@ -652,6 +667,9 @@ class Kontakt extends FHCAPI_Controller
$bic = $this->input->post('bic');
$blz = $this->input->post('blz');
$kontonr = $this->input->post('kontonr');
$iban = $this->input->post('iban');
$typ = $this->input->post('typ');
$verrechnung = $this->input->post('verrechnung');
$result = $this->BankverbindungModel->insert(
[
@@ -659,13 +677,13 @@ class Kontakt extends FHCAPI_Controller
'name' => $name,
'anschrift' => $anschrift,
'bic' => $bic,
'iban' => $_POST['iban'],
'iban' => $iban,
'blz' => $blz,
'kontonr' => $kontonr,
'insertvon' => 'uid',
'insertamum' => date('c'),
'typ' => $_POST['typ'],
'verrechnung' => $_POST['verrechnung'],
'typ' => $typ,
'verrechnung' => $verrechnung,
'ext_id' => $ext_id,
'oe_kurzbz' => $oe_kurzbz,
'orgform_kurzbz' => $orgform_kurzbz
+7 -4
View File
@@ -95,12 +95,15 @@ class AntragJob extends JOB_Controller
continue;
}
$leitung = current(getData($result));
if (!isset($stgLeitungen[$leitung->uid]))
$leitungen = getData($result);
foreach ($leitungen as $leitung)
{
$stgLeitungen[$leitung->uid] = [ 'Details' => $leitung, 'stgs' => [] ];
if (!isset($stgLeitungen[$leitung->uid]))
{
$stgLeitungen[$leitung->uid] = ['Details' => $leitung, 'stgs' => []];
}
$stgLeitungen[$leitung->uid]['stgs'][] = $antrag->studiengang_kz;
}
$stgLeitungen[$leitung->uid]['stgs'][] = $antrag->studiengang_kz;
$result = $this->StudierendenantragModel->getStgAndSem($antrag->studierendenantrag_id);
if (isError($result))
@@ -48,7 +48,9 @@ class IssueResolver extends IssueResolver_Controller
'CORE_PERSON_0001' => 'CORE_PERSON_0001',
'CORE_PERSON_0002' => 'CORE_PERSON_0002',
'CORE_PERSON_0003' => 'CORE_PERSON_0003',
'CORE_PERSON_0004' => 'CORE_PERSON_0004'
'CORE_PERSON_0004' => 'CORE_PERSON_0004',
'CORE_PERSON_0005' => 'CORE_PERSON_0005',
'CORE_PERSON_0006' => 'CORE_PERSON_0006'
);
// fehler which are resolved by the job the same way as they are produced
@@ -2375,16 +2375,50 @@ class InfoCenter extends Auth_Controller
if ($statusgrund === 'null' || $studiengang === 'null' || $abgeschickt === 'null' || empty($personen))
$this->terminateWithJsonError("Bitte füllen Sie alle Felder aus");
foreach($personen as $person)
if ($studiengang === 'all' && $abgeschickt === 'all')
{
$prestudent = $this->PrestudentModel->getPrestudentByStudiengangAndPerson($studiengang, $person, $studienSemester, $abgeschickt);
foreach($personen as $person)
{
$prestudenten = $this->PrestudentModel->getByPersonWithoutLehrgang($person, $studienSemester);
if (!hasData($prestudent))
continue;
if (!hasData($prestudenten))
continue;
$prestudentData = getData($prestudent);
$prestudentenData = getData($prestudenten);
foreach ($prestudentenData as $prestudent)
{
$this->saveAbsage($prestudent->prestudent_id, $statusgrund);
}
}
}
else
{
$this->load->model('organisation/Studienplan_model', 'StudienplanModel');
$this->StudienplanModel->addSelect('1');
$this->StudienplanModel->addJoin('lehre.tbl_studienordnung so', 'studienordnung_id');
$escaped = $this->StudienplanModel->db->escape(strtoupper($studiengang));
$this->StudienplanModel->db->where("UPPER(so.studiengangkurzbzlang || ':' || tbl_studienplan.orgform_kurzbz) = $escaped");
$this->StudienplanModel->addLimit(1);
$studiengangResult = $this->StudienplanModel->load();
if (hasData($studiengangResult))
{
foreach($personen as $person)
{
$prestudent = $this->PrestudentModel->getPrestudentByStudiengangAndPerson($studiengang, $person, $studienSemester, $abgeschickt, $abgeschickt === 'all');
if (!hasData($prestudent))
continue;
$prestudentData = getData($prestudent);
$this->saveAbsage($prestudentData[0]->prestudent_id, $statusgrund);
}
}
else
$this->terminateWithJsonError("Falschen Studiengang übergeben!");
$this->saveAbsage($prestudentData[0]->prestudent_id, $statusgrund);
}
$this->outputJsonSuccess("Success");
@@ -14,7 +14,8 @@ class Rueckstellung extends Auth_Controller
'get' => array('infocenter:r', 'lehre/zgvpruefung:r'),
'set' => array('infocenter:r', 'lehre/zgvpruefung:r'),
'delete' => array('infocenter:r', 'lehre/zgvpruefung:r'),
'getStatus' => array('infocenter:rw', 'lehre/zgvpruefung:rw')
'getStatus' => array('infocenter:rw', 'lehre/zgvpruefung:rw'),
'setForPersonen' => array('infocenter:rw', 'lehre/zgvpruefung:rw'),
)
);
@@ -79,7 +80,34 @@ class Rueckstellung extends Auth_Controller
$this->outputJson($result);
}
public function setForPersonen()
{
$personen = $this->input->post('personen');
$datum_bis = $this->input->post('datum_bis');
$status_kurzbz = $this->input->post('status_kurzbz');
foreach ($personen as $person)
{
$rueckstellung = $this->_ci->RueckstellungModel->loadWhere(array('person_id' => $person));
if (hasData($rueckstellung))
continue;
$result = $this->_ci->RueckstellungModel->insert(
array('person_id' => $person,
'status_kurzbz' => $status_kurzbz,
'datum_bis' => date_format(date_create($datum_bis), 'Y-m-d'),
'insertvon' => $this->_uid
)
);
if (isError($result))
$this->terminateWithJsonError(getError($result));
$this->_log($person, $status_kurzbz);
}
$this->outputJsonSuccess("Erfolgreich gespeichert!");
}
public function delete()
{
$person_id = $this->input->post('person_id');
@@ -6,7 +6,6 @@ class Issues extends Auth_Controller
{
private $_uid;
const FUNKTION_KURZBZ = 'ass'; // user having this funktion can see issues for oes assigned with this funktion
const BERECHTIGUNG_KURZBZ = 'system/issues_verwalten'; // user having this permission can see issues for oes assigned with this permission
public function __construct()
@@ -28,6 +27,9 @@ class Issues extends Auth_Controller
$this->load->model('organisation/Organisationseinheit_model', 'OrganisationseinheitModel');
$this->load->model('system/Sprache_model', 'SpracheModel');
// load config
$this->load->config('issueList');
$this->loadPhrases(
array(
'global',
@@ -47,10 +49,12 @@ class Issues extends Auth_Controller
{
$oes_for_issues = $this->_getOesForIssues();
$language_index = $this->_getLanguageIndex();
$apps = $this->config->item('issues_list_apps');
$status = $this->config->item('issues_list_status');
$this->load->view(
'system/issues/issues',
array_merge($oes_for_issues, array('language_index' => $language_index))
array_merge($oes_for_issues, array('language_index' => $language_index, 'apps' => $apps, 'status' => $status))
);
}
@@ -121,6 +125,8 @@ class Issues extends Auth_Controller
$oe_kurzbz_for_funktion = array();
$benutzerfunktionRes = $this->BenutzerfunktionModel->getBenutzerFunktionByUid($this->_uid, null, date('Y-m-d'), date('Y-m-d'));
$functions = $this->config->item('issues_list_functions');
if (isError($benutzerfunktionRes))
show_error(getError($benutzerfunktionRes));
@@ -130,8 +136,8 @@ class Issues extends Auth_Controller
{
$all_funktionen_oe_kurzbz[$benutzerfunktion->oe_kurzbz][] = $benutzerfunktion->funktion_kurzbz;
// separate oes for the additional funktion which enables displaying issues
if ($benutzerfunktion->funktion_kurzbz == self::FUNKTION_KURZBZ)
// separate oes for the additional functions which enables displaying issues
if (in_array($benutzerfunktion->funktion_kurzbz, $functions))
{
$oe_kurzbz_for_funktion[] = $benutzerfunktion->oe_kurzbz;
@@ -95,6 +95,9 @@ function generateJSDataStorageObject($indexPage, $calledPath, $calledMethod)
}, $server_language);
$user_language = getUserLanguage();
$ci->load->config('javascript');
$systemerror_mailto = $ci->config->item('systemerror_mailto');
$FHC_JS_DATA_STORAGE_OBJECT = array(
'app_root' => APP_ROOT,
'ci_router' => $indexPage,
@@ -103,6 +106,7 @@ function generateJSDataStorageObject($indexPage, $calledPath, $calledMethod)
'server_languages' => $server_language,
'user_language' => $user_language,
'timezone' => date_default_timezone_get(),
'systemerror_mailto' => $systemerror_mailto,
);
$toPrint = "\n";
+7 -2
View File
@@ -77,7 +77,9 @@ class AntragLib
'studiensemester_kurzbz'=>$prestudentstatus->studiensemester_kurzbz,
'ausbildungssemester'=>$prestudentstatus->ausbildungssemester
], [
'statusgrund_id' => null
'statusgrund_id' => null,
'updateamum' => date('c'),
'updatevon' => $insertvon
]);
}
}
@@ -335,7 +337,10 @@ class AntragLib
'status_kurzbz'=>$prestudentstatus->status_kurzbz,
'studiensemester_kurzbz'=>$prestudentstatus->studiensemester_kurzbz,
'ausbildungssemester'=>$prestudentstatus->ausbildungssemester
], []);
], [
'updateamum' => $insertam,
'updatevon' => $insertvon
]);
if (isError($result))
{
$errors[] = getError($result);
@@ -13,7 +13,7 @@ class PlausicheckResolverLib
private $_ci; // ci instance
private $_extensionName; // name of extension
private $_codeLibMappings = []; // mappings for issues which explicitly defined resolver
private $_codeProducerLibMappings = []; // mappings for issues which are resolved as produced
private $_codeProducerLibMappings = []; // mappings for issues which are resolved with the same check as they are produced
public function __construct($params = null)
{
@@ -99,10 +99,11 @@ class PlausicheckResolverLib
$issueResolved = getData($issueResolvedRes) === true;
}
}
elseif (isset($this->_codeProducerLibMappings[$issue->fehlercode]))
elseif (isset($this->_codeProducerLibMappings[$issue->fehlercode])) // check if it is an issue without explicit resolver, "self-resolving"
{
$libName = $this->_codeProducerLibMappings[$issue->fehlercode];
// execute same check as used for issue production
$issueResolvedRes = $this->_ci->plausicheckproducerlib->producePlausicheckIssue(
$libName,
$issue->fehler_kurzbz,
@@ -0,0 +1,36 @@
<?php
if (! defined('BASEPATH')) exit('No direct script access allowed');
/**
* Geburtsnation missing
*/
class CORE_PERSON_0005 implements IIssueResolvedChecker
{
public function checkIfIssueIsResolved($params)
{
if (!isset($params['issue_person_id']) || !is_numeric($params['issue_person_id']))
return error('Person Id missing, issue_id: '.$params['issue_id']);
$this->_ci =& get_instance(); // get code igniter instance
$this->_ci->load->model('person/Person_model', 'PersonModel');
// load geburtsnation for the given person
$this->_ci->PersonModel->addSelect('geburtsnation');
$personRes = $this->_ci->PersonModel->load($params['issue_person_id']);
if (isError($personRes)) return $personRes;
if (hasData($personRes))
{
// get person data
$personData = getData($personRes)[0];
// if geburtsnation present, issue is resolved
return success(!isEmptyString($personData->geburtsnation));
}
else
return success(false); // if no person found, not resolved
}
}
@@ -0,0 +1,37 @@
<?php
if (! defined('BASEPATH')) exit('No direct script access allowed');
/**
* Geburtsnation missing
*/
class CORE_PERSON_0006 implements IIssueResolvedChecker
{
public function checkIfIssueIsResolved($params)
{
if (!isset($params['issue_person_id']) || !is_numeric($params['issue_person_id']))
return error('Person Id missing, issue_id: '.$params['issue_id']);
$this->_ci =& get_instance(); // get code igniter instance
$this->_ci->load->model('codex/Uhstat1daten_model', 'UhstatModel');
$personRes = $this->_ci->UhstatModel->getUHSTAT1PersonData([$params['issue_person_id']]);
if (isError($personRes)) return $personRes;
if (hasData($personRes))
{
// get person data
$personData = getData($personRes)[0];
// if person identification data present, issue is resolved
return success(
!isEmptyString($personData->ersatzkennzeichen)
|| (!isEmptyString($personData->vbpkAs) && !isEmptyString($personData->vbpkBf))
);
}
else
return success(false); // if no person found, not resolved
}
}
@@ -131,6 +131,11 @@ class VertragsbestandteilLib
return $this->VertragsbestandteilModel->getVertragsbestandteil($vertragsbestandteil_id);
}
public function fetchLastVertragsbestandteilStundenBeforeAltersteilzeit($dienstverhaeltnis_id)
{
return $this->VertragsbestandteilModel->getLastVertragsbestanteilStundenBeforeAltersteilzeit($dienstverhaeltnis_id);
}
public function storeDienstverhaeltnis(Dienstverhaeltnis $dv)
{
if( intval($dv->getDienstverhaeltnis_id()) > 0 )
@@ -11,4 +11,44 @@ class Uhstat1daten_model extends DB_Model
$this->dbTable = 'bis.tbl_uhstat1daten';
$this->pk = 'uhstat1daten_id';
}
/**
* Gets person data needed for sending as UHSTAT1 data.
* @param array $person_id_arr
* @param string $studiensemester
* @param array $status_kurzbz
* @return object success with prestudents or error
*/
public function getUHSTAT1PersonData($person_id_arr)
{
if (!isset($person_id_arr) || isEmptyArray($person_id_arr)) return success([]);
$params = array($person_id_arr);
$prstQry = "SELECT
DISTINCT ON (pers.person_id)
pers.person_id, uhstat_daten.uhstat1daten_id, pers.svnr, pers.ersatzkennzeichen, pers.geburtsnation,
uhstat_daten.mutter_geburtsstaat, uhstat_daten.mutter_bildungsstaat, uhstat_daten.mutter_geburtsjahr,
uhstat_daten.mutter_bildungmax, uhstat_daten.vater_geburtsstaat, uhstat_daten.vater_bildungsstaat,
uhstat_daten.vater_geburtsjahr, uhstat_daten.vater_bildungmax,
kzVbpkAs.inhalt AS \"vbpkAs\", kzVbpkBf.inhalt AS \"vbpkBf\"
FROM
public.tbl_person pers
JOIN public.tbl_prestudent ps USING (person_id)
JOIN public.tbl_studiengang stg USING (studiengang_kz)
JOIN bis.tbl_uhstat1daten uhstat_daten USING (person_id)
LEFT JOIN public.tbl_kennzeichen kzVbpkAs ON kzVbpkAs.kennzeichentyp_kurzbz = 'vbpkAs'AND kzVbpkAs.person_id = pers.person_id AND kzVbpkAs.aktiv
LEFT JOIN public.tbl_kennzeichen kzVbpkBf ON kzVbpkBf.kennzeichentyp_kurzbz = 'vbpkBf'AND kzVbpkBf.person_id = pers.person_id AND kzVbpkBf.aktiv
WHERE
ps.bismelden
AND stg.melderelevant
AND pers.person_id IN ?
ORDER BY
pers.person_id";
return $this->execReadOnlyQuery(
$prstQry,
$params
);
}
}
+28 -8
View File
@@ -677,7 +677,7 @@ class Prestudent_model extends DB_Model
));
}
public function getPrestudentByStudiengangAndPerson($studiengang, $person, $studienSemester, $abgeschickt)
public function getPrestudentByStudiengangAndPerson($studiengang, $person, $studienSemester, $abgeschickt, $ignoreAbgeschickt = false)
{
$query = "SELECT ps.prestudent_id
FROM public.tbl_prestudentstatus pss
@@ -687,22 +687,42 @@ class Prestudent_model extends DB_Model
JOIN lehre.tbl_studienordnung so USING(studienordnung_id)
WHERE ps.person_id = ?
AND UPPER(so.studiengangkurzbzlang || ':' || sp.orgform_kurzbz) = ?
AND pss.studiensemester_kurzbz = ?
AND";
AND pss.studiensemester_kurzbz = ?";
if ($abgeschickt === 'true')
$query .= " EXISTS";
else
$query .= " NOT EXISTS";
if (!$ignoreAbgeschickt)
{
$query .= "AND";
$query .= " (SELECT 1 FROM public.tbl_prestudentstatus spss
if ($abgeschickt === 'true')
$query .= " EXISTS";
else
$query .= " NOT EXISTS";
$query .= " (SELECT 1 FROM public.tbl_prestudentstatus spss
JOIN public.tbl_prestudent sps USING(prestudent_id)
WHERE sps.prestudent_id = ps.prestudent_id
AND spss.bewerbung_abgeschicktamum IS NOT NULL)";
}
return $this->execQuery($query, array($person, $studiengang, $studienSemester));
}
public function getByPersonWithoutLehrgang($person, $studienSemester)
{
$query = "SELECT DISTINCT(ps.prestudent_id)
FROM public.tbl_prestudentstatus pss
JOIN public.tbl_prestudent ps USING(prestudent_id)
JOIN public.tbl_studiengang sg USING(studiengang_kz)
JOIN lehre.tbl_studienplan sp USING(studienplan_id)
JOIN lehre.tbl_studienordnung so USING(studienordnung_id)
WHERE ps.person_id = ?
AND (sg.typ = 'b' OR sg.typ = 'm')
AND pss.studiensemester_kurzbz = ?";
return $this->execQuery($query, array($person, $studienSemester));
}
/**
* Gets förderrelevant flag for a prestudent, from prestudent, or, if not set on prestudent level, from studiengang
* @param int $prestudent_id
@@ -183,6 +183,46 @@ EOSQL;
return $vbcount[0]->overlappingvbs;
}
public function getLastVertragsbestanteilStundenBeforeAltersteilzeit($dienstverhaeltnis_id)
{
$sql = <<<EOATZSQL
select
*
from
hr.tbl_vertragsbestandteil vb
join
hr.tbl_vertragsbestandteil_stunden vbs USING(vertragsbestandteil_id)
where
vb.dienstverhaeltnis_id = ?
and (
vbs.teilzeittyp_kurzbz != 'altersteilzeit'
or
vbs.teilzeittyp_kurzbz is NULL
)
order by
vb.bis desc
limit 1
EOATZSQL;
$query = $this->execReadOnlyQuery($sql, array($dienstverhaeltnis_id));
$data = getData($query);
if ($data == null)
{
return null;
}
$vertragsbestandteil = null;
try
{
$vertragsbestandteil = VertragsbestandteilFactory::getVertragsbestandteil($data[0], true);
}
catch (Exception $ex)
{
echo $ex->getMessage() . "\n";
}
return $vertragsbestandteil;
}
/**
* Checks if sap sync table exists.
* @return bool
@@ -14,12 +14,13 @@
'navigationwidget' => true,
'dialoglib' => true,
'phrases' => array(
'infocenter' => array('statusAuswahl'),
'person' => array('vorname', 'nachname'),
'global' => array('mailAnXversandt'),
'ui' => array('bitteEintragWaehlen')
),
'customCSSs' => array('public/css/sbadmin2/tablesort_bootstrap.css', 'public/css/infocenter/infocenterPersonDataset.css'),
'customJSs' => array('public/js/bootstrapper.js', 'public/js/infocenter/infocenterPersonDataset.js')
'customJSs' => array('public/js/bootstrapper.js', 'public/js/infocenter/rueckstellung.js', 'public/js/infocenter/infocenterPersonDataset.js')
);
$this->load->view('templates/FHC-Header', $includesArray);
@@ -20,7 +20,7 @@
'ui' => array('bitteEintragWaehlen')
),
'customCSSs' => array('public/css/sbadmin2/tablesort_bootstrap.css', 'public/css/infocenter/infocenterPersonDataset.css'),
'customJSs' => array('public/js/bootstrapper.js', 'public/js/infocenter/infocenterPersonDataset.js')
'customJSs' => array('public/js/bootstrapper.js', 'public/js/infocenter/rueckstellung.js', 'public/js/infocenter/infocenterPersonDataset.js')
)
);
?>
@@ -20,7 +20,7 @@
'ui' => array('bitteEintragWaehlen')
),
'customCSSs' => array('public/css/sbadmin2/tablesort_bootstrap.css', 'public/css/infocenter/infocenterPersonDataset.css'),
'customJSs' => array('public/js/bootstrapper.js', 'public/js/infocenter/infocenterPersonDataset.js')
'customJSs' => array('public/js/bootstrapper.js', 'public/js/infocenter/rueckstellung.js', 'public/js/infocenter/infocenterPersonDataset.js')
)
);
?>
@@ -20,7 +20,7 @@
'ui' => array('bitteEintragWaehlen')
),
'customCSSs' => array('public/css/sbadmin2/tablesort_bootstrap.css', 'public/css/infocenter/infocenterPersonDataset.css'),
'customJSs' => array('public/js/bootstrapper.js', 'public/js/infocenter/infocenterPersonDataset.js')
'customJSs' => array('public/js/bootstrapper.js', 'public/js/infocenter/rueckstellung.js', 'public/js/infocenter/infocenterPersonDataset.js')
)
);
?>
@@ -20,7 +20,7 @@
'ui' => array('bitteEintragWaehlen')
),
'customCSSs' => array('public/css/sbadmin2/tablesort_bootstrap.css', 'public/css/infocenter/infocenterPersonDataset.css'),
'customJSs' => array('public/js/bootstrapper.js', 'public/js/infocenter/infocenterPersonDataset.js')
'customJSs' => array('public/js/bootstrapper.js', 'public/js/infocenter/rueckstellung.js', 'public/js/infocenter/infocenterPersonDataset.js')
)
);
?>
+48 -34
View File
@@ -1,11 +1,21 @@
<?php
$PERSON_ID = getAuthPersonId();
// all oe kurzbz for which logged user has a funktion
$ALL_FUNKTIONEN_OE_KURZBZ = "('" . implode("','", array_keys($all_funktionen_oe_kurzbz)) . "')";
$ALL_FUNKTIONEN_OE_KURZBZ = isEmptyArray($all_funktionen_oe_kurzbz) ? "(NULL)"
: "(" . implode(",", array_map(function($string) { return $this->db->escape($string); }, array_keys($all_funktionen_oe_kurzbz))) . ")";
// all oes for which logged user has issues permissions, including permissions for "special" issue funktion
$ALL_OE_KURZBZ_BERECHTIGT = "('" . implode("','", $all_oe_kurzbz_berechtigt) . "')";
$RELEVANT_PRESTUDENT_STATUS = "('Aufgenommener', 'Student', 'Incoming', 'Diplomand', 'Abbrecher', 'Unterbrecher', 'Absolvent')";
$ALL_OE_KURZBZ_BERECHTIGT = isEmptyArray($all_oe_kurzbz_berechtigt) ? "(NULL)"
: "(" . implode(",", array_map(function($string) { return $this->db->escape($string); }, $all_oe_kurzbz_berechtigt)) . ")";
// app apps for which issues should be displayed
$APPS = isEmptyArray($apps) ? "" : "(" . implode(",", array_map(function($string) { return $this->db->escape($string); }, $apps)) . ")";
// all prestudent status for which issues should be displayed
$RELEVANT_PRESTUDENT_STATUS = isEmptyArray($status) ? ""
: "(" . implode(",", array_map(function($string) { return $this->db->escape($string); }, $status)) . ")";
// get issues for the oes of the logged user or for the persons (students, oe-zuordnung) of the oes
$query = "WITH zustaendigkeiten AS (
@@ -37,8 +47,8 @@ $query .= "
SELECT
issue_id, fehlercode AS \"Fehlercode\", fehler_kurzbz AS \"Fehler Kurzbezeichnung\", iss.fehlercode_extern AS \"Fehlercode extern\", datum AS \"Datum\",
inhalt AS \"Inhalt\", inhalt_extern AS \"Inhalt extern\", iss.person_id AS \"PersonId\", iss.oe_kurzbz AS \"OE\",
ftyp.bezeichnung_mehrsprachig[".$language_index."] AS \"Fehlertyp\",
stat.bezeichnung_mehrsprachig[".$language_index."] AS \"Fehlerstatus\",
ftyp.bezeichnung_mehrsprachig[".$this->db->escape($language_index)."] AS \"Fehlertyp\",
stat.bezeichnung_mehrsprachig[".$this->db->escape($language_index)."] AS \"Fehlerstatus\",
verarbeitetvon AS \"Verarbeitet von\",verarbeitetamum AS \"Verarbeitet am\", fr.app AS \"Applikation\",
fr.fehlertyp_kurzbz AS \"Fehlertypcode\", iss.status_kurzbz AS \"Statuscode\",
pers.vorname AS \"Vorname\", pers.nachname AS \"Nachname\",
@@ -118,44 +128,48 @@ $query .= "
JOIN system.tbl_issue_status stat USING (status_kurzbz)
LEFT JOIN public.tbl_person pers ON iss.person_id = pers.person_id
WHERE
fr.app IN ('core', 'dvuh')
AND (
(
EXISTS ( /* if oe or person is specified in fehler_zustaendigkeiten */
SELECT 1 FROM zustaendigkeiten
WHERE fehlercode = iss.fehlercode
AND zustaendig = TRUE)";
// show issue if it is assigend to oe of logged in user or to student of oe of logged in user
if (!isEmptyArray($all_oe_kurzbz_berechtigt))
{
$query .= " OR iss.oe_kurzbz IN $ALL_OE_KURZBZ_BERECHTIGT /* if issue is for oe */";
$query .= " OR iss.oe_kurzbz IN $ALL_OE_KURZBZ_BERECHTIGT /* if issue is for oe */";
$query .= " OR (iss.oe_kurzbz IS NULL AND EXISTS ( /* if person_id of issue is a student of studiengang oe */
SELECT 1 FROM public.tbl_prestudent ps
JOIN public.tbl_prestudentstatus pss USING (prestudent_id)
JOIN public.tbl_studiengang stg USING (studiengang_kz)
WHERE person_id = iss.person_id
AND stg.oe_kurzbz IN ".$ALL_OE_KURZBZ_BERECHTIGT;
if (!isEmptyString($RELEVANT_PRESTUDENT_STATUS)) $query .= " AND pss.status_kurzbz IN ".$RELEVANT_PRESTUDENT_STATUS;
$query .= " AND NOT EXISTS (SELECT 1 /* irrelevant if already finished studies and studied a while ago */
FROM public.tbl_prestudentstatus ps_finished
JOIN public.tbl_studiensemester sem_finished USING (studiensemester_kurzbz)
WHERE prestudent_id = ps.prestudent_id
AND status_kurzbz IN ('Absolvent','Abbrecher','Abgewiesener')
AND datum::date + interval '2 months' < NOW()
AND EXISTS (SELECT 1 FROM public.tbl_prestudent /* if more recent prestudent exists, still display the issue */
JOIN public.tbl_prestudentstatus USING (prestudent_id)
JOIN public.tbl_studiensemester USING (studiensemester_kurzbz)
WHERE person_id = ps.person_id
AND prestudent_id <> ps_finished.prestudent_id
AND tbl_studiensemester.start::date > sem_finished.start::date";
if (!isEmptyString($RELEVANT_PRESTUDENT_STATUS)) $query .= " AND tbl_prestudentstatus.status_kurzbz IN ".$RELEVANT_PRESTUDENT_STATUS;
$query .= ")
)
)
)";
$query .= " OR (iss.oe_kurzbz IS NULL AND EXISTS ( /* if person_id of issue is a student of studiengang oe */
SELECT 1 FROM public.tbl_prestudent ps
JOIN public.tbl_prestudentstatus pss USING (prestudent_id)
JOIN public.tbl_studiengang stg USING (studiengang_kz)
WHERE person_id = iss.person_id
AND stg.oe_kurzbz IN $ALL_OE_KURZBZ_BERECHTIGT
AND pss.status_kurzbz IN $RELEVANT_PRESTUDENT_STATUS
AND NOT EXISTS (SELECT 1 /* irrelevant if already finished studies and studied a while ago */
FROM public.tbl_prestudentstatus ps_finished
JOIN public.tbl_studiensemester sem_finished USING (studiensemester_kurzbz)
WHERE prestudent_id = ps.prestudent_id
AND status_kurzbz IN ('Absolvent','Abbrecher','Abgewiesener')
AND datum::date + interval '2 months' < NOW()
AND EXISTS (SELECT 1 FROM public.tbl_prestudent /* if more recent prestudent exists, still display the issue */
JOIN public.tbl_prestudentstatus USING (prestudent_id)
JOIN public.tbl_studiensemester USING (studiensemester_kurzbz)
WHERE tbl_prestudentstatus.status_kurzbz IN $RELEVANT_PRESTUDENT_STATUS
AND person_id = ps.person_id
AND prestudent_id <> ps_finished.prestudent_id
AND tbl_studiensemester.start::date > sem_finished.start::date)
)
)
)";
}
$query .= ") ";
if (!isEmptyString($APPS)) $query .= " AND fr.app IN ".$APPS;
$query .= " ORDER BY
CASE
WHEN fehlertyp_kurzbz = '".IssuesLib::ERRORTYPE_CODE."' THEN 0