From 1dde2c5cb26db9cf869bcc878aeee8ebe849f00f Mon Sep 17 00:00:00 2001 From: bison Date: Wed, 17 Aug 2016 16:24:42 +0200 Subject: [PATCH] Fixed method loadVorlagetext, now it take care about all the parameters --- application/libraries/VorlageLib.php | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) diff --git a/application/libraries/VorlageLib.php b/application/libraries/VorlageLib.php index 6fab8e71f..7cf586dff 100644 --- a/application/libraries/VorlageLib.php +++ b/application/libraries/VorlageLib.php @@ -122,8 +122,23 @@ class VorlageLib $where .= "sprache = " . $this->ci->VorlageModel->escape($sprache); } - // Try to search the template with the given vorlage_kurzbz - $vorlage = $this->ci->VorlageStudiengangModel->loadWhere(array("vorlage_kurzbz" => $vorlage_kurzbz)); + // Try to search the template with the given vorlage_kurzbz and other parameters if present + $queryParameters = array("vorlage_kurzbz" => $vorlage_kurzbz); + + if (isset($oe_kurzbz)) + { + $queryParameters["oe_kurzbz"] = $oe_kurzbz; + } + if (isset($orgform_kurzbz)) + { + $queryParameters["orgform_kurzbz"] = $orgform_kurzbz; + } + if (isset($sprache)) + { + $queryParameters["sprache"] = $sprache; + } + + $vorlage = $this->ci->VorlageStudiengangModel->loadWhere($queryParameters); // If the searched template was not found if (is_object($vorlage) && $vorlage->error == EXIT_SUCCESS && is_array($vorlage->retval) && count($vorlage->retval) == 0) {