RT::LoadConfig();
}
- # A hook supporting strange legacy ways people have added stuff on
+ # A hook supporting strange legacy ways people (well, SG) have added stuff on
my @addl_comp_root = ();
my $addl_comp_root_file = '%%%FREESIDE_CONF%%%/addl_comp_root.pl';
}
}
+ my $fs_comp_root =
+ scalar(@addl_comp_root)
+ ? [
+ [ 'freeside'=>'%%%FREESIDE_DOCUMENT_ROOT%%%' ],
+ @addl_comp_root,
+ ]
+ : '%%%FREESIDE_DOCUMENT_ROOT%%%';
+
my %interp = (
request_class => $request_class,
data_dir => '%%%MASONDATA%%%',
error_mode => 'output',
error_format => 'html',
ignore_warnings_expr => '.',
- comp_root => [
- [ 'freeside'=>'%%%FREESIDE_DOCUMENT_ROOT%%%' ],
- [ 'rt' =>'%%%FREESIDE_DOCUMENT_ROOT%%%/rt' ],
- @addl_comp_root,
- ],
);
$interp{out_method} = $opt{outbuf} if $mode eq 'standalone' && $opt{outbuf};
my $fs_interp = new HTML::Mason::Interp (
%interp,
+ comp_root => $fs_comp_root,
escape_flags => { 'js_string' => $js_string_sub,
'defang' => sub {
${$_[0]} = $html_defang->defang(${$_[0]});
my $rt_interp = new HTML::Mason::Interp (
%interp,
+ comp_root => [
+ [ 'rt' => '%%%FREESIDE_DOCUMENT_ROOT%%%/rt' ],
+ [ 'freeside' => '%%%FREESIDE_DOCUMENT_ROOT%%%' ],
+ ],
escape_flags => { 'h' => \&RT::Interface::Web::EscapeUTF8,
'js_string' => $js_string_sub,
},
my( $filename, $mode ) = @_;
- #warn "initializing for $filename\n";
+ if ( $filename =~ qr(/REST/\d+\.\d+/NoAuth/) ) {
- if ( $filename !~ /\/rt\/.*NoAuth/ ) { #not RT images/JS
+ package HTML::Mason::Commands; #?
+ use FS::UID qw( adminsuidsetup );
+
+ #need to log somebody in for the mail gw
+
+ ##old installs w/fs_selfs or selfserv??
+ #&adminsuidsetup('fs_selfservice');
+
+ &adminsuidsetup('fs_queue');
+
+ } else {
package HTML::Mason::Commands;
use vars qw( $cgi $p $fsurl );
die "unknown mode $mode";
}
- } elsif ( $filename =~ /\/rt\/REST\/.*NoAuth/ ) {
-
- package HTML::Mason::Commands; #?
- use FS::UID qw( adminsuidsetup );
-
- #need to log somebody in for the mail gw
-
- ##old installs w/fs_selfs or selfserv??
- #&adminsuidsetup('fs_selfservice');
-
- &adminsuidsetup('fs_queue');
-
- }
+ }
}
<Directory %%%FREESIDE_DOCUMENT_ROOT%%%/rt/NoAuth>
-<Limit GET POST>
-allow from all
-Satisfy any
SetHandler perl-script
PerlHandler HTML::Mason
-</Limit>
</Directory>
<Directory %%%FREESIDE_DOCUMENT_ROOT%%%/rt/REST/1.0/NoAuth>
if ( $r->filename =~ /\/rt\// ) { #RT
- $ah->interp($rt_interp);
+ # We don't need to handle non-text, non-xml items
+ return -1 if defined( $r->content_type )
+ && $r->content_type !~ m!(^text/|\bxml\b)!io;
+
local $SIG{__WARN__};
local $SIG{__DIE__};
RT::Init();
- # We don't need to handle non-text, non-xml items
- return -1 if defined( $r->content_type )
- && $r->content_type !~ m!(^text/|\bxml\b)!io;
+ $ah->interp($rt_interp);
} else {
lib/RT/URI/freeside.pm
lib/RT/URI/freeside/Internal.pm
lib/RT/URI/freeside/XMLRPC.pm
- share/html/Admin/Elements/EditCustomFields
share/html/Admin/Users/Modify.html
- share/html/Elements/ColumnMap
share/html/Elements/CollectionList
share/html/Elements/EditCustomFieldDate #customfield date patch (NEW)
share/html/Elements/Header
share/html/Elements/PageLayout
#html/Elements/QuickCreate
- share/html/Elements/RefreshHomepage
- share/html/Elements/RT__CustomField/ColumnMap
share/html/Elements/RT__Ticket/ColumnMap
share/html/Elements/ShowCustomFieldDate #customfield date patch (NEW)
share/html/Elements/SelectDate
share/html/Ticket/Elements/ShowSummary
share/html/Ticket/Elements/ShowTransactionAttachments
share/html/Ticket/Elements/Tabs
- share/html/Ticket/Graph/index.html
share/html/Ticket/ModifyCustomers.html
html/NoAuth/css/3.5-default/main.css
html/NoAuth/css/3.5-default/misc.css
%# END BPS TAGGED BLOCK }}}
<& /Elements/ListActions, actions => \@results &>
-% my $path = $m->request_comp->path;
-% $path =~ s(^/rt)(); #hacky, dunno why this happens
-<form action="<%RT->Config->Get('WebPath')%><% $path |n %>" method="post" name="EditCustomFields">
+<form action="<%RT->Config->Get('WebPath')%><% $m->request_comp->path |n %>" method="post" name="EditCustomFields">
<input type="hidden" class="hidden" name="id" value="<% $Object->Id || ''%>" />
<input type="hidden" class="hidden" name="ObjectType" value="<% $ObjectType %>" />
<input type="hidden" class="hidden" name="SubType" value="<% $SubType %>" />
} qw(WebPath WebBaseURL WebURL)),
WebRequestPath => { value => sub { substr( $m->request_path, 1 ) } },
- #WebRequestPathDir => { value => sub { substr( $m->request_comp->dir_path, 1 ) } },
- WebRequestPathDir => { value => sub {
- my $wrpd = substr( $m->request_comp->dir_path, 1 );
- $wrpd =~ s(^rt/)(); #hacky, dunno why this happens
- $wrpd;
- } },
+ WebRequestPathDir => { value => sub { substr( $m->request_comp->dir_path, 1 ) } },
};
$COLUMN_MAP->{'CF'} = $COLUMN_MAP->{'CustomField'};
: ($args->{'PassArguments'});
my %pass = map { $_ => $args->{$_} } grep exists $args->{$_}, @pass;
- my $path = $m->request_path;
- $path =~ s(^/rt)(); #hacky, dunno why this happens
- my $uri = RT->Config->Get('WebPath') . $path;
+ my $uri = RT->Config->Get('WebPath') . $m->request_path;
my @res = (
\'<a href="',
%#
%# END BPS TAGGED BLOCK }}}
<&|/Widgets/TitleBox, title => loc('Refresh')&>
-<form method="get" action="<% RT->Config->Get('WebPath') . $path %>">
+<form method="get" action="<% RT->Config->Get('WebPath') . $m->request_path %>">
<& /Elements/Refresh, Name => 'HomeRefreshInterval',
Default => $session{'home_refresh_interval'}||RT->Config->Get('HomePageRefreshInterval', $session{'CurrentUser'}) &>
<& /Elements/Submit, Label => loc('Go!') &>
</&>
</form>
-<%init>
-my $path = $m->request_path;
-$path =~ s(^/rt)(); #hacky, dunno why this happens
-</%init>
<& Elements/ShowGraph, %ARGS, Ticket => $ticket &>
-% my $path = $m->request_comp->path;
-% $path =~ s(^/rt)(); #hacky, dunno why this happens
-<form action="<% RT->Config->Get('WebPath') . $path %>">
+<form action="<% RT->Config->Get('WebPath') . $m->request_comp->path %>">
<input type="hidden" class="hidden" name="id" value="<% $id %>" />
<& Elements/EditGraphProperties, %ARGS, Ticket => $ticket &>