From 9e43cc20e1adf929225bb368c684fb5060560327 Mon Sep 17 00:00:00 2001 From: Mike Koch Date: Mon, 6 Apr 2015 17:11:22 -0400 Subject: [PATCH 1/8] Got started on the email templates page. Nothing fancy --- admin/manage_email_templates.php | 92 ++++++++++++++++++++++++++++++++ language/en/text.php | 4 ++ 2 files changed, 96 insertions(+) create mode 100644 admin/manage_email_templates.php diff --git a/admin/manage_email_templates.php b/admin/manage_email_templates.php new file mode 100644 index 00000000..3e8dbad9 --- /dev/null +++ b/admin/manage_email_templates.php @@ -0,0 +1,92 @@ + + +
+ +
+ +
+
\ No newline at end of file diff --git a/language/en/text.php b/language/en/text.php index cf5de85e..fde4cf83 100644 --- a/language/en/text.php +++ b/language/en/text.php @@ -21,6 +21,10 @@ $hesklang['_COLLATE']='utf8_unicode_ci'; // This is the email break line that will be used in email piping $hesklang['EMAIL_HR']='------ Reply above this line ------'; +// ADDED OR MODIFIED IN Mods for HESK 2.2.0 +$hesklang['email_templates'] = 'Email templates'; +$hesklang['email_templates_intro'] = 'You can edit your plaintext and HTML email templates here.'; + // ADDED OR MODIFIED IN Mods for HESK 2.1.1 $hesklang['new_article_default_type'] = 'Default Type for New Articles'; $hesklang['new_article_default_type_help'] = 'Choose the default type for new knowledgebase articles.'; From bc2f2a67a5753539c9ba9b9707bdf62b149aa228 Mon Sep 17 00:00:00 2001 From: Mike Koch Date: Mon, 6 Apr 2015 21:16:32 -0400 Subject: [PATCH 2/8] Add some more to email templates --- admin/manage_email_templates.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/admin/manage_email_templates.php b/admin/manage_email_templates.php index 3e8dbad9..199f3378 100644 --- a/admin/manage_email_templates.php +++ b/admin/manage_email_templates.php @@ -87,6 +87,15 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
- +
+
+

+ + +
+
\ No newline at end of file From 89efb15cd01103c827c513ae3cfdf1400be3b615 Mon Sep 17 00:00:00 2001 From: Mike Koch Date: Mon, 6 Apr 2015 22:25:09 -0400 Subject: [PATCH 3/8] #169 Now able to dump list of template files and add links for HTML/plaintext --- admin/manage_email_templates.php | 95 ++++++++++++++++++++------------ language/en/text.php | 2 + 2 files changed, 63 insertions(+), 34 deletions(-) diff --git a/admin/manage_email_templates.php b/admin/manage_email_templates.php index 199f3378..1603ba16 100644 --- a/admin/manage_email_templates.php +++ b/admin/manage_email_templates.php @@ -1,36 +1,4 @@
-
+


