communigate provisioning phase 2: add svc_domain.trailer -> communigate TrailerText...
[freeside.git] / httemplate / view / prospect_main.html
1 <% include('/elements/header.html',
2              'Prospect View: '. $prospect_main->company
3           )
4 %>
5
6 % if ( $curuser->access_right('Edit prospect') ) { 
7   <A HREF="<% $p %>edit/prospect_main.html?<% $prospectnum %>">Edit this prospect</A>
8 % } 
9
10 <% ntable("#cccccc",2) %>
11
12 <TR>
13   <TD ALIGN="right">Prospect #</TD>
14   <TD BGCOLOR="#FFFFFF"><B><% $prospectnum %></B></TD>
15 </TR>
16
17 %unless ( scalar(@agentnums) == 1 ) {
18 %  my $agent = qsearchs('agent',{ 'agentnum' => $prospect_main->agentnum } );
19    <TR>
20      <TD ALIGN="right">Agent</TD>
21      <TD BGCOLOR="#ffffff"><% $agent->agentnum %>: <% $agent->agent %></TD>
22    </TR>
23 %}
24
25 <TR>
26   <TD ALIGN="right">Company</TD>
27   <TD BGCOLOR="#FFFFFF"><B><% $prospect_main->company |h %></B></TD>
28 </TR>
29
30 % foreach my $contact ( $prospect_main->contact ) {
31     <TR>
32       <TD ALIGN="right">Contact</TD>
33       <TD BGCOLOR="#FFFFFF"><% $contact->line %></TD>
34     </TR>
35 %}
36
37 % my @cust_location =
38 %   qsearch('cust_location', { 'prospectnum' => $prospectnum } );
39 % #but only one, for now
40 % foreach my $cust_location (@cust_location) {
41     <TR>
42       <TD ALIGN="right">Address</TD>
43       <TD BGCOLOR="#FFFFFF">
44         <% $cust_location->location_label(
45              'join_string'     => '<BR>',
46              'double_space'    => ' &nbsp; ',
47              'escape_function' => \&encode_entities,
48            )
49         %>
50       </TD>
51   </TR>
52 % }
53
54 </TABLE>
55
56 <BR>
57
58 <% ntable("#cccccc") %>
59
60 <TR>
61   <TH BGCOLOR="#e8e8e8" COLSPAN=2 ALIGN="left"><FONT SIZE="+1">Tickets</FONT></TH>
62 </TR>
63
64 </TABLE>
65
66 <%init>
67
68 my $curuser = $FS::CurrentUser::CurrentUser;
69
70 die "access denied"
71   unless $curuser->access_right('View prospect');
72
73 my $prospectnum;
74 if ( $cgi->param('prospectnum') =~ /^(\d+)$/ ) {
75   $prospectnum = $1;
76 } else {
77   die "No prospect specified (bad URL)!" unless $cgi->keywords;
78   my($query) = $cgi->keywords; # needs parens with my, ->keywords returns array
79   $query =~ /^(\d+)$/;
80   $prospectnum = $1;
81 }
82
83 my $prospect_main = qsearchs( {
84   'table'     => 'prospect_main',
85   'hashref'   => { 'prospectnum' => $prospectnum },
86   'extra_sql' => ' AND '. $curuser->agentnums_sql,
87 });
88 die "Prospect not found!" unless $prospect_main;
89
90 my @agentnums = $curuser->agentnums;
91
92 </%init>