From e708c722a21ace25198d7a8891cda584fde62178 Mon Sep 17 00:00:00 2001 From: Mike Koch Date: Thu, 30 Jul 2015 13:00:53 -0400 Subject: [PATCH] #202 Add TinyMCE to ticket template page --- admin/manage_ticket_templates.php | 119 ++++++++++++++++++++++-------- 1 file changed, 90 insertions(+), 29 deletions(-) diff --git a/admin/manage_ticket_templates.php b/admin/manage_ticket_templates.php index f454bab9..8ff7d655 100644 --- a/admin/manage_ticket_templates.php +++ b/admin/manage_ticket_templates.php @@ -37,6 +37,7 @@ define('HESK_PATH','../'); /* Get all the required files and functions */ require(HESK_PATH . 'hesk_settings.inc.php'); +require(HESK_PATH . 'modsForHesk_settings.inc.php'); require(HESK_PATH . 'inc/common.inc.php'); require(HESK_PATH . 'inc/admin_functions.inc.php'); hesk_load_database_functions(); @@ -51,6 +52,10 @@ hesk_checkPermission('can_man_ticket_tpl'); // Define required constants define('LOAD_TABS',1); +if ($modsForHesk_settings['rich_text_for_tickets']) { + define('WYSIWYG', 1); +} + /* What should we do? */ if ( $action = hesk_REQUEST('a') ) { @@ -127,8 +132,11 @@ $num = hesk_dbNumRows($result); $options .= (isset($_SESSION['canned']['id']) && $_SESSION['canned']['id'] == $mysaved['id']) ? ' selected="selected" ' : ''; $options .= '>'.$mysaved['title'].''; - - $javascript_messages.='myMsgTxt['.$mysaved['id'].']=\''.str_replace("\r\n","\\r\\n' + \r\n'", addslashes($mysaved['message']) )."';\n"; + if ($modsForHesk_settings['rich_text_for_tickets']) { + $javascript_messages.='myMsgTxt['.$mysaved['id'].']=\''.str_replace("\r\n","\\r\\n' + \r\n'", html_entity_decode($mysaved['message'] ))."';\n"; + } else { + $javascript_messages.='myMsgTxt['.$mysaved['id'].']=\''.str_replace("\r\n","\\r\\n' + \r\n'", addslashes($mysaved['message']) )."';\n"; + } $javascript_titles.='myTitle['.$mysaved['id'].']=\''.addslashes($mysaved['title'])."';\n"; echo ' @@ -223,7 +231,7 @@ $num = hesk_dbNumRows($result);
- >
@@ -232,10 +240,14 @@ $num = hesk_dbNumRows($result);
- @@ -250,34 +262,83 @@ $num = hesk_dbNumRows($result);
+ + +