From 03ceab71dad1e5eb366865d304e5e459cc905ce4 Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 28 Dec 2009 19:20:25 +0000 Subject: beginning of prospect/CRM/contact work --- httemplate/view/cust_main/packages/location.html | 6 +- httemplate/view/prospect_main.html | 92 ++++++++++++++++++++++++ 2 files changed, 97 insertions(+), 1 deletion(-) create mode 100644 httemplate/view/prospect_main.html (limited to 'httemplate/view') diff --git a/httemplate/view/cust_main/packages/location.html b/httemplate/view/cust_main/packages/location.html index 9f348e5d3..41155cbae 100644 --- a/httemplate/view/cust_main/packages/location.html +++ b/httemplate/view/cust_main/packages/location.html @@ -4,12 +4,16 @@ (default service address)
% } - <% $loc->location_label( 'join_string' => '
', + <% $loc->location_label( 'join_string' => '
', + 'double_space' => '   ', 'escape_function' => \&encode_entities, + 'countrydefault' => $countrydefault, ) %> +% unless ( $cust_pkg->locationnum ) {
+% } % if ( ! $cust_pkg->get('cancel') % && $FS::CurrentUser::CurrentUser->access_right('Change customer package') 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; + + -- cgit v1.2.1