From 14aab3dd56665c79982fefec6ac83cb7aa927023 Mon Sep 17 00:00:00 2001 From: bison-paolo Date: Mon, 13 Mar 2017 16:39:38 +0100 Subject: [PATCH] - Vorlage widget now add an empty element to the beginning of the drop down box - Bugfix message write controller: - JS function getVorlageText was missing - Wrong URL in form action --- application/views/system/messageWrite.php | 20 +++++++++++++++++++- application/views/widgets/vorlage.php | 11 ++++++++++- application/widgets/vorlage_widget.php | 6 ++++++ 3 files changed, 35 insertions(+), 2 deletions(-) diff --git a/application/views/system/messageWrite.php b/application/views/system/messageWrite.php index 69b37589c..dfefb8787 100644 --- a/application/views/system/messageWrite.php +++ b/application/views/system/messageWrite.php @@ -3,7 +3,6 @@
@@ -166,5 +165,24 @@ } }); } + + function getVorlageText(vorlage_kurzbz) + { + + + $.ajax({ + dataType: "json", + url: "", + data: {"vorlage_kurzbz": vorlage_kurzbz}, + success: function(data, textStatus, jqXHR) { + tinyMCE.get("bodyTextArea").setContent(data.retval[0].text); + }, + error: function(jqXHR, textStatus, errorThrown) { + alert(textStatus + " - " + errorThrown); + } + }); + } diff --git a/application/views/widgets/vorlage.php b/application/views/widgets/vorlage.php index a1d503578..e3be9c2cb 100644 --- a/application/views/widgets/vorlage.php +++ b/application/views/widgets/vorlage.php @@ -1,7 +1,16 @@ diff --git a/application/widgets/vorlage_widget.php b/application/widgets/vorlage_widget.php index db190cc85..ad3857047 100644 --- a/application/widgets/vorlage_widget.php +++ b/application/widgets/vorlage_widget.php @@ -10,6 +10,12 @@ class Vorlage_widget extends Widget if (is_object($result) && $result->error == EXIT_SUCCESS) { + // Adding an empty element + $emptyVorlage = new stdClass(); + $emptyVorlage->vorlage_kurzbz = '-1'; + $emptyVorlage->bezeichnung = 'Select a template...'; + array_unshift($result->retval, $emptyVorlage); + $data = array("vorlage" => $result->retval); $this->view("widgets/vorlage", $data); }