projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
a7d43c4
)
truncate long labels that are TOO long... RT#3519
author
ivan
<ivan>
Tue, 7 Apr 2009 18:15:17 +0000
(18:15 +0000)
committer
ivan
<ivan>
Tue, 7 Apr 2009 18:15:17 +0000
(18:15 +0000)
FS/FS/svc_acct.pm
patch
|
blob
|
history
diff --git
a/FS/FS/svc_acct.pm
b/FS/FS/svc_acct.pm
index
6b7236f
..
c92c324
100644
(file)
--- a/
FS/FS/svc_acct.pm
+++ b/
FS/FS/svc_acct.pm
@@
-470,9
+470,12
@@
history records.
sub label_long {
my $self = shift;
sub label_long {
my $self = shift;
- ( $self->finger =~ /\S/ )
- ? $self->finger. ' <'.$self->label(@_).'>'
- : $self->label(@_);
+ my $label = $self->label(@_);
+ my $finger = $self->finger;
+ return $label unless $finger =~ /\S/;
+ my $maxlen = 40 - length($label) - length($self->cust_svc->part_svc->svc);
+ $finger = substr($finger, 0, $maxlen-3).'...' if length($finger) > $maxlen;
+ "$finger <$label>";
}
=item insert [ , OPTION => VALUE ... ]
}
=item insert [ , OPTION => VALUE ... ]