#209 View ticket on admin side now supports new statuses

merge-requests/2/head
Mike Koch 9 years ago
parent 98ee61ff6d
commit 22e8a8efe9

@ -677,9 +677,9 @@ if($ticket['email'] != '') {
$recentTicketsWithStatuses = array(); $recentTicketsWithStatuses = array();
foreach ($recentTickets as $recentTicket) { foreach ($recentTickets as $recentTicket) {
$newRecentTicket = $recentTicket; $newRecentTicket = $recentTicket;
$thisTicketStatusRS = hesk_dbQuery("SELECT * FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "statuses` WHERE `ID` = " . intval($recentTicket['status'])); $thisTicketStatusRS = hesk_dbQuery("SELECT `ID`, `TextColor` FROM `" . hesk_dbEscape($hesk_settings['db_pfix']) . "statuses` WHERE `ID` = " . intval($recentTicket['status']));
$theStatusRow = hesk_dbFetchAssoc($thisTicketStatusRS); $theStatusRow = hesk_dbFetchAssoc($thisTicketStatusRS);
$newRecentTicket['statusText'] = $hesklang[$theStatusRow['Key']]; $newRecentTicket['statusText'] = mfh_getDisplayTextForStatusId($theStatusRow['ID']);
$newRecentTicket['statusColor'] = $theStatusRow['TextColor']; $newRecentTicket['statusColor'] = $theStatusRow['TextColor'];
array_push($recentTicketsWithStatuses, $newRecentTicket); array_push($recentTicketsWithStatuses, $newRecentTicket);
} }
@ -975,11 +975,11 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
<?php <?php
$random=rand(10000,99999); $random=rand(10000,99999);
$statusSql = 'SELECT `ID`, `Key`, `IsStaffClosedOption`, `IsStaffReopenedStatus` FROM `'.hesk_dbEscape($hesk_settings['db_pfix']).'statuses` WHERE `IsStaffClosedOption` = 1 OR `IsStaffReopenedStatus` = 1'; $statusSql = 'SELECT `ID`, `IsStaffClosedOption`, `IsStaffReopenedStatus` FROM `'.hesk_dbEscape($hesk_settings['db_pfix']).'statuses` WHERE `IsStaffClosedOption` = 1 OR `IsStaffReopenedStatus` = 1';
$statusRs = hesk_dbQuery($statusSql); $statusRs = hesk_dbQuery($statusSql);
$staffClosedOptionStatus = array(); $staffClosedOptionStatus = array();
$staffReopenedStatus = array(); $staffReopenedStatus = array();
while ($statusRow = $statusRs->fetch_assoc()) while ($statusRow = hesk_dbFetchAssoc($statusRs))
{ {
if ($statusRow['IsStaffReopenedStatus'] == 1) if ($statusRow['IsStaffReopenedStatus'] == 1)
{ {
@ -1079,11 +1079,11 @@ require_once(HESK_PATH . 'inc/show_admin_nav.inc.php');
echo '<div class="col-md-3 col-sm-12 ticket-cell-admin"><p class="ticketPropertyTitle">'.$hesklang['status'].'</p>'; echo '<div class="col-md-3 col-sm-12 ticket-cell-admin"><p class="ticketPropertyTitle">'.$hesklang['status'].'</p>';
$status_options = array(); $status_options = array();
$results = hesk_dbQuery("SELECT `ID`, `Key` FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."statuses`"); $results = hesk_dbQuery("SELECT `ID`FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."statuses`");
while ($row = $results->fetch_assoc()) while ($row = hesk_dbFetchAssoc($results))
{ {
$selected = $ticket['status'] == $row['ID'] ? 'selected' : ''; $selected = $ticket['status'] == $row['ID'] ? 'selected' : '';
$status_options[$row['ID']] = '<option value="'.$row['ID'].'" '.$selected.'>'.$hesklang[$row['Key']].'</option>'; $status_options[$row['ID']] = '<option value="'.$row['ID'].'" '.$selected.'>'.mfh_getDisplayTextForStatusId($row['ID']).'</option>';
} }
echo ' echo '
@ -2033,7 +2033,7 @@ function hesk_printReplyForm() {
</a></li> </a></li>
<li class="divider"></li> <li class="divider"></li>
<?php <?php
$allStatusesRs = hesk_dbQuery('SELECT `ID`, `Key`, `TextColor` FROM `'.hesk_dbEscape($hesk_settings['db_pfix']).'statuses`'); $allStatusesRs = hesk_dbQuery('SELECT `ID`, `TextColor` FROM `'.hesk_dbEscape($hesk_settings['db_pfix']).'statuses`');
$statuses = array(); $statuses = array();
while ($row = hesk_dbFetchAssoc($allStatusesRs)) { while ($row = hesk_dbFetchAssoc($allStatusesRs)) {
array_push($statuses, $row); array_push($statuses, $row);
@ -2043,7 +2043,7 @@ function hesk_printReplyForm() {
echo '<li><a> echo '<li><a>
<button class="dropdown-submit" type="submit" name="submit_as_status" value="'.$status['ID'].'""> <button class="dropdown-submit" type="submit" name="submit_as_status" value="'.$status['ID'].'"">
'.$hesklang['submit_reply'].' '.$hesklang['and_change_status_to'].' <b> '.$hesklang['submit_reply'].' '.$hesklang['and_change_status_to'].' <b>
<span style="color:'.$status['TextColor'].'">'.$hesklang[$status['Key']].'</span></b> <span style="color:'.$status['TextColor'].'">'.mfh_getDisplayTextForStatusId($status['ID']).'</span></b>
</button> </button>
</a></li>'; </a></li>';
} }

Loading…
Cancel
Save