diff --git a/inc/ticket_list.inc.php b/inc/ticket_list.inc.php
index 32c32b8e..0109dbf6 100644
--- a/inc/ticket_list.inc.php
+++ b/inc/ticket_list.inc.php
@@ -1,7 +1,7 @@
0)
while ($ticket=hesk_dbFetchAssoc($result))
{
+ // Are we grouping tickets?
if ($group)
{
require(HESK_PATH . 'inc/print_group.inc.php');
@@ -284,15 +285,7 @@ if ($total > 0)
$first_line = $hesklang['taso3'] . ' ' . $admins[$ticket['owner']] . " \n\n";
}
- $tagged = '';
- if ($ticket['archive'])
- {
- $tagged = ' ';
- }
-
- $statusName = hesk_dbFetchAssoc(hesk_dbQuery("SELECT `ShortNameContentKey`, `TextColor` FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."statuses` WHERE ID = ".$ticket['status']));
- $ticket['status']=''.$hesklang[$statusName['ShortNameContentKey']].'';
-
+ // Prepare ticket priority
switch ($ticket['priority'])
{
case 0:
@@ -310,35 +303,151 @@ if ($total > 0)
$ticket['priority']='';
}
- $ticket['lastchange']=hesk_time_since(strtotime($ticket['lastchange']));
+ // Set message (needed for row title)
+ $ticket['message'] = $first_line . substr(strip_tags($ticket['message']),0,200).'...';
+
+ // Start ticket row
+ echo '
+
+ |
+ ';
- if ($ticket['lastreplier'])
+ // Print sequential ID and link it to the ticket page
+ if ( hesk_show_column('id') )
+ {
+ echo ''.$ticket['id'].' | ';
+ }
+
+ // Print tracking ID and link it to the ticket page
+ if ( hesk_show_column('trackid') )
+ {
+ echo ''.$ticket['trackid'].' | ';
+ }
+
+ // Print date submitted
+ if ( hesk_show_column('dt') )
+ {
+ switch ($hesk_settings['updatedformat'])
+ {
+ case 1:
+ $ticket['dt'] = hesk_formatDate($ticket['dt']);
+ break;
+ case 2:
+ $ticket['dt'] = hesk_time_lastchange($ticket['dt']);
+ break;
+ default:
+ $ticket['dt'] = hesk_time_since( strtotime($ticket['dt']) );
+ }
+ echo ''.$ticket['dt'].' | ';
+ }
+
+ // Print last modified
+ if ( hesk_show_column('lastchange') )
{
- $ticket['repliername'] = isset($admins[$ticket['replierid']]) ? $admins[$ticket['replierid']] : $hesklang['staff'];
+ switch ($hesk_settings['updatedformat'])
+ {
+ case 1:
+ $ticket['lastchange'] = hesk_formatDate($ticket['lastchange']);
+ break;
+ case 2:
+ $ticket['lastchange'] = hesk_time_lastchange($ticket['lastchange']);
+ break;
+ default:
+ $ticket['lastchange'] = hesk_time_since( strtotime($ticket['lastchange']) );
+ }
+ echo ''.$ticket['lastchange'].' | ';
}
- else
+
+ // Print ticket category
+ if ( hesk_show_column('category') )
{
- $ticket['repliername'] = $ticket['name'];
+ $ticket['category'] = isset($hesk_settings['categories'][$ticket['category']]) ? $hesk_settings['categories'][$ticket['category']] : $hesklang['catd'];
+ echo ''.$ticket['category'].' | ';
}
- $ticket['archive'] = !($ticket['archive']) ? $hesklang['no'] : $hesklang['yes'];
+ // Print customer name
+ if ( hesk_show_column('name') )
+ {
+ echo ''.$ticket['name'].' | ';
+ }
+
+ // Print customer email
+ if ( hesk_show_column('email') )
+ {
+ echo ''.$hesklang['clickemail'].' | ';
+ }
+
+ // Print subject and link to the ticket page
+ if ( hesk_show_column('subject') )
+ {
+ echo ''.($ticket['archive'] ? ' ' : '').$owner.''.$ticket['subject'].' | ';
+ }
+
+ // Print ticket status
+ if ( hesk_show_column('status') )
+ {
+ $statusName = hesk_dbFetchAssoc(hesk_dbQuery("SELECT `ShortNameContentKey`, `TextColor` FROM `".hesk_dbEscape($hesk_settings['db_pfix'])."statuses` WHERE ID = ".$ticket['status']));
+ $ticket['status']=''.$hesklang[$statusName['ShortNameContentKey']].'';
+ echo ''.$ticket['status'].' | ';
+ }
+
+ // Print ticket owner
+ if ( hesk_show_column('owner') )
+ {
+ if ($ticket['owner'])
+ {
+ $ticket['owner'] = isset($admins[$ticket['owner']]) ? $admins[$ticket['owner']] : $hesklang['unas'];
+ }
+ else
+ {
+ $ticket['owner'] = $hesklang['unas'];
+ }
+ echo ''.$ticket['owner'].' | ';
+ }
+
+ // Print number of all replies
+ if ( hesk_show_column('replies') )
+ {
+ echo ''.$ticket['replies'].' | ';
+ }
- $ticket['message'] = $first_line . substr(strip_tags($ticket['message']),0,200).'...';
-
+ // Print number of staff replies
+ if ( hesk_show_column('staffreplies') )
+ {
+ echo ''.$ticket['staffreplies'].' | ';
+ }
- echo <<
- |
- $ticket[trackid] |
- $ticket[lastchange] |
- $ticket[name] |
- $tagged$owner$ticket[subject] |
- $ticket[status] |
- $ticket[repliername] |
- $ticket[priority] |
-
+ // Print last replier
+ if ( hesk_show_column('lastreplier') )
+ {
+ if ($ticket['lastreplier'])
+ {
+ $ticket['repliername'] = isset($admins[$ticket['replierid']]) ? $admins[$ticket['replierid']] : $hesklang['staff'];
+ }
+ else
+ {
+ $ticket['repliername'] = $ticket['name'];
+ }
+ echo ''.$ticket['repliername'].' | ';
+ }
-EOC;
+ // Print time worked
+ if ( hesk_show_column('time_worked') )
+ {
+ echo ''.$ticket['time_worked'].' | ';
+ }
+
+ // Print custom fields
+ foreach ($hesk_settings['custom_fields'] as $key => $value)
+ {
+ if ($value['use'] && hesk_show_column($key) )
+ echo ''.$ticket[$key].' | ';
+ }
+
+ // End ticket row
+ echo '
+ '.$ticket['priority'].' |
+ ';
} // End while
?>
@@ -349,7 +458,11 @@ EOC;
|