Browse Source

Update the form for the new fields

tags/3.1.0
Mike Koch 2 years ago
parent
commit
523b80fb4c
2 changed files with 39 additions and 6 deletions
  1. 37
    6
      admin/manage_categories.php
  2. 2
    0
      language/en/text.php

+ 37
- 6
admin/manage_categories.php View File

@@ -400,7 +400,8 @@ while ($mycat = hesk_dbFetchAssoc($res)) {
</label>
<div class="col-sm-9">
<input type="text" name="background-color" class="form-control category-colorpicker"
placeholder="<?php echo $hesklang['category_background_color']; ?>">
placeholder="<?php echo $hesklang['category_background_color']; ?>"
data-error="<?php echo htmlspecialchars($hesklang['this_field_is_required']); ?>">
<div class="help-block with-errors"></div>
</div>
</div>
@@ -413,10 +414,34 @@ while ($mycat = hesk_dbFetchAssoc($res)) {
</label>
<div class="col-sm-9">
<input type="text" name="foreground-color" class="form-control category-colorpicker"
placeholder="<?php echo $hesklang['category_foreground_color']; ?>">
placeholder="<?php echo $hesklang['category_foreground_color']; ?>"
data-error="<?php echo htmlspecialchars($hesklang['this_field_is_required']); ?>"
required>
<div class="help-block with-errors"></div>
</div>
</div>
<div class="form-group">
<label for="display-border" class="col-sm-3 control-label">
<?php echo $hesklang['category_display_border']; ?>
<i class="fa fa-question-circle settingsquestionmark" data-toggle="popover"
title="<?php echo htmlspecialchars($hesklang['category_display_border']); ?>"
data-content="<?php echo htmlspecialchars($hesklang['category_display_border_help']); ?>"></i>
</label>
<div class="col-sm-9 form-inline">
<div class="radio">
<label>
<input type="radio" name="display-border" value="1">
<?php echo $hesklang['yes']; ?>
</label>
</div>&nbsp;&nbsp;&nbsp;
<div class="radio">
<label>
<input type="radio" name="display-border" value="0" checked>
<?php echo $hesklang['no']; ?>
</label>
</div>
</div>
</div>
<div class="form-group">
<label for="priority" class="col-sm-3 control-label">
<?php echo $hesklang['priority']; ?>
@@ -649,9 +674,9 @@ function new_cat()
/* Category name */
$catname = hesk_input(hesk_POST('name'), $hesklang['enter_cat_name'], 'manage_categories.php');

$color = hesk_POST('color', null);
$color = str_replace('#', '', $color);
$color = $color != null ? "'#" . hesk_dbEscape($color) . "'" : 'NULL';
$background_color = hesk_POST('background-color', '#ffffff');
$foreground_color = hesk_POST('foreground-color', '#000000');
$display_border = hesk_POST('display-border', 0);

$usage = hesk_POST('usage', 0);

@@ -667,7 +692,11 @@ function new_cat()
$row = hesk_dbFetchRow($res);
$my_order = $row[0] + 10;

hesk_dbQuery("INSERT INTO `" . hesk_dbEscape($hesk_settings['db_pfix']) . "categories` (`name`,`cat_order`,`autoassign`,`type`, `priority`, `color`, `usage`) VALUES ('" . hesk_dbEscape($catname) . "','" . intval($my_order) . "','" . intval($_SESSION['cat_autoassign']) . "','" . intval($_SESSION['cat_type']) . "','{$_SESSION['cat_priority']}', {$color}, " . intval($usage) . ")");
hesk_dbQuery("INSERT INTO `" . hesk_dbEscape($hesk_settings['db_pfix']) . "categories`
(`name`,`cat_order`,`autoassign`,`type`, `priority`, `background_color`, `foreground_color`, `display_border_outline`, `usage`) VALUES
('" . hesk_dbEscape($catname) . "','" . intval($my_order) . "','" . intval($_SESSION['cat_autoassign']) . "',
'" . intval($_SESSION['cat_type']) . "','{$_SESSION['cat_priority']}', '" . hesk_dbEscape($background_color) . "',
'" . hesk_dbEscape($foreground_color) . "', '" . intval($display_border) . "', " . intval($usage) . ")");

hesk_cleanSessionVars('catname');
hesk_cleanSessionVars('cat_autoassign');
@@ -867,6 +896,8 @@ function get_manager($user_id, $user_array) {
return $user['name'];
}
}

return 'Error!';
}

?>

+ 2
- 0
language/en/text.php View File

@@ -2128,6 +2128,8 @@ $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.';
$hesklang['category_display_border'] = 'Display Border';
$hesklang['category_display_border_help'] = 'Choose to decide whether or not to display a border around the category (uses foreground color)';

// DO NOT CHANGE BELOW
if (!defined('IN_SCRIPT')) die('PHP syntax OK!');

Loading…
Cancel
Save