mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-07-26 09:04:28 +00:00
- Added session_start() to hlp_session_helper to start a PHP standard session (NOT CI session)
- Added functions cleanSession and cleanSessionElement to hlp_session_helper - Renamed setElementSession to setSessionElement in hlp_session_helper - Renamed getElementSession to getSessionElement in hlp_session_helper - Adapted the code that were using this helper - Autoload does NOT load anymore helper hlp_session_helper - Controller controllers/system/Filters now loads the AuthLib - Removed var_dump from controllers/jobs/ReihungstestJob
This commit is contained in:
@@ -18,7 +18,7 @@ if (! defined('BASEPATH'))
|
||||
class ReihungstestJob extends FHC_Controller
|
||||
{
|
||||
private $VILESCI_RT_VERWALTUNGS_URL;
|
||||
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
*/
|
||||
@@ -37,9 +37,9 @@ class ReihungstestJob extends FHC_Controller
|
||||
echo "Jobs must be run from the CLI";
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
$this->VILESCI_RT_VERWALTUNGS_URL = site_url(). "/organisation/Reihungstest";
|
||||
|
||||
|
||||
// Load models
|
||||
$this->load->model('crm/Reihungstest_model', 'ReihungstestModel');
|
||||
$this->load->model('organisation/Studiengang_model', 'StudiengangModel');
|
||||
@@ -60,7 +60,7 @@ class ReihungstestJob extends FHC_Controller
|
||||
|
||||
echo $result. PHP_EOL;
|
||||
}
|
||||
|
||||
|
||||
public function runReihungstestJob()
|
||||
{
|
||||
// Get study plans that have no assigned placement tests yet
|
||||
@@ -75,10 +75,10 @@ class ReihungstestJob extends FHC_Controller
|
||||
{
|
||||
show_error($result->error);
|
||||
}
|
||||
|
||||
|
||||
// Get free places
|
||||
$result = $this->ReihungstestModel->getFreePlaces();
|
||||
|
||||
|
||||
$free_places_arr = array();
|
||||
if (hasData($result))
|
||||
{
|
||||
@@ -88,10 +88,10 @@ class ReihungstestJob extends FHC_Controller
|
||||
{
|
||||
show_error($result->error);
|
||||
}
|
||||
|
||||
|
||||
// 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))
|
||||
{
|
||||
@@ -102,12 +102,12 @@ class ReihungstestJob extends FHC_Controller
|
||||
'Support für die Reihungstest-Verwaltung');
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
public function runZentraleReihungstestAnmeldefristAssistenzJob()
|
||||
{
|
||||
// Get placement tests where registration date was yesterday
|
||||
$result = $this->ReihungstestModel->checkReachedRegistrationDate(11000);
|
||||
|
||||
|
||||
$reachedRegistration_rt_arr = array();
|
||||
|
||||
if (hasData($result))
|
||||
@@ -162,7 +162,7 @@ class ReihungstestJob extends FHC_Controller
|
||||
{
|
||||
$mailReceipients .= $applicant->email. ';';
|
||||
$applicantCounter ++;
|
||||
$applicants_list .= '
|
||||
$applicants_list .= '
|
||||
<tr '.$rowstyle.'>
|
||||
<td>'. $applicant->orgform_kurzbz. '</td>
|
||||
<td>'. $applicant->ausbildungssemester. '</td>
|
||||
@@ -204,13 +204,13 @@ class ReihungstestJob extends FHC_Controller
|
||||
$mailcontent .= $applicants_list;
|
||||
$mailcontent .= '
|
||||
</tbody>
|
||||
</table>
|
||||
</table>
|
||||
';
|
||||
$mailcontent .= '<p style="font-family: verdana, sans-serif;"><a href="mailto:?bcc=' . $mailReceipients . '">Mail an alle schicken</a></p>';
|
||||
}
|
||||
$mailcontent_data_arr['table'] = $mailcontent;
|
||||
//$mailcontent_data_arr['link'] = $this->VILESCI_RT_VERWALTUNGS_URL;
|
||||
//var_dump($mailcontent_data_arr);
|
||||
|
||||
// Send email in Sancho design
|
||||
if (!isEmptyString($mailcontent))
|
||||
{
|
||||
@@ -296,7 +296,7 @@ class ReihungstestJob extends FHC_Controller
|
||||
|
||||
$studiengang = $applicant->studiengang_kz;
|
||||
$mailReceipients .= $applicant->email . ';';
|
||||
$applicants_list .= '
|
||||
$applicants_list .= '
|
||||
<tr ' . $rowstyle . '>
|
||||
<td>' . date_format(date_create($applicant->datum), 'd.m.Y') . '</td>
|
||||
<td>' . $applicant->uhrzeit . '</td>
|
||||
@@ -400,20 +400,20 @@ class ReihungstestJob extends FHC_Controller
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ------------------------------------------------------------------------
|
||||
// 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
|
||||
* @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))
|
||||
{
|
||||
@@ -421,27 +421,27 @@ class ReihungstestJob extends FHC_Controller
|
||||
= '
|
||||
<table'. $style_tbl2.'>
|
||||
';
|
||||
|
||||
|
||||
foreach ($missing_rt_arr as $rt)
|
||||
{
|
||||
$studienplan_list .= '
|
||||
$studienplan_list .= '
|
||||
<tr><td>'. $rt->bezeichnung. '</td></tr>
|
||||
';
|
||||
}
|
||||
|
||||
$studienplan_list .= '
|
||||
|
||||
$studienplan_list .= '
|
||||
</table>
|
||||
';
|
||||
}
|
||||
else
|
||||
{
|
||||
$studienplan_list = '
|
||||
<table'. $style_tbl1.'>
|
||||
<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))
|
||||
{
|
||||
@@ -453,21 +453,21 @@ class ReihungstestJob extends FHC_Controller
|
||||
<th>Freie Plätze</th>
|
||||
</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
|
||||
|
||||
|
||||
$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>
|
||||
</tr>
|
||||
';
|
||||
';
|
||||
}
|
||||
|
||||
|
||||
$freie_plaetze_list .= '
|
||||
</table>
|
||||
';
|
||||
@@ -475,12 +475,12 @@ class ReihungstestJob extends FHC_Controller
|
||||
else
|
||||
{
|
||||
$freie_plaetze_list = '
|
||||
<table'. $style_tbl1.'>
|
||||
<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;
|
||||
@@ -490,4 +490,3 @@ class ReihungstestJob extends FHC_Controller
|
||||
return $content_data_arr;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -21,6 +21,9 @@ class Filters extends FHC_Controller
|
||||
{
|
||||
parent::__construct();
|
||||
|
||||
// Loads authentication library and starts authentication
|
||||
$this->load->library('AuthLib');
|
||||
|
||||
// Loads the FiltersLib with HTTP GET/POST parameters
|
||||
$this->_loadFiltersLib();
|
||||
|
||||
@@ -45,7 +48,7 @@ class Filters extends FHC_Controller
|
||||
public function rowNumber()
|
||||
{
|
||||
$rowNumber = 0;
|
||||
$dataset = $this->filterslib->getElementSession(FiltersLib::SESSION_DATASET);
|
||||
$dataset = $this->filterslib->getSessionElement(FiltersLib::SESSION_DATASET);
|
||||
|
||||
if (isset($dataset) && is_array($dataset))
|
||||
{
|
||||
|
||||
@@ -991,7 +991,7 @@ class InfoCenter extends Auth_Controller
|
||||
$homeLink .= '?'.self::FILTER_ID.'='.$prevFilterId;
|
||||
}
|
||||
|
||||
$this->navigationlib->setElementSessionMenu(
|
||||
$this->navigationlib->setSessionElementMenu(
|
||||
'uebersicht',
|
||||
$this->navigationlib->oneLevel(
|
||||
'Infocenter Übersicht', // description
|
||||
@@ -1009,7 +1009,7 @@ class InfoCenter extends Auth_Controller
|
||||
|
||||
if($page == self::REIHUNGSTESTABSOLVIERT_PAGE)
|
||||
{
|
||||
$this->navigationlib->setElementSessionMenu(
|
||||
$this->navigationlib->setSessionElementMenu(
|
||||
'freigegeben',
|
||||
$this->navigationlib->oneLevel(
|
||||
'zum RT freigegeben', // description
|
||||
@@ -1027,7 +1027,7 @@ class InfoCenter extends Auth_Controller
|
||||
}
|
||||
if($page == self::FREIGEGEBEN_PAGE)
|
||||
{
|
||||
$this->navigationlib->setElementSessionMenu(
|
||||
$this->navigationlib->setSessionElementMenu(
|
||||
'reihungstestAbsolviert',
|
||||
$this->navigationlib->oneLevel(
|
||||
'Reihungstest absolviert', // description
|
||||
|
||||
Reference in New Issue
Block a user