Update print and reply_ticket
This commit is contained in:
parent
7d7e1bd1c4
commit
1224ea8d23
24
print.php
24
print.php
@ -55,6 +55,9 @@ $trackingID = hesk_cleanID('p_track') or die("$hesklang[int_error]: $hesklang[no
|
||||
/* Connect to database */
|
||||
hesk_dbConnect();
|
||||
|
||||
// Load custom fields
|
||||
require_once(HESK_PATH . 'inc/custom_fields.inc.php');
|
||||
|
||||
// Perform additional checks for customers
|
||||
if (empty($_SESSION['id'])) {
|
||||
// Are we in maintenance mode?
|
||||
@ -218,15 +221,17 @@ echo '</tr>';
|
||||
$num_cols = 0;
|
||||
echo '<tr>';
|
||||
foreach ($hesk_settings['custom_fields'] as $k => $v) {
|
||||
if ($v['use']) {
|
||||
if ($modsForHesk_settings['custom_field_setting']) {
|
||||
$v['name'] = $hesklang[$v['name']];
|
||||
}
|
||||
|
||||
if (($v['use'] == 1 || (! empty($_SESSION['id']) && $v['use'] == 2)) && hesk_is_custom_field_in_category($k, $ticket['category'])) {
|
||||
if ($num_cols == 3) {
|
||||
echo '</tr><tr>';
|
||||
$num_cols = 0;
|
||||
}
|
||||
|
||||
switch ($v['type']) {
|
||||
case 'date':
|
||||
$ticket[$k] = hesk_custom_date_display_format($ticket[$k], $v['value']['date_format']);
|
||||
break;
|
||||
}
|
||||
?>
|
||||
<td bgcolor="#EEE"><b><?php echo $v['name']; ?>:</b></td>
|
||||
<td bgcolor="#DDD"><?php echo hesk_unhortenUrl($ticket[$k]); ?></td>
|
||||
@ -239,11 +244,14 @@ foreach ($hesk_settings['custom_fields'] as $k => $v) {
|
||||
echo '</table><br>';
|
||||
|
||||
// Print initial ticket message
|
||||
$newMessage = hesk_unhortenUrl($ticket['message']);
|
||||
if ($ticket['html']) {
|
||||
if ($ticket['message'] != '') {
|
||||
$newMessage = hesk_unhortenUrl($ticket['message']);
|
||||
if ($ticket['html']) {
|
||||
$newMessage = hesk_html_entity_decode($newMessage);
|
||||
}
|
||||
echo '<p>' . $newMessage . '</p>';
|
||||
}
|
||||
echo '<p>' . $newMessage . '</p>';
|
||||
|
||||
|
||||
// Print replies
|
||||
while ($reply = hesk_dbFetchAssoc($res)) {
|
||||
|
@ -185,17 +185,19 @@ 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';
|
||||
$newStatusRs = hesk_dbQuery($customerReplyStatusQuery);
|
||||
$newStatus = hesk_dbFetchAssoc($newStatusRs);
|
||||
$defaultNewTicketStatusRs = hesk_dbQuery($defaultNewTicketStatusQuery);
|
||||
$defaultNewTicketStatus = hesk_dbFetchAssoc($defaultNewTicketStatusRs);
|
||||
if (hesk_can_customer_change_status($ticket['status'])) {
|
||||
$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';
|
||||
$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'];
|
||||
$ticket['status'] = $ticket['status'] == $defaultNewTicketStatus['ID'] ? $defaultNewTicketStatus['ID'] : $newStatus['ID'];
|
||||
}
|
||||
|
||||
/* Update ticket as necessary */
|
||||
$res = hesk_dbQuery("UPDATE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "tickets` SET `lastchange`=NOW(), `status`='{$ticket['status']}', `replies`=`replies`+1, `lastreplier`='0' WHERE `id`='{$ticket['id']}' LIMIT 1");
|
||||
$res = hesk_dbQuery("UPDATE `" . hesk_dbEscape($hesk_settings['db_pfix']) . "tickets` SET `lastchange`=NOW(), `status`='{$ticket['status']}', `replies`=`replies`+1, `lastreplier`='0' WHERE `id`='{$ticket['id']}'");
|
||||
|
||||
// Insert reply into database
|
||||
$modsForHesk_settings = mfh_getSettings();
|
||||
|
Loading…
x
Reference in New Issue
Block a user