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 % && !$curuser->access_right('View customers of all agents') ) {
19 % my $agent = qsearchs('agent',{ 'agentnum' => $prospect_main->agentnum } );
21 <TD ALIGN="right">Agent</TD>
22 <TD BGCOLOR="#ffffff"><% $agent->agentnum %>: <% $agent->agent %></TD>
27 <TD ALIGN="right">Company</TD>
28 <TD BGCOLOR="#FFFFFF"><B><% $prospect_main->company |h %></B></TD>
31 % foreach my $contact ( $prospect_main->contact ) {
33 <TD ALIGN="right">Contact</TD>
34 <TD BGCOLOR="#FFFFFF"><% $contact->line %></TD>
39 % qsearch('cust_location', { 'prospectnum' => $prospectnum } );
40 % #but only one, for now
41 % foreach my $cust_location (@cust_location) {
43 <TD ALIGN="right">Address</TD>
44 <TD BGCOLOR="#FFFFFF">
45 <% $cust_location->location_label(
46 'join_string' => '<BR>',
47 'double_space' => ' ',
48 'escape_function' => \&encode_entities,
59 <% ntable("#cccccc") %>
62 <TH CLASS="background" COLSPAN=2 ALIGN="left"><FONT SIZE="+1">Tickets</FONT></TH>
69 my $curuser = $FS::CurrentUser::CurrentUser;
72 unless $curuser->access_right('View prospect');
75 if ( $cgi->param('prospectnum') =~ /^(\d+)$/ ) {
78 die "No prospect specified (bad URL)!" unless $cgi->keywords;
79 my($query) = $cgi->keywords; # needs parens with my, ->keywords returns array
84 my $prospect_main = qsearchs( {
85 'table' => 'prospect_main',
86 'hashref' => { 'prospectnum' => $prospectnum },
87 'extra_sql' => ' AND '. $curuser->agentnums_sql,
89 die "Prospect not found!" unless $prospect_main;
91 my @agentnums = $curuser->agentnums;