diff --git a/admin/manage_categories.php b/admin/manage_categories.php index 2d642ad7..73b5d585 100644 --- a/admin/manage_categories.php +++ b/admin/manage_categories.php @@ -277,11 +277,15 @@ while ($mycat = hesk_dbFetchAssoc($res)) { } $tmp = $i ? 'White' : 'Blue'; - $style = ''; - if ($mycat['color'] == null) { - $style .= 'color: black; border: solid 1px #000'; - } else { - $style .= 'background: ' . $mycat['color']; + $style = 'background: ' . $mycat['background_color']; + $backgroundVolatile = 'background-volatile'; + if ($mycat['foreground_color'] != 'AUTO') { + $style .= '; color: ' . $mycat['foreground_color']; + $backgroundVolatile = ''; + + if ($mycat['display_border_outline']) { + $style .= '; border: solid 1px ' . $mycat['foreground_color']; + } } $i = $i ? 0 : 1; @@ -319,10 +323,12 @@ while ($mycat = hesk_dbFetchAssoc($res)) { echo ' ' . $mycat['id'] . ' - ' . $mycat['name'] . ' + ' . $mycat['name'] . ' ' . $priorities[$mycat['priority']]['formatted'] . ' ' . $all . ' @@ -386,15 +392,28 @@ while ($mycat = hesk_dbFetchAssoc($res)) {
-
+
+
- +
@@ -471,7 +490,8 @@ while ($mycat = hesk_dbFetchAssoc($res)) { var name = tempNameElement.value; var id = $row.attr('data-category-id'); - var color = $row.attr('data-color'); + var backgroundColor = $row.attr('data-background-color'); + var foregroundColor = $row.attr('data-foreground-color'); var priority = $row.attr('data-priority'); var manager = $row.attr('data-manager'); var usage = $row.attr('data-usage'); @@ -482,29 +502,29 @@ while ($mycat = hesk_dbFetchAssoc($res)) { .find('select[name="manager"]').val(manager).end() .find('input[name="id"]').val(id).end() .find('select[name="usage"]').val(usage).end() - .find('input[name="color"]').val(color).end(); - - var colorpickerOptions = null; - if (color == '') { - colorpickerOptions = { - format: 'hex' - }; - } else { - colorpickerOptions = { - format: 'hex', - color: color - }; - } - $modal.find('input[name="color"]') + .find('input[name="background-color"]').val(backgroundColor).end() + .find('input[name="foreground-color"]').val(foregroundColor).end(); + + var colorpickerOptions = { + format: 'hex', + color: backgroundColor + }; + $modal.find('input[name="background-color"]') .colorpicker(colorpickerOptions).end().modal('show'); + colorpickerOptions = { + format: 'hex', + color: foregroundColor + }; - if (color == '') { - $modal.find('input[name="color"]').val(''); - } + $modal.find('input[name="foreground-color"]') + .colorpicker(colorpickerOptions).end().modal('show'); }); $('.cancel-callback').click(function() { - $('#edit-category-modal').find('input[name="color"]').val('').colorpicker('destroy').end(); + var $editCategoryModal = $('#edit-category-modal'); + + $editCategoryModal.find('input[name="background-color"]').val('').colorpicker('destroy').end(); + $editCategoryModal.find('input[name="foreground-color"]').val('').colorpicker('destroy').end(); }); }); diff --git a/install/mods-for-hesk/sql/installSql.php b/install/mods-for-hesk/sql/installSql.php index c9bd0063..b2faa81a 100644 --- a/install/mods-for-hesk/sql/installSql.php +++ b/install/mods-for-hesk/sql/installSql.php @@ -1006,6 +1006,9 @@ function execute310Scripts() { language VARCHAR(200) NOT NULL, text VARCHAR(200) NOT NULL, subtext VARCHAR(200))"); + executeQuery("ALTER TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "categories` ADD COLUMN `foreground_color` VARCHAR(7) NOT NULL DEFAULT 'AUTO'"); + executeQuery("ALTER TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "categories` ADD COLUMN `display_border_outline` ENUM('0','1') NOT NULL DEFAULT '0'"); + executeQuery("ALTER TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "categories` CHANGE `color` `background_color` VARCHAR(7) NOT NULL DEFAULT '#FFFFFF'"); updateVersion('3.1.0'); } \ No newline at end of file diff --git a/language/en/text.php b/language/en/text.php index ab5ae57e..1ed96d5c 100644 --- a/language/en/text.php +++ b/language/en/text.php @@ -1965,8 +1965,6 @@ $hesklang['attachment_cancel'] = 'Cancel'; $hesklang['attachment_confirm_cancel'] = 'Are you sure you want to cancel this upload?'; $hesklang['attachment_remove'] = 'Remove attachment'; $hesklang['due_date'] = 'Due Date'; -$hesklang['category_color'] = 'Color'; -$hesklang['category_color_help'] = 'The hex code for the color to be used on the view ticket screen and calendar. Leave blank for no color'; $hesklang['category_updated'] = 'Changes to %s have been saved'; $hesklang['new_event'] = 'New Event'; $hesklang['create_event'] = 'Create Event'; @@ -2127,6 +2125,9 @@ $hesklang['customer_view'] = 'Customer View'; $hesklang['admin_panel'] = 'Admin Panel'; $hesklang['manage_custom_nav_elements'] = 'Manage Custom Nav Elements'; $hesklang['can_man_custom_nav'] = 'Can manage custom nav elements'; +$hesklang['category_background_color'] = 'Background Color'; +$hesklang['category_foreground_color'] = 'Foreground Color'; +$hesklang['category_color_help'] = 'The hex code for the color to be used on the view ticket screen and calendar.'; // DO NOT CHANGE BELOW if (!defined('IN_SCRIPT')) die('PHP syntax OK!');