mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-01 20:29:29 +00:00
25e66bf9dd
- Added function isEmptyArray to fhc_helper - Adapted the code in application/* to use as much as possible this two new functions - Removed the php function empty almost everywhere
44 lines
1.3 KiB
PHP
44 lines
1.3 KiB
PHP
<?php
|
|
|
|
class Reihungstest_widget extends DropdownWidget
|
|
{
|
|
public function display($widgetData)
|
|
{
|
|
$this->load->model('crm/Reihungstest_model', 'ReihungstestModel');
|
|
$this->ReihungstestModel->addOrder('datum', 'DESC');
|
|
|
|
$this->addSelectToModel($this->ReihungstestModel, 'reihungstest_id', 'CONCAT(datum, \' \', uhrzeit, \' \', anmerkung)');
|
|
|
|
$parametersArray = array();
|
|
// If the parameters studiengang or studiensemester are given and are not empty
|
|
if (isset($widgetData) && is_array($widgetData)
|
|
&& ((isset($widgetData['studiengang']) && !isEmptyString($widgetData['studiengang']))
|
|
|| (isset($widgetData['studiensemester']) && !isEmptyString($widgetData['studiensemester']))))
|
|
{
|
|
if ($widgetData['studiengang'] != null)
|
|
{
|
|
$parametersArray['studiengang_kz'] = $widgetData['studiengang'];
|
|
}
|
|
if ($widgetData['studiensemester'] != null)
|
|
{
|
|
$parametersArray['studiensemester_kurzbz'] = $widgetData['studiensemester'];
|
|
}
|
|
}
|
|
else
|
|
{
|
|
// To NOT select anything
|
|
// Set 0 = 1 in the where clause of the query
|
|
$parametersArray['0'] = '1';
|
|
}
|
|
|
|
$this->setElementsArray(
|
|
$this->ReihungstestModel->loadWhere($parametersArray),
|
|
true,
|
|
'Select a reihungstest...',
|
|
'No reihungstest found'
|
|
);
|
|
|
|
$this->loadDropDownView($widgetData);
|
|
}
|
|
}
|