X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=htetc%2Fglobal.asa;h=a2d8dee123bda4de9dd2bee9497b4c271ad4fdb2;hb=456021fddfef45aaf2d629af509fda9074db00cf;hp=62f45447527b0b07739d9813b05dbf0fd9d45880;hpb=e6ea57971831f25d682d97a0ba508c39b66ecd8b;p=freeside.git diff --git a/htetc/global.asa b/htetc/global.asa index 62f454475..a2d8dee12 100644 --- a/htetc/global.asa +++ b/htetc/global.asa @@ -1,20 +1,26 @@ +BEGIN { eval "use Devel::AutoProfiler;"; } #only if installed... +#BEGIN { package Devel::AutoProfiler; use vars qw(%caller_info); } +#use Devel::AutoProfiler; + use strict; use vars qw( $cgi $p ); use CGI; #use CGI::Carp qw(fatalsToBrowser); use Date::Format; use Date::Parse; +use Time::Local; use Tie::IxHash; use HTML::Entities; use IO::Handle; use IO::File; use String::Approx qw(amatch); -use HTML::Widgets::SelectLayers; +use Chart::LinesPoints; +use HTML::Widgets::SelectLayers 0.02; use FS::UID qw(cgisuidsetup dbh getotaker datasrc driver_name); use FS::Record qw(qsearch qsearchs fields dbdef); use FS::Conf; use FS::CGI qw(header menubar popurl table itable ntable idiot eidiot - small_custview myexit); + small_custview myexit http_header); use FS::Msgcat qw(gettext geterror); use FS::agent; @@ -46,6 +52,12 @@ use FS::svc_acct_sm; use FS::svc_domain; use FS::svc_forward; use FS::svc_www; +use FS::ac_type; +use FS::ac; +use FS::part_ac_field; +use FS::ac_field; +use FS::ac_block; +use FS::svc_broadband; use FS::type_pkgs; use FS::part_export; use FS::part_export_option; @@ -62,22 +74,113 @@ sub Script_OnStart { &cgisuidsetup($cgi); $p = popurl(2); #print $cgi->header( '-expires' => 'now' ); + dbh->{'private_profile'} = {} if dbh->can('sprintProfile'); + + #really should check for FS::Profiler or something + # Devel::AutoProfiler _our_ VERSION? thanks a fucking lot + if ( Devel::AutoProfiler->can('__recursively_fetch_subs_in_package') ) { + #should check to see it's my special version. well, switch to FS::Profiler + + #nicked from Devel::AutoProfiler::INIT + my %subs = Devel::AutoProfiler::__recursively_fetch_subs_in_package('main'); + + + SUB : while( my ($name, $ref) = each(%subs) ) + { + #next if $name =~ /^(main::)?Apache::/; + next unless $name =~ /FS/; + foreach my $sub (@Devel::AutoProfiler::do_not_instrument_this_sub) + { + if ($name =~ /$sub/) + { + next SUB; + } + } + next if ($Devel::AutoProfiler::do_not_instrument_this_sub{$name}); + #warn "INIT name is $name \n"; + Devel::AutoProfiler::__instrument_sub($name, $ref); + } + + } + } sub Script_OnFlush { my $ref = $Response->{BinaryRef}; - $$ref = $cgi->header( @FS::CGI::header ) . $$ref; + #$$ref = $cgi->header( @FS::CGI::header ) . $$ref; + #$$ref = $cgi->header() . $$ref; if ( dbh->can('sprintProfile') ) { - - $$ref =~ s/<\/BODY>[\s\n]*<\/HTML>[\s\n]*$//i - or warn "can't remove"; + if ( lc($Response->{ContentType}) eq 'text/html' ) { + $$ref =~ s/<\/BODY>[\s\n]*<\/HTML>[\s\n]*$//i + or warn "can't remove"; - #$$ref .= '
'. ("\n"x96). encode_entities(dbh->sprintProfile()). ''; - # wtf? konqueror... - $$ref .= '
'. ("\n"x4096). encode_entities(dbh->sprintProfile()). ''; + #$$ref .= '
'. ("\n"x96). encode_entities(dbh->sprintProfile()). ''; + # wtf? konqueror... + $$ref .= '
'. ("\n"x4096). encode_entities(dbh->sprintProfile()). + "\n\n". &sprintAutoProfile(). ''; - $$ref .= '