X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fbrowse%2Fpart_svc.cgi;h=eef2676c06c0043bd868dbc6d3f50fe764abee95;hb=c738a3c4923774b64960aa87fa58bd0751487edb;hp=7c83924a2be72a3bf393f86e5b064854bc929b5a;hpb=7c319f1608fd3459c992eda7743696fc745fccf1;p=freeside.git diff --git a/httemplate/browse/part_svc.cgi b/httemplate/browse/part_svc.cgi index 7c83924a2..eef2676c0 100755 --- a/httemplate/browse/part_svc.cgi +++ b/httemplate/browse/part_svc.cgi @@ -1,6 +1,11 @@ - <% +my %flag = ( + 'D' => 'Default', + 'F' => 'Fixed', + '' => '', +); + my %search; if ( $cgi->param('showdisabled') ) { %search = (); @@ -13,8 +18,17 @@ my @part_svc = qsearch('part_svc', \%search ); my $total = scalar(@part_svc); +my %num_active_cust_svc = map { $_->svcpart => $_->num_cust_svc } @part_svc; + +if ( $cgi->param('orderby') eq 'active' ) { + @part_svc = sort { $num_active_cust_svc{$b->svcpart} <=> + $num_active_cust_svc{$a->svcpart} } @part_svc; +} elsif ( $cgi->param('orderby') eq 'svc' ) { + @part_svc = sort { lc($a->svc) cmp lc($b->svc) } @part_svc; +} + %> -<%= header('Service Definition Listing', menubar( 'Main Menu' => $p) ) %> +<%= include("/elements/header.html",'Service Definition Listing', menubar( 'Main Menu' => $p) ) %>