From 36b4f3f101051417c81241d2ce2b2db6164b68b4 Mon Sep 17 00:00:00 2001 From: Mike Koch Date: Sat, 28 Jun 2014 15:37:53 -0400 Subject: [PATCH] Now statuses used as a default action can't be deleted with the GUI --- admin/admin_settings.php | 18 +++++++++++++++++- language/en/text.php | 2 ++ 2 files changed, 19 insertions(+), 1 deletion(-) diff --git a/admin/admin_settings.php b/admin/admin_settings.php index fc8d8569..8e6cffe4 100644 --- a/admin/admin_settings.php +++ b/admin/admin_settings.php @@ -1805,13 +1805,29 @@ if ( defined('HESK_DEMO') ) while ($row = $statusesRS->fetch_assoc()) { $checkedEcho = ($row['IsClosed'] == 1) ? 'checked="checked"' : ''; + $isDisabled = false; + if ($row['IsNewTicketStatus'] || $row['IsClosedByClient'] || $row['IsCustomerReplyStatus'] || + $row['IsStaffClosedOption'] || $row['IsStaffReopenedStatus'] || $row['IsDefaultStaffReplyStatus'] + || $row['LockedTicketStatus']) + { + $isDisabled = true; + } + echo ''; echo ''.$hesklang[$row['ShortNameContentKey']].''; //Name echo ''; // Short Name Language File echo ''; // Long Name Language File echo ''; // Text Color echo ''; // Resolved Status? - echo ''; //Delete status? + echo ''; + if ($isDisabled) + { + echo ''; + } else + { + echo ''; + } + echo ''; //Delete status? echo ''; } diff --git a/language/en/text.php b/language/en/text.php index 72255e8f..9a451385 100644 --- a/language/en/text.php +++ b/language/en/text.php @@ -45,6 +45,8 @@ $hesklang['longNameRequired'] = 'Long Name Key is required.'; $hesklang['textColorRequired'] = 'Text Color is required.'; $hesklang['addNew'] = 'Add New'; $hesklang['close_action']='Close Ticket'; // Close ACTION +$hesklang['whyCantIDeleteThisStatus'] = "Why Can't I Delete This Status?"; +$hesklang['whyCantIDeleteThisStatusReason'] = 'This status cannot be deleted because it is being used as a default status for a particular action (see the below section).'; // ADDED OR MODIFIED IN HESK UI