mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-01 20:29:29 +00:00
Merge branch 'master' into feature-25003/NotenimportFuerNachpruefung
This commit is contained in:
@@ -6,10 +6,6 @@ if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
// Deadline for Application given as Time-Interval after Semesterstart.
|
||||
$config['interval_blocking_application'] = 'P1M';
|
||||
|
||||
// Application submission period given by start- and enddate.
|
||||
$config['submit_application_start'] = '05.09.2022';
|
||||
$config['submit_application_end'] = '22.09.2022';
|
||||
|
||||
// Lehrveranstaltungen with these grades will be blocked for application
|
||||
$config['grades_blocking_application'] = array(
|
||||
5, // nicht genügend
|
||||
@@ -19,4 +15,9 @@ $config['grades_blocking_application'] = array(
|
||||
14, // nicht bestanden,
|
||||
15, // nicht teilgenommen
|
||||
18 // unentschuldigt
|
||||
);
|
||||
);
|
||||
|
||||
//Enables Fachbereichsleiter instead of LV Leiter
|
||||
$config['fbl'] = FALSE;
|
||||
//Enables Info Mails
|
||||
$config['send_mail'] = TRUE;
|
||||
|
||||
@@ -120,11 +120,18 @@ $config['navigation_header'] = array(
|
||||
'sort' => 30,
|
||||
'requiredPermissions' => 'system/issues_verwalten:r'
|
||||
),
|
||||
'plausichecks' => array(
|
||||
'link' => site_url('system/issues/Plausichecks'),
|
||||
'description' => 'Plausichecks',
|
||||
'expand' => true,
|
||||
'sort' => 40,
|
||||
'requiredPermissions' => 'system/issues_verwalten:r'
|
||||
),
|
||||
'gruppenmanagement' => array(
|
||||
'link' => site_url('person/Gruppenmanagement'),
|
||||
'description' => 'Gruppenmanagement',
|
||||
'expand' => true,
|
||||
'sort' => 40,
|
||||
'sort' => 50,
|
||||
'requiredPermissions' => 'lehre/gruppenmanager:r'
|
||||
)
|
||||
)
|
||||
@@ -157,7 +164,14 @@ $config['navigation_header'] = array(
|
||||
'expand' => true,
|
||||
'sort' => 20,
|
||||
'requiredPermissions' => 'system/developer:r'
|
||||
)
|
||||
),
|
||||
'anrechnungen' => array(
|
||||
'link' => site_url('lehre/anrechnung/AdminAnrechnung'),
|
||||
'description' => 'Anrechnungen',
|
||||
'expand' => true,
|
||||
'sort' => 30,
|
||||
'requiredPermissions' => 'lehre/anrechnungszeitfenster:rw'
|
||||
)
|
||||
)
|
||||
)
|
||||
)
|
||||
@@ -177,6 +191,15 @@ $config['navigation_menu']['Vilesci/index'] = array(
|
||||
)
|
||||
);
|
||||
|
||||
$config['navigation_menu']['Vilesci/index'] = array(
|
||||
'dashboard' => array(
|
||||
'link' => '#',
|
||||
'description' => 'Dashboard',
|
||||
'icon' => 'dashboard',
|
||||
'sort' => 1
|
||||
)
|
||||
);
|
||||
|
||||
$config['navigation_menu']['organisation/Reihungstest/index'] = array(
|
||||
'reihungstestverwalung' => array(
|
||||
'link' => base_url('vilesci/stammdaten/reihungstestverwaltung.php'),
|
||||
|
||||
@@ -22,7 +22,33 @@ class IssueResolver extends IssueResolver_Controller
|
||||
'CORE_INOUT_0003' => 'CORE_INOUT_0003',
|
||||
'CORE_INOUT_0004' => 'CORE_INOUT_0004',
|
||||
'CORE_INOUT_0005' => 'CORE_INOUT_0005',
|
||||
'CORE_INOUT_0006' => 'CORE_INOUT_0006'
|
||||
'CORE_INOUT_0006' => 'CORE_INOUT_0006',
|
||||
'CORE_INOUT_0007' => 'CORE_INOUT_0007',
|
||||
'CORE_INOUT_0008' => 'CORE_INOUT_0008',
|
||||
'CORE_INOUT_0009' => 'CORE_INOUT_0009',
|
||||
'CORE_STG_0001' => 'CORE_STG_0001',
|
||||
'CORE_STG_0002' => 'CORE_STG_0002',
|
||||
'CORE_STG_0003' => 'CORE_STG_0003',
|
||||
'CORE_STG_0004' => 'CORE_STG_0004',
|
||||
'CORE_STUDENTSTATUS_0001' => 'CORE_STUDENTSTATUS_0001',
|
||||
'CORE_STUDENTSTATUS_0002' => 'CORE_STUDENTSTATUS_0002',
|
||||
'CORE_STUDENTSTATUS_0003' => 'CORE_STUDENTSTATUS_0003',
|
||||
'CORE_STUDENTSTATUS_0004' => 'CORE_STUDENTSTATUS_0004',
|
||||
'CORE_STUDENTSTATUS_0005' => 'CORE_STUDENTSTATUS_0005',
|
||||
'CORE_STUDENTSTATUS_0006' => 'CORE_STUDENTSTATUS_0006',
|
||||
'CORE_STUDENTSTATUS_0007' => 'CORE_STUDENTSTATUS_0007',
|
||||
'CORE_STUDENTSTATUS_0008' => 'CORE_STUDENTSTATUS_0008',
|
||||
'CORE_STUDENTSTATUS_0009' => 'CORE_STUDENTSTATUS_0009',
|
||||
'CORE_STUDENTSTATUS_0010' => 'CORE_STUDENTSTATUS_0010',
|
||||
'CORE_STUDENTSTATUS_0011' => 'CORE_STUDENTSTATUS_0011',
|
||||
'CORE_STUDENTSTATUS_0012' => 'CORE_STUDENTSTATUS_0012',
|
||||
'CORE_STUDENTSTATUS_0013' => 'CORE_STUDENTSTATUS_0013',
|
||||
'CORE_STUDENTSTATUS_0014' => 'CORE_STUDENTSTATUS_0014',
|
||||
'CORE_STUDENTSTATUS_0015' => 'CORE_STUDENTSTATUS_0015',
|
||||
'CORE_PERSON_0001' => 'CORE_PERSON_0001',
|
||||
'CORE_PERSON_0002' => 'CORE_PERSON_0002',
|
||||
'CORE_PERSON_0003' => 'CORE_PERSON_0003',
|
||||
'CORE_PERSON_0004' => 'CORE_PERSON_0004'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -0,0 +1,62 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Job for producing Plausicheck issues
|
||||
*/
|
||||
class PlausiIssueProducer extends JOB_Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
$this->load->library('issues/PlausicheckProducerLib');
|
||||
$this->load->library('IssuesLib');
|
||||
}
|
||||
|
||||
/**
|
||||
* Runs issue production job.
|
||||
* @param studiensemester_kurzbz string job is run for students of a certain semester.
|
||||
* @param studiengang_kz int job is run for students of certain Studiengang.
|
||||
*/
|
||||
public function run($studiensemester_kurzbz = null, $studiengang_kz = null)
|
||||
{
|
||||
$fehlerKurzbz = $this->plausicheckproducerlib->getFehlerKurzbz();
|
||||
|
||||
$this->logInfo("Plausicheck issue producer job started");
|
||||
|
||||
// get the data returned by Plausicheck
|
||||
foreach ($fehlerKurzbz as $fehler_kurzbz)
|
||||
{
|
||||
// execute the check
|
||||
$this->logInfo("Checking " . $fehler_kurzbz . "...");
|
||||
$plausicheckRes = $this->plausicheckproducerlib->producePlausicheckIssue($fehler_kurzbz, $studiensemester_kurzbz, $studiengang_kz);
|
||||
|
||||
if (isError($plausicheckRes)) $this->logError(getError($plausicheckRes));
|
||||
|
||||
if (hasData($plausicheckRes))
|
||||
{
|
||||
$plausicheckData = getData($plausicheckRes);
|
||||
|
||||
foreach ($plausicheckData as $plausiData)
|
||||
{
|
||||
// get the data needed for issue production
|
||||
$person_id = isset($plausiData['person_id']) ? $plausiData['person_id'] : null;
|
||||
$oe_kurzbz = isset($plausiData['oe_kurzbz']) ? $plausiData['oe_kurzbz'] : null;
|
||||
$fehlertext_params = isset($plausiData['fehlertext_params']) ? $plausiData['fehlertext_params'] : null;
|
||||
$resolution_params = isset($plausiData['resolution_params']) ? $plausiData['resolution_params'] : null;
|
||||
|
||||
// write the issue
|
||||
$addIssueRes = $this->issueslib->addFhcIssue($fehler_kurzbz, $person_id, $oe_kurzbz, $fehlertext_params, $resolution_params);
|
||||
|
||||
// log if error, or log info if inserted new issue
|
||||
if (isError($addIssueRes))
|
||||
$this->logError(getError($addIssueRes));
|
||||
elseif (hasData($addIssueRes) && is_integer(getData($addIssueRes)))
|
||||
$this->logInfo("Plausicheck issue " . $fehler_kurzbz . " successfully produced, person_id: " . $person_id);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->logInfo("Plausicheck issue producer job stopped");
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,187 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class AdminAnrechnung extends Auth_Controller
|
||||
{
|
||||
public function __construct()
|
||||
{
|
||||
// Set required permissions
|
||||
parent::__construct(
|
||||
array(
|
||||
'index' => 'lehre/anrechnungszeitfenster:rw',
|
||||
'save' => 'lehre/anrechnungszeitfenster:rw',
|
||||
'edit' => 'lehre/anrechnungszeitfenster:rw',
|
||||
'delete' => 'lehre/anrechnungszeitfenster:rw'
|
||||
)
|
||||
);
|
||||
|
||||
// Load models
|
||||
$this->load->model('education/Anrechnung_model', 'AnrechnungModel');
|
||||
$this->load->model('education/Anrechnungszeitraum_model', 'AnrechnungszeitraumModel');
|
||||
$this->load->model('organisation/Studiensemester_model', 'StudiensemesterModel');
|
||||
|
||||
// Load libraries
|
||||
$this->load->library('WidgetLib');
|
||||
$this->load->library('PermissionLib');
|
||||
$this->load->library('AnrechnungLib');
|
||||
|
||||
|
||||
// Load language phrases
|
||||
$this->loadPhrases(
|
||||
array(
|
||||
'global',
|
||||
'ui',
|
||||
'lehre',
|
||||
'anrechnung',
|
||||
'table'
|
||||
)
|
||||
);
|
||||
|
||||
$this->_setAuthUID();
|
||||
|
||||
$this->setControllerId();
|
||||
}
|
||||
|
||||
public function index()
|
||||
{
|
||||
// Set nearest Studiensemester as default
|
||||
$result = $this->StudiensemesterModel->getNearest();
|
||||
$studiensemester_kurzbz = hasData($result) ? getData($result)[0]->studiensemester_kurzbz : '';
|
||||
|
||||
// Get existing Anrechnungszeitraeume
|
||||
$this->AnrechnungszeitraumModel->addOrder('anrechnungszeitraum_id', 'DESC');
|
||||
$result = $this->AnrechnungszeitraumModel->load();
|
||||
$anrechnungszeitraum_arr = hasData($result) ? getData($result) : array();
|
||||
|
||||
$viewData = array(
|
||||
'studiensemester_kurzbz' => $studiensemester_kurzbz,
|
||||
'anrechnungszeitraum_arr' => $anrechnungszeitraum_arr
|
||||
);
|
||||
|
||||
$this->load->view('lehre/anrechnung/adminAnrechnung.php', $viewData);
|
||||
}
|
||||
|
||||
/**
|
||||
* Save new Anrechnungszeitraum.
|
||||
*/
|
||||
public function save()
|
||||
{
|
||||
$this->_validate($this->input->post());
|
||||
|
||||
$studiensemester_kurzbz = $this->input->post('studiensemester_kurzbz');
|
||||
$anrechnungstart = $this->input->post('anrechnungstart');
|
||||
$anrechnungende = $this->input->post('anrechnungende');
|
||||
|
||||
$result = $this->AnrechnungszeitraumModel->insertAzr($studiensemester_kurzbz, $anrechnungstart, $anrechnungende);
|
||||
|
||||
if (isError($result))
|
||||
{
|
||||
$this->terminateWithJsonError(getError($result));
|
||||
}
|
||||
|
||||
if (hasData($result))
|
||||
{
|
||||
$this->outputJsonSuccess(array('anrechnungszeitraum_id' => getData($result)));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Edit Anrechnungszeitraum.
|
||||
*/
|
||||
public function edit()
|
||||
{
|
||||
$this->_validate($this->input->post());
|
||||
|
||||
$anrechnungszeitraum_id = $this->input->post('anrechnungszeitraum_id');
|
||||
$studiensemester_kurzbz = $this->input->post('studiensemester_kurzbz');
|
||||
$anrechnungstart = $this->input->post('anrechnungstart');
|
||||
$anrechnungende = $this->input->post('anrechnungende');
|
||||
|
||||
$result = $this->AnrechnungszeitraumModel->updateAzr(
|
||||
$anrechnungszeitraum_id,
|
||||
$studiensemester_kurzbz,
|
||||
$anrechnungstart,
|
||||
$anrechnungende
|
||||
);
|
||||
|
||||
if (isError($result))
|
||||
{
|
||||
$this->terminateWithJsonError(getError($result));
|
||||
}
|
||||
|
||||
if (hasData($result))
|
||||
{
|
||||
$this->outputJsonSuccess(array('anrechnungszeitraum_id' => getData($result)));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete Anrechnungszeitraum.
|
||||
*/
|
||||
public function delete()
|
||||
{
|
||||
$anrechnungszeitraum_id = $this->input->post('anrechnungszeitraum_id');
|
||||
|
||||
$result = $this->AnrechnungszeitraumModel->deleteAzr($anrechnungszeitraum_id);
|
||||
|
||||
if (isError($result))
|
||||
{
|
||||
$this->terminateWithJsonError(getError($result));
|
||||
}
|
||||
|
||||
if (hasData($result))
|
||||
{
|
||||
$this->outputJsonSuccess(array('anrechnungszeitraum_id' => getData($result)));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Validates post parameters.
|
||||
*
|
||||
* @param $post
|
||||
*/
|
||||
private function _validate($post)
|
||||
{
|
||||
$studiensemester_kurzbz = $post['studiensemester_kurzbz'];
|
||||
$anrechnungstart = $post['anrechnungstart'];
|
||||
$anrechnungende = $post['anrechnungende'];
|
||||
|
||||
if (isEmptyString($studiensemester_kurzbz)
|
||||
|| isEmptyString($anrechnungstart)
|
||||
|| isEmptyString($anrechnungende))
|
||||
{
|
||||
$this->terminateWithJsonError($this->p->t('ui', 'errorFelderFehlen'));
|
||||
}
|
||||
|
||||
if ($anrechnungstart > $anrechnungende)
|
||||
{
|
||||
$this->terminateWithJsonError($this->p->t('ui', 'errorStartdatumNachEndedatum'));
|
||||
}
|
||||
|
||||
$result = $this->StudiensemesterModel->load($studiensemester_kurzbz);
|
||||
$studiensemester = getData($result)[0];
|
||||
|
||||
if ($anrechnungstart < $studiensemester->start || $anrechnungstart > $studiensemester->ende)
|
||||
{
|
||||
$this->terminateWithJsonError($this->p->t('ui', 'errorStartdatumNichtInStudiensemester'));
|
||||
}
|
||||
|
||||
if ($anrechnungende < $studiensemester->start || $anrechnungende > $studiensemester->ende)
|
||||
{
|
||||
$this->terminateWithJsonError($this->p->t('ui', 'errorEndedatumNichtInStudiensemester'));
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve the UID of the logged user and checks if it is valid
|
||||
*/
|
||||
private function _setAuthUID()
|
||||
{
|
||||
$this->_uid = getAuthUID();
|
||||
|
||||
if (!$this->_uid) show_error('User authentification failed');
|
||||
}
|
||||
}
|
||||
@@ -33,6 +33,9 @@ class approveAnrechnungDetail extends Auth_Controller
|
||||
)
|
||||
);
|
||||
|
||||
//Load configs
|
||||
$this->load->config('anrechnung');
|
||||
|
||||
// Load models
|
||||
$this->load->model('education/Anrechnung_model', 'AnrechnungModel');
|
||||
$this->load->model('education/Anrechnungstatus_model', 'AnrechnungstatusModel');
|
||||
@@ -90,7 +93,8 @@ class approveAnrechnungDetail extends Auth_Controller
|
||||
$antragData = $this->anrechnunglib->getAntragData(
|
||||
$anrechnungData->prestudent_id,
|
||||
$anrechnungData->studiensemester_kurzbz,
|
||||
$anrechnungData->lehrveranstaltung_id
|
||||
$anrechnungData->lehrveranstaltung_id,
|
||||
$anrechnungData->anrechnung_id
|
||||
);
|
||||
|
||||
// Get Empfehlung data
|
||||
@@ -209,48 +213,46 @@ class approveAnrechnungDetail extends Auth_Controller
|
||||
*/
|
||||
public function requestRecommendation()
|
||||
{
|
||||
$data = $this->input->post('data');
|
||||
$anrechnung_id = $this->input->post('anrechnung_id');
|
||||
|
||||
if(isEmptyArray($data))
|
||||
if(isEmptyString($anrechnung_id))
|
||||
{
|
||||
return $this->outputJsonError('Fehler beim Übertragen der Daten.');
|
||||
}
|
||||
|
||||
$retval = array();
|
||||
$counter = 0;
|
||||
|
||||
// Check if Anrechnungs-LV has lector
|
||||
if (!$this->anrechnunglib->LVhasLector($anrechnung_id))
|
||||
{
|
||||
$this->terminateWithJsonError('LV has no lector');
|
||||
}
|
||||
|
||||
foreach ($data as $item)
|
||||
{
|
||||
// Check if Anrechnungs-LV has lector
|
||||
if (!$this->anrechnunglib->LVhasLector($item['anrechnung_id']))
|
||||
{
|
||||
// Count up LV with no lector
|
||||
$counter++;
|
||||
// Get Fachbereichsleitung or LV Leitung.
|
||||
if($this->config->item('fbl') === TRUE)
|
||||
{
|
||||
$result = $this->anrechnunglib->getLeitungOfLvOe($anrechnung_id);
|
||||
}
|
||||
else
|
||||
{
|
||||
// If LV Leitung is not present, gets all LV lectors.
|
||||
$result = $this->anrechnunglib->getLectors($anrechnung_id);
|
||||
}
|
||||
|
||||
// Break, if LV has no lector
|
||||
break;
|
||||
}
|
||||
$empfehlungsanfrage_an = !isEmptyArray($result) ? implode(', ', array_column($result, 'fullname')) : '';
|
||||
|
||||
// Get full name of LV Leitung.
|
||||
// If LV Leitung is not present, get full name of LV lectors.
|
||||
$lector_arr = $this->anrechnunglib->getLectors($item['anrechnung_id']);
|
||||
$empfehlungsanfrage_an = !isEmptyArray($lector_arr)
|
||||
? implode(', ', array_column($lector_arr, 'fullname'))
|
||||
: '';
|
||||
|
||||
// Request Recommendation
|
||||
if($this->anrechnunglib->requestRecommendation($item['anrechnung_id']))
|
||||
{
|
||||
$retval[]= array(
|
||||
'anrechnung_id' => $item['anrechnung_id'],
|
||||
'status_kurzbz' => self::ANRECHNUNGSTATUS_PROGRESSED_BY_LEKTOR,
|
||||
'status_bezeichnung' => $this->anrechnunglib->getStatusbezeichnung(self::ANRECHNUNGSTATUS_PROGRESSED_BY_LEKTOR),
|
||||
'empfehlung_anrechnung' => null,
|
||||
'empfehlungsanfrageAm' => (new DateTime())->format('d.m.Y'),
|
||||
'empfehlungsanfrageAn' => $empfehlungsanfrage_an
|
||||
);
|
||||
}
|
||||
}
|
||||
// Request Recommendation
|
||||
if($this->anrechnunglib->requestRecommendation($anrechnung_id))
|
||||
{
|
||||
$retval[]= array(
|
||||
'anrechnung_id' => $anrechnung_id,
|
||||
'status_kurzbz' => self::ANRECHNUNGSTATUS_PROGRESSED_BY_LEKTOR,
|
||||
'status_bezeichnung' => $this->anrechnunglib->getStatusbezeichnung(self::ANRECHNUNGSTATUS_PROGRESSED_BY_LEKTOR),
|
||||
'empfehlung_anrechnung' => null,
|
||||
'empfehlungsanfrageAm' => (new DateTime())->format('d.m.Y'),
|
||||
'empfehlungsanfrageAn' => $empfehlungsanfrage_an
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Send mails to lectors
|
||||
@@ -259,21 +261,24 @@ class approveAnrechnungDetail extends Auth_Controller
|
||||
* */
|
||||
if (!isEmptyArray($retval))
|
||||
{
|
||||
self::_sendSanchoMailToLectors($retval);
|
||||
if ($this->config->item('send_mail') === TRUE)
|
||||
{
|
||||
$this->_sendSanchoMailToLectors($anrechnung_id);
|
||||
}
|
||||
|
||||
// Output json to ajax
|
||||
return $this->outputJsonSuccess($retval);
|
||||
}
|
||||
|
||||
// Output json to ajax
|
||||
if (isEmptyArray($retval) && $counter > 0)
|
||||
if (isEmptyArray($retval))
|
||||
{
|
||||
return $this->outputJsonError(
|
||||
$this->terminateWithJsonError(
|
||||
"Empfehlung wurde nicht angefordert,\nDer LV sind keine LektorInnen zugeteilt."
|
||||
);
|
||||
}
|
||||
|
||||
return $this->outputJsonError($this->p->t('ui', 'errorNichtAusgefuehrt'));
|
||||
$this->terminateWithJsonError($this->p->t('ui', 'errorNichtAusgefuehrt'));
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -467,39 +472,33 @@ class approveAnrechnungDetail extends Auth_Controller
|
||||
|
||||
/**
|
||||
* Send mail to lectors asking for recommendation. (first to LV-Leitung, if not present to all lectors of lv)
|
||||
* @param $mail_params
|
||||
* @param $anrechnung_id
|
||||
* @return bool
|
||||
*/
|
||||
private function _sendSanchoMailToLectors($mail_params)
|
||||
private function _sendSanchoMailToLectors($anrechnung_id)
|
||||
{
|
||||
// Get Lehrveranstaltungen
|
||||
$anrechnung_arr = array();
|
||||
|
||||
foreach ($mail_params as $item)
|
||||
{
|
||||
$this->AnrechnungModel->addSelect('lehrveranstaltung_id, studiensemester_kurzbz');
|
||||
$anrechnung_arr[]= array(
|
||||
'lehrveranstaltung_id' => $this->AnrechnungModel->load($item['anrechnung_id'])->retval[0]->lehrveranstaltung_id,
|
||||
'studiensemester_kurzbz' => $this->AnrechnungModel->load($item['anrechnung_id'])->retval[0]->studiensemester_kurzbz
|
||||
);
|
||||
}
|
||||
|
||||
$anrechnung_arr = array_unique($anrechnung_arr, SORT_REGULAR);
|
||||
|
||||
$lehrveranstaltung_id = $this->AnrechnungModel->load($anrechnung_id)->retval[0]->lehrveranstaltung_id;
|
||||
$studiensemester_kurzbz = $this->AnrechnungModel->load($anrechnung_id)->retval[0]->studiensemester_kurzbz;
|
||||
|
||||
/**
|
||||
* Get lectors (prio for LV-Leitung, if not present to all lectors of LV.
|
||||
* Get mail receivers.
|
||||
* If config is default (lectors): prio for LV-Leitung, if not present to all lectors of LV.
|
||||
* Anyway this function will receive a unique array to avoid sending more mails to one and the same lector.
|
||||
* **/
|
||||
$lector_arr = $this->_getLectors($anrechnung_arr);
|
||||
if ($this->config->item('fbl') === TRUE)
|
||||
{
|
||||
$receiver_arr = $this->_getLeitungOfLvOe($lehrveranstaltung_id);
|
||||
}
|
||||
else
|
||||
{
|
||||
$receiver_arr = $this->_getLectors($studiensemester_kurzbz, $lehrveranstaltung_id);
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Send mail to lectors
|
||||
foreach ($lector_arr as $lector)
|
||||
// Send mail
|
||||
foreach ($receiver_arr as $receiver)
|
||||
{
|
||||
$to = $lector->uid;
|
||||
$vorname = $lector->vorname;
|
||||
$to = $receiver->uid. '@'. DOMAIN;;
|
||||
$vorname = $receiver->vorname;
|
||||
|
||||
// Get full name of stgl
|
||||
$this->load->model('person/Person_model', 'PersonModel');
|
||||
@@ -537,35 +536,30 @@ class approveAnrechnungDetail extends Auth_Controller
|
||||
* @param $anrechnung_arr
|
||||
* @return array
|
||||
*/
|
||||
private function _getLectors($anrechnung_arr)
|
||||
private function _getLectors($studiensemester_kurzbz, $lehrveranstaltung_id)
|
||||
{
|
||||
$lector_arr = array();
|
||||
|
||||
// Get lectors
|
||||
foreach($anrechnung_arr as $anrechnung)
|
||||
{
|
||||
$this->load->model('education/Lehrveranstaltung_model', 'LehrveranstaltungModel');
|
||||
$result = $this->LehrveranstaltungModel->getLecturersByLv($anrechnung['studiensemester_kurzbz'], $anrechnung['lehrveranstaltung_id']);
|
||||
$result = $this->LehrveranstaltungModel->getLecturersByLv($studiensemester_kurzbz, $lehrveranstaltung_id);
|
||||
|
||||
if (!$result = getData($result))
|
||||
{
|
||||
show_error('Failed retrieving lectors of Lehrveranstaltung');
|
||||
}
|
||||
if (!$result = getData($result))
|
||||
{
|
||||
show_error('Failed retrieving lectors of Lehrveranstaltung');
|
||||
}
|
||||
|
||||
// Check if lv has LV-Leitung
|
||||
$key = array_search(true, array_column($result, 'lvleiter'));
|
||||
// Check if lv has LV-Leitung
|
||||
$key = array_search(true, array_column($result, 'lvleiter'));
|
||||
|
||||
// If lv has LV-Leitung, keep only the one
|
||||
if ($key !== false)
|
||||
{
|
||||
$lector_arr[]= $result[$key];
|
||||
}
|
||||
// ...otherwise keep all lectors
|
||||
else
|
||||
{
|
||||
$lector_arr = array_merge($lector_arr, $result);
|
||||
}
|
||||
}
|
||||
// If lv has LV-Leitung, keep only the one
|
||||
if ($key !== false)
|
||||
{
|
||||
$lector_arr[]= $result[$key];
|
||||
}
|
||||
// ...otherwise keep all lectors
|
||||
else
|
||||
{
|
||||
$lector_arr = array_merge($lector_arr, $result);
|
||||
}
|
||||
|
||||
/**
|
||||
* NOTE: This step is only done to make the array unique by uid, vorname and nachname in the following step
|
||||
@@ -584,6 +578,14 @@ class approveAnrechnungDetail extends Auth_Controller
|
||||
|
||||
}
|
||||
|
||||
// Get Leitungen of Lehrveranstaltungs-Organisationseinheit
|
||||
private function _getLeitungOfLvOe($lehrveranstaltung_id)
|
||||
{
|
||||
$result = $this->LehrveranstaltungModel->getLeitungOfLvOe($lehrveranstaltung_id);
|
||||
|
||||
return hasData($result) ? getData($result) : show_error('Failed retrieving Leitung of Lehrveranstaltungs-Organisationseinheit');
|
||||
}
|
||||
|
||||
private function _saveEmpfehlungsNotiz($anrechnung_id, $empfehlungstext, $notiz_id)
|
||||
{
|
||||
$this->load->model('person/Notiz_model', 'NotizModel');
|
||||
@@ -606,8 +608,5 @@ class approveAnrechnungDetail extends Auth_Controller
|
||||
trim($empfehlungstext),
|
||||
$this->_uid
|
||||
);
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -28,6 +28,9 @@ class approveAnrechnungUebersicht extends Auth_Controller
|
||||
)
|
||||
);
|
||||
|
||||
// Load configs
|
||||
$this->load->config('anrechnung');
|
||||
|
||||
// Load models
|
||||
$this->load->model('education/Anrechnung_model', 'AnrechnungModel');
|
||||
$this->load->model('education/Anrechnungstatus_model', 'AnrechnungstatusModel');
|
||||
@@ -78,6 +81,19 @@ class approveAnrechnungUebersicht extends Auth_Controller
|
||||
show_error(getError($studiengang_kz_arr));
|
||||
}
|
||||
|
||||
// Get oes the user is entitled for
|
||||
$oe_kurzbz_arr_schreibberechtigt = array();
|
||||
if ($oe_arr = $this->permissionlib->getOE_isEntitledFor(self::BERECHTIGUNG_ANRECHNUNG_GENEHMIGEN))
|
||||
{
|
||||
foreach($oe_arr as $oe)
|
||||
{
|
||||
$berechtigt = $this->permissionlib->isBerechtigt(self::BERECHTIGUNG_ANRECHNUNG_GENEHMIGEN, 'suid', $oe);
|
||||
|
||||
if ($berechtigt) $oe_kurzbz_arr_schreibberechtigt[]= $oe;
|
||||
}
|
||||
}
|
||||
|
||||
// Check if permission is readonly
|
||||
$hasReadOnlyAccess =
|
||||
$this->permissionlib->isBerechtigt(self::BERECHTIGUNG_ANRECHNUNG_GENEHMIGEN, 's')
|
||||
&& !$this->permissionlib->isBerechtigt(self::BERECHTIGUNG_ANRECHNUNG_GENEHMIGEN, 'suid');
|
||||
@@ -87,9 +103,11 @@ class approveAnrechnungUebersicht extends Auth_Controller
|
||||
|
||||
$viewData = array(
|
||||
'studiensemester_selected' => $studiensemester_kurzbz,
|
||||
'studiengaenge_entitled' => $studiengang_kz_arr,
|
||||
'studiengaenge_entitled' => $studiengang_kz_arr, // alle STG mit Lese- und Schreibberechtigung
|
||||
'oes_schreibberechtigt' => $oe_kurzbz_arr_schreibberechtigt, // alle STG nur mit Schreibberechtigung
|
||||
'hasReadOnlyAccess' => $hasReadOnlyAccess,
|
||||
'hasCreateAnrechnungAccess' => $hasCreateAnrechnungAccess
|
||||
'hasCreateAnrechnungAccess' => $hasCreateAnrechnungAccess,
|
||||
'configFachbereichsleitung' => $this->config->item('fbl')
|
||||
);
|
||||
|
||||
$this->load->view('lehre/anrechnung/approveAnrechnungUebersicht.php', $viewData);
|
||||
@@ -207,14 +225,20 @@ class approveAnrechnungUebersicht extends Auth_Controller
|
||||
// Request Recommendation
|
||||
if($this->anrechnunglib->requestRecommendation($item['anrechnung_id']))
|
||||
{
|
||||
// Get full name of LV Leitung.
|
||||
// If LV Leitung is not present, get full name of LV lectors.
|
||||
$lector_arr = $this->anrechnunglib->getLectors($item['anrechnung_id']);
|
||||
$empfehlungsanfrage_an = !isEmptyArray($lector_arr)
|
||||
? implode(', ', array_column($lector_arr, 'fullname'))
|
||||
: '';
|
||||
// Get full name of Fachbereichsleitung or LV Leitung.
|
||||
if($this->config->item('fbl') === TRUE)
|
||||
{
|
||||
$result = $this->anrechnunglib->getLeitungOfLvOe($item['anrechnung_id']);
|
||||
}
|
||||
else
|
||||
{
|
||||
// If LV Leitung is not present, get full name of LV lectors.
|
||||
$result = $this->anrechnunglib->getLectors($item['anrechnung_id']);
|
||||
}
|
||||
|
||||
$retval[]= array(
|
||||
$empfehlungsanfrage_an = !isEmptyArray($result) ? implode(', ', array_column($result, 'fullname')) : '';
|
||||
|
||||
$retval[]= array(
|
||||
'anrechnung_id' => $item['anrechnung_id'],
|
||||
'status_kurzbz' => self::ANRECHNUNGSTATUS_PROGRESSED_BY_LEKTOR,
|
||||
'status_bezeichnung' => $this->anrechnunglib->getStatusbezeichnung(self::ANRECHNUNGSTATUS_PROGRESSED_BY_LEKTOR),
|
||||
@@ -226,19 +250,27 @@ class approveAnrechnungUebersicht extends Auth_Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* Send mails to lectors
|
||||
* Send mails
|
||||
* NOTE: mails are sent at the end to ensure sending only ONE mail to each LV-Leitung or lector
|
||||
* even if they are required for more recommendations
|
||||
* */
|
||||
if (!isEmptyArray($retval))
|
||||
{
|
||||
self::_sendSanchoMailToLectors($retval);
|
||||
if ($this->config->item('send_mail') === TRUE)
|
||||
{
|
||||
$this->_sendSanchoMail($retval);
|
||||
}
|
||||
}
|
||||
|
||||
// Output json to ajax
|
||||
if (isEmptyArray($retval) && $counter == 0)
|
||||
if (isEmptyArray($retval))
|
||||
{
|
||||
return $this->outputJsonError('Es wurden keine Empfehlungen angefordert');
|
||||
if ($counter > 0)
|
||||
{
|
||||
$this->terminateWithJsonError('Bei '. $counter.' LV sind keine LektorInnen zugeteilt.');
|
||||
}
|
||||
|
||||
$this->terminateWithJsonError('Es wurden keine Empfehlungen angefordert');
|
||||
}
|
||||
|
||||
return $this->outputJsonSuccess($retval);
|
||||
@@ -316,7 +348,7 @@ class approveAnrechnungUebersicht extends Auth_Controller
|
||||
* @param $mail_params
|
||||
* @return bool
|
||||
*/
|
||||
private function _sendSanchoMailToLectors($mail_params)
|
||||
private function _sendSanchoMail($mail_params)
|
||||
{
|
||||
// Get Lehrveranstaltungen
|
||||
$anrechnung_arr = array();
|
||||
@@ -332,18 +364,25 @@ class approveAnrechnungUebersicht extends Auth_Controller
|
||||
|
||||
$anrechnung_arr = array_unique($anrechnung_arr, SORT_REGULAR);
|
||||
|
||||
|
||||
/**
|
||||
* Get lectors (prio for LV-Leitung, if not present to all lectors of LV.
|
||||
* Anyway this function will receive a unique array to avoid sending more mails to one and the same lector.
|
||||
* **/
|
||||
$lector_arr = $this->_getLectors($anrechnung_arr);
|
||||
/**
|
||||
* Get mail receivers.
|
||||
* If retrieving lectors: prio for LV-Leitung, if not present to all lectors of LV.
|
||||
* This function will receive a unique array to avoid sending more mails to one and the same user.
|
||||
**/
|
||||
if($this->config->item('fbl') === TRUE)
|
||||
{
|
||||
$receiver_arr = $this->_getLeitungOfLvOe($anrechnung_arr);
|
||||
}
|
||||
else
|
||||
{
|
||||
$receiver_arr = $this->_getLectors($anrechnung_arr);
|
||||
}
|
||||
|
||||
// Send mail to lectors
|
||||
foreach ($lector_arr as $lector)
|
||||
foreach ($receiver_arr as $receiver)
|
||||
{
|
||||
$to = $lector->uid;
|
||||
$vorname = $lector->vorname;
|
||||
$to = $receiver->uid. '@'. DOMAIN;
|
||||
$vorname = $receiver->vorname;
|
||||
|
||||
// Get full name of stgl
|
||||
$this->load->model('person/Person_model', 'PersonModel');
|
||||
@@ -427,4 +466,34 @@ class approveAnrechnungUebersicht extends Auth_Controller
|
||||
|
||||
return $lector_arr;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Leitungen of Lehrveranstaltungs-Organisationseinheit with unique uids.
|
||||
*
|
||||
* @param $anrechnung_arr
|
||||
* @return array
|
||||
*/
|
||||
private function _getLeitungOfLvOe($anrechnung_arr)
|
||||
{
|
||||
$oeLeitung_arr = array();
|
||||
|
||||
// Get Leitungen
|
||||
foreach($anrechnung_arr as $anrechnung)
|
||||
{
|
||||
$this->load->model('education/Lehrveranstaltung_model', 'LehrveranstaltungModel');
|
||||
$result = $this->LehrveranstaltungModel->getLeitungOfLvOe($anrechnung['lehrveranstaltung_id']);
|
||||
|
||||
if (!hasData($result))
|
||||
{
|
||||
show_error('No Leitung found');
|
||||
}
|
||||
|
||||
$oeLeitung_arr = array_merge($oeLeitung_arr, getData($result));
|
||||
}
|
||||
|
||||
// Make array unique
|
||||
$oeLeitung_arr = array_unique($oeLeitung_arr, SORT_REGULAR);
|
||||
|
||||
return $oeLeitung_arr;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -80,11 +80,7 @@ class requestAnrechnung extends Auth_Controller
|
||||
$prestudent_id = getData($result)[0]->prestudent_id;
|
||||
|
||||
// Check if application deadline is expired
|
||||
$is_expired = self::_isExpired(
|
||||
$this->config->item('submit_application_start'),
|
||||
$this->config->item('submit_application_end'),
|
||||
$studiensemester_kurzbz
|
||||
);
|
||||
$is_expired = $this->_isExpired($studiensemester_kurzbz);
|
||||
|
||||
// Check if Lehrveranstaltung was already graded with application blocking grades
|
||||
$is_blocked = self::_LVhasBlockingGrades($studiensemester_kurzbz, $lehrveranstaltung_id);
|
||||
@@ -93,7 +89,7 @@ class requestAnrechnung extends Auth_Controller
|
||||
$anrechnungData = $this->anrechnunglib->getAnrechnungDataByLv($lehrveranstaltung_id, $studiensemester_kurzbz, $prestudent_id);
|
||||
|
||||
// Get Antrag data
|
||||
$antragData = $this->anrechnunglib->getAntragData($prestudent_id, $studiensemester_kurzbz, $lehrveranstaltung_id);
|
||||
$antragData = $this->anrechnunglib->getAntragData($prestudent_id, $studiensemester_kurzbz, $lehrveranstaltung_id, $anrechnungData->anrechnung_id);
|
||||
|
||||
$viewData = array(
|
||||
'antragData' => $antragData,
|
||||
@@ -234,32 +230,30 @@ class requestAnrechnung extends Auth_Controller
|
||||
* @return bool True if deadline is expired
|
||||
* @throws Exception
|
||||
*/
|
||||
private function _isExpired($start, $ende, $studiensemester_kurzbz)
|
||||
private function _isExpired($studiensemester_kurzbz)
|
||||
{
|
||||
$this->load->model('organisation/Studiensemester_model', 'StudiensemesterModel');
|
||||
$today = new DateTime('today midnight');
|
||||
|
||||
// If start is not given, set to Semesterstart.
|
||||
if (!isset($start) || isEmptyString($start))
|
||||
{
|
||||
$this->StudiensemesterModel->addSelect('start');
|
||||
$result = $this->StudiensemesterModel->load($studiensemester_kurzbz);
|
||||
$start = getData($result)[0]->start;
|
||||
}
|
||||
// Load all Anrechnungszeitfenster for this Studiensemester
|
||||
$this->load->model('education/Anrechnungszeitraum_model', 'AnrechnungszeitraumModel');
|
||||
$result = $this->AnrechnungszeitraumModel->loadWhere(array('studiensemester_kurzbz' => $studiensemester_kurzbz));
|
||||
|
||||
// If ende is not given, set to Semesterende.
|
||||
if (!isset($ende) || isEmptyString($ende))
|
||||
{
|
||||
$this->StudiensemesterModel->addSelect('ende');
|
||||
$result = $this->StudiensemesterModel->load($studiensemester_kurzbz);
|
||||
$ende = getData($result)[0]->ende;
|
||||
}
|
||||
if (hasData($result))
|
||||
{
|
||||
// Loop through Anrechnungszeitfenster
|
||||
foreach (getData($result) as $azrObj)
|
||||
{
|
||||
$start = new DateTime($azrObj->anrechnungstart);
|
||||
$ende = new DateTime($azrObj->anrechnungende);
|
||||
|
||||
$today = new DateTime('today midnight');
|
||||
$start = new DateTime($start);
|
||||
$ende = new DateTime($ende);
|
||||
// Return false if today is at least within one Anrechnungszeitraum
|
||||
if (($today >= $start && $today <= $ende)) return false;
|
||||
|
||||
// True if expired
|
||||
return ($today < $start || $today > $ende);
|
||||
}
|
||||
}
|
||||
|
||||
// Return true if today is in none Anrechnungszeitraum
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -28,6 +28,9 @@ class reviewAnrechnungDetail extends Auth_Controller
|
||||
)
|
||||
);
|
||||
|
||||
// Load configs
|
||||
$this->load->config('anrechnung');
|
||||
|
||||
// Load models
|
||||
$this->load->model('education/Anrechnung_model', 'AnrechnungModel');
|
||||
$this->load->model('education/Anrechnungstatus_model', 'AnrechnungstatusModel');
|
||||
@@ -84,16 +87,21 @@ class reviewAnrechnungDetail extends Auth_Controller
|
||||
$antragData = $this->anrechnunglib->getAntragData(
|
||||
$anrechnungData->prestudent_id,
|
||||
$anrechnungData->studiensemester_kurzbz,
|
||||
$anrechnungData->lehrveranstaltung_id
|
||||
$anrechnungData->lehrveranstaltung_id,
|
||||
$anrechnungData->anrechnung_id
|
||||
);
|
||||
|
||||
// Get Empfehlung data
|
||||
$empfehlungData = $this->anrechnunglib->getEmpfehlungData($anrechnung_id);
|
||||
|
||||
// False if LV-Leitung is present and user is not LV-Leitung. Otherwise always true.
|
||||
$isEmpfehlungsberechtigt = $this->anrechnunglib->isEmpfehlungsberechtigt($anrechnung_id);
|
||||
|
||||
$viewData = array(
|
||||
'antragData' => $antragData,
|
||||
'anrechnungData' => $anrechnungData,
|
||||
'empfehlungData' => $empfehlungData
|
||||
'empfehlungData' => $empfehlungData,
|
||||
'isEmpfehlungsberechtigt' => $isEmpfehlungsberechtigt
|
||||
);
|
||||
|
||||
$this->load->view('lehre/anrechnung/reviewAnrechnungDetail.php', $viewData);
|
||||
@@ -140,10 +148,13 @@ class reviewAnrechnungDetail extends Auth_Controller
|
||||
* Send mails to STGL (if not present STGL, send to STGL assistance)
|
||||
* NOTE: mails are sent at the end to ensure sending only one mail to each STGL
|
||||
* */
|
||||
if (!$this->_sendSanchoMails($json, true))
|
||||
{
|
||||
return $this->outputJsonError('Failed sending emails');
|
||||
}
|
||||
if ($this->config->item('send_mail') === TRUE)
|
||||
{
|
||||
if (!$this->_sendSanchoMails($json, true))
|
||||
{
|
||||
return $this->outputJsonError('Failed sending emails');
|
||||
}
|
||||
}
|
||||
|
||||
return $this->outputJsonSuccess($json);
|
||||
}
|
||||
@@ -191,10 +202,13 @@ class reviewAnrechnungDetail extends Auth_Controller
|
||||
if (isset($json) && !isEmptyArray($json))
|
||||
{
|
||||
// Send mails to STGL (if not present STGL, send to STGL assistance)
|
||||
if (!$this->_sendSanchoMails($json, false))
|
||||
{
|
||||
return $this->outputJsonError('Failed sending emails');
|
||||
}
|
||||
if ($this->config->item('send_mail') === TRUE)
|
||||
{
|
||||
if (!$this->_sendSanchoMails($json, false))
|
||||
{
|
||||
return $this->outputJsonError('Failed sending emails');
|
||||
}
|
||||
}
|
||||
|
||||
return $this->outputJsonSuccess($json);
|
||||
}
|
||||
@@ -253,8 +267,14 @@ class reviewAnrechnungDetail extends Auth_Controller
|
||||
show_error('Failed retrieving Anrechnung');
|
||||
}
|
||||
|
||||
$result = $this->LehrveranstaltungModel
|
||||
->getLecturersByLv($result->studiensemester_kurzbz, $result->lehrveranstaltung_id);
|
||||
if($this->config->item('fbl') === TRUE)
|
||||
{
|
||||
$result = $this->LehrveranstaltungModel->getLeitungOfLvOe($result->lehrveranstaltung_id);
|
||||
}
|
||||
else
|
||||
{
|
||||
$result = $this->LehrveranstaltungModel->getLecturersByLv($result->studiensemester_kurzbz, $result->lehrveranstaltung_id);
|
||||
}
|
||||
|
||||
if($result = getData($result))
|
||||
{
|
||||
@@ -282,14 +302,20 @@ class reviewAnrechnungDetail extends Auth_Controller
|
||||
show_error('Failed retrieving Anrechnung');
|
||||
}
|
||||
|
||||
$result = $this->LehrveranstaltungModel
|
||||
->getLecturersByLv($result->studiensemester_kurzbz, $result->lehrveranstaltung_id);
|
||||
if($this->config->item('fbl') === TRUE)
|
||||
{
|
||||
$result = $this->LehrveranstaltungModel->getLeitungOfLvOe($result->lehrveranstaltung_id);
|
||||
}
|
||||
else
|
||||
{
|
||||
$result = $this->LehrveranstaltungModel->getLecturersByLv($result->studiensemester_kurzbz, $result->lehrveranstaltung_id);
|
||||
}
|
||||
|
||||
if($result = getData($result))
|
||||
{
|
||||
$entitled_lector_arr = array_column($result, 'uid');
|
||||
$entitled_uid_arr = array_column($result, 'uid');
|
||||
|
||||
if (in_array($this->_uid, $entitled_lector_arr))
|
||||
if (in_array($this->_uid, $entitled_uid_arr))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -26,6 +26,9 @@ class reviewAnrechnungUebersicht extends Auth_Controller
|
||||
)
|
||||
);
|
||||
|
||||
// Load configs
|
||||
$this->load->config('anrechnung');
|
||||
|
||||
// Load models
|
||||
$this->load->model('education/Anrechnung_model', 'AnrechnungModel');
|
||||
$this->load->model('education/Anrechnungstatus_model', 'AnrechnungstatusModel');
|
||||
@@ -72,7 +75,8 @@ class reviewAnrechnungUebersicht extends Auth_Controller
|
||||
}
|
||||
|
||||
$viewData = array(
|
||||
'studiensemester_selected' => $studiensemester_kurzbz
|
||||
'studiensemester_selected' => $studiensemester_kurzbz,
|
||||
'configFachbereichsleitung' => $this->config->item('fbl')
|
||||
);
|
||||
|
||||
$this->load->view('lehre/anrechnung/reviewAnrechnungUebersicht.php', $viewData);
|
||||
@@ -111,16 +115,19 @@ class reviewAnrechnungUebersicht extends Auth_Controller
|
||||
* Send mails to STGL (if not present STGL, send to STGL assistance)
|
||||
* NOTE: mails are sent at the end to ensure sending only one mail to each STGL
|
||||
* */
|
||||
if (!$this->_sendSanchoMails($json, true))
|
||||
{
|
||||
show_error('Failed sending emails');
|
||||
}
|
||||
if ($this->config->item('send_mail') === TRUE)
|
||||
{
|
||||
if (!$this->_sendSanchoMails($json, true))
|
||||
{
|
||||
show_error('Failed sending emails');
|
||||
}
|
||||
}
|
||||
|
||||
return $this->outputJsonSuccess($json);
|
||||
}
|
||||
else
|
||||
{
|
||||
return $this->outputJsonError($this->p->t('ui', 'errorNichtAusgefuehrt'));
|
||||
$this->terminateWithJsonError($this->p->t('ui', 'errorNichtAusgefuehrt'));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -154,10 +161,13 @@ class reviewAnrechnungUebersicht extends Auth_Controller
|
||||
if (isset($json) && !isEmptyArray($json))
|
||||
{
|
||||
// Send mails to STGL (if not present STGL, send to STGL assistance)
|
||||
if (!$this->_sendSanchoMails($json, false))
|
||||
{
|
||||
show_error('Failed sending emails');
|
||||
}
|
||||
if ($this->config->item('send_mail') === TRUE)
|
||||
{
|
||||
if (!$this->_sendSanchoMails($json, false))
|
||||
{
|
||||
show_error('Failed sending emails');
|
||||
}
|
||||
}
|
||||
|
||||
return $this->outputJsonSuccess($json);
|
||||
}
|
||||
@@ -217,14 +227,20 @@ class reviewAnrechnungUebersicht extends Auth_Controller
|
||||
show_error('Failed retrieving Anrechnung');
|
||||
}
|
||||
|
||||
$result = $this->LehrveranstaltungModel
|
||||
->getLecturersByLv($result->studiensemester_kurzbz, $result->lehrveranstaltung_id);
|
||||
if ($this->config->item('fbl') === TRUE)
|
||||
{
|
||||
$result = $this->LehrveranstaltungModel->getLeitungOfLvOe($result->lehrveranstaltung_id);
|
||||
}
|
||||
else
|
||||
{
|
||||
$result = $this->LehrveranstaltungModel->getLecturersByLv($result->studiensemester_kurzbz, $result->lehrveranstaltung_id);
|
||||
}
|
||||
|
||||
if($result = getData($result))
|
||||
{
|
||||
$entitled_lector_arr = array_column($result, 'uid');
|
||||
$entitled_uid_arr = array_column($result, 'uid');
|
||||
|
||||
if (in_array($this->_uid, $entitled_lector_arr))
|
||||
if (in_array($this->_uid, $entitled_uid_arr))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -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',
|
||||
@@ -141,12 +142,6 @@ class InfoCenter extends Auth_Controller
|
||||
'reloadNotizen' => array('infocenter:r', 'lehre/zgvpruefung:r'),
|
||||
'reloadLogs' => 'infocenter:r',
|
||||
'outputAkteContent' => array('infocenter:r', 'lehre/zgvpruefung:r'),
|
||||
'getPostponeDate' => array('infocenter:r', 'lehre/zgvpruefung:r'),
|
||||
'park' => 'infocenter:rw',
|
||||
'unpark' => 'infocenter:rw',
|
||||
'setOnHold' => 'infocenter:rw',
|
||||
'removeOnHold' => array('infocenter:rw', 'lehre/zgvpruefung:rw'),
|
||||
'getStudienjahrEnd' => array('infocenter:r', 'lehre/zgvpruefung:r'),
|
||||
'setNavigationMenuArrayJson' => 'infocenter:r',
|
||||
'getAbsageData' => 'infocenter:r',
|
||||
'saveAbsageForAll' => 'infocenter:rw',
|
||||
@@ -163,6 +158,7 @@ class InfoCenter extends Auth_Controller
|
||||
$this->load->model('crm/Statusgrund_model', 'StatusgrundModel');
|
||||
$this->load->model('crm/ZGVPruefung_model', 'ZGVPruefungModel');
|
||||
$this->load->model('crm/ZGVPruefungStatus_model', 'ZGVPruefungStatusModel');
|
||||
$this->load->model('crm/Rueckstellung_model', 'RueckstellungModel');
|
||||
$this->load->model('person/Notiz_model', 'NotizModel');
|
||||
$this->load->model('person/Person_model', 'PersonModel');
|
||||
$this->load->model('system/Message_model', 'MessageModel');
|
||||
@@ -172,11 +168,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',
|
||||
@@ -600,7 +601,7 @@ class InfoCenter extends Auth_Controller
|
||||
}
|
||||
|
||||
/**
|
||||
* Sendet bei einer neuen ZGV Prüfung die Mail raus an den Studiengang
|
||||
* Sendet bei einer neuen ZGV Prüfung eine Mail an den Studiengang
|
||||
*/
|
||||
private function sendZgvMail($mail, $typ, $person){
|
||||
$data = array(
|
||||
@@ -691,7 +692,7 @@ class InfoCenter extends Auth_Controller
|
||||
|
||||
/**
|
||||
* Fügt einen neuen ZGV Status hinzu oder updated einen bestehenden
|
||||
* Falls es erfolgreich war, sendet er die Mail raus
|
||||
* Falls es erfolgreich war, wird eine Mail rausgeschickt
|
||||
*/
|
||||
public function zgvRueckfragen()
|
||||
{
|
||||
@@ -745,7 +746,8 @@ class InfoCenter extends Auth_Controller
|
||||
$this->sendZgvMail($mail, $typ, $person);
|
||||
elseif (isError($insert))
|
||||
$this->terminateWithJsonError('Fehler beim Speichern');
|
||||
}else
|
||||
}
|
||||
else
|
||||
{
|
||||
$insert = $this->ZGVPruefungModel->insert(
|
||||
array(
|
||||
@@ -775,7 +777,7 @@ class InfoCenter extends Auth_Controller
|
||||
}
|
||||
|
||||
$hold = false;
|
||||
if ($this->personloglib->getOnHoldDate($person_id) !== null)
|
||||
if (hasData($this->RueckstellungModel->getByPersonId($person_id, 'onhold_zgv')))
|
||||
$hold = true;
|
||||
|
||||
$this->outputJsonSuccess(
|
||||
@@ -1111,14 +1113,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())));
|
||||
@@ -1156,107 +1158,7 @@ class InfoCenter extends Auth_Controller
|
||||
->set_output($aktecontent->retval)
|
||||
->_display();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the date until which a person is parked
|
||||
* @param $person_id
|
||||
*/
|
||||
public function getPostponeDate($person_id)
|
||||
{
|
||||
$result = array(
|
||||
'type' => null,
|
||||
'date' => null
|
||||
);
|
||||
|
||||
$parkedDate = $this->personloglib->getParkedDate($person_id);
|
||||
|
||||
if (isset($parkedDate))
|
||||
{
|
||||
$result['type'] = 'parked';
|
||||
$result['date'] = $parkedDate;
|
||||
}
|
||||
else
|
||||
{
|
||||
$onholdDate = $this->personloglib->getOnHoldDate($person_id);
|
||||
|
||||
if (isset($onholdDate))
|
||||
{
|
||||
$result['type'] = 'onhold';
|
||||
$result['date'] = $onholdDate;
|
||||
}
|
||||
}
|
||||
|
||||
$this->outputJsonSuccess($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initializes parking of a person, i.e. a person is not expected to do any actions while parked
|
||||
*/
|
||||
public function park()
|
||||
{
|
||||
$person_id = $this->input->post('person_id');
|
||||
$date = $this->input->post('parkdate');
|
||||
|
||||
$result = $this->personloglib->park($person_id, date_format(date_create($date), 'Y-m-d'), self::TAETIGKEIT, self::APP, null, $this->_uid);
|
||||
|
||||
$this->outputJson($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes parking of a person
|
||||
*/
|
||||
public function unPark()
|
||||
{
|
||||
$person_id = $this->input->post('person_id');
|
||||
|
||||
$result = $this->personloglib->unPark($person_id);
|
||||
|
||||
$this->outputJson($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets a person on hold ("zurückstellen")
|
||||
*/
|
||||
public function setOnHold()
|
||||
{
|
||||
$person_id = $this->input->post('person_id');
|
||||
$date = $this->input->post('onholddate');
|
||||
|
||||
$result = $this->personloglib->setOnHold($person_id, date_format(date_create($date), 'Y-m-d'), self::TAETIGKEIT, self::APP, null, $this->_uid);
|
||||
|
||||
$this->outputJson($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* Removed on hold status of a person
|
||||
*/
|
||||
public function removeOnHold()
|
||||
{
|
||||
$person_id = $this->input->post('person_id');
|
||||
|
||||
$result = $this->personloglib->removeOnHold($person_id);
|
||||
|
||||
$this->outputJson($result);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the End date of the current Studienjahr
|
||||
*/
|
||||
public function getStudienjahrEnd()
|
||||
{
|
||||
$this->load->model('organisation/studienjahr_model', 'StudienjahrModel');
|
||||
|
||||
$result = $this->StudienjahrModel->getCurrStudienjahr();
|
||||
|
||||
$json = null;
|
||||
|
||||
if (hasData($result))
|
||||
{
|
||||
$json = $result->retval[0]->ende;
|
||||
}
|
||||
|
||||
$this->outputJsonSuccess(array($json));
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Wrapper for setNavigationMenu, returns JSON message
|
||||
@@ -1320,6 +1222,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');
|
||||
@@ -1358,7 +1380,6 @@ class InfoCenter extends Auth_Controller
|
||||
if($nachreichungAm < $today)
|
||||
$this->terminateWithJsonError($this->p->t('infocenter', 'nachreichDatumNichtVergangenheit'));
|
||||
|
||||
|
||||
$akte = $this->AkteModel->loadWhere(array('person_id' => $person_id, 'dokument_kurzbz' => $allowedTypes[$typ]));
|
||||
|
||||
if (hasData($akte)) {
|
||||
@@ -1794,14 +1815,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 +2017,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 +2031,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 +2193,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 +2291,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 +2310,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()
|
||||
|
||||
@@ -0,0 +1,135 @@
|
||||
<?php
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
|
||||
class Rueckstellung extends Auth_Controller
|
||||
{
|
||||
private $_ci; // Code igniter instance
|
||||
private $_uid;
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct(
|
||||
array(
|
||||
'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')
|
||||
)
|
||||
);
|
||||
|
||||
$this->load->model('crm/Rueckstellung_model', 'RueckstellungModel');
|
||||
$this->load->model('crm/RueckstellungStatus_model', 'RueckstellungStatusModel');
|
||||
$this->load->model('person/Person_model', 'PersonModel');
|
||||
$this->load->library('PersonLogLib');
|
||||
|
||||
$this->_setAuthUID(); // sets property uid
|
||||
|
||||
$this->_ci =& get_instance(); // get code igniter instance
|
||||
}
|
||||
|
||||
public function get($person_id)
|
||||
{
|
||||
$result = null;
|
||||
$rueckstellung = $this->_ci->RueckstellungModel->getByPersonId($person_id);
|
||||
|
||||
if (isError($rueckstellung))
|
||||
$this->terminateWithJsonError($this->_ci->p->t('ui', 'fehlerBeimLesen'));
|
||||
|
||||
if (hasData($rueckstellung))
|
||||
{
|
||||
$rueckstellung = getData($rueckstellung)[0];
|
||||
$fullName = getData($this->_ci->PersonModel->getFullName($rueckstellung->insertvon));
|
||||
|
||||
$result = array(
|
||||
'von' => $fullName,
|
||||
'bezeichnung' => $rueckstellung->bezeichnung,
|
||||
'bis' => $rueckstellung->datum_bis,
|
||||
'status_kurzbz' => $rueckstellung->status_kurzbz
|
||||
);
|
||||
|
||||
if ($rueckstellung->status_kurzbz === 'parked' && $rueckstellung->datum_bis < date('Y-m-d'))
|
||||
{
|
||||
$this->_ci->RueckstellungModel->delete(array('person_id' => $person_id, 'status_kurzbz' => 'parked'));
|
||||
$result = null;
|
||||
}
|
||||
}
|
||||
|
||||
$this->outputJsonSuccess($result);
|
||||
}
|
||||
|
||||
public function set()
|
||||
{
|
||||
$person_id = $this->input->post('person_id');
|
||||
$datum_bis = $this->input->post('datum_bis');
|
||||
$status_kurzbz = $this->input->post('status_kurzbz');
|
||||
|
||||
$result = $this->_ci->RueckstellungModel->insert(
|
||||
array('person_id' => $person_id,
|
||||
'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_id, $status_kurzbz);
|
||||
|
||||
$this->outputJson($result);
|
||||
}
|
||||
|
||||
public function delete()
|
||||
{
|
||||
$person_id = $this->input->post('person_id');
|
||||
$status = $this->input->post('status');
|
||||
|
||||
$result = $this->_ci->RueckstellungModel->delete(array('person_id' => $person_id, 'status_kurzbz' => $status));
|
||||
|
||||
if (isError($result))
|
||||
$this->terminateWithJsonError($this->_ci->p->t('ui', 'fehlerBeimSpeichern'));
|
||||
|
||||
$this->outputJson($result);
|
||||
}
|
||||
|
||||
public function getStatus($aktiv = true)
|
||||
{
|
||||
$this->_ci->RueckstellungStatusModel->addOrder('sort');
|
||||
$result = $this->_ci->RueckstellungStatusModel->loadWhere(array('aktiv' => $aktiv));
|
||||
|
||||
if (isError($result))
|
||||
$this->terminateWithJsonError($this->_ci->p->t('ui', 'fehlerBeimLesen'));
|
||||
|
||||
$this->outputJsonSuccess(getData($result));
|
||||
}
|
||||
|
||||
/**
|
||||
* Retrieve the UID of the logged user and checks if it is valid
|
||||
*/
|
||||
private function _setAuthUID()
|
||||
{
|
||||
$this->_uid = getAuthUID();
|
||||
|
||||
if (!$this->_uid) show_error('User authentification failed');
|
||||
}
|
||||
|
||||
private function _log($person_id, $status_kurzbz)
|
||||
{
|
||||
$message = "Person $person_id set to $status_kurzbz";
|
||||
|
||||
$this->_ci->personloglib->log(
|
||||
$person_id,
|
||||
'Action',
|
||||
array(
|
||||
'name' => 'Person status set',
|
||||
'message' => $message,
|
||||
'success' => true
|
||||
),
|
||||
'bewerbung',
|
||||
'infocenter',
|
||||
null,
|
||||
$this->_uid
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,142 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class Plausichecks extends Auth_Controller
|
||||
{
|
||||
const GENERIC_ISSUE_OCCURED_TEXT = 'Issue aufgetreten';
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct(
|
||||
array(
|
||||
'index' => array('system/issues_verwalten:r'),
|
||||
'runChecks' => array('system/issues_verwalten:r')
|
||||
)
|
||||
);
|
||||
|
||||
// Load libraries
|
||||
$this->load->library('issues/PlausicheckProducerLib');
|
||||
$this->load->library('WidgetLib');
|
||||
|
||||
// Load models
|
||||
$this->load->model('system/Fehler_model', 'FehlerModel');
|
||||
$this->load->model('organisation/Studiensemester_model', 'StudiensemesterModel');
|
||||
$this->load->model('organisation/Studiengang_model', 'StudiengangModel');
|
||||
}
|
||||
|
||||
/*
|
||||
* Get data for filtering the plausichecks and load the view.
|
||||
*/
|
||||
public function index()
|
||||
{
|
||||
$filterData = $this->_getFilterData();
|
||||
$this->load->view('system/issues/plausichecks', $filterData);
|
||||
}
|
||||
|
||||
/**
|
||||
* Initiate plausichecks run.
|
||||
*/
|
||||
public function runChecks()
|
||||
{
|
||||
$studiensemester_kurzbz = $this->input->get('studiensemester_kurzbz');
|
||||
$studiengang_kz = $this->input->get('studiengang_kz');
|
||||
$fehler_kurzbz = $this->input->get('fehler_kurzbz');
|
||||
|
||||
// issues array for passing issue texts
|
||||
$issueTexts = array();
|
||||
// all fehler kurzbz which are going to be checked
|
||||
$fehlerKurzbz = !isEmptyString($fehler_kurzbz) ? array($fehler_kurzbz) : $this->plausicheckproducerlib->getFehlerKurzbz();
|
||||
// set Studiengang to null if not passed
|
||||
if (isEmptyString($studiengang_kz)) $studiengang_kz = null;
|
||||
|
||||
// get the data returned by Plausicheck
|
||||
foreach ($fehlerKurzbz as $fehler_kurzbz)
|
||||
{
|
||||
// execute the check
|
||||
$issueTexts[$fehler_kurzbz] = array();
|
||||
$plausicheckRes = $this->plausicheckproducerlib->producePlausicheckIssue($fehler_kurzbz, $studiensemester_kurzbz, $studiengang_kz);
|
||||
|
||||
if (isError($plausicheckRes)) $this->terminateWithJsonError(getError($plausicheckRes));
|
||||
|
||||
if (hasData($plausicheckRes))
|
||||
{
|
||||
$plausicheckData = getData($plausicheckRes);
|
||||
|
||||
foreach ($plausicheckData as $plausiData)
|
||||
{
|
||||
// get the data needed for issue production
|
||||
$person_id = isset($plausiData['person_id']) ? $plausiData['person_id'] : null;
|
||||
$oe_kurzbz = isset($plausiData['oe_kurzbz']) ? $plausiData['oe_kurzbz'] : null;
|
||||
$fehlertext_params = isset($plausiData['fehlertext_params']) ? $plausiData['fehlertext_params'] : null;
|
||||
$resolution_params = isset($plausiData['resolution_params']) ? $plausiData['resolution_params'] : null;
|
||||
|
||||
// get Text of the Fehler
|
||||
$this->FehlerModel->addSelect('fehlertext');
|
||||
$fehlerRes = $this->FehlerModel->loadWhere(array('fehler_kurzbz' => $fehler_kurzbz));
|
||||
|
||||
if (isError($fehlerRes)) $this->outputJsonError(getError($fehlerRes));
|
||||
|
||||
// optionally replace fehler parameters in text, output the fehlertext
|
||||
if (hasData($fehlerRes))
|
||||
{
|
||||
// use issue fehler text from database if present
|
||||
$fehlerText = getData($fehlerRes)[0]->fehlertext;
|
||||
|
||||
if (!isEmptyArray($fehlertext_params))
|
||||
{
|
||||
// replace placeholder with params, if present
|
||||
if (count($fehlertext_params) != substr_count($fehlerText, '%s'))
|
||||
$this->terminateWithJsonError('Wrong number of parameters for Fehlertext, fehler_kurzbz ' . $fehler_kurzbz);
|
||||
|
||||
$fehlerText = vsprintf($fehlerText, $fehlertext_params);
|
||||
}
|
||||
}
|
||||
else // if no issue text found, use generic text
|
||||
{
|
||||
$fehlerText = self::GENERIC_ISSUE_OCCURED_TEXT;
|
||||
}
|
||||
|
||||
// add generic parameters to issue text
|
||||
if (isset($person_id)) $fehlerText .= "; person_id: $person_id";
|
||||
if (isset($oe_kurzbz)) $fehlerText .= "; oe_kurzbz: $oe_kurzbz";
|
||||
$issueTexts[$fehler_kurzbz][] = $fehlerText;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
$this->outputJsonSuccess($issueTexts);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the data needed for filtering for limiting checks.
|
||||
*/
|
||||
private function _getFilterData()
|
||||
{
|
||||
$this->StudiensemesterModel->addOrder('start', 'DESC');
|
||||
$studiensemesterRes = $this->StudiensemesterModel->load();
|
||||
|
||||
if (isError($studiensemesterRes)) show_error(getError($studiensemesterRes));
|
||||
|
||||
$currSemRes = $this->StudiensemesterModel->getAkt();
|
||||
|
||||
if (isError($currSemRes)) show_error(getError($currSemRes));
|
||||
|
||||
$this->StudiengangModel->addSelect('studiengang_kz, tbl_studiengang.bezeichnung, tbl_studiengang.typ,
|
||||
tbl_studiengangstyp.bezeichnung AS typbezeichnung, UPPER(tbl_studiengang.typ::varchar(1) || tbl_studiengang.kurzbz) as kuerzel');
|
||||
$this->StudiengangModel->addJoin('public.tbl_studiengangstyp', 'typ');
|
||||
$this->StudiengangModel->addOrder('kuerzel, tbl_studiengang.bezeichnung, studiengang_kz');
|
||||
$studiengaengeRes = $this->StudiengangModel->loadWhere(array('aktiv' => true));
|
||||
|
||||
if (isError($studiengaengeRes)) show_error(getError($studiengaengeRes));
|
||||
|
||||
$fehlerKurzbz = $this->plausicheckproducerlib->getFehlerKurzbz();
|
||||
|
||||
return array(
|
||||
'semester' => hasData($studiensemesterRes) ? getData($studiensemesterRes) : array(),
|
||||
'currsemester' => hasData($currSemRes) ? getData($currSemRes) : array(),
|
||||
'studiengaenge' => hasData($studiengaengeRes) ? getData($studiengaengeRes) : array(),
|
||||
'fehler' => $fehlerKurzbz
|
||||
);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* Interface defining method to implement for issue producer (from core and extensions)
|
||||
*/
|
||||
interface IIssueExistsChecker
|
||||
{
|
||||
/**
|
||||
* Checks if an issue exists.
|
||||
* @param array $params parameters needed for issue detection
|
||||
* @return object with success(true) if issue exists, success(false) otherwise
|
||||
*/
|
||||
public function checkIfIssueExists($paramsForChecking);
|
||||
|
||||
/**
|
||||
* Produces an issue.
|
||||
* @param array $params parameters needed for issue detection
|
||||
* @return object with success(true) if issue exists, success(false) otherwise
|
||||
*/
|
||||
//public function produceIssue($person_id, $oe_kurzbz, $paramsForProducing);
|
||||
}
|
||||
@@ -5,7 +5,8 @@
|
||||
*/
|
||||
abstract class IssueResolver_Controller extends JOB_Controller
|
||||
{
|
||||
const ISSUES_FOLDER = 'issues';
|
||||
const CI_PATH = 'application';
|
||||
const ISSUE_RESOLVERS_FOLDER = 'issues/resolvers';
|
||||
const CHECK_ISSUE_RESOLVED_METHOD_NAME = 'checkIfIssueIsResolved';
|
||||
|
||||
protected $_codeLibMappings;
|
||||
@@ -43,71 +44,68 @@ abstract class IssueResolver_Controller extends JOB_Controller
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
$openIssues = getData($openIssuesRes);
|
||||
|
||||
foreach ($openIssues as $issue)
|
||||
{
|
||||
if (isset($this->_codeLibMappings[$issue->fehlercode]))
|
||||
// ignore if Fehlercode is not in libmappings (shouldn't be checked)
|
||||
if (!isset($this->_codeLibMappings[$issue->fehlercode])) continue;
|
||||
|
||||
$libName = $this->_codeLibMappings[$issue->fehlercode];
|
||||
|
||||
// add person id and oe kurzbz automatically as params, merge it with additional params
|
||||
// decode bewerbung_parameter into assoc array
|
||||
$params = array_merge(
|
||||
array('issue_id' => $issue->issue_id, 'issue_person_id' => $issue->person_id, 'issue_oe_kurzbz' => $issue->oe_kurzbz),
|
||||
isset($issue->behebung_parameter) ? json_decode($issue->behebung_parameter, true) : array()
|
||||
);
|
||||
|
||||
// if called from extension (extension name set), path includes extension names, otherwise it is the core library folder
|
||||
$libRootPath = isset($this->_extensionName) ? 'extensions/' . $this->_extensionName . '/' : '';
|
||||
$issuesLibPath = $libRootPath . self::ISSUE_RESOLVERS_FOLDER . '/';
|
||||
$issuesLibFilePath = DOC_ROOT . self::CI_PATH . '/' . $libRootPath . 'libraries/' . self::ISSUE_RESOLVERS_FOLDER . '/' . $libName . '.php';
|
||||
|
||||
// check if library file exists
|
||||
if (!file_exists($issuesLibFilePath))
|
||||
{
|
||||
$libName = $this->_codeLibMappings[$issue->fehlercode];
|
||||
// log error and continue with next issue if not
|
||||
$this->logError("Issue library file " . $issuesLibFilePath . " does not exist");
|
||||
continue;
|
||||
}
|
||||
|
||||
// add person id and oe kurzbz automatically as params, merge it with additional params
|
||||
// decode bewerbung_parameter into assoc array
|
||||
$params = array_merge(
|
||||
array('issue_id' => $issue->issue_id, 'issue_person_id' => $issue->person_id, 'issue_oe_kurzbz' => $issue->oe_kurzbz),
|
||||
isset($issue->behebung_parameter) ? json_decode($issue->behebung_parameter, true) : array()
|
||||
);
|
||||
// load library connected to fehlercode
|
||||
$this->load->library($issuesLibPath . $libName);
|
||||
|
||||
// if called from extension (extension name set), path includes extension names, otherwise it is the core library folder
|
||||
$libRootPath = isset($this->_extensionName) ? 'extensions/' . $this->_extensionName . '/' : '';
|
||||
$issuesLibPath = $libRootPath . self::ISSUES_FOLDER . '/';
|
||||
$issuesLibFilePath = DOC_ROOT . 'application/' . $libRootPath . 'libraries/' . self::ISSUES_FOLDER . '/' . $libName . '.php';
|
||||
$lowercaseLibName = mb_strtolower($libName);
|
||||
|
||||
// check if library file exists
|
||||
if (!file_exists($issuesLibFilePath))
|
||||
// check if method is defined in library class
|
||||
if (!is_callable(array($this->{$lowercaseLibName}, self::CHECK_ISSUE_RESOLVED_METHOD_NAME)))
|
||||
{
|
||||
// log error and continue with next issue if not
|
||||
$this->logError("Method " . self::CHECK_ISSUE_RESOLVED_METHOD_NAME . " is not defined in library $lowercaseLibName");
|
||||
continue;
|
||||
}
|
||||
|
||||
// call the function for checking for issue resolution
|
||||
$issueResolvedRes = $this->{$lowercaseLibName}->{self::CHECK_ISSUE_RESOLVED_METHOD_NAME}($params);
|
||||
|
||||
if (isError($issueResolvedRes))
|
||||
{
|
||||
$this->logError(getError($issueResolvedRes));
|
||||
}
|
||||
else
|
||||
{
|
||||
$issueResolvedData = getData($issueResolvedRes);
|
||||
|
||||
if ($issueResolvedData === true)
|
||||
{
|
||||
// log error and continue with next issue if not
|
||||
$this->logError("Issue library file " . $issuesLibFilePath . " does not exist");
|
||||
continue;
|
||||
}
|
||||
// set issue to resolved if needed
|
||||
$behobenRes = $this->issueslib->setBehoben($issue->issue_id, null);
|
||||
|
||||
// load library connected to fehlercode
|
||||
$this->load->library(
|
||||
$issuesLibPath . $libName
|
||||
);
|
||||
|
||||
$lowercaseLibName = mb_strtolower($libName);
|
||||
|
||||
// check if method is defined in libary class
|
||||
if (!is_callable(array($this->{$lowercaseLibName}, self::CHECK_ISSUE_RESOLVED_METHOD_NAME)))
|
||||
{
|
||||
// log error and continue with next issue if not
|
||||
$this->logError("Method " . self::CHECK_ISSUE_RESOLVED_METHOD_NAME . " is not defined in library $lowercaseLibName");
|
||||
continue;
|
||||
}
|
||||
|
||||
// call the function for checking for issue resolution
|
||||
$issueResolvedRes = $this->{$lowercaseLibName}->{self::CHECK_ISSUE_RESOLVED_METHOD_NAME}($params);
|
||||
|
||||
if (isError($issueResolvedRes))
|
||||
{
|
||||
$this->logError(getError($issueResolvedRes));
|
||||
}
|
||||
else
|
||||
{
|
||||
$issueResolvedData = getData($issueResolvedRes);
|
||||
|
||||
if ($issueResolvedData === true)
|
||||
{
|
||||
// set issue to resolved if needed
|
||||
$behobenRes = $this->issueslib->setBehoben($issue->issue_id, null);
|
||||
|
||||
if (isError($behobenRes))
|
||||
$this->logError(getError($behobenRes));
|
||||
else
|
||||
$this->logInfo("Issue " . $issue->issue_id . " successfully resolved");
|
||||
}
|
||||
if (isError($behobenRes))
|
||||
$this->logError(getError($behobenRes));
|
||||
else
|
||||
$this->logInfo("Issue " . $issue->issue_id . " successfully resolved");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -37,19 +37,30 @@ class AnrechnungLib
|
||||
* @param $lv_id
|
||||
* @return StdClass
|
||||
*/
|
||||
public function getAntragData($prestudent_id, $studiensemester_kurzbz, $lv_id)
|
||||
public function getAntragData($prestudent_id, $studiensemester_kurzbz, $lv_id, $anrechnung_id = null)
|
||||
{
|
||||
$antrag_data = new StdClass();
|
||||
|
||||
// Get students UID.
|
||||
$uid = $this->ci->StudentModel->getUID($prestudent_id);
|
||||
|
||||
// Get lehrveranstaltung data. Break, if course is not assigned to student.
|
||||
if(!$lv = getData($this->ci->LehrveranstaltungModel->getLvByStudent($uid, $studiensemester_kurzbz, $lv_id))[0])
|
||||
|
||||
// If Anrechnung exists
|
||||
if (is_numeric($anrechnung_id))
|
||||
{
|
||||
show_error('You are not assigned to this course yet.');
|
||||
// Just load LV by lv_id
|
||||
$result = $this->ci->LehrveranstaltungModel->load($lv_id);
|
||||
$lv = getData($result)[0];
|
||||
}
|
||||
|
||||
// If Anrechnung not exists
|
||||
else
|
||||
{
|
||||
// Load LV, but check if student is assigned to that LV. Break, if not.
|
||||
if(!$lv = getData($this->ci->LehrveranstaltungModel->getLvByStudent($uid, $studiensemester_kurzbz, $lv_id))[0])
|
||||
{
|
||||
show_error('You are not assigned to this course yet.');
|
||||
}
|
||||
}
|
||||
|
||||
// Get the students personal data
|
||||
if (!$person = getData($this->ci->PersonModel->getByUid($uid))[0])
|
||||
{
|
||||
@@ -274,14 +285,21 @@ class AnrechnungLib
|
||||
if (hasData($result))
|
||||
{
|
||||
$empfehlung_data->empfehlungsanfrageAm = (new DateTime($result->retval[0]->insertamum))->format('d.m.Y');
|
||||
|
||||
// Get lectors who received request for recommendation
|
||||
$lector_arr = self::getLectors($anrechnung_id);
|
||||
|
||||
if (!isEmptyArray($lector_arr))
|
||||
{
|
||||
$empfehlung_data->empfehlungsanfrageAn = implode(', ', array_column($lector_arr, 'fullname'));
|
||||
}
|
||||
|
||||
// Get users who received request for recommendation
|
||||
if($this->ci->config->item('fbl') === TRUE)
|
||||
{
|
||||
$res = $this->getLeitungOfLvOe($anrechnung_id);
|
||||
}
|
||||
else
|
||||
{
|
||||
$res = $this->getLectors($anrechnung_id);
|
||||
}
|
||||
|
||||
if (!isEmptyArray($res))
|
||||
{
|
||||
$empfehlung_data->empfehlungsanfrageAn = implode(', ', array_column($res, 'fullname'));
|
||||
}
|
||||
}
|
||||
|
||||
if (is_null($anrechnung->empfehlung_anrechnung))
|
||||
@@ -741,6 +759,25 @@ class AnrechnungLib
|
||||
// Continue, if LV has no lector (there is no one to ask for recommendation)
|
||||
return hasData($result) ? true : false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if user is allowed to recommend Anrechnung.
|
||||
*
|
||||
* @param $anrechnung_id
|
||||
* @return bool
|
||||
*/
|
||||
public function isEmpfehlungsberechtigt($anrechnung_id)
|
||||
{
|
||||
if($this->ci->config->item('fbl') === TRUE)
|
||||
{
|
||||
return true;
|
||||
}
|
||||
// Get lv-leitungen or, if not present, all lectors of lv.
|
||||
$lector_arr = $this->getLectors($anrechnung_id);
|
||||
|
||||
// Return false if lv-leitung is present and user is not lv-leitung. Otherways return always true.
|
||||
return in_array(getAuthUID(), array_column($lector_arr, 'uid'));
|
||||
}
|
||||
|
||||
/**
|
||||
* Get LV Leitung. If not present, get all LV lectors.
|
||||
@@ -774,11 +811,14 @@ class AnrechnungLib
|
||||
|
||||
// Check if lv has LV-Leitung
|
||||
$key = array_search(true, array_column($result, 'lvleiter'));
|
||||
|
||||
// If lv has LV-Leitung, keep only the one
|
||||
|
||||
// If lv has 1 or more LV-Leitungen, keep only them
|
||||
if ($key !== false)
|
||||
{
|
||||
$lector_arr[]= $result[$key];
|
||||
foreach ($result as $lector)
|
||||
{
|
||||
if ($lector->lvleiter) $lector_arr[]= $lector;
|
||||
}
|
||||
}
|
||||
// ...otherwise keep all lectors
|
||||
else
|
||||
@@ -803,6 +843,40 @@ class AnrechnungLib
|
||||
return $lector_arr;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get Leitung of Lehrveranstaltungs-Organisationseinheit.
|
||||
*
|
||||
* @param $anrechnung_id
|
||||
* @return false|mixed|null
|
||||
*/
|
||||
public function getLeitungOfLvOe($anrechnung_id)
|
||||
{
|
||||
$this->ci->AnrechnungModel->addSelect('lehrveranstaltung_id');
|
||||
$result = $this->ci->AnrechnungModel->load($anrechnung_id);
|
||||
|
||||
$lehrveranstaltung_id = getData($result)[0]->lehrveranstaltung_id;
|
||||
|
||||
// Get Leitungen
|
||||
$result = $this->ci->LehrveranstaltungModel->getLeitungOfLvOe($lehrveranstaltung_id);
|
||||
|
||||
if (!hasData($result))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
$oeLeitung_arr = getData($result);
|
||||
|
||||
foreach ($oeLeitung_arr as $oeLeitung)
|
||||
{
|
||||
$oeLeitung->fullname = $oeLeitung->vorname. ' '. $oeLeitung->nachname;
|
||||
}
|
||||
|
||||
// Now make the array unique
|
||||
$oeLeitung_arr = array_unique($oeLeitung_arr, SORT_REGULAR);
|
||||
|
||||
return $oeLeitung_arr;
|
||||
}
|
||||
|
||||
// Return an object with Anrechnungdata
|
||||
private function _setAnrechnungDataObject($anrechnung)
|
||||
{
|
||||
|
||||
@@ -0,0 +1,304 @@
|
||||
<?php
|
||||
/* Copyright (C) 2022 fhcomplete.net
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
require_once(dirname(__FILE__).'/../../vendor/nategood/httpful/bootstrap.php');
|
||||
|
||||
use \ZipArchive as ZipArchive;
|
||||
|
||||
/**
|
||||
* Simple client to convert documents using Docsbox
|
||||
*/
|
||||
class DocsboxLib
|
||||
{
|
||||
const ERROR = 1;
|
||||
const SUCCESS = 0;
|
||||
const STATUS_FINISHED = 'finished'; // Docsbox status when a document conversion ended
|
||||
const STATUS_QUEUED = 'queued'; // Docsbox status when a file has been queued for the conversion
|
||||
const STATUS_STARTED = 'started'; // Docsbox status when a file has started being worked
|
||||
const STATUS_WORKING = 'working'; // Docsbox status when a file is being converted
|
||||
const OUTPUT_FILENAME = 'out.zip.pdf'; // File name used by docsbox to save a converted document
|
||||
|
||||
const DEFAULT_FORMAT = 'pdf'; // Default supported format
|
||||
|
||||
// -------------------------------------------------------------------------------------------------
|
||||
// Public static methods
|
||||
|
||||
/**
|
||||
* Static method used to convert a document using a Docsbox installation (local/remote) over the network
|
||||
* It return 0 on success and any other integer on error
|
||||
* NOTE: currently format is not supported
|
||||
*/
|
||||
public static function convert($inputFileName, $outputFileName, $format)
|
||||
{
|
||||
// If a format has not been given
|
||||
if (($format == null) || ($format != null && ctype_space($format) === true)) $format = self::DEFAULT_FORMAT;
|
||||
|
||||
// Posts the file to docsbox
|
||||
$queueId = self::_postFile($inputFileName);
|
||||
// If an error occurred
|
||||
if ($queueId == null) return self::ERROR;
|
||||
|
||||
// Checks and waits if the file has been converted
|
||||
$resultUrl = self::_checkConvertion($queueId);
|
||||
// If an error occurred
|
||||
if ($resultUrl == null) return self::ERROR;
|
||||
|
||||
// Download and rename the converted file
|
||||
$downloaded = self::_downloadFile($resultUrl, $outputFileName);
|
||||
// If an error occurred
|
||||
if (!$downloaded) return self::ERROR;
|
||||
|
||||
return self::SUCCESS;
|
||||
}
|
||||
|
||||
// -------------------------------------------------------------------------------------------------
|
||||
// Private static methods
|
||||
|
||||
/**
|
||||
* Posts the given file to a Docsboxserver and checks the response to return a valid queue id
|
||||
* On failure it returns a null value
|
||||
*/
|
||||
private static function _postFile($inputFileName)
|
||||
{
|
||||
$queueId = null;
|
||||
|
||||
try
|
||||
{
|
||||
// Posts the given file and expects a response in JSON format
|
||||
$postFileResponse = \Httpful\Request::post(DOCSBOX_SERVER.DOCSBOX_PATH_API)
|
||||
->attach(array('file' => $inputFileName))
|
||||
->expectsJson()
|
||||
->send();
|
||||
|
||||
// Checks that:
|
||||
// - the response is not empty
|
||||
// - the reponse body has the property id
|
||||
// - the property id is a valid string
|
||||
// - the reponse body has the property status
|
||||
// - docsbox queued the conversion of the posted file
|
||||
if (is_object($postFileResponse)
|
||||
&& isset($postFileResponse->body)
|
||||
&& isset($postFileResponse->body->id)
|
||||
&& $postFileResponse->body->id != '' && $postFileResponse->body->id != null
|
||||
&& isset($postFileResponse->body->status)
|
||||
&& $postFileResponse->body->status == self::STATUS_QUEUED)
|
||||
{
|
||||
$queueId = $postFileResponse->body->id;
|
||||
}
|
||||
else
|
||||
{
|
||||
// If docsbox refused to convert the posted file
|
||||
if (isset($postFileResponse->body->status)
|
||||
&& $postFileResponse->body->status != self::STATUS_QUEUED)
|
||||
{
|
||||
error_log(
|
||||
'Docsbox did not queue the posted file. Returned status: '.
|
||||
$postFileResponse->body->status
|
||||
);
|
||||
}
|
||||
else // any other generic error
|
||||
{
|
||||
error_log(
|
||||
'An error occurred while posting to docsbox. Response: '.
|
||||
print_r($postFileResponse, 1)
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
catch(\Httpful\Exception\ConnectionErrorException $cee) // Httpful exception
|
||||
{
|
||||
error_log($cee->getMessage());
|
||||
}
|
||||
catch (Exception $e) // any other exception
|
||||
{
|
||||
error_log($e->getMessage());
|
||||
}
|
||||
|
||||
return $queueId;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check the status of the file convertion identified by the given queue element id
|
||||
* A URL is returned with the path where it is possible to download the converted file
|
||||
* If an error occurred then a null value is returned
|
||||
*/
|
||||
private static function _checkConvertion($queueId)
|
||||
{
|
||||
$resultUrl = null;
|
||||
$startConvertionsTime = time(); // time when the file conversion has started
|
||||
|
||||
// Until a timeout has occurred
|
||||
while (time() - $startConvertionsTime <= DOCSBOX_CONVERSION_TIMEOUT)
|
||||
{
|
||||
sleep(DOCSBOX_WAITING_SLEEP_TIME); // takes a nap on every round
|
||||
|
||||
try
|
||||
{
|
||||
// Calls the docsbox server to check the status of the
|
||||
// file conversion using the provided queue id
|
||||
// it expects a response in JSON format
|
||||
$getStatusResponse = \Httpful\Request::get(DOCSBOX_SERVER.DOCSBOX_PATH_API.$queueId)
|
||||
->expectsJson()
|
||||
->send();
|
||||
|
||||
// Checks that:
|
||||
// - the response is not empty
|
||||
// - the reponse body has the property id
|
||||
// - the property id is a valid string
|
||||
// - the reponse body has the property status
|
||||
// - docsbox is working the conversion of the posted file
|
||||
if (is_object($getStatusResponse)
|
||||
&& isset($getStatusResponse->body->id)
|
||||
&& $getStatusResponse->body->id != '' && $getStatusResponse->body->id != null
|
||||
&& isset($getStatusResponse->body->status))
|
||||
{
|
||||
// Checks that docsbox has finished working on the file conversion
|
||||
// and that there is a valid resultUrl property
|
||||
if ($getStatusResponse->body->status == self::STATUS_FINISHED
|
||||
&& isset($getStatusResponse->body->result_url)
|
||||
&& $getStatusResponse->body->result_url != ''
|
||||
&& $getStatusResponse->body->result_url != null)
|
||||
{
|
||||
$resultUrl = $getStatusResponse->body->result_url;
|
||||
break;
|
||||
}
|
||||
// Just started or still working on it
|
||||
elseif ($getStatusResponse->body->status == self::STATUS_WORKING
|
||||
|| $getStatusResponse->body->status == self::STATUS_STARTED)
|
||||
{
|
||||
// go on!
|
||||
}
|
||||
else // any other status is abnormal
|
||||
{
|
||||
error_log(
|
||||
'Not valid status for queue element: '.$queueId.'. Response: '.
|
||||
print_r($getStatusResponse, 1)
|
||||
);
|
||||
break; // interrupt the loop on error
|
||||
}
|
||||
}
|
||||
else // if the response from the docsbox server is not valid
|
||||
{
|
||||
error_log(
|
||||
'An error occurred while checking the docsbox activity. Response: '.
|
||||
print_r($getStatusResponse, 1)
|
||||
);
|
||||
break; // interrupt the loop on error
|
||||
}
|
||||
}
|
||||
catch(\Httpful\Exception\ConnectionErrorException $cee) // Httpful exception
|
||||
{
|
||||
error_log($cee->getMessage());
|
||||
break; // interrupt the loop on error
|
||||
}
|
||||
catch (Exception $e) // any other exception
|
||||
{
|
||||
error_log($e->getMessage());
|
||||
break; // interrupt the loop on error
|
||||
}
|
||||
}
|
||||
|
||||
return $resultUrl;
|
||||
}
|
||||
|
||||
/**
|
||||
* Download the converted file using the provided URL, unzip it, and renames it into the provided file name
|
||||
*/
|
||||
private static function _downloadFile($resultUrl, $outputFileName)
|
||||
{
|
||||
$downloaded = false; // pessimistic assumption
|
||||
|
||||
try
|
||||
{
|
||||
// Download the file
|
||||
$getFileResponse = \Httpful\Request::get(DOCSBOX_SERVER.$resultUrl)->send();
|
||||
|
||||
// If the downloaded file content is valid and not empty
|
||||
if (isset($getFileResponse->body)
|
||||
&& $getFileResponse->body != null
|
||||
&& $getFileResponse->body != '')
|
||||
{
|
||||
// Output directory where to unzip the downloaded zip file
|
||||
$outputDirectory = dirname($outputFileName);
|
||||
// The path and name of the downloaded zip file
|
||||
$temporaryDownloadedZip = sys_get_temp_dir().'/'.basename($resultUrl);
|
||||
|
||||
// Write the file content into a temporary directory and file
|
||||
if (file_put_contents($temporaryDownloadedZip, $getFileResponse->body) != false)
|
||||
{
|
||||
$zipArchive = new ZipArchive;
|
||||
|
||||
// Open and extract the dowloaded zip file into the directory of the output file
|
||||
if ($zipArchive->open($temporaryDownloadedZip) === true
|
||||
&& $zipArchive->extractTo($outputDirectory) === true
|
||||
&& $zipArchive->close() === true)
|
||||
{
|
||||
// Opened, extracted and closed!
|
||||
|
||||
// Rename the extracted file to the given output file name
|
||||
if (rename($outputDirectory.'/'.self::OUTPUT_FILENAME, $outputFileName))
|
||||
{
|
||||
$downloaded = true;
|
||||
}
|
||||
else
|
||||
{
|
||||
error_log(
|
||||
'An error occurred while renaming the extracted file: '.
|
||||
$outputDirectory.'/'.self::OUTPUT_FILENAME.' into: '.
|
||||
$outputFileName
|
||||
);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
error_log(
|
||||
'An error occurred while working the dowloaded zip file: '.
|
||||
$temporaryDownloadedZip
|
||||
);
|
||||
}
|
||||
}
|
||||
else // if an error occurred while writing
|
||||
{
|
||||
error_log(
|
||||
'An error occurred while writing the file content to: '.
|
||||
$temporaryDownloadedZip
|
||||
);
|
||||
}
|
||||
}
|
||||
else // if the downloaded file is not valid
|
||||
{
|
||||
error_log(
|
||||
'An error occurred while downloading the file from the docsbox server: '.
|
||||
print_r($getFileResponse, 1)
|
||||
);
|
||||
}
|
||||
}
|
||||
catch(\Httpful\Exception\ConnectionErrorException $cee)
|
||||
{
|
||||
error_log($cee->getMessage());
|
||||
}
|
||||
catch (Exception $e)
|
||||
{
|
||||
error_log($e->getMessage());
|
||||
}
|
||||
|
||||
return $downloaded;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -14,20 +14,28 @@ class DocumentLib
|
||||
// Gets CI instance
|
||||
$this->ci =& get_instance();
|
||||
|
||||
exec('unoconv --version', $ret_arr);
|
||||
|
||||
if(isset($ret_arr[0]))
|
||||
// Which document converter has to be used
|
||||
if (defined('DOCSBOX_ENABLED') && DOCSBOX_ENABLED === true)
|
||||
{
|
||||
$hlp = explode(' ', $ret_arr[0]);
|
||||
if(isset($hlp[1]))
|
||||
{
|
||||
$this->unoconv_version = $hlp[1];
|
||||
}
|
||||
else
|
||||
show_error('Could not get Unoconv Version');
|
||||
// Use docsbox!!
|
||||
}
|
||||
else
|
||||
show_error('Unoconv not found - Please install Unoconv');
|
||||
{
|
||||
exec('unoconv --version', $ret_arr);
|
||||
|
||||
if(isset($ret_arr[0]))
|
||||
{
|
||||
$hlp = explode(' ', $ret_arr[0]);
|
||||
if(isset($hlp[1]))
|
||||
{
|
||||
$this->unoconv_version = $hlp[1];
|
||||
}
|
||||
else
|
||||
show_error('Could not get Unoconv Version');
|
||||
}
|
||||
else
|
||||
show_error('Unoconv not found - Please install Unoconv');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -57,9 +65,16 @@ class DocumentLib
|
||||
case 'application/vnd.ms-word':
|
||||
case 'application/vnd.oasis.opendocument.text':
|
||||
case 'text/plain':
|
||||
// Unoconv Version 0.6 seems to fail on converting TXT Files
|
||||
if ($this->unoconv_version == '0.6')
|
||||
return error();
|
||||
if (defined('DOCSBOX_ENABLED') && DOCSBOX_ENABLED === true)
|
||||
{
|
||||
// Use docsbox
|
||||
}
|
||||
else
|
||||
{
|
||||
// Unoconv Version 0.6 seems to fail on converting TXT Files
|
||||
if ($this->unoconv_version == '0.6')
|
||||
return error();
|
||||
}
|
||||
|
||||
$ret = $this->convert($filename, $outFile, 'pdf');
|
||||
if(isSuccess($ret))
|
||||
@@ -105,6 +120,7 @@ class DocumentLib
|
||||
|
||||
finfo_close($finfo);
|
||||
|
||||
$out = null;
|
||||
exec($cmd, $out, $ret);
|
||||
if ($ret != 0)
|
||||
{
|
||||
@@ -123,13 +139,26 @@ class DocumentLib
|
||||
*/
|
||||
public function convert($inFile, $outFile, $format)
|
||||
{
|
||||
if ($this->unoconv_version == '0.6')
|
||||
$command = 'unoconv -f %1$s %3$s > %2$s';
|
||||
else
|
||||
$command = 'unoconv -f %s --output %s %s 2>&1';
|
||||
$command = sprintf($command, $format, $outFile, $inFile);
|
||||
$ret = 0;
|
||||
|
||||
exec($command, $out, $ret);
|
||||
// If it is set to use docsbox
|
||||
if (defined('DOCSBOX_ENABLED') && DOCSBOX_ENABLED === true)
|
||||
{
|
||||
require_once(dirname(__FILE__).'/../application/libraries/DocsboxLib.php');
|
||||
|
||||
$ret = DocsboxLib::convert($inFile, $outFile, $format);
|
||||
}
|
||||
else // otherwise use unoconv
|
||||
{
|
||||
if ($this->unoconv_version == '0.6')
|
||||
$command = 'unoconv -f %1$s %3$s > %2$s';
|
||||
else
|
||||
$command = 'unoconv -f %s --output %s %s 2>&1';
|
||||
$command = sprintf($command, $format, $outFile, $inFile);
|
||||
|
||||
$out = null;
|
||||
exec($command, $out, $ret);
|
||||
}
|
||||
|
||||
if ($ret != 0)
|
||||
{
|
||||
@@ -191,6 +220,7 @@ class DocumentLib
|
||||
$cmd .= '/countspaces { [ exch { dup 32 ne { pop } if } forall ] length } bind def >> ';
|
||||
$cmd .= 'setpagedevice viewJPEG"';
|
||||
|
||||
$out = null;
|
||||
exec($cmd, $out, $ret);
|
||||
if ($ret != 0)
|
||||
{
|
||||
|
||||
@@ -169,6 +169,9 @@ class IssuesLib
|
||||
return $this->_changeIssueStatus($issue_id, $data, $user);
|
||||
}
|
||||
|
||||
// --------------------------------------------------------------------------------------------------------------
|
||||
// Private methods
|
||||
|
||||
/**
|
||||
* Changes status of an issue.
|
||||
* @param int $issue_id
|
||||
@@ -215,8 +218,15 @@ class IssuesLib
|
||||
* @param string $inhalt_extern
|
||||
* @return object success or error
|
||||
*/
|
||||
private function _addIssue($fehlercode, $person_id = null, $oe_kurzbz = null, $fehlertext_params = null, $resolution_params = null, $fehlercode_extern = null, $inhalt_extern = null)
|
||||
{
|
||||
private function _addIssue(
|
||||
$fehlercode,
|
||||
$person_id = null,
|
||||
$oe_kurzbz = null,
|
||||
$fehlertext_params = null,
|
||||
$resolution_params = null,
|
||||
$fehlercode_extern = null,
|
||||
$inhalt_extern = null
|
||||
) {
|
||||
if (isEmptyString($person_id) && isEmptyString($oe_kurzbz))
|
||||
return error("Person_id or oe_kurzbz must be set.");
|
||||
|
||||
@@ -226,7 +236,15 @@ class IssuesLib
|
||||
if (hasData($fehlerRes))
|
||||
{
|
||||
$fehlertextVorlage = getData($fehlerRes)[0]->fehlertext;
|
||||
$fehlertext = isEmptyArray($fehlertext_params) ? $fehlertextVorlage : vsprintf($fehlertextVorlage, $fehlertext_params);
|
||||
|
||||
$fehlertext = $fehlertextVorlage;
|
||||
if (!isEmptyArray($fehlertext_params))
|
||||
{
|
||||
if (count($fehlertext_params) != substr_count($fehlertextVorlage, '%s'))
|
||||
return error('Wrong number of parameters for Fehlertext, fehler_kurzbz ' . $fehlercode);
|
||||
|
||||
$fehlertext = vsprintf($fehlertextVorlage, $fehlertext_params);
|
||||
}
|
||||
|
||||
$openIssuesCountRes = $this->_ci->IssueModel->getOpenIssueCount($fehlercode, $person_id, $oe_kurzbz, $fehlercode_extern);
|
||||
|
||||
@@ -252,6 +270,7 @@ class IssuesLib
|
||||
return error("Invalid parameters for resolution");
|
||||
}
|
||||
|
||||
// insert new issue
|
||||
return $this->_ci->IssueModel->insert(
|
||||
array(
|
||||
'fehlercode' => $fehlercode,
|
||||
@@ -267,8 +286,8 @@ class IssuesLib
|
||||
)
|
||||
);
|
||||
}
|
||||
else
|
||||
return success($openIssueCount);
|
||||
else // return success if issue already exists
|
||||
return success("Issue already exists");
|
||||
}
|
||||
else
|
||||
return error("Number of open issues could not be determined");
|
||||
|
||||
@@ -7,9 +7,6 @@ if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
*/
|
||||
class PersonLogLib
|
||||
{
|
||||
const PARKED_LOGNAME = 'Parked';
|
||||
const ONHOLD_LOGNAME = 'Onhold';
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
@@ -78,168 +75,6 @@ class PersonLogLib
|
||||
else
|
||||
show_error(getError($result));
|
||||
}
|
||||
|
||||
/**
|
||||
* Parks a person, i.e. marks a person so no actions are expected for the person (e.g. as a prestudent)
|
||||
* Done by adding a logentry in the future
|
||||
* @param $person_id
|
||||
* @param $date
|
||||
* @param $taetigkeit_kurzbz
|
||||
* @param string $app
|
||||
* @param null $oe_kurzbz
|
||||
* @param null $user
|
||||
* @return insert object
|
||||
*/
|
||||
public function park($person_id, $date, $taetigkeit_kurzbz, $app = 'core', $oe_kurzbz = null, $user = null)
|
||||
{
|
||||
$onhold = $this->getOnHoldDate($person_id);
|
||||
|
||||
if (hasData($onhold))
|
||||
return error("Person already on hold");
|
||||
|
||||
$logjson = array(
|
||||
'name' => self::PARKED_LOGNAME
|
||||
);
|
||||
|
||||
return $this->_savePsLog($person_id, $date, $taetigkeit_kurzbz, $logjson, $app, $oe_kurzbz, $user);
|
||||
}
|
||||
|
||||
/**
|
||||
* Unparks a person, i.e. removes all log entries in the future with logname for parking
|
||||
* @param $person_id
|
||||
* @return array with deleted logids
|
||||
*/
|
||||
public function unPark($person_id)
|
||||
{
|
||||
$deleted = array();
|
||||
|
||||
$result = $this->ci->PersonLogModel->getLogsInFuture($person_id);
|
||||
if (hasData($result))
|
||||
{
|
||||
foreach ($result->retval as $log)
|
||||
{
|
||||
$logdata = json_decode($log->logdata);
|
||||
if (isset($logdata->name) && $logdata->name === self::PARKED_LOGNAME)
|
||||
{
|
||||
$delresult = $this->ci->PersonLogModel->deleteLog($log->log_id);
|
||||
if (isSuccess($delresult))
|
||||
{
|
||||
$deleted[] = $log->log_id;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return success($deleted);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets date until which a person is parked
|
||||
* @param $person_id
|
||||
* @return the date if person is parked, null otherwise
|
||||
*/
|
||||
public function getParkedDate($person_id)
|
||||
{
|
||||
$result = $this->ci->PersonLogModel->getLogsInFuture($person_id);
|
||||
|
||||
$parkeddate = null;
|
||||
|
||||
if (hasData($result))
|
||||
{
|
||||
foreach ($result->retval as $log)
|
||||
{
|
||||
$logdata = json_decode($log->logdata);
|
||||
if (isset($logdata->name) && $logdata->name === self::PARKED_LOGNAME)
|
||||
{
|
||||
$parkeddate = $log->zeitpunkt;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $parkeddate;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets person on hold, i.e. marks a person so no actions are expected for the person (e.g. as a prestudent).
|
||||
* Done by adding a logentry with a special name. can be undone only manually by clicking button.
|
||||
* @param $person_id
|
||||
* @param $date
|
||||
* @param $taetigkeit_kurzbz
|
||||
* @param string $app
|
||||
* @param null $oe_kurzbz
|
||||
* @param null $user
|
||||
* @return array
|
||||
*/
|
||||
public function setOnHold($person_id, $date, $taetigkeit_kurzbz, $app = 'core', $oe_kurzbz = null, $user = null)
|
||||
{
|
||||
$parked = $this->getParkedDate($person_id);
|
||||
|
||||
if (hasData($parked))
|
||||
return error("Person already parked");
|
||||
|
||||
$logjson = array(
|
||||
'name' => self::ONHOLD_LOGNAME
|
||||
);
|
||||
|
||||
return $this->_savePsLog($person_id, $date, $taetigkeit_kurzbz, $logjson, $app, $oe_kurzbz, $user);
|
||||
}
|
||||
|
||||
/**
|
||||
* Removes on hold status, i.e. removes all log entries with logname for on hold
|
||||
* @param $person_id
|
||||
* @return array
|
||||
*/
|
||||
public function removeOnHold($person_id)
|
||||
{
|
||||
$deleted = array();
|
||||
|
||||
$result = $this->ci->PersonLogModel->filterLog($person_id);
|
||||
if (hasData($result))
|
||||
{
|
||||
foreach ($result->retval as $log)
|
||||
{
|
||||
$logdata = json_decode($log->logdata);
|
||||
if (isset($logdata->name) && $logdata->name === self::ONHOLD_LOGNAME)
|
||||
{
|
||||
$delresult = $this->ci->PersonLogModel->deleteLog($log->log_id);
|
||||
if (isSuccess($delresult))
|
||||
{
|
||||
$deleted[] = $log->log_id;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return success($deleted);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets date until which a person is on hold
|
||||
* @param $person_id
|
||||
* @return the date if person is on hold, null otherwise
|
||||
*/
|
||||
public function getOnHoldDate($person_id)
|
||||
{
|
||||
$result = $this->ci->PersonLogModel->filterLog($person_id);
|
||||
|
||||
$onholddate = null;
|
||||
|
||||
if (hasData($result))
|
||||
{
|
||||
foreach ($result->retval as $log)
|
||||
{
|
||||
$logdata = json_decode($log->logdata);
|
||||
if (isset($logdata->name) && $logdata->name === self::ONHOLD_LOGNAME)
|
||||
{
|
||||
$onholddate = $log->zeitpunkt;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return $onholddate;
|
||||
}
|
||||
|
||||
/**
|
||||
* Saves a processstate log with specified parameters, including a specified log date.
|
||||
* @param $person_id
|
||||
|
||||
@@ -0,0 +1,75 @@
|
||||
<?php
|
||||
/**
|
||||
* Copyright (C) 2022 fhcomplete.net
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as
|
||||
* published by the Free Software Foundation; either version 2 of the
|
||||
* License, or (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program; if not, write to the Free Software
|
||||
* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
|
||||
*
|
||||
*/
|
||||
|
||||
require_once(dirname(__FILE__).'/../../vendor/nategood/httpful/bootstrap.php');
|
||||
|
||||
/**
|
||||
* Simple client to call the signature server
|
||||
*/
|
||||
class SignatureLib
|
||||
{
|
||||
// -------------------------------------------------------------------------------------------------
|
||||
// Public static methods
|
||||
|
||||
/**
|
||||
* Returns the list of signature inside the given file
|
||||
*/
|
||||
public static function list($inputFileName)
|
||||
{
|
||||
try
|
||||
{
|
||||
// Get the content of the given file
|
||||
$inputFileContent = file_get_contents($inputFileName);
|
||||
if ($inputFileContent === false) // if failed
|
||||
{
|
||||
error_log('An error occurred while getting the content from: '.$inputFileName);
|
||||
}
|
||||
else
|
||||
{
|
||||
// Posts the given file content + file name and expects a response in JSON format
|
||||
$resultPost = \Httpful\Request::post(SIGNATUR_URL.'/'.SIGNATUR_LIST_API)
|
||||
->sendsJson()
|
||||
->authenticateWith(SIGNATUR_USER, SIGNATUR_PASSWORD)
|
||||
->body('{"filename": "'.basename($inputFileName).'", "content": "'.base64_encode($inputFileContent).'"}')
|
||||
->expectsJson()
|
||||
->send();
|
||||
}
|
||||
}
|
||||
catch(\Httpful\Exception\ConnectionErrorException $cee) // Httpful exception
|
||||
{
|
||||
error_log($cee->getMessage());
|
||||
}
|
||||
catch (Exception $e) // any other exception
|
||||
{
|
||||
error_log($e->getMessage());
|
||||
}
|
||||
|
||||
// If the response is fine
|
||||
if (isset($resultPost->body) && is_object($resultPost->body)
|
||||
&& isset($resultPost->body->retval) && is_array($resultPost->body->retval))
|
||||
{
|
||||
return $resultPost->body->retval;
|
||||
}
|
||||
|
||||
// Otherwise return a null as error
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,103 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
class PlausicheckProducerLib
|
||||
{
|
||||
const CI_LIBRARY_PATH = 'application/libraries';
|
||||
const PLAUSI_ISSUES_FOLDER = 'issues/plausichecks';
|
||||
const EXECUTE_PLAUSI_CHECK_METHOD_NAME = 'executePlausiCheck';
|
||||
|
||||
private $_ci; // ci instance
|
||||
private $_currentStudiensemester; // current Studiensemester
|
||||
|
||||
// set fehler which can be produced by the job
|
||||
// structure: fehler_kurzbz => class (library) name for resolving
|
||||
private $_fehlerLibMappings = array(
|
||||
'AbbrecherAktiv' => 'AbbrecherAktiv',
|
||||
'AbschlussstatusFehlt' => 'AbschlussstatusFehlt',
|
||||
'AktSemesterNull' => 'AktSemesterNull',
|
||||
'AktiverStudentOhneStatus' => 'AktiverStudentOhneStatus',
|
||||
'AktiverStudentstatusOhneKontobuchung' => 'AktiverStudentstatusOhneKontobuchung',
|
||||
'AusbildungssemPrestudentUngleichAusbildungssemStatus' => 'AusbildungssemPrestudentUngleichAusbildungssemStatus',
|
||||
'BewerberNichtZumRtAngetreten' => 'BewerberNichtZumRtAngetreten',
|
||||
'DatumAbschlusspruefungFehlt' => 'DatumAbschlusspruefungFehlt',
|
||||
'DatumSponsionFehlt' => 'DatumSponsionFehlt',
|
||||
'DatumStudiensemesterFalscheReihenfolge' => 'DatumStudiensemesterFalscheReihenfolge',
|
||||
'FalscheAnzahlAbschlusspruefungen' => 'FalscheAnzahlAbschlusspruefungen',
|
||||
'FalscheAnzahlHeimatadressen' => 'FalscheAnzahlHeimatadressen',
|
||||
'FalscheAnzahlZustelladressen' => 'FalscheAnzahlZustelladressen',
|
||||
'GbDatumWeitZurueck' => 'GbDatumWeitZurueck',
|
||||
'InaktiverStudentAktiverStatus' => 'InaktiverStudentAktiverStatus',
|
||||
'IncomingHeimatNationOesterreich' => 'IncomingHeimatNationOesterreich',
|
||||
'IncomingOhneIoDatensatz' => 'IncomingOhneIoDatensatz',
|
||||
'IncomingOrGsFoerderrelevant' => 'IncomingOrGsFoerderrelevant',
|
||||
'InskriptionVorLetzerBismeldung' => 'InskriptionVorLetzerBismeldung',
|
||||
'NationNichtOesterreichAberGemeinde' => 'NationNichtOesterreichAberGemeinde',
|
||||
'OrgformStgUngleichOrgformPrestudent' => 'OrgformStgUngleichOrgformPrestudent',
|
||||
'PrestudentMischformOhneOrgform' => 'PrestudentMischformOhneOrgform',
|
||||
'StgPrestudentUngleichStgStudienplan' => 'StgPrestudentUngleichStgStudienplan',
|
||||
'StgPrestudentUngleichStgStudent' => 'StgPrestudentUngleichStgStudent',
|
||||
'StudentstatusNachAbbrecher' => 'StudentstatusNachAbbrecher'
|
||||
//'StudienplanUngueltig' => 'StudienplanUngueltig'
|
||||
);
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->_ci =& get_instance(); // get ci instance
|
||||
|
||||
// load models
|
||||
$this->_ci->load->model('organisation/studiensemester_model', 'StudiensemesterModel');
|
||||
|
||||
// get current Studiensemester
|
||||
$studiensemesterRes = $this->_ci->StudiensemesterModel->getAkt();
|
||||
if (hasData($studiensemesterRes)) $this->_currentStudiensemester = getData($studiensemesterRes)[0]->studiensemester_kurzbz;
|
||||
}
|
||||
|
||||
/**
|
||||
* Executes check for a fehler_kurzbz, returns the result.
|
||||
* @param $fehler_kurzbz string
|
||||
* @param $studiensemester_kurzbz string optionally needed for issue production
|
||||
* @param $studiengang_kz int optionally needed for issue production
|
||||
*/
|
||||
public function producePlausicheckIssue($fehler_kurzbz, $studiensemester_kurzbz = null, $studiengang_kz = null)
|
||||
{
|
||||
$libName = $this->_fehlerLibMappings[$fehler_kurzbz];
|
||||
|
||||
// get Studiensemester
|
||||
if (isEmptyString($studiensemester_kurzbz)) $studiensemester_kurzbz = $this->_currentStudiensemester;
|
||||
|
||||
// get path of library for issue to be produced
|
||||
$issuesLibPath = DOC_ROOT . self::CI_LIBRARY_PATH . '/' . self::PLAUSI_ISSUES_FOLDER . '/';
|
||||
$issuesLibFilePath = $issuesLibPath . $libName . '.php';
|
||||
|
||||
// check if library file exists
|
||||
if (!file_exists($issuesLibFilePath)) return error("Issue library file " . $issuesLibFilePath . " does not exist");
|
||||
|
||||
// load library connected to fehlercode
|
||||
$this->_ci->load->library(self::PLAUSI_ISSUES_FOLDER . '/'.$libName);
|
||||
|
||||
$lowercaseLibName = mb_strtolower($libName);
|
||||
|
||||
// check if method is defined in library class
|
||||
if (!is_callable(array($this->_ci->{$lowercaseLibName}, self::EXECUTE_PLAUSI_CHECK_METHOD_NAME)))
|
||||
return error("Method " . self::EXECUTE_PLAUSI_CHECK_METHOD_NAME . " is not defined in library $lowercaseLibName");
|
||||
|
||||
// pass the data needed for issue check
|
||||
$paramsForCheck = array(
|
||||
'studiensemester_kurzbz' => $studiensemester_kurzbz,
|
||||
'studiengang_kz' => $studiengang_kz
|
||||
);
|
||||
|
||||
// call the function for checking for issue production
|
||||
return $this->_ci->{$lowercaseLibName}->{self::EXECUTE_PLAUSI_CHECK_METHOD_NAME}($paramsForCheck);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets all fehler_kurzbz for fehler which need to be checked.
|
||||
*/
|
||||
public function getFehlerKurzbz()
|
||||
{
|
||||
return array_keys($this->_fehlerLibMappings);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
require_once('PlausiChecker.php');
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class AbbrecherAktiv extends PlausiChecker
|
||||
{
|
||||
public function executePlausiCheck($params)
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// pass parameters needed for plausicheck
|
||||
$studiengang_kz = isset($params['studiengang_kz']) ? $params['studiengang_kz'] : null;
|
||||
|
||||
// get all students failing the plausicheck
|
||||
$prestudentRes = $this->_ci->plausichecklib->getAbbrecherAktiv($studiengang_kz);
|
||||
|
||||
if (isError($prestudentRes)) return $prestudentRes;
|
||||
|
||||
if (hasData($prestudentRes))
|
||||
{
|
||||
$prestudents = getData($prestudentRes);
|
||||
|
||||
// populate results with data necessary for writing issues
|
||||
foreach ($prestudents as $prestudent)
|
||||
{
|
||||
$results[] = array(
|
||||
'person_id' => $prestudent->person_id,
|
||||
'oe_kurzbz' => $prestudent->prestudent_stg_oe_kurzbz,
|
||||
'fehlertext_params' => array('prestudent_id' => $prestudent->prestudent_id),
|
||||
'resolution_params' => array('prestudent_id' => $prestudent->prestudent_id)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// return the results
|
||||
return success($results);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
require_once('PlausiChecker.php');
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class AbschlussstatusFehlt extends PlausiChecker
|
||||
{
|
||||
public function executePlausiCheck($params)
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// pass parameters needed for plausicheck
|
||||
$studiensemester_kurzbz = isset($params['studiensemester_kurzbz']) ? $params['studiensemester_kurzbz'] : null;
|
||||
$studiengang_kz = isset($params['studiengang_kz']) ? $params['studiengang_kz'] : null;
|
||||
|
||||
// get all students failing the plausicheck
|
||||
$prestudentRes = $this->_ci->plausichecklib->getAbschlussstatusFehlt($studiensemester_kurzbz, $studiengang_kz);
|
||||
|
||||
if (isError($prestudentRes)) return $prestudentRes;
|
||||
|
||||
if (hasData($prestudentRes))
|
||||
{
|
||||
$prestudents = getData($prestudentRes);
|
||||
|
||||
// populate results with data necessary for writing issues
|
||||
foreach ($prestudents as $prestudent)
|
||||
{
|
||||
$results[] = array(
|
||||
'person_id' => $prestudent->person_id,
|
||||
'oe_kurzbz' => $prestudent->prestudent_stg_oe_kurzbz,
|
||||
'fehlertext_params' => array('prestudent_id' => $prestudent->prestudent_id),
|
||||
'resolution_params' => array('prestudent_id' => $prestudent->prestudent_id)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// return the results
|
||||
return success($results);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
require_once('PlausiChecker.php');
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class AktSemesterNull extends PlausiChecker
|
||||
{
|
||||
public function executePlausiCheck($params)
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// pass parameters needed for plausicheck
|
||||
$studiensemester_kurzbz = isset($params['studiensemester_kurzbz']) ? $params['studiensemester_kurzbz'] : null;
|
||||
$studiengang_kz = isset($params['studiengang_kz']) ? $params['studiengang_kz'] : null;
|
||||
|
||||
// get all students failing the plausicheck
|
||||
$prestudentRes = $this->_ci->plausichecklib->getAktSemesterNull($studiensemester_kurzbz, $studiengang_kz);
|
||||
|
||||
if (isError($prestudentRes)) return $prestudentRes;
|
||||
|
||||
if (hasData($prestudentRes))
|
||||
{
|
||||
$prestudents = getData($prestudentRes);
|
||||
|
||||
// populate results with data necessary for writing issues
|
||||
foreach ($prestudents as $prestudent)
|
||||
{
|
||||
$results[] = array(
|
||||
'person_id' => $prestudent->person_id,
|
||||
'oe_kurzbz' => $prestudent->prestudent_stg_oe_kurzbz,
|
||||
'fehlertext_params' => array(
|
||||
'prestudent_id' => $prestudent->prestudent_id,
|
||||
'studiensemester_kurzbz' => $prestudent->studiensemester_kurzbz
|
||||
),
|
||||
'resolution_params' => array(
|
||||
'prestudent_id' => $prestudent->prestudent_id,
|
||||
'studiensemester_kurzbz' => $prestudent->studiensemester_kurzbz
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// return the results
|
||||
return success($results);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
require_once('PlausiChecker.php');
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class AktiverStudentOhneStatus extends PlausiChecker
|
||||
{
|
||||
public function executePlausiCheck($params)
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// pass parameters needed for plausicheck
|
||||
$studiengang_kz = isset($params['studiengang_kz']) ? $params['studiengang_kz'] : null;
|
||||
|
||||
// get all students failing the plausicheck
|
||||
$prestudentRes = $this->_ci->plausichecklib->getAktiverStudentOhneStatus($studiengang_kz);
|
||||
|
||||
if (isError($prestudentRes)) return $prestudentRes;
|
||||
|
||||
if (hasData($prestudentRes))
|
||||
{
|
||||
$prestudents = getData($prestudentRes);
|
||||
|
||||
// populate results with data necessary for writing issues
|
||||
foreach ($prestudents as $prestudent)
|
||||
{
|
||||
$results[] = array(
|
||||
'person_id' => $prestudent->person_id,
|
||||
'oe_kurzbz' => $prestudent->prestudent_stg_oe_kurzbz,
|
||||
'fehlertext_params' => array('prestudent_id' => $prestudent->prestudent_id),
|
||||
'resolution_params' => array('prestudent_id' => $prestudent->prestudent_id)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// return the results
|
||||
return success($results);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
require_once('PlausiChecker.php');
|
||||
|
||||
/**
|
||||
* Student with active status should have been charged, i.e. have a Kontobuchung with negative or zero value.
|
||||
*/
|
||||
class AktiverStudentstatusOhneKontobuchung extends PlausiChecker
|
||||
{
|
||||
public function executePlausiCheck($params)
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// pass parameters needed for plausicheck
|
||||
$studiensemester_kurzbz = isset($params['studiensemester_kurzbz']) ? $params['studiensemester_kurzbz'] : null;
|
||||
$studiengang_kz = isset($params['studiengang_kz']) ? $params['studiengang_kz'] : null;
|
||||
|
||||
// get all students failing the plausicheck
|
||||
$prestudentRes = $this->_ci->plausichecklib->getAktiverStudentstatusOhneKontobuchung($studiensemester_kurzbz, $studiengang_kz);
|
||||
|
||||
if (isError($prestudentRes)) return $prestudentRes;
|
||||
|
||||
if (hasData($prestudentRes))
|
||||
{
|
||||
$prestudents = getData($prestudentRes);
|
||||
|
||||
// populate results with data necessary for writing issues
|
||||
foreach ($prestudents as $prestudent)
|
||||
{
|
||||
$results[] = array(
|
||||
'person_id' => $prestudent->person_id,
|
||||
'oe_kurzbz' => $prestudent->prestudent_stg_oe_kurzbz,
|
||||
'fehlertext_params' => array(
|
||||
'prestudent_id' => $prestudent->prestudent_id,
|
||||
'studiensemester_kurzbz' => $prestudent->studiensemester_kurzbz
|
||||
),
|
||||
'resolution_params' => array(
|
||||
'prestudent_id' => $prestudent->prestudent_id,
|
||||
'studiensemester_kurzbz' => $prestudent->studiensemester_kurzbz
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// return the results
|
||||
return success($results);
|
||||
}
|
||||
}
|
||||
+56
@@ -0,0 +1,56 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
require_once('PlausiChecker.php');
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class AusbildungssemPrestudentUngleichAusbildungssemStatus extends PlausiChecker
|
||||
{
|
||||
public function executePlausiCheck($params)
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// pass parameters needed for plausicheck
|
||||
$studiensemester_kurzbz = isset($params['studiensemester_kurzbz']) ? $params['studiensemester_kurzbz'] : null;
|
||||
$studiengang_kz = isset($params['studiengang_kz']) ? $params['studiengang_kz'] : null;
|
||||
|
||||
// get all students failing the plausicheck
|
||||
$prestudentRes = $this->_ci->plausichecklib->getAusbildungssemPrestudentUngleichAusbildungssemStatus(
|
||||
$studiensemester_kurzbz,
|
||||
$studiengang_kz
|
||||
);
|
||||
|
||||
if (isError($prestudentRes)) return $prestudentRes;
|
||||
|
||||
if (hasData($prestudentRes))
|
||||
{
|
||||
$prestudents = getData($prestudentRes);
|
||||
|
||||
// populate results with data necessary for writing issues
|
||||
foreach ($prestudents as $prestudent)
|
||||
{
|
||||
$results[] = array(
|
||||
'person_id' => $prestudent->person_id,
|
||||
'oe_kurzbz' => $prestudent->prestudent_stg_oe_kurzbz,
|
||||
'fehlertext_params' => array(
|
||||
'status_ausbildungssemester' => $prestudent->status_ausbildungssemester,
|
||||
'student_ausbildungssemester' => $prestudent->student_ausbildungssemester,
|
||||
'student_uid' => $prestudent->student_uid,
|
||||
'prestudent_id' => $prestudent->prestudent_id,
|
||||
'studiensemester_kurzbz' => $prestudent->studiensemester_kurzbz
|
||||
),
|
||||
'resolution_params' => array(
|
||||
'prestudent_id' => $prestudent->prestudent_id,
|
||||
'studiensemester_kurzbz' => $prestudent->studiensemester_kurzbz
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// return the results
|
||||
return success($results);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
require_once('PlausiChecker.php');
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class BewerberNichtZumRtAngetreten extends PlausiChecker
|
||||
{
|
||||
public function executePlausiCheck($params)
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// pass parameters needed for plausicheck
|
||||
$studiensemester_kurzbz = isset($params['studiensemester_kurzbz']) ? $params['studiensemester_kurzbz'] : null;
|
||||
$studiengang_kz = isset($params['studiengang_kz']) ? $params['studiengang_kz'] : null;
|
||||
|
||||
// get all students failing the plausicheck
|
||||
$prestudentRes = $this->_ci->plausichecklib->getBewerberNichtZumRtAngetreten($studiensemester_kurzbz, $studiengang_kz);
|
||||
|
||||
if (isError($prestudentRes)) return $prestudentRes;
|
||||
|
||||
if (hasData($prestudentRes))
|
||||
{
|
||||
$prestudents = getData($prestudentRes);
|
||||
|
||||
// populate results with data necessary for writing issues
|
||||
foreach ($prestudents as $prestudent)
|
||||
{
|
||||
$results[] = array(
|
||||
'person_id' => $prestudent->person_id,
|
||||
'oe_kurzbz' => $prestudent->prestudent_stg_oe_kurzbz,
|
||||
'fehlertext_params' => array('prestudent_id' => $prestudent->prestudent_id),
|
||||
'resolution_params' => array(
|
||||
'studiensemester_kurzbz' => $prestudent->studiensemester_kurzbz,
|
||||
'prestudent_id' => $prestudent->prestudent_id
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// return the results
|
||||
return success($results);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
require_once('PlausiChecker.php');
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class DatumAbschlusspruefungFehlt extends PlausiChecker
|
||||
{
|
||||
public function executePlausiCheck($params)
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// pass parameters needed for plausicheck
|
||||
$studiensemester_kurzbz = isset($params['studiensemester_kurzbz']) ? $params['studiensemester_kurzbz'] : null;
|
||||
$studiengang_kz = isset($params['studiengang_kz']) ? $params['studiengang_kz'] : null;
|
||||
|
||||
// get all students failing the plausicheck
|
||||
$prestudentRes = $this->_ci->plausichecklib->getDatumAbschlusspruefungFehlt($studiensemester_kurzbz, $studiengang_kz);
|
||||
|
||||
if (isError($prestudentRes)) return $prestudentRes;
|
||||
|
||||
if (hasData($prestudentRes))
|
||||
{
|
||||
$prestudents = getData($prestudentRes);
|
||||
|
||||
// populate results with data necessary for writing issues
|
||||
foreach ($prestudents as $prestudent)
|
||||
{
|
||||
$results[] = array(
|
||||
'person_id' => $prestudent->person_id,
|
||||
'oe_kurzbz' => $prestudent->prestudent_stg_oe_kurzbz,
|
||||
'fehlertext_params' => array(
|
||||
'prestudent_id' => $prestudent->prestudent_id,
|
||||
'abschlusspruefung_id' => $prestudent->abschlusspruefung_id
|
||||
),
|
||||
'resolution_params' => array('abschlusspruefung_id' => $prestudent->abschlusspruefung_id)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// return the results
|
||||
return success($results);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
require_once('PlausiChecker.php');
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class DatumSponsionFehlt extends PlausiChecker
|
||||
{
|
||||
public function executePlausiCheck($params)
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// pass parameters needed for plausicheck
|
||||
$studiensemester_kurzbz = isset($params['studiensemester_kurzbz']) ? $params['studiensemester_kurzbz'] : null;
|
||||
$studiengang_kz = isset($params['studiengang_kz']) ? $params['studiengang_kz'] : null;
|
||||
|
||||
// get all students failing the plausicheck
|
||||
$prestudentRes = $this->_ci->plausichecklib->getDatumSponsionFehlt($studiensemester_kurzbz, $studiengang_kz);
|
||||
|
||||
if (isError($prestudentRes)) return $prestudentRes;
|
||||
|
||||
if (hasData($prestudentRes))
|
||||
{
|
||||
$prestudents = getData($prestudentRes);
|
||||
|
||||
// populate results with data necessary for writing issues
|
||||
foreach ($prestudents as $prestudent)
|
||||
{
|
||||
$results[] = array(
|
||||
'person_id' => $prestudent->person_id,
|
||||
'oe_kurzbz' => $prestudent->prestudent_stg_oe_kurzbz,
|
||||
'fehlertext_params' => array(
|
||||
'prestudent_id' => $prestudent->prestudent_id,
|
||||
'abschlusspruefung_id' => $prestudent->abschlusspruefung_id
|
||||
),
|
||||
'resolution_params' => array('abschlusspruefung_id' => $prestudent->abschlusspruefung_id)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// return the results
|
||||
return success($results);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
require_once('PlausiChecker.php');
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class DatumStudiensemesterFalscheReihenfolge extends PlausiChecker
|
||||
{
|
||||
public function executePlausiCheck($params)
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// pass parameters needed for plausicheck
|
||||
$studiengang_kz = isset($params['studiengang_kz']) ? $params['studiengang_kz'] : null;
|
||||
|
||||
// get all students failing the plausicheck
|
||||
$prestudentRes = $this->_ci->plausichecklib->getDatumStudiensemesterFalscheReihenfolge($studiengang_kz);
|
||||
|
||||
if (isError($prestudentRes)) return $prestudentRes;
|
||||
|
||||
if (hasData($prestudentRes))
|
||||
{
|
||||
$prestudents = getData($prestudentRes);
|
||||
|
||||
// populate results with data necessary for writing issues
|
||||
foreach ($prestudents as $prestudent)
|
||||
{
|
||||
$results[] = array(
|
||||
'person_id' => $prestudent->person_id,
|
||||
'oe_kurzbz' => $prestudent->prestudent_stg_oe_kurzbz,
|
||||
'fehlertext_params' => array('prestudent_id' => $prestudent->prestudent_id),
|
||||
'resolution_params' => array(
|
||||
'prestudent_id' => $prestudent->prestudent_id
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// return the results
|
||||
return success($results);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
require_once('PlausiChecker.php');
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class FalscheAnzahlAbschlusspruefungen extends PlausiChecker
|
||||
{
|
||||
public function executePlausiCheck($params)
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// pass parameters needed for plausicheck
|
||||
$studiensemester_kurzbz = isset($params['studiensemester_kurzbz']) ? $params['studiensemester_kurzbz'] : null;
|
||||
$studiengang_kz = isset($params['studiengang_kz']) ? $params['studiengang_kz'] : null;
|
||||
|
||||
// get all students failing the plausicheck
|
||||
$prestudentRes = $this->_ci->plausichecklib->getFalscheAnzahlAbschlusspruefungen($studiensemester_kurzbz, $studiengang_kz);
|
||||
|
||||
if (isError($prestudentRes)) return $prestudentRes;
|
||||
|
||||
if (hasData($prestudentRes))
|
||||
{
|
||||
$prestudents = getData($prestudentRes);
|
||||
|
||||
// populate results with data necessary for writing issues
|
||||
foreach ($prestudents as $prestudent)
|
||||
{
|
||||
$results[] = array(
|
||||
'person_id' => $prestudent->person_id,
|
||||
'oe_kurzbz' => $prestudent->prestudent_stg_oe_kurzbz,
|
||||
'fehlertext_params' => array('prestudent_id' => $prestudent->prestudent_id),
|
||||
'resolution_params' => array('prestudent_id' => $prestudent->prestudent_id)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// return the results
|
||||
return success($results);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
require_once('PlausiChecker.php');
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class FalscheAnzahlHeimatadressen extends PlausiChecker
|
||||
{
|
||||
public function executePlausiCheck($params)
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// pass parameters needed for plausicheck
|
||||
$studiensemester_kurzbz = isset($params['studiensemester_kurzbz']) ? $params['studiensemester_kurzbz'] : null;
|
||||
$studiengang_kz = isset($params['studiengang_kz']) ? $params['studiengang_kz'] : null;
|
||||
|
||||
// get all students failing the plausicheck
|
||||
$personRes = $this->_ci->plausichecklib->getFalscheAnzahlHeimatadressen($studiensemester_kurzbz, $studiengang_kz);
|
||||
|
||||
if (isError($personRes)) return $personRes;
|
||||
|
||||
if (hasData($personRes))
|
||||
{
|
||||
$persons = getData($personRes);
|
||||
|
||||
// populate results with data necessary for writing issues
|
||||
foreach ($persons as $person)
|
||||
{
|
||||
$results[] = array(
|
||||
'person_id' => $person->person_id,
|
||||
'resolution_params' => array('person_id' => $person->person_id)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// return the results
|
||||
return success($results);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
require_once('PlausiChecker.php');
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class FalscheAnzahlZustelladressen extends PlausiChecker
|
||||
{
|
||||
public function executePlausiCheck($params)
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// pass parameters needed for plausicheck
|
||||
$studiensemester_kurzbz = isset($params['studiensemester_kurzbz']) ? $params['studiensemester_kurzbz'] : null;
|
||||
$studiengang_kz = isset($params['studiengang_kz']) ? $params['studiengang_kz'] : null;
|
||||
|
||||
// get all students failing the plausicheck
|
||||
$personRes = $this->_ci->plausichecklib->getFalscheAnzahlZustelladressen($studiensemester_kurzbz, $studiengang_kz);
|
||||
|
||||
if (isError($personRes)) return $personRes;
|
||||
|
||||
if (hasData($personRes))
|
||||
{
|
||||
$persons = getData($personRes);
|
||||
|
||||
// populate results with data necessary for writing issues
|
||||
foreach ($persons as $person)
|
||||
{
|
||||
$results[] = array(
|
||||
'person_id' => $person->person_id,
|
||||
'resolution_params' => array('person_id' => $person->person_id)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// return the results
|
||||
return success($results);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
require_once('PlausiChecker.php');
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class GbDatumWeitZurueck extends PlausiChecker
|
||||
{
|
||||
public function executePlausiCheck($params)
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// pass parameters needed for plausicheck
|
||||
$studiensemester_kurzbz = isset($params['studiensemester_kurzbz']) ? $params['studiensemester_kurzbz'] : null;
|
||||
$studiengang_kz = isset($params['studiengang_kz']) ? $params['studiengang_kz'] : null;
|
||||
|
||||
// get all students failing the plausicheck
|
||||
$personRes = $this->_ci->plausichecklib->getGbDatumWeitZurueck($studiensemester_kurzbz, $studiengang_kz);
|
||||
|
||||
if (isError($personRes)) return $personRes;
|
||||
|
||||
if (hasData($personRes))
|
||||
{
|
||||
$persons = getData($personRes);
|
||||
|
||||
// populate results with data necessary for writing issues
|
||||
foreach ($persons as $person)
|
||||
{
|
||||
$results[] = array(
|
||||
'person_id' => $person->person_id,
|
||||
'resolution_params' => array('person_id' => $person->person_id)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// return the results
|
||||
return success($results);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,47 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
require_once('PlausiChecker.php');
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class InaktiverStudentAktiverStatus extends PlausiChecker
|
||||
{
|
||||
public function executePlausiCheck($params)
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// pass parameters needed for plausicheck
|
||||
$studiensemester_kurzbz = isset($params['studiensemester_kurzbz']) ? $params['studiensemester_kurzbz'] : null;
|
||||
$studiengang_kz = isset($params['studiengang_kz']) ? $params['studiengang_kz'] : null;
|
||||
|
||||
// get all students failing the plausicheck
|
||||
$prestudentRes = $this->_ci->plausichecklib->getInaktiverStudentAktiverStatus($studiensemester_kurzbz, $studiengang_kz);
|
||||
|
||||
if (isError($prestudentRes)) return $prestudentRes;
|
||||
|
||||
if (hasData($prestudentRes))
|
||||
{
|
||||
$prestudents = getData($prestudentRes);
|
||||
|
||||
// populate results with data necessary for writing issues
|
||||
foreach ($prestudents as $prestudent)
|
||||
{
|
||||
$results[] = array(
|
||||
'person_id' => $prestudent->person_id,
|
||||
'oe_kurzbz' => $prestudent->prestudent_stg_oe_kurzbz,
|
||||
'fehlertext_params' => array('prestudent_id' => $prestudent->prestudent_id),
|
||||
'resolution_params' => array(
|
||||
'prestudent_id' => $prestudent->prestudent_id,
|
||||
'studiensemester_kurzbz' => $studiensemester_kurzbz
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// return the results
|
||||
return success($results);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
require_once('PlausiChecker.php');
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class IncomingHeimatNationOesterreich extends PlausiChecker
|
||||
{
|
||||
public function executePlausiCheck($params)
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// pass parameters needed for plausicheck
|
||||
$studiensemester_kurzbz = isset($params['studiensemester_kurzbz']) ? $params['studiensemester_kurzbz'] : null;
|
||||
$studiengang_kz = isset($params['studiengang_kz']) ? $params['studiengang_kz'] : null;
|
||||
|
||||
// get all students failing the plausicheck
|
||||
$personRes = $this->_ci->plausichecklib->getIncomingHeimatNationOesterreich($studiensemester_kurzbz, $studiengang_kz);
|
||||
|
||||
if (isError($personRes)) return $personRes;
|
||||
|
||||
if (hasData($personRes))
|
||||
{
|
||||
$persons = getData($personRes);
|
||||
|
||||
// populate results with data necessary for writing issues
|
||||
foreach ($persons as $person)
|
||||
{
|
||||
$results[] = array(
|
||||
'person_id' => $person->person_id,
|
||||
'resolution_params' => array('person_id' => $person->person_id, 'studiensemester_kurzbz' => $studiensemester_kurzbz)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// return the results
|
||||
return success($results);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
require_once('PlausiChecker.php');
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class IncomingOhneIoDatensatz extends PlausiChecker
|
||||
{
|
||||
public function executePlausiCheck($params)
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// pass parameters needed for plausicheck
|
||||
$studiengang_kz = isset($params['studiengang_kz']) ? $params['studiengang_kz'] : null;
|
||||
|
||||
// get all students failing the plausicheck
|
||||
$prestudentRes = $this->_ci->plausichecklib->getIncomingOhneIoDatensatz($studiengang_kz);
|
||||
|
||||
if (isError($prestudentRes)) return $prestudentRes;
|
||||
|
||||
if (hasData($prestudentRes))
|
||||
{
|
||||
$prestudents = getData($prestudentRes);
|
||||
|
||||
// populate results with data necessary for writing issues
|
||||
foreach ($prestudents as $prestudent)
|
||||
{
|
||||
$results[] = array(
|
||||
'person_id' => $prestudent->person_id,
|
||||
'oe_kurzbz' => $prestudent->prestudent_stg_oe_kurzbz,
|
||||
'fehlertext_params' => array('prestudent_id' => $prestudent->prestudent_id),
|
||||
'resolution_params' => array('prestudent_id' => $prestudent->prestudent_id)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// return the results
|
||||
return success($results);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,44 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
require_once('PlausiChecker.php');
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class IncomingOrGsFoerderrelevant extends PlausiChecker
|
||||
{
|
||||
public function executePlausiCheck($params)
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// pass parameters needed for plausicheck
|
||||
$studiensemester_kurzbz = isset($params['studiensemester_kurzbz']) ? $params['studiensemester_kurzbz'] : null;
|
||||
$studiengang_kz = isset($params['studiengang_kz']) ? $params['studiengang_kz'] : null;
|
||||
|
||||
// get all students failing the plausicheck
|
||||
$prestudentRes = $this->_ci->plausichecklib->getIncomingOrGsFoerderrelevant($studiensemester_kurzbz, $studiengang_kz);
|
||||
|
||||
if (isError($prestudentRes)) return $prestudentRes;
|
||||
|
||||
if (hasData($prestudentRes))
|
||||
{
|
||||
$prestudents = getData($prestudentRes);
|
||||
|
||||
// populate results with data necessary for writing issues
|
||||
foreach ($prestudents as $prestudent)
|
||||
{
|
||||
$results[] = array(
|
||||
'person_id' => $prestudent->person_id,
|
||||
'oe_kurzbz' => $prestudent->prestudent_stg_oe_kurzbz,
|
||||
'fehlertext_params' => array('prestudent_id' => $prestudent->prestudent_id),
|
||||
'resolution_params' => array('prestudent_id' => $prestudent->prestudent_id)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// return the results
|
||||
return success($results);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
require_once('PlausiChecker.php');
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class InskriptionVorLetzerBismeldung extends PlausiChecker
|
||||
{
|
||||
public function executePlausiCheck($params)
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// pass parameters needed for plausicheck
|
||||
$studiensemester_kurzbz = isset($params['studiensemester_kurzbz']) ? $params['studiensemester_kurzbz'] : null;
|
||||
$studiengang_kz = isset($params['studiengang_kz']) ? $params['studiengang_kz'] : null;
|
||||
|
||||
// get all students failing the plausicheck
|
||||
$prestudentRes = $this->_ci->plausichecklib->getInskriptionVorLetzerBismeldung($studiensemester_kurzbz, $studiengang_kz);
|
||||
|
||||
if (isError($prestudentRes)) return $prestudentRes;
|
||||
|
||||
if (hasData($prestudentRes))
|
||||
{
|
||||
$prestudents = getData($prestudentRes);
|
||||
|
||||
// populate results with data necessary for writing issues
|
||||
foreach ($prestudents as $prestudent)
|
||||
{
|
||||
$results[] = array(
|
||||
'person_id' => $prestudent->person_id,
|
||||
'oe_kurzbz' => $prestudent->prestudent_stg_oe_kurzbz,
|
||||
'fehlertext_params' => array(
|
||||
'datum_bismeldung' => date_format(date_create($prestudent->datum_bismeldung), 'd.m.Y'),
|
||||
'prestudent_id' => $prestudent->prestudent_id,
|
||||
'studiensemester_kurzbz' => $prestudent->studiensemester_kurzbz
|
||||
),
|
||||
'resolution_params' => array(
|
||||
'prestudent_id' => $prestudent->prestudent_id,
|
||||
'studiensemester_kurzbz' => $prestudent->studiensemester_kurzbz
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// return the results
|
||||
return success($results);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,42 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
require_once('PlausiChecker.php');
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class NationNichtOesterreichAberGemeinde extends PlausiChecker
|
||||
{
|
||||
public function executePlausiCheck($params)
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// pass parameters needed for plausicheck
|
||||
$studiengang_kz = isset($params['studiengang_kz']) ? $params['studiengang_kz'] : null;
|
||||
|
||||
// get all students failing the plausicheck
|
||||
$personRes = $this->_ci->plausichecklib->getNationNichtOesterreichAberGemeinde($studiengang_kz);
|
||||
|
||||
if (isError($personRes)) return $personRes;
|
||||
|
||||
if (hasData($personRes))
|
||||
{
|
||||
$persons = getData($personRes);
|
||||
|
||||
// populate results with data necessary for writing issues
|
||||
foreach ($persons as $person)
|
||||
{
|
||||
$results[] = array(
|
||||
'person_id' => $person->person_id,
|
||||
'fehlertext_params' => array('gemeinde' => $person->gemeinde, 'adresse_id' => $person->adresse_id),
|
||||
'resolution_params' => array('adresse_id' => $person->adresse_id)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// return the results
|
||||
return success($results);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
require_once('PlausiChecker.php');
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class OrgformStgUngleichOrgformPrestudent extends PlausiChecker
|
||||
{
|
||||
public function executePlausiCheck($params)
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// pass parameters needed for plausicheck
|
||||
$studiensemester_kurzbz = isset($params['studiensemester_kurzbz']) ? $params['studiensemester_kurzbz'] : null;
|
||||
$studiengang_kz = isset($params['studiengang_kz']) ? $params['studiengang_kz'] : null;
|
||||
|
||||
// get all students failing the plausicheck
|
||||
$prestudentRes = $this->_ci->plausichecklib->getOrgformStgUngleichOrgformPrestudent($studiensemester_kurzbz, $studiengang_kz);
|
||||
|
||||
if (isError($prestudentRes)) return $prestudentRes;
|
||||
|
||||
if (hasData($prestudentRes))
|
||||
{
|
||||
$prestudents = getData($prestudentRes);
|
||||
|
||||
// populate results with data necessary for writing issues
|
||||
foreach ($prestudents as $prestudent)
|
||||
{
|
||||
$results[] = array(
|
||||
'person_id' => $prestudent->person_id,
|
||||
'oe_kurzbz' => $prestudent->prestudent_stg_oe_kurzbz,
|
||||
'fehlertext_params' => array(
|
||||
'student_studiengang' => $prestudent->student_studiengang,
|
||||
'student_orgform' => $prestudent->student_orgform,
|
||||
'prestudent_id' => $prestudent->prestudent_id,
|
||||
'studiensemester_kurzbz' => $prestudent->studiensemester_kurzbz
|
||||
),
|
||||
'resolution_params' => array(
|
||||
'prestudent_id' => $prestudent->prestudent_id,
|
||||
'studiensemester_kurzbz' => $prestudent->studiensemester_kurzbz
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// return the results
|
||||
return success($results);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,24 @@
|
||||
<?php
|
||||
|
||||
/**
|
||||
* class defining ressources and method to use for plausicheck issue producer
|
||||
*/
|
||||
abstract class PlausiChecker
|
||||
{
|
||||
protected $_ci; // code igniter instance
|
||||
|
||||
public function __construct()
|
||||
{
|
||||
$this->_ci =& get_instance(); // get code igniter instance
|
||||
|
||||
// load libraries
|
||||
$this->_ci->load->library('issues/PlausicheckLib'); // load plausicheck library
|
||||
}
|
||||
|
||||
/**
|
||||
* Executes a plausi check.
|
||||
* @param $paramsForChecking array parameters needed for executing the check
|
||||
* @return array with objects which failed the plausi check
|
||||
*/
|
||||
abstract public function executePlausiCheck($paramsForChecking);
|
||||
}
|
||||
@@ -0,0 +1,50 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
require_once('PlausiChecker.php');
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class PrestudentMischformOhneOrgform extends PlausiChecker
|
||||
{
|
||||
public function executePlausiCheck($params)
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// pass parameters needed for plausicheck
|
||||
$studiensemester_kurzbz = isset($params['studiensemester_kurzbz']) ? $params['studiensemester_kurzbz'] : null;
|
||||
$studiengang_kz = isset($params['studiengang_kz']) ? $params['studiengang_kz'] : null;
|
||||
|
||||
// get all students failing the plausicheck
|
||||
$prestudentRes = $this->_ci->plausichecklib->getPrestudentMischformOhneOrgform($studiensemester_kurzbz, $studiengang_kz);
|
||||
|
||||
if (isError($prestudentRes)) return $prestudentRes;
|
||||
|
||||
if (hasData($prestudentRes))
|
||||
{
|
||||
$prestudents = getData($prestudentRes);
|
||||
|
||||
// populate results with data necessary for writing issues
|
||||
foreach ($prestudents as $prestudent)
|
||||
{
|
||||
$results[] = array(
|
||||
'person_id' => $prestudent->person_id,
|
||||
'oe_kurzbz' => $prestudent->prestudent_stg_oe_kurzbz,
|
||||
'fehlertext_params' => array(
|
||||
'prestudent_id' => $prestudent->prestudent_id,
|
||||
'studiensemester_kurzbz' => $prestudent->studiensemester_kurzbz
|
||||
),
|
||||
'resolution_params' => array(
|
||||
'prestudent_id' => $prestudent->prestudent_id,
|
||||
'studiensemester_kurzbz' => $prestudent->studiensemester_kurzbz
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// return the results
|
||||
return success($results);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
require_once('PlausiChecker.php');
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class StgPrestudentUngleichStgStudent extends PlausiChecker
|
||||
{
|
||||
public function executePlausiCheck($params)
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// pass parameters needed for plausicheck
|
||||
$studiengang_kz = isset($params['studiengang_kz']) ? $params['studiengang_kz'] : null;
|
||||
|
||||
// get all students failing the plausicheck
|
||||
$prestudentRes = $this->_ci->plausichecklib->getStgPrestudentUngleichStgStudent($studiengang_kz);
|
||||
|
||||
if (isError($prestudentRes)) return $prestudentRes;
|
||||
|
||||
if (hasData($prestudentRes))
|
||||
{
|
||||
$prestudents = getData($prestudentRes);
|
||||
|
||||
// populate results with data necessary for writing issues
|
||||
foreach ($prestudents as $prestudent)
|
||||
{
|
||||
$results[] = array(
|
||||
'person_id' => $prestudent->person_id,
|
||||
'oe_kurzbz' => $prestudent->prestudent_stg_oe_kurzbz,
|
||||
'fehlertext_params' => array('prestudent_id' => $prestudent->prestudent_id),
|
||||
'resolution_params' => array('prestudent_id' => $prestudent->prestudent_id)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// return the results
|
||||
return success($results);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
require_once('PlausiChecker.php');
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class StgPrestudentUngleichStgStudienplan extends PlausiChecker
|
||||
{
|
||||
public function executePlausiCheck($params)
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// pass parameters needed for plausicheck
|
||||
$studiengang_kz = isset($params['studiengang_kz']) ? $params['studiengang_kz'] : null;
|
||||
|
||||
// get all students failing the plausicheck
|
||||
$prestudentRes = $this->_ci->plausichecklib->getStgPrestudentUngleichStgStudienplan($studiengang_kz);
|
||||
|
||||
if (isError($prestudentRes)) return $prestudentRes;
|
||||
|
||||
if (hasData($prestudentRes))
|
||||
{
|
||||
$prestudents = getData($prestudentRes);
|
||||
|
||||
// populate results with data necessary for writing issues
|
||||
foreach ($prestudents as $prestudent)
|
||||
{
|
||||
$results[] = array(
|
||||
'person_id' => $prestudent->person_id,
|
||||
'oe_kurzbz' => $prestudent->prestudent_stg_oe_kurzbz,
|
||||
'fehlertext_params' => array('prestudent_id' => $prestudent->prestudent_id, 'studienplan' => $prestudent->studienplan),
|
||||
'resolution_params' => array('prestudent_id' => $prestudent->prestudent_id, 'studienordnung_id' => $prestudent->studienordnung_id)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// return the results
|
||||
return success($results);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,43 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
require_once('PlausiChecker.php');
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class StudentstatusNachAbbrecher extends PlausiChecker
|
||||
{
|
||||
public function executePlausiCheck($params)
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// pass parameters needed for plausicheck
|
||||
$studiengang_kz = isset($params['studiengang_kz']) ? $params['studiengang_kz'] : null;
|
||||
|
||||
// get all students failing the plausicheck
|
||||
$prestudentRes = $this->_ci->plausichecklib->getStudentstatusNachAbbrecher($studiengang_kz);
|
||||
|
||||
if (isError($prestudentRes)) return $prestudentRes;
|
||||
|
||||
if (hasData($prestudentRes))
|
||||
{
|
||||
$prestudents = getData($prestudentRes);
|
||||
|
||||
// populate results with data necessary for writing issues
|
||||
foreach ($prestudents as $prestudent)
|
||||
{
|
||||
$results[] = array(
|
||||
'person_id' => $prestudent->person_id,
|
||||
'oe_kurzbz' => $prestudent->prestudent_stg_oe_kurzbz,
|
||||
'fehlertext_params' => array('prestudent_id' => $prestudent->prestudent_id),
|
||||
'resolution_params' => array('prestudent_id' => $prestudent->prestudent_id)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// return the results
|
||||
return success($results);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,51 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
require_once('PlausiChecker.php');
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
class StudienplanUngueltig extends PlausiChecker
|
||||
{
|
||||
public function executePlausiCheck($params)
|
||||
{
|
||||
$results = array();
|
||||
|
||||
// pass parameters needed for plausicheck
|
||||
$studiensemester_kurzbz = isset($params['studiensemester_kurzbz']) ? $params['studiensemester_kurzbz'] : null;
|
||||
$studiengang_kz = isset($params['studiengang_kz']) ? $params['studiengang_kz'] : null;
|
||||
|
||||
// get all students failing the plausicheck
|
||||
$prestudentRes = $this->_ci->plausichecklib->getStudienplanUngueltig($studiensemester_kurzbz, $studiengang_kz);
|
||||
|
||||
if (isError($prestudentRes)) return $prestudentRes;
|
||||
|
||||
if (hasData($prestudentRes))
|
||||
{
|
||||
$prestudents = getData($prestudentRes);
|
||||
|
||||
// populate results with data necessary for writing issues
|
||||
foreach ($prestudents as $prestudent)
|
||||
{
|
||||
$results[] = array(
|
||||
'person_id' => $prestudent->person_id,
|
||||
'oe_kurzbz' => $prestudent->prestudent_stg_oe_kurzbz,
|
||||
'fehlertext_params' => array(
|
||||
'studienplan' => $prestudent->studienplan,
|
||||
'ausbildungssemester' => $prestudent->ausbildungssemester,
|
||||
'prestudent_id' => $prestudent->prestudent_id
|
||||
),
|
||||
'resolution_params' => array(
|
||||
'prestudent_id' => $prestudent->prestudent_id,
|
||||
'studiensemester_kurzbz' => $prestudent->studiensemester_kurzbz
|
||||
)
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
// return the results
|
||||
return success($results);
|
||||
}
|
||||
}
|
||||
-1
@@ -15,7 +15,6 @@ class CORE_INOUT_0006 implements IIssueResolvedChecker
|
||||
$this->_ci =& get_instance(); // get code igniter instance
|
||||
|
||||
$this->_ci->load->model('codex/Bisio_model', 'BisioModel');
|
||||
//$this->_ci->load->model('codex/Aufenthaltfoerderung_model', 'AufenthaltfoerderungModel');
|
||||
|
||||
// get all Zwecke
|
||||
$this->_ci->BisioModel->addSelect('ects_erworben');
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Incoming shouldn't have austrian home address.
|
||||
*/
|
||||
class CORE_INOUT_0007 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']);
|
||||
|
||||
if (!isset($params['studiensemester_kurzbz']) || isEmptyString($params['studiensemester_kurzbz']))
|
||||
return error('Studiensemester missing, issue_id: '.$params['issue_id']);
|
||||
|
||||
$this->_ci =& get_instance(); // get code igniter instance
|
||||
|
||||
$this->_ci->load->library('issues/PlausicheckLib');
|
||||
|
||||
// check if issue persists
|
||||
$checkRes = $this->_ci->plausichecklib->getIncomingHeimatNationOesterreich($params['studiensemester_kurzbz'], null, $params['issue_person_id']);
|
||||
|
||||
if (isError($checkRes)) return $checkRes;
|
||||
|
||||
if (hasData($checkRes))
|
||||
return success(false); // not resolved if issue is still present
|
||||
else
|
||||
return success(true); // resolved otherwise
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Incoming shouldn't have austrian home address.
|
||||
*/
|
||||
class CORE_INOUT_0008 implements IIssueResolvedChecker
|
||||
{
|
||||
public function checkIfIssueIsResolved($params)
|
||||
{
|
||||
if (!isset($params['prestudent_id']) || !is_numeric($params['prestudent_id']))
|
||||
return error('Prestudent Id missing, issue_id: '.$params['issue_id']);
|
||||
|
||||
$this->_ci =& get_instance(); // get code igniter instance
|
||||
|
||||
$this->_ci->load->library('issues/PlausicheckLib');
|
||||
|
||||
// check if issue persists
|
||||
$checkRes = $this->_ci->plausichecklib->getIncomingOhneIoDatensatz(null, $params['prestudent_id']);
|
||||
|
||||
if (isError($checkRes)) return $checkRes;
|
||||
|
||||
if (hasData($checkRes))
|
||||
return success(false); // not resolved if issue is still present
|
||||
else
|
||||
return success(true); // resolved otherwise
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Incoming or external GS student should not be foerderrelevant.
|
||||
*/
|
||||
class CORE_INOUT_0009 implements IIssueResolvedChecker
|
||||
{
|
||||
public function checkIfIssueIsResolved($params)
|
||||
{
|
||||
if (!isset($params['prestudent_id']) || !is_numeric($params['prestudent_id']))
|
||||
return error('Prestudent Id missing, issue_id: '.$params['issue_id']);
|
||||
|
||||
$this->_ci =& get_instance(); // get code igniter instance
|
||||
|
||||
$this->_ci->load->library('issues/PlausicheckLib');
|
||||
|
||||
// check if issue persists
|
||||
$checkRes = $this->_ci->plausichecklib->getIncomingOrGsFoerderrelevant(null, null, $params['prestudent_id']);
|
||||
|
||||
if (isError($checkRes)) return $checkRes;
|
||||
|
||||
if (hasData($checkRes))
|
||||
return success(false); // not resolved if issue is still present
|
||||
else
|
||||
return success(true); // resolved otherwise
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Incoming shouldn't have austrian home address.
|
||||
*/
|
||||
class CORE_PERSON_0001 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->library('issues/PlausicheckLib');
|
||||
|
||||
// check if issue persists
|
||||
$checkRes = $this->_ci->plausichecklib->getGbDatumWeitZurueck(null, null, $params['issue_person_id']);
|
||||
|
||||
if (isError($checkRes)) return $checkRes;
|
||||
|
||||
if (hasData($checkRes))
|
||||
return success(false); // not resolved if issue is still present
|
||||
else
|
||||
return success(true); // resolved otherwise
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Incoming shouldn't have austrian home address.
|
||||
*/
|
||||
class CORE_PERSON_0002 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->library('issues/PlausicheckLib');
|
||||
|
||||
// check if issue persists
|
||||
$checkRes = $this->_ci->plausichecklib->getNationNichtOesterreichAberGemeinde(null, $params['issue_person_id']);
|
||||
|
||||
if (isError($checkRes)) return $checkRes;
|
||||
|
||||
if (hasData($checkRes))
|
||||
return success(false); // not resolved if issue is still present
|
||||
else
|
||||
return success(true); // resolved otherwise
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Incoming shouldn't have austrian home address.
|
||||
*/
|
||||
class CORE_PERSON_0003 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->library('issues/PlausicheckLib');
|
||||
|
||||
// check if issue persists
|
||||
$checkRes = $this->_ci->plausichecklib->getFalscheAnzahlHeimatadressen(null, null, $params['issue_person_id']);
|
||||
|
||||
if (isError($checkRes)) return $checkRes;
|
||||
|
||||
if (hasData($checkRes))
|
||||
return success(false); // not resolved if issue is still present
|
||||
else
|
||||
return success(true); // resolved otherwise
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Incoming shouldn't have austrian home address.
|
||||
*/
|
||||
class CORE_PERSON_0004 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->library('issues/PlausicheckLib');
|
||||
|
||||
// check if issue persists
|
||||
$checkRes = $this->_ci->plausichecklib->getFalscheAnzahlZustelladressen(null, null, $params['issue_person_id']);
|
||||
|
||||
if (isError($checkRes)) return $checkRes;
|
||||
|
||||
if (hasData($checkRes))
|
||||
return success(false); // not resolved if issue is still present
|
||||
else
|
||||
return success(true); // resolved otherwise
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Incoming shouldn't have austrian home address.
|
||||
*/
|
||||
class CORE_STG_0001 implements IIssueResolvedChecker
|
||||
{
|
||||
public function checkIfIssueIsResolved($params)
|
||||
{
|
||||
if (!isset($params['prestudent_id']) || !is_numeric($params['prestudent_id']))
|
||||
return error('Prestudent Id missing, issue_id: '.$params['issue_id']);
|
||||
|
||||
$this->_ci =& get_instance(); // get code igniter instance
|
||||
|
||||
$this->_ci->load->library('issues/PlausicheckLib');
|
||||
|
||||
// check if issue persists
|
||||
$checkRes = $this->_ci->plausichecklib->getStgPrestudentUngleichStgStudent(null, $params['prestudent_id']);
|
||||
|
||||
if (isError($checkRes)) return $checkRes;
|
||||
|
||||
if (hasData($checkRes))
|
||||
return success(false); // not resolved if issue is still present
|
||||
else
|
||||
return success(true); // resolved otherwise
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Incoming shouldn't have austrian home address.
|
||||
*/
|
||||
class CORE_STG_0002 implements IIssueResolvedChecker
|
||||
{
|
||||
public function checkIfIssueIsResolved($params)
|
||||
{
|
||||
if (!isset($params['prestudent_id']) || !is_numeric($params['prestudent_id']))
|
||||
return error('Prestudent Id missing, issue_id: '.$params['issue_id']);
|
||||
|
||||
if (!isset($params['studiensemester_kurzbz']) || isEmptyString($params['studiensemester_kurzbz']))
|
||||
return error('Studiensemester missing, issue_id: '.$params['issue_id']);
|
||||
|
||||
$this->_ci =& get_instance(); // get code igniter instance
|
||||
|
||||
$this->_ci->load->library('issues/PlausicheckLib');
|
||||
|
||||
// check if issue persists
|
||||
$checkRes = $this->_ci->plausichecklib->getOrgformStgUngleichOrgformPrestudent($params['studiensemester_kurzbz'], null, $params['prestudent_id']);
|
||||
|
||||
if (isError($checkRes)) return $checkRes;
|
||||
|
||||
if (hasData($checkRes))
|
||||
return success(false); // not resolved if issue is still present
|
||||
else
|
||||
return success(true); // resolved otherwise
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Incoming shouldn't have austrian home address.
|
||||
*/
|
||||
class CORE_STG_0003 implements IIssueResolvedChecker
|
||||
{
|
||||
public function checkIfIssueIsResolved($params)
|
||||
{
|
||||
if (!isset($params['prestudent_id']) || !is_numeric($params['prestudent_id']))
|
||||
return error('Prestudent Id missing, issue_id: '.$params['issue_id']);
|
||||
|
||||
if (!isset($params['studiensemester_kurzbz']) || isEmptyString($params['studiensemester_kurzbz']))
|
||||
return error('Studiensemester missing, issue_id: '.$params['issue_id']);
|
||||
|
||||
$this->_ci =& get_instance(); // get code igniter instance
|
||||
|
||||
$this->_ci->load->library('issues/PlausicheckLib');
|
||||
|
||||
// check if issue persists
|
||||
$checkRes = $this->_ci->plausichecklib->getPrestudentMischformOhneOrgform($params['studiensemester_kurzbz'], null, $params['prestudent_id']);
|
||||
|
||||
if (isError($checkRes)) return $checkRes;
|
||||
|
||||
if (hasData($checkRes))
|
||||
return success(false); // not resolved if issue is still present
|
||||
else
|
||||
return success(true); // resolved otherwise
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Incoming shouldn't have austrian home address.
|
||||
*/
|
||||
class CORE_STG_0004 implements IIssueResolvedChecker
|
||||
{
|
||||
public function checkIfIssueIsResolved($params)
|
||||
{
|
||||
if (!isset($params['prestudent_id']) || !is_numeric($params['prestudent_id']))
|
||||
return error('Prestudent Id missing, issue_id: '.$params['issue_id']);
|
||||
|
||||
if (!isset($params['studienordnung_id']) || !is_numeric($params['studienordnung_id']))
|
||||
return error('Studienordnung Id missing, issue_id: '.$params['issue_id']);
|
||||
|
||||
$this->_ci =& get_instance(); // get code igniter instance
|
||||
|
||||
$this->_ci->load->library('issues/PlausicheckLib');
|
||||
|
||||
// check if issue persists
|
||||
$checkRes = $this->_ci->plausichecklib->getStgPrestudentUngleichStgStudienplan(null, $params['prestudent_id'], $params['studienordnung_id']);
|
||||
|
||||
if (isError($checkRes)) return $checkRes;
|
||||
|
||||
if (hasData($checkRes))
|
||||
return success(false); // not resolved if issue is still present
|
||||
else
|
||||
return success(true); // resolved otherwise
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Incoming shouldn't have austrian home address.
|
||||
*/
|
||||
class CORE_STUDENTSTATUS_0001 implements IIssueResolvedChecker
|
||||
{
|
||||
public function checkIfIssueIsResolved($params)
|
||||
{
|
||||
if (!isset($params['prestudent_id']) || !is_numeric($params['prestudent_id']))
|
||||
return error('Prestudent Id missing, issue_id: '.$params['issue_id']);
|
||||
|
||||
$this->_ci =& get_instance(); // get code igniter instance
|
||||
|
||||
$this->_ci->load->library('issues/PlausicheckLib');
|
||||
|
||||
// check if issue persists
|
||||
$checkRes = $this->_ci->plausichecklib->getAbbrecherAktiv(null, $params['prestudent_id']);
|
||||
|
||||
if (isError($checkRes)) return $checkRes;
|
||||
|
||||
if (hasData($checkRes))
|
||||
return success(false); // not resolved if issue is still present
|
||||
else
|
||||
return success(true); // resolved otherwise
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Incoming shouldn't have austrian home address.
|
||||
*/
|
||||
class CORE_STUDENTSTATUS_0002 implements IIssueResolvedChecker
|
||||
{
|
||||
public function checkIfIssueIsResolved($params)
|
||||
{
|
||||
if (!isset($params['prestudent_id']) || !is_numeric($params['prestudent_id']))
|
||||
return error('Prestudent Id missing, issue_id: '.$params['issue_id']);
|
||||
|
||||
$this->_ci =& get_instance(); // get code igniter instance
|
||||
|
||||
$this->_ci->load->library('issues/PlausicheckLib');
|
||||
|
||||
// check if issue persists
|
||||
$checkRes = $this->_ci->plausichecklib->getStudentstatusNachAbbrecher(null, $params['prestudent_id']);
|
||||
|
||||
if (isError($checkRes)) return $checkRes;
|
||||
|
||||
if (hasData($checkRes))
|
||||
return success(false); // not resolved if issue is still present
|
||||
else
|
||||
return success(true); // resolved otherwise
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Incoming shouldn't have austrian home address.
|
||||
*/
|
||||
class CORE_STUDENTSTATUS_0003 implements IIssueResolvedChecker
|
||||
{
|
||||
public function checkIfIssueIsResolved($params)
|
||||
{
|
||||
if (!isset($params['prestudent_id']) || !is_numeric($params['prestudent_id']))
|
||||
return error('Prestudent Id missing, issue_id: '.$params['issue_id']);
|
||||
|
||||
if (!isset($params['studiensemester_kurzbz']) || isEmptyString($params['studiensemester_kurzbz']))
|
||||
return error('Studiensemester missing, issue_id: '.$params['issue_id']);
|
||||
|
||||
$this->_ci =& get_instance(); // get code igniter instance
|
||||
|
||||
$this->_ci->load->library('issues/PlausicheckLib');
|
||||
|
||||
// check if issue persists
|
||||
$checkRes = $this->_ci->plausichecklib->getAusbildungssemPrestudentUngleichAusbildungssemStatus($params['studiensemester_kurzbz'], null, $params['prestudent_id']);
|
||||
|
||||
if (isError($checkRes)) return $checkRes;
|
||||
|
||||
if (hasData($checkRes))
|
||||
return success(false); // not resolved if issue is still present
|
||||
else
|
||||
return success(true); // resolved otherwise
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Incoming shouldn't have austrian home address.
|
||||
*/
|
||||
class CORE_STUDENTSTATUS_0004 implements IIssueResolvedChecker
|
||||
{
|
||||
public function checkIfIssueIsResolved($params)
|
||||
{
|
||||
if (!isset($params['prestudent_id']) || !is_numeric($params['prestudent_id']))
|
||||
return error('Prestudent Id missing, issue_id: '.$params['issue_id']);
|
||||
|
||||
if (!isset($params['studiensemester_kurzbz']) || isEmptyString($params['studiensemester_kurzbz']))
|
||||
return error('Studiensemester missing, issue_id: '.$params['issue_id']);
|
||||
|
||||
$this->_ci =& get_instance(); // get code igniter instance
|
||||
|
||||
$this->_ci->load->library('issues/PlausicheckLib');
|
||||
|
||||
// check if issue persists
|
||||
$checkRes = $this->_ci->plausichecklib->getInaktiverStudentAktiverStatus($params['studiensemester_kurzbz'], null, $params['prestudent_id']);
|
||||
|
||||
if (isError($checkRes)) return $checkRes;
|
||||
|
||||
if (hasData($checkRes))
|
||||
return success(false); // not resolved if issue is still present
|
||||
else
|
||||
return success(true); // resolved otherwise
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Incoming shouldn't have austrian home address.
|
||||
*/
|
||||
class CORE_STUDENTSTATUS_0005 implements IIssueResolvedChecker
|
||||
{
|
||||
public function checkIfIssueIsResolved($params)
|
||||
{
|
||||
if (!isset($params['prestudent_id']) || !is_numeric($params['prestudent_id']))
|
||||
return error('Prestudent Id missing, issue_id: '.$params['issue_id']);
|
||||
|
||||
if (!isset($params['studiensemester_kurzbz']) || isEmptyString($params['studiensemester_kurzbz']))
|
||||
return error('Studiensemester missing, issue_id: '.$params['issue_id']);
|
||||
|
||||
$this->_ci =& get_instance(); // get code igniter instance
|
||||
|
||||
$this->_ci->load->library('issues/PlausicheckLib');
|
||||
|
||||
// check if issue persists
|
||||
$checkRes = $this->_ci->plausichecklib->getInskriptionVorLetzerBismeldung($params['studiensemester_kurzbz'], null, $params['prestudent_id']);
|
||||
|
||||
if (isError($checkRes)) return $checkRes;
|
||||
|
||||
if (hasData($checkRes))
|
||||
return success(false); // not resolved if issue is still present
|
||||
else
|
||||
return success(true); // resolved otherwise
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Incoming shouldn't have austrian home address.
|
||||
*/
|
||||
class CORE_STUDENTSTATUS_0006 implements IIssueResolvedChecker
|
||||
{
|
||||
public function checkIfIssueIsResolved($params)
|
||||
{
|
||||
if (!isset($params['prestudent_id']) || !is_numeric($params['prestudent_id']))
|
||||
return error('Prestudent Id missing, issue_id: '.$params['issue_id']);
|
||||
|
||||
$this->_ci =& get_instance(); // get code igniter instance
|
||||
|
||||
$this->_ci->load->library('issues/PlausicheckLib');
|
||||
|
||||
// check if issue persists
|
||||
$checkRes = $this->_ci->plausichecklib->getDatumStudiensemesterFalscheReihenfolge(null, $params['prestudent_id']);
|
||||
|
||||
if (isError($checkRes)) return $checkRes;
|
||||
|
||||
if (hasData($checkRes))
|
||||
return success(false); // not resolved if issue is still present
|
||||
else
|
||||
return success(true); // resolved otherwise
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Incoming shouldn't have austrian home address.
|
||||
*/
|
||||
class CORE_STUDENTSTATUS_0007 implements IIssueResolvedChecker
|
||||
{
|
||||
public function checkIfIssueIsResolved($params)
|
||||
{
|
||||
if (!isset($params['prestudent_id']) || !is_numeric($params['prestudent_id']))
|
||||
return error('Prestudent Id missing, issue_id: '.$params['issue_id']);
|
||||
|
||||
$this->_ci =& get_instance(); // get code igniter instance
|
||||
|
||||
$this->_ci->load->library('issues/PlausicheckLib');
|
||||
|
||||
// check if issue persists
|
||||
$checkRes = $this->_ci->plausichecklib->getAktiverStudentOhneStatus(null, $params['prestudent_id']);
|
||||
|
||||
if (isError($checkRes)) return $checkRes;
|
||||
|
||||
if (hasData($checkRes))
|
||||
return success(false); // not resolved if issue is still present
|
||||
else
|
||||
return success(true); // resolved otherwise
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Incoming shouldn't have austrian home address.
|
||||
*/
|
||||
class CORE_STUDENTSTATUS_0008 implements IIssueResolvedChecker
|
||||
{
|
||||
public function checkIfIssueIsResolved($params)
|
||||
{
|
||||
if (!isset($params['prestudent_id']) || !is_numeric($params['prestudent_id']))
|
||||
return error('Prestudent Id missing, issue_id: '.$params['issue_id']);
|
||||
|
||||
if (!isset($params['studiensemester_kurzbz']) || isEmptyString($params['studiensemester_kurzbz']))
|
||||
return error('Studiensemester missing, issue_id: '.$params['issue_id']);
|
||||
|
||||
$this->_ci =& get_instance(); // get code igniter instance
|
||||
|
||||
$this->_ci->load->library('issues/PlausicheckLib');
|
||||
|
||||
// check if issue persists
|
||||
$checkRes = $this->_ci->plausichecklib->getStudienplanUngueltig($params['studiensemester_kurzbz'], null, $params['prestudent_id']);
|
||||
|
||||
if (isError($checkRes)) return $checkRes;
|
||||
|
||||
if (hasData($checkRes))
|
||||
return success(false); // not resolved if issue is still present
|
||||
else
|
||||
return success(true); // resolved otherwise
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Incoming shouldn't have austrian home address.
|
||||
*/
|
||||
class CORE_STUDENTSTATUS_0009 implements IIssueResolvedChecker
|
||||
{
|
||||
public function checkIfIssueIsResolved($params)
|
||||
{
|
||||
if (!isset($params['prestudent_id']) || !is_numeric($params['prestudent_id']))
|
||||
return error('Prestudent Id missing, issue_id: '.$params['issue_id']);
|
||||
|
||||
$this->_ci =& get_instance(); // get code igniter instance
|
||||
|
||||
$this->_ci->load->library('issues/PlausicheckLib');
|
||||
|
||||
// check if issue persists
|
||||
$checkRes = $this->_ci->plausichecklib->getFalscheAnzahlAbschlusspruefungen(null, null, $params['prestudent_id']);
|
||||
|
||||
if (isError($checkRes)) return $checkRes;
|
||||
|
||||
if (hasData($checkRes))
|
||||
return success(false); // not resolved if issue is still present
|
||||
else
|
||||
return success(true); // resolved otherwise
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Incoming shouldn't have austrian home address.
|
||||
*/
|
||||
class CORE_STUDENTSTATUS_0010 implements IIssueResolvedChecker
|
||||
{
|
||||
public function checkIfIssueIsResolved($params)
|
||||
{
|
||||
if (!isset($params['abschlusspruefung_id']) || !is_numeric($params['abschlusspruefung_id']))
|
||||
return error('Prestudent Id missing, issue_id: '.$params['issue_id']);
|
||||
|
||||
$this->_ci =& get_instance(); // get code igniter instance
|
||||
|
||||
$this->_ci->load->library('issues/PlausicheckLib');
|
||||
|
||||
// check if issue persists
|
||||
$checkRes = $this->_ci->plausichecklib->getDatumAbschlusspruefungFehlt(null, null, $params['abschlusspruefung_id']);
|
||||
|
||||
if (isError($checkRes)) return $checkRes;
|
||||
|
||||
if (hasData($checkRes))
|
||||
return success(false); // not resolved if issue is still present
|
||||
else
|
||||
return success(true); // resolved otherwise
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Incoming shouldn't have austrian home address.
|
||||
*/
|
||||
class CORE_STUDENTSTATUS_0011 implements IIssueResolvedChecker
|
||||
{
|
||||
public function checkIfIssueIsResolved($params)
|
||||
{
|
||||
if (!isset($params['abschlusspruefung_id']) || !is_numeric($params['abschlusspruefung_id']))
|
||||
return error('Prestudent Id missing, issue_id: '.$params['issue_id']);
|
||||
|
||||
$this->_ci =& get_instance(); // get code igniter instance
|
||||
|
||||
$this->_ci->load->library('issues/PlausicheckLib');
|
||||
|
||||
// check if issue persists
|
||||
$checkRes = $this->_ci->plausichecklib->getDatumSponsionFehlt(null, null, $params['abschlusspruefung_id']);
|
||||
|
||||
if (isError($checkRes)) return $checkRes;
|
||||
|
||||
if (hasData($checkRes))
|
||||
return success(false); // not resolved if issue is still present
|
||||
else
|
||||
return success(true); // resolved otherwise
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Incoming shouldn't have austrian home address.
|
||||
*/
|
||||
class CORE_STUDENTSTATUS_0012 implements IIssueResolvedChecker
|
||||
{
|
||||
public function checkIfIssueIsResolved($params)
|
||||
{
|
||||
if (!isset($params['prestudent_id']) || !is_numeric($params['prestudent_id']))
|
||||
return error('Prestudent Id missing, issue_id: '.$params['issue_id']);
|
||||
|
||||
if (!isset($params['studiensemester_kurzbz']) || isEmptyString($params['studiensemester_kurzbz']))
|
||||
return error('Studiensemester missing, issue_id: '.$params['issue_id']);
|
||||
|
||||
$this->_ci =& get_instance(); // get code igniter instance
|
||||
|
||||
$this->_ci->load->library('issues/PlausicheckLib');
|
||||
|
||||
// check if issue persists
|
||||
$checkRes = $this->_ci->plausichecklib->getBewerberNichtZumRtAngetreten($params['studiensemester_kurzbz'], null, $params['prestudent_id']);
|
||||
|
||||
if (isError($checkRes)) return $checkRes;
|
||||
|
||||
if (hasData($checkRes))
|
||||
return success(false); // not resolved if issue is still present
|
||||
else
|
||||
return success(true); // resolved otherwise
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Incoming shouldn't have austrian home address.
|
||||
*/
|
||||
class CORE_STUDENTSTATUS_0013 implements IIssueResolvedChecker
|
||||
{
|
||||
public function checkIfIssueIsResolved($params)
|
||||
{
|
||||
if (!isset($params['prestudent_id']) || !is_numeric($params['prestudent_id']))
|
||||
return error('Prestudent Id missing, issue_id: '.$params['issue_id']);
|
||||
|
||||
if (!isset($params['studiensemester_kurzbz']) || isEmptyString($params['studiensemester_kurzbz']))
|
||||
return error('Studiensemester missing, issue_id: '.$params['issue_id']);
|
||||
|
||||
$this->_ci =& get_instance(); // get code igniter instance
|
||||
|
||||
$this->_ci->load->library('issues/PlausicheckLib');
|
||||
|
||||
// check if issue persists
|
||||
$checkRes = $this->_ci->plausichecklib->getAktSemesterNull($params['studiensemester_kurzbz'], null, $params['prestudent_id']);
|
||||
|
||||
if (isError($checkRes)) return $checkRes;
|
||||
|
||||
if (hasData($checkRes))
|
||||
return success(false); // not resolved if issue is still present
|
||||
else
|
||||
return success(true); // resolved otherwise
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,29 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Incoming shouldn't have austrian home address.
|
||||
*/
|
||||
class CORE_STUDENTSTATUS_0014 implements IIssueResolvedChecker
|
||||
{
|
||||
public function checkIfIssueIsResolved($params)
|
||||
{
|
||||
if (!isset($params['prestudent_id']) || !is_numeric($params['prestudent_id']))
|
||||
return error('Prestudent Id missing, issue_id: '.$params['issue_id']);
|
||||
|
||||
$this->_ci =& get_instance(); // get code igniter instance
|
||||
|
||||
$this->_ci->load->library('issues/PlausicheckLib');
|
||||
|
||||
// check if issue persists
|
||||
$checkRes = $this->_ci->plausichecklib->getAbschlussstatusFehlt(null, null, $params['prestudent_id']);
|
||||
|
||||
if (isError($checkRes)) return $checkRes;
|
||||
|
||||
if (hasData($checkRes))
|
||||
return success(false); // not resolved if issue is still present
|
||||
else
|
||||
return success(true); // resolved otherwise
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,36 @@
|
||||
<?php
|
||||
|
||||
if (! defined('BASEPATH')) exit('No direct script access allowed');
|
||||
|
||||
/**
|
||||
* Student with active status should have been charged, i.e. have a Kontobuchung with negative or zero value.
|
||||
*/
|
||||
class CORE_STUDENTSTATUS_0015 implements IIssueResolvedChecker
|
||||
{
|
||||
public function checkIfIssueIsResolved($params)
|
||||
{
|
||||
if (!isset($params['prestudent_id']) || !is_numeric($params['prestudent_id']))
|
||||
return error('Prestudent Id missing, issue_id: '.$params['issue_id']);
|
||||
|
||||
if (!isset($params['studiensemester_kurzbz']) || isEmptyString($params['studiensemester_kurzbz']))
|
||||
return error('Studiensemester missing, issue_id: '.$params['issue_id']);
|
||||
|
||||
$this->_ci =& get_instance(); // get code igniter instance
|
||||
|
||||
$this->_ci->load->library('issues/PlausicheckLib');
|
||||
|
||||
// check if issue persists
|
||||
$checkRes = $this->_ci->plausichecklib->getAktiverStudentstatusOhneKontobuchung(
|
||||
$params['studiensemester_kurzbz'],
|
||||
null,
|
||||
$params['prestudent_id']
|
||||
);
|
||||
|
||||
if (isError($checkRes)) return $checkRes;
|
||||
|
||||
if (hasData($checkRes))
|
||||
return success(false); // not resolved if issue is still present
|
||||
else
|
||||
return success(true); // resolved otherwise
|
||||
}
|
||||
}
|
||||
@@ -128,8 +128,8 @@ class Messages_model extends CI_Model
|
||||
{
|
||||
$ouOptions .= sprintf(
|
||||
"\n".'<option value="%s">%s</option>',
|
||||
is_numeric($ou->prestudent_id) ? $ou->oe_kurzbz : self::ALT_OE,
|
||||
$ou->bezeichnung . (is_numeric($ou->prestudent_id) ? '' : ' *')
|
||||
($ou->typ === 'l' ? $ou->oe_kurzbz : (is_numeric($ou->prestudent_id) ? $ou->oe_kurzbz : self::ALT_OE)),
|
||||
$ou->bezeichnung . ((is_numeric($ou->prestudent_id) || $ou->typ === 'l' ) ? '' : ' *')
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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);
|
||||
|
||||
@@ -560,9 +586,10 @@ class Prestudent_model extends DB_Model
|
||||
o.bezeichnung,
|
||||
(CASE
|
||||
WHEN sg.typ = \'b\' THEN ps.prestudent_id
|
||||
WHEN sg.typ = \'m\' THEN ps.prestudent_id
|
||||
WHEN sg.typ = \'m\' THEN mps.prestudent_id
|
||||
ELSE NULL
|
||||
END) AS prestudent_id
|
||||
END) AS prestudent_id,
|
||||
sg.typ
|
||||
FROM public.tbl_prestudent p
|
||||
JOIN public.tbl_studiengang sg USING(studiengang_kz)
|
||||
JOIN public.tbl_organisationseinheit o USING(oe_kurzbz)
|
||||
@@ -571,11 +598,17 @@ class Prestudent_model extends DB_Model
|
||||
FROM public.tbl_prestudentstatus
|
||||
WHERE status_kurzbz = \'Bewerber\'
|
||||
) ps USING(prestudent_id)
|
||||
LEFT JOIN (
|
||||
SELECT prestudent_id
|
||||
FROM public.tbl_prestudentstatus
|
||||
WHERE status_kurzbz = \'Interessent\' AND bestaetigtam IS NOT NULL
|
||||
) mps ON p.prestudent_id = mps.prestudent_id
|
||||
WHERE p.person_id = ?
|
||||
GROUP BY o.oe_kurzbz,
|
||||
o.bezeichnung,
|
||||
sg.typ,
|
||||
ps.prestudent_id,
|
||||
mps.prestudent_id,
|
||||
p.prestudent_id
|
||||
ORDER BY o.bezeichnung';
|
||||
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
<?php
|
||||
|
||||
class RueckstellungStatus_model extends DB_Model
|
||||
{
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->dbTable = 'public.tbl_rueckstellung_status';
|
||||
$this->pk = 'status_kurzbz';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,33 @@
|
||||
<?php
|
||||
|
||||
class Rueckstellung_model extends DB_Model
|
||||
{
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->dbTable = 'public.tbl_rueckstellung';
|
||||
$this->pk = 'rueckstellung_id';
|
||||
$this->hasSequence = true;
|
||||
}
|
||||
|
||||
public function getByPersonId($person_id, $status = null)
|
||||
{
|
||||
$language_index = getUserLanguage() == 'German' ? 0 : 1;
|
||||
|
||||
$this->addLimit(1);
|
||||
$this->addJoin('tbl_rueckstellung_status', 'status_kurzbz');
|
||||
$this->addSelect('*,
|
||||
array_to_json(bezeichnung_mehrsprachig::varchar[])->>'.$language_index . 'as bezeichnung');
|
||||
$this->addOrder('datum_bis', 'DESC');
|
||||
|
||||
$where['person_id'] = $person_id;
|
||||
|
||||
if (!isEmptyString($status))
|
||||
$where['status_kurzbz'] = $status;
|
||||
|
||||
return $this->loadWhere($where);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,87 @@
|
||||
<?php
|
||||
|
||||
class Anrechnungszeitraum_model extends DB_Model
|
||||
{
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
parent::__construct();
|
||||
$this->dbTable = 'lehre.tbl_anrechnungszeitraum';
|
||||
$this->pk = 'anrechnungszeitraum_id';
|
||||
}
|
||||
|
||||
/**
|
||||
* Save new Anrechnungszeitraum.
|
||||
*
|
||||
* @param $studiensemester_kurzbz
|
||||
* @param $anrechnungstart
|
||||
* @param $anrechnungende
|
||||
* @return array|stdClass
|
||||
*/
|
||||
public function insertAzr($studiensemester_kurzbz, $anrechnungstart, $anrechnungende)
|
||||
{
|
||||
$result = $this->insert(array(
|
||||
'studiensemester_kurzbz' => $studiensemester_kurzbz,
|
||||
'anrechnungstart' => $anrechnungstart,
|
||||
'anrechnungende' => $anrechnungende,
|
||||
'insertvon' => getAuthUID()
|
||||
));
|
||||
|
||||
if (isError($result))
|
||||
{
|
||||
return error('Fehler bei Anrechnungszeitraum speichern.');
|
||||
}
|
||||
|
||||
// Return new anrechnungszeitraum_id
|
||||
return success($result->retval);
|
||||
}
|
||||
|
||||
/**
|
||||
* Delete Anrechnungszeitraum.
|
||||
*
|
||||
* @param $anrechnungszeitraum_id
|
||||
* @return array|stdClass
|
||||
*/
|
||||
public function deleteAzr($anrechnungszeitraum_id)
|
||||
{
|
||||
$result = $this->delete(array('anrechnungszeitraum_id' => $anrechnungszeitraum_id));
|
||||
|
||||
if (isError($result))
|
||||
{
|
||||
return error('Fehler bei Anrechnungszeitraum löschen.');
|
||||
}
|
||||
|
||||
return success($result->retval);
|
||||
}
|
||||
|
||||
/**
|
||||
* Update existing Anrechnungszeitraum.
|
||||
*
|
||||
* @param $anrechnungszeitraum_id
|
||||
* @param $studiensemester_kurzbz
|
||||
* @param $anrechnungstart
|
||||
* @param $anrechnungende
|
||||
* @return array|stdClass
|
||||
*/
|
||||
public function updateAzr($anrechnungszeitraum_id, $studiensemester_kurzbz, $anrechnungstart, $anrechnungende)
|
||||
{
|
||||
$result = $this->update(
|
||||
$anrechnungszeitraum_id,
|
||||
array(
|
||||
'studiensemester_kurzbz' => $studiensemester_kurzbz,
|
||||
'anrechnungstart' => $anrechnungstart,
|
||||
'anrechnungende' => $anrechnungende
|
||||
)
|
||||
);
|
||||
|
||||
if (isError($result))
|
||||
{
|
||||
return error('Fehler bei Anrechnungszeitraum update.');
|
||||
}
|
||||
|
||||
return success($result->retval);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -200,6 +200,28 @@ class Lehrveranstaltung_model extends DB_Model
|
||||
|
||||
return $this->execQuery($query, array($lehrveranstaltung_id, $studiensemester_kurzbz));
|
||||
}
|
||||
/**
|
||||
* Gets all Leiter of Lehrveranstaltungsorganisationseinheit
|
||||
* @param $lehrveranstaltung_id
|
||||
* @return array|null
|
||||
*/
|
||||
public function getLeitungOfLvOe($lehrveranstaltung_id)
|
||||
{
|
||||
$query = "select distinct vorname, nachname, uid
|
||||
FROM
|
||||
lehre.tbl_lehrveranstaltung lv
|
||||
JOIN public.tbl_organisationseinheit og using (oe_kurzbz)
|
||||
JOIN public.tbl_benutzerfunktion bf using (oe_kurzbz)
|
||||
join public.tbl_benutzer b using (uid)
|
||||
join public.tbl_person p using (person_id)
|
||||
where
|
||||
bf.datum_von <= now()::date
|
||||
and (bf.datum_bis >= now()::date or bf.datum_bis is null)
|
||||
and bf.funktion_kurzbz = 'Leitung' -- Leitung of LV-OE
|
||||
and lehrveranstaltung_id = ?";
|
||||
|
||||
return $this->execQuery($query, array($lehrveranstaltung_id));
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets Lehrveranstaltungen of a student
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
<?php
|
||||
class Paabgabe_model extends DB_Model
|
||||
{
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
@@ -11,4 +10,24 @@ class Paabgabe_model extends DB_Model
|
||||
$this->dbTable = 'campus.tbl_paabgabe';
|
||||
$this->pk = 'paabgabe_id';
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets last Endabgabe of a Projektarbeit, including filename.
|
||||
* @param int $projektarbeit_id
|
||||
* @return object
|
||||
*/
|
||||
public function getEndabgabe($projektarbeit_id)
|
||||
{
|
||||
$qry = "SELECT paabgabe_id, student_uid, paabg.datum, paabg.abgabedatum, projekttyp_kurzbz, titel, titel_english,
|
||||
paabgabe_id || '_' || student_uid || '.pdf' AS filename
|
||||
FROM campus.tbl_paabgabe paabg
|
||||
JOIN lehre.tbl_projektarbeit USING (projektarbeit_id)
|
||||
WHERE projektarbeit_id = ?
|
||||
AND paabgabetyp_kurzbz = 'end'
|
||||
AND paabg.abgabedatum IS NOT NULL
|
||||
ORDER BY paabg.abgabedatum, paabg.datum DESC
|
||||
LIMIT 1";
|
||||
|
||||
return $this->execQuery($qry, array($projektarbeit_id));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -54,18 +54,28 @@ class Projektbetreuer_model extends DB_Model
|
||||
$qry = "SELECT DISTINCT ON (pers.person_id) pers.person_id, betreuerart_kurzbz, vorname, nachname,
|
||||
trim(COALESCE(titelpre,'')||' '||COALESCE(vorname,'')||' '||COALESCE(nachname,'')||' '||COALESCE(titelpost,'')) as voller_name,
|
||||
anrede, titelpre, titelpost, gebdatum, geschlecht, pa.projekttyp_kurzbz,
|
||||
ben.uid, ben.alias, ma.personalnummer, mitarbeiter_uid, student_uid
|
||||
FROM lehre.tbl_projektarbeit pa
|
||||
JOIN lehre.tbl_projektbetreuer USING (projektarbeit_id)
|
||||
JOIN public.tbl_person pers USING (person_id)
|
||||
LEFT JOIN public.tbl_benutzer ben USING (person_id)
|
||||
LEFT JOIN public.tbl_mitarbeiter ma ON ben.uid = ma.mitarbeiter_uid
|
||||
WHERE ben.aktiv
|
||||
AND projektarbeit_id = ?
|
||||
AND betreuerart_kurzbz = ?
|
||||
ORDER BY pers.person_id, CASE WHEN ma.mitarbeiter_uid IS NULL THEN 1 ELSE 0 END, /*Mitarbeiter account first*/
|
||||
CASE WHEN ben.uid IS NULL THEN 1 ELSE 0 END, /*user with account first*/
|
||||
ben.insertamum";
|
||||
ben.uid, ben.alias, ma.personalnummer, mitarbeiter_uid, student_uid,
|
||||
(
|
||||
SELECT kontakt
|
||||
FROM public.tbl_kontakt
|
||||
WHERE kontakttyp = 'email'
|
||||
AND person_id = pers.person_id
|
||||
ORDER BY
|
||||
CASE WHEN zustellung THEN 0 ELSE 1 END,
|
||||
insertamum DESC NULLS LAST
|
||||
LIMIT 1
|
||||
) AS private_email
|
||||
FROM lehre.tbl_projektarbeit pa
|
||||
JOIN lehre.tbl_projektbetreuer USING (projektarbeit_id)
|
||||
JOIN public.tbl_person pers USING (person_id)
|
||||
LEFT JOIN public.tbl_benutzer ben USING (person_id)
|
||||
LEFT JOIN public.tbl_mitarbeiter ma ON ben.uid = ma.mitarbeiter_uid
|
||||
WHERE (ben.aktiv OR ben.aktiv IS NULL)
|
||||
AND projektarbeit_id = ?
|
||||
AND betreuerart_kurzbz = ?
|
||||
ORDER BY pers.person_id, CASE WHEN ma.mitarbeiter_uid IS NULL THEN 1 ELSE 0 END, /*Mitarbeiter account first*/
|
||||
CASE WHEN ben.uid IS NULL THEN 1 ELSE 0 END, /*user with account first*/
|
||||
ben.insertamum";
|
||||
|
||||
return $this->execQuery($qry, array($projektarbeit_id, $betreuerart_kurzbz));
|
||||
}
|
||||
@@ -77,14 +87,14 @@ class Projektbetreuer_model extends DB_Model
|
||||
*/
|
||||
public function getBetreuerByToken($zugangstoken)
|
||||
{
|
||||
$qry = '
|
||||
$qry = "
|
||||
SELECT tbl_projektbetreuer.person_id, tbl_projektbetreuer.projektarbeit_id, student_uid
|
||||
FROM lehre.tbl_projektbetreuer
|
||||
JOIN lehre.tbl_projektarbeit USING (projektarbeit_id)
|
||||
WHERE zugangstoken = ? AND zugangstoken_gueltigbis >= NOW()
|
||||
ORDER BY tbl_projektbetreuer.insertamum DESC, projektarbeit_id DESC
|
||||
LIMIT 1
|
||||
';
|
||||
";
|
||||
|
||||
return $this->execQuery($qry, array($zugangstoken));
|
||||
}
|
||||
@@ -96,31 +106,60 @@ class Projektbetreuer_model extends DB_Model
|
||||
* @param $student_uid string uid des Studenten der Arbeit abgibt
|
||||
* @return object | bool
|
||||
*/
|
||||
public function getZweitbegutachterWithToken($erstbegutachter_person_id, $projektarbeit_id, $student_uid)
|
||||
public function getZweitbegutachterWithToken($erstbegutachter_person_id, $projektarbeit_id, $student_uid, $zweitbegutachter_person_id = null)
|
||||
{
|
||||
$qry_betr = "SELECT betr.person_id, betr.projektarbeit_id, pers.anrede, betr.zugangstoken, betr.zugangstoken_gueltigbis, tbl_benutzer.uid, kontakt,
|
||||
trim(COALESCE(titelpre,'')||' '||COALESCE(vorname,'')||' '||COALESCE(nachname,'')||' '||COALESCE(titelpost,'')) as voller_name,
|
||||
CASE WHEN tbl_benutzer.uid IS NULL THEN kontakt ELSE tbl_benutzer.uid || '@".DOMAIN."' END AS email, abg.abgabedatum
|
||||
FROM lehre.tbl_projektbetreuer betr
|
||||
JOIN lehre.tbl_projektarbeit parb ON betr.projektarbeit_id = parb.projektarbeit_id
|
||||
JOIN public.tbl_person pers ON betr.person_id = pers.person_id
|
||||
LEFT JOIN public.tbl_kontakt ON pers.person_id = tbl_kontakt.person_id AND kontakttyp = 'email' AND zustellung = true
|
||||
LEFT JOIN public.tbl_benutzer ON pers.person_id = tbl_benutzer.person_id
|
||||
LEFT JOIN campus.tbl_paabgabe abg ON betr.projektarbeit_id = abg.projektarbeit_id AND abg.paabgabetyp_kurzbz = 'end'
|
||||
WHERE betr.betreuerart_kurzbz = 'Zweitbegutachter'
|
||||
AND betr.projektarbeit_id = ?
|
||||
AND parb.student_uid = ?
|
||||
AND EXISTS (
|
||||
SELECT 1 FROM lehre.tbl_projektbetreuer
|
||||
WHERE person_id = ?
|
||||
AND betreuerart_kurzbz = 'Erstbegutachter'
|
||||
AND projektarbeit_id = betr.projektarbeit_id
|
||||
)
|
||||
AND (tbl_benutzer.aktiv OR tbl_benutzer.aktiv IS NULL)
|
||||
ORDER BY betr.insertamum DESC
|
||||
LIMIT 1";
|
||||
$params = array($erstbegutachter_person_id, $erstbegutachter_person_id, $projektarbeit_id, $student_uid);
|
||||
|
||||
return $this->execQuery($qry_betr, array($projektarbeit_id, $student_uid, $erstbegutachter_person_id));
|
||||
$qry_betr = "SELECT betr.person_id, betr.projektarbeit_id, pers.anrede, betr.zugangstoken, betr.zugangstoken_gueltigbis, tbl_benutzer.uid,
|
||||
trim(COALESCE(titelpre,'')||' '||COALESCE(vorname,'')||' '||COALESCE(nachname,'')||' '||COALESCE(titelpost,'')) as voller_name,
|
||||
CASE WHEN tbl_benutzer.uid IS NULL THEN kontakt ELSE tbl_benutzer.uid || '@".DOMAIN."' END AS email, kontakt,
|
||||
abg.abgabedatum, betr.betreuerart_kurzbz
|
||||
FROM lehre.tbl_projektbetreuer betr
|
||||
JOIN lehre.tbl_projektarbeit parb ON betr.projektarbeit_id = parb.projektarbeit_id
|
||||
JOIN public.tbl_person pers ON betr.person_id = pers.person_id
|
||||
LEFT JOIN public.tbl_kontakt ON pers.person_id = tbl_kontakt.person_id AND kontakttyp = 'email' AND zustellung = true
|
||||
LEFT JOIN public.tbl_benutzer ON pers.person_id = tbl_benutzer.person_id
|
||||
LEFT JOIN campus.tbl_paabgabe abg ON betr.projektarbeit_id = abg.projektarbeit_id AND abg.paabgabetyp_kurzbz = 'end'
|
||||
WHERE
|
||||
(
|
||||
(
|
||||
betr.betreuerart_kurzbz = 'Zweitbegutachter'
|
||||
AND EXISTS (
|
||||
SELECT 1 FROM lehre.tbl_projektbetreuer
|
||||
WHERE person_id = ?
|
||||
AND betreuerart_kurzbz = 'Erstbegutachter'
|
||||
AND projektarbeit_id = betr.projektarbeit_id
|
||||
)
|
||||
)
|
||||
OR /* either Zweitbegutachter of masterarbeit, or Kommissionsprüfer if Kommission */
|
||||
(
|
||||
betr.betreuerart_kurzbz = 'Senatsmitglied'
|
||||
AND EXISTS (
|
||||
SELECT 1 FROM lehre.tbl_projektbetreuer
|
||||
WHERE person_id = ?
|
||||
AND betreuerart_kurzbz = 'Senatsvorsitz'
|
||||
AND projektarbeit_id = betr.projektarbeit_id
|
||||
)
|
||||
)
|
||||
)
|
||||
AND betr.projektarbeit_id = ?
|
||||
AND parb.student_uid = ?
|
||||
AND (tbl_benutzer.aktiv OR tbl_benutzer.aktiv IS NULL)";
|
||||
|
||||
if (isset($zweitbegutachter_person_id))
|
||||
{
|
||||
$qry_betr .= " AND betr.person_id = ?";
|
||||
$params[] = $zweitbegutachter_person_id;
|
||||
}
|
||||
|
||||
$qry_betr .= " ORDER BY betr.person_id DESC,
|
||||
(CASE WHEN EXISTS ( /* if multiple accounts, prioritize mitarbeiter */
|
||||
SELECT 1 FROM public.tbl_mitarbeiter ma
|
||||
WHERE ma.mitarbeiter_uid = tbl_benutzer.uid
|
||||
) THEN 0 ELSE 1 END), betr.insertamum DESC
|
||||
LIMIT 1";
|
||||
|
||||
return $this->execQuery($qry_betr, $params);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -131,23 +170,23 @@ class Projektbetreuer_model extends DB_Model
|
||||
*/
|
||||
public function generateZweitbegutachterToken($zweitbegutachter_person_id, $projektarbeit_id)
|
||||
{
|
||||
$betreuerUidQry = "SELECT uid, zugangstoken, zugangstoken_gueltigbis, tbl_projektbetreuer.person_id
|
||||
$betreuerUidQry = "SELECT uid, zugangstoken, zugangstoken_gueltigbis, tbl_projektbetreuer.person_id, betreuerart_kurzbz
|
||||
FROM lehre.tbl_projektbetreuer
|
||||
JOIN public.tbl_person USING(person_id)
|
||||
LEFT JOIN public.tbl_benutzer USING(person_id)
|
||||
WHERE projektarbeit_id = ?
|
||||
AND tbl_projektbetreuer.person_id = ?
|
||||
AND betreuerart_kurzbz = 'Zweitbegutachter'
|
||||
AND betreuerart_kurzbz IN ('Zweitbegutachter', 'Senatsmitglied')
|
||||
LIMIT 1";
|
||||
|
||||
$betreueruidres = $this->execQuery($betreuerUidQry, array($projektarbeit_id, $zweitbegutachter_person_id));
|
||||
$betreueruidRes = $this->execQuery($betreuerUidQry, array($projektarbeit_id, $zweitbegutachter_person_id));
|
||||
|
||||
if (!hasData($betreueruidres))
|
||||
if (!hasData($betreueruidRes))
|
||||
return error('Zweitbegutachter nicht gefunden');
|
||||
|
||||
$row_betr = getData($betreueruidres)[0];
|
||||
$zweitbetreuer = getData($betreueruidRes)[0];
|
||||
|
||||
if (!isset($row_betr->uid))
|
||||
if (!isset($zweitbetreuer->uid))
|
||||
{
|
||||
do {
|
||||
$token = generateToken(16);
|
||||
@@ -156,8 +195,8 @@ class Projektbetreuer_model extends DB_Model
|
||||
|
||||
$result = $this->update(
|
||||
array('projektarbeit_id' => $projektarbeit_id,
|
||||
'person_id' => $row_betr->person_id,
|
||||
'betreuerart_kurzbz' => 'Zweitbegutachter'),
|
||||
'person_id' => $zweitbetreuer->person_id,
|
||||
'betreuerart_kurzbz' => $zweitbetreuer->betreuerart_kurzbz),
|
||||
array('zugangstoken' => $token,
|
||||
'zugangstoken_gueltigbis' => date('Y-m-d', strtotime('+1 year')))
|
||||
);
|
||||
@@ -167,4 +206,29 @@ class Projektbetreuer_model extends DB_Model
|
||||
else
|
||||
return success("Account vorhanden, kein Token benötigt");
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets betreuerart of a Betreuer for a Projektarbeit.
|
||||
* Main Betreuer are prioritized (normally one Betreuer should be assigned to a Projektarbeit another time with a different Betreuerart).
|
||||
* @param int projektarbeit_id
|
||||
* @param int betreuer_person_id
|
||||
* @return object success or error
|
||||
*/
|
||||
public function getBetreuerart($projektarbeit_id, $betreuer_person_id)
|
||||
{
|
||||
$qry = "SELECT betreuerart_kurzbz
|
||||
FROM lehre.tbl_projektbetreuer
|
||||
WHERE projektarbeit_id = ?
|
||||
AND person_id = ?
|
||||
ORDER BY CASE WHEN betreuerart_kurzbz = 'Senatsvorsitz' THEN 1 /*Senatsvorsitz has priority*/
|
||||
WHEN betreuerart_kurzbz = 'Begutachter' THEN 2
|
||||
WHEN betreuerart_kurzbz = 'Erstbegutachter' THEN 3
|
||||
WHEN betreuerart_kurzbz = 'Zweitbegutachter' THEN 4
|
||||
WHEN betreuerart_kurzbz = 'Senatsmitglied' THEN 5
|
||||
ELSE 5
|
||||
END, insertamum DESC
|
||||
LIMIT 1";
|
||||
|
||||
return $this->execQuery($qry, array($projektarbeit_id, $betreuer_person_id));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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';
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,137 @@
|
||||
<?php
|
||||
$includesArray = array(
|
||||
'title' => $this->p->t('anrechnung', 'anrechnungenVerwalten'),
|
||||
'jquery3' => true,
|
||||
'jqueryui1' => true,
|
||||
'bootstrap3' => true,
|
||||
'fontawesome6' => true,
|
||||
'ajaxlib' => true,
|
||||
'dialoglib' => true,
|
||||
'tabulator4' => true,
|
||||
'tablewidget' => true,
|
||||
'sbadmintemplate3' => true,
|
||||
'navigationwidget' => true,
|
||||
'phrases' => array(
|
||||
'anrechnung' => array(
|
||||
'anrechnungenVerwalten',
|
||||
'anrechnungszeitraumFestlegen',
|
||||
'anrechnungszeitraumHinzufuegen',
|
||||
'anrechnungszeitraumSpeichern',
|
||||
'anrechnungszeitraumStart',
|
||||
'anrechnungszeitraumEnde'
|
||||
),
|
||||
'ui' => array(
|
||||
'aktion',
|
||||
'geloescht',
|
||||
'gespeichert',
|
||||
'frageSicherLoeschen',
|
||||
'spaltenEinstellen'
|
||||
),
|
||||
'lehre' => array('studiensemester'),
|
||||
'table' => array(
|
||||
'spaltenEinAusblenden',
|
||||
'spaltenEinAusblendenMitKlickOeffnen',
|
||||
'spaltenEinAusblendenAufEinstellungenKlicken',
|
||||
'spaltenEinAusblendenMitKlickAktivieren',
|
||||
'spaltenEinAusblendenMitKlickSchliessen',
|
||||
'spaltenbreiteVeraendern',
|
||||
'spaltenbreiteVeraendernText',
|
||||
'spaltenbreiteVeraendernInfotext',
|
||||
'zeilenAuswaehlen',
|
||||
'zeilenAuswaehlenEinzeln',
|
||||
'zeilenAuswaehlenBereich',
|
||||
'zeilenAuswaehlenAlle'
|
||||
)
|
||||
),
|
||||
'customJSs' => array(
|
||||
'public/js/bootstrapper.js',
|
||||
'public/js/lehre/anrechnung/adminAnrechnung.js'
|
||||
),
|
||||
'customCSSs' => array(
|
||||
'public/css/sbadmin2/tablesort_bootstrap.css'
|
||||
)
|
||||
);
|
||||
|
||||
$this->load->view('templates/FHC-Header', $includesArray);
|
||||
?>
|
||||
|
||||
<div id="wrapper">
|
||||
|
||||
<?php echo $this->widgetlib->widget('NavigationWidget'); ?>
|
||||
|
||||
<div id="page-wrapper">
|
||||
<div class="container-fluid">
|
||||
|
||||
<!--Titel-->
|
||||
<div class="page-header">
|
||||
<h3><?php echo $this->p->t('anrechnung', 'anrechnungenVerwalten'); ?></h3>
|
||||
</div><br>
|
||||
|
||||
<!--Untertitel-->
|
||||
<h4><?php echo $this->p->t('anrechnung', 'anrechnungszeitraumFestlegen'); ?></h4><br>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-xs-4">
|
||||
<button class="btn btn-primary azrOpenModal" data-toggle="modal" data-target="#azrModal">
|
||||
<i class="fa fa-plus"></i> <?php echo $this->p->t('anrechnung', 'anrechnungszeitraumHinzufuegen'); ?>
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Tabelle -->
|
||||
<div class="row">
|
||||
<div class="col-lg-12">
|
||||
<?php $this->load->view('lehre/anrechnung/adminAnrechnungData.php'); ?>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Modal (für insert und update von Anrechnungszeitraum)-->
|
||||
<div class="modal fade" id="azrModal" tabindex="-1" role="dialog" aria-labelledby="azrModalLabel" aria-hidden="true">
|
||||
<div class="modal-dialog" role="document">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title" id="azrModalLabel"></h5>
|
||||
<button type="button" class="close" data-dismiss="modal" aria-label="Close"><span aria-hidden="true">×</span></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
<div class="row">
|
||||
<input type="hidden" id="anrechnungszeitraum_id" value="">
|
||||
<input type="hidden" id="defaultStudiensemester_kurzbz" value="<?php echo $studiensemester_kurzbz ?>">
|
||||
<div class="col-xs-4">
|
||||
<label for="studiensemester" class="small">Studiensemester</label>
|
||||
<?php
|
||||
echo $this->widgetlib->widget(
|
||||
'Studiensemester_widget',
|
||||
array(
|
||||
DropdownWidget::SELECTED_ELEMENT => $studiensemester_kurzbz
|
||||
),
|
||||
array(
|
||||
'name' => 'studiensemester',
|
||||
'id' => 'studiensemester'
|
||||
)
|
||||
);
|
||||
?>
|
||||
</div>
|
||||
<div class="col-xs-4">
|
||||
<label for="azrStart" class="small">Anr.-Zeitraum Start</label>
|
||||
<input type="date" id="azrStart" value="" class="form-control" required>
|
||||
</div>
|
||||
<div class="col-xs-4">
|
||||
<label for="azrEnde" class="small">Anr.-Zeitraum Ende</label>
|
||||
<input type="date" id="azrEnde" value="" class="form-control" required>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" id="azrInsertBtn" class="btn btn-primary" value=""><?php echo $this->p->t('ui', 'speichern'); ?></button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<?php $this->load->view('templates/FHC-Footer', $includesArray); ?>
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
<?php
|
||||
|
||||
$query = '
|
||||
SELECT *
|
||||
FROM lehre.tbl_anrechnungszeitraum
|
||||
ORDER BY anrechnungstart DESC
|
||||
';
|
||||
|
||||
$filterWidgetArray = array(
|
||||
'query' => $query,
|
||||
'tableUniqueId' => 'adminAnrechnung',
|
||||
'requiredPermissions' => 'lehre/anrechnungszeitfenster',
|
||||
'datasetRepresentation' => 'tabulator',
|
||||
'columnsAliases' => array(
|
||||
'AzrID',
|
||||
ucfirst($this->p->t('lehre', 'studiensemester')),
|
||||
ucfirst($this->p->t('anrechnung', 'anrechnungszeitraumStart')),
|
||||
ucfirst($this->p->t('anrechnung', 'anrechnungszeitraumEnde')),
|
||||
ucfirst($this->p->t('ui', 'bearbeitetAm')),
|
||||
ucfirst($this->p->t('ui', 'bearbeitetVon')),
|
||||
),
|
||||
'datasetRepOptions' => '{
|
||||
height: func_height(this),
|
||||
layout: "fitDataFill",
|
||||
persistentLayout:true,
|
||||
autoResize: false, // prevent auto resizing of table (false to allow adapting table size when cols are (de-)activated
|
||||
headerFilterPlaceholder: " ",
|
||||
index: "anrechnungszeitraum_id", // assign specific column as unique id (important for row indexing)
|
||||
selectable: false, // allow row selection
|
||||
tableWidgetHeader: true,
|
||||
tableBuilt: function(){
|
||||
func_tableBuilt(this);
|
||||
},
|
||||
}',
|
||||
'datasetRepFieldsDefs' => '{
|
||||
anrechnungszeitraum_id: {visible: false, headerFilter:"input"},
|
||||
studiensemester_kurzbz: {headerFilter:"input"},
|
||||
anrechnungstart: {headerFilter:"input", formatter: formatDate},
|
||||
anrechnungende: {headerFilter:"input", formatter: formatDate},
|
||||
insertamum: {visible: false, headerFilter:"input"},
|
||||
insertvon: {visible: false, headerFilter:"input"}
|
||||
}'
|
||||
);
|
||||
|
||||
echo $this->widgetlib->widget('TableWidget', $filterWidgetArray);
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user