Getting started on enhanced color changes
This commit is contained in:
parent
21d00049ba
commit
a043dced97
@ -277,11 +277,15 @@ while ($mycat = hesk_dbFetchAssoc($res)) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$tmp = $i ? 'White' : 'Blue';
|
$tmp = $i ? 'White' : 'Blue';
|
||||||
$style = '';
|
$style = 'background: ' . $mycat['background_color'];
|
||||||
if ($mycat['color'] == null) {
|
$backgroundVolatile = 'background-volatile';
|
||||||
$style .= 'color: black; border: solid 1px #000';
|
if ($mycat['foreground_color'] != 'AUTO') {
|
||||||
} else {
|
$style .= '; color: ' . $mycat['foreground_color'];
|
||||||
$style .= 'background: ' . $mycat['color'];
|
$backgroundVolatile = '';
|
||||||
|
|
||||||
|
if ($mycat['display_border_outline']) {
|
||||||
|
$style .= '; border: solid 1px ' . $mycat['foreground_color'];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
$i = $i ? 0 : 1;
|
$i = $i ? 0 : 1;
|
||||||
|
|
||||||
@ -319,10 +323,12 @@ while ($mycat = hesk_dbFetchAssoc($res)) {
|
|||||||
|
|
||||||
echo '
|
echo '
|
||||||
<tr data-category-id="' . $mycat['id'] . '" data-name="' . htmlspecialchars($mycat['name']) . '"
|
<tr data-category-id="' . $mycat['id'] . '" data-name="' . htmlspecialchars($mycat['name']) . '"
|
||||||
data-color="'. htmlspecialchars($mycat['color']) . '" data-priority="' . $mycat['priority'] . '"
|
data-foreground-color="' . htmlspecialchars($mycat['foreground_color']) . '"
|
||||||
|
data-border="' . $mycat['display_border_outline'] . '"
|
||||||
|
data-background-color="'. htmlspecialchars($mycat['background_color']) . '" data-priority="' . $mycat['priority'] . '"
|
||||||
data-manager="' . $mycat['manager'] . '" data-usage="'. $mycat['usage'] .'">
|
data-manager="' . $mycat['manager'] . '" data-usage="'. $mycat['usage'] .'">
|
||||||
<td style="display: none">' . $mycat['id'] . '</td>
|
<td style="display: none">' . $mycat['id'] . '</td>
|
||||||
<td><span class="label background-volatile category-label" style="'.$style.'">' . $mycat['name'] . '</span></td>
|
<td><span class="label ' . $backgroundVolatile . ' category-label" style="'.$style.'">' . $mycat['name'] . '</span></td>
|
||||||
<td width="1" style="white-space: nowrap;">' . $priorities[$mycat['priority']]['formatted'] . '</td>
|
<td width="1" style="white-space: nowrap;">' . $priorities[$mycat['priority']]['formatted'] . '</td>
|
||||||
<td><a href="show_tickets.php?category=' . $mycat['id'] . '&s_all=1&s_my=1&s_ot=1&s_un=1" alt="' . $hesklang['list_tickets_cat'] . '" title="' . $hesklang['list_tickets_cat'] . '">' . $all . '</a></td>
|
<td><a href="show_tickets.php?category=' . $mycat['id'] . '&s_all=1&s_my=1&s_ot=1&s_un=1" alt="' . $hesklang['list_tickets_cat'] . '" title="' . $hesklang['list_tickets_cat'] . '">' . $all . '</a></td>
|
||||||
<td>
|
<td>
|
||||||
@ -386,15 +392,28 @@ while ($mycat = hesk_dbFetchAssoc($res)) {
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label for="color" class="col-sm-3 control-label">
|
<label for="background-color" class="col-sm-3 control-label">
|
||||||
<?php echo $hesklang['category_color']; ?>
|
<?php echo $hesklang['category_background_color']; ?>
|
||||||
<i class="fa fa-question-circle settingsquestionmark" data-toggle="popover"
|
<i class="fa fa-question-circle settingsquestionmark" data-toggle="popover"
|
||||||
title="<?php echo htmlspecialchars($hesklang['category_color']); ?>"
|
title="<?php echo htmlspecialchars($hesklang['category_background_color']); ?>"
|
||||||
data-content="<?php echo htmlspecialchars($hesklang['category_color_help']); ?>"></i>
|
data-content="<?php echo htmlspecialchars($hesklang['category_color_help']); ?>"></i>
|
||||||
</label>
|
</label>
|
||||||
<div class="col-sm-9">
|
<div class="col-sm-9">
|
||||||
<input type="text" name="color" class="form-control category-colorpicker"
|
<input type="text" name="background-color" class="form-control category-colorpicker"
|
||||||
placeholder="<?php echo $hesklang['category_color']; ?>">
|
placeholder="<?php echo $hesklang['category_background_color']; ?>">
|
||||||
|
<div class="help-block with-errors"></div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="form-group">
|
||||||
|
<label for="foreground-color" class="col-sm-3 control-label">
|
||||||
|
<?php echo $hesklang['category_foreground_color']; ?>
|
||||||
|
<i class="fa fa-question-circle settingsquestionmark" data-toggle="popover"
|
||||||
|
title="<?php echo htmlspecialchars($hesklang['category_foreground_color']); ?>"
|
||||||
|
data-content="<?php echo htmlspecialchars($hesklang['category_color_help']); ?>"></i>
|
||||||
|
</label>
|
||||||
|
<div class="col-sm-9">
|
||||||
|
<input type="text" name="foreground-color" class="form-control category-colorpicker"
|
||||||
|
placeholder="<?php echo $hesklang['category_foreground_color']; ?>">
|
||||||
<div class="help-block with-errors"></div>
|
<div class="help-block with-errors"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -471,7 +490,8 @@ while ($mycat = hesk_dbFetchAssoc($res)) {
|
|||||||
var name = tempNameElement.value;
|
var name = tempNameElement.value;
|
||||||
|
|
||||||
var id = $row.attr('data-category-id');
|
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 priority = $row.attr('data-priority');
|
||||||
var manager = $row.attr('data-manager');
|
var manager = $row.attr('data-manager');
|
||||||
var usage = $row.attr('data-usage');
|
var usage = $row.attr('data-usage');
|
||||||
@ -482,29 +502,29 @@ while ($mycat = hesk_dbFetchAssoc($res)) {
|
|||||||
.find('select[name="manager"]').val(manager).end()
|
.find('select[name="manager"]').val(manager).end()
|
||||||
.find('input[name="id"]').val(id).end()
|
.find('input[name="id"]').val(id).end()
|
||||||
.find('select[name="usage"]').val(usage).end()
|
.find('select[name="usage"]').val(usage).end()
|
||||||
.find('input[name="color"]').val(color).end();
|
.find('input[name="background-color"]').val(backgroundColor).end()
|
||||||
|
.find('input[name="foreground-color"]').val(foregroundColor).end();
|
||||||
|
|
||||||
var colorpickerOptions = null;
|
var colorpickerOptions = {
|
||||||
if (color == '') {
|
format: 'hex',
|
||||||
colorpickerOptions = {
|
color: backgroundColor
|
||||||
format: 'hex'
|
};
|
||||||
};
|
$modal.find('input[name="background-color"]')
|
||||||
} else {
|
|
||||||
colorpickerOptions = {
|
|
||||||
format: 'hex',
|
|
||||||
color: color
|
|
||||||
};
|
|
||||||
}
|
|
||||||
$modal.find('input[name="color"]')
|
|
||||||
.colorpicker(colorpickerOptions).end().modal('show');
|
.colorpicker(colorpickerOptions).end().modal('show');
|
||||||
|
colorpickerOptions = {
|
||||||
|
format: 'hex',
|
||||||
|
color: foregroundColor
|
||||||
|
};
|
||||||
|
|
||||||
if (color == '') {
|
$modal.find('input[name="foreground-color"]')
|
||||||
$modal.find('input[name="color"]').val('');
|
.colorpicker(colorpickerOptions).end().modal('show');
|
||||||
}
|
|
||||||
});
|
});
|
||||||
|
|
||||||
$('.cancel-callback').click(function() {
|
$('.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();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
</script>
|
</script>
|
||||||
|
|||||||
@ -1006,6 +1006,9 @@ function execute310Scripts() {
|
|||||||
language VARCHAR(200) NOT NULL,
|
language VARCHAR(200) NOT NULL,
|
||||||
text VARCHAR(200) NOT NULL,
|
text VARCHAR(200) NOT NULL,
|
||||||
subtext VARCHAR(200))");
|
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');
|
updateVersion('3.1.0');
|
||||||
}
|
}
|
||||||
@ -1965,8 +1965,6 @@ $hesklang['attachment_cancel'] = 'Cancel';
|
|||||||
$hesklang['attachment_confirm_cancel'] = 'Are you sure you want to cancel this upload?';
|
$hesklang['attachment_confirm_cancel'] = 'Are you sure you want to cancel this upload?';
|
||||||
$hesklang['attachment_remove'] = 'Remove attachment';
|
$hesklang['attachment_remove'] = 'Remove attachment';
|
||||||
$hesklang['due_date'] = 'Due Date';
|
$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 <i>%s</i> have been saved';
|
$hesklang['category_updated'] = 'Changes to <i>%s</i> have been saved';
|
||||||
$hesklang['new_event'] = 'New Event';
|
$hesklang['new_event'] = 'New Event';
|
||||||
$hesklang['create_event'] = 'Create Event';
|
$hesklang['create_event'] = 'Create Event';
|
||||||
@ -2127,6 +2125,9 @@ $hesklang['customer_view'] = 'Customer View';
|
|||||||
$hesklang['admin_panel'] = 'Admin Panel';
|
$hesklang['admin_panel'] = 'Admin Panel';
|
||||||
$hesklang['manage_custom_nav_elements'] = 'Manage Custom Nav Elements';
|
$hesklang['manage_custom_nav_elements'] = 'Manage Custom Nav Elements';
|
||||||
$hesklang['can_man_custom_nav'] = 'Can 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
|
// DO NOT CHANGE BELOW
|
||||||
if (!defined('IN_SCRIPT')) die('PHP syntax OK!');
|
if (!defined('IN_SCRIPT')) die('PHP syntax OK!');
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user