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>
26 % if ( $prospect_main->company ) {
28 <TD ALIGN="right">Company</TD>
29 <TD BGCOLOR="#FFFFFF"><B><% $prospect_main->company |h %></B></TD>
33 % foreach my $contact ( $prospect_main->contact ) {
35 <TD ALIGN="right">Contact</TD>
36 <TD BGCOLOR="#FFFFFF"><% $contact->line %></TD>
41 % qsearch('cust_location', { 'prospectnum' => $prospectnum } );
42 % #but only one, for now
43 % foreach my $cust_location (@cust_location) {
45 <TD ALIGN="right">Address</TD>
46 <TD BGCOLOR="#FFFFFF">
47 <% $cust_location->location_label(
48 'join_string' => '<BR>',
49 'double_space' => ' ',
50 'escape_function' => \&encode_entities,
61 % if ( $curuser->access_right('Qualify service') ) {
62 <% include( '/elements/popup_link-prospect_main.html',
63 'action' => $p. 'misc/qual.html',
64 'label' => 'New Qualification',
65 'actionlabel' => 'New Qualification',
67 'prospect_main' => $prospect_main,
68 'closetext' => 'Close',
73 | <A HREF="<%$p%>search/qual.cgi?prospectnum=<% $prospect_main->prospectnum %>">View Qualifications</A>
77 <% ntable("#cccccc") %>
80 <TH CLASS="background" COLSPAN=2 ALIGN="left"><FONT SIZE="+1">Tickets</FONT></TH>
87 my $curuser = $FS::CurrentUser::CurrentUser;
90 unless $curuser->access_right('View prospect');
93 if ( $cgi->param('prospectnum') =~ /^(\d+)$/ ) {
96 die "No prospect specified (bad URL)!" unless $cgi->keywords;
97 my($query) = $cgi->keywords; # needs parens with my, ->keywords returns array
102 my $prospect_main = qsearchs( {
103 'table' => 'prospect_main',
104 'hashref' => { 'prospectnum' => $prospectnum },
105 'extra_sql' => ' AND '. $curuser->agentnums_sql,
107 die "Prospect not found!" unless $prospect_main;
109 my @agentnums = $curuser->agentnums;