'links' => [ $link,
$link,
# package?
- ( map { $link_cust }
+ ( map { $_ ne 'Cust. Status' ? $link_cust : '' }
FS::UI::Web::cust_header()
),
],
+ 'align' => 'rl'. FS::UI::Web::cust_aligns(),
+ 'color' => [
+ '',
+ '',
+ FS::UI::Web::cust_colors(),
+ ],
+ 'style' => [
+ '',
+ '',
+ FS::UI::Web::cust_styles(),
+ ],
)
%>
<%init>
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->access_right('List services');
+
my $addl_from = ' LEFT JOIN part_svc USING ( svcpart ) '.
' LEFT JOIN cust_pkg USING ( pkgnum ) '.
' LEFT JOIN cust_main USING ( custnum ) ';
if ( length( $cgi->param('search_svc') ) ) {
my $string = $cgi->param('search_svc');
+ $string =~ s/(^\s+|\s+$)//; #trim leading & trailing whitespace
# implement fuzzy searching in subclasses too at some point?
# service searching maybe shouldn't be fuzzy...
push @extra_sql, "svcpart = $1";
} else {
- eidiot("No search term specified");
+ errorpage("No search term specified");
}
#here is the agent virtualization
my $link = sub {
my $cust_svc = shift;
- my $url = FS::UI::Web::svc_url(
+ my $url = svc_url(
'm' => $m,
'action' => 'view',
#'part_svc' => $cust_svc->part_svc,
'svcdb' => $cust_svc->svcdb, #we have it from the joined search
#'svc' => $cust_svc, #redundant
- 'query' => 'svcnum=',
+ 'query' => '',
);
+ [ $url, 'svcnum' ];
+};
+
+my $link_cust = sub {
+ my $cust_svc = shift;
+ if ( $cust_svc->custnum ) {
+ [ "${p}view/cust_main.cgi?", 'custnum' ];
+ } else {
+ '';
+ }
+};
+
+</%init>