X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;ds=sidebyside;f=httemplate%2Fview%2Fprospect_main.html;fp=httemplate%2Fview%2Fprospect_main.html;h=de446a9fbdb9b7e43a693d59ea24deec2ee7cb32;hb=03ceab71dad1e5eb366865d304e5e459cc905ce4;hp=0000000000000000000000000000000000000000;hpb=5950a980cef4968ac59ca8041d2204e6d98e7a3d;p=freeside.git
diff --git a/httemplate/view/prospect_main.html b/httemplate/view/prospect_main.html
new file mode 100644
index 000000000..de446a9fb
--- /dev/null
+++ b/httemplate/view/prospect_main.html
@@ -0,0 +1,92 @@
+<% include('/elements/header.html',
+ 'Prospect View: '. $prospect_main->company
+ )
+%>
+
+% if ( $curuser->access_right('Edit prospect') ) {
+ Edit this prospect
+% }
+
+<% ntable("#cccccc",2) %>
+
+
+ Prospect # |
+ <% $prospectnum %> |
+
+
+%unless ( scalar(@agentnums) == 1 ) {
+% my $agent = qsearchs('agent',{ 'agentnum' => $prospect_main->agentnum } );
+
+ Agent |
+ <% $agent->agentnum %>: <% $agent->agent %> |
+
+%}
+
+
+ Company |
+ <% $prospect_main->company |h %> |
+
+
+% foreach my $contact ( $prospect_main->contact ) {
+
+ Contact |
+ <% $contact->line %> |
+
+%}
+
+% my @cust_location =
+% qsearch('cust_location', { 'prospectnum' => $prospectnum } );
+% #but only one, for now
+% foreach my $cust_location (@cust_location) {
+
+ Address |
+
+ <% $cust_location->location_label(
+ 'join_string' => ' ',
+ 'double_space' => ' ',
+ 'escape_function' => \&encode_entities,
+ )
+ %>
+ |
+
+% }
+
+
+
+
+
+<% ntable("#cccccc") %>
+
+
+ Tickets |
+
+
+
+
+<%init>
+
+my $curuser = $FS::CurrentUser::CurrentUser;
+
+die "access denied"
+ unless $curuser->access_right('View prospect');
+
+my $prospectnum;
+if ( $cgi->param('prospectnum') =~ /^(\d+)$/ ) {
+ $prospectnum = $1;
+} else {
+ die "No prospect specified (bad URL)!" unless $cgi->keywords;
+ my($query) = $cgi->keywords; # needs parens with my, ->keywords returns array
+ $query =~ /^(\d+)$/;
+ $prospectnum = $1;
+}
+
+my $prospect_main = qsearchs( {
+ 'table' => 'prospect_main',
+ 'hashref' => { 'prospectnum' => $prospectnum },
+ 'extra_sql' => ' AND '. $curuser->agentnums_sql,
+});
+die "Prospect not found!" unless $prospect_main;
+
+my @agentnums = $curuser->agentnums;
+
+%init>