From 7b38fe3c10d3e8cea17d78055063648d9c87aa78 Mon Sep 17 00:00:00 2001 From: Mike Koch Date: Wed, 28 Oct 2015 22:01:34 -0400 Subject: [PATCH] #378 Parent/Child tickets are now Linked tickets --- admin/admin_ticket.php | 57 +++++++++++++++++++++--------------------- language/en/text.php | 17 ++++++------- 2 files changed, 37 insertions(+), 37 deletions(-) diff --git a/admin/admin_ticket.php b/admin/admin_ticket.php index 270fcbc0..941121e2 100644 --- a/admin/admin_ticket.php +++ b/admin/admin_ticket.php @@ -429,7 +429,7 @@ if (($can_reply || $can_edit) && isset($_POST['childTrackingId'])) { $mergedTickets = hesk_dbQuery('SELECT * FROM `' . hesk_dbEscape($hesk_settings['db_pfix']) . 'tickets` WHERE `trackid` = \'' . 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)); + hesk_process_messages($hesklang['cannot_link_ticket_to_itself'], 'admin_ticket.php?track=' . $trackingID . '&Refresh=' . mt_rand(10000, 99999)); } //-- Does the child exist? @@ -442,30 +442,30 @@ if (($can_reply || $can_edit) && isset($_POST['childTrackingId'])) { $exist = $existRs->fetch_assoc(); $_POST['childTrackingId'] = $exist['trackid']; } else { - hesk_process_messages(sprintf($hesklang['child_does_not_exist'], $_POST['childTrackingId']), 'admin_ticket.php?track=' . $trackingID . '&Refresh=' . mt_rand(10000, 99999)); + hesk_process_messages(sprintf($hesklang['linked_ticket_does_not_exist'], $_POST['childTrackingId']), 'admin_ticket.php?track=' . $trackingID . '&Refresh=' . mt_rand(10000, 99999)); } } //-- Check if the ticket is already a child. $childRs = hesk_dbQuery('SELECT * FROM `' . hesk_dbEscape($hesk_settings['db_pfix']) . 'tickets` WHERE `parent` = ' . $ticket['id'] . ' AND `trackid` = \'' . $_POST['childTrackingId'] . '\''); if ($childRs->num_rows > 0) { - hesk_process_messages(sprintf($hesklang['is_child_already'], $_POST['childTrackingId']), 'admin_ticket.php?track=' . $trackingID . '&Refresh=' . mt_rand(10000, 99999), 'NOTICE'); + hesk_process_messages(sprintf($hesklang['is_already_linked'], $_POST['childTrackingId']), 'admin_ticket.php?track=' . $trackingID . '&Refresh=' . mt_rand(10000, 99999), 'NOTICE'); } hesk_dbQuery('UPDATE `' . hesk_dbEscape($hesk_settings['db_pfix']) . 'tickets` SET `parent` = ' . $ticket['id'] . ' WHERE `trackid` = \'' . $_POST['childTrackingId'] . '\''); - hesk_process_messages(sprintf($hesklang['child_added'], $_POST['childTrackingId']), 'admin_ticket.php?track=' . $trackingID . '&Refresh=' . mt_rand(10000, 99999), 'SUCCESS'); + hesk_process_messages(sprintf($hesklang['link_added'], $_POST['childTrackingId']), 'admin_ticket.php?track=' . $trackingID . '&Refresh=' . mt_rand(10000, 99999), 'SUCCESS'); } /* Delete child action */ 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'); + hesk_process_messages($hesklang['ticket_no_longer_linked'], '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'); + hesk_process_messages($hesklang['ticket_no_longer_linked'], 'admin_ticket.php?track=' . $trackingID . '&Refresh=' . mt_rand(10000, 99999), 'SUCCESS'); } /* Delete attachment action */ @@ -728,7 +728,7 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
  • - +

    '; echo ' ' . $parent['trackid'] . ''; - } else { - echo $hesklang['none']; } - ?>

    -
  • -
  • - - -

    fetch_assoc()) { $hasRows = true; echo ' - '; + '; echo ' ' . $row['trackid'] . ''; echo '
    '; } - if (!$hasRows) { + if (!$hasRows && $ticket['parent'] == null) { echo $hesklang['none']; } ?>

    @@ -766,19 +758,28 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php'); if ($can_reply || $can_edit) { ?>
    -

    ' . $hesklang['add_child'] . ''; ?>

    +

    ' . $hesklang['add_ticket'] . ''; ?>