[freeside-commits] freeside/FS/FS svc_acct.pm, 1.217.2.22, 1.217.2.23
Ivan,,,
ivan at wavetail.420.am
Tue Apr 7 11:15:19 PDT 2009
Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv22676
Modified Files:
Tag: FREESIDE_1_7_BRANCH
svc_acct.pm
Log Message:
truncate long labels that are TOO long... RT#3519
Index: svc_acct.pm
===================================================================
RCS file: /home/cvs/cvsroot/freeside/FS/FS/svc_acct.pm,v
retrieving revision 1.217.2.22
retrieving revision 1.217.2.23
diff -u -d -r1.217.2.22 -r1.217.2.23
--- svc_acct.pm 26 Mar 2009 03:59:59 -0000 1.217.2.22
+++ svc_acct.pm 7 Apr 2009 18:15:17 -0000 1.217.2.23
@@ -470,9 +470,12 @@
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 ... ]
More information about the freeside-commits
mailing list