1 <& /elements/header.html, 'Prospect View: '. $prospect_main->company &>
3 % if ( $curuser->access_right('Edit prospect') ) {
4 <A HREF="<% $p %>edit/prospect_main.html?<% $prospectnum %>">Edit this prospect</A>
7 <% ntable("#cccccc",2) %>
10 <TD ALIGN="right">Prospect #</TD>
11 <TD BGCOLOR="#FFFFFF"><B><% $prospectnum %></B>
12 % if ( $prospect_main->disabled ) {
18 %unless ( scalar(@agentnums) == 1
19 % && !$curuser->access_right('View customers of all agents') ) {
20 % my $agent = qsearchs('agent',{ 'agentnum' => $prospect_main->agentnum } );
22 <TD ALIGN="right">Agent</TD>
23 <TD BGCOLOR="#ffffff"><% $agent->agentnum %>: <% $agent->agent |h %></TD>
27 %unless ( ! $prospect_main->refnum ) { # || scalar(@part_referral) == 1 ) {
28 % my $part_referral = qsearchs('part_referral',{ 'refnum' => $prospect_main->refnum } );
30 <TD ALIGN="right">Advertising source</TD>
31 <TD BGCOLOR="#ffffff"><% $part_referral->referral |h %></TD>
35 % if ( $prospect_main->company ) {
37 <TD ALIGN="right">Company</TD>
38 <TD BGCOLOR="#FFFFFF"><B><% $prospect_main->company |h %></B></TD>
42 % foreach my $contact ( $prospect_main->contact ) {
44 <TD ALIGN="right"><% $contact->contact_classname %> Contact</TD>
45 <TD BGCOLOR="#FFFFFF"><% $contact->line %></TD>
50 % qsearch('cust_location', { 'prospectnum' => $prospectnum } );
51 % #but only one, for now
52 % foreach my $cust_location (@cust_location) {
54 <TD ALIGN="right">Address</TD>
55 <TD BGCOLOR="#FFFFFF">
56 <% $cust_location->location_label(
57 'join_string' => '<BR>',
58 'double_space' => ' ',
59 'escape_function' => \&encode_entities,
64 % if ( $cust_location->latitude && $cust_location->longitude ) {
65 <& /elements/tr-coords.html, $cust_location->latitude,
66 $cust_location->longitude,
76 <& /elements/quotations.html, prospect_main=>$prospect_main &>
78 % if ( $curuser->access_right('Qualify service') ) {
79 <% include( '/elements/popup_link-prospect_main.html',
80 'action' => $p. 'misc/qual.html',
81 'label' => 'New Qualification',
82 'actionlabel' => 'New Qualification',
84 'prospect_main' => $prospect_main,
85 'closetext' => 'Close',
90 | <A HREF="<%$p%>search/qual.cgi?prospectnum=<% $prospect_main->prospectnum %>">View Qualifications</A>
95 <% ntable("#cccccc") %>
98 <TH CLASS="background" COLSPAN=2 ALIGN="left"><FONT SIZE="+1">Tickets</FONT></TH>
106 my $curuser = $FS::CurrentUser::CurrentUser;
109 unless $curuser->access_right('View prospect');
112 if ( $cgi->param('prospectnum') =~ /^(\d+)$/ ) {
115 die "No prospect specified (bad URL)!" unless $cgi->keywords;
116 my($query) = $cgi->keywords; # needs parens with my, ->keywords returns array
121 my $prospect_main = qsearchs( {
122 'table' => 'prospect_main',
123 'hashref' => { 'prospectnum' => $prospectnum },
124 'extra_sql' => ' AND '. $curuser->agentnums_sql,
126 die "Prospect not found!" unless $prospect_main;
128 my @agentnums = $curuser->agentnums;