1 <& /elements/header.html, $title &>
3 % if ( $curuser->access_right('Edit prospect') ) {
4 <A HREF="<% $p %>edit/prospect_main.html?<% $prospectnum %>">Edit this prospect</A>
7 <TABLE CLASS="fsinnerbox">
9 %unless ( ! $prospect_main->refnum ) { # || scalar(@part_referral) == 1 ) {
10 % my $part_referral = qsearchs('part_referral',{ 'refnum' => $prospect_main->refnum } );
12 <TH ALIGN="right">Advertising source</TD>
13 <TD BGCOLOR="#ffffff"><% $part_referral->referral |h %></TD>
17 % if ( $prospect_main->company ) {
19 <TH ALIGN="right">Company</TD>
20 <TD BGCOLOR="#FFFFFF"><B><% $prospect_main->company |h %></B></TD>
24 % foreach my $prospect_contact ( $prospect_main->prospect_contact ) {
25 % my $contact = $prospect_contact->contact;
27 <TH ALIGN="right" VALIGN="top"><% $prospect_contact->contact_classname |h %> Contact</TH>
28 <TD BGCOLOR="#FFFFFF">
29 <% $contact->line |h %><br>
31 % for my $row ( $contact->contact_email ) {
32 <tr><th>E-Mail:</th><td><% $row->emailaddress |h %></td></tr>
34 % for my $row ( $contact->contact_phone ) {
35 <tr><th><% $row->phone_type->typename |h %>:</th><td><% $row->phonenum_pretty |h %></td></tr>
37 % if ( $prospect_contact->comment ) {
38 <tr><th>Comment:</th><td><% $prospect_contact->comment |h %></td></tr>
46 % qsearch('cust_location', { 'prospectnum' => $prospectnum } );
47 % #but only one, for now
48 % foreach my $cust_location (@cust_location) {
50 <TH ALIGN="right">Address</TD>
51 <TD BGCOLOR="#FFFFFF">
52 <% $cust_location->location_label(
53 'join_string' => '<BR>',
54 'double_space' => ' ',
55 'escape_function' => \&encode_entities,
60 % if ( $cust_location->latitude && $cust_location->longitude ) {
61 <& /elements/tr-coords.html, $cust_location->latitude,
62 $cust_location->longitude,
67 % if ( my $tax_status = $prospect_main->tax_status ) {
69 <TH ALIGN="right">Tax status</TD>
70 <TD BGCOLOR="#FFFFFF">
71 <B><% $tax_status->taxstatus %>:</B> <% $tax_status->description %>
80 <& /elements/quotations.html, prospect_main=>$prospect_main &>
82 % if ( $curuser->access_right('Qualify service') ) {
83 <% include( '/elements/popup_link-prospect_main.html',
84 'action' => $p. 'misc/qual.html',
85 'label' => 'New Qualification',
86 'actionlabel' => 'New Qualification',
88 'prospect_main' => $prospect_main,
89 'closetext' => 'Close',
94 | <A HREF="<%$p%>search/qual.cgi?prospectnum=<% $prospect_main->prospectnum %>">View Qualifications</A>
98 %# XXX display prospect tickets
102 my $curuser = $FS::CurrentUser::CurrentUser;
105 unless $curuser->access_right('View prospect');
108 if ( $cgi->param('prospectnum') =~ /^(\d+)$/ ) {
111 die "No prospect specified (bad URL)!" unless $cgi->keywords;
112 my($query) = $cgi->keywords; # needs parens with my, ->keywords returns array
117 my $prospect_main = qsearchs( {
118 'table' => 'prospect_main',
119 'hashref' => { 'prospectnum' => $prospectnum },
120 'extra_sql' => ' AND '. $curuser->agentnums_sql,
122 die "Prospect not found!" unless $prospect_main;
124 my $title = mt("Prospect"). ': '. $prospect_main->name;
125 $title .= ' ('.mt('DISABLED').')'
126 if $prospect_main->disabled;
128 my @agentnums = $curuser->agentnums;
129 if (scalar(@agentnums) > 1 ) {
130 $title = encode_entities($prospect_main->agent->agent). " $title";