summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorivan <ivan>2007-09-23 18:32:28 +0000
committerivan <ivan>2007-09-23 18:32:28 +0000
commit4ddf9e2e9a5552306c3d95cb85a44586367f58c4 (patch)
tree04583f7d90edad3b47e7ae55f20f249bc950aac4
parent312d84036ac0b5f77d78db81d048cbefc4ac0b13 (diff)
accounts w/time remaining search
-rw-r--r--FS/FS/svc_acct.pm3
-rw-r--r--httemplate/elements/menu.html5
-rwxr-xr-xhttemplate/search/svc_acct.cgi2
3 files changed, 7 insertions, 3 deletions
diff --git a/FS/FS/svc_acct.pm b/FS/FS/svc_acct.pm
index 59068549f..f5d3a228e 100644
--- a/FS/FS/svc_acct.pm
+++ b/FS/FS/svc_acct.pm
@@ -204,7 +204,7 @@ sub table_info {
{
'name' => 'Account',
'longname_plural' => 'Access accounts and mailboxes',
- 'sorts' => [ 'username', 'uid', ],
+ 'sorts' => [ 'username', 'uid', 'seconds' ],
'display_weight' => 10,
'cancel_weight' => 50,
'fields' => {
@@ -270,6 +270,7 @@ sub table_info {
disable_select => 1,
},
'seconds' => { label => 'Seconds',
+ label_sort => 'with Time Remaining',
type => 'text',
disable_inventory => 1,
disable_select => 1,
diff --git a/httemplate/elements/menu.html b/httemplate/elements/menu.html
index 455c7b364..5675c7b17 100644
--- a/httemplate/elements/menu.html
+++ b/httemplate/elements/menu.html
@@ -115,8 +115,11 @@ foreach my $svcdb ( FS::part_svc->svc_tables() ) {
foreach my $sort ( @$sorts ) {
+ my $field_info = FS::part_svc->svc_table_fields($svcdb)->{$sort};
+ my $label = $field_info->{'label_sort'} || 'by '.$field_info->{'label'};
+
my $title = "All $lcname";
- $title .= " by ". FS::part_svc->svc_table_fields($svcdb)->{$sort}->{'label'}
+ $title .= " $label"
if scalar(@$sorts) > 1;
$report_svc{$title} =
diff --git a/httemplate/search/svc_acct.cgi b/httemplate/search/svc_acct.cgi
index ee8a5d0a7..9ccac5dd7 100755
--- a/httemplate/search/svc_acct.cgi
+++ b/httemplate/search/svc_acct.cgi
@@ -71,7 +71,7 @@ if ( $cgi->param('magic') =~ /^(all|unlinked)$/ ) {
$sortby = "LOWER($sortby)"
if $sortby eq 'username';
push @extra_sql, "$sortby IS NOT NULL"
- if $sortby eq 'uid';
+ if $sortby eq 'uid' || $sortby eq 'seconds';
$orderby = "ORDER BY $sortby";
}