[Rt-commit] rt branch, 4.0/avoid-absolute-links, created. rt-4.0.4-185-ge514ec3
? sunnavy
sunnavy at bestpractical.com
Mon Jan 16 12:49:33 EST 2012
The branch, 4.0/avoid-absolute-links has been created
at e514ec3718419767cfbb5df619f024bc4ce8dc38 (commit)
- Log -----------------------------------------------------------------
commit aed1409f1afc8c0b696dccbe56c48e8a3bf86ff1
Author: sunnavy <sunnavy at bestpractical.com>
Date: Tue Jan 17 01:43:12 2012 +0800
switch to relative links instead if it's local
this fixed the original problem of #18721
diff --git a/share/html/Elements/ShowLink b/share/html/Elements/ShowLink
index 8913a32..7c8b11d 100644
--- a/share/html/Elements/ShowLink
+++ b/share/html/Elements/ShowLink
@@ -45,7 +45,7 @@
%# those contributions and any derivatives thereof.
%#
%# END BPS TAGGED BLOCK }}}
-<a href="<%$URI->Resolver->HREF%>">
+<a href="<% $href %>">
% if ($URI->IsLocal) {
% my $member = $URI->Object;
% my $has_name = UNIVERSAL::can($member, 'Name') || (UNIVERSAL::can($member, '_Accessible') && $member->_Accessible('Name', 'read'));
@@ -69,3 +69,11 @@
<%ARGS>
$URI => undef
</%ARGS>
+
+<%INIT>
+my $href = $URI->Resolver->HREF;
+if ( $URI->IsLocal ) {
+ my $base = RT->Config->Get('WebBaseURL');
+ $href =~ s!^$base!!;
+}
+</%INIT>
commit e514ec3718419767cfbb5df619f024bc4ce8dc38
Author: sunnavy <sunnavy at bestpractical.com>
Date: Tue Jan 17 01:46:22 2012 +0800
replace WebURL with WebPath to make links relative
absolute links are not necessary in these places and they are less convenient
than relative ones.
diff --git a/share/html/Admin/Tools/Shredder/Elements/Object/RT--Attachment b/share/html/Admin/Tools/Shredder/Elements/Object/RT--Attachment
index 11b876b..0da910d 100644
--- a/share/html/Admin/Tools/Shredder/Elements/Object/RT--Attachment
+++ b/share/html/Admin/Tools/Shredder/Elements/Object/RT--Attachment
@@ -49,6 +49,6 @@
$Object => undef
</%ARGS>
% my $name = (defined $Object->Filename and length $Object->Filename) ? $Object->Filename : loc("(no value)");
-<a href="<% RT->Config->Get('WebURL') %>/Ticket/Attachment/<% $Object->TransactionId %>/<% $Object->id %>/">
+<a href="<% RT->Config->Get('WebPath') %>/Ticket/Attachment/<% $Object->TransactionId %>/<% $Object->id %>/">
<% loc('Attachment') %>(<% loc('id') %>:<% $Object->id %>, <% loc('Filename') %>: <% $name %>)
</a>
diff --git a/share/html/Admin/Tools/Shredder/Elements/Object/RT--Ticket b/share/html/Admin/Tools/Shredder/Elements/Object/RT--Ticket
index 13547ad..35f1aa8 100644
--- a/share/html/Admin/Tools/Shredder/Elements/Object/RT--Ticket
+++ b/share/html/Admin/Tools/Shredder/Elements/Object/RT--Ticket
@@ -48,6 +48,6 @@
<%ARGS>
$Object => undef
</%ARGS>
-<a href="<% RT->Config->Get('WebURL') %>/Ticket/Display.html?id=<% $Object->id %>">
+<a href="<% RT->Config->Get('WebPath') %>/Ticket/Display.html?id=<% $Object->id %>">
<% loc('Ticket') %>(<% loc('id') %>:<% $Object->id %>, <% loc('Subject') %>: <% substr($Object->Subject, 0, 30) %>...)
</a>
diff --git a/share/html/Admin/Tools/Shredder/Elements/Object/RT--User b/share/html/Admin/Tools/Shredder/Elements/Object/RT--User
index f77169a..d7627eb 100644
--- a/share/html/Admin/Tools/Shredder/Elements/Object/RT--User
+++ b/share/html/Admin/Tools/Shredder/Elements/Object/RT--User
@@ -48,6 +48,6 @@
<%ARGS>
$Object => undef
</%ARGS>
-<a href="<% RT->Config->Get('WebURL') %>/Admin/Users/Modify.html?id=<% $Object->id %>">
+<a href="<% RT->Config->Get('WebPath') %>/Admin/Users/Modify.html?id=<% $Object->id %>">
<% loc('User') %>(<% loc('id') %>:<% $Object->id %>, <% loc('Name') %>: <% $Object->Name %>)
</a>
diff --git a/share/html/Elements/ShowSearch b/share/html/Elements/ShowSearch
index 2b23181..4ae200e 100644
--- a/share/html/Elements/ShowSearch
+++ b/share/html/Elements/ShowSearch
@@ -79,7 +79,7 @@ if ($SavedSearch) {
# XXX: dispatch to different handler here
$query_display_component
= '/Search/Elements/' . $SearchArg->{SearchType};
- $query_link_url = RT->Config->Get('WebURL') . "/Search/$SearchArg->{SearchType}.html";
+ $query_link_url = RT->Config->Get('WebPath') . "/Search/$SearchArg->{SearchType}.html";
} elsif ($ShowCustomize) {
$customize = RT->Config->Get('WebPath') . '/Search/Build.html?'
. $m->comp( '/Elements/QueryString',
diff --git a/share/html/Search/Elements/Chart b/share/html/Search/Elements/Chart
index 01b78c7..be05da3 100644
--- a/share/html/Search/Elements/Chart
+++ b/share/html/Search/Elements/Chart
@@ -130,10 +130,10 @@ my ($i,$total);
);
</%perl>
<td class="label collection-as-table">
-<a href=<% RT->Config->Get('WebURL') %>Search/Results.html?<%$QueryString%>><%$key%></a>
+<a href=<% RT->Config->Get('WebPath') %>/Search/Results.html?<%$QueryString%>><%$key%></a>
</td>
<td class="value collection-as-table">
-<a href=<% RT->Config->Get('WebURL') %>Search/Results.html?<%$QueryString%>><%$value%></a>
+<a href=<% RT->Config->Get('WebPath') %>/Search/Results.html?<%$QueryString%>><%$value%></a>
</td>
% } else {
<td class="label collection-as-table"><% $key %></td>
diff --git a/share/html/Ticket/GnuPG.html b/share/html/Ticket/GnuPG.html
index 6269907..d15ce72 100644
--- a/share/html/Ticket/GnuPG.html
+++ b/share/html/Ticket/GnuPG.html
@@ -51,7 +51,7 @@
% $m->callback( CallbackName => 'BeforeActionList', %ARGS, Actions => \@results, ARGSRef => \%ARGS );
<& /Elements/ListActions, actions => \@results &>
<form method="post" action="<% RT->Config->Get('WebPath') . $m->request_comp->path %>?id=<% $id %>">
-<a href="<% RT->Config->Get('WebURL') %>Ticket/Display.html?id=<% $txn->Ticket %>#txn-<% $id %>">
+<a href="<% RT->Config->Get('WebPath') %>/Ticket/Display.html?id=<% $txn->Ticket %>#txn-<% $id %>">
<% loc('Return back to the ticket') %>
</a>
<& /Elements/Submit,
-----------------------------------------------------------------------
More information about the Rt-commit
mailing list