X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=blobdiff_plain;f=rt%2Flib%2FRT%2FURI%2Ffsck_com_rt.pm;h=053268f9eeb94dc38b73f56651c0d623183f395d;hp=a55bff0de7a47a25b5e1e8f9b55b75a41edaa305;hb=9aee669886202be7035e6c6049fc71bc99dd3013;hpb=0fb307c305e4bc2c9c27dc25a3308beae3a4d33c diff --git a/rt/lib/RT/URI/fsck_com_rt.pm b/rt/lib/RT/URI/fsck_com_rt.pm index a55bff0de..053268f9e 100644 --- a/rt/lib/RT/URI/fsck_com_rt.pm +++ b/rt/lib/RT/URI/fsck_com_rt.pm @@ -2,7 +2,7 @@ # # COPYRIGHT: # -# This software is Copyright (c) 1996-2011 Best Practical Solutions, LLC +# This software is Copyright (c) 1996-2015 Best Practical Solutions, LLC # # # (Except where explicitly superseded by other copyright notices) @@ -209,23 +209,32 @@ sub HREF { =head2 AsString -Returns either a localized string 'ticket #23' or the full URI if the object is not local +Returns either a localized string C<#23: Subject> for tickets, C for other object types (not really used), or the full URI if the object +is not local. =cut sub AsString { my $self = shift; - if ($self->IsLocal && $self->Object) { - return $self->loc("[_1] #[_2]", $self->ObjectType, $self->Object->Id); + if ($self->IsLocal && ( my $object = $self->Object )) { + if ($object->isa('RT::Ticket')) { + return $self->loc("#[_1]: [_2]", $object->Id, $object->Subject || ''); + } else { + my $name = $object->_Accessible('Name', 'read') ? $object->Name : undef; + + if ( defined $name and length $name ) { + return $self->loc("[_1] #[_2]: [_3]", $self->ObjectType, $object->Id, $name); + } else { + return $self->loc("[_1] #[_2]", $self->ObjectType, $object->Id); + } + } } else { return $self->URI; } } -eval "require RT::URI::fsck_com_rt_Vendor"; -die $@ if ($@ && $@ !~ qr{^Can't locate RT/URI/fsck_com_rt_Vendor.pm}); -eval "require RT::URI::fsck_com_rt_Local"; -die $@ if ($@ && $@ !~ qr{^Can't locate RT/URI/fsck_com_rt_Local.pm}); +RT::Base->_ImportOverlays(); 1;