From eca75f2f0fdef186c54719cd4d9e1b83f29a5f35 Mon Sep 17 00:00:00 2001 From: Thierry Bugier Date: Mon, 1 Jul 2019 15:35:21 +0200 Subject: [PATCH] fix(targetticket): fix tags handling --- inc/field.class.php | 4 ++-- inc/fields/dropdownfield.class.php | 1 - inc/fields/tagfield.class.php | 5 +++++ inc/targetbase.class.php | 16 +++++++++++++--- inc/targetticket.class.php | 2 +- 5 files changed, 21 insertions(+), 7 deletions(-) diff --git a/inc/field.class.php b/inc/field.class.php index 31bc73815..0ee1dbdb2 100644 --- a/inc/field.class.php +++ b/inc/field.class.php @@ -67,8 +67,8 @@ public function prepareQuestionInputForSave($input) { return $input; } - public function getValueForTarget() { - return Toolbox::addslashes_deep($this->value); + public function getRawValue() { + return $this->value; } /** diff --git a/inc/fields/dropdownfield.class.php b/inc/fields/dropdownfield.class.php index bce1d630c..bf15fa76d 100644 --- a/inc/fields/dropdownfield.class.php +++ b/inc/fields/dropdownfield.class.php @@ -350,7 +350,6 @@ public function getValueForTargetText($richText) { return Toolbox::addslashes_deep($value); } - public function getDocumentsForTarget() { return []; } diff --git a/inc/fields/tagfield.class.php b/inc/fields/tagfield.class.php index a40b343f9..8a56ca171 100644 --- a/inc/fields/tagfield.class.php +++ b/inc/fields/tagfield.class.php @@ -103,6 +103,11 @@ public function getValueForDesign() { return implode("\r\n", $this->value); } + public function getValueForTargetText($richText) { + $value = Dropdown::getDropdownName(PluginTagTag::getTable(), $this->value); + return Toolbox::addslashes_deep($value); + } + public function isValid() { // If the field is required it can't be empty if ($this->isRequired() && $this->value == '') { diff --git a/inc/targetbase.class.php b/inc/targetbase.class.php index b883a4da5..91b3f9144 100644 --- a/inc/targetbase.class.php +++ b/inc/targetbase.class.php @@ -973,7 +973,7 @@ function change_tag_type() { echo '