diff --git a/admin/admin_ticket.php b/admin/admin_ticket.php
index 02073ebd..9842b6bd 100644
--- a/admin/admin_ticket.php
+++ b/admin/admin_ticket.php
@@ -1943,7 +1943,7 @@ function hesk_printReplyForm() {
function hesk_printCanned()
{
- global $hesklang, $hesk_settings, $can_reply, $ticket;
+ global $hesklang, $hesk_settings, $can_reply, $ticket, $modsForHesk_settings;
/* Can user reply to tickets? */
if ( ! $can_reply)
@@ -1972,13 +1972,19 @@ function hesk_printCanned()
while ($mysaved = hesk_dbFetchRow($res))
{
$can_options .= '\n";
- echo 'myMsgTxt['.$mysaved[0].']=\''.str_replace("\r\n","\\r\\n' + \r\n'", addslashes($mysaved[2]))."';\n";
+ if ($modsForHesk_settings['rich_text_for_tickets']) {
+ echo 'myMsgTxt['.$mysaved[0].']=\''.str_replace("\r\n","\\r\\n' + \r\n'", hesk_html_entity_decode($mysaved[2]))."';\n";
+ } else {
+ echo 'myMsgTxt['.$mysaved[0].']=\''.str_replace("\r\n","\\r\\n' + \r\n'", addslashes($mysaved[2]))."';\n";
+ }
}
?>
function setMessage(msgid)
{
+ var isHtml = ;
+
var myMsg=myMsgTxt[msgid];
if (myMsg == '')
@@ -2021,12 +2027,23 @@ function hesk_printCanned()
{
if (document.getElementById('moderep').checked)
{
- document.getElementById('HeskMsg').innerHTML='';
+ if (isHtml){
+ tinymce.get("message").setContent('');
+ tinymce.get("message").execCommand('mceInsertRawHTML', false, myMsg);
+ } else {
+ document.getElementById('message').value = myMsg;
+ }
}
else
{
- var oldMsg = document.getElementById('message').value;
- document.getElementById('HeskMsg').innerHTML='';
+ if (isHtml) {
+ var oldMsg = tinymce.get("message").getContent();
+ tinymce.get("message").setContent('');
+ tinymce.get("message").execCommand('mceInsertRawHTML', false, oldMsg + myMsg);
+ } else {
+ var oldMsg = document.getElementById('message').value;
+ document.getElementById('message').value = oldMsg + myMsg;
+ }
}
}
else
diff --git a/admin/manage_canned.php b/admin/manage_canned.php
index d6fa2b6a..19c38d66 100644
--- a/admin/manage_canned.php
+++ b/admin/manage_canned.php
@@ -159,8 +159,12 @@ function hesk_insertAtCursor(myField, myValue) {
$options .= '>'.$mysaved['title'].'';
- $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";
+ if ($modsForHesk_settings['rich_text_for_tickets']) {
+ $javascript_messages.='myMsgTxt['.$mysaved['id'].']=\''.str_replace("\r\n","\\r\\n' + \r\n'", hesk_html_entity_decode($mysaved['message']) )."';\n";
+ } else {
+ $javascript_messages.='myMsgTxt['.$mysaved['id'].']=\''.str_replace("\r\n","\\r\\n' + \r\n'", addslashes($mysaved['message']) )."';\n";
+ }
echo '
diff --git a/admin/manage_statuses.php b/admin/manage_statuses.php
index cc6ac8da..13d9a4fd 100644
--- a/admin/manage_statuses.php
+++ b/admin/manage_statuses.php
@@ -644,8 +644,13 @@ function createStatus() {
$row = hesk_dbFetchRow($res);
$my_order = $row[0]+10;
- $insert = "INSERT INTO `".hesk_dbEscape($hesk_settings['db_pfix'])."statuses` (`Key`, `TextColor`, `IsClosed`, `Closable`, `sort`)
- VALUES ('STORED IN XREF TABLE', '".hesk_dbEscape($textColor)."', ".intval($isClosed).", '".hesk_dbEscape($closable)."', ".intval($my_order).")";
+ // Get the next status id
+ $res = hesk_dbQuery("SELECT `ID` FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."statuses` ORDER BY `ID` DESC LIMIT 1");
+ $row = hesk_dbFetchAssoc($res);
+ $nextId = $row['ID'] + 1;
+
+ $insert = "INSERT INTO `".hesk_dbEscape($hesk_settings['db_pfix'])."statuses` (`ID`, `Key`, `TextColor`, `IsClosed`, `Closable`, `sort`)
+ VALUES (".intval($nextId).", 'STORED IN XREF TABLE', '".hesk_dbEscape($textColor)."', ".intval($isClosed).", '".hesk_dbEscape($closable)."', ".intval($my_order).")";
hesk_dbQuery($insert);
$newStatusId = hesk_dbInsertID();
diff --git a/admin/new_ticket.php b/admin/new_ticket.php
index 8799deac..fcb65702 100644
--- a/admin/new_ticket.php
+++ b/admin/new_ticket.php
@@ -563,7 +563,11 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
while ($mysaved = hesk_dbFetchRow($res))
{
$can_options .= '\n";
- echo 'myMsgTxt['.$mysaved[0].']=\''.str_replace("\r\n","\\r\\n' + \r\n'", addslashes($mysaved[2]))."';\n";
+ if ($modsForHesk_settings['rich_text_for_tickets']) {
+ echo 'myMsgTxt['.$mysaved[0].']=\''.str_replace("\r\n","\\r\\n' + \r\n'", hesk_html_entity_decode($mysaved[2]))."';\n";
+ } else {
+ echo 'myMsgTxt['.$mysaved[0].']=\''.str_replace("\r\n","\\r\\n' + \r\n'", addslashes($mysaved[2]))."';\n";
+ }
echo 'mySubjectTxt['.$mysaved[0].']=\''.str_replace("\r\n","\\r\\n' + \r\n'", addslashes($mysaved[1]))."';\n";
}
diff --git a/inc/common.inc.php b/inc/common.inc.php
index 1c43e76f..8fe783c0 100644
--- a/inc/common.inc.php
+++ b/inc/common.inc.php
@@ -1962,10 +1962,11 @@ function mfh_getDisplayTextForStatusId($statusId) {
$statusRs = hesk_dbQuery("SELECT `text`, `Key`, `language` FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."statuses` AS `statuses`
LEFT JOIN `".hesk_dbEscape($hesk_settings['db_pfix'])."text_to_status_xref` ON `status_id` = `statuses`.`ID`
+ AND `language` = '".hesk_dbEscape($hesk_settings['language'])."'
WHERE `statuses`.`ID` = ".intval($statusId));
$statusRec = hesk_dbFetchAssoc($statusRs);
- if ($statusRec['language'] == $hesk_settings['language'] && $statusRec['text'] != NULL) {
+ if ($statusRec['text'] != NULL) {
// We found a record. Use the text field
return $statusRec['text'];
} else {
diff --git a/install/install_functions.inc.php b/install/install_functions.inc.php
index 41e2c64f..eef55759 100644
--- a/install/install_functions.inc.php
+++ b/install/install_functions.inc.php
@@ -37,7 +37,7 @@ if (!defined('IN_SCRIPT')) {die('Invalid attempt');}
// We will be installing this HESK version:
define('HESK_NEW_VERSION','2.6.4');
-define('MODS_FOR_HESK_NEW_VERSION','2.3.2');
+define('MODS_FOR_HESK_NEW_VERSION','2.4.0');
define('REQUIRE_PHP_VERSION','5.0.0');
define('REQUIRE_MYSQL_VERSION','5.0.7');
diff --git a/install/mods-for-hesk/ajax/install-database-ajax.php b/install/mods-for-hesk/ajax/install-database-ajax.php
index 17070024..a00501cf 100644
--- a/install/mods-for-hesk/ajax/install-database-ajax.php
+++ b/install/mods-for-hesk/ajax/install-database-ajax.php
@@ -45,6 +45,9 @@ if ($version == 1) {
execute231Scripts();
} elseif ($version == 232) {
execute232Scripts();
+} elseif ($version == 240) {
+ execute240Scripts();
+ execute240FileUpdate();
} else {
$response = 'The version "'.$version.'" was not recognized. Check the value submitted and try again.';
print $response;
diff --git a/install/mods-for-hesk/installModsForHesk.php b/install/mods-for-hesk/installModsForHesk.php
index 5e576af3..ac5ff53d 100644
--- a/install/mods-for-hesk/installModsForHesk.php
+++ b/install/mods-for-hesk/installModsForHesk.php
@@ -58,6 +58,9 @@ function echoInitialVersionRows($version) {
if ($version < 232) {
printRow('v2.3.2');
}
+ if ($version < 240) {
+ printRow('v2.4.0');
+ }
}
function printRow($version) {
@@ -107,7 +110,7 @@ function printRow($version) {
-
+
@@ -116,10 +119,12 @@ function printRow($version) {
+
Migrate IP / Email Bans |
Waiting... |
+
Initialize Statuses |
Waiting... |
diff --git a/install/mods-for-hesk/js/version-scripts.js b/install/mods-for-hesk/js/version-scripts.js
index f55b3614..62d45456 100644
--- a/install/mods-for-hesk/js/version-scripts.js
+++ b/install/mods-for-hesk/js/version-scripts.js
@@ -47,6 +47,9 @@ function processUpdates(startingVersion) {
} else if (startingVersion < 232) {
startVersionUpgrade('232');
executeUpdate(232, '232', '2.3.2');
+ } else if (startingVersion < 240) {
+ startVersionUpgrade('240');
+ executeUpdate(240, '240', '2.4.0');
} else {
installationFinished();
}
diff --git a/install/mods-for-hesk/modsForHesk.php b/install/mods-for-hesk/modsForHesk.php
index d28174a9..5afebb74 100644
--- a/install/mods-for-hesk/modsForHesk.php
+++ b/install/mods-for-hesk/modsForHesk.php
@@ -137,6 +137,17 @@ hesk_dbConnect();
}
?>
+
+
-
-
+
+
-
-
+
@@ -280,6 +291,9 @@ hesk_dbConnect();
+
+
+
diff --git a/install/mods-for-hesk/sql/installSql.php b/install/mods-for-hesk/sql/installSql.php
index 76cdb845..8b1faa34 100644
--- a/install/mods-for-hesk/sql/installSql.php
+++ b/install/mods-for-hesk/sql/installSql.php
@@ -1,7 +1,5 @@
$value) {
$languages[$key] = $hesk_settings['languages'][$key]['folder'];
}
$statusesRs = executeQuery("SELECT `ID`, `Key` FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."statuses`");
+ $oldSetting = $hesk_settings['can_sel_lang'];
+ $hesk_settings['can_sel_lang'] = 1;
while ($row = hesk_dbFetchAssoc($statusesRs)) {
foreach ($languages as $language => $languageCode) {
+ hesk_setLanguage($language);
$sql = "INSERT INTO `".hesk_dbEscape($hesk_settings['db_pfix'])."text_to_status_xref` (`language`, `text`, `status_id`)
VALUES ('".hesk_dbEscape($language)."', '".hesk_dbEscape($hesklang[$row['Key']])."', ".intval($row['ID']).")";
executeQuery($sql);
}
}
+ $hesk_settings['can_sel_lang'] = $oldSetting;
+ hesk_resetLanguage();
}
function execute240FileUpdate() {
diff --git a/install/mods-for-hesk/sql/uninstallSql.php b/install/mods-for-hesk/sql/uninstallSql.php
index 96adb576..cfca06a9 100644
--- a/install/mods-for-hesk/sql/uninstallSql.php
+++ b/install/mods-for-hesk/sql/uninstallSql.php
@@ -78,6 +78,10 @@ function removeOtherColumns() {
executeQuery("ALTER TABLE `".hesk_dbEscape($hesk_settings['db_pfix'])."categories` DROP COLUMN `manager`");
executeQuery("ALTER TABLE `".hesk_dbEscape($hesk_settings['db_pfix'])."users` DROP COLUMN `permission_template`");
executeQuery("DROP TABLE `".hesk_dbEscape($hesk_settings['db_pfix'])."permission_templates`");
+ executeQuery("DROP TABLE `".hesk_dbEscape($hesk_settings['db_pfix'])."quick_help_sections`");
+ executeQuery("DROP TABLE `".hesk_dbEscape($hesk_settings['db_pfix'])."text_to_status_xref`");
+ executeQuery("ALTER TABLE `".hesk_dbEscape($hesk_settings['db_pfix'])."attachments` DROP COLUMN `download_count`");
+ executeQuery("ALTER TABLE `".hesk_dbEscape($hesk_settings['db_pfix'])."kb_attachments` DROP COLUMN `download_count`");
// These queries are ran in case someone used an unfortunate installation they may have not properly cleaned up tables