Permalink
Browse files

When linking to printable report, provide a default reportype to be

less confusing.
  • Loading branch information...
1 parent 0c780bd commit 6aaff52cebb38945567c063f95b4332e22ac78f8 Chia-liang Kao committed Dec 20, 2006
Showing with 12 additions and 12 deletions.
  1. +1 −0 html/Reports/Activity/Elements/ScreenFooter
  2. +11 −12 html/Reports/Activity/index.html
@@ -4,6 +4,7 @@
% my %printable_args = %ARGS;
% delete $printable_args{$_} for (qw/path title mode/);
% $printable_args{'mode'} = 'print';
+% $printable_args{'ReportType'} ||= 'ActivityDetail';
% my $url = $path .'?'. join(';', map { $_."=".$printable_args{$_} } keys %printable_args);
<a href="<%$RT::WebPath . $url |n%>"><&|/l&>Printable version</&></a>
</div>
@@ -11,29 +11,28 @@
</&>
<%args>
-$ReportType => undef
-$start => undef
-$end => undef
-$query => undef
+$ReportType => undef
$mode => 'screen'
</%args>
<%init>
-unless ($start) {
+$ReportType = $ARGS{ReportType} ||= $ARGS{type};
+$ARGS{Start} ||= $ARGS{start};
+$ARGS{End} ||= $ARGS{end};
+$ARGS{Query} ||= $ARGS{query};
+delete $ARGS{$_} for qw(type start end query);
+
+unless ($ARGS{Start}) {
my $then = RT::Date->new($session{'CurrentUser'});
$then->Set(Format => 'Unix', Value => time - (86400*7));
- $ARGS{start} = substr($then->ISO,0,10);
+ $ARGS{Start} = substr($then->ISO,0,10);
}
-unless ($end) {
+unless ($ARGS{End}) {
my $now = RT::Date->new($session{'CurrentUser'});
$now->SetToNow();
- $ARGS{end} = substr($now->ISO,0,10);
+ $ARGS{End} = substr($now->ISO,0,10);
}
-$ARGS{ReportType} ||= $ARGS{type};
-$ARGS{Start} ||= $ARGS{start};
-$ARGS{End} ||= $ARGS{end};
-$ARGS{Query} ||= $ARGS{query};
my $saved_search = $m->comp( '/Widgets/SavedSearch:new',
SearchType => 'ActivityReport',

0 comments on commit 6aaff52

Please sign in to comment.