diff --git a/admin/admin_ticket.php b/admin/admin_ticket.php index 5a4eee24..b409b924 100644 --- a/admin/admin_ticket.php +++ b/admin/admin_ticket.php @@ -313,7 +313,7 @@ if ( ($can_reply || $can_edit) && isset($_POST['h']) && isset($_POST['m']) && is if (($can_reply || $can_edit) && isset($_POST['childTrackingId'])) { //-- Make sure this isn't the same ticket or one of its merged tickets. $mergedTickets = hesk_dbQuery('SELECT * FROM `'.hesk_dbEscape($hesk_settings['db_pfix']).'tickets` WHERE `trackid` = - \''.hesk_dbEscape($trackingID).'\' AND `merged` LIKE \'#'.hesk_dbEscape($_POST['childTrackingId']).'\''); + \''.hesk_dbEscape($trackingID).'\' AND `merged` LIKE \'%#'.hesk_dbEscape($_POST['childTrackingId']).'#%\''); if ($_POST['childTrackingId'] == $trackingID || $mergedTickets->num_rows > 0) { hesk_process_messages($hesklang['child_is_itself'], 'admin_ticket.php?track='.$trackingID.'&Refresh='.mt_rand(10000,99999)); } @@ -343,7 +343,16 @@ if (($can_reply || $can_edit) && isset($_POST['childTrackingId'])) { } /* Delete child action */ -//TODO Populate this +if (($can_reply || $can_edit) && isset($_GET['deleteChild'])) { + //-- Delete the relationship + hesk_dbQuery('UPDATE `'.hesk_dbEscape($hesk_settings['db_pfix']).'tickets` SET `parent` = NULL WHERE `ID` = '.hesk_dbEscape($_GET['deleteChild'])); + hesk_process_messages($hesklang['relationship_deleted'], 'admin_ticket.php?track='.$trackingID.'&Refresh='.mt_rand(10000,99999), 'SUCCESS'); + +} elseif (($can_reply || $can_edit) && isset($_GET['deleteParent'])) { + //-- Delete the relationship + hesk_dbQuery('UPDATE `'.hesk_dbEscape($hesk_settings['db_pfix']).'tickets` SET `parent` = NULL WHERE `ID` = '.hesk_dbEscape($ticket['id'])); + hesk_process_messages($hesklang['relationship_deleted'], 'admin_ticket.php?track='.$trackingID.'&Refresh='.mt_rand(10000,99999), 'SUCCESS'); +} /* Delete attachment action */ if (isset($_GET['delatt']) && hesk_token_check()) @@ -543,7 +552,9 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php'); //-- Get the tracking ID of the parent $parent = hesk_dbQuery('SELECT `trackid` FROM `'.hesk_dbEscape($hesk_settings['db_pfix']).'tickets` WHERE `ID` = '.hesk_dbEscape($ticket['parent']))->fetch_assoc(); - echo ''.$parent['trackid'].''; + echo ' + '; + echo ' '.$parent['trackid'].''; } else { echo $hesklang['none']; } @@ -554,11 +565,14 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
fetch_assoc()) {
$hasRows = true;
- echo ''.$row['trackid'].'
';
+ echo '
+ ';
+ echo ' '.$row['trackid'].'';
+ echo '
';
}
if (!$hasRows) {
echo $hesklang['none'];
diff --git a/language/en/text.php b/language/en/text.php
index ff2bd438..1b3f6dd0 100644
--- a/language/en/text.php
+++ b/language/en/text.php
@@ -67,6 +67,8 @@ $hesklang['child_added'] = 'Successfully added %s as a child to
$hesklang['is_child_already'] = '%s is already a child of this ticket.'; //%s: the child tracking ID
$hesklang['child_does_not_exist'] = '%s is not a valid Tracking ID!'; //%s: the child tracking ID
$hesklang['child_is_itself'] = 'You cannot set a ticket as a child of itself.';
+$hesklang['delete_relationship'] = 'Delete Relationship';
+$hesklang['relationship_deleted'] = 'Parent/Child relationship deleted.';
// ADDED OR MODIFIED IN NuMods 1.3.1
$hesklang['autorefresh'] = 'Autorefresh:';