mirror of
https://github.com/FH-Complete/FHC-Core.git
synced 2026-06-27 00:49:28 +00:00
1f65f7737c
- Aufnahmegruppe_widget - Reihungstest_widget - Studiengang_widget - Studiensemester_widget - Stufe_widget - Renamed /system/Users controller to system/aufnahme/PrestudentMultiAssign - Added method getPrestudentMultiAssign to Prestudent_model - Changed WidgetLib to allow to set the name and the id html attributes of a widget
56 lines
1.8 KiB
PHP
56 lines
1.8 KiB
PHP
<?php
|
|
|
|
class Reihungstest_widget extends Widget
|
|
{
|
|
public function __construct($name, $args, $htmlArgs = array())
|
|
{
|
|
// Calling daddy
|
|
parent::__construct($name, $args, $htmlArgs);
|
|
}
|
|
|
|
public function display($widgetData)
|
|
{
|
|
// Reihungstest
|
|
$reihungstest = success(array()); // default value empty array
|
|
// If the parameters studiengang or studiensemester are given and are not empty
|
|
if (isset($widgetData) && is_array($widgetData)
|
|
&& ((isset($widgetData['studiengang']) && !empty($widgetData['studiengang']))
|
|
|| (isset($widgetData['studiensemester']) && !empty($widgetData['studiensemester']))))
|
|
{
|
|
$this->load->model('crm/Reihungstest_model', 'ReihungstestModel');
|
|
$this->ReihungstestModel->addSelect('reihungstest_id, concat(datum, \' \', uhrzeit, \' \', anmerkung) AS beschreibung');
|
|
$this->ReihungstestModel->addOrder('datum', 'DESC');
|
|
|
|
$parametersArray = array();
|
|
if ($widgetData['studiengang'] != null)
|
|
{
|
|
$parametersArray['studiengang_kz'] = $widgetData['studiengang'];
|
|
}
|
|
if ($widgetData['studiensemester'] != null)
|
|
{
|
|
$parametersArray['studiensemester_kurzbz'] = $widgetData['studiensemester'];
|
|
}
|
|
|
|
$reihungstest = $this->ReihungstestModel->loadWhere($parametersArray);
|
|
if (isError($reihungstest))
|
|
{
|
|
show_error($reihungstest);
|
|
}
|
|
}
|
|
|
|
if (!isError($reihungstest))
|
|
{
|
|
// Adding an empty element at the beginning
|
|
$emptyElement = new stdClass();
|
|
$emptyElement->reihungstest_id = Partial::HTML_DEFAULT_VALUE;
|
|
$emptyElement->beschreibung = 'Select a reihungstest...';
|
|
array_unshift($reihungstest->retval, $emptyElement);
|
|
}
|
|
|
|
// Data to be used in the widget view
|
|
$widgetData['reihungstests'] = $reihungstest->retval;
|
|
|
|
// Loads widget view
|
|
$this->view('widgets/reihungstest', $widgetData);
|
|
}
|
|
} |