if $DEBUG;
if ( $opt{m}->interp->comp_exists("/$opt{action}/$svcdb.cgi") ) {
$url = "$svcdb.cgi?";
+ } elsif ( $opt{m}->interp->comp_exists("/$opt{action}/$svcdb.html") ) {
+ $url = "$svcdb.html?";
} else {
-
my $generic = $opt{action} eq 'search' ? 'cust_svc' : 'svc_Common';
$url = "$generic.html?svcdb=$svcdb;";
$url .= 'svcnum=' if $query =~ /^\d+(;|$)/ or $query eq '';
}
- import FS::CGI 'rooturl'; #WTF! why is this necessary
- my $return = rooturl(). "$opt{action}/$url$query";
+ my $return = FS::CGI::rooturl(). "$opt{action}/$url$query";
$return = qq!<A HREF="$return">! if $opt{ahref};
my %header2method = (
'Customer' => 'name',
- 'Cust. Status' => 'ucfirst_cust_status',
+ 'Cust. Status' => 'cust_status_label',
'Cust#' => 'custnum',
'Name' => 'contact',
'Company' => 'company',
}
}
+=item cust_links
+
+Returns an array of links to view/cust_main.cgi, for use with cust_fields.
+
+=cut
+
+sub cust_links {
+ my $link = [ FS::CGI::rooturl().'view/cust_main.cgi?', 'custnum' ];
+
+ return map { $_ eq 'cust_status_label' ? '' : $link }
+ @cust_fields;
+}
+
=item is_mobile
Utility function to determine if the client is a mobile browser.
#too slow to insert all the cgi params as individual args..,?
#my $error = $queue->insert('_JOB', $cgi->Vars);
- #warn 'froze string of size '. length(nfreeze(\%param)). " for job args\n"
- # if $DEBUG;
- #
- # XXX FS::queue::insert knows how to do this.
- # not changing it here because that requires changing it everywhere else,
- # too, but we should eventually fix it
+ #rely on FS::queue smartness to freeze/encode the param hash
- my $error = $job->insert( '_JOB', encode_base64(nfreeze(\%param)) );
+ my $error = $job->insert( '_JOB', \%param );
if ( $error ) {