Task #1353: First solution, to be refined

This commit is contained in:
Paolo
2017-05-16 18:52:38 +02:00
parent d6c5cb2267
commit 2286d47b69
3 changed files with 97 additions and 7 deletions
+20 -4
View File
@@ -4,13 +4,29 @@ class Vorlage_widget extends DropdownWidget
{
public function display($widgetData)
{
$this->load->model('system/Vorlage_model', 'VorlageModel');
$this->VorlageModel->addOrder('vorlage_kurzbz');
// Loads
$this->load->library('OrganisationseinheitLib');
$this->addSelectToModel($this->VorlageModel, 'vorlage_kurzbz', 'bezeichnung');
$vorlage = $this->organisationseinheitlib->treeSearchEntire(
'(
SELECT v.vorlage_kurzbz, v.bezeichnung, vs.version, vs.oe_kurzbz, vs.aktiv, vs.subject, vs.text, v.mimetype
FROM tbl_vorlagestudiengang vs INNER JOIN tbl_vorlage v USING(vorlage_kurzbz)
) templates',
'templates',
array("templates.vorlage_kurzbz AS id", "UPPER(templates.oe_kurzbz) || ' - ' || templates.bezeichnung || ' - V' || templates.version AS description"),
'templates.aktiv = TRUE
AND templates.subject IS NOT NULL
AND templates.text IS NOT NULL
AND templates.mimetype = \'text/html\'',
"description ASC",
'eas',
true
);
array_pop($vorlage->retval);
$this->setElementsArray(
$this->VorlageModel->loadWhere(array('mimetype' => 'text/html')),
$vorlage,
true,
'Select a vorlage...',
'No vorlage found'