diff options
Diffstat (limited to 'rt/lib/RT/URI')
-rw-r--r-- | rt/lib/RT/URI/base.pm | 5 | ||||
-rw-r--r-- | rt/lib/RT/URI/fsck_com_rt.pm | 39 | ||||
-rw-r--r-- | rt/lib/RT/URI/t.pm | 22 |
3 files changed, 13 insertions, 53 deletions
diff --git a/rt/lib/RT/URI/base.pm b/rt/lib/RT/URI/base.pm index d6ee402a1..f7d27ef68 100644 --- a/rt/lib/RT/URI/base.pm +++ b/rt/lib/RT/URI/base.pm @@ -1,8 +1,8 @@ # BEGIN BPS TAGGED BLOCK {{{ # # COPYRIGHT: -# -# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +# +# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC # <jesse@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) @@ -45,6 +45,7 @@ # those contributions and any derivatives thereof. # # END BPS TAGGED BLOCK }}} + package RT::URI::base; use strict; diff --git a/rt/lib/RT/URI/fsck_com_rt.pm b/rt/lib/RT/URI/fsck_com_rt.pm index d652ec328..d6c194da5 100644 --- a/rt/lib/RT/URI/fsck_com_rt.pm +++ b/rt/lib/RT/URI/fsck_com_rt.pm @@ -1,8 +1,8 @@ # BEGIN BPS TAGGED BLOCK {{{ # # COPYRIGHT: -# -# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +# +# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC # <jesse@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) @@ -45,15 +45,14 @@ # those contributions and any derivatives thereof. # # END BPS TAGGED BLOCK }}} + package RT::URI::fsck_com_rt; use RT::Ticket; -use RT::URI::base; +use base 'RT::URI::base'; use strict; -use vars qw(@ISA); -@ISA = qw/RT::URI::base/; @@ -62,24 +61,6 @@ use vars qw(@ISA); Returns the prefix for a local URI. -=begin testing - -use_ok("RT::URI::fsck_com_rt"); -my $uri = RT::URI::fsck_com_rt->new($RT::SystemUser); - -ok(ref($uri)); - -use Data::Dumper; - - -ok (UNIVERSAL::isa($uri,RT::URI::fsck_com_rt), "It's an RT::URI::fsck_com_rt"); - -ok ($uri->isa('RT::URI::base'), "It's an RT::URI::base"); -ok ($uri->isa('RT::Base'), "It's an RT::Base"); - -is ($uri->LocalURIPrefix , 'fsck.com-rt://'.$RT::Organization); - -=end testing @@ -88,7 +69,7 @@ is ($uri->LocalURIPrefix , 'fsck.com-rt://'.$RT::Organization); sub LocalURIPrefix { my $self = shift; - my $prefix = $self->Scheme. "://$RT::Organization"; + my $prefix = $self->Scheme. "://". RT->Config->Get('Organization'); return ($prefix); } @@ -116,14 +97,6 @@ sub ObjectType { Returns the RT URI for a local RT::Record object -=begin testing - -my $ticket = RT::Ticket->new($RT::SystemUser); -$ticket->Load(1); -my $uri = RT::URI::fsck_com_rt->new($ticket->CurrentUser); -is($uri->LocalURIPrefix. "/ticket/1" , $uri->URIForObject($ticket)); - -=end testing =cut @@ -239,7 +212,7 @@ Otherwise, return its URI sub HREF { my $self = shift; if ($self->IsLocal && $self->Object && ($self->ObjectType eq 'ticket')) { - return ( $RT::WebURL . "Ticket/Display.html?id=".$self->Object->Id); + return ( RT->Config->Get('WebURL') . "Ticket/Display.html?id=".$self->Object->Id); } else { return ($self->URI); diff --git a/rt/lib/RT/URI/t.pm b/rt/lib/RT/URI/t.pm index d07144a27..9b0dcbe90 100644 --- a/rt/lib/RT/URI/t.pm +++ b/rt/lib/RT/URI/t.pm @@ -1,8 +1,8 @@ # BEGIN BPS TAGGED BLOCK {{{ # # COPYRIGHT: -# -# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC +# +# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC # <jesse@bestpractical.com> # # (Except where explicitly superseded by other copyright notices) @@ -45,6 +45,7 @@ # those contributions and any derivatives thereof. # # END BPS TAGGED BLOCK }}} + # BEGIN LICENSE BLOCK # # Copyright (c) 1996-2003 Jesse Vincent <jesse@bestpractical.com> @@ -74,8 +75,7 @@ use RT::Ticket; use RT::URI::base; use strict; -use vars qw(@ISA); -@ISA = qw/RT::URI::fsck_com_rt/; +use base 'RT::URI::fsck_com_rt'; my $scheme = "t"; @@ -84,20 +84,6 @@ my $scheme = "t"; When handed an t: URI, figures out if it is an RT ticket. This is an alternate short form of specifying a full ticket URI. -=begin testing - -use_ok("RT::URI::t"); -my $uri = RT::URI::t->new($RT::SystemUser); -ok(ref($uri), "URI object exists"); - -my $uristr = "t:1"; -$uri->ParseURI($uristr); -is(ref($uri->Object), "RT::Ticket", "Object loaded is a ticket"); -is($uri->Object->Id, 1, "Object loaded has correct ID"); -is($uri->URI, 'fsck.com-rt://'.$RT::Organization.'/ticket/1', - "URI object has correct URI string"); - -=end testing =cut |