'type' => 'checkbox',
},
+ {
+ '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 => "<b>DEPRECATED</b>", type => "text" },
{ key => "apachemachine", section => "deprecated", description => "<b>DEPRECATED</b>", type => "text" },
#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
--- /dev/null
+% 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);
+</%init>
<% include('cust_main/change_history.html', $cust_main ) %>
% }
+% if ( $view eq 'custom' ) {
+<% include('cust_main/custom.html', $cust_main ) %>
+% }
+
</DIV>
<% include('/elements/footer.html') %>
<%init>
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;
--- /dev/null
+<IFRAME id="customframe"
+ src="<% $proxyurl %>"
+ onload="resizeFrame(this)"
+ frameborder=0
+ marginheight="0px"
+ marginwidth="0px"
+ width="100%"
+ scrolling="no"
+>
+</IFRAME>
+<SCRIPT TYPE="text/javascript">
+function resizeFrame(f) {
+ f.style.height = f.contentDocument.body.scrollHeight + 'px';
+}
+</SCRIPT>
+<%init>
+
+my( $cust_main ) = @_;
+
+my $proxyurl = $p.'/misc/custom_link_proxy.cgi?custnum='.$cust_main->custnum;
+</%init>