1 <% include('/elements/header.html',
2 'Prospect View: '. $prospect_main->company
6 % if ( $curuser->access_right('Edit prospect') ) {
7 <A HREF="<% $p %>edit/prospect_main.html?<% $prospectnum %>">Edit this prospect</A>
10 <% ntable("#cccccc",2) %>
13 <TD ALIGN="right">Prospect #</TD>
14 <TD BGCOLOR="#FFFFFF"><B><% $prospectnum %></B></TD>
17 %unless ( scalar(@agentnums) == 1 ) {
18 % my $agent = qsearchs('agent',{ 'agentnum' => $prospect_main->agentnum } );
20 <TD ALIGN="right">Agent</TD>
21 <TD BGCOLOR="#ffffff"><% $agent->agentnum %>: <% $agent->agent %></TD>
26 <TD ALIGN="right">Company</TD>
27 <TD BGCOLOR="#FFFFFF"><B><% $prospect_main->company |h %></B></TD>
30 % foreach my $contact ( $prospect_main->contact ) {
32 <TD ALIGN="right">Contact</TD>
33 <TD BGCOLOR="#FFFFFF"><% $contact->line %></TD>
38 % qsearch('cust_location', { 'prospectnum' => $prospectnum } );
39 % #but only one, for now
40 % foreach my $cust_location (@cust_location) {
42 <TD ALIGN="right">Address</TD>
43 <TD BGCOLOR="#FFFFFF">
44 <% $cust_location->location_label(
45 'join_string' => '<BR>',
46 'double_space' => ' ',
47 'escape_function' => \&encode_entities,
58 <% ntable("#cccccc") %>
61 <TH BGCOLOR="#e8e8e8" COLSPAN=2 ALIGN="left"><FONT SIZE="+1">Tickets</FONT></TH>
68 my $curuser = $FS::CurrentUser::CurrentUser;
71 unless $curuser->access_right('View prospect');
74 if ( $cgi->param('prospectnum') =~ /^(\d+)$/ ) {
77 die "No prospect specified (bad URL)!" unless $cgi->keywords;
78 my($query) = $cgi->keywords; # needs parens with my, ->keywords returns array
83 my $prospect_main = qsearchs( {
84 'table' => 'prospect_main',
85 'hashref' => { 'prospectnum' => $prospectnum },
86 'extra_sql' => ' AND '. $curuser->agentnums_sql,
88 die "Prospect not found!" unless $prospect_main;
90 my @agentnums = $curuser->agentnums;