diff --git a/application/config/issueList.php b/application/config/issueList.php
new file mode 100644
index 000000000..e4e4f278c
--- /dev/null
+++ b/application/config/issueList.php
@@ -0,0 +1,11 @@
+ self::PERM_LOGGED,
+ 'getNext' => self::PERM_LOGGED
+ )
+ );
+ // Load model StudiensemesterModel
+ $this->load->model('organisation/studienjahr_model', 'StudienjahrModel');
+ }
+
+ /**
+ * Get all Studienjahre.
+ *
+ * @param null|string $order Sorting order for the Studienjahr, 'asc' or 'desc'. Defaults to 'asc'.
+ * @param null|string $start Starting Studienjahre with given studienjahr_kurzbz
+ */
+ public function getAll()
+ {
+ $order = $this->input->get('order');
+ $start = $this->input->get('studienjahr_kurzbz');
+
+ if (strcasecmp($order, 'DESC') == 0) {
+ $this->StudienjahrModel->addOrder('studienjahr_kurzbz', 'DESC');
+ } else {
+ $this->StudienjahrModel->addOrder('studienjahr_kurzbz', 'ASC');
+ }
+
+ if ($start) {
+ $result = $this->StudienjahrModel->loadWhere([
+ 'studienjahr_kurzbz >= ' => $start
+ ]);
+ } else {
+ $result = $this->StudienjahrModel->load();
+ }
+
+ if (isError($result)) {
+ $this->terminateWithError(getError($result), self::ERROR_TYPE_DB);
+ }
+
+ $this->terminateWithSuccess((getData($result) ?: []));
+ }
+
+ public function getNext()
+ {
+ $this->StudienjahrModel->addJoin('public.tbl_studiensemester', 'studienjahr_kurzbz');
+ $this->StudienjahrModel->addOrder('start');
+ $this->StudienjahrModel->addLimit(1);
+
+ $result = $this->StudienjahrModel->loadWhere(['start >' => 'NOW()']);
+
+ if (isError($result)) {
+ $this->terminateWithError(getError($result), self::ERROR_TYPE_DB);
+ }
+
+ $this->terminateWithSuccess(current(getData($result)));
+ }
+}
diff --git a/application/controllers/api/frontend/v1/organisation/Studiensemester.php b/application/controllers/api/frontend/v1/organisation/Studiensemester.php
index 72a449aaa..bb56ea71a 100644
--- a/application/controllers/api/frontend/v1/organisation/Studiensemester.php
+++ b/application/controllers/api/frontend/v1/organisation/Studiensemester.php
@@ -24,7 +24,8 @@ class Studiensemester extends FHCAPI_Controller
parent::__construct(
array(
'getAll' => self::PERM_LOGGED,
- 'getAktNext' => self::PERM_LOGGED
+ 'getAktNext' => self::PERM_LOGGED,
+ 'getStudienjahrByStudiensemester' => self::PERM_LOGGED
)
);
// Load model StudiensemesterModel
@@ -115,4 +116,40 @@ class Studiensemester extends FHCAPI_Controller
$this->terminateWithSuccess((getData($result) ?: ''));
}
+
+ /**
+ * Get Studienjahr by Studiensemester.
+ * input param semester: studiensemester_kurzbz
+ */
+ public function getStudienjahrByStudiensemester()
+ {
+ $semester = $this->input->get('semester');
+
+ $studienjahrObj = null;
+
+ if (!is_numeric($semester))
+ {
+ $this->StudiensemesterModel->addSelect('studienjahr_kurzbz');
+ $result = $this->StudiensemesterModel->loadWhere(array('studiensemester_kurzbz =' => $semester));
+ }
+
+ if (hasData($result))
+ {
+ $studienjahr = getData($result)[0]->studienjahr_kurzbz;
+ $startstudienjahr = substr($studienjahr, 0, 4);
+ $endstudienjahr = substr($studienjahr, 0, 2) . substr($studienjahr, -2);
+
+ $studienjahrObj = new StdClass();
+
+ $studienjahrObj->studienjahr_kurzbz = $studienjahr;
+ $studienjahrObj->startstudienjahr = $startstudienjahr;
+ $studienjahrObj->endstudienjahr= $endstudienjahr;
+ }
+
+ if (isError($result)) {
+ $this->terminateWithError(getError($result), self::ERROR_TYPE_DB);
+ }
+
+ $this->terminateWithSuccess((getData(success($studienjahrObj))));
+ }
}
diff --git a/application/controllers/api/frontend/v1/stv/Kontakt.php b/application/controllers/api/frontend/v1/stv/Kontakt.php
index fd16fff06..bcd38853c 100644
--- a/application/controllers/api/frontend/v1/stv/Kontakt.php
+++ b/application/controllers/api/frontend/v1/stv/Kontakt.php
@@ -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
diff --git a/application/controllers/api/frontend/v1/stv/Student.php b/application/controllers/api/frontend/v1/stv/Student.php
index f805be88a..f24ef62bb 100644
--- a/application/controllers/api/frontend/v1/stv/Student.php
+++ b/application/controllers/api/frontend/v1/stv/Student.php
@@ -156,6 +156,8 @@ class Student extends FHCAPI_Controller
$uid = $student ? current($student)->student_uid : null;
+ $studiengang_kz = $student ? current($student)->studiengang_kz : null;
+
$result = $this->PrestudentModel->loadWhere(['prestudent_id' => $prestudent_id]);
$person = $this->getDataOrTerminateWithError($result);
@@ -231,10 +233,27 @@ class Student extends FHCAPI_Controller
// Do Updates
if (count($update_lehrverband)) {
- $result = $this->StudentlehrverbandModel->update([
+ $curstudlvb = $this->StudentlehrverbandModel->load([
'studiensemester_kurzbz' => $studiensemester_kurzbz,
'student_uid' => $uid
- ], $update_lehrverband);
+ ]);
+
+ if(hasData($curstudlvb) && count(getData($curstudlvb)) > 0 )
+ {
+ $result = $this->StudentlehrverbandModel->update([
+ 'studiensemester_kurzbz' => $studiensemester_kurzbz,
+ 'student_uid' => $uid
+ ], $update_lehrverband);
+ }
+ else
+ {
+ $result = $this->StudentlehrverbandModel->insert(array_merge([
+ 'studiensemester_kurzbz' => $studiensemester_kurzbz,
+ 'student_uid' => $uid,
+ 'studiengang_kz' => $studiengang_kz
+ ], $update_lehrverband));
+ }
+
$this->getDataOrTerminateWithError($result);
}
diff --git a/application/controllers/jobs/IssueResolver.php b/application/controllers/jobs/IssueResolver.php
index ca07439c3..fe7ee21f5 100755
--- a/application/controllers/jobs/IssueResolver.php
+++ b/application/controllers/jobs/IssueResolver.php
@@ -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
diff --git a/application/controllers/jobs/OneTimeMessages.php b/application/controllers/jobs/OneTimeMessages.php
index 525f63c3b..0e49ca8a5 100644
--- a/application/controllers/jobs/OneTimeMessages.php
+++ b/application/controllers/jobs/OneTimeMessages.php
@@ -52,6 +52,7 @@ class OneTimeMessages extends JOB_Controller
JOIN public.tbl_prestudentstatus ps USING (prestudent_id)
JOIN public.tbl_studiengang s USING (studiengang_kz)
WHERE get_rolle_prestudent(ps.prestudent_id, NULL) = \'Wartender\'
+ AND ps.status_kurzbz = \'Wartender\'
AND ps.studiensemester_kurzbz = ?
AND ps.datum <= NOW() - \''.$days.' days\'::interval
AND s.typ = ?
diff --git a/application/controllers/system/infocenter/InfoCenter.php b/application/controllers/system/infocenter/InfoCenter.php
index f6e41d2e6..57aca0876 100644
--- a/application/controllers/system/infocenter/InfoCenter.php
+++ b/application/controllers/system/infocenter/InfoCenter.php
@@ -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");
diff --git a/application/controllers/system/infocenter/Rueckstellung.php b/application/controllers/system/infocenter/Rueckstellung.php
index 62af633ca..b1f2b60b7 100644
--- a/application/controllers/system/infocenter/Rueckstellung.php
+++ b/application/controllers/system/infocenter/Rueckstellung.php
@@ -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');
diff --git a/application/controllers/system/issues/Issues.php b/application/controllers/system/issues/Issues.php
index 44c2ff5d3..27a928fb4 100644
--- a/application/controllers/system/issues/Issues.php
+++ b/application/controllers/system/issues/Issues.php
@@ -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;
diff --git a/application/helpers/hlp_header_helper.php b/application/helpers/hlp_header_helper.php
index 14f7ed338..de7e866f4 100644
--- a/application/helpers/hlp_header_helper.php
+++ b/application/helpers/hlp_header_helper.php
@@ -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";
diff --git a/application/libraries/AntragLib.php b/application/libraries/AntragLib.php
index 885acac90..d90a98241 100644
--- a/application/libraries/AntragLib.php
+++ b/application/libraries/AntragLib.php
@@ -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);
diff --git a/application/libraries/PermissionLib.php b/application/libraries/PermissionLib.php
index c6e693666..42502f999 100644
--- a/application/libraries/PermissionLib.php
+++ b/application/libraries/PermissionLib.php
@@ -109,7 +109,7 @@ class PermissionLib
foreach($oe_kurzbz as $value)
{
- $results[] = $this->isBerechtigt($berechtigung_kurzbz, $value, $art, $kostenstelle_id);
+ $results[] = $this->isBerechtigt($berechtigung_kurzbz, $art, $value, $kostenstelle_id);
}
if(!in_array(true, $results))
diff --git a/application/libraries/issues/PlausicheckResolverLib.php b/application/libraries/issues/PlausicheckResolverLib.php
index 26da985f6..2b20a7d93 100644
--- a/application/libraries/issues/PlausicheckResolverLib.php
+++ b/application/libraries/issues/PlausicheckResolverLib.php
@@ -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,
diff --git a/application/libraries/issues/resolvers/CORE_PERSON_0005.php b/application/libraries/issues/resolvers/CORE_PERSON_0005.php
new file mode 100644
index 000000000..1d768e70c
--- /dev/null
+++ b/application/libraries/issues/resolvers/CORE_PERSON_0005.php
@@ -0,0 +1,36 @@
+_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
+ }
+}
\ No newline at end of file
diff --git a/application/libraries/issues/resolvers/CORE_PERSON_0006.php b/application/libraries/issues/resolvers/CORE_PERSON_0006.php
new file mode 100644
index 000000000..8b7ff9c56
--- /dev/null
+++ b/application/libraries/issues/resolvers/CORE_PERSON_0006.php
@@ -0,0 +1,37 @@
+_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
+ }
+}
\ No newline at end of file
diff --git a/application/models/codex/Uhstat1daten_model.php b/application/models/codex/Uhstat1daten_model.php
index 9bca44b58..899f037ef 100644
--- a/application/models/codex/Uhstat1daten_model.php
+++ b/application/models/codex/Uhstat1daten_model.php
@@ -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
+ );
+ }
}
diff --git a/application/models/crm/Prestudent_model.php b/application/models/crm/Prestudent_model.php
index 242c26518..ff56c3268 100644
--- a/application/models/crm/Prestudent_model.php
+++ b/application/models/crm/Prestudent_model.php
@@ -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
diff --git a/application/models/education/Lehrveranstaltung_model.php b/application/models/education/Lehrveranstaltung_model.php
index 0a48965b5..056fb45d7 100644
--- a/application/models/education/Lehrveranstaltung_model.php
+++ b/application/models/education/Lehrveranstaltung_model.php
@@ -16,145 +16,21 @@ class Lehrveranstaltung_model extends DB_Model
}
/**
- * Get Lehrveranstaltungen by eventQuery string. Use with autocomplete event queries.
- * @param $eventQuery String
- * @param string $studiensemester_kurzbz Filter by Studiensemester
- * @param array $oes Filter by Organisationseinheiten
- * @return array
- */
- public function getAutocompleteSuggestions($eventQuery, $studiensemester_kurzbz = null, $oes = null)
- {
- $subQry = $this->_getQryLvsByStudienplan($studiensemester_kurzbz, $oes);
- $params = [];
-
- /* filter by input string */
- if (is_string($eventQuery)) {
- $subQry.= ' AND lv.bezeichnung ILIKE ?';
- $params[] = '%' . $eventQuery . '%';
- }
-
- $qry = 'SELECT DISTINCT ON (lehrveranstaltung_id) * FROM ('. $subQry. ') AS tmp';
-
- return $this->execQuery($qry, $params);
- }
-
- /**
- * Get Lehrveranstaltungen with its Stg, OE and OE-type.
- * Filter by Studiensemester and Organisationseinheiten if necessary.
- * @param $eventQuery String
- * @param string $studiensemester_kurzbz Filter by Studiensemester
- * @param array $oes Filter by Organisationseinheiten
- * @param array $lv_ids Filter by Lehrveranstaltung-Ids
- * @return array
- */
- public function getLvsByStudienplan($studiensemester_kurzbz = null, $oes = null, $lv_ids = null)
- {
- $subQry = $this->_getQryLvsByStudienplan($studiensemester_kurzbz, $oes);
- $qry = 'SELECT * FROM ('. $subQry. ') AS tmp';
-
- if (isset($lv_ids) && is_array($lv_ids))
- {
- /* filter by lv_ids */
- $implodedLvIds = "'". implode("', '", $lv_ids). "'";
- $qry.= ' WHERE lehrveranstaltung_id IN ('. $implodedLvIds. ')';
- }
-
- $qry.= ' ORDER BY stg_typ_kurzbz, orgform_kurzbz DESC';
-
- return $this->execQuery($qry);
- }
-
- /**
- * Get basic query to retrieve Lehrveranstaltungen according to the Orgforms and Ausbildungssemesters actual Studienplan.
- *
- * @return string
- */
- private function _getQryLvsByStudienplan($studiensemester_kurzbz = null, $oes = null, $lehrtyp_kurzbz = 'lv')
- {
- $qry = '
- SELECT
- lv.oe_kurzbz AS lv_oe_kurzbz,
- CASE
- WHEN oe.organisationseinheittyp_kurzbz = \'Kompetenzfeld\' THEN (\'KF \' || oe.bezeichnung)
- WHEN oe.organisationseinheittyp_kurzbz = \'Department\' THEN (\'DEP \' || oe.bezeichnung)
- ELSE (oe.organisationseinheittyp_kurzbz || \' \' || oe.bezeichnung)
- END AS lv_oe_bezeichnung,
- stplsem.studiensemester_kurzbz,
- studienordnung_id,
- sto.studiengang_kz,
- stpl.studienplan_id,
- stplsem.semester,
- stpl.orgform_kurzbz,
- upper(stg.typ || stg.kurzbz) AS stg_typ_kurzbz,
- stg.bezeichnung AS stg_bezeichnung,
- stgtyp.bezeichnung AS stg_typ_bezeichnung,
- lv.lehrveranstaltung_id,
- lv.semester,
- lv.bezeichnung AS lv_bezeichnung,
- (
- -- comma seperated string of all lehreinheitgruppen
- SELECT string_agg(bezeichnung, \', \') AS lehreinheitgruppe_bezeichnung
- FROM(
- -- distinct bezeichnung, as may come multiple times from different lehreinheiten
- SELECT DISTINCT ON (studiengang_kz, bezeichnung) studiengang_kz, bezeichnung FROM
- (
- -- distinct lehreinheitgruppe, as may come multiple times from different lehrform
- SELECT DISTINCT ON (legr.lehreinheitgruppe_id) legr.studiengang_kz,
- -- get Spezialgruppe or Lehrverbandgruppe
- COALESCE(
- legr.gruppe_kurzbz,
- CONCAT( UPPER(stg1.typ), UPPER(stg1.kurzbz), \'-\', legr.semester, legr.verband, legr.gruppe )
- ) as bezeichnung
- FROM lehre.tbl_lehreinheitgruppe legr
- JOIN lehre.tbl_lehreinheit le USING (lehreinheit_id)
- JOIN lehre.tbl_lehrveranstaltung lv1 USING (lehrveranstaltung_id)
- JOIN public.tbl_studiengang stg1 ON stg1.studiengang_kz = legr.studiengang_kz
- WHERE lv1.lehrveranstaltung_id = lv.lehrveranstaltung_id
- AND le.studiensemester_kurzbz = stplsem.studiensemester_kurzbz
- ) AS lehreinheitgruppen
- GROUP BY studiengang_kz, bezeichnung
- ORDER BY studiengang_kz DESC
- ) AS uniqueLehreinheitgruppen_bezeichnung
- ) AS lehreinheitgruppen_bezeichnung
- FROM
- lehre.tbl_studienplan stpl
- JOIN lehre.tbl_studienordnung sto USING (studienordnung_id)
- JOIN lehre.tbl_studienplan_semester stplsem USING (studienplan_id)
- JOIN lehre.tbl_studienplan_lehrveranstaltung stpllv ON (stpllv.studienplan_id = stpl.studienplan_id AND stpllv.semester = stplsem.semester)
- JOIN lehre.tbl_lehrveranstaltung lv USING (lehrveranstaltung_id)
- JOIN public.tbl_organisationseinheit oe USING (oe_kurzbz)
- JOIN public.tbl_studiengang stg ON stg.studiengang_kz = sto.studiengang_kz
- JOIN public.tbl_studiengangstyp stgtyp ON stgtyp.typ = stg.typ
- /* filter by lehrtyp_kurzbz, default is lvs only */
- WHERE
- lehrtyp_kurzbz = '. $this->db->escape($lehrtyp_kurzbz);
-
- if (isset($studiensemester_kurzbz) && is_string($studiensemester_kurzbz))
- {
- /* filter by studiensemester */
- $qry.= ' AND stplsem.studiensemester_kurzbz = '. $this->db->escape($studiensemester_kurzbz);
-
- }
-
- if (isset($oes) && is_array($oes))
- {
- /* filter by organisationseinheit */
- $implodedOes = "'". implode("', '", $oes). "'";
- $qry.= ' AND lv.oe_kurzbz IN ('. $implodedOes. ')';
- }
-
- return $qry;
- }
-
- /**
- * Get all Templates and union with all Lehrveranstaltungen of given Studiensemester and Oes, that are assigned to
- * a template. This data structure can be used for nested tabulator data tree.
+ * Get all Templates and its assigned Lehrveranstaltungen of given Studiensemester and Oes.
+ * Lvs are queried via actual Studienordnung and Studienplan.
*
* @param null|string $studiensemester_kurzbz
* @param null|array $oes
+ * @param null $lehrveranstaltung_id Queries certain LV only
* @return array|stdClass|null
*/
- public function getTemplateLvTree($studiensemester_kurzbz = null, $oes = null){
+ public function getTemplateLvTree($studiensemester_kurzbz = null, $oes = null, $studienjahr_kurzbz = null){
+
+ if (is_string($studiensemester_kurzbz) && is_string($studienjahr_kurzbz))
+ {
+ return error('Query not possible for both studiensemester and studienjahr');
+ }
+
$params = [];
$qry = '
WITH
@@ -189,6 +65,17 @@ class Lehrveranstaltung_model extends DB_Model
}
+ if (is_string($studienjahr_kurzbz)) {
+ /* filter by studiensemester */
+ $params[] = $studienjahr_kurzbz;
+ $qry .= '
+ AND stplsem.studiensemester_kurzbz IN (
+ SELECT studiensemester_kurzbz
+ FROM public.tbl_studiensemester
+ WHERE studienjahr_kurzbz = ?
+ )';
+ }
+
if (is_array($oes))
{
/* filter by organisationseinheit */
@@ -300,7 +187,15 @@ class Lehrveranstaltung_model extends DB_Model
JOIN public.tbl_studiengangstyp stgtyp ON stgtyp.typ = stg.typ
JOIN public.tbl_organisationseinheit oe ON oe.oe_kurzbz = lv.oe_kurzbz
ORDER BY
- oe.bezeichnung, lv.semester, lv.bezeichnung
+ -- Sort by lv.bezeichnung
+ lv.bezeichnung,
+ -- Within each group, ensure templates appear first
+ CASE
+ WHEN lv.lehrtyp_kurzbz = \'tpl\' THEN 0
+ ELSE 1
+ END,
+ -- Ensure assigend lvs follow their template, grouped by lehrveranstaltung_template_id
+ COALESCE(lv.lehrveranstaltung_template_id, lv.lehrveranstaltung_id)
';
return $this->execQuery($qry, $params);
@@ -811,6 +706,28 @@ class Lehrveranstaltung_model extends DB_Model
return $this->execQuery($qry);
}
+ /**
+ * Check if given LV is a template (Quellkurs)
+ *
+ * @param $lehrveranstaltung_id
+ * @return array|stdClass|void
+ */
+ public function checkIsTemplate($lehrveranstaltung_id)
+ {
+ $this->addSelect('lehrtyp_kurzbz, lehrveranstaltung_template_id');
+ $result = $this->load($lehrveranstaltung_id);
+
+ if (isError($result))
+ return error(getError($result));
+
+ if (hasData($result))
+ {
+ return success(
+ getData($result)[0]->lehrtyp_kurzbz === 'tpl' &&
+ getData($result)[0]->lehrveranstaltung_template_id === null
+ );
+ }
+ }
/**
* Get ECTS Summe pro angerechnetes Quereinstiegssemester.
diff --git a/application/models/organisation/Studienjahr_model.php b/application/models/organisation/Studienjahr_model.php
index a6e1bc575..1686ddc48 100644
--- a/application/models/organisation/Studienjahr_model.php
+++ b/application/models/organisation/Studienjahr_model.php
@@ -1,4 +1,5 @@
execQuery($query);
}
+ public function getNextStudienjahr()
+ {
+ $this->addJoin('public.tbl_studiensemester', 'studienjahr_kurzbz');
+ $this->addOrder('start');
+ $this->addLimit(1);
+
+ return $this->loadWhere(['start >' => 'NOW()']);
+ }
+ public function getNextFrom($studienjahr_kurzbz)
+ {
+ $this->addLimit(1);
+
+ return $this->loadWhere([
+ 'studienjahr_kurzbz >' => $studienjahr_kurzbz
+ ]);
+ }
/**
* Get the current Studienjahr. During the summer term, continue using the previous Studienjahr.
@@ -38,8 +55,7 @@ class Studienjahr_model extends DB_Model
*/
public function getLastOrAktStudienjahr($days = 60)
{
- if (!is_numeric($days))
- {
+ if (!is_numeric($days)) {
$days = 60;
}
@@ -63,8 +79,7 @@ class Studienjahr_model extends DB_Model
*/
public function getAktOrNextStudienjahr($days = 62)
{
- if (!is_numeric($days))
- {
+ if (!is_numeric($days)) {
$days = 62;
}
diff --git a/application/models/organisation/Studiensemester_model.php b/application/models/organisation/Studiensemester_model.php
index 0ea5b9328..f29ab223c 100644
--- a/application/models/organisation/Studiensemester_model.php
+++ b/application/models/organisation/Studiensemester_model.php
@@ -225,7 +225,7 @@ class Studiensemester_model extends DB_Model
/**
* @param string $student_uid
- *
+ *
* @return StdClass
*/
public function getWhereStudentHasLvs($student_uid)
@@ -238,7 +238,7 @@ class Studiensemester_model extends DB_Model
$this->db->where("v.lehreverzeichnis<>''");
$this->addOrder($this->dbTable . '.start');
-
+
return $this->loadWhere(['uid' => $student_uid, 'v.lehre' => true]);
}
@@ -291,6 +291,42 @@ class Studiensemester_model extends DB_Model
return $studienjahrNumber;
}
+ /**
+ * Get Studienjahr by Studiensemester.
+ *
+ * @param $studiensemester_kurzbz
+ * @return array|stdClass
+ */
+ public function getStudienjahrByStudiensemester($studiensemester_kurzbz)
+ {
+ $studienjahrObj = null;
+
+ if (!is_numeric($studiensemester_kurzbz))
+ {
+ $this->StudiensemesterModel->addSelect('studienjahr_kurzbz');
+ $result = $this->StudiensemesterModel->loadWhere(array('studiensemester_kurzbz =' => $studiensemester_kurzbz));
+ }
+
+ if (hasData($result))
+ {
+ $studienjahr = getData($result)[0]->studienjahr_kurzbz;
+ $startstudienjahr = substr($studienjahr, 0, 4);
+ $endstudienjahr = substr($studienjahr, 0, 2) . substr($studienjahr, -2);
+
+ $studienjahrObj = new StdClass();
+
+ $studienjahrObj->studienjahr_kurzbz = $studienjahr;
+ $studienjahrObj->startstudienjahr = $startstudienjahr;
+ $studienjahrObj->endstudienjahr= $endstudienjahr;
+ }
+
+ if (isError($result)) {
+ return error(getError($result));
+ }
+
+ return success($studienjahrObj);
+ }
+
/**
* Holt Start und Ende des Studiensemester_kurzbz
* @param studiensemester_kurzbz
diff --git a/application/models/vertragsbestandteil/Dienstverhaeltnis_model.php b/application/models/vertragsbestandteil/Dienstverhaeltnis_model.php
index 6827beaa4..f81a2d518 100644
--- a/application/models/vertragsbestandteil/Dienstverhaeltnis_model.php
+++ b/application/models/vertragsbestandteil/Dienstverhaeltnis_model.php
@@ -59,7 +59,14 @@ class Dienstverhaeltnis_model extends DB_Model
}
$qry .="
- ORDER BY dv.von desc
+ ORDER BY
+ CASE
+ WHEN (COALESCE(dv.bis, '2999-12-31'::date) - NOW()::date) < 0 THEN NULL
+ ELSE
+ (COALESCE(dv.bis, '2999-12-31'::date) - NOW()::date)
+ END ASC NULLS LAST,
+ COALESCE(dv.bis, '2999-12-31'::date) DESC,
+ dv.von DESC
";
return $this->execQuery($qry, $data);
diff --git a/application/views/system/infocenter/infocenter.php b/application/views/system/infocenter/infocenter.php
index 0b7a20c2c..157f98bf1 100644
--- a/application/views/system/infocenter/infocenter.php
+++ b/application/views/system/infocenter/infocenter.php
@@ -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);
diff --git a/application/views/system/infocenter/infocenterAbgewiesen.php b/application/views/system/infocenter/infocenterAbgewiesen.php
index 921d9f224..7129a3250 100644
--- a/application/views/system/infocenter/infocenterAbgewiesen.php
+++ b/application/views/system/infocenter/infocenterAbgewiesen.php
@@ -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')
)
);
?>
diff --git a/application/views/system/infocenter/infocenterAbgewiesenData.php b/application/views/system/infocenter/infocenterAbgewiesenData.php
index da816b2c7..03397ff31 100644
--- a/application/views/system/infocenter/infocenterAbgewiesenData.php
+++ b/application/views/system/infocenter/infocenterAbgewiesenData.php
@@ -8,7 +8,7 @@
$STUDIENSEMESTER = '\''.$this->variablelib->getVar('infocenter_studiensemester').'\'';
$LOGDATA_NAME = '\'Message sent\'';
$LOGDATA_VON = '\'online\'';
- $STUDIENGEBUEHR_ANZAHLUNG = '\'StudiengebuehrAnzahlung\'';
+ $KAUTION_DRITT_STAAT = '\'KautionDrittStaat\'';
$query = '
SELECT
@@ -62,7 +62,7 @@ $query = '
FROM public.tbl_konto konto
WHERE konto.person_id = p.person_id
AND konto.studiensemester_kurzbz = '. $STUDIENSEMESTER .'
- AND konto.buchungstyp_kurzbz = '. $STUDIENGEBUEHR_ANZAHLUNG .'
+ AND konto.buchungstyp_kurzbz = '. $KAUTION_DRITT_STAAT .'
) AS "Kaution"
FROM
public.tbl_prestudentstatus pss
diff --git a/application/views/system/infocenter/infocenterAufgenommen.php b/application/views/system/infocenter/infocenterAufgenommen.php
index 680d66a8a..d57f31d6b 100644
--- a/application/views/system/infocenter/infocenterAufgenommen.php
+++ b/application/views/system/infocenter/infocenterAufgenommen.php
@@ -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')
)
);
?>
diff --git a/application/views/system/infocenter/infocenterData.php b/application/views/system/infocenter/infocenterData.php
index 956ad80d4..ebfd1db37 100644
--- a/application/views/system/infocenter/infocenterData.php
+++ b/application/views/system/infocenter/infocenterData.php
@@ -13,7 +13,7 @@
$ADDITIONAL_STG = $this->config->item('infocenter_studiengang_kz');
$AKTE_TYP = '\'identity\', \'zgv_bakk\'';
$STUDIENSEMESTER = '\''.$this->variablelib->getVar('infocenter_studiensemester').'\'';
- $STUDIENGEBUEHR_ANZAHLUNG = '\'StudiengebuehrAnzahlung\'';
+ $KAUTION_DRITT_STAAT = '\'KautionDrittStaat\'';
$ORG_NAME = '\'InfoCenter\'';
$ONLINE = '\'online\'';
@@ -302,7 +302,7 @@
FROM public.tbl_konto konto
WHERE konto.person_id = p.person_id
AND konto.studiensemester_kurzbz = '. $STUDIENSEMESTER .'
- AND konto.buchungstyp_kurzbz = '. $STUDIENGEBUEHR_ANZAHLUNG .'
+ AND konto.buchungstyp_kurzbz = '. $KAUTION_DRITT_STAAT .'
) AS "Kaution"
FROM public.tbl_person p
LEFT JOIN (
diff --git a/application/views/system/infocenter/infocenterFreigegeben.php b/application/views/system/infocenter/infocenterFreigegeben.php
index a240a0b5c..d843cc5c9 100644
--- a/application/views/system/infocenter/infocenterFreigegeben.php
+++ b/application/views/system/infocenter/infocenterFreigegeben.php
@@ -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')
)
);
?>
diff --git a/application/views/system/infocenter/infocenterFreigegebenData.php b/application/views/system/infocenter/infocenterFreigegebenData.php
index 8003b42e0..38285b6ae 100644
--- a/application/views/system/infocenter/infocenterFreigegebenData.php
+++ b/application/views/system/infocenter/infocenterFreigegebenData.php
@@ -13,7 +13,8 @@
$ORG_NAME = '\'InfoCenter\'';
$IDENTITY = '\'identity\'';
$ONLINE = '\'online\'';
- $STUDIENGEBUEHR_ANZAHLUNG = '\'StudiengebuehrAnzahlung\'';
+ $KAUTION_DRITT_STAAT = '\'KautionDrittStaat\'';
+
$query = '
SELECT
@@ -111,7 +112,7 @@ $query = '
LIMIT 1
) AS "AnzahlAbgeschickt",
(
- SELECT ARRAY_TO_STRING(ARRAY_AGG(DISTINCT UPPER(so.studiengangkurzbzlang) || \':\' || sp.orgform_kurzbz), \', \')
+ SELECT ARRAY_TO_STRING(ARRAY_AGG(DISTINCT UPPER(so.studiengangkurzbzlang) || \':\' || sp.orgform_kurzbz || \' [\' || pss.ausbildungssemester || \']\'), \', \')
FROM public.tbl_prestudentstatus pss
JOIN public.tbl_prestudent ps USING(prestudent_id)
JOIN public.tbl_studiengang sg USING(studiengang_kz)
@@ -275,7 +276,7 @@ $query = '
FROM public.tbl_konto konto
WHERE konto.person_id = p.person_id
AND konto.studiensemester_kurzbz = '. $STUDIENSEMESTER .'
- AND konto.buchungstyp_kurzbz = '. $STUDIENGEBUEHR_ANZAHLUNG .'
+ AND konto.buchungstyp_kurzbz = '. $KAUTION_DRITT_STAAT .'
) AS "Kaution"
FROM public.tbl_person p
LEFT JOIN (
diff --git a/application/views/system/infocenter/infocenterReihungstestAbsolviert.php b/application/views/system/infocenter/infocenterReihungstestAbsolviert.php
index a86e0df97..eef2a214a 100644
--- a/application/views/system/infocenter/infocenterReihungstestAbsolviert.php
+++ b/application/views/system/infocenter/infocenterReihungstestAbsolviert.php
@@ -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')
)
);
?>
diff --git a/application/views/system/infocenter/infocenterReihungstestAbsolviertData.php b/application/views/system/infocenter/infocenterReihungstestAbsolviertData.php
index 7f9ee1288..c19b139b3 100644
--- a/application/views/system/infocenter/infocenterReihungstestAbsolviertData.php
+++ b/application/views/system/infocenter/infocenterReihungstestAbsolviertData.php
@@ -9,7 +9,8 @@
$ADDITIONAL_STG = $this->config->item('infocenter_studiengang_kz');
$STUDIENSEMESTER = '\''.$this->variablelib->getVar('infocenter_studiensemester').'\'';
$ORG_NAME = '\'InfoCenter\'';
- $STUDIENGEBUEHR_ANZAHLUNG = '\'StudiengebuehrAnzahlung\'';
+ $KAUTION_DRITT_STAAT = '\'KautionDrittStaat\'';
+
$query = '
SELECT
@@ -206,7 +207,7 @@ $query = '
FROM public.tbl_konto konto
WHERE konto.person_id = p.person_id
AND konto.studiensemester_kurzbz = '. $STUDIENSEMESTER .'
- AND konto.buchungstyp_kurzbz = '. $STUDIENGEBUEHR_ANZAHLUNG .'
+ AND konto.buchungstyp_kurzbz = '. $KAUTION_DRITT_STAAT .'
) AS "Kaution"
FROM public.tbl_person p
LEFT JOIN (
diff --git a/application/views/system/issues/issuesData.php b/application/views/system/issues/issuesData.php
index c60b03a74..edaee9058 100644
--- a/application/views/system/issues/issuesData.php
+++ b/application/views/system/issues/issuesData.php
@@ -1,11 +1,21 @@
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
diff --git a/cis/private/lehre/abgabe_lektor_details.php b/cis/private/lehre/abgabe_lektor_details.php
index a8705e7f9..f97dfa159 100644
--- a/cis/private/lehre/abgabe_lektor_details.php
+++ b/cis/private/lehre/abgabe_lektor_details.php
@@ -125,7 +125,7 @@ $projekttyp_kurzbz = $projektarbeit_obj->projekttyp_kurzbz;
// paarbeit sollte nur ab bestimmten Zeitpunkt online bewertet werden
$paIsCurrent = $projektarbeit_obj->projektarbeitIsCurrent($projektarbeit_id);
-if(!is_numeric($paIsCurrent) || $paIsCurrent < 0)
+if(!is_bool($paIsCurrent))
{
echo "".$p->t('abgabetool/fehlerAktualitaetProjektarbeit')."
";
}
@@ -166,7 +166,7 @@ if(in_array($betreuerart, array('Erstbegutachter', 'Senatsvorsitz')))
}
// Mail mit Token an Zweitbegutachter senden
- if (count($zweitbetreuerArr) > 0 && $paIsCurrent >= 1 && isset($_GET['zweitbegutachtertoken']) && isset($_GET['zweitbetreuer_person_id']))
+ if (count($zweitbetreuerArr) > 0 && $paIsCurrent === true && isset($_GET['zweitbegutachtertoken']) && isset($_GET['zweitbetreuer_person_id']))
{
$qry_std="SELECT * FROM campus.vw_benutzer where uid=".$db->db_add_param($uid);
if(!$result_std=$db->db_query($qry_std))
@@ -482,7 +482,7 @@ $htmlstr .= "
| ".$p->t('abgabetool/student').": ".$db->convert_html_chars($studentenname)." | "; $htmlstr .= ""; -$semester_benotbar = $paIsCurrent >= 1; +$semester_benotbar = $paIsCurrent === true; $endupload_vorhanden = $num_rows_endupload >= 1; if ($semester_benotbar && $endupload_vorhanden) @@ -495,7 +495,8 @@ if ($semester_benotbar && $endupload_vorhanden) } else { - $quick_info = !$semester_benotbar ? $p->t('abgabetool/aeltereParbeitBenoten') : $p->t('abgabetool/keinEnduploadErfolgt'); + $quick_info = !$semester_benotbar ? $p->t('abgabetool/aeltereParbeitBenotenQuickInfo') : $p->t('abgabetool/keinEnduploadErfolgt'); + $info_text = !$semester_benotbar ? $p->t('abgabetool/aeltereParbeitBenoten') : $p->t('abgabetool/keinEnduploadErfolgt'); $htmlstr .= " |
| Fragen im Gebiet: | +'.$result_anz_fragen->count.' | +
| Gestellte Fragen: | '.$gebietdetails->maxfragen.' | diff --git a/cis/testtool/frage.php b/cis/testtool/frage.php index 0aa37b299..c38229cdf 100644 --- a/cis/testtool/frage.php +++ b/cis/testtool/frage.php @@ -148,7 +148,7 @@ echo ' alert(t("testtool/alleFragenBeantwortet")."'"?>); return true; } - + $(document).ready(function () { $(document).bind('cut copy paste', function(e) { @@ -717,7 +717,7 @@ if($frage->frage_id!='') if(!$demo) { - echo ''; + echo ''; } else { diff --git a/content/functions.js.php b/content/functions.js.php index 9b75718d1..65622f9ae 100644 --- a/content/functions.js.php +++ b/content/functions.js.php @@ -217,6 +217,24 @@ function getDataFromClipboard() return pastetext; } +// **** +// * Kopiert Inhalte in die Zwischenablage +// **** +function copyToClipboard(link) +{ + netscape.security.PrivilegeManager.enablePrivilege('UniversalXPConnect'); + try { + const clipboard = Components.classes["@mozilla.org/widget/clipboardhelper;1"] + .getService(Components.interfaces.nsIClipboardHelper); + clipboard.copyString(link); + + // Erfolgsmeldung anzeigen + alert("Link erfolgreich in die Zwischenablage kopiert.\nBitte in anderem Browser einfügen und öffnen."); + } catch (e) { + alert("Fehler beim Kopieren in die Zwischenablage: " + e); + } +} + // **** // * Oeffnet ein neues Fenster welches dann die Datei 'action' mit dem POST Parameter 'data' aufruft // **** diff --git a/content/lvplanung/lehrveranstaltungDBDML.php b/content/lvplanung/lehrveranstaltungDBDML.php index 12a28b943..958468c9d 100644 --- a/content/lvplanung/lehrveranstaltungDBDML.php +++ b/content/lvplanung/lehrveranstaltungDBDML.php @@ -355,7 +355,8 @@ if(!$error) WHERE mitarbeiter_uid=".$db->db_add_param($lem->mitarbeiter_uid)." AND studiensemester_kurzbz=".$db->db_add_param($le->studiensemester_kurzbz)." AND - bismelden"; + bismelden AND + lower(mitarbeiter_uid) NOT LIKE '_dummy%'"; if(count($oe_arr)>0) $qry.=" AND tbl_studiengang.oe_kurzbz in(".$db->db_implode4SQL($oe_arr).")"; @@ -633,6 +634,7 @@ if(!$error) JOIN public.tbl_studiengang USING(studiengang_kz) WHERE mitarbeiter_uid=".$db->db_add_param($lem->mitarbeiter_uid)." AND + lower(mitarbeiter_uid) NOT LIKE '_dummy%' AND studiensemester_kurzbz=".$db->db_add_param($le->studiensemester_kurzbz)." AND bismelden"; diff --git a/content/messages.js.php b/content/messages.js.php index 3e72748ec..5afc6162f 100644 --- a/content/messages.js.php +++ b/content/messages.js.php @@ -175,7 +175,22 @@ function MessagesIFrameSetHTML(val) } //Value setzen if(val!='') + { editor.contentDocument.execCommand("inserthtml", false, val); + + setTimeout(function() + { + scrollToTop(); + }, 100); + } +} + +function scrollToTop() +{ + netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect"); + editor = document.getElementById('message-wysiwyg'); + + editor.contentWindow.scrollTo(0, 0); } function MessageIFrameInit() diff --git a/content/student/studentabschlusspruefung.js.php b/content/student/studentabschlusspruefung.js.php index dfdd102d5..892ae35f0 100644 --- a/content/student/studentabschlusspruefung.js.php +++ b/content/student/studentabschlusspruefung.js.php @@ -1113,15 +1113,15 @@ function StudentAbschlusspruefungTypChange() { if(document.getElementById('student-abschlusspruefung-menulist-typ').value=='Bachelor') { - document.getElementById('student-abschlusspruefung-label-pruefer1').value='Pruefer 1'; - document.getElementById('student-abschlusspruefung-label-pruefer2').value='Pruefer 2'; + document.getElementById('student-abschlusspruefung-label-pruefer1').value='PrueferIn 1'; + document.getElementById('student-abschlusspruefung-label-pruefer2').value='PrueferIn 2'; document.getElementById('student-abschlusspruefung-menulist-pruefer3').hidden=false; document.getElementById('student-abschlusspruefung-label-pruefer3').hidden=false; } else { - document.getElementById('student-abschlusspruefung-label-pruefer1').value='Pruefer 1 (Diplomarbeit)'; - document.getElementById('student-abschlusspruefung-label-pruefer2').value='Pruefer 2'; + document.getElementById('student-abschlusspruefung-label-pruefer1').value='PrueferIn 1 (Diplomarbeit)'; + document.getElementById('student-abschlusspruefung-label-pruefer2').value='PrueferIn 2'; document.getElementById('student-abschlusspruefung-menulist-pruefer3').hidden=true; document.getElementById('student-abschlusspruefung-label-pruefer3').hidden=true; } diff --git a/content/student/studentdetailoverlay.xul.php b/content/student/studentdetailoverlay.xul.php index 4b4fbdd63..132667395 100644 --- a/content/student/studentdetailoverlay.xul.php +++ b/content/student/studentdetailoverlay.xul.php @@ -74,7 +74,7 @@ echo '';