$value) { + $languages[$key] = $hesk_settings['languages'][$key]['folder']; + } + + // Get all files, but don't worry about index.htm, .., ., or the html folder as we'll assume they both exist + // We'll also assume the template file exists in all language folders + reset($languages); + $firstKey = key($languages); + $firstDirectory = HESK_PATH . 'language/'.$languages[$firstKey].'/emails'; + $directoryListing = preg_grep('/^([^.])/', scandir($firstDirectory)); + $emailTemplates = array_diff($directoryListing, array('html', 'index.htm')); + ?> + + + + + $value): ?> + + + + + + + + + + + + +
+ +
+
-
\ No newline at end of file + + +'; + } else { + $link = sprintf($linkPlaintext, $languageCode, $template); + return + ''; + } + } \ No newline at end of file diff --git a/language/en/text.php b/language/en/text.php index fde4cf83..d39acb6f 100644 --- a/language/en/text.php +++ b/language/en/text.php @@ -24,6 +24,8 @@ $hesklang['EMAIL_HR']='------ Reply above this line ------'; // ADDED OR MODIFIED IN Mods for HESK 2.2.0 $hesklang['email_templates'] = 'Email templates'; $hesklang['email_templates_intro'] = 'You can edit your plaintext and HTML email templates here.'; +$hesklang['edit_plain_text_template'] = 'Edit plain text template'; +$hesklang['edit_html_template'] = 'Edit HTML template'; // ADDED OR MODIFIED IN Mods for HESK 2.1.1 $hesklang['new_article_default_type'] = 'Default Type for New Articles'; From 685bf6b008116a5a6b2e816beec0dbb377a6067e Mon Sep 17 00:00:00 2001 From: Mike Koch Date: Tue, 7 Apr 2015 00:04:41 -0400 Subject: [PATCH 4/8] #169 In a somewhat broken state. Can't use modals due to TinyMCE not wanting to resize inside of a modal. --- admin/manage_email_templates.php | 117 +++++++++++++++++++++++++------ language/en/text.php | 2 + 2 files changed, 97 insertions(+), 22 deletions(-) diff --git a/admin/manage_email_templates.php b/admin/manage_email_templates.php index 1603ba16..e51b95b9 100644 --- a/admin/manage_email_templates.php +++ b/admin/manage_email_templates.php @@ -15,9 +15,32 @@ hesk_isLoggedIn(); // TODO Check permissions for this feature +define('WYSIWYG',1); /* Print header */ require_once(HESK_PATH . 'inc/headerAdmin.inc.php'); +if ($modsForHesk_settings['html_emails']) { + echo ''; +} + /* Print main manage users page */ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php'); ?> @@ -57,7 +80,6 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
-

- -
+ + '; - } else { - $link = sprintf($linkPlaintext, $languageCode, $template); - return - ''; - } - } \ No newline at end of file +require_once(HESK_PATH . 'inc/footer.inc.php'); +exit(); + +function getTemplateMarkup($template, $languageCode, $html = false) { + global $hesklang; + + $templateId = str_replace('.', '-', $template); + $templateId = str_replace(' ', '-', $templateId); + $languageCodeId = str_replace('.', '-', $languageCode); + $languageCodeId = str_replace(' ', '-', $languageCodeId); + if ($html) { + $markup = ''; + $markup .= ''; + $markup .= ''; + return $markup; + } else { + $markup = ''; + $markup .= ''; + $markup .= ''; + return $markup; + } +} + +function getModalMarkup($template, $languageCode, $html = false) { + global $hesklang; + + $templateId = str_replace('.', '-', $template); + $templateId = str_replace(' ', '-', $templateId); + $languageCodeId = str_replace('.', '-', $languageCode); + $languageCodeId = str_replace(' ', '-', $languageCodeId); + $id = 'modal-html-'.$languageCodeId.'-'.$templateId; + $class = ''; + + if ($html) { + $title = sprintf($hesklang['editing_html_template'], $template); + $content = file_get_contents(HESK_PATH . 'language/'.$languageCode.'/emails/html/'.$template); + $class = 'htmlEditor'; + } else { + $id = str_replace('html-', '', $id); + $title = sprintf($hesklang['editing_template'], $template); + $content = file_get_contents(HESK_PATH . 'language/'.$languageCode.'/emails/'.$template); + } + return ' + '; +} \ No newline at end of file diff --git a/language/en/text.php b/language/en/text.php index d39acb6f..b202aa23 100644 --- a/language/en/text.php +++ b/language/en/text.php @@ -26,6 +26,8 @@ $hesklang['email_templates'] = 'Email templates'; $hesklang['email_templates_intro'] = 'You can edit your plaintext and HTML email templates here.'; $hesklang['edit_plain_text_template'] = 'Edit plain text template'; $hesklang['edit_html_template'] = 'Edit HTML template'; +$hesklang['editing_template'] = 'Editing plain text template %s'; // %s: The name of the template file (XXXX.txt) +$hesklang['editing_html_template'] = 'Editing HTML template %s'; // %s: The name of the template file // ADDED OR MODIFIED IN Mods for HESK 2.1.1 $hesklang['new_article_default_type'] = 'Default Type for New Articles'; From 5b68f5f9264afc893adafd3f14a5b22f6fc5d451 Mon Sep 17 00:00:00 2001 From: Mike Koch Date: Tue, 7 Apr 2015 22:23:28 -0400 Subject: [PATCH 5/8] Can now edit and save email templates :grinning: --- admin/manage_email_templates.php | 197 ++++++++++++++++----- css/hesk_newStyle.php | 4 + language/en/emails/html/category_moved.txt | 11 +- language/en/text.php | 21 ++- 4 files changed, 177 insertions(+), 56 deletions(-) diff --git a/admin/manage_email_templates.php b/admin/manage_email_templates.php index e51b95b9..1a5baae2 100644 --- a/admin/manage_email_templates.php +++ b/admin/manage_email_templates.php @@ -16,6 +16,21 @@ hesk_isLoggedIn(); // TODO Check permissions for this feature define('WYSIWYG',1); + +// Are we performing an action? +$showEditPanel = false; +if (isset($_GET['action'])) { + if ($_GET['action'] == 'edit') { + $showEditPanel = true; + } +} + +// Are we saving? +if (isset($_POST['action'])) { + if ($_POST['action'] == 'save') { + save(); + } +} /* Print header */ require_once(HESK_PATH . 'inc/headerAdmin.inc.php'); @@ -78,6 +93,90 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
+ +
+
+
+
+

