diff --git a/.gitignore b/.gitignore index e4ef0e68..274e3a3f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,8 +1,6 @@ admin/admin_suggest_articles.php admin/archive.php -admin/assign_owner.php admin/generate_spam_question.php -admin/move_category.php admin/priority.php admin/test_connection.php attachments/index.htm diff --git a/README.md b/README.md index fd837659..fc68f220 100644 --- a/README.md +++ b/README.md @@ -1,8 +1,8 @@ -## [Mods for HESK](http://mods-for-hesk.mkochcs.com) [![Current Release](https://img.shields.io/github/release/mkoch227/Mods-for-HESK.svg)](https://www.github.com/mkoch227/Mods-for-HESK/releases) [![Project Status](http://stillmaintained.com/mkoch227/Mods-for-HESK.png)](https://www.github.com/mkoch227/Mods-for-HESK) +## [Mods for HESK](http://mods-for-hesk.mkochcs.com) [![Number of Downloads](https://img.shields.io/github/downloads/mkoch227/Mods-for-HESK/latest/total.svg)](https://www.github.com/mkoch227/Mods-for-HESK/releases) [![Open Issues](https://img.shields.io/github/issues-raw/mkoch227/Mods-for-HESK.svg)](https://www.github.com/mkoch227/Mods-for-HESK/issues) [![Current Release](https://img.shields.io/github/release/mkoch227/Mods-for-HESK.svg)](https://www.github.com/mkoch227/Mods-for-HESK/releases) [![Project Status](http://stillmaintained.com/mkoch227/Mods-for-HESK.png)](https://www.github.com/mkoch227/Mods-for-HESK) [![License](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/mkoch227/Mods-for-HESK/blob/master/LICENSE) [![Join the chat at https://gitter.im/mkoch227/Mods-for-HESK](https://badges.gitter.im/Join%20Chat.svg)](https://gitter.im/mkoch227/Mods-for-HESK?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) -Mods for HESK is a set of modifications for [HESK](http://www.hesk.com) v2.6.4, a free and popular helpdesk solution. +Mods for HESK is a set of modifications for [HESK](http://www.hesk.com) v2.6.5, a free and popular helpdesk solution. ## Features diff --git a/admin/admin_main.php b/admin/admin_main.php index 111ed08a..d80ecf5a 100644 --- a/admin/admin_main.php +++ b/admin/admin_main.php @@ -1,7 +1,7 @@ install folder /* 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'); require(HESK_PATH . 'inc/status_functions.inc.php'); diff --git a/admin/admin_reply_ticket.php b/admin/admin_reply_ticket.php index 3b317f21..7c2805a6 100644 --- a/admin/admin_reply_ticket.php +++ b/admin/admin_reply_ticket.php @@ -1,7 +1,7 @@ install folder // Get all the required files and functions require(HESK_PATH . 'hesk_settings.inc.php'); -require(HESK_PATH . 'modsForHesk_settings.inc.php'); // Save the default language for the settings page before choosing user's preferred one $hesk_settings['language_default'] = $hesk_settings['language']; @@ -254,25 +253,6 @@ if ( defined('HESK_DEMO') ) ?> - - - - -
- /modsForHesk_settings.inc.php - - '.$hesklang['exists'].', '.$hesklang['writable'].''; - } else { - echo ''.$hesklang['exists'].', '.$hesklang['not_writable'].'
'.$hesklang['e_mfh_settings']; - } - ?> -
@@ -348,6 +328,7 @@ if ( defined('HESK_DEMO') ) $hesklang['err_custname'] = addslashes($hesklang['err_custname']); + $modsForHesk_settings = mfh_getSettings(); ?> -"> - + '.$mysaved['title'].''; 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"; + $theMessage = html_entity_decode($mysaved['message']); + $theMessage = addslashes($theMessage); + $javascript_messages.='myMsgTxt['.$mysaved['id'].']=\''.str_replace("\r\n","\\r\\n' + \r\n'", $theMessage)."';\n"; } else { $javascript_messages.='myMsgTxt['.$mysaved['id'].']=\''.str_replace("\r\n","\\r\\n' + \r\n'", addslashes($mysaved['message']) )."';\n"; } diff --git a/admin/manage_users.php b/admin/manage_users.php index 0deacacf..a6f78c95 100644 --- a/admin/manage_users.php +++ b/admin/manage_users.php @@ -1,7 +1,7 @@ 1, ); +$modsForHesk_settings = mfh_getSettings(); /* A list of all categories */ $orderBy = $modsForHesk_settings['category_order_column']; $hesk_settings['categories'] = array(); diff --git a/admin/move_category.php b/admin/move_category.php new file mode 100755 index 00000000..9ea06c9e --- /dev/null +++ b/admin/move_category.php @@ -0,0 +1,212 @@ + Prepare message */ + +// 1. Generate the array with ticket info that can be used in emails +$info = array( +'email' => $ticket['email'], +'category' => $ticket['category'], +'priority' => $ticket['priority'], +'owner' => $ticket['owner'], +'trackid' => $ticket['trackid'], +'status' => $ticket['status'], +'name' => $ticket['name'], +'lastreplier' => $ticket['lastreplier'], +'subject' => $ticket['subject'], +'message' => $ticket['message'], +'attachments' => $ticket['attachments'], +'dt' => hesk_date($ticket['dt'], true), +'lastchange' => hesk_date($ticket['lastchange'], true), +'id' => $ticket['id'], +); + +// 2. Add custom fields to the array +foreach ($hesk_settings['custom_fields'] as $k => $v) +{ + $info[$k] = $v['use'] ? $ticket[$k] : ''; +} + +// 3. Make sure all values are properly formatted for email +$ticket = hesk_ticketToPlain($info, 1, 0); + +/* Need to notify any staff? */ +/* --> From autoassign? */ +if ($need_to_reassign && ! empty($autoassign_owner['email']) ) +{ + hesk_notifyAssignedStaff($autoassign_owner, 'ticket_assigned_to_you', $modsForHesk_settings); +} +/* --> No autoassign, find and notify appropriate staff */ +elseif ( ! $ticket['owner'] ) +{ + hesk_notifyStaff('category_moved', "`notify_new_unassigned`='1' AND `id`!=".intval($_SESSION['id']), $modsForHesk_settings); +} + +/* Is the user allowed to view tickets in the new category? */ +if ($category_ok) +{ + /* Ticket has an owner */ + if ($ticket['owner']) + { + /* Staff is owner or can view tickets assigned to others */ + if ($ticket['owner'] == $_SESSION['id'] || hesk_checkPermission('can_view_ass_others',0) ) + { + hesk_process_messages($hesklang['moved_to'],'admin_ticket.php?track='.$trackingID.'&Refresh='.rand(10000,99999),'SUCCESS'); + } + else + { + hesk_process_messages($hesklang['moved_to'],'admin_main.php','SUCCESS'); + } + } + /* Ticket is unassigned, staff can view unassigned tickets */ + elseif (hesk_checkPermission('can_view_unassigned',0)) + { + hesk_process_messages($hesklang['moved_to'],'admin_ticket.php?track='.$trackingID.'&Refresh='.rand(10000,99999),'SUCCESS'); + } + /* Ticket is unassigned, staff cannot view unassigned tickets */ + else + { + hesk_process_messages($hesklang['moved_to'],'admin_main.php','SUCCESS'); + } +} +else +{ + hesk_process_messages($hesklang['moved_to'],'admin_main.php','SUCCESS'); +} +?> diff --git a/admin/new_ticket.php b/admin/new_ticket.php index 6b266304..6407df19 100644 --- a/admin/new_ticket.php +++ b/admin/new_ticket.php @@ -1,7 +1,7 @@ ' . $mysaved[1]. "\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"; + $theMessage = hesk_html_entity_decode($mysaved[2]); + $theMessage = addslashes($theMessage); + echo 'myMsgTxt['.$mysaved[0].']=\''.str_replace("\r\n","\\r\\n' + \r\n'", $theMessage)."';\n"; } else { echo 'myMsgTxt['.$mysaved[0].']=\''.str_replace("\r\n","\\r\\n' + \r\n'", addslashes($mysaved[2]))."';\n"; } diff --git a/admin/options.php b/admin/options.php index 9b2abe6b..9c4f155d 100644 --- a/admin/options.php +++ b/admin/options.php @@ -1,7 +1,7 @@ - .nu-rtlFloatLeft { /* Don't do anything; the pager looks good already */ } @@ -89,47 +69,6 @@ .navbar { margin-bottom: 0; } -.navbar-default { - background-color: ; - background-image: none; - filter: none; -} -.navbar-default .navbar-brand { - color: ; -} -.navbar-default .navbar-brand:focus, .navbar-default .navbar-brand:hover { - color: ; - background-color: transparent; -} -.navbar-default .navbar-nav>li>a { - color: ; -} -.navbar-default .navbar-nav>li>a:focus, .navbar-default .navbar-nav>li>a:hover { - color: ; - background-color: transparent; -} -.dropdown-menu>li>a { - color: ; -} -.dropdown-menu>li>a:focus, .dropdown-menu>li>a:hover { - color: ; - text-decoration: none; - background-color: ; -} -.navbar-default .navbar-nav>.open>a, .navbar-default .navbar-nav>.open>a:focus, .navbar-default .navbar-nav>.open>a:hover { - color: ; - background-color: ; - background-image: none; -} -.settingsquestionmark { - color: ; - font-size: 14px; - cursor: pointer; -} -.h3questionmark { - color: ; - font-size: 14px; -} .h3questionmark:hover { text-decoration: underline; } diff --git a/css/hesk_newStyleRTL.php b/css/hesk_newStyleRTL.css similarity index 70% rename from css/hesk_newStyleRTL.php rename to css/hesk_newStyleRTL.css index 86541710..661b83ba 100644 --- a/css/hesk_newStyleRTL.php +++ b/css/hesk_newStyleRTL.css @@ -1,23 +1,3 @@ - - .nu-rtlFloatLeft { float: left; } @@ -89,50 +69,9 @@ .navbar { margin-bottom: 0; } -.navbar-default { - background-color: ; - background-image: none; - filter: none; -} -.navbar-default .navbar-brand { - color: ; -} -.navbar-default .navbar-brand:focus, .navbar-default .navbar-brand:hover { - color: ; - background-color: transparent; -} -.navbar-default .navbar-nav>li>a { - color: ; -} -.navbar-default .navbar-nav>li>a:focus, .navbar-default .navbar-nav>li>a:hover { - color: ; - background-color: transparent; -} -.dropdown-menu>li>a { - color: ; -} -.dropdown-menu>li>a:focus, .dropdown-menu>li>a:hover { - color: ; - text-decoration: none; - background-color: ; -} -.navbar-default .navbar-nav>.open>a, .navbar-default .navbar-nav>.open>a:focus, .navbar-default .navbar-nav>.open>a:hover { - color: ; - background-color: ; - background-image: none; -} -.settingsquestionmark { - color: ; - font-size: 14px; - cursor: pointer; -} .settingsquestionmark:hover { text-decoration: underline; } -.h3questionmark { - color: ; - font-size: 14px; -} .h3questionmark:hover { text-decoration: underline; } diff --git a/download_attachment.php b/download_attachment.php index dab63c42..fb6483d1 100755 --- a/download_attachment.php +++ b/download_attachment.php @@ -1,7 +1,7 @@ 'modsForHeskVersion'"); + while ($row = hesk_dbFetchAssoc($res)) { + $settings[$row['Key']] = $row['Value']; + } + return $settings; } \ No newline at end of file diff --git a/inc/email_functions.inc.php b/inc/email_functions.inc.php index fc335c19..f2627b8c 100644 --- a/inc/email_functions.inc.php +++ b/inc/email_functions.inc.php @@ -1,7 +1,7 @@ @@ -42,7 +46,7 @@ require(HESK_PATH . 'modsForHesk_settings.inc.php'); <?php echo (isset($hesk_settings['tmp_title']) ? $hesk_settings['tmp_title'] : $hesk_settings['hesk_title']); ?> - + @@ -53,9 +57,9 @@ require(HESK_PATH . 'modsForHesk_settings.inc.php'); > - + - + @@ -70,6 +74,47 @@ require(HESK_PATH . 'modsForHesk_settings.inc.php'); + @@ -42,7 +43,7 @@ require(HESK_PATH . 'modsForHesk_settings.inc.php'); <?php echo (isset($hesk_settings['tmp_title']) ? $hesk_settings['tmp_title'] : $hesk_settings['hesk_title']); ?> - + @@ -53,9 +54,9 @@ require(HESK_PATH . 'modsForHesk_settings.inc.php'); > - + - + @@ -70,6 +71,47 @@ require(HESK_PATH . 'modsForHesk_settings.inc.php'); + If ticket is assigned just notify the owner if ($ticket['owner']) { - hesk_notifyAssignedStaff(false, 'new_reply_by_customer', 'notify_reply_my'); + $modsForHesk_settings = mfh_getSettings(); + hesk_notifyAssignedStaff(false, 'new_reply_by_customer', $modsForHesk_settings, 'notify_reply_my'); } // --> No owner assigned, find and notify appropriate staff else { - hesk_notifyStaff('new_reply_by_customer',"`notify_reply_unassigned`='1'"); + hesk_notifyStaff('new_reply_by_customer',"`notify_reply_unassigned`='1'", $modsForHesk_settings); } return $ticket['trackid']; @@ -363,7 +363,7 @@ function hesk_email2ticket($results, $pop3 = 0, $set_category = 1, $set_priority // SPAM tags not found or not checked, send email if ($possible_SPAM === false) { - hesk_notifyCustomer(); + hesk_notifyCustomer($modsForHesk_settings); } } @@ -371,12 +371,12 @@ function hesk_email2ticket($results, $pop3 = 0, $set_category = 1, $set_priority // --> From autoassign? if ($tmpvar['owner'] && $autoassign_owner['notify_assigned']) { - hesk_notifyAssignedStaff($autoassign_owner, 'ticket_assigned_to_you'); + hesk_notifyAssignedStaff($autoassign_owner, 'ticket_assigned_to_you', $modsForHesk_settings); } // --> No autoassign, find and notify appropriate staff elseif ( ! $tmpvar['owner'] ) { - hesk_notifyStaff('new_ticket_staff', " `notify_new_unassigned` = '1' "); + hesk_notifyStaff('new_ticket_staff', " `notify_new_unassigned` = '1' ", $modsForHesk_settings); } return $ticket['trackid']; diff --git a/inc/posting_functions.inc.php b/inc/posting_functions.inc.php index 6f1a2d09..6f6be248 100644 --- a/inc/posting_functions.inc.php +++ b/inc/posting_functions.inc.php @@ -1,7 +1,7 @@ '; /* Get e-mail message for customer */ - $msg = hesk_getEmailMessage('forgot_ticket_id','',0,0,1); + $msg = hesk_getEmailMessage('forgot_ticket_id','',$modsForHesk_settings,0,0,1); $msg = processEmail($msg, $name, $num, $tid_list); // Get HTML message for customer - $htmlMsg = hesk_getHtmlMessage('forgot_ticket_id','',0,0,1); + $htmlMsg = hesk_getHtmlMessage('forgot_ticket_id','', $modsForHesk_settings, 0,0,1); $htmlMsg = processEmail($htmlMsg, $name, $num, $html_tid_list); $subject = hesk_getEmailSubject('forgot_ticket_id'); /* Send e-mail */ - hesk_mail($email, $subject, $msg, $htmlMsg); + hesk_mail($email, $subject, $msg, $htmlMsg, $modsForHesk_settings); /* Show success message */ $tmp = ''.$hesklang['tid_sent'].'!'; diff --git a/install/install.php b/install/install.php index d84d00c7..439916e7 100644 --- a/install/install.php +++ b/install/install.php @@ -1,7 +1,7 @@ CREATE, ALTER, DROP Permissions: Please check before continuing!* - - - modsForHesk_settings.inc.php - - - > - Success'; - } else { - echo ' CHMOD to 0666, yours is '.$fileperm; - $allowInstallation = false; - } - ?> - - * Mods for HESK is unable to check database permissions automatically. @@ -137,6 +119,17 @@ hesk_dbConnect(); } ?>
+
+ + v2.4.1 +
v2.3.1
+
+
+
v2.3.0
-
-
-
v2.1.1
+
+
+
v2.1.0
-
-
-
v1.7.0
+
+
+
v1.6.1
-
-
-
v1.4.1
-
- v1.4.0 -

