summaryrefslogtreecommitdiff
path: root/httemplate/view/cust_main/tickets.html
blob: b5d581d5022e1bc2f251299e90c65aa0234772e3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
<A NAME="tickets"><FONT SIZE="+2">Tickets</FONT></A>
<BR>

(<A HREF="<% $open_link %>">View <% $openlabel %> tickets for this customer</A>)
(<A HREF="<% $res_link  %>">View resolved tickets for this customer</A>)
<BR>
(<A HREF="<% $new_link  %>">Create new ticket for this customer</A>)

<% include("/elements/table-grid.html") %>
% my $bgcolor1 = '#eeeeee';
%   my $bgcolor2 = '#ffffff';
%   my $bgcolor = '';

<TR>
  <TH CLASS="grid" BGCOLOR="#cccccc">#</TH>
  <TH CLASS="grid" BGCOLOR="#cccccc">Subject</TH>
  <TH CLASS="grid" BGCOLOR="#cccccc">Status</TH>
  <TH CLASS="grid" BGCOLOR="#cccccc">Queue</TH>
  <TH CLASS="grid" BGCOLOR="#cccccc">Owner</TH>
  <TH CLASS="grid" BGCOLOR="#cccccc">Priority</TH>
</TR>

% foreach my $ticket ( @tickets ) {
%     my $href = FS::TicketSystem->href_ticket($ticket->{id});
%     if ( $bgcolor eq $bgcolor1 ) {
%       $bgcolor = $bgcolor2;
%     } else {
%       $bgcolor = $bgcolor1;
%     }

  <TR>
  
    <TD CLASS="grid" BGCOLOR="<% $bgcolor %>">
      <A HREF=<%$href%>><% $ticket->{id} %></A>
    </TD>
  
    <TD CLASS="grid" BGCOLOR="<% $bgcolor %>">
      <A HREF=<%$href%>><% $ticket->{subject} %></A>
    </TD>
  
    <TD CLASS="grid" BGCOLOR="<% $bgcolor %>">
      <% $ticket->{status} %>
    </TD>
  
    <TD CLASS="grid" BGCOLOR="<% $bgcolor %>">
      <% $ticket->{queue} %>
    </TD>
  
    <TD CLASS="grid" BGCOLOR="<% $bgcolor %>">
      <% $ticket->{owner} %>
    </TD>
  
    <TD ALIGN="right" CLASS="grid" BGCOLOR="<% $bgcolor %>">
      <% $ticket->{content}
           ? $ticket->{content}.' ('.$ticket->{priority}.')'
           : $ticket->{priority}
      %>
    </TD>
  
  </TR>

% } 

</TABLE>

<%init>

my( $cust_main ) = @_;
my( @tickets )  = $cust_main->tickets;

my $open_link = FS::TicketSystem->href_customer_tickets($cust_main->custnum);
my $openlabel = join('/', FS::TicketSystem->statuses );

my $res_link  = FS::TicketSystem->href_customer_tickets(
                  $cust_main->custnum,
                  { 'statuses' => [ 'resolved' ] }
                );

my $new_link = FS::TicketSystem->href_new_ticket(
                 $cust_main,
                 join(', ', $cust_main->invoicing_list_emailonly )
               );

</%init>