+ +

+
+
+ + + + + +
+ + + + + +
+ +

'.sprintf($hesklang['email_template_directory_not_writable'], $_GET['template']).'

+
'; + } else { + echo ''; + } + ?> + +
+
+
+
+
- $value): ?> - + $languageCode): ?> + @@ -113,15 +212,17 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php'); + $languageCode): ?> + @@ -130,13 +231,6 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
- - '; + $markup = ''; $markup .= ''; $markup .= ''; return $markup; } else { - $markup = ''; + $markup = ''; $markup .= ''; $markup .= ''; return $markup; } } -function getModalMarkup($template, $languageCode, $html = false) { +function save() { global $hesklang; - $templateId = str_replace('.', '-', $template); - $templateId = str_replace(' ', '-', $templateId); - $languageCodeId = str_replace('.', '-', $languageCode); - $languageCodeId = str_replace(' ', '-', $languageCodeId); - $id = 'modal-html-'.$languageCodeId.'-'.$templateId; - $class = ''; + $filePath = HESK_PATH . 'language/'.$_POST['language'].'/emails/'.$_POST['template']; + if ($_POST['html'] == '1') { + $filePath = HESK_PATH . 'language/'.$_POST['language'].'/emails/html/'.$_POST['template']; + } - if ($html) { - $title = sprintf($hesklang['editing_html_template'], $template); - $content = file_get_contents(HESK_PATH . 'language/'.$languageCode.'/emails/html/'.$template); - $class = 'htmlEditor'; + $success = file_put_contents($filePath, $_POST['text']); + if ($success === false) { + hesk_process_messages($hesklang[''], 'manage_email_templates.php'); } else { - $id = str_replace('html-', '', $id); - $title = sprintf($hesklang['editing_template'], $template); - $content = file_get_contents(HESK_PATH . 'language/'.$languageCode.'/emails/'.$template); + $message = sprintf($hesklang['email_template_saved'], $_POST['template']); + hesk_process_messages($message,'manage_email_templates.php','SUCCESS'); } - return ' - '; +} + +function getSpecialTagMap() { + global $hesk_settings, $modsForHesk_settings, $hesklang; + + $map = array(); + $map['%%NAME%%'] = $hesklang['customer_name']; + $map['%%EMAIL%%'] = $hesklang['customer_email']; + $map['%%SUBJECT%%'] = $hesklang['ticket_subject']; + $map['%%MESSAGE%%'] = $hesklang['ticket_message']; + $map['%%CREATED%%'] = $hesklang['ticket_created']; + $map['%%UPDATED%%'] = $hesklang['ticket_updated']; + $map['%%TRACK_ID%%'] = $hesklang['ticket_trackID']; + $map['%%TRACK_URL%%'] = $hesklang['ticket_url']; + $map['%%SITE_TITLE%%'] = $hesklang['wbst_title']; + $map['%%SITE_URL%%'] = $hesklang['wbst_url']; + $map['%%CATEGORY%%'] = $hesklang['ticket_category']; + $map['%%OWNER%%'] = $hesklang['ticket_owner']; + $map['%%PRIORITY%%'] = $hesklang['ticket_priority']; + $map['%%STATUS%%'] = $hesklang['ticket_status']; + + $i = 1; + foreach ($hesk_settings['custom_fields'] as $key => $value) { + if ($value['use']) { + $uppercaseKey = strtoupper($key); + $map['%%'.$uppercaseKey.'%%'] = sprintf($hesklang['custom_field_x'], $i++); + } + } + + return $map; } \ No newline at end of file diff --git a/css/hesk_newStyle.php b/css/hesk_newStyle.php index ce577fcc..adda1d59 100644 --- a/css/hesk_newStyle.php +++ b/css/hesk_newStyle.php @@ -390,3 +390,7 @@ button.dropdown-submit { max-width: 80px; cursor: pointer; } + +.plaintext-editor { + font-family: monospace; +} diff --git a/language/en/emails/html/category_moved.txt b/language/en/emails/html/category_moved.txt index a2d87b36..8f254ac9 100644 --- a/language/en/emails/html/category_moved.txt +++ b/language/en/emails/html/category_moved.txt @@ -1,10 +1,7 @@

