[freeside-commits] branch master updated. 949114e0f65232b405e084bcfcff37b1fd9a2926
Mark Wells
mark at 420.am
Thu Jan 3 12:47:50 PST 2013
The branch, master has been updated
via 949114e0f65232b405e084bcfcff37b1fd9a2926 (commit)
from 47835e6fb2ff9da30bd95ce10f1f22a3ce1cb8b5 (commit)
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.
- Log -----------------------------------------------------------------
commit 949114e0f65232b405e084bcfcff37b1fd9a2926
Author: Mark Wells <mark at freeside.biz>
Date: Thu Jan 3 12:47:41 2013 -0800
more reasonable solution for #17067
diff --git a/rt/lib/RT/URI/freeside/Internal.pm b/rt/lib/RT/URI/freeside/Internal.pm
index 61b256e..b096286 100644
--- a/rt/lib/RT/URI/freeside/Internal.pm
+++ b/rt/lib/RT/URI/freeside/Internal.pm
@@ -143,7 +143,7 @@ sub small_custview {
}
-sub _FreesideURILabelLong {
+sub AsStringLong {
my $self = shift;
@@ -161,30 +161,28 @@ sub _FreesideURILabelLong {
} elsif ( $table eq 'cust_svc' ) {
my $string = '';
- # we now do this within the UI
- #my $cust = $self->CustomerResolver;
- #if ( $cust ) {
- # $string = $cust->AsStringLong;
- #}
- $string .= $self->AsString;
+ my $cust = $self->CustomerResolver;
+ if ( $cust ) {
+ # the customer's small_custview
+ $string = $cust->AsStringLong();
+ }
+ # + the service label and link
+ $string .= $self->ShortLink;
return $string;
} else {
- return $self->_FreesideURILabel();
+ return $self->SUPER::AsStringLong;
}
}
-sub AsString {
+sub ShortLink {
+ # because I don't want AsString to sometimes return a hunk of HTML, but
+ # on the other hand AsStringLong does something specific.
my $self = shift;
- if ( $self->{'fstable'} eq 'cust_svc' ) {
- return '<B><A HREF="' . $self->HREF . '">' .
- $self->_FreesideURILabel . '</A></B>';
- } else {
- $self->SUPER::AsString;
- }
+ '<B><A HREF="'.$self->HREF.'">' . $self->_FreesideURILabel . '</A></B>';
}
sub CustomerResolver {
diff --git a/rt/share/html/Elements/CustomerFields b/rt/share/html/Elements/CustomerFields
index 199184b..d5419d2 100644
--- a/rt/share/html/Elements/CustomerFields
+++ b/rt/share/html/Elements/CustomerFields
@@ -27,7 +27,7 @@ my @customer_fields = ( # ordered
my @return = ();
foreach my $c (ticket_cust_resolvers($Ticket)) {
push @return, \'<A HREF="', $c->HREF, \'">',
- $c->_FreesideURILabel,
+ $c->AsString,
\'</A>',
\'<BR>';
}
diff --git a/rt/share/html/Ticket/Elements/EditCustomers b/rt/share/html/Ticket/Elements/EditCustomers
index e8aa69e..cc9956f 100644
--- a/rt/share/html/Ticket/Elements/EditCustomers
+++ b/rt/share/html/Ticket/Elements/EditCustomers
@@ -38,7 +38,11 @@
% }
</td>
<td>
+% if ( $resolver->URI =~ /cust_main/ ) {
<% $resolver->AsStringLong |n %>
+% } elsif ( $resolver->URI =~ /cust_svc/ ) {
+ <% $resolver->ShortLink |n %>
+% }
</td>
</tr>
% }
diff --git a/rt/share/html/Ticket/Elements/ShowCustomers b/rt/share/html/Ticket/Elements/ShowCustomers
index 175822f..f9b0133 100644
--- a/rt/share/html/Ticket/Elements/ShowCustomers
+++ b/rt/share/html/Ticket/Elements/ShowCustomers
@@ -24,7 +24,7 @@ my %data = $m->comp('Customers', Ticket => $Ticket);
<td class="value">
<% $cust->AsStringLong |n %>
% foreach my $svc ( @{ $data{cust_svc}{$custnum} || [] } ) {
- <% $svc->AsString |n %>
+ <% $svc->ShortLink |n %>
<br>
% }
</td>
-----------------------------------------------------------------------
Summary of changes:
rt/lib/RT/URI/freeside/Internal.pm | 28 ++++++++++++--------------
rt/share/html/Elements/CustomerFields | 2 +-
rt/share/html/Ticket/Elements/EditCustomers | 4 +++
rt/share/html/Ticket/Elements/ShowCustomers | 2 +-
4 files changed, 19 insertions(+), 17 deletions(-)
More information about the freeside-commits
mailing list