From: mark Date: Tue, 3 Aug 2010 03:30:34 +0000 (+0000) Subject: customer view tab for an external info page, RT#8903 X-Git-Tag: freeside_1_9_5~93 X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=124601883f5c26ddc16d0f9d0890614dfd58a91e customer view tab for an external info page, RT#8903 --- diff --git a/FS/FS/Conf.pm b/FS/FS/Conf.pm index fe5d3ed26..068ed9756 100644 --- a/FS/FS/Conf.pm +++ b/FS/FS/Conf.pm @@ -3450,7 +3450,6 @@ and customer address. Include units.', 'per_agent' => 1, }, - { 'key' => 'selfservice-menu_top_image', 'section' => 'self-service', @@ -3792,6 +3791,20 @@ and customer address. Include units.', 'select_enum' => [ 'misc_info', 'top' ], }, + { + 'key' => 'cust_main-custom_link', + 'section' => 'UI', + 'description' => 'URL to use as source for the "Custom" tab in the View Customer page. The custnum will be appended.', + 'type' => 'text', + }, + + { + 'key' => 'cust_main-custom_title', + 'section' => 'UI', + 'description' => 'Title for the "Custom" tab in the View Customer page.', + 'type' => 'text', + }, + { key => "apacheroot", section => "deprecated", description => "DEPRECATED", type => "text" }, { key => "apachemachine", section => "deprecated", description => "DEPRECATED", type => "text" }, { key => "apachemachines", section => "deprecated", description => "DEPRECATED", type => "text" }, diff --git a/FS/FS/Mason.pm b/FS/FS/Mason.pm index 8efab49bd..8a617ccde 100644 --- a/FS/FS/Mason.pm +++ b/FS/FS/Mason.pm @@ -107,6 +107,7 @@ if ( -e $addl_handler_use_file ) { #selectlayers.html use Locale::Country; use Business::US::USPS::WebTools::AddressStandardization; + use LWP::UserAgent; use FS; use FS::UID qw( getotaker dbh datasrc driver_name ); use FS::Record qw( qsearch qsearchs fields dbdef diff --git a/httemplate/misc/custom_link_proxy.cgi b/httemplate/misc/custom_link_proxy.cgi new file mode 100644 index 000000000..e5934e4a6 --- /dev/null +++ b/httemplate/misc/custom_link_proxy.cgi @@ -0,0 +1,24 @@ +% if( $response->is_success ) { +<% $response->decoded_content %> +% } +% else { +<% $response->error_as_HTML %> +% } +<%init> + +my( $custnum ) = $cgi->param('custnum'); +my $cust_main = qsearchs('cust_main', { custnum => $custnum } ) + or die "custnum '$custnum' not found"; # just check for existence + +my $conf = new FS::Conf; +my $url = $conf->config('cust_main-custom_link') . $cust_main->custnum; +#warn $url; + +my $curuser = $FS::CurrentUser::CurrentUser; + +die "access denied" + unless $curuser->access_right('View customer'); + +my $ua = new LWP::UserAgent; +my $response = $ua->get($url); + diff --git a/httemplate/view/cust_main.cgi b/httemplate/view/cust_main.cgi index 0b267ad2e..d5b7d9341 100755 --- a/httemplate/view/cust_main.cgi +++ b/httemplate/view/cust_main.cgi @@ -230,6 +230,10 @@ Comments <% include('cust_main/change_history.html', $cust_main ) %> % } +% if ( $view eq 'custom' ) { +<% include('cust_main/custom.html', $cust_main ) %> +% } + <% include('/elements/footer.html') %> <%init> @@ -269,6 +273,8 @@ $views{'Payment History'} = 'payment_history' unless $conf->config('payby-default' eq 'HIDE'); $views{'Change History'} = 'change_history' if $curuser->access_right('View customer history'); +$views{$conf->config('cust_main-custom_title') || 'Custom'} = 'custom' + if $conf->config('cust_main-custom_link'); $views{'Jumbo'} = 'jumbo'; my %viewname = reverse %views; diff --git a/httemplate/view/cust_main/custom.html b/httemplate/view/cust_main/custom.html new file mode 100644 index 000000000..8e2e07b75 --- /dev/null +++ b/httemplate/view/cust_main/custom.html @@ -0,0 +1,21 @@ + + +<%init> + +my( $cust_main ) = @_; + +my $proxyurl = $p.'/misc/custom_link_proxy.cgi?custnum='.$cust_main->custnum; +