Hello,

A new support ticket has been moved to your category. Ticket details:

-

Ticket subject: %%SUBJECT%%
-Tracking ID: %%TRACK_ID%%

-

You can manage this ticket here: -%%TRACK_URL%%

-
+

Ticket subject: %%SUBJECT%%
Tracking ID: %%TRACK_ID%%

+

You can manage this ticket here: %%TRACK_URL%%

+

 

Regards,

-%%SITE_TITLE%%
-%%SITE_URL%% \ No newline at end of file +

%%SITE_TITLE%%
%%SITE_URL%%

\ No newline at end of file diff --git a/language/en/text.php b/language/en/text.php index b202aa23..2eb3537b 100644 --- a/language/en/text.php +++ b/language/en/text.php @@ -26,8 +26,27 @@ $hesklang['email_templates'] = 'Email templates'; $hesklang['email_templates_intro'] = 'You can edit your plaintext and HTML email templates here.'; $hesklang['edit_plain_text_template'] = 'Edit plain text template'; $hesklang['edit_html_template'] = 'Edit HTML template'; -$hesklang['editing_template'] = 'Editing plain text template %s'; // %s: The name of the template file (XXXX.txt) +$hesklang['editing_plain_text_template'] = 'Editing plain text template %s'; // %s: The name of the template file (XXXX.txt) $hesklang['editing_html_template'] = 'Editing HTML template %s'; // %s: The name of the template file +$hesklang['show_special_tags'] = 'Show Special Tags'; +$hesklang['hide_special_tags'] = 'Hide Special Tags'; +$hesklang['special_tag'] = 'Special Tag'; +$hesklang['description'] = 'Description'; +$hesklang['customer_name'] = 'Customer name'; +$hesklang['customer_email'] = 'Customer email'; +$hesklang['ticket_subject'] = 'Ticket subject'; +$hesklang['ticket_message'] = 'Ticket/Reply message'; +$hesklang['ticket_created'] = 'Date and time of ticket submission'; +$hesklang['ticket_updated'] = 'Date and time of ticket last update'; +$hesklang['ticket_url'] = 'Ticket URL address'; +$hesklang['ticket_category'] = 'Ticket category'; +$hesklang['ticket_owner'] = 'Staff member assigned to the ticket'; +$hesklang['ticket_priority'] = 'Ticket priority'; +$hesklang['custom_field_x'] = 'Custom field %s'; // %s: Custom field #1-20 +$hesklang['email_template_saved'] = 'The email template %s has been saved.'; // %s: Template file name +$hesklang['error_saving_template'] = 'An error occurred when trying to save the email template!'; +$hesklang['email_template_directory_not_writable'] = 'The email template %s is not writable by HESK. Please CHMOD it to 0666.'; // %s: template file name + // ADDED OR MODIFIED IN Mods for HESK 2.1.1 $hesklang['new_article_default_type'] = 'Default Type for New Articles'; From 570ab0e54fe874ce9e2459cbe2693bc2df58c000 Mon Sep 17 00:00:00 2001 From: Mike Koch Date: Wed, 8 Apr 2015 11:41:43 -0400 Subject: [PATCH 6/8] #169 Add can_manage_email_template permission --- admin/manage_email_templates.php | 2 +- inc/admin_functions.inc.php | 12 ++++++++++++ install/mods-for-hesk/sql/installSql.php | 17 ++++++++++++++--- install/mods-for-hesk/sql/uninstallSql.php | 8 ++++++++ language/en/text.php | 4 ++-- 5 files changed, 37 insertions(+), 6 deletions(-) diff --git a/admin/manage_email_templates.php b/admin/manage_email_templates.php index 1a5baae2..4ba41202 100644 --- a/admin/manage_email_templates.php +++ b/admin/manage_email_templates.php @@ -13,7 +13,7 @@ hesk_session_start(); hesk_dbConnect(); hesk_isLoggedIn(); -// TODO Check permissions for this feature +hesk_checkPermission('can_manage_email_templates'); define('WYSIWYG',1); diff --git a/inc/admin_functions.inc.php b/inc/admin_functions.inc.php index 3f5a022d..3cdac183 100644 --- a/inc/admin_functions.inc.php +++ b/inc/admin_functions.inc.php @@ -735,6 +735,18 @@ function hesk_checkPermission($feature,$showerror=1) { return true; } + if ($feature == 'can_manage_email_templates') { + if ($_SESSION['can_manage_email_templates']) { + return true; + } else { + if ($showerror) { + hesk_error($hesklang['no_permission'].'

 

