X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2FCGI.pm;h=f1f2a3dcae02a444a41d4a47ba053401a566ab61;hb=53bf3dff4149408fde4f1d0d87fd18c6033bc71f;hp=a3286299bce0f6ea36b2a072f5b995a0d901ee4b;hpb=a7319715290dccc7beb414de8d2de24230278a13;p=freeside.git diff --git a/FS/FS/CGI.pm b/FS/FS/CGI.pm index a3286299b..f1f2a3dca 100644 --- a/FS/FS/CGI.pm +++ b/FS/FS/CGI.pm @@ -9,7 +9,7 @@ use URI::URL; use FS::UID; @ISA = qw(Exporter); -@EXPORT_OK = qw(header menubar idiot eidiot popurl table itable ntable +@EXPORT_OK = qw(header menubar idiot eidiot popurl rooturl table itable ntable small_custview myexit http_header); =head1 NAME @@ -225,6 +225,34 @@ sub popurl { $x; } +=item rooturl + +=cut + +sub rooturl { + #this doesn't work so well... + #'%%%FREESIDE_URL%%%'; + + # better to start with the client-provided URL + my $cgi = &FS::UID::cgi; + my $url_string = $cgi->isa('Apache') ? $cgi->uri : $cgi->url; + $url_string =~ s/\?.*//; + + #even though this is kludgy + $url_string =~ + s{ + (browse|config|docs|edit|graph|misc|search|view) + / + (process/)? + ([\w\-\.]+) + $ + } + {}x; + + $url_string; + +} + =item table Returns HTML tag for beginning a table. @@ -252,10 +280,11 @@ Returns HTML tag for beginning an (invisible) table. sub itable { my $col = shift; my $cellspacing = shift || 0; + my $width = ( scalar(@_) && shift ) ? '' : 'WIDTH="100%"'; #bah if ( $col ) { - qq!
'. ntable("#cccccc",2). + my $html = 'Customer #'. $cust_main->custnum. ''. + ' - '. + ucfirst($cust_main->status). ''. + ntable('#e8e8e8'). ' | |
'. ntable("#cccccc",2). ' | |
Billing Address | '.
$cust_main->getfield('last'). ', '. $cust_main->first. ' '; @@ -305,13 +337,27 @@ sub small_custview { $html .= $cust_main->country. ' ' if $cust_main->country && $cust_main->country ne $countrydefault; + $html .= ' |
';
+ if ( $cust_main->daytime && $cust_main->night ) {
+ use FS::Msgcat;
+ $html .= ( FS::Msgcat::_gettext('daytime') || 'Day' ).
+ ' '. $cust_main->daytime.
+ ' '. ( FS::Msgcat::_gettext('night') || 'Night' ). + ' '. $cust_main->night; + } elsif ( $cust_main->daytime || $cust_main->night ) { + $html .= $cust_main->daytime || $cust_main->night; + } + if ( $cust_main->fax ) { + $html .= ' Fax '. $cust_main->fax; + } + $html .= ' |