[freeside-commits] freeside/FS/FS svc_acct.pm,1.254,1.255
Ivan,,,
ivan at wavetail.420.am
Tue Apr 7 11:15:17 PDT 2009
Update of /home/cvs/cvsroot/freeside/FS/FS
In directory wavetail.420.am:/tmp/cvs-serv22674
Modified Files:
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.254
retrieving revision 1.255
diff -u -d -r1.254 -r1.255
--- svc_acct.pm 26 Mar 2009 03:59:57 -0000 1.254
+++ svc_acct.pm 7 Apr 2009 18:15:15 -0000 1.255
@@ -459,9 +459,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