|
@@ -8123,12 +8123,9 @@ class Form
|
|
|
$out .= "\n".'<script>'."\n";
|
|
|
if ($addjscombo == 1) {
|
|
|
$tmpplugin = empty($conf->global->MAIN_USE_JQUERY_MULTISELECT) ?constant('REQUIRE_JQUERY_MULTISELECT') : $conf->global->MAIN_USE_JQUERY_MULTISELECT;
|
|
|
- $out .= 'function formatResult(record) {'."\n";
|
|
|
- if ($elemtype == 'category') {
|
|
|
- $out .= 'return \'<span><img src="'.DOL_URL_ROOT.'/theme/eldy/img/object_category.png"> \'+record.text+\'</span>\';';
|
|
|
- } else {
|
|
|
- $out .= 'return record.text;';
|
|
|
- }
|
|
|
+ $out .= 'function formatResult(record, container) {'."\n";
|
|
|
+ $out .= ' if ($(record.element).attr("data-html") != undefined) return htmlEntityDecodeJs($(record.element).attr("data-html")); // If property html set, we decode html entities and use this'."\n";
|
|
|
+ $out .= ' return record.text;';
|
|
|
$out .= '};'."\n";
|
|
|
$out .= 'function formatSelection(record) {'."\n";
|
|
|
if ($elemtype == 'category') {
|
|
@@ -8150,6 +8147,7 @@ class Form
|
|
|
// Specify format function for dropdown item
|
|
|
formatResult: formatResult,
|
|
|
templateResult: formatResult, /* For 4.0 */
|
|
|
+ escapeMarkup: function (markup) { return markup; }, // let our custom formatter work
|
|
|
// Specify format function for selected item
|
|
|
formatSelection: formatSelection,
|
|
|
templateSelection: formatSelection /* For 4.0 */
|