projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
3c34dbb
)
disable display of auto-suspend dates unless enabled by config. at least until it...
author
ivan
<ivan>
Fri, 20 Feb 2009 02:41:06 +0000
(
02:41
+0000)
committer
ivan
<ivan>
Fri, 20 Feb 2009 02:41:06 +0000
(
02:41
+0000)
FS/FS/Conf.pm
patch
|
blob
|
history
httemplate/view/cust_main/packages/status.html
patch
|
blob
|
history
diff --git
a/FS/FS/Conf.pm
b/FS/FS/Conf.pm
index
4def462
..
39ab389
100644
(file)
--- a/
FS/FS/Conf.pm
+++ b/
FS/FS/Conf.pm
@@
-2650,6
+2650,13
@@
worry that config_items is freeside-specific and icky.
'type' => 'text',
},
'type' => 'text',
},
+ {
+ 'key' => 'cust_pkg-show_autosuspend',
+ 'section' => 'UI',
+ 'description' => 'Show package auto-suspend dates. Use with caution for now; can slow down customer view for large insallations.',
+ 'type' => 'checkbox',
+ },
+
);
1;
);
1;
diff --git
a/httemplate/view/cust_main/packages/status.html
b/httemplate/view/cust_main/packages/status.html
index
e0a188e
..
106137b
100644
(file)
--- a/
httemplate/view/cust_main/packages/status.html
+++ b/
httemplate/view/cust_main/packages/status.html
@@
-121,8
+121,11
@@
% }
%
% }
% }
%
% }
-% my $autosuspend = pkg_autosuspend_time( $cust_pkg );
-% $cust_pkg->set('autosuspend', $autosuspend) if $autosuspend;
+%
+% if ( $conf->exists('cust_pkg-show_autosuspend') ) {
+% my $autosuspend = pkg_autosuspend_time( $cust_pkg );
+% $cust_pkg->set('autosuspend', $autosuspend) if $autosuspend;
+% }
<% pkg_status_row_changed( $cust_pkg, %opt ) %>
<% pkg_status_row_if( $cust_pkg, $last_bill_or_renewed, 'last_bill', %opt, curuser=>$curuser ) %>
<% pkg_status_row_changed( $cust_pkg, %opt ) %>
<% pkg_status_row_if( $cust_pkg, $last_bill_or_renewed, 'last_bill', %opt, curuser=>$curuser ) %>
@@
-167,6
+170,8
@@
my %opt = @_;
my %opt = @_;
+my $conf = new FS::Conf;
+
my $bgcolor = $opt{'bgcolor'};
my $cust_pkg = $opt{'cust_pkg'};
my $part_pkg = $opt{'part_pkg'};
my $bgcolor = $opt{'bgcolor'};
my $cust_pkg = $opt{'cust_pkg'};
my $part_pkg = $opt{'part_pkg'};
@@
-352,7
+357,8
@@
sub pkg_autosuspend_time {
my $days = 7;
my $time = time;
my $pending_suspend = 0;
my $days = 7;
my $time = time;
my $pending_suspend = 0;
- #this seems to be extremely inefficient...
+ #this seems to be extremely inefficient... and is slowing down all customer
+ #views
while ( $days > 0 &&
scalar(
grep { $_->part_event->action eq 'suspend' }
while ( $days > 0 &&
scalar(
grep { $_->part_event->action eq 'suspend' }