'; hesk_process_messages($hesk_error_buffer,'NOREDIRECT'); print_form(); } } elseif ( empty($trackingID) || ( $hesk_settings['email_view_ticket'] && empty($my_email) ) ) { print_form(); } /* Connect to database */ hesk_dbConnect(); /* Limit brute force attempts */ hesk_limitBfAttempts(); /* Get ticket info */ $sql = "SELECT `t1`.* , `t2`.name AS `repliername` FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."tickets` AS `t1` LEFT JOIN `".hesk_dbEscape($hesk_settings['db_pfix'])."users` AS `t2` ON `t1`.`replierid` = `t2`.`id` WHERE `trackid`='".hesk_dbEscape($trackingID)."' LIMIT 1"; $res = hesk_dbQuery($sql); /* Ticket found? */ if (hesk_dbNumRows($res) != 1) { /* Ticket not found, perhaps it was merged with another ticket? */ $sql = "SELECT * FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."tickets` WHERE `merged` LIKE '%#".hesk_dbEscape($trackingID)."#%' LIMIT 1"; $res = hesk_dbQuery($sql); if (hesk_dbNumRows($res) == 1) { /* OK, found in a merged ticket. Get info */ $ticket = hesk_dbFetchAssoc($res); /* If we require e-mail to view tickets check if it matches the one from merged ticket */ if ( hesk_verifyEmailMatch($ticket['trackid'], $my_email, $ticket['email'], 0) ) { hesk_process_messages( sprintf($hesklang['tme'], $trackingID, $ticket['trackid']) ,'NOREDIRECT','NOTICE'); $trackingID = $ticket['trackid']; } else { hesk_process_messages( sprintf($hesklang['tme1'], $trackingID, $ticket['trackid']) . '

' . sprintf($hesklang['tme2'], $ticket['trackid']) ,'NOREDIRECT','NOTICE'); $trackingID = $ticket['trackid']; print_form(); } } else { /* Nothing found, error out */ hesk_process_messages($hesklang['ticket_not_found'],'NOREDIRECT'); print_form(); } } else { /* We have a match, get ticket info */ $ticket = hesk_dbFetchAssoc($res); /* If we require e-mail to view tickets check if it matches the one in database */ hesk_verifyEmailMatch($trackingID, $my_email, $ticket['email']); } /* Ticket exists, clean brute force attempts */ hesk_cleanBfAttempts(); /* Remember email address? */ if ($is_form) { if ( ! empty($_GET['r']) ) { setcookie('hesk_myemail', $my_email, strtotime('+1 year')); $do_remember = ' checked="checked" '; } elseif ( isset($_COOKIE['hesk_myemail']) ) { setcookie('hesk_myemail', ''); } } /* Set last replier name */ if ($ticket['lastreplier']) { if (empty($ticket['repliername'])) { $ticket['repliername'] = $hesklang['staff']; } } else { $ticket['repliername'] = $ticket['name']; } /* Get category name and ID */ $sql = "SELECT * FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."categories` WHERE `id`=".hesk_dbEscape($ticket['category'])." LIMIT 1"; $result = hesk_dbQuery($sql); /* If this category has been deleted use the default category with ID 1 */ if (hesk_dbNumRows($result) != 1) { $sql = "SELECT * FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."categories` WHERE `id`=1 LIMIT 1"; $result = hesk_dbQuery($sql); } $category = hesk_dbFetchAssoc($result); /* Get replies */ $sql = "SELECT * FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."replies` WHERE `replyto`='".hesk_dbEscape($ticket['id'])."' ORDER BY `id` "; $sql .= $hesk_settings['new_top'] ? 'DESC' : 'ASC'; $result = hesk_dbQuery($sql); $replies = hesk_dbNumRows($result); $unread_replies = array(); // Demo mode if ( defined('HESK_DEMO') ) { $ticket['email'] = 'xxxxx@yyyyy.com'; } /* Print header */ require_once(HESK_PATH . 'inc/header.inc.php'); ?>
> >

  '; } else { echo ''; } echo ' '; if ($hesk_settings['cust_urgency']) { echo ' '; } ?>
