X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;ds=sidebyside;f=httemplate%2Fbrowse%2Fpart_svc.cgi;h=805bd88b921762e71615e0a2ab4affe9ed4418aa;hb=9608be1f5c73517fc348f1ab458892b34ed7facb;hp=9fb359d1ddbf270c4efbcd19149e9dca1e6f7c67;hpb=6d02e527490b2f0cf080f7b519443caeecd76357;p=freeside.git
diff --git a/httemplate/browse/part_svc.cgi b/httemplate/browse/part_svc.cgi
index 9fb359d1d..805bd88b9 100755
--- a/httemplate/browse/part_svc.cgi
+++ b/httemplate/browse/part_svc.cgi
@@ -1,6 +1,17 @@
-
<%
+#code duplication w/ edit/part_svc.cgi, should move this hash to part_svc.pm
+my %flag = (
+ '' => '',
+ 'D' => 'Default',
+ 'F' => 'Fixed (unchangeable)',
+ #'M' => 'Manual selection from inventory',
+ 'M' => 'Manual selected from inventory',
+ #'A' => 'Automatically fill in from inventory',
+ 'A' => 'Automatically filled in from inventory',
+ 'X' => 'Excluded',
+);
+
my %search;
if ( $cgi->param('showdisabled') ) {
%search = ();
@@ -13,8 +24,19 @@ 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;
+}
+
+my %inventory_class = ();
+
%>
-<%= header('Service Definition Listing', menubar( 'Main Menu' => $p) ) %>
+<%= include("/elements/header.html",'Service Definition Listing', menubar( 'Main Menu' => $p) ) %>
- Services are items you offer to your customers.
+ Service definitions are the templates for items you offer to your customers.
-