Added using of specific, limited studiengang-array in Dropdown-Widget

By passing an array of studiengang_kz the dropdown-menu will only be
populated with them.
This commit is contained in:
hainberg
2019-08-29 14:22:34 +02:00
parent aad5f7bd5e
commit 6dcf97c848
+3 -4
View File
@@ -10,9 +10,8 @@ class Studiengang_widget extends DropdownWidget
$this->addSelectToModel($this->StudiengangModel, 'studiengang_kz', '\'(\' || kurzbzlang || \') \' || tbl_studiengang.bezeichnung');
// If a specific array of studiengaenge is privided, set the condition to retrieve them
if (isset($widgetData['studiengang']))
// If 'studiengang' (array of specific studiengaenge) is given, retrieve these studiengaenge only
if (isset($widgetData['studiengang']) && !empty($widgetData['studiengang']))
{
$condition = '
studiengang_kz IN ('. implode(',', $widgetData['studiengang']) . ') AND
@@ -28,7 +27,7 @@ class Studiengang_widget extends DropdownWidget
$this->setElementsArray(
$this->StudiengangModel->loadWhere($condition),
true,
'Select a studiengang...',
$this->p->t('ui', 'bitteEintragWaehlen'),
'No studiengaenge found'
);