diff --git a/admin/admin_ticket.php b/admin/admin_ticket.php index 93482f22..8c522973 100644 --- a/admin/admin_ticket.php +++ b/admin/admin_ticket.php @@ -456,7 +456,7 @@ if (($can_reply || $can_edit) && isset($_POST['childTrackingId'])) { $existRs = hesk_dbQuery('SELECT `trackid` FROM `' . hesk_dbEscape($hesk_settings['db_pfix']) . 'tickets` WHERE `merged` LIKE \'#' . hesk_dbEscape($_POST['childTrackingId']) . '#\''); if ($existRs->num_rows > 0) { //-- Yes, it was merged. Set the child to the "new" ticket; not the merged one. - $exist = $existRs->fetch_assoc(); + $exist = hesk_dbFetchAssoc($existRs); $_POST['childTrackingId'] = $exist['trackid']; } else { hesk_process_messages(sprintf($hesklang['linked_ticket_does_not_exist'], $_POST['childTrackingId']), 'admin_ticket.php?track=' . $trackingID . '&Refresh=' . mt_rand(10000, 99999)); @@ -782,8 +782,9 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');

fetch_assoc(); + $parentRs = hesk_dbQuery('SELECT `trackid` FROM `' . hesk_dbEscape($hesk_settings['db_pfix']) . 'tickets` + WHERE `ID` = ' . hesk_dbEscape($ticket['parent'])); + $parent = hesk_dbFetchAssoc($parentRs); echo ' '; echo ' ' . $parent['trackid'] . ''; @@ -792,7 +793,7 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php'); $hasRows = false; $childrenRS = hesk_dbQuery('SELECT * FROM `' . hesk_dbEscape($hesk_settings['db_pfix']) . 'tickets` WHERE `parent` = ' . hesk_dbEscape($ticket['id'])); - while ($row = $childrenRS->fetch_assoc()) { + while ($row = hesk_dbFetchAssoc($childrenRS)) { $hasRows = true; echo ' '; @@ -1045,7 +1046,8 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php'); } $isTicketClosedSql = 'SELECT `IsClosed`, `Closable` FROM `' . hesk_dbEscape($hesk_settings['db_pfix']) . 'statuses` WHERE `ID` = ' . $ticket['status']; - $isTicketClosedRow = hesk_dbQuery($isTicketClosedSql)->fetch_assoc(); + $isTicketClosedRs = hesk_dbQuery($isTicketClosedSql); + $isTicketClosedRow = hesk_dbFetchAssoc($isTicketClosedRs); $isTicketClosed = $isTicketClosedRow['IsClosed']; $isClosable = $isTicketClosedRow['Closable'] == 'yes' || $isTicketClosedRow['Closable'] == 'sonly'; diff --git a/admin/change_status.php b/admin/change_status.php index adf471d8..3e756fe5 100644 --- a/admin/change_status.php +++ b/admin/change_status.php @@ -59,7 +59,7 @@ $statusSql = "SELECT `ID` FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . " $status_options = array(); $results = hesk_dbQuery($statusSql); -while ($row = $results->fetch_assoc()) { +while ($row = hesk_dbFetchAssoc($results)) { $status_options[$row['ID']] = mfh_getDisplayTextForStatusId($row['ID']); } diff --git a/admin/lock.php b/admin/lock.php index d1f58187..8f8d5d6d 100644 --- a/admin/lock.php +++ b/admin/lock.php @@ -94,7 +94,8 @@ if (empty($_GET['locked'])) { /* Update database */ $statusSql = 'SELECT `ID` FROM `' . hesk_dbEscape($hesk_settings['db_pfix']) . 'statuses` WHERE `LockedTicketStatus` = 1'; -$statusRow = hesk_dbQuery($statusSql)->fetch_assoc(); +$statusRs = hesk_dbQuery($statusSql); +$statusRow = hesk_dbFetchAssoc($statusSql); $statusId = $statusRow['ID']; hesk_dbQuery("UPDATE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "tickets` SET `status`='{$statusId}',`locked`='{$status}' $closedby_sql , `history`=CONCAT(`history`,'" . hesk_dbEscape($revision) . "') WHERE `trackid`='" . hesk_dbEscape($trackingID) . "' LIMIT 1"); diff --git a/install/mods-for-hesk/sql/installSql.php b/install/mods-for-hesk/sql/installSql.php index a628dade..4ae4a69c 100644 --- a/install/mods-for-hesk/sql/installSql.php +++ b/install/mods-for-hesk/sql/installSql.php @@ -47,7 +47,7 @@ function executePre140Scripts() executeQuery("ALTER TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "tickets` ADD COLUMN `status_int` INT NOT NULL DEFAULT 0 AFTER `status`;"); $ticketsRS = executeQuery("SELECT `id`, `status` FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "tickets`;"); - while ($currentResult = $ticketsRS->fetch_assoc()) { + while ($currentResult = hesk_dbFetchAssoc($ticketsRS)) { executeQuery("UPDATE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "tickets` SET `status_int` = " . $currentResult['status'] . " WHERE `id` = " . $currentResult['id']); } diff --git a/install/mods-for-hesk/sql/uninstallSql.php b/install/mods-for-hesk/sql/uninstallSql.php index ecad5fe6..0ad1c651 100644 --- a/install/mods-for-hesk/sql/uninstallSql.php +++ b/install/mods-for-hesk/sql/uninstallSql.php @@ -45,7 +45,7 @@ function replaceStatusColumn() executeQuery("ALTER TABLE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "tickets` ADD COLUMN `status_int` ENUM('0','1','2','3','4','5') NOT NULL AFTER `status`;"); $ticketsRS = executeQuery("SELECT `id`, `status` FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "tickets`;"); - while ($currentResult = $ticketsRS->fetch_assoc()) { + while ($currentResult = hesk_dbFetchAssoc($ticketsRS)) { executeQuery("UPDATE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "tickets` SET `status_int` = '" . intval($currentResult['status']) . "' WHERE `id` = " . $currentResult['id']); } diff --git a/reply_ticket.php b/reply_ticket.php index 99a112cf..13052cff 100644 --- a/reply_ticket.php +++ b/reply_ticket.php @@ -187,8 +187,10 @@ if ($hesk_settings['attachments']['use'] && !empty($attachments)) { // If staff hasn't replied yet, don't change the status; otherwise set it to the status for customer replies. $customerReplyStatusQuery = 'SELECT `ID` FROM `' . hesk_dbEscape($hesk_settings['db_pfix']) . 'statuses` WHERE `IsCustomerReplyStatus` = 1'; $defaultNewTicketStatusQuery = 'SELECT `ID` FROM `' . hesk_dbEscape($hesk_settings['db_pfix']) . 'statuses` WHERE `IsNewTicketStatus` = 1'; -$newStatus = hesk_dbQuery($customerReplyStatusQuery)->fetch_assoc(); -$defaultNewTicketStatus = hesk_dbQuery($defaultNewTicketStatusQuery)->fetch_assoc(); +$newStatusRs = hesk_dbQuery($customerReplyStatusQuery); +$newStatus = hesk_dbFetchAssoc($newStatusRs); +$defaultNewTicketStatusRs = hesk_dbQuery($defaultNewTicketStatusQuery); +$defaultNewTicketStatus = hesk_dbFetchAssoc($defaultNewTicketStatusRs); $ticket['status'] = $ticket['status'] == $defaultNewTicketStatus['ID'] ? $defaultNewTicketStatus['ID'] : $newStatus['ID']; diff --git a/verifyemail.php b/verifyemail.php index a9f57a83..72150119 100644 --- a/verifyemail.php +++ b/verifyemail.php @@ -36,11 +36,11 @@ require_once(HESK_PATH . 'inc/header.inc.php'); $email = ''; $getRs = hesk_dbQuery("SELECT `Email` FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "pending_verification_emails` WHERE `ActivationKey` = '" . hesk_dbEscape($key) . "'"); - while ($result = $getRs->fetch_assoc()) { + while ($result = hesk_dbFetchAssoc($getRs)) { $email = $result['Email']; $ticketRs = hesk_dbQuery("SELECT * FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "stage_tickets` WHERE `email` = '" . hesk_dbEscape($result['Email']) . "'"); - while ($innerResult = $ticketRs->fetch_assoc()) { + while ($innerResult = hesk_dbFetchAssoc($ticketRs)) { $ticket = hesk_newTicket($innerResult); // Notify the customer $modsForHesk_settings = mfh_getSettings(); @@ -49,7 +49,7 @@ require_once(HESK_PATH . 'inc/header.inc.php'); // Need to notify staff? // --> From autoassign? $getOwnerRs = hesk_dbQuery("SELECT * FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "users` WHERE ID = " . hesk_dbEscape($ticket['owner'])); - $autoassign_owner = $getOwnerRs->fetch_assoc(); + $autoassign_owner = hesk_dbFetchAssoc($getOwnerRs); if ($ticket['owner'] && $autoassign_owner['notify_assigned']) { hesk_notifyAssignedStaff($autoassign_owner, 'ticket_assigned_to_you', $modsForHesk_settings); } // --> No autoassign, find and notify appropriate staff