@@ -603,6 +607,7 @@ function new_sm()
}
$type = empty($_POST['type']) ? 0 : 1;
+ $icon = hesk_POST('icon');
$title = hesk_input( hesk_POST('title') ) or $hesk_error_buffer[] = $hesklang['sm_e_title'];
$message = hesk_getHTML( hesk_POST('message') );
@@ -613,6 +618,7 @@ function new_sm()
'style' => $style,
'type' => $type,
'title' => $title,
+ 'icon' => $icon,
'message' => hesk_input( hesk_POST('message') ),
);
@@ -636,6 +642,7 @@ function new_sm()
'style' => $style,
'type' => $type,
'title' => $title,
+ 'icon' => $icon,
'message' => $message,
);
@@ -649,13 +656,14 @@ function new_sm()
$my_order = intval($row[0]) + 10;
// Insert service message into database
- hesk_dbQuery("INSERT INTO `".hesk_dbEscape($hesk_settings['db_pfix'])."service_messages` (`author`,`title`,`message`,`style`,`type`,`order`) VALUES (
+ hesk_dbQuery("INSERT INTO `".hesk_dbEscape($hesk_settings['db_pfix'])."service_messages` (`author`,`title`,`message`,`style`,`type`,`order`, `icon`) VALUES (
'".intval($_SESSION['id'])."',
'".hesk_dbEscape($title)."',
'".hesk_dbEscape($message)."',
'{$style}',
'{$type}',
- '{$my_order}'
+ '{$my_order}',
+ '{$icon}'
)");
$_SESSION['smord'] = hesk_dbInsertID();
diff --git a/install/mods-for-hesk/ajax/uninstall-database-ajax.php b/install/mods-for-hesk/ajax/uninstall-database-ajax.php
index 69357dcc..d03d06d0 100644
--- a/install/mods-for-hesk/ajax/uninstall-database-ajax.php
+++ b/install/mods-for-hesk/ajax/uninstall-database-ajax.php
@@ -29,6 +29,8 @@ if ($task == 'status-change') {
removePendingVerificationEmailsTable();
} elseif ($task == 'pending-verification-tickets-table') {
removeTicketsPendingVerificationTable();
+} elseif ($task == 'service-message-icon') {
+ removeServiceMessageCustomIcon();
} elseif ($task == 'miscellaneous') {
executeMiscellaneousSql();
} else {
diff --git a/install/mods-for-hesk/js/uninstall-scripts.js b/install/mods-for-hesk/js/uninstall-scripts.js
index d85b6a33..ce2f3a0d 100644
--- a/install/mods-for-hesk/js/uninstall-scripts.js
+++ b/install/mods-for-hesk/js/uninstall-scripts.js
@@ -1,7 +1,7 @@
function getTasks() {
return ['status-change', 'autorefresh', 'parent-child', 'settings-access', 'activate-user',
'notify-note-unassigned', 'user-manage-notification-settings', 'settings-table', 'verified-emails-table',
- 'pending-verification-emails-table', 'pending-verification-tickets-table', 'miscellaneous'];
+ 'pending-verification-emails-table', 'pending-verification-tickets-table', 'service-message-icon', 'miscellaneous'];
}
function processUninstallation() {
diff --git a/install/mods-for-hesk/sql/installSql.php b/install/mods-for-hesk/sql/installSql.php
index f0ca04b9..ce61e4a9 100644
--- a/install/mods-for-hesk/sql/installSql.php
+++ b/install/mods-for-hesk/sql/installSql.php
@@ -436,4 +436,14 @@ function execute221Scripts() {
hesk_dbConnect();
executeQuery("UPDATE `".hesk_dbEscape($hesk_settings['db_pfix'])."settings` SET `Value` = '2.2.1' WHERE `Key` = 'modsForHeskVersion'");
}
-// END Version 2.2.1
\ No newline at end of file
+// END Version 2.2.1
+
+// BEGIN Version 2.3.0
+function execute230Scripts() {
+ global $hesk_settings;
+
+ hesk_dbConnect();
+ executeQuery("ALTER TABLE `".hesk_dbEscape($hesk_settings['db_pfix'])."service_messages` ADD COLUMN `icon` VARCHAR(150)");
+ executeQuery("UPDATE `".hesk_dbEscape($hesk_settings['db_pfix'])."settings` SET `Value` = '2.3.0' WHERE `Key` = 'modsForHeskVersion'");
+}
+// END Version 2.3.0
\ No newline at end of file
diff --git a/install/mods-for-hesk/sql/uninstallSql.php b/install/mods-for-hesk/sql/uninstallSql.php
index d8f2b7b4..d76c7728 100644
--- a/install/mods-for-hesk/sql/uninstallSql.php
+++ b/install/mods-for-hesk/sql/uninstallSql.php
@@ -129,6 +129,13 @@ function removeTicketsPendingVerificationTable() {
executeQuery("DROP TABLE `".hesk_dbEscape($hesk_settings['db_pfix'])."stage_tickets`");
}
+function removeServiceMessageCustomIcon() {
+ global $hesk_settings;
+
+ hesk_dbConnect();
+ executeQuery("ALTER TABLE `".hesk_dbEscape($hesk_settings['db_pfix'])."service_messages` DROP COLUMN `icon`");
+}
+
function executeMiscellaneousSql() {
global $hesk_settings;
diff --git a/install/mods-for-hesk/uninstallModsForHesk.php b/install/mods-for-hesk/uninstallModsForHesk.php
index 34dc18d7..1dd3d27c 100644
--- a/install/mods-for-hesk/uninstallModsForHesk.php
+++ b/install/mods-for-hesk/uninstallModsForHesk.php
@@ -16,6 +16,7 @@ function echoTaskRows() {
printUninstallRow('Remove verified emails table', 'verified-emails-table');
printUninstallRow('Remove pending verification emails table', 'pending-verification-emails-table');
printUninstallRow('Remove tickets pending verification table', 'pending-verification-tickets-table');
+ printUninstallRow('Remove custom service messages icon', 'service-message-icon');
printUninstallRow('Miscellaneous database cleanup changes', 'miscellaneous');
}