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"><% $prospect_contact->contact_classname %> Contact</TD>
28 <TD BGCOLOR="#FFFFFF"><% $contact->line %></TD>
33 % qsearch('cust_location', { 'prospectnum' => $prospectnum } );
34 % #but only one, for now
35 % foreach my $cust_location (@cust_location) {
37 <TH ALIGN="right">Address</TD>
38 <TD BGCOLOR="#FFFFFF">
39 <% $cust_location->location_label(
40 'join_string' => '<BR>',
41 'double_space' => ' ',
42 'escape_function' => \&encode_entities,
47 % if ( $cust_location->latitude && $cust_location->longitude ) {
48 <& /elements/tr-coords.html, $cust_location->latitude,
49 $cust_location->longitude,
54 % if ( my $tax_status = $prospect_main->tax_status ) {
56 <TH ALIGN="right">Tax status</TD>
57 <TD BGCOLOR="#FFFFFF">
58 <B><% $tax_status->taxstatus %>:</B> <% $tax_status->description %>
67 <& /elements/quotations.html, prospect_main=>$prospect_main &>
69 % if ( $curuser->access_right('Qualify service') ) {
70 <% include( '/elements/popup_link-prospect_main.html',
71 'action' => $p. 'misc/qual.html',
72 'label' => 'New Qualification',
73 'actionlabel' => 'New Qualification',
75 'prospect_main' => $prospect_main,
76 'closetext' => 'Close',
81 | <A HREF="<%$p%>search/qual.cgi?prospectnum=<% $prospect_main->prospectnum %>">View Qualifications</A>
85 %# XXX display prospect tickets
89 my $curuser = $FS::CurrentUser::CurrentUser;
92 unless $curuser->access_right('View prospect');
95 if ( $cgi->param('prospectnum') =~ /^(\d+)$/ ) {
98 die "No prospect specified (bad URL)!" unless $cgi->keywords;
99 my($query) = $cgi->keywords; # needs parens with my, ->keywords returns array
104 my $prospect_main = qsearchs( {
105 'table' => 'prospect_main',
106 'hashref' => { 'prospectnum' => $prospectnum },
107 'extra_sql' => ' AND '. $curuser->agentnums_sql,
109 die "Prospect not found!" unless $prospect_main;
111 my $title = encode_entities($prospect_main->name);
112 $title = mt("Prospect"). ": $title";
113 $title .= ' ('.mt('DISABLED').')'
114 if $prospect_main->disabled;
116 my @agentnums = $curuser->agentnums;
117 if (scalar(@agentnums) > 1 ) {
118 $title = encode_entities($prospect_main->agent->agent). " $title";