Merge branch 'master' into FASgendern

This commit is contained in:
Unknown
2019-09-06 15:14:19 +02:00
766 changed files with 10615 additions and 63622 deletions
+506 -293
View File
@@ -1,33 +1,32 @@
<?php
if (!defined('BASEPATH')) exit('No direct script access allowed');
class ReihungstestJob extends CLI_Controller
{
/**
* Constructor
*/
public function __construct()
{
parent::__construct();
/**
* Constructor
*/
public function __construct()
{
parent::__construct();
// Load models
$this->load->model('crm/Reihungstest_model', 'ReihungstestModel');
$this->load->model('crm/RtStudienplan_model', 'RtStudienplanModel');
$this->load->model('organisation/Studiengang_model', 'StudiengangModel');
$this->load->model('organisation/Studienplan_model', 'StudienplanModel');
// Load models
$this->load->model('crm/Reihungstest_model', 'ReihungstestModel');
$this->load->model('crm/RtStudienplan_model', 'RtStudienplanModel');
$this->load->model('organisation/Studiengang_model', 'StudiengangModel');
$this->load->model('organisation/Studienplan_model', 'StudienplanModel');
// Load helpers
$this->load->helper('hlp_sancho_helper');
}
// Load helpers
$this->load->helper('hlp_sancho_helper');
}
/**
* runReihungstestJob
*/
public function runReihungstestJob()
{
// Get study plans that have no assigned placement tests yet
$result = $this->ReihungstestModel->checkMissingReihungstest();
/**
* runReihungstestJob
*/
public function runReihungstestJob()
{
// Get study plans that have no assigned placement tests yet
$result = $this->ReihungstestModel->checkMissingReihungstest();
$missing_rt_arr = array();
if (hasData($result))
@@ -39,8 +38,8 @@ class ReihungstestJob extends CLI_Controller
show_error($result->error);
}
// Get free places
$result = $this->ReihungstestModel->getFreePlaces();
// Get free places
$result = $this->ReihungstestModel->getFreePlaces();
$free_places_arr = array();
if (hasData($result))
@@ -52,8 +51,8 @@ class ReihungstestJob extends CLI_Controller
show_error($result->error);
}
// Prepare data for mail template 'ReihungstestJob'
$content_data_arr = $this->_getContentData($missing_rt_arr, $free_places_arr);
// Prepare data for mail template 'ReihungstestJob'
$content_data_arr = $this->_getContentData($missing_rt_arr, $free_places_arr);
// Send email in Sancho design
if (!empty($missing_rt_arr) || !empty($free_places_arr))
@@ -66,15 +65,37 @@ class ReihungstestJob extends CLI_Controller
}
}
/**
* runZentraleReihungstestAnmeldefristAssistenzJob
/*
* Sends an email to all assistants of a placement test when an anmeldeschluss has been reached
*
* @param integer $degreeProgram. Kennzahl of Degree Program to check
* @param string $bcc. Optional. BCC-Mailadress to send the Mails to
* @param string $from. Optional. Sender-Mailadress shown to recipient
*/
public function runZentraleReihungstestAnmeldefristAssistenzJob()
public function runZentraleReihungstestAnmeldefristAssistenzJob($degreeProgram, $bcc = null, $from = null)
{
// Get placement tests where registration date was yesterday
$result = $this->ReihungstestModel->checkReachedRegistrationDate(11000);
// Encode Params
if ($bcc != '')
{
// $bcc can be given as null-string, so check that too
if ($bcc == 'null')
{
$bcc = '';
}
else
{
$bcc = urldecode($bcc);
}
}
if ($from != '')
{
$from = urldecode($from);
}
$reachedRegistration_rt_arr = array();
// Get placement tests where registration date was yesterday
$result = $this->ReihungstestModel->checkReachedRegistrationDate($degreeProgram);
$reachedRegistration_rt_arr = array();
if (hasData($result))
{
@@ -85,11 +106,11 @@ class ReihungstestJob extends CLI_Controller
show_error($result->error);
}
$applicants_arr = array();
$applicants_arr = array();
foreach ($reachedRegistration_rt_arr as $reihungstest)
{
$applicants = $this->ReihungstestModel->getApplicantsOfPlacementTestForCronjob($reihungstest->reihungstest_id);
foreach ($reachedRegistration_rt_arr as $reihungstest)
{
$applicants = $this->ReihungstestModel->getApplicantsOfPlacementTestForCronjob($reihungstest->reihungstest_id);
if (hasData($applicants))
{
@@ -102,6 +123,7 @@ class ReihungstestJob extends CLI_Controller
// Get all Bachelor-Degree-Programs with Mailadress
$bachelorStudiengeange = $this->StudiengangModel->loadStudiengaengeFromTyp('b');
$bachelorStudiengeange_arr = array();
if (hasData($bachelorStudiengeange))
{
@@ -117,29 +139,13 @@ class ReihungstestJob extends CLI_Controller
foreach ($bachelorStudiengeange_arr as $bachelorStudiengang)
{
$studiengang_kuerzel = strtoupper($bachelorStudiengang->typ.$bachelorStudiengang->kurzbz);
$applicants_list = '';
$applicantCounter = 0;
$rowstyle = 'style="background-color: #EEEEEE; padding: 4px;"';
$mailReceipients = ''; // String with all mailadresses
$mailcontent_data_arr = array();
foreach ($applicants_arr as $applicant)
{
if ($bachelorStudiengang->studiengang_kz == $applicant->studiengang_kz)
{
$mailReceipients .= $applicant->email. ';';
$applicantCounter ++;
$applicants_list .= '
<tr '.$rowstyle.'>
<td>'. $applicant->orgform_kurzbz. '</td>
<td>'. $applicant->ausbildungssemester. '</td>
<td>'. $applicant->nachname. '</td>
<td>'. $applicant->vorname. '</td>
<td>'. $applicant->zgv_kurzbz. '</td>
<td>'. $applicant->prioritaet. '</td>
<td>'. $applicant->qualifikationskurs. '</td>
<td><a href="mailto:'. $applicant->email. '">'. $applicant->email. '</a></td>
</tr>
';
}
}
if ($applicantCounter == 0)
@@ -149,30 +155,14 @@ class ReihungstestJob extends CLI_Controller
}
else
{
$headerstyle = 'style="background: #DCE4EF; border: 1px solid #FFF; padding: 4px; text-align: left;"';
$mailcontent = '<p style="font-family: verdana, sans-serif;">Der Anmeldeschluss für den zentralen Reihungstest am ' . date_format(date_create($reihungstest->datum), 'd.m.Y') . ' um ' . $reihungstest->uhrzeit . ' Uhr wurde gestern erreicht.</p>';
$mailcontent .= '
<p style="font-family: verdana, sans-serif;">Folgende ' . $applicantCounter . ' InteressentInnen des Studiengangs ' . $studiengang_kuerzel . ' nehmen daran teil:</p>
<table width="100%" style="cellpadding: 3px; font-family: verdana, sans-serif; border: 1px solid #000000;">
<thead>
<th '.$headerstyle.'>OrgForm</th>
<th '.$headerstyle.'>Semester</th>
<th '.$headerstyle.'>Nachname</th>
<th '.$headerstyle.'>Vorname</th>
<th '.$headerstyle.'>ZGV</th>
<th '.$headerstyle.'>Priorität</th>
<th '.$headerstyle.'>Qualikurs</th>
<th '.$headerstyle.'>E-Mail</th>
</thead>
<tbody>
';
$mailcontent .= $applicants_list;
$mailcontent .= '
</tbody>
</table>
';
$mailcontent .= '<p style="font-family: verdana, sans-serif;"><a href="mailto:?bcc=' . $mailReceipients . '">Mail an alle schicken</a></p>';
<p style="font-family: verdana, sans-serif;"><b>' . $applicantCounter . '</b> InteressentIn(nen) des Studiengangs ' . $studiengang_kuerzel . ' nehmen daran teil:</p>
<p style="font-family: verdana, sans-serif;">
<a href="'.APP_ROOT.'vilesci/stammdaten/auswertung_fhtw.php?reihungstest='.$reihungstest->reihungstest_id.'&studiengang='.$bachelorStudiengang->studiengang_kz.'" target="_blank">
Liste der Anmeldungen
</a>
</p>';
}
$mailcontent_data_arr['table'] = $mailcontent;
@@ -182,41 +172,66 @@ class ReihungstestJob extends CLI_Controller
sendSanchoMail(
'Sancho_ReihungstestteilnehmerJob',
$mailcontent_data_arr,
array($bachelorStudiengang->email,'kindlm@technikum-wien.at'),
$bachelorStudiengang->email,
'Anmeldeschluss Reihungstest ' . date_format(date_create($reihungstest->datum), 'd.m.Y') . ' ' . $reihungstest->uhrzeit . ' Uhr',
'sancho_header_min_bw.jpg',
'sancho_footer_min_bw.jpg');
'sancho_footer_min_bw.jpg',
$from,
'',
$bcc);
}
}
}
}
/**
* Checks, if an applicant was assigned to a test after Anmeldefrist
/*
* Checks, if an applicant was assigned to a test after Anmeldefrist and sends an email to all responsible assistants
*
* @param integer $degreeProgram. Kennzahl of Degree Program to check
* @param string $bcc. Optional. BCC-Mailadress to send the Mails to
* @param string $from. Optional. Sender-Mailadress shown to recipient
*/
public function runZentraleReihungstestNachtraeglichHinzugefuegtJob()
public function runZentraleReihungstestNachtraeglichHinzugefuegtJob($degreeProgram, $bcc = null, $from = null)
{
// Encode Params
if ($bcc != '')
{
// $bcc can be given as null-string, so check that too
if ($bcc == 'null')
{
$bcc = '';
}
else
{
$bcc = urldecode($bcc);
}
}
if ($from != '')
{
$from = urldecode($from);
}
// Get applicants that have been added to a test after Anmeldefrist
$result = $this->ReihungstestModel->getApplicantAssignedAfterDate(11000);
$result = $this->ReihungstestModel->getApplicantAssignedAfterDate($degreeProgram);
$applicants_after_anmeldefrist_arr = array();
$applicants_after_anmeldefrist_arr = array();
if (hasData($result))
{
$applicants_after_anmeldefrist_arr = $result->retval;
}
elseif (isError($result))
{
show_error($result->error);
}
if (hasData($result))
{
$applicants_after_anmeldefrist_arr = $result->retval;
}
elseif (isError($result))
{
show_error($result->error);
}
$studiengang = '';
$mailReceipients = ''; // String with all mailadresses
$mailcontent_data_arr = array();
$headerstyle = 'style="background: #DCE4EF; border: 1px solid #FFF; padding: 4px; text-align: left;"';
$rowstyle = 'style="background-color: #EEEEEE; padding: 4px;"';
$mailcontent = '';
$applicants_list = '';
$studiengang = '';
$mailReceipients = ''; // String with all mailadresses
$mailcontent_data_arr = array();
$headerstyle = 'style="background: #DCE4EF; border: 1px solid #FFF; padding: 4px; text-align: left;"';
$rowstyle = 'style="background-color: #EEEEEE; padding: 4px;"';
$mailcontent = '';
$applicants_list = '';
if (count($applicants_after_anmeldefrist_arr) > 0)
{
@@ -229,20 +244,27 @@ class ReihungstestJob extends CLI_Controller
$bachelorStudiengang = $this->StudiengangModel->load($studiengang);
$mailcontent .= $applicants_list;
$mailcontent .= '</tbody></table>';
$mailcontent .= '<p style="font-family: verdana, sans-serif;"><a href="mailto:?bcc=' . $mailReceipients . '">Mail an alle schicken</a></p>';
$mailcontent .= '<p style="font-family: verdana, sans-serif;">
<a href="'.APP_ROOT.'vilesci/stammdaten/auswertung_fhtw.php?reihungstest='.$applicant->reihungstest_id.'&studiengang='.$studiengang.'" target="_blank">
Liste der Anmeldungen
</a>
</p>';
$mailcontent_data_arr['table'] = $mailcontent;
sendSanchoMail(
'Sancho_ReihungstestteilnehmerJob',
$mailcontent_data_arr,
array($bachelorStudiengang->retval[0]->email,'kindlm@technikum-wien.at'),
$bachelorStudiengang->retval[0]->email,
'InteressentIn nach Reihungstest-Anmeldeschluss hinzugefügt',
'sancho_header_min_bw.jpg',
'sancho_footer_min_bw.jpg');
'sancho_footer_min_bw.jpg',
$from,
'',
$bcc);
$applicants_list = '';
$mailcontent_data_arr = array();
}
$mailcontent = '<p style="font-family: verdana, sans-serif;">Folgende InteressentInnen wurden <b>nach</b> der Anmeldefrist zu einem Reihungstest hinzugefügt.</p>';
$mailcontent = '<p style="font-family: verdana, sans-serif;">Folgende InteressentInnen wurden <b>nach</b> der Anmeldefrist zu einem Reihungstest hinzugefügt.<br>Details siehe Link</p>';
$mailcontent .= '
<table width="100%" style="cellpadding: 3px; font-family: verdana, sans-serif; border: 1px solid #000000;">
<thead>
@@ -252,18 +274,14 @@ class ReihungstestJob extends CLI_Controller
<th ' . $headerstyle . '>Semester</th>
<th ' . $headerstyle . '>Nachname</th>
<th ' . $headerstyle . '>Vorname</th>
<th ' . $headerstyle . '>ZGV</th>
<th ' . $headerstyle . '>Priorität</th>
<th ' . $headerstyle . '>Qualikurs</th>
<th ' . $headerstyle . '>E-Mail</th>
</thead>
<tbody>
';
}
}
$studiengang = $applicant->studiengang_kz;
$mailReceipients .= $applicant->email . ';';
$applicants_list .= '
$studiengang = $applicant->studiengang_kz;
$mailReceipients .= $applicant->email . ';';
$applicants_list .= '
<tr ' . $rowstyle . '>
<td>' . date_format(date_create($applicant->datum), 'd.m.Y') . '</td>
<td>' . $applicant->uhrzeit . '</td>
@@ -271,25 +289,28 @@ class ReihungstestJob extends CLI_Controller
<td>' . $applicant->ausbildungssemester . '</td>
<td>' . $applicant->nachname . '</td>
<td>' . $applicant->vorname . '</td>
<td>' . $applicant->zgv_kurzbz . '</td>
<td>' . $applicant->prioritaet . '</td>
<td>' . $applicant->qualifikationskurs . '</td>
<td><a href="mailto:' . $applicant->email . '">' . $applicant->email . '</a></td>
</tr>
';
};
$bachelorStudiengang = $this->StudiengangModel->load($studiengang);
$mailcontent .= $applicants_list;
$mailcontent .= '</tbody></table>';
$mailcontent .= '<p style="font-family: verdana, sans-serif;"><a href="mailto:?bcc=' . $mailReceipients . '">Mail an alle schicken</a></p>';
$mailcontent .= '<p style="font-family: verdana, sans-serif;">
<a href="'.APP_ROOT.'vilesci/stammdaten/auswertung_fhtw.php?reihungstest='.$applicant->reihungstest_id.'&studiengang='.$studiengang.'" target="_blank">
Liste der Anmeldungen
</a>
</p>';
$mailcontent_data_arr['table'] = $mailcontent;
sendSanchoMail(
'Sancho_ReihungstestteilnehmerJob',
$mailcontent_data_arr,
array($bachelorStudiengang->retval[0]->email,'kindlm@technikum-wien.at'),
$bachelorStudiengang->retval[0]->email,
'InteressentIn nach Reihungstest-Anmeldeschluss hinzugefügt',
'sancho_header_min_bw.jpg',
'sancho_footer_min_bw.jpg');
'sancho_footer_min_bw.jpg',
$from,
'',
$bcc);
}
}
@@ -300,82 +321,86 @@ class ReihungstestJob extends CLI_Controller
* @param string $bcc. Optional. BCC-Mailadress to send the Mails to
* @param string $from. Optional. Sender-Mailadress shown to recipient
*/
public function remindApplicantsOfPlacementTest()
public function remindApplicantsOfPlacementTest($degreeProgram, $bcc = null, $from = null)
{
$degreeProgram = $this->input->get('degreeprogram');
$bcc = $this->input->get('bcc');
$from = $this->input->get('from');
// Encode Params
if ($bcc != '')
{
$bcc = urldecode($bcc);
// $bcc can be given as null-string, so check that too
if ($bcc == 'null')
{
$bcc = '';
}
else
{
$bcc = urldecode($bcc);
}
}
if ($from != '')
{
$from = urldecode($from);
}
// Get placement tests with testdate within the next 2 weeks
$resultNextTestDates = $this->ReihungstestModel->getNextPlacementtests($degreeProgram, 14);
if (hasData($resultNextTestDates))
{
$nextTestDates = $resultNextTestDates->retval;
$enddate = '';
// Loop through the dates
foreach ($nextTestDates as $testDates)
{
$workingdays = 0;
$testsOndate = array();
// Get placement tests with testdate within the next 2 weeks
$resultNextTestDates = $this->ReihungstestModel->getNextPlacementtests($degreeProgram, 14);
if (hasData($resultNextTestDates))
{
$nextTestDates = $resultNextTestDates->retval;
$enddate = '';
// Loop through the dates
foreach ($nextTestDates as $testDates)
{
$workingdays = 0;
$testsOndate = array();
// Deduct days till 3 working days are reached
for ($i = 1; ; $i++)
{
if (isDateWorkingDay($testDates->datum, $i) === true)
{
$workingdays++;
}
if ($workingdays == 3)
{
$enddate = date("Y-m-d", strtotime("$testDates->datum -".$i." days"));
break;
}
else
{
continue;
}
}
// Deduct days till 3 working days are reached
for ($i = 1; ; $i++)
{
if (isDateWorkingDay($testDates->datum, $i) === true)
{
$workingdays++;
}
if ($workingdays == 3)
{
$enddate = date("Y-m-d", strtotime("$testDates->datum -" . $i . " days"));
break;
}
else
{
continue;
}
}
// If $enddate is today -> load all tests of $testDates->datum
if (date("Y-m-d", strtotime($enddate)) == date('Y-m-d'))
{
$resultTestsOnDate = $this->ReihungstestModel->getTestsOnDate($testDates->datum, $degreeProgram);
// If $enddate is today -> load all tests of $testDates->datum
if (date("Y-m-d", strtotime($enddate)) == date('Y-m-d'))
{
$resultTestsOnDate = $this->ReihungstestModel->getTestsOnDate($testDates->datum, $degreeProgram);
if (hasData($resultTestsOnDate))
{
$testsOndate = $resultTestsOnDate->retval;
}
elseif (isError($resultTestsOnDate))
{
show_error($resultTestsOnDate->error);
}
}
if (hasData($resultTestsOnDate))
{
$testsOndate = $resultTestsOnDate->retval;
}
elseif (isError($resultTestsOnDate))
{
show_error($resultTestsOnDate->error);
}
}
if (!isEmptyArray($testsOndate))
{
foreach ($testsOndate as $reihungstest)
{
// Loads applicants of a test
$applicants = $this->ReihungstestModel->getApplicantsOfPlacementTest($reihungstest->reihungstest_id);
if (!isEmptyArray($testsOndate))
{
foreach ($testsOndate as $reihungstest)
{
// Loads applicants of a test
$applicants = $this->ReihungstestModel->getApplicantsOfPlacementTest($reihungstest->reihungstest_id);
if (hasData($applicants))
{
$applicants_arr = $applicants->retval;
}
elseif (isError($applicants))
{
show_error($applicants->error);
}
if (hasData($applicants))
{
$applicants_arr = $applicants->retval;
}
elseif (isError($applicants))
{
show_error($applicants->error);
}
foreach ($applicants_arr as $applicant)
{
@@ -386,71 +411,247 @@ class ReihungstestJob extends CLI_Controller
$mailcontent_data_arr['rt_datum'] = date_format(date_create($reihungstest->datum), 'd.m.Y');
$mailcontent_data_arr['rt_uhrzeit'] = date_format(date_create($reihungstest->uhrzeit), 'H:i');
$mailcontent_data_arr['rt_raum'] = $applicant->planbezeichnung;
$mailcontent_data_arr['wegbeschreibung'] = $applicant->lageplan;
if ($applicant->lageplan == '')
{
$mailcontent_data_arr['wegbeschreibung'] = 'Für diesen Raum liegt noch keine Wegbeschreibung vor.<br><br>No directions were found for this room';
}
else
{
$mailcontent_data_arr['wegbeschreibung'] = $applicant->lageplan;
}
sendSanchoMail(
'Sancho_RemindApplicantsOfTest',
$mailcontent_data_arr,
$applicant->email,
'Ihre Anmeldung zum Reihungstest - Reminder / Your registration for the placement test - Reminder',
DEFAULT_SANCHO_HEADER_IMG,
DEFAULT_SANCHO_FOOTER_IMG,
$from,
'',
$bcc);
}
}
}
}
}
}
sendSanchoMail(
'Sancho_RemindApplicantsOfTest',
$mailcontent_data_arr,
$applicant->email,
'Ihre Anmeldung zum Reihungstest - Reminder / Your registration for the placement test - Reminder',
DEFAULT_SANCHO_HEADER_IMG,
DEFAULT_SANCHO_FOOTER_IMG,
$from,
'',
$bcc);
}
}
}
}
}
}
// ------------------------------------------------------------------------
// Private methods
/**
* Returns associative array with data as needed in the reihungstest job template.
* @param array $missing_rt_arr Array with studienpläne, which have no assigned placement tests.
* @param array $free_places_arr Array with info and amount of free placement test places.
* @return array
*/
private function _getContentData($missing_rt_arr, $free_places_arr)
{
$style_tbl1 = ' cellpadding="0" cellspacing="10" width="100%" style="font-family: courier, verdana, sans-serif; font-size: 0.95em; border: 1px solid #000000;" ';
$style_tbl2 = ' cellpadding="0" cellspacing="20" width="100%" style="font-family: courier, verdana, sans-serif; font-size: 0.95em; border: 1px solid #000000;" ';
/**
* This job sends eMail(s) to the relevant stg assistance(s) informing about:
* All applicants, who have sent new applications AFTER they had absolved a
* placement test in the actual studiensemester
* AND who have been confirmed yesterday.
*/
public function mailNewApplicants()
{
// Get yesterdays confirmed applicants for Bachelor-studies
$this->load->model('crm/Prestudentstatus_model', 'PrestudentstatusModel');
$this->PrestudentstatusModel->addSelect('
tbl_person.person_id,
tbl_prestudentstatus.prestudent_id,
tbl_prestudent.studiengang_kz,
tbl_prestudentstatus.studiensemester_kurzbz,
tbl_prestudentstatus.bestaetigtam,
tbl_prestudentstatus.bewerbung_abgeschicktamum
');
$this->PrestudentstatusModel->addJoin('public.tbl_prestudent', 'prestudent_id');
$this->PrestudentstatusModel->addJoin('public.tbl_studiengang', 'studiengang_kz');
$this->PrestudentstatusModel->addJoin('public.tbl_studiengangstyp', 'typ');
$this->PrestudentstatusModel->addJoin('public.tbl_person', 'person_id');
// Prepare HTML table with study plans that have no placement tests yet
if (!empty($missing_rt_arr))
{
$studienplan_list
= '
<table'. $style_tbl2.'>
$yesterdays_applicants_arr = $this->PrestudentstatusModel->loadWhere('
status_kurzbz = \'Interessent\' AND
typ = \'b\' AND
bestaetigtam = current_date - 1
');
// Retrieve the person_ids of yesterdays confirmed applicants
$person_id_arr = array();
if (hasData($yesterdays_applicants_arr))
{
foreach ($yesterdays_applicants_arr->retval as $yesterdays_applicant)
{
if (isset($yesterdays_applicant->person_id)) {
$person_id_arr[] = $yesterdays_applicant->person_id;
}
}
}
elseif (isError($yesterdays_applicants_arr))
{
show_error($yesterdays_applicants_arr->error);
}
// Get all other prestudenten of the given persons.
if (!isEmptyArray($person_id_arr))
{
$this->load->model('crm/Prestudent_model', 'PrestudentModel');
$this->PrestudentModel->addDistinct();
$this->PrestudentModel->addSelect('
person_id,
tbl_reihungstest.studiensemester_kurzbz,
tbl_reihungstest.reihungstest_id,
(SELECT(tbl_reihungstest.datum::text || \' \' || tbl_reihungstest.uhrzeit::text)::timestamp) AS reihungstest_timestamp
');
$this->PrestudentModel->addJoin('public.tbl_studiengang', 'studiengang_kz');
$this->PrestudentModel->addJoin('public.tbl_studiengangstyp', 'typ');
$this->PrestudentModel->addJoin('public.tbl_prestudentstatus', 'prestudent_id');
$this->PrestudentModel->addJoin('public.tbl_person', 'person_id');
$this->PrestudentModel->addJoin('public.tbl_rt_person', 'person_id');
$this->PrestudentModel->addJoin('public.tbl_reihungstest', 'tbl_reihungstest.reihungstest_id = tbl_rt_person.rt_id');
// Store them, if they have already absolved a placement test in the same study term they have applied for.
$placement_absolvents_arr = $this->PrestudentModel->loadWhere('
person_id IN (' . implode(', ', $person_id_arr) . ') AND
typ = \'b\' AND
teilgenommen = \'t\' AND
tbl_reihungstest.studiensemester_kurzbz IN (
SELECT
studiensemester_kurzbz
FROM
public.tbl_studiensemester
WHERE
ende >= now()
)
');
}
// Store data to be send in the email-link
$result_arr = array();
foreach($yesterdays_applicants_arr->retval as $yesterdays_applicant)
{
foreach ($placement_absolvents_arr->retval as $placement_absolvent)
{
if ($yesterdays_applicant->person_id == $placement_absolvent->person_id &&
$yesterdays_applicant->studiensemester_kurzbz == $placement_absolvent->studiensemester_kurzbz &&
$yesterdays_applicant->bewerbung_abgeschicktamum >= $placement_absolvent->reihungstest_timestamp)
{
$obj = new stdClass();
$obj->prestudent_id = $yesterdays_applicant->prestudent_id; // prestudent_id of the yesterdays applicant
$obj->studiengang_kz = $yesterdays_applicant->studiengang_kz; // study program of interest of the yesterdays applicant
$obj->reihungstest_id = $placement_absolvent->reihungstest_id; // reihungstest_id of absolved reihungstest of that person
$result_arr[]= $obj;
}
}
}
// Sort by STG. This is important to send the mails clustered by STG to the different STG assistances.
usort($result_arr, function ($a, $b)
{
if ($a->studiengang_kz == $b->studiengang_kz) {
return 0;
}
return ($a->studiengang_kz < $b->studiengang_kz) ? -1 : 1;
});
$to = ''; // mail recipient (stg assistance)
$content_arr = array(); // url paths to the new applicants
$base_link = base_url('vilesci/stammdaten/auswertung_fhtw.php');
$i = 0; // loop counter
$len = count($result_arr);
// Loop trough list of new applicants
foreach($result_arr as $result)
{
$studiengang = $this->StudiengangModel->load($result->studiengang_kz);
$mail_stg_assistance = $studiengang->retval[0]->email;
// If first loop
if ($i == 0)
{
$to = $mail_stg_assistance; // set recipient initially
}
// If new study is encountered but is not the first loop
if ($to != $mail_stg_assistance && $i != 0)
{
// Prepare content for mail template
$content_data_arr = $this->_getContentDataNewApplicant($content_arr);
// Send mail
sendSanchoMail(
'BewerberNachReihungstest',
$content_data_arr,
$to,
'Neue Bewerbungen nach absolviertem Reihungstest',
'sancho_header_min_bw.jpg',
'sancho_footer_min_bw.jpg'
);
// Reset content for new study applicants & reset recipient (new stg assistance)
$content_arr = array($base_link. '?reihungstest='. $result->reihungstest_id. '&prestudent_id='. $result->prestudent_id);
$to = $mail_stg_assistance;
}
// If same study
else
{
// just add content
$content_arr[]= $base_link. '?reihungstest='. $result->reihungstest_id. '&prestudent_id='. $result->prestudent_id; // add to content
}
// If last loop
if (($i == $len - 1))
{
// Prepare content for mail template
$content_data_arr = $this->_getContentDataNewApplicant($content_arr);
// Send mail
sendSanchoMail(
'BewerberNachReihungstest',
$content_data_arr,
$to,
'Neue Bewerbungen nach absolviertem Reihungstest',
'sancho_header_min_bw.jpg',
'sancho_footer_min_bw.jpg'
);
}
$i++; // iterate counter
}
}
// ------------------------------------------------------------------------
// Private methods
/**
* Returns associative array with data as needed in the reihungstest job template.
* @param array $missing_rt_arr Array with studienpläne, which have no assigned placement tests.
* @param array $free_places_arr Array with info and amount of free placement test places.
* @return array
*/
private function _getContentData($missing_rt_arr, $free_places_arr)
{
$style_tbl1 = ' cellpadding="0" cellspacing="10" width="100%" style="font-family: courier, verdana, sans-serif; font-size: 0.95em; border: 1px solid #000000;" ';
$style_tbl2 = ' cellpadding="0" cellspacing="20" width="100%" style="font-family: courier, verdana, sans-serif; font-size: 0.95em; border: 1px solid #000000;" ';
// Prepare HTML table with study plans that have no placement tests yet
if (!empty($missing_rt_arr)) {
$studienplan_list
= '
<table' . $style_tbl2 . '>
';
foreach ($missing_rt_arr as $rt)
{
$studienplan_list .= '
<tr><td>'. $rt->bezeichnung. '</td></tr>
foreach ($missing_rt_arr as $rt) {
$studienplan_list .= '
<tr><td>' . $rt->bezeichnung . '</td></tr>
';
}
}
$studienplan_list .= '
$studienplan_list .= '
</table>
';
}
else
{
$studienplan_list = '
<table'. $style_tbl1.'>
} else {
$studienplan_list = '
<table' . $style_tbl1 . '>
<tr><td>Alles okay! Alle Studienpläne haben zumindest einen Reihungstest.</td></tr>
</table>
';
}
}
// Prepare HTML table with information and amount of free places
if (!empty($free_places_arr))
{
$freie_plaetze_list = '
<table'. $style_tbl2.'>
// Prepare HTML table with information and amount of free places
if (!empty($free_places_arr)) {
$freie_plaetze_list = '
<table' . $style_tbl2 . '>
<tr>
<th>Fakultät</th>
<th>Reihungstesttermine</th>
@@ -458,51 +659,67 @@ class ReihungstestJob extends CLI_Controller
</tr>
';
foreach ($free_places_arr as $free_place)
{
$datum = new DateTime($free_place->datum);
$style_alarm = ($free_place->freie_plaetze <= 5) ? ' style=" color: red; font-weight: bold" ' : ''; // mark if <=5 free places
foreach ($free_places_arr as $free_place) {
$datum = new DateTime($free_place->datum);
$style_alarm = ($free_place->freie_plaetze <= 5) ? ' style=" color: red; font-weight: bold" ' : ''; // mark if <=5 free places
$freie_plaetze_list .= '
$freie_plaetze_list .= '
<tr>
<td width="350">'. $free_place->fakultaet. '</td>
<td align="center">'. $datum->format('d.m.Y'). '</td>
<td align="center"'. $style_alarm.'>'. $free_place->freie_plaetze. '</td>
<td width="350">' . $free_place->fakultaet . '</td>
<td align="center">' . $datum->format('d.m.Y') . '</td>
<td align="center"' . $style_alarm . '>' . $free_place->freie_plaetze . '</td>
</tr>
';
}
}
$freie_plaetze_list .= '
$freie_plaetze_list .= '
</table>
';
}
else
{
$freie_plaetze_list = '
<table'. $style_tbl1.'>
} else {
$freie_plaetze_list = '
<table' . $style_tbl1 . '>
<tr><td>Es gibt heute keine Ergebnisse zu freien Reihungstestplätze.</td></tr>
</table>
';
}
}
// Set associative array with the prepared HTML tables and URL be used by the template's variables
$content_data_arr['studienplan_list'] = $studienplan_list;
$content_data_arr['freie_plaetze_list'] = $freie_plaetze_list;
$content_data_arr['link'] = site_url('/organisation/Reihungstest');
// Set associative array with the prepared HTML tables and URL be used by the template's variables
$content_data_arr['studienplan_list'] = $studienplan_list;
$content_data_arr['freie_plaetze_list'] = $freie_plaetze_list;
$content_data_arr['link'] = site_url('/organisation/Reihungstest');
return $content_data_arr;
}
return $content_data_arr;
}
/**
* Returns associative array with data as needed in the BewerberNachReihungstest-template.
* @param array $content_arr Array with links to the testtool evaluation page of the new applicants.
* @return array
*/
private function _getContentDataNewApplicant($content_arr)
{
$content = '';
$counter = 1;
foreach ($content_arr as $row)
{
$content .= '<br>Link zu: <a href="'. $row. '">Bewerber '. $counter. '</a>';
$counter++;
}
$content_data_arr['link'] = $content;
return $content_data_arr;
}
/**
* Checks the upcoming placement tests if there are correct studyplans assigned
* If there are invalid studyplans assigned (outdated because there exists a new version),
* it tries to find a better one and assigns it additionaly
*/
public function correctStudienplan()
{
// get all placement tests with incorrect studyplan
$qry = "
/**
* Checks the upcoming placement tests if there are correct studyplans assigned
* If there are invalid studyplans assigned (outdated because there exists a new version),
* it tries to find a better one and assigns it additionaly
*/
public function correctStudienplan()
{
// get all placement tests with incorrect studyplan
$qry = "
SELECT
tbl_reihungstest.reihungstest_id,
tbl_studienplan.studienplan_id,
@@ -535,42 +752,38 @@ class ReihungstestJob extends CLI_Controller
)
";
$db = new DB_Model();
$result_rt = $db->execReadOnlyQuery($qry);
$db = new DB_Model();
$result_rt = $db->execReadOnlyQuery($qry);
if(hasdata($result_rt))
{
foreach ($result_rt->retval as $row_rt)
{
// find an active studyplan for the same degree program with is valid in this semester
$result_stpl = $this->StudienplanModel->getStudienplaeneBySemester(
$row_rt->studiengang_kz,
$row_rt->studiensemester_kurzbz
);
if (hasdata($result_rt)) {
foreach ($result_rt->retval as $row_rt) {
// find an active studyplan for the same degree program with is valid in this semester
$result_stpl = $this->StudienplanModel->getStudienplaeneBySemester(
$row_rt->studiengang_kz,
$row_rt->studiensemester_kurzbz
);
if(hasData($result_stpl))
{
foreach($result_stpl->retval as $row_stpl)
{
// Add new Studyplan to RtStudienplan if missing
$rt_studienplan = $this->RtStudienplanModel->loadWhere(array(
"reihungstest_id" => $row_rt->reihungstest_id,
"studienplan_id" => $row_stpl->studienplan_id
));
if (hasData($result_stpl)) {
foreach ($result_stpl->retval as $row_stpl) {
// Add new Studyplan to RtStudienplan if missing
$rt_studienplan = $this->RtStudienplanModel->loadWhere(array(
"reihungstest_id" => $row_rt->reihungstest_id,
"studienplan_id" => $row_stpl->studienplan_id
));
if(!hasData($rt_studienplan))
{
echo "\nAdding StudienplanId: $row_stpl->studienplan_id";
echo " to ReihungstestId: $row_rt->reihungstest_id";
if (!hasData($rt_studienplan)) {
echo "\nAdding StudienplanId: $row_stpl->studienplan_id";
echo " to ReihungstestId: $row_rt->reihungstest_id";
$this->RtStudienplanModel->insert(array(
"reihungstest_id" => $row_rt->reihungstest_id,
"studienplan_id" => $row_stpl->studienplan_id
));
}
}
}
}
}
}
$this->RtStudienplanModel->insert(array(
"reihungstest_id" => $row_rt->reihungstest_id,
"studienplan_id" => $row_stpl->studienplan_id
));
}
}
}
}
}
}
}
+79 -4
View File
@@ -28,6 +28,7 @@ class Gradelist extends Auth_Controller
$this->load->model('education/zeugnisnote_model', 'ZeugnisnoteModel');
$this->load->model('education/lehrveranstaltung_model', 'LehrveranstaltungModel');
$this->load->model('codex/note_model', 'NoteModel');
$this->load->model('education/lehrveranstaltung_model', 'LehrveranstaltungModel');
$this->loadPhrases(
array(
@@ -45,6 +46,9 @@ class Gradelist extends Auth_Controller
$this->_grades[$row->note]['anmerkung'] = $row->anmerkung;
$this->_grades[$row->note]['notenwert'] = $row->notenwert;
}
$this->_grades['']['positiv'] = false;
$this->_grades['']['anmerkung'] = '';
$this->_grades['']['notenwert'] = 0;
}
/**
@@ -163,6 +167,14 @@ class Gradelist extends Auth_Controller
'studienplan_bezeichnung' => $stpl_bezeichnung,
);
}
$result_zuordnung = $this->LehrveranstaltungModel->getLvsByStudent($uid, $row_status->studiensemester_kurzbz);
if(isSuccess($result_zuordnung) && hasData($result_zuordnung))
{
$this->setZuordnung(
$result_zuordnung,
$courses['semester'][$row_status->studiensemester_kurzbz]['lvs']
);
}
}
// Load Grades and add to studyplan
@@ -186,6 +198,7 @@ class Gradelist extends Auth_Controller
if (!isset($row_noten->found))
{
$result_lv = $this->LehrveranstaltungModel->load($row_noten->lehrveranstaltung_id);
$result_stg = $this->StudiengangModel->load($result_lv->retval[0]->studiengang_kz);
$courses['semester'][$row_noten->studiensemester_kurzbz]['lvs_nonstpl'][] = array(
'lehrveranstaltung_id' => $row_noten->lehrveranstaltung_id,
'lehrtyp_kurzbz' => $result_lv->retval[0]->lehrtyp_kurzbz,
@@ -194,13 +207,20 @@ class Gradelist extends Auth_Controller
'sws' => $result_lv->retval[0]->sws,
'zeugnis' => $result_lv->retval[0]->zeugnis,
'bezeichnung' => $result_lv->retval[0]->bezeichnung,
'kurzbz' => $result_lv->retval[0]->kurzbz,
'ects' => $result_lv->retval[0]->ects,
'semester' => $result_lv->retval[0]->semester,
'note' => $row_noten->note,
'datum' => $row_noten->benotungsdatum
'datum' => $row_noten->benotungsdatum,
'zugeordnet' => true,
'studiengang_kurzbz' => $result_stg->retval[0]->kurzbzlang
);
if(!isset($courses['semester'][$row_noten->studiensemester_kurzbz]['data']['ectssumme_nonstpl']))
$courses['semester'][$row_noten->studiensemester_kurzbz]['data']['ectssumme_nonstpl'] = 0;
if(!isset($courses['semester'][$row_noten->studiensemester_kurzbz]['data']['swssumme_nonstpl']))
$courses['semester'][$row_noten->studiensemester_kurzbz]['data']['swssumme_nonstpl'] = 0;
$courses['semester'][$row_noten->studiensemester_kurzbz]['data']['ectssumme_nonstpl'] += $result_lv->retval[0]->ects;
$courses['semester'][$row_noten->studiensemester_kurzbz]['data']['swssumme_nonstpl'] += $result_lv->retval[0]->sws;
}
}
@@ -210,6 +230,8 @@ class Gradelist extends Auth_Controller
$num_grades_overall = 0;
$sum_ects_overall = 0;
$sum_ects_positiv_overall = 0;
$sum_sws_overall = 0;
$sum_sws_positiv_overall = 0;
// Calculate Sum and Average
foreach ($courses['semester'] as $stsem => $row_lvs)
@@ -219,6 +241,8 @@ class Gradelist extends Auth_Controller
$num_grades = 0;
$sum_ects = 0;
$sum_ects_positiv = 0;
$sum_sws = 0;
$sum_sws_positiv = 0;
$sum_grades = 0;
$notendurchschnitt = 0;
$sum_gradeweighted = 0;
@@ -235,8 +259,12 @@ class Gradelist extends Auth_Controller
$sum_gradeweighted += $row['ects'] * $this->_grades[$row['note']]['notenwert'];
}
$sum_ects += $row['ects'];
$sum_sws += $row['sws'];
if ($this->_grades[$row['note']]['positiv'])
{
$sum_ects_positiv += $row['ects'];
$sum_sws_positiv += $row['sws'];
}
}
if ($num_grades > 0)
$notendurchschnitt = $sum_grades / $num_grades;
@@ -254,11 +282,15 @@ class Gradelist extends Auth_Controller
$sum_ectsweighted_overall += $sum_ectsweighted;
$sum_ects_overall += $sum_ects;
$sum_ects_positiv_overall += $sum_ects_positiv;
$sum_sws_overall += $sum_sws;
$sum_sws_positiv_overall += $sum_sws_positiv;
$courses['semester'][$stsem]['data']['notendurchschnitt'] = number_format($notendurchschnitt, 2);
$courses['semester'][$stsem]['data']['notendurchschnittgewichtet'] = number_format($notendurchschnittgewichtet, 2);
$courses['semester'][$stsem]['data']['ectssumme'] = number_format($sum_ects,2);
$courses['semester'][$stsem]['data']['ectssumme_positiv'] = number_formaT($sum_ects_positiv,2);
$courses['semester'][$stsem]['data']['ectssumme_positiv'] = number_format($sum_ects_positiv,2);
$courses['semester'][$stsem]['data']['swssumme'] = number_format($sum_sws,2);
$courses['semester'][$stsem]['data']['swssumme_positiv'] = number_format($sum_sws_positiv,2);
}
if ($num_grades_overall > 0)
@@ -275,7 +307,9 @@ class Gradelist extends Auth_Controller
'notendurchschnitt' => number_format($notendurchschnitt, 2),
'notendurchschnittgewichtet' => number_format($notendurchschnittgewichtet, 2),
'ectssumme' => $sum_ects_overall,
'ectssumme_positiv' => $sum_ects_positiv_overall
'ectssumme_positiv' => $sum_ects_positiv_overall,
'swssumme' => $sum_sws_overall,
'swssumme_positiv' => $sum_sws_positiv_overall
);
return $courses;
}
@@ -306,6 +340,37 @@ class Gradelist extends Auth_Controller
}
}
/**
* Checks if the Student is Assigned to this course and marks the course
* @param $zuordnung reference to array of all assigned courses.
* @param $courses reference to array of all courses.
* @param $studiensemester_kurzbz Studiensemester of the Course and Grades
*/
private function setZuordnung(&$zuordnung, &$courses)
{
$subtree_zugeordnet = false;
foreach ($courses as $key => $value)
{
foreach ($zuordnung->retval as $zuordnungkey => $row_zuordnung)
{
if ($row_zuordnung->lehrveranstaltung_id == $value['lehrveranstaltung_id'])
{
$courses[$key]['zugeordnet'] = true;
$subtree_zugeordnet = true;
}
if (isset($value['childs']))
{
if ($this->setZuordnung($zuordnung, $courses[$key]['childs']) === true)
{
$courses[$key]['zugeordnet'] = true;
$subtree_zugeordnet = true;
}
}
}
}
return $subtree_zugeordnet;
}
/**
* Reads all the Courses recursivly and Returns an Array with the Grades and ECTS
* @param $courses array of courses
@@ -320,7 +385,17 @@ class Gradelist extends Auth_Controller
{
$grades[] = array(
'note' => $row['note'],
'ects' => $row['ects']
'ects' => $row['ects'],
'sws' => $row['sws']
);
}
elseif (isset($row['zugeordnet']) && $row['zugeordnet'] == true && $row['lehrtyp_kurzbz']=='lv')
{
// ECTS und SWS mitzaehlen wenn die Person zugeordnet ist auch wenn noch keine Noten vorhanden ist.
$grades[] = array(
'note' => '',
'ects' => $row['ects'],
'sws' => $row['sws']
);
}
@@ -65,6 +65,13 @@ class InfoCenter extends Auth_Controller
)
);
// Name of Interessentenstatus
const INTERESSENTSTATUS = 'Interessent';
const ABGEWIESENERSTATUS = 'Abgewiesener';
// Statusgruende for which no Studiengangsfreigabemessage should be sent
private $_statusgruendeNoStgFreigabeMessage = array('FIT Programm', 'FIT program', 'FIT programme');
/**
* Constructor
*/
@@ -168,7 +175,6 @@ class InfoCenter extends Auth_Controller
/**
* Personal details page of the InfoCenter tool
* Initialization function, gets person and prestudent data and loads the view with the data
* @param $person_id
*/
public function showDetails()
{
@@ -343,7 +349,6 @@ class InfoCenter extends Auth_Controller
/**
* Saves a ZGV for a prestudent, includes Ort, Datum, Nation for bachelor and master
* @param $prestudent_id
*/
public function saveZgvPruefung()
{
@@ -372,7 +377,7 @@ class InfoCenter extends Auth_Controller
$zgvmadatum = isEmptyString($zgvmadatum) ? null : date_format(date_create($zgvmadatum), 'Y-m-d');
$zgvmanation_code = $this->input->post('zgvmanation') === 'null' ? null : $this->input->post('zgvmanation');
$lastStatus = $this->PrestudentstatusModel->getLastStatus($prestudent_id, '', 'Interessent');
$lastStatus = $this->PrestudentstatusModel->getLastStatus($prestudent_id, '', self::INTERESSENTSTATUS);
$semresult = null;
@@ -423,7 +428,6 @@ class InfoCenter extends Auth_Controller
/**
* Saves Absage for Prestudent including the reason for the Absage (statusgrund).
* inserts Studiensemester and Ausbildungssemester for the new Absage of (chronologically) last status.
* @param $prestudent_id
*/
public function saveAbsage()
{
@@ -439,7 +443,7 @@ class InfoCenter extends Auth_Controller
if (hasData($lastStatus) && hasData($statusgrresult))
{
//check if still Interessent and not freigegeben yet
if ($lastStatus->retval[0]->status_kurzbz === 'Interessent' && !isset($lastStatus->retval[0]->bestaetigtam))
if ($lastStatus->retval[0]->status_kurzbz === self::INTERESSENTSTATUS && !isset($lastStatus->retval[0]->bestaetigtam))
{
$result = $this->PrestudentstatusModel->insert(
array(
@@ -449,7 +453,7 @@ class InfoCenter extends Auth_Controller
'datum' => date('Y-m-d'),
'orgform_kurzbz' => $lastStatus->retval[0]->orgform_kurzbz,
'studienplan_id' => $lastStatus->retval[0]->studienplan_id,
'status_kurzbz' => 'Abgewiesener',
'status_kurzbz' => self::ABGEWIESENERSTATUS,
'statusgrund_id' => $statusgrund,
'insertvon' => $this->_uid,
'insertamum' => date('Y-m-d H:i:s')
@@ -475,7 +479,6 @@ class InfoCenter extends Auth_Controller
/**
* Saves Freigabe of a Prestudent to the Studiengang.
* updates bestaetigtam and bestaetigtvon fields of the last status
* @param $prestudent_id
*/
public function saveFreigabe()
{
@@ -494,7 +497,7 @@ class InfoCenter extends Auth_Controller
$lastStatus = $lastStatus->retval[0];
//check if still Interessent and not freigegeben yet
if ($lastStatus->status_kurzbz === 'Interessent' && !isset($lastStatus->bestaetigtam))
if ($lastStatus->status_kurzbz === self::INTERESSENTSTATUS && !isset($lastStatus->bestaetigtam))
{
$statusdata = array(
'bestaetigtvon' => $this->_uid,
@@ -596,7 +599,6 @@ class InfoCenter extends Auth_Controller
/**
* Updates a new Notiz for a person
* @param int $notiz_id
* @param int $person_id
*/
public function updateNotiz($notiz_id)
{
@@ -1210,44 +1212,79 @@ class InfoCenter extends Auth_Controller
show_error($prestudenten->retval);
}
$interessentenCount = array();
foreach ($prestudenten->retval as $prestudent)
{
$prestudent = $this->PrestudentModel->getPrestudentWithZgv($prestudent->prestudent_id);
$prestudentWithZgv = $this->PrestudentModel->getPrestudentWithZgv($prestudent->prestudent_id);
if (isError($prestudent))
if (isError($prestudentWithZgv))
{
show_error($prestudent->retval);
show_error($prestudentWithZgv->retval);
}
$zgvpruefung = $prestudent->retval[0];
$zgvpruefung = $prestudentWithZgv->retval[0];
if (isset($zgvpruefung->prestudentstatus))
{
//get orgform for german and english
if (isset($zgvpruefung->prestudentstatus->bezeichnung_orgform) && is_array($zgvpruefung->prestudentstatus->bezeichnung_orgform))
{
$zgvpruefung->prestudentstatus->bezeichnung_orgform_german = getPhraseByLanguage($zgvpruefung->prestudentstatus->bezeichnung_orgform, 'German');
$zgvpruefung->prestudentstatus->bezeichnung_orgform_english = getPhraseByLanguage($zgvpruefung->prestudentstatus->bezeichnung_orgform, 'English');
}
$position = strpos($zgvpruefung->prestudentstatus->anmerkung, 'Alt:');
//parse Anmerkung for Alternative (Prio is given in orgform and sprache anyway)
$zgvpruefung->prestudentstatus->alternative = is_numeric($position) ? substr($zgvpruefung->prestudentstatus->anmerkung, $position) : null;
}
//if prestudent is not interessent or is already bestaetigt, then show only as information, non-editable
$zgvpruefung->infoonly = !isset($zgvpruefung->prestudentstatus) || isset($zgvpruefung->prestudentstatus->bestaetigtam) || $zgvpruefung->prestudentstatus->status_kurzbz != 'Interessent';
$zgvpruefung->infoonly = !isset($zgvpruefung->prestudentstatus)
|| isset($zgvpruefung->prestudentstatus->bestaetigtam)
|| $zgvpruefung->prestudentstatus->status_kurzbz != self::INTERESSENTSTATUS;
//numeric application priority
//wether prestudent was freigegeben for RT/Stg
$zgvpruefung->isRtFreigegeben = false;
$zgvpruefung->isStgFreigegeben = false;
$zgvpruefung->sendStgFreigabeMsg = true;//wether Stgudiengangfreigabemessage can be sent (for "exceptions", Studiengänge with no message sending)
$this->PrestudentstatusModel->addSelect('bestaetigtam, statusgrund_id, tbl_status_grund.bezeichnung_mehrsprachig AS bezeichnung_statusgrund');
$this->PrestudentstatusModel->addJoin('public.tbl_status_grund', 'statusgrund_id', 'LEFT');
$isFreigegeben = $this->PrestudentstatusModel->loadWhere(array('studiensemester_kurzbz' => $zgvpruefung->prestudentstatus->studiensemester_kurzbz,
'tbl_prestudentstatus.status_kurzbz' => self::INTERESSENTSTATUS, 'prestudent_id' => $prestudent->prestudent_id));
if (hasData($isFreigegeben))
{
foreach ($isFreigegeben->retval as $prestudentstatus)
{
if (isset($prestudentstatus->bestaetigtam))
{
//if statusgrund set - RTfreigabe, otherwise Stgfreigabe
if (isset($prestudentstatus->statusgrund_id))
{
if (isset($prestudentstatus->bezeichnung_statusgrund[0])
&& in_array($prestudentstatus->bezeichnung_statusgrund[0], $this->_statusgruendeNoStgFreigabeMessage))
$zgvpruefung->sendStgFreigabeMsg = false;
else
$zgvpruefung->isStgFreigegeben = true;
}
else
$zgvpruefung->isRtFreigegeben = true;
}
}
}
//application priority change possible?
$zgvpruefung->changeup = false;
$zgvpruefung->changedown = false;
if (isset($zgvpruefung->prestudentstatus->status_kurzbz) && $zgvpruefung->prestudentstatus->status_kurzbz == 'Interessent')
if (isset($zgvpruefung->prestudentstatus->status_kurzbz) && $zgvpruefung->prestudentstatus->status_kurzbz == self::INTERESSENTSTATUS)
{
if (isset($zgvpruefung->prestudentstatus->studiensemester_kurzbz))
{
$studiensemester = $zgvpruefung->prestudentstatus->studiensemester_kurzbz;
$zgvpruefung->changeup = $this->PrestudentModel->checkPrioChange($zgvpruefung->prestudent_id, $studiensemester, -1);
$zgvpruefung->changedown = $this->PrestudentModel->checkPrioChange($zgvpruefung->prestudent_id, $studiensemester, 1);
if (array_key_exists($studiensemester, $interessentenCount))
$interessentenCount[$studiensemester]++;
else
$interessentenCount[$studiensemester] = 1;
}
}
@@ -1256,8 +1293,8 @@ class InfoCenter extends Auth_Controller
$this->_sortPrestudents($zgvpruefungen);
$abwstatusgruende = $this->StatusgrundModel->loadWhere(array('status_kurzbz' => 'Abgewiesener'))->retval;
$intstatusgruende = $this->StatusgrundModel->loadWhere(array('status_kurzbz' => 'Interessent'))->retval;
$abwstatusgruende = $this->StatusgrundModel->loadWhere(array('status_kurzbz' => self::ABGEWIESENERSTATUS))->retval;
$intstatusgruende = $this->StatusgrundModel->loadWhere(array('status_kurzbz' => self::INTERESSENTSTATUS))->retval;
$data = array (
'zgvpruefungen' => $zgvpruefungen,
@@ -1315,9 +1352,9 @@ class InfoCenter extends Auth_Controller
return 1;
elseif ($a->prestudentstatus->status_kurzbz !== $b->prestudentstatus->status_kurzbz)
{
if ($a->prestudentstatus->status_kurzbz === 'Interessent')
if ($a->prestudentstatus->status_kurzbz === self::INTERESSENTSTATUS)
return -1;
elseif ($b->prestudentstatus->status_kurzbz === 'Interessent')
elseif ($b->prestudentstatus->status_kurzbz === self::INTERESSENTSTATUS)
return 1;
}
}
-3
View File
@@ -14,9 +14,6 @@ class Auth_Controller extends FHC_Controller
// Loads authentication library and starts authentication
$this->load->library('AuthLib');
// Loads authentication helper
$this->load->helper('hlp_authentication');
// Checks if the caller is allowed to access to this content
$this->_isAllowed($requiredPermissions);
}
@@ -2,20 +2,35 @@
if (!defined('BASEPATH')) exit('No direct script access allowed');
// ------------------------------------------------------------------------
// -----------------------------------------------------------------------------------------------------
// Functions needed to manage the user authentication
// ------------------------------------------------------------------------
// NOTE: the following functions do NOT prompt a login page if the user is NOT logged in
// -----------------------------------------------------------------------------------------------------
/**
* It calls the AuthLib, if the user is NOT logged then the login page is shown
* If the user is NOT logged then a null value is returned.
* If the user is alredy logged, then it is possible to access to the authentication object
* that contains the person_id of the logged user
* NOTE: if a user is logged then a person_id is always present!
*/
function getAuthPersonId()
{
$ci =& get_instance(); // get CI instance
return isLogged() ? ($ci->authlib->getAuthObj())->{AuthLib::AO_PERSON_ID} : null;
}
/**
* If the user is NOT logged then a null value is returned.
* If the user is alredy logged, then it is possible to access to the authentication object
* that contains the username of the logged user
*
* @return string or null
* NOTE: if the user is logged with a "foreign" method (ex. Bewerbungstool),
* then it is possible that the username is null!
*/
function getAuthUID()
{
$ci =& get_instance(); // get CI instance
return ($ci->authlib->getAuthObj())->{AuthLib::AO_USERNAME};
return isLogged() ? ($ci->authlib->getAuthObj())->{AuthLib::AO_USERNAME} : null;
}
+16
View File
@@ -224,3 +224,19 @@ function isDateWorkingDay($date, $days = null)
return true;
}
}
/**
* Checks if the current user is logged by checking that the AuthLib is loaded and
* it is present the authentication object in session
* NOTE: it is placed here instead of being placed in the helper hlp_authentication_helper
* because hlp_authentication_helper is loaded after the authentication.
* It is very useful to use this function even in those parts of the code that are accessible
* even when a user is NOT authenticated!!!
* If and only if this function returns true, then all the functions present in hlp_authentication_helper can be used!
*/
function isLogged()
{
$ci =& get_instance(); // get CI instance
return isset($ci->authlib) && $ci->authlib->getAuthObj() != null;
}
+8 -2
View File
@@ -30,7 +30,6 @@ class AuthLib
/**
* Construct
*
*
* @param bool $authenticate If the authentication must be performed.
*/
public function __construct($authenticate = true)
@@ -483,6 +482,8 @@ class AuthLib
/**
* Stores the authentication object into the authentication session
* Everything was fine, the user at this point is authenticated, it is possible to store the authentication object
* in the user session
*/
private function _storeSessionAuthObj($authObj)
{
@@ -552,7 +553,12 @@ class AuthLib
$this->_showError(getData($auth)); // display a generic error message and logs the occurred error
}
}
// else the user is already logged, then continue with the execution
// else the user is already logged, then loads authentication helper and continue with the execution
// NOTE: it is needed only here because:
// - it is called when a user is already logged in
// - it is called after login the user
// - it is NOT called in case of fatal error or wrong authentication
$this->_ci->load->helper('hlp_authentication');
}
/**
+65 -82
View File
@@ -108,9 +108,6 @@ class FiltersLib
{
$this->_ci =& get_instance(); // get code igniter instance
// Loads authentication helper
$this->_ci->load->helper('hlp_authentication'); // NOTE: needed to load custom filters do not remove!
$this->_filterUniqueId = $this->_getFilterUniqueId($params); // sets the id for the related filter widget
}
@@ -185,11 +182,8 @@ class FiltersLib
{
// Loads the needed models
$this->_ci->load->model('system/Filters_model', 'FiltersModel');
$this->_ci->load->model('person/Benutzer_model', 'BenutzerModel'); // to get the default custom filter
$this->_ci->FiltersModel->resetQuery(); // reset any previous built query
$this->_ci->FiltersModel->addJoin('public.tbl_benutzer', 'person_id', 'LEFT'); // left join with benutzer table
$this->_ci->FiltersModel->addSelect('system.tbl_filters.*'); // select only from table filters
$this->_ci->FiltersModel->addOrder('sort', 'ASC'); // sort on column sort
$this->_ci->FiltersModel->addLimit(1); // if more than one filter is set as default only one will be retrieved
@@ -223,7 +217,7 @@ class FiltersLib
$whereParameters = array(
'app' => $app,
'dataset_name' => $datasetName,
'uid' => getAuthUID(),
'person_id' => getAuthPersonId(),
'default_filter' => true
);
@@ -260,10 +254,10 @@ class FiltersLib
$jsonEncodedFilter = null;
// If the definition contains data and they are valid
if (hasData($definition) && isset($definition->retval[0]->filter) && trim($definition->retval[0]->filter) != '')
if (hasData($definition) && isset(getData($definition)[0]->filter) && trim(getData($definition)[0]->filter) != '')
{
// Get the json definition of the filter
$tmpJsonEncodedFilter = json_decode($definition->retval[0]->filter);
$tmpJsonEncodedFilter = json_decode(getData($definition)[0]->filter);
// Checks required filter's properies
if (isset($tmpJsonEncodedFilter->name)
@@ -585,87 +579,76 @@ class FiltersLib
$saveCustomFilter = false; // by default returns a failure
// Checks parameter customFilterDescription if not valid stop the execution
if (isEmptyString($customFilterDescription))
{
return $saveCustomFilter;
}
if (isEmptyString($customFilterDescription)) return $saveCustomFilter;
$this->_ci->load->model('system/Filters_model', 'FiltersModel'); // to load the filter definitions
$this->_ci->load->model('person/Benutzer_model', 'BenutzerModel'); // to get the person_id of the authenticated user
$this->_ci->FiltersModel->resetQuery(); // reset any previous built query
$this->_ci->BenutzerModel->resetQuery(); // reset any previous built query
// Loads data for the authenticated user
$authBenutzer = $this->_ci->BenutzerModel->loadWhere(array('uid' => getAuthUID()));
if (hasData($authBenutzer)) // if data are found
// person_id of the authenticated user
$authPersonId = getAuthPersonId();
// Postgres array for the description
$descPGArray = str_replace('%desc%', $customFilterDescription, '{"%desc%", "%desc%", "%desc%", "%desc%"}');
// Loads the definition to check if is already present in the DB
$definition = $this->_ci->FiltersModel->loadWhere(array(
'app' => $this->getSessionElement(self::APP_PARAMETER),
'dataset_name' => $this->getSessionElement(self::DATASET_NAME_PARAMETER),
'description' => $descPGArray,
'person_id' => $authPersonId
));
// New definition to be json encoded
$jsonDeifinition = new stdClass();
$jsonDeifinition->name = $customFilterDescription; // name of the filter
// Generates the "column" property
$jsonDeifinition->columns = array();
$selectedFields = $this->getSessionElement(self::SESSION_SELECTED_FIELDS); // retrieved the selected fields
for ($i = 0; $i < count($selectedFields); $i++)
{
// person_id of the authenticated user
$authPersonId = $authBenutzer->retval[0]->person_id;
// Postgres array for the description
$descPGArray = str_replace('%desc%', $customFilterDescription, '{"%desc%", "%desc%", "%desc%", "%desc%"}');
// Each element is an object with a property called "name"
$jsonDeifinition->columns[$i] = new stdClass();
$jsonDeifinition->columns[$i]->name = $selectedFields[$i];
}
// Loads the definition to check if is already present in the DB
$definition = $this->_ci->FiltersModel->loadWhere(array(
'app' => $this->getSessionElement(self::APP_PARAMETER),
'dataset_name' => $this->getSessionElement(self::DATASET_NAME_PARAMETER),
'description' => $descPGArray,
'person_id' => $authPersonId
));
// List of applied filters
$jsonDeifinition->filters = $this->getSessionElement(self::SESSION_FILTERS);
// New definition to be json encoded
$jsonDeifinition = new stdClass();
$jsonDeifinition->name = $customFilterDescription; // name of the filter
// If it is already present
if (hasData($definition))
{
// update it
$this->_ci->FiltersModel->update(
array(
'app' => $this->getSessionElement(self::APP_PARAMETER),
'dataset_name' => $this->getSessionElement(self::DATASET_NAME_PARAMETER),
'description' => $descPGArray,
'person_id' => $authPersonId
),
array(
'filter' => json_encode($jsonDeifinition)
)
);
// Generates the "column" property
$jsonDeifinition->columns = array();
$selectedFields = $this->getSessionElement(self::SESSION_SELECTED_FIELDS); // retrieved the selected fields
for ($i = 0; $i < count($selectedFields); $i++)
{
// Each element is an object with a property called "name"
$jsonDeifinition->columns[$i] = new stdClass();
$jsonDeifinition->columns[$i]->name = $selectedFields[$i];
}
$saveCustomFilter = true;
}
else // otherwise insert a new one
{
$this->_ci->FiltersModel->insert(
array(
'app' => $this->getSessionElement(self::APP_PARAMETER),
'dataset_name' => $this->getSessionElement(self::DATASET_NAME_PARAMETER),
'filter_kurzbz' => uniqid($authPersonId, true),
'description' => $descPGArray,
'person_id' => $authPersonId,
'sort' => null,
'default_filter' => false,
'filter' => json_encode($jsonDeifinition),
'oe_kurzbz' => null
)
);
// List of applied filters
$jsonDeifinition->filters = $this->getSessionElement(self::SESSION_FILTERS);
// If it is already present
if (hasData($definition))
{
// update it
$this->_ci->FiltersModel->update(
array(
'app' => $this->getSessionElement(self::APP_PARAMETER),
'dataset_name' => $this->getSessionElement(self::DATASET_NAME_PARAMETER),
'description' => $descPGArray,
'person_id' => $authPersonId
),
array(
'filter' => json_encode($jsonDeifinition)
)
);
$saveCustomFilter = true;
}
else // otherwise insert a new one
{
$this->_ci->FiltersModel->insert(
array(
'app' => $this->getSessionElement(self::APP_PARAMETER),
'dataset_name' => $this->getSessionElement(self::DATASET_NAME_PARAMETER),
'filter_kurzbz' => uniqid($authPersonId, true),
'description' => $descPGArray,
'person_id' => $authPersonId,
'sort' => null,
'default_filter' => false,
'filter' => json_encode($jsonDeifinition),
'oe_kurzbz' => null
)
);
$saveCustomFilter = true;
}
$saveCustomFilter = true;
}
return $saveCustomFilter;
@@ -721,7 +704,7 @@ class FiltersLib
$childrenPersonalArray = array(); // contains all the children elements in menu enty for personal filters
// Loops through loaded filters
foreach ($filters->retval as $filter)
foreach (getData($filters) as $filter)
{
// Generate a menu entry
$menuEntry = $this->_ci->navigationlib->oneLevel(
+6 -2
View File
@@ -37,7 +37,9 @@ class StudienplanLib
'pflicht' => $row->pflicht,
'zeugnis' => $row->zeugnis,
'bezeichnung' => $row->bezeichnung,
'ects' => $row->ects
'kurzbz' => $row->kurzbz,
'ects' => $row->ects,
'semester' => $row->semester
);
$childs = $this->getChildElements($row->studienplan_lehrveranstaltung_id);
if(is_array($childs) && count($childs) > 0)
@@ -65,7 +67,9 @@ class StudienplanLib
'pflicht' => $row->pflicht,
'zeugnis' => $row->zeugnis,
'bezeichnung' => $row->bezeichnung,
'ects' => $row->ects
'kurzbz' => $row->kurzbz,
'ects' => $row->ects,
'semester' => $row->semester
);
$childs = $this->getChildElements($row->studienplan_lehrveranstaltung_id);
if(is_array($childs))
+1 -1
View File
@@ -218,7 +218,7 @@ class Prestudent_model extends DB_Model
if (count($lastStatus->retval) > 0)
{
// get Studiengangname from Studienlan and -ordnung
//get Studiengangname from Studienplan and -ordnung
$studienordnung = $this->PrestudentstatusModel->getStudienordnungFromPrestudent($prestudent_id);
if ($studienordnung->error)
return error($studienordnung->retval);
@@ -19,14 +19,17 @@ class Prestudentstatus_model extends DB_Model
public function getLastStatus($prestudent_id, $studiensemester_kurzbz = '', $status_kurzbz = '')
{
$query = 'SELECT tbl_prestudentstatus.*,
bezeichnung AS studienplan_bezeichnung,
tbl_studienplan.orgform_kurzbz as orgform,
tbl_studienplan.bezeichnung AS studienplan_bezeichnung,
tbl_studienplan.orgform_kurzbz AS orgform,
sprache,
tbl_orgform.bezeichnung_mehrsprachig AS bezeichnung_orgform,
tbl_status.bezeichnung_mehrsprachig,
tbl_status_grund.bezeichnung_mehrsprachig as bezeichnung_statusgrund
FROM public.tbl_prestudentstatus LEFT JOIN lehre.tbl_studienplan USING (studienplan_id)
tbl_status_grund.bezeichnung_mehrsprachig AS bezeichnung_statusgrund
FROM public.tbl_prestudentstatus
LEFT JOIN lehre.tbl_studienplan USING (studienplan_id)
JOIN public.tbl_status USING (status_kurzbz)
LEFT JOIN public.tbl_status_grund USING (statusgrund_id)
LEFT JOIN bis.tbl_orgform ON tbl_studienplan.orgform_kurzbz = bis.tbl_orgform.orgform_kurzbz
WHERE tbl_status.status_kurzbz = tbl_prestudentstatus.status_kurzbz
AND prestudent_id = ?';
@@ -349,6 +349,7 @@ class Reihungstest_model extends DB_Model
ps.prestudent_id,
rt.datum,
rt.uhrzeit,
rt.reihungstest_id,
tbl_studienplan.orgform_kurzbz,
tbl_prestudentstatus.studienplan_id,
tbl_prestudentstatus.ausbildungssemester,
@@ -28,6 +28,7 @@ class Lehreinheit_model extends DB_Model
{
$lehreinheiten = array();
$this->addOrder('lehreinheit_id');
$les = $this->loadWhere(
array('lehrveranstaltung_id' => $lehrveranstaltung_id,
'studiensemester_kurzbz' => $studiensemester)
@@ -62,17 +63,17 @@ class Lehreinheit_model extends DB_Model
if (hasData($studiengangresponse))
{
$studiengang = $studiengangresponse->retval[0];
$stgkuerzel = mb_strtoupper($studiengang->typ . $studiengang->kurzbz);
$stgkuerzel = mb_strtoupper($studiengang->typ.$studiengang->kurzbz);
$letoadd->lehreinheitgruppen[] = array(
'semester' => $lehreinheitgruppe->semester,
'verband' => $lehreinheitgruppe->verband,
'gruppe' => $lehreinheitgruppe->gruppe,
'gruppe_kurzbz' => $lehreinheitgruppe->gruppe_kurzbz,
'direktinskription' => $lehreinheitgruppe->direktinskription,
'studiengang_kz' => $lehreinheitgruppe->studiengang_kz,
'studiengang_kuerzel' => $stgkuerzel
);
$letoadd->lehreinheitgruppen[] = array(
'semester' => $lehreinheitgruppe->semester,
'verband' => $lehreinheitgruppe->verband,
'gruppe' => $lehreinheitgruppe->gruppe,
'gruppe_kurzbz' => $lehreinheitgruppe->gruppe_kurzbz,
'direktinskription' => $lehreinheitgruppe->direktinskription,
'studiengang_kz' => $lehreinheitgruppe->studiengang_kz,
'studiengang_kuerzel' => $stgkuerzel
);
}
}
}
@@ -140,6 +140,10 @@
{
$datasetRaw->{'anmeldefrist'} = '-';
}
else
{
$datasetRaw->{'anmeldefrist'} = date_format(date_create($datasetRaw->{'anmeldefrist'}), 'd.m.Y');
}
if ($datasetRaw->{'max_plaetze'} == null)
{
$datasetRaw->{'max_plaetze'} = '-';
+17 -3
View File
@@ -3,16 +3,27 @@ if(isset($course['note']) && isset($grades[$course['note']]))
$gradeclass = ($grades[$course['note']]['positiv']?'gradelist_row_grade_positiv':'gradelist_row_grade_negativ');
else
$gradeclass = '';
// Only Display the Course if the person is assigned to the course
// (no additional elective courses are displayed)
if(isset($course['zugeordnet']) && $course['zugeordnet'] === true)
{
?>
<tr class="gradelist_row_<?php echo $course['lehrtyp_kurzbz']; ?> gradelist_row_depth_<?php echo $depth; ?>">
<td><?php echo $course['bezeichnung']; ?></td>
<td><?php echo $course['kurzbz']; ?></td>
<td align="center">
<?php
echo $course['semester'].'. Sem ';
if(isset($course['studiengang_kurzbz']))
echo '( '.$course['studiengang_kurzbz'].' )';
?></td>
<td><?php echo (isset($course['lehrform_kurzbz'])?$course['lehrform_kurzbz']:''); ?></td>
<td align="right"><?php echo (isset($course['ects'])?$course['ects']:''); ?></td>
<!--
<td align="right"><?php echo (isset($course['sws'])?$course['sws']:''); ?></td>
<td align="right"><?php echo (isset($course['lehrform_kurzbz'])?$course['lehrform_kurzbz']:''); ?></td>
<td align="right"><?php echo (isset($course['pflicht'])?($course['pflicht']?'Ja':'Nein'):''); ?></td>
<td align="right"><?php echo (isset($course['zeugnis'])?($course['zeugnis']?'Ja':'Nein'):''); ?></td>
-->
<td class="<?php echo $gradeclass; ?>">
<?php
if (isset($course['note']) && isset($grades[$course['note']]['anmerkung']))
@@ -20,3 +31,6 @@ else
?>
</td>
</tr>
<?php
}
?>
@@ -31,11 +31,14 @@
</div>
</div>
<div>
<b><?php echo $this->p->t('lehre', 'notendurchschnitt'); ?>:</b>
<b><?php echo $this->p->t('lehre', 'notendurchschnitt'); ?>
<img src="../../../../skin/images/information.png" title="<?php echo htmlentities($this->p->t('lehre', 'info_notendurchschnitt')); ?>" />:</b>
<?php echo $courses['overall']['notendurchschnitt'] ?><br>
<b><?php echo $this->p->t('lehre', 'gewichteternotendurchschnitt'); ?>:</b>
<b><?php echo $this->p->t('lehre', 'gewichteternotendurchschnitt'); ?>
<img src="../../../../skin/images/information.png" title="<?php echo htmlentities($this->p->t('lehre', 'info_notendurchschnitt_gewichtet')); ?>" />:</b>
<?php echo $courses['overall']['notendurchschnittgewichtet'] ?><br>
<b><?php echo $this->p->t('lehre', 'ects'); ?>:</b>
<b><?php echo $this->p->t('lehre', 'ects'); ?>
<img src="../../../../skin/images/information.png" title="Summe der positiv absolvierten ECTS" />:</b>
<?php echo $courses['overall']['ectssumme_positiv'] ?><br>
<br>
<?php
+37 -12
View File
@@ -38,13 +38,13 @@
<thead>
<tr>
<th><?php echo $this->p->t('lehre','lehrveranstaltung');?></th>
<th><?php echo $this->p->t('lehre','kurzbz');?></th>
<th><?php echo $this->p->t('lehre','semester');?></th>
<th><?php echo $this->p->t('lehre','lehrform');?></th>
<th style="text-align: right"><?php echo $this->p->t('lehre','ects');?></th>
<!--
<th>SWS</th>
<th>Lehrform</th>
<th>Pflichtfach</th>
<th>Zeugnis</th>
-->
<th style="text-align: right"><?php echo $this->p->t('lehre','sws');?></th>
<th><?php echo $this->p->t('lehre','pflichtfach');?></th>
<th><?php echo $this->p->t('lehre','zeugnis');?></th>
<th><?php echo $this->p->t('lehre','note');?></th>
</tr>
</thead>
@@ -58,6 +58,9 @@
</tbody>
<tfoot>
<tr>
<th></th>
<th></th>
<th></th>
<th></th>
<th style="text-align: right">
<?php
@@ -71,6 +74,20 @@
}
?>
</th>
<th style="text-align: right">
<?php
echo (isset($semesterdata['swssumme_positiv'])?$semesterdata['swssumme_positiv']:'');
if (isset($semesterdata['swssumme'])
&& isset($semesterdata['swssumme_positiv'])
&& $semesterdata['swssumme'] != $semesterdata['swssumme_positiv'])
{
echo ' ('.$semesterdata['swssumme'].')';
}
?>
</th>
<th></th>
<th></th>
<th></th>
</tr>
</tfoot>
@@ -84,13 +101,13 @@
<thead>
<tr>
<th><?php echo $this->p->t('lehre','lehrveranstaltung');?></th>
<th><?php echo $this->p->t('lehre','kurzbz');?></th>
<th><?php echo $this->p->t('lehre','semester');?></th>
<th><?php echo $this->p->t('lehre','lehrform');?></th>
<th><?php echo $this->p->t('lehre','ects');?></th>
<!--
<th>SWS</th>
<th>Lehrform</th>
<th>Pflichtfach</th>
<th>Zeugnis</th>
-->
<th><?php echo $this->p->t('lehre','sws');?></th>
<th><?php echo $this->p->t('lehre','pflichtfach');?></th>
<th><?php echo $this->p->t('lehre','zeugnis');?></th>
<th><?php echo $this->p->t('lehre','note');?></th>
</tr>
</thead>
@@ -107,8 +124,14 @@
</tbody>
<tfoot>
<tr>
<th></th>
<th></th>
<th></th>
<th></th>
<th style="text-align: right"><?php echo (isset($semesterdata['ectssumme_nonstpl'])?number_format($semesterdata['ectssumme_nonstpl'],2):''); ?></th>
<th style="text-align: right"><?php echo (isset($semesterdata['swssumme_nonstpl'])?number_format($semesterdata['swssumme_nonstpl'],2):''); ?></th>
<th></th>
<th></th>
<th></th>
</tr>
</tfoot>
@@ -120,8 +143,10 @@
<div class="panel-footer">
<b><?php echo $this->p->t('lehre','notendurchschnitt');?>:</b>
<?php echo (isset($semesterdata['notendurchschnitt'])?$semesterdata['notendurchschnitt']:'');?>
<img src="../../../../skin/images/information.png" title="<?php echo htmlentities($this->p->t('lehre', 'info_notendurchschnitt')); ?>" />
<b><?php echo $this->p->t('lehre','gewichteternotendurchschnitt');?>:</b>
<?php echo (isset($semesterdata['notendurchschnittgewichtet'])?$semesterdata['notendurchschnittgewichtet']:'');?>
<img src="../../../../skin/images/information.png" title="<?php echo htmlentities($this->p->t('lehre', 'info_notendurchschnitt_gewichtet')); ?>" />
</div>
</div>
</div>
@@ -10,6 +10,7 @@
$LOGTYPE_KURZBZ = '\'Processstate\'';
$STATUS_KURZBZ = '\'Wartender\', \'Bewerber\', \'Aufgenommener\', \'Student\'';
$ADDITIONAL_STG = '10021,10027';
$AKTE_TYP = '\'identity\', \'zgv_bakk\'';
$query = '
WITH currentOrNextStudiensemester AS (
@@ -48,6 +49,14 @@
ORDER BY l.zeitpunkt DESC
LIMIT 1
) AS "LastActionType",
(
SELECT count(akte_id)
FROM public.tbl_akte a
WHERE
a.person_id = p.person_id
AND
a.dokument_kurzbz in ('.$AKTE_TYP.')
) AS "AnzahlAkte",
(
SELECT l.insertvon
FROM system.tbl_log l
@@ -134,7 +143,7 @@
JOIN lehre.tbl_studienplan sp USING(studienplan_id)
WHERE pss.status_kurzbz = '.$INTERESSENT_STATUS.'
AND pss.bewerbung_abgeschicktamum IS NOT NULL
AND pss.bestaetigtam IS NULL
-- AND pss.bestaetigtam IS NULL
AND ps.person_id = p.person_id
AND (sg.typ IN ('.$STUDIENGANG_TYP.')
OR
@@ -272,6 +281,7 @@
ucfirst($this->p->t('global', 'parkdatum')),
ucfirst($this->p->t('global', 'letzteAktion')),
'Aktionstyp',
'AnzahlAktePflicht',
ucfirst($this->p->t('global', 'letzterBearbeiter')),
ucfirst($this->p->t('lehre', 'studiensemester')),
ucfirst($this->p->t('global', 'gesendetAm')),
@@ -6,7 +6,8 @@
$TAETIGKEIT_KURZBZ = '\'bewerbung\', \'kommunikation\'';
$LOGDATA_NAME = '\'Login with code\', \'Login with user\', \'New application\'';
$REJECTED_STATUS = '\'Abgewiesener\'';
$ADDITIONAL_STG = '10021,10027';
$ADDITIONAL_STG = '10021,10027,10002';
$STATUS_KURZBZ = '\'Wartender\', \'Bewerber\', \'Aufgenommener\', \'Student\'';
$query = '
SELECT
@@ -114,6 +115,29 @@
AND pss.studiensemester_kurzbz IN (SELECT ss.studiensemester_kurzbz FROM public.tbl_studiensemester ss WHERE ss.ende >= NOW())
LIMIT 1
) AS "StgAbgeschickt",
(
SELECT ARRAY_TO_STRING(ARRAY_AGG(DISTINCT UPPER(sg.typ || sg.kurzbz) || \':\' || sp.orgform_kurzbz), \', \')
FROM public.tbl_prestudentstatus pss
JOIN public.tbl_prestudent ps USING(prestudent_id)
JOIN public.tbl_studiengang sg USING(studiengang_kz)
JOIN lehre.tbl_studienplan sp USING(studienplan_id)
WHERE pss.status_kurzbz IN ('.$STATUS_KURZBZ.')
AND ps.person_id = p.person_id
AND (sg.typ IN ('.$STUDIENGANG_TYP.')
OR
sg.studiengang_kz in('.$ADDITIONAL_STG.')
)
AND pss.studiensemester_kurzbz IN (SELECT ss.studiensemester_kurzbz FROM public.tbl_studiensemester ss WHERE ss.ende >= NOW())
AND NOT EXISTS (
SELECT 1
FROM tbl_prestudentstatus spss
WHERE spss.prestudent_id = pss.prestudent_id
AND spss.status_kurzbz = '.$REJECTED_STATUS.'
AND spss.studiensemester_kurzbz IN (SELECT ss.studiensemester_kurzbz FROM public.tbl_studiensemester ss WHERE ss.ende > NOW())
)
LIMIT 1
) AS "StgAktiv",
(
SELECT ARRAY_TO_STRING(ARRAY_AGG(DISTINCT UPPER(sg.bezeichnung_mehrsprachig[1])), \', \')
FROM public.tbl_prestudentstatus pss
@@ -155,7 +179,7 @@
) rtp ON(rtp.person_id = ps.person_id AND rtp.studiensemester_kurzbz = pss.studiensemester_kurzbz)
WHERE pss.status_kurzbz = '.$INTERESSENT_STATUS.'
AND ps.person_id = p.person_id
AND pss.studiensemester_kurzbz IN (SELECT ss.studiensemester_kurzbz FROM public.tbl_studiensemester ss WHERE ss.ende >= NOW())
AND pss.studiensemester_kurzbz IN (SELECT ss.studiensemester_kurzbz FROM public.tbl_studiensemester ss WHERE ss.studiensemester_kurzbz = \'WS2019\')
ORDER BY pss.datum DESC, pss.insertamum DESC, pss.ext_id DESC
LIMIT 1
) AS "ReihungstestApplied",
@@ -227,6 +251,7 @@
'GesendetAm',
'NumAbgeschickt',
'Studiengänge',
'Stg aktiv',
'Statusgrund',
'Reihungstest angetreten',
'Reihungstest angemeldet',
@@ -287,6 +312,11 @@
$datasetRaw->{'Nation'} = '-';
}
if ($datasetRaw->{'StgAktiv'} == null)
{
$datasetRaw->{'StgAktiv'} = '-';
}
if ($datasetRaw->{'ReihungstestAngetreten'} == 'true')
{
$datasetRaw->{'ReihungstestAngetreten'} = 'Ja';