Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

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

less confusing.
  • Loading branch information...
commit 6aaff52cebb38945567c063f95b4332e22ac78f8 1 parent 0c780bd
Chia-liang Kao authored
1  html/Reports/Activity/Elements/ScreenFooter
@@ -4,6 +4,7 @@
4 4 % my %printable_args = %ARGS;
5 5 % delete $printable_args{$_} for (qw/path title mode/);
6 6 % $printable_args{'mode'} = 'print';
  7 +% $printable_args{'ReportType'} ||= 'ActivityDetail';
7 8 % my $url = $path .'?'. join(';', map { $_."=".$printable_args{$_} } keys %printable_args);
8 9 <a href="<%$RT::WebPath . $url |n%>"><&|/l&>Printable version</&></a>
9 10 </div>
23 html/Reports/Activity/index.html
@@ -11,29 +11,28 @@
11 11 </&>
12 12
13 13 <%args>
14   -$ReportType => undef
15   -$start => undef
16   -$end => undef
17   -$query => undef
  14 +$ReportType => undef
18 15 $mode => 'screen'
19 16 </%args>
20 17 <%init>
21   -unless ($start) {
  18 +$ReportType = $ARGS{ReportType} ||= $ARGS{type};
  19 +$ARGS{Start} ||= $ARGS{start};
  20 +$ARGS{End} ||= $ARGS{end};
  21 +$ARGS{Query} ||= $ARGS{query};
  22 +delete $ARGS{$_} for qw(type start end query);
  23 +
  24 +unless ($ARGS{Start}) {
22 25 my $then = RT::Date->new($session{'CurrentUser'});
23 26 $then->Set(Format => 'Unix', Value => time - (86400*7));
24   - $ARGS{start} = substr($then->ISO,0,10);
  27 + $ARGS{Start} = substr($then->ISO,0,10);
25 28 }
26 29
27   -unless ($end) {
  30 +unless ($ARGS{End}) {
28 31 my $now = RT::Date->new($session{'CurrentUser'});
29 32 $now->SetToNow();
30   - $ARGS{end} = substr($now->ISO,0,10);
  33 + $ARGS{End} = substr($now->ISO,0,10);
31 34 }
32 35
33   -$ARGS{ReportType} ||= $ARGS{type};
34   -$ARGS{Start} ||= $ARGS{start};
35   -$ARGS{End} ||= $ARGS{end};
36   -$ARGS{Query} ||= $ARGS{query};
37 36
38 37 my $saved_search = $m->comp( '/Widgets/SavedSearch:new',
39 38 SearchType => 'ActivityReport',

0 comments on commit 6aaff52

Please sign in to comment.
Something went wrong with that request. Please try again.