+
+ v1.4.0 +
v1.3.0
diff --git a/install/mods-for-hesk/sql/installSql.php b/install/mods-for-hesk/sql/installSql.php index 226575e9..29629970 100644 --- a/install/mods-for-hesk/sql/installSql.php +++ b/install/mods-for-hesk/sql/installSql.php @@ -676,4 +676,118 @@ $modsForHesk_settings[\'rich_text_for_tickets_for_customers\'] = 0;'; } return file_put_contents(HESK_PATH.'modsForHesk_settings.inc.php', $file); +} +// END Version 2.4.1 + +// Version 2.4.2 +function execute242Scripts() { + global $hesk_settings; + + hesk_dbConnect(); + + executeQuery("UPDATE `".hesk_dbEscape($hesk_settings['db_pfix'])."settings` SET `Value` = '2.4.2' WHERE `Key` = 'modsForHeskVersion'"); +} + +// BEGIN Version 2.5.0 +function migrateSettings() { + global $hesk_settings; + + if (file_exists(HESK_PATH . 'modsForHesk_settings.inc.php')) { + require_once(HESK_PATH . 'modsForHesk_settings.inc.php'); + + $rtl = getSettingValue($modsForHesk_settings, 'rtl', 0); + $show_icons = getSettingValue($modsForHesk_settings, 'show_icons', 0); + $custom_field_setting = getSettingValue($modsForHesk_settings, 'custom_field_setting', 0); + $customer_email_verification_required = getSettingValue($modsForHesk_settings, 'customer_email_verification_required', 0); + $html_emails = getSettingValue($modsForHesk_settings, 'html_emails', 1); + $use_mailgun = getSettingValue($modsForHesk_settings, 'use_mailgun', 0); + $mailgun_api_key = getSettingValue($modsForHesk_settings, 'mailgun_api_key', ''); + $mailgun_domain = getSettingValue($modsForHesk_settings, 'mailgun_domain', ''); + $use_bootstrap_theme = getSettingValue($modsForHesk_settings, 'use_bootstrap_theme', 1); + $new_kb_article_visibility = getSettingValue($modsForHesk_settings, 'new_kb_article_visibility', 0); + $attachments = getSettingValue($modsForHesk_settings, 'attachments', 0); + $show_number_merged = getSettingValue($modsForHesk_settings, 'show_number_merged', 1); + $request_location = getSettingValue($modsForHesk_settings, 'request_location', 0); + $category_order_column = getSettingValue($modsForHesk_settings, 'category_order_column', 'cat_order'); + $rich_text_for_tickets = getSettingValue($modsForHesk_settings, 'rich_text_for_tickets', 0); + $statuses_order_column = getSettingValue($modsForHesk_settings, 'statuses_order_column', 'sort'); + $kb_attach_dir = getSettingValue($modsForHesk_settings, 'kb_attach_dir', 'attachments'); + $rich_text_for_tickets_for_customers = getSettingValue($modsForHesk_settings, 'rich_text_for_tickets_for_customers', 0); + + $navbar_background_color = getSettingValue($modsForHesk_settings, 'navbarBackgroundColor', '#414a5c'); + $navbar_brand_color = getSettingValue($modsForHesk_settings, 'navbarBrandColor', '#d4dee7'); + $navbar_brand_hover_color = getSettingValue($modsForHesk_settings, 'navbarBrandHoverColor', '#ffffff'); + $navbar_item_text_color = getSettingValue($modsForHesk_settings, 'navbarItemTextColor', '#d4dee7'); + $navbar_item_text_hover_color = getSettingValue($modsForHesk_settings, 'navbarItemTextHoverColor', '#ffffff'); + $navbar_item_text_selected_color = getSettingValue($modsForHesk_settings, 'navbarItemTextSelectedColor', '#ffffff'); + $navbar_item_selected_background_color = getSettingValue($modsForHesk_settings, 'navbarItemSelectedBackgroundColor', '#2d3646'); + $dropdown_item_text_color = getSettingValue($modsForHesk_settings, 'dropdownItemTextColor', '#333333'); + $dropdown_item_text_hover_color = getSettingValue($modsForHesk_settings, 'dropdownItemTextHoverColor', '#262626'); + $dropdown_item_text_hover_background_color = getSettingValue($modsForHesk_settings, 'dropdownItemTextHoverBackgroundColor', '#f5f5f5'); + $question_mark_color = getSettingValue($modsForHesk_settings, 'questionMarkColor', '#000000'); + + + executeQuery("INSERT INTO `".hesk_dbEscape($hesk_settings['db_pfix'])."settings` (`Key`, `Value`) + VALUES ('rtl', ".intval($rtl).")"); + executeQuery("INSERT INTO `".hesk_dbEscape($hesk_settings['db_pfix'])."settings` (`Key`, `Value`) + VALUES ('show_icons', ".intval($show_icons).")"); + executeQuery("INSERT INTO `".hesk_dbEscape($hesk_settings['db_pfix'])."settings` (`Key`, `Value`) + VALUES ('custom_field_setting', ".intval($custom_field_setting).")"); + executeQuery("INSERT INTO `".hesk_dbEscape($hesk_settings['db_pfix'])."settings` (`Key`, `Value`) + VALUES ('customer_email_verification_required', ".intval($customer_email_verification_required).")"); + executeQuery("INSERT INTO `".hesk_dbEscape($hesk_settings['db_pfix'])."settings` (`Key`, `Value`) + VALUES ('html_emails', ".intval($html_emails).")"); + executeQuery("INSERT INTO `".hesk_dbEscape($hesk_settings['db_pfix'])."settings` (`Key`, `Value`) + VALUES ('use_mailgun', ".intval($use_mailgun).")"); + executeQuery("INSERT INTO `".hesk_dbEscape($hesk_settings['db_pfix'])."settings` (`Key`, `Value`) + VALUES ('mailgun_api_key', '".hesk_dbEscape($mailgun_api_key)."')"); + executeQuery("INSERT INTO `".hesk_dbEscape($hesk_settings['db_pfix'])."settings` (`Key`, `Value`) + VALUES ('mailgun_domain', '".hesk_dbEscape($mailgun_domain)."')"); + executeQuery("INSERT INTO `".hesk_dbEscape($hesk_settings['db_pfix'])."settings` (`Key`, `Value`) + VALUES ('use_bootstrap_theme', ".intval($use_bootstrap_theme).")"); + executeQuery("INSERT INTO `".hesk_dbEscape($hesk_settings['db_pfix'])."settings` (`Key`, `Value`) + VALUES ('new_kb_article_visibility', ".intval($new_kb_article_visibility).")"); + executeQuery("INSERT INTO `".hesk_dbEscape($hesk_settings['db_pfix'])."settings` (`Key`, `Value`) + VALUES ('attachments', ".intval($attachments).")"); + executeQuery("INSERT INTO `".hesk_dbEscape($hesk_settings['db_pfix'])."settings` (`Key`, `Value`) + VALUES ('show_number_merged', ".intval($show_number_merged).")"); + executeQuery("INSERT INTO `".hesk_dbEscape($hesk_settings['db_pfix'])."settings` (`Key`, `Value`) + VALUES ('request_location', ".intval($request_location).")"); + executeQuery("INSERT INTO `".hesk_dbEscape($hesk_settings['db_pfix'])."settings` (`Key`, `Value`) + VALUES ('category_order_column', '".hesk_dbEscape($category_order_column)."')"); + executeQuery("INSERT INTO `".hesk_dbEscape($hesk_settings['db_pfix'])."settings` (`Key`, `Value`) + VALUES ('rich_text_for_tickets', ".intval($rich_text_for_tickets).")"); + executeQuery("INSERT INTO `".hesk_dbEscape($hesk_settings['db_pfix'])."settings` (`Key`, `Value`) + VALUES ('statuses_order_column', '".hesk_dbEscape($statuses_order_column)."')"); + executeQuery("INSERT INTO `".hesk_dbEscape($hesk_settings['db_pfix'])."settings` (`Key`, `Value`) + VALUES ('kb_attach_dir', '".hesk_dbEscape($kb_attach_dir)."')"); + executeQuery("INSERT INTO `".hesk_dbEscape($hesk_settings['db_pfix'])."settings` (`Key`, `Value`) + VALUES ('rich_text_for_tickets_for_customers', ".intval($rich_text_for_tickets_for_customers).")"); + executeQuery("INSERT INTO `".hesk_dbEscape($hesk_settings['db_pfix'])."settings` (`Key`, `Value`) + VALUES ('navbarBackgroundColor', '".hesk_dbEscape($navbar_background_color)."')"); + executeQuery("INSERT INTO `".hesk_dbEscape($hesk_settings['db_pfix'])."settings` (`Key`, `Value`) + VALUES ('navbarBrandColor', '".hesk_dbEscape($navbar_brand_color)."')"); + executeQuery("INSERT INTO `".hesk_dbEscape($hesk_settings['db_pfix'])."settings` (`Key`, `Value`) + VALUES ('navbarBrandHoverColor', '".hesk_dbEscape($navbar_brand_hover_color)."')"); + executeQuery("INSERT INTO `".hesk_dbEscape($hesk_settings['db_pfix'])."settings` (`Key`, `Value`) + VALUES ('navbarItemTextColor', '".hesk_dbEscape($navbar_item_text_color)."')"); + executeQuery("INSERT INTO `".hesk_dbEscape($hesk_settings['db_pfix'])."settings` (`Key`, `Value`) + VALUES ('navbarItemTextHoverColor', '".hesk_dbEscape($navbar_item_text_hover_color)."')"); + executeQuery("INSERT INTO `".hesk_dbEscape($hesk_settings['db_pfix'])."settings` (`Key`, `Value`) + VALUES ('navbarItemTextSelectedColor', '".hesk_dbEscape($navbar_item_text_selected_color)."')"); + executeQuery("INSERT INTO `".hesk_dbEscape($hesk_settings['db_pfix'])."settings` (`Key`, `Value`) + VALUES ('navbarItemSelectedBackgroundColor', '".hesk_dbEscape($navbar_item_selected_background_color)."')"); + executeQuery("INSERT INTO `".hesk_dbEscape($hesk_settings['db_pfix'])."settings` (`Key`, `Value`) + VALUES ('dropdownItemTextColor', '".hesk_dbEscape($dropdown_item_text_color)."')"); + executeQuery("INSERT INTO `".hesk_dbEscape($hesk_settings['db_pfix'])."settings` (`Key`, `Value`) + VALUES ('dropdownItemTextHoverColor', '".hesk_dbEscape($dropdown_item_text_hover_color)."')"); + executeQuery("INSERT INTO `".hesk_dbEscape($hesk_settings['db_pfix'])."settings` (`Key`, `Value`) + VALUES ('dropdownItemTextHoverBackgroundColor', '".hesk_dbEscape($dropdown_item_text_hover_background_color)."')"); + executeQuery("INSERT INTO `".hesk_dbEscape($hesk_settings['db_pfix'])."settings` (`Key`, `Value`) + VALUES ('questionMarkColor', '".hesk_dbEscape($question_mark_color)."')"); + } +} + +function getSettingValue($settings, $setting, $default) { + return isset($settings[$setting]) ? $settings[$setting] : $default; } \ No newline at end of file diff --git a/knowledgebase.php b/knowledgebase.php index 7fd2d310..4cbc3afd 100644 --- a/knowledgebase.php +++ b/knowledgebase.php @@ -1,7 +1,7 @@ diff --git a/reply_ticket.php b/reply_ticket.php index 435a345b..f0d4f1d4 100644 --- a/reply_ticket.php +++ b/reply_ticket.php @@ -1,7 +1,7 @@ NOW() LIMIT 1"); if (hesk_dbNumRows($res) == 1) @@ -205,6 +204,7 @@ $ticket['status'] = $ticket['status'] == $defaultNewTicketStatus['ID'] ? $defaul $res = hesk_dbQuery("UPDATE `".hesk_dbEscape($hesk_settings['db_pfix'])."tickets` SET `lastchange`=NOW(), `status`='{$ticket['status']}', `replies`=`replies`+1, `lastreplier`='0' WHERE `id`='{$ticket['id']}' LIMIT 1"); // Insert reply into database +$modsForHesk_settings = mfh_getSettings(); $html = $modsForHesk_settings['rich_text_for_tickets_for_customers']; hesk_dbQuery("INSERT INTO `".hesk_dbEscape($hesk_settings['db_pfix'])."replies` (`replyto`,`name`,`message`,`dt`,`attachments`, `html`) VALUES ({$ticket['id']},'".hesk_dbEscape($ticket['name'])."','".hesk_dbEscape($message)."',NOW(),'".hesk_dbEscape($myattachments)."','".$html."')"); @@ -243,12 +243,12 @@ $ticket = hesk_ticketToPlain($info, 1, 0); // --> If ticket is assigned just notify the owner if ($ticket['owner']) { - hesk_notifyAssignedStaff(false, 'new_reply_by_customer', 'notify_reply_my'); + hesk_notifyAssignedStaff(false, 'new_reply_by_customer', $modsForHesk_settings, 'notify_reply_my'); } // --> No owner assigned, find and notify appropriate staff else { - hesk_notifyStaff('new_reply_by_customer',"`notify_reply_unassigned`='1'"); + hesk_notifyStaff('new_reply_by_customer',"`notify_reply_unassigned`='1'", $modsForHesk_settings); } /* Clear unneeded session variables */ diff --git a/submit_ticket.php b/submit_ticket.php index 5eedc331..9a763cea 100644 --- a/submit_ticket.php +++ b/submit_ticket.php @@ -1,7 +1,7 @@ $v) { if ($v['use']) @@ -412,8 +412,10 @@ if (count($hesk_error_buffer)) hesk_process_messages($hesk_error_buffer, 'index.php?a=add'); } -$tmpvar['message']=hesk_makeURL($tmpvar['message']); -$tmpvar['message']=nl2br($tmpvar['message']); +if (!$modsForHesk_settings['rich_text_for_tickets_for_customers']) { + $tmpvar['message']=hesk_makeURL($tmpvar['message']); + $tmpvar['message']=nl2br($tmpvar['message']); +} // Track suggested knowledgebase articles if ($hesk_settings['kb_enable'] && $hesk_settings['kb_recommendanswers'] && isset($_POST['suggested']) && is_array($_POST['suggested']) ) @@ -470,7 +472,7 @@ if ($modsForHesk_settings['customer_email_verification_required']) hesk_dbQuery("INSERT INTO `".hesk_dbEscape($hesk_settings['db_pfix'])."pending_verification_emails` (`Email`, `ActivationKey`) VALUES ('".$escapedEmail."', '".$escapedKey."')"); - hesk_notifyCustomerForVerifyEmail('verify_email', $key); + hesk_notifyCustomerForVerifyEmail('verify_email', $key, $modsForHesk_settings); $createTicket = false; } } @@ -482,19 +484,19 @@ if ($createTicket) // Notify the customer if ($hesk_settings['notify_new']) { - hesk_notifyCustomer(); + hesk_notifyCustomer($modsForHesk_settings); } // Need to notify staff? // --> From autoassign? if ($tmpvar['owner'] && $autoassign_owner['notify_assigned']) { - hesk_notifyAssignedStaff($autoassign_owner, 'ticket_assigned_to_you'); + hesk_notifyAssignedStaff($autoassign_owner, 'ticket_assigned_to_you', $modsForHesk_settings); } // --> No autoassign, find and notify appropriate staff elseif ( ! $tmpvar['owner'] ) { - hesk_notifyStaff('new_ticket_staff', " `notify_new_unassigned` = '1' "); + hesk_notifyStaff('new_ticket_staff', " `notify_new_unassigned` = '1' ", $modsForHesk_settings); } } diff --git a/suggest_articles.php b/suggest_articles.php index e9d49710..df3447bc 100644 --- a/suggest_articles.php +++ b/suggest_articles.php @@ -1,7 +1,7 @@ From autoassign? @@ -54,12 +54,12 @@ require_once(HESK_PATH . 'inc/header.inc.php'); $autoassign_owner = $getOwnerRs->fetch_assoc(); if ($ticket['owner'] && $autoassign_owner['notify_assigned']) { - hesk_notifyAssignedStaff($autoassign_owner, 'ticket_assigned_to_you'); + hesk_notifyAssignedStaff($autoassign_owner, 'ticket_assigned_to_you', $modsForHesk_settings); } // --> No autoassign, find and notify appropriate staff elseif ( ! $ticket['owner'] ) { - hesk_notifyStaff('new_ticket_staff', " `notify_new_unassigned` = '1' "); + hesk_notifyStaff('new_ticket_staff', " `notify_new_unassigned` = '1' ", $modsForHesk_settings); } array_push($submittedTickets, $innerResult['trackid']);