'.$hesklang['trackID'].': '.$trackingID.' ('.$hesklang['seqid'].': '.$ticket['id'].')
'.$hesklang['trackID'].': '.$trackingID.'
'.$hesklang['ticket_status'].': '; $random=rand(10000,99999); switch ($ticket['status']) { case 0: echo ''.$hesklang['open'].' ['.$hesklang['close_action'].']'; break; case 1: echo ''.$hesklang['wait_staff_reply'].' ['.$hesklang['close_action'].']'; break; case 2: echo ''.$hesklang['wait_cust_reply'].' ['.$hesklang['close_action'].']'; break; case 4: echo ''.$hesklang['in_progress'].' ['.$hesklang['close_action'].']'; break; case 5: echo ''.$hesklang['on_hold'].' ['.$hesklang['close_action'].']'; break; default: echo ''.$hesklang['closed'].''; if ($ticket['locked'] != 1 && $hesk_settings['custopen']) { echo ' ['.$hesklang['open_action'].']'; } } echo '
'.$hesklang['created_on'].': '.hesk_date($ticket['dt']).'
'.$hesklang['last_update'].': '.hesk_date($ticket['lastchange']).'
'.$hesklang['last_replier'].': '.$ticket['repliername'].'
'.$hesklang['category'].': '.$category['name'].'
'.$hesklang['replies'].': '.$replies.'
'.$hesklang['priority'].': '; if ($ticket['priority']==0) {echo ''.$hesklang['critical'].'';} elseif ($ticket['priority']==1) {echo ''.$hesklang['high'].'';} elseif ($ticket['priority']==2) {echo ''.$hesklang['medium'].'';} else {echo $hesklang['low'];} echo '
 

 
>
:
:
:
$v) { if ($v['use'] && $v['place']==0) { if ($print_table == 0) { echo ''; $print_table = 1; } echo ' '; } } if ($print_table) { echo '
'.$v['name'].': '.$ticket[$k].'
'; } ?>

:


 

$v) { if ($v['use'] && $v['place']) { if ($print_table == 0) { echo ''; $print_table = 1; } echo ' '; } } if ($print_table) { echo '
'.$v['name'].': '.$ticket[$k].'
'; } /* Print attachments */ hesk_listAttachments($ticket['attachments'], $i); ?>
 
> >
 
 

   
  :

 
  :

 

 
 
   
 
 


 


 

  

 


 

: *

' . $hesklang['ful'] . '):
'; for ($i=1;$i<=$hesk_settings['attachments']['max_number'];$i++) { echo '
'; } ?>  

'; } ?>

 
>
:
:

:

'.$hesklang['rnh'].'

'; } elseif ($reply['rating']==5) { echo '

'.$hesklang['rh'].'

'; } else { echo '
'.$hesklang['r'].' '.strtolower($hesklang['yes']).' / '.strtolower($hesklang['no']).'
'; } } ?> '.$hesklang['attachments'].':
'; $att=explode(',',substr($attachments, 0, -1)); foreach ($att as $myatt) { list($att_id, $att_name) = explode('#', $myatt); echo ' '.$hesklang['dnl'].' '.$att_name.' '.$att_name.'
'; } echo '

'; return true; } // End hesk_listAttachments() function hesk_getCustomerButtons($white=1) { global $hesk_settings, $hesklang, $trackingID; $options = ''; /* Style and mousover/mousout */ $tmp = $white ? 'White' : 'Blue'; $style = 'class="option'.$tmp.'OFF" onmouseover="this.className=\'option'.$tmp.'ON\'" onmouseout="this.className=\'option'.$tmp.'OFF\'"'; /* Print ticket button */ $options .= ''.$hesklang['printer_friendly'].' '; /* Return generated HTML */ return $options; } // END hesk_getCustomerButtons() ?>