'.$hesklang['click_login'].''); + } else { + return false; + } + } + } + /* Check other staff for permissions */ if (strpos($_SESSION['heskprivileges'], $feature) === false) { diff --git a/install/mods-for-hesk/sql/installSql.php b/install/mods-for-hesk/sql/installSql.php index a38e4f60..4f6245c8 100644 --- a/install/mods-for-hesk/sql/installSql.php +++ b/install/mods-for-hesk/sql/installSql.php @@ -337,8 +337,8 @@ function execute210Scripts() { executeQuery("UPDATE `".hesk_dbEscape($hesk_settings['db_pfix'])."settings` SET `Value` = '2.1.0' WHERE `Key` = 'modsForHeskVersion'"); // Some old tables may not have been dropped during the 2.0.0 upgrade. Check and drop if necessary - executeQuery("DROP TABLE IF EXISTS `".hesk_dbEscape($hesk['db_pfix'])."denied_ips`"); - executeQuery("DROP TABLE IF EXISTS `".hesk_dbEscape($hesk['db_pfix'])."denied_emails`"); + executeQuery("DROP TABLE IF EXISTS `".hesk_dbEscape($hesk_settings['db_pfix'])."denied_ips`"); + executeQuery("DROP TABLE IF EXISTS `".hesk_dbEscape($hesk_settings['db_pfix'])."denied_emails`"); } function execute210FileUpdate() { @@ -395,4 +395,15 @@ $modsForHesk_settings[\'new_kb_article_visibility\'] = 0;'; return file_put_contents(HESK_PATH.'modsForHesk_settings.inc.php', $file); } -// END Version 2.1.1 \ No newline at end of file +// END Version 2.1.1 + +// BEGIN Version 2.2.0 +function execute220Scripts() { + global $hesk_settings; + + hesk_dbConnect(); + + executeQuery("ALTER TABLE `".hesk_dbEscape($hesk_settings['db_pfix'])."users` ADD COLUMN `can_manage_email_templates` ENUM('0','1') NOT NULL DEFAULT '0'"); + executeQuery("UPDATE `".hesk_dbEscape($hesk_settings['db_pfix'])."users` SET `can_manage_email_templates` = '1' WHERE `isadmin` = '1'"); + executeQuery("UPDATE `".hesk_dbEscape($hesk_settings['db_pfix'])."settings` SET `Value` = '2.2.0' WHERE `Key` = 'modsForHeskVersion'"); +} \ 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..471edb31 100644 --- a/install/mods-for-hesk/sql/uninstallSql.php +++ b/install/mods-for-hesk/sql/uninstallSql.php @@ -136,4 +136,12 @@ function executeMiscellaneousSql() { // These queries are ran in case someone used an unfortunate installation they may have not properly cleaned up tables executeQuery('DROP TABLE IF EXISTS `'.hesk_dbEscape($hesk_settings['db_pfix']).'denied_ips`'); executeQuery('DROP TABLE IF EXISTS `'.hesk_dbEscape($hesk_settings['db_pfix']).'denied_emails`'); +} + +function removeEmailTemplatePermission() { + global $hesk_settings; + + hesk_dbConnect(); + + executeQuery("ALTER TABLE `".hesk_dbEscape($hesk_settings['db_pfix'])."users` DROP COLUMN `can_manage_email_templates`"); } \ No newline at end of file diff --git a/language/en/text.php b/language/en/text.php index 2eb3537b..301f2e38 100644 --- a/language/en/text.php +++ b/language/en/text.php @@ -26,8 +26,8 @@ $hesklang['email_templates'] = 'Email templates'; $hesklang['email_templates_intro'] = 'You can edit your plaintext and HTML email templates here.'; $hesklang['edit_plain_text_template'] = 'Edit plain text template'; $hesklang['edit_html_template'] = 'Edit HTML template'; -$hesklang['editing_plain_text_template'] = 'Editing plain text template %s'; // %s: The name of the template file (XXXX.txt) -$hesklang['editing_html_template'] = 'Editing HTML template %s'; // %s: The name of the template file +$hesklang['editing_plain_text_template'] = 'Editing plain text template %s'; // %s: The name of the template file, then language name +$hesklang['editing_html_template'] = 'Editing HTML template %s'; // %s: The name of the template file, then language name $hesklang['show_special_tags'] = 'Show Special Tags'; $hesklang['hide_special_tags'] = 'Hide Special Tags'; $hesklang['special_tag'] = 'Special Tag'; From 61fed97bfe858e12a34f7887651308c1304dcd15 Mon Sep 17 00:00:00 2001 From: Mike Koch Date: Wed, 8 Apr 2015 17:09:39 -0400 Subject: [PATCH 7/8] #169 Don't use a dedicated column --- install/mods-for-hesk/sql/installSql.php | 3 --- install/mods-for-hesk/sql/uninstallSql.php | 8 -------- 2 files changed, 11 deletions(-) diff --git a/install/mods-for-hesk/sql/installSql.php b/install/mods-for-hesk/sql/installSql.php index 4f6245c8..84fddf67 100644 --- a/install/mods-for-hesk/sql/installSql.php +++ b/install/mods-for-hesk/sql/installSql.php @@ -402,8 +402,5 @@ function execute220Scripts() { global $hesk_settings; hesk_dbConnect(); - - executeQuery("ALTER TABLE `".hesk_dbEscape($hesk_settings['db_pfix'])."users` ADD COLUMN `can_manage_email_templates` ENUM('0','1') NOT NULL DEFAULT '0'"); - executeQuery("UPDATE `".hesk_dbEscape($hesk_settings['db_pfix'])."users` SET `can_manage_email_templates` = '1' WHERE `isadmin` = '1'"); executeQuery("UPDATE `".hesk_dbEscape($hesk_settings['db_pfix'])."settings` SET `Value` = '2.2.0' WHERE `Key` = 'modsForHeskVersion'"); } \ 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 471edb31..d8f2b7b4 100644 --- a/install/mods-for-hesk/sql/uninstallSql.php +++ b/install/mods-for-hesk/sql/uninstallSql.php @@ -136,12 +136,4 @@ function executeMiscellaneousSql() { // These queries are ran in case someone used an unfortunate installation they may have not properly cleaned up tables executeQuery('DROP TABLE IF EXISTS `'.hesk_dbEscape($hesk_settings['db_pfix']).'denied_ips`'); executeQuery('DROP TABLE IF EXISTS `'.hesk_dbEscape($hesk_settings['db_pfix']).'denied_emails`'); -} - -function removeEmailTemplatePermission() { - global $hesk_settings; - - hesk_dbConnect(); - - executeQuery("ALTER TABLE `".hesk_dbEscape($hesk_settings['db_pfix'])."users` DROP COLUMN `can_manage_email_templates`"); } \ No newline at end of file From 0fce992568dd1a3fc6d2a7461c7baa0069db937e Mon Sep 17 00:00:00 2001 From: Mike Koch Date: Wed, 8 Apr 2015 17:09:56 -0400 Subject: [PATCH 8/8] #169 Show link to other tools pages --- admin/banned_emails.php | 9 +++++++++ admin/banned_ips.php | 9 +++++++++ admin/manage_users.php | 1 + admin/service_messages.php | 10 ++++++++++ language/en/text.php | 1 + 5 files changed, 30 insertions(+) diff --git a/admin/banned_emails.php b/admin/banned_emails.php index 2151160d..9599d650 100644 --- a/admin/banned_emails.php +++ b/admin/banned_emails.php @@ -89,6 +89,15 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php'); ' . $hesklang['sm_title'] . ' '; } + + // Show a link to email tpl management if user has permission to do so + if (hesk_checkPermission('can_man_email_tpl', 0)) { + echo ' +

  • + '.$hesklang['email_templates'].' +
  • + '; + } ?>
    diff --git a/admin/banned_ips.php b/admin/banned_ips.php index e4599c36..1edc5672 100644 --- a/admin/banned_ips.php +++ b/admin/banned_ips.php @@ -92,6 +92,15 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php'); ' . $hesklang['sm_title'] . ' '; } + + // Show a link to email tpl management if user has permission to do so + if (hesk_checkPermission('can_man_email_tpl', 0)) { + echo ' +
  • + '.$hesklang['email_templates'].' +
  • + '; + } ?>
    diff --git a/admin/manage_users.php b/admin/manage_users.php index 6245a89b..c03e84af 100644 --- a/admin/manage_users.php +++ b/admin/manage_users.php @@ -77,6 +77,7 @@ $hesk_settings['features'] = array( 'can_ban_ips', /* User can ban IP addresses */ 'can_unban_ips', /* User can delete IP bans. Also enables "can_ban_ips" */ 'can_service_msg', /* User can manage service messages shown in customer interface */ +'can_man_email_tpl', /* User can manage email templates */ ); /* Set default values */ diff --git a/admin/service_messages.php b/admin/service_messages.php index df4f374a..30d5155e 100644 --- a/admin/service_messages.php +++ b/admin/service_messages.php @@ -92,6 +92,16 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php'); + + '.$hesklang['email_templates'].' + + '; + } + ?>