|
- |
+
+ ';
+ }
+ ?>
+ |
|
|
|
@@ -885,6 +918,7 @@ function save_cf()
`req` = '{$cf['req']}',
`category` = ".(count($cf['categories']) ? "'".json_encode($cf['categories'])."'" : 'NULL').",
`name` = '".hesk_dbEscape($cf['names'])."',
+ `mfh_description` = '".hesk_dbEscape($cf['descriptions'])."',
`value` = ".(strlen($cf['value']) ? "'".hesk_dbEscape($cf['value'])."'" : 'NULL')."
WHERE `id`={$id}");
@@ -916,6 +950,9 @@ function edit_cf()
$cf['names'] = json_decode($cf['name'], true);
unset($cf['name']);
+ $cf['descriptions'] = json_decode($cf['mfh_description'], true);
+ unset($cf['mfh_description']);
+
if (strlen($cf['category']))
{
$cf['categories'] = json_decode($cf['category'], true);
@@ -994,7 +1031,7 @@ function remove_cf()
$id = intval( hesk_GET('id') ) or hesk_error($hesklang['cf_e_id']);
// Reset the custom field
- hesk_dbQuery("UPDATE `".hesk_dbEscape($hesk_settings['db_pfix'])."custom_fields` SET `use`='0', `place`='0', `type`='text', `req`='0', `category`=NULL, `name`='', `value`=NULL, `order`=1000 WHERE `id`={$id}");
+ hesk_dbQuery("UPDATE `".hesk_dbEscape($hesk_settings['db_pfix'])."custom_fields` SET `use`='0', `place`='0', `type`='text', `req`='0', `category`=NULL, `name`='', `mfh_description`=NULL, `value`=NULL, `order`=1000 WHERE `id`={$id}");
// Were we successful?
if ( hesk_dbAffectedRows() == 1 )
@@ -1057,6 +1094,27 @@ function cf_validate()
$hesk_error_buffer[] = $hesklang['err_custname'];
}
+ // Descriptions
+ $cf['descriptions'] = hesk_POST_array('description');
+
+ // Make sure only non-empty descriptions pass
+ foreach ($cf['descriptions'] as $key => $description) {
+ if (!isset($hesk_settings['languages'][$key])) {
+ unset($cf['descriptions'][$key]);
+ } else {
+ $description = is_array($description) ? '' : hesk_input($description, 0, 0, HESK_SLASH);
+
+ if (strlen($description) < 1)
+ {
+ unset($cf['descriptions'][$key]);
+ }
+ else
+ {
+ $cf['descriptions'][$key] = stripslashes($description);
+ }
+ }
+ }
+
// Get type and values
$cf['type'] = hesk_POST('type');
switch ($cf['type'])
@@ -1264,8 +1322,10 @@ function cf_validate()
}
$cf['names'] = addslashes(json_encode($cf['names']));
+ $cf['descriptions'] = addslashes(json_encode($cf['descriptions']));
$cf['value'] = $cf['type'] == 'date' ? json_encode($cf['value']) : addslashes(json_encode($cf['value']));
+
return $cf;
} // END cf_validate()
@@ -1305,7 +1365,8 @@ function new_cf()
`req` = '{$cf['req']}',
`category` = ".(count($cf['categories']) ? "'".json_encode($cf['categories'])."'" : 'NULL').",
`name` = '".hesk_dbEscape($cf['names'])."',
- `value` = ".(strlen($cf['value']) ? "'".hesk_dbEscape($cf['value'])."'" : 'NULL').",
+ `mfh_description` = '".hesk_dbEscape($cf['descriptions'])."',
+ `value` = ".(strlen($cf['value']) ? "'".hesk_dbEscape($cf['value'])."'" : 'NULL').",
`order` = 990
WHERE `id`={$_SESSION['cford']}");
diff --git a/admin/edit_post.php b/admin/edit_post.php
index f4312a2a..a0bc7c55 100644
--- a/admin/edit_post.php
+++ b/admin/edit_post.php
@@ -445,6 +445,9 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
echo '';
}
+ if (!empty($v['mfh_description'])) {
+ echo '' . $v['mfh_description'] . '
';
+ }
echo '
';
@@ -475,9 +478,11 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
echo '';
}
-
- echo '
-
+ if (!empty($v['mfh_description'])) {
+ echo '' . $v['mfh_description'] . '
';
+ }
+ echo '';
+ echo '
';
break;
@@ -498,6 +503,9 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
echo '';
}
+ if (!empty($v['mfh_description'])) {
+ echo '' . $v['mfh_description'] . '
';
+ }
echo '
';
@@ -512,8 +520,11 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
';
break;
@@ -532,8 +543,11 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
';
break;
@@ -548,8 +562,11 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
@@ -570,8 +587,11 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
';
diff --git a/admin/new_ticket.php b/admin/new_ticket.php
index e831ec15..bc6f8fca 100644
--- a/admin/new_ticket.php
+++ b/admin/new_ticket.php
@@ -381,6 +381,10 @@ $show_quick_help = $show['show'];
';
}
+ if (!empty($v['mfh_description'])) {
+ echo '' . $v['mfh_description'] . '
';
+ }
+
echo '
@@ -410,8 +414,14 @@ $show_quick_help = $show['show'];
echo '';
}
- echo '
- ';
+ echo '';
+
+
+ if (!empty($v['mfh_description'])) {
+ echo '' . $v['mfh_description'] . '
';
+ }
+
+ echo '';
break;
/* Checkbox */
@@ -432,6 +442,11 @@ $show_quick_help = $show['show'];
echo '';
}
+
+
+ if (!empty($v['mfh_description'])) {
+ echo '' . $v['mfh_description'] . '
';
+ }
echo '
';
break;
@@ -442,8 +457,13 @@ $show_quick_help = $show['show'];
echo '';
+ ';
+
+ if (!empty($v['mfh_description'])) {
+ echo '
' . $v['mfh_description'] . '
';
+ }
+
+ echo '
';
break;
case 'date':
@@ -458,8 +478,13 @@ $show_quick_help = $show['show'];
-
+ value="' . $k_value . '" ' . $required_attribute . '>';
+
+ if (!empty($v['mfh_description'])) {
+ echo '
' . $v['mfh_description'] . '
';
+ }
+
+ echo '
';
break;
@@ -471,8 +496,13 @@ $show_quick_help = $show['show'];
echo '';
@@ -491,8 +521,13 @@ $show_quick_help = $show['show'];
echo '';
}
@@ -753,7 +788,9 @@ $show_quick_help = $show['show'];
echo '';
}
-
+ if (!empty($v['mfh_description'])) {
+ echo '' . $v['mfh_description'] . '
';
+ }
echo '';
break;
@@ -780,7 +817,11 @@ $show_quick_help = $show['show'];
echo '';
}
- echo '';
+ echo '';
+ if (!empty($v['mfh_description'])) {
+ echo '' . $v['mfh_description'] . '
';
+ }
+ echo '';
break;
/* Checkbox */
@@ -801,6 +842,9 @@ $show_quick_help = $show['show'];
echo '';
}
+ if (!empty($v['mfh_description'])) {
+ echo '' . $v['mfh_description'] . '
';
+ }
echo '';
break;
@@ -810,8 +854,11 @@ $show_quick_help = $show['show'];
echo '';
break;
@@ -827,8 +874,11 @@ $show_quick_help = $show['show'];
-
+ value="' . $k_value . '" ' . $required_attribute . '>';
+ if (!empty($v['mfh_description'])) {
+ echo '
' . $v['mfh_description'] . '
';
+ }
+ echo '
';
break;
@@ -840,8 +890,11 @@ $show_quick_help = $show['show'];
echo '';
@@ -859,8 +912,11 @@ $show_quick_help = $show['show'];
echo '';
}
diff --git a/css/mods-for-hesk.css b/css/mods-for-hesk.css
index 8a916d66..bb1d6035 100644
--- a/css/mods-for-hesk.css
+++ b/css/mods-for-hesk.css
@@ -302,6 +302,14 @@ div.setupButtons {
color: black;
}
+.critical-priority {
+ background-color: #9400d3;
+}
+
+.lowPriority {
+ background-color: blue;
+}
+
.pad-down-20 {
padding-top: 20px;
}
diff --git a/inc/custom_fields.inc.php b/inc/custom_fields.inc.php
index 4d57778f..7cbd4ef9 100755
--- a/inc/custom_fields.inc.php
+++ b/inc/custom_fields.inc.php
@@ -77,6 +77,12 @@ function hesk_load_custom_fields($category=0, $use_cache=1)
// Decode options
$row['value'] = json_decode($row['value'], true);
+ // Description
+ $descriptions = strlen($row['mfh_description']) ? json_decode($row['mfh_description'], true) : array();
+ $row['mfh_description'] = (isset($descriptions[$hesk_settings['language']])) ?
+ $descriptions[$hesk_settings['language']] :
+ reset($descriptions);
+
// Add to custom_fields array
$hesk_settings['custom_fields'][$id] = $row;
}
diff --git a/index.php b/index.php
index 8ab81bd9..72c28dea 100644
--- a/index.php
+++ b/index.php
@@ -499,6 +499,9 @@ function print_add_ticket()
echo '';
}
+ if (!empty($v['mfh_description'])) {
+ echo '' . $v['mfh_description'] . '
';
+ }
echo '
@@ -536,8 +539,11 @@ function print_add_ticket()
echo '';
}
- echo '
-
+ echo '';
+ if (!empty($v['mfh_description'])) {
+ echo '' . $v['mfh_description'] . '
';
+ }
+ echo '
';
break;
@@ -565,6 +571,9 @@ function print_add_ticket()
echo '';
}
+ if (!empty($v['mfh_description'])) {
+ echo '' . $v['mfh_description'] . '
';
+ }
echo '
@@ -579,8 +588,11 @@ function print_add_ticket()
';
break;
@@ -597,8 +609,11 @@ function print_add_ticket()
';
break;
@@ -613,8 +628,11 @@ function print_add_ticket()
';
@@ -642,8 +660,11 @@ function print_add_ticket()
';
break;
@@ -660,8 +681,11 @@ function print_add_ticket()
';
}
@@ -829,6 +853,9 @@ function print_add_ticket()
echo '';
}
+ if (!empty($v['mfh_description'])) {
+ echo '' . $v['mfh_description'] . '
';
+ }
echo '
@@ -865,9 +892,11 @@ function print_add_ticket()
echo '';
}
-
- echo '
-
+ if (!empty($v['mfh_description'])) {
+ echo '' . $v['mfh_description'] . '
';
+ }
+ echo '';
+ echo '
';
break;
@@ -895,6 +924,9 @@ function print_add_ticket()
echo '';
}
+ if (!empty($v['mfh_description'])) {
+ echo '' . $v['mfh_description'] . '
';
+ }
echo '
@@ -909,8 +941,11 @@ function print_add_ticket()
';
break;
@@ -927,8 +962,11 @@ function print_add_ticket()
';
break;
@@ -943,8 +981,11 @@ function print_add_ticket()
';
@@ -972,8 +1013,11 @@ function print_add_ticket()
';
break;
@@ -990,8 +1034,11 @@ function print_add_ticket()
';
}
diff --git a/install/mods-for-hesk/sql/installSql.php b/install/mods-for-hesk/sql/installSql.php
index c8922f46..18cb6dc4 100644
--- a/install/mods-for-hesk/sql/installSql.php
+++ b/install/mods-for-hesk/sql/installSql.php
@@ -1136,8 +1136,16 @@ function execute320Scripts() {
global $hesk_settings;
hesk_dbConnect();
- executeQuery("ALTER TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "categories`
+ executeQuery("ALTER TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "categories`
ADD COLUMN `mfh_description` VARCHAR(255)");
+ executeQuery("ALTER TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "custom_fields`
+ ADD COLUMN `mfh_description` VARCHAR(255)");
+
+ // Purge the custom field caches as we're adding a new field
+ foreach ($hesk_settings['languages'] as $key => $value) {
+ $language_hash = sha1($key);
+ hesk_unlink(HESK_PATH . "cache/cf_{$language_hash}.cache.php");
+ }
updateVersion('3.2.0');
}
\ No newline at end of file
diff --git a/ticket.php b/ticket.php
index 86088a15..2d7197b4 100644
--- a/ticket.php
+++ b/ticket.php
@@ -283,11 +283,13 @@ if (!$show['show']) {
$repliesColumnWidth = 2;
echo '';
+ echo 'critical-priority">';
} elseif ($ticket['priority'] == 1) {
echo 'highPriority">';
- } else {
+ } elseif ($ticket['priority'] == 2) {
echo 'medLowPriority">';
+ } else {
+ echo 'lowPriority">';
}
echo '
' . $hesklang['priority'] . '
';