Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
best-practical
rtir
Commits
deb1f1c7
Commit
deb1f1c7
authored
Jun 12, 2014
by
Kevin Falcone
Browse files
Merge branch '3.0/reports-without-constituencies' into 3.0-trunk
parents
3131f5a8
e25063ca
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
24 additions
and
6 deletions
+24
-6
html/RTIR/Reporting/Report.html
html/RTIR/Reporting/Report.html
+10
-1
html/RTIR/Reporting/index.html
html/RTIR/Reporting/index.html
+14
-5
No files found.
html/RTIR/Reporting/Report.html
View file @
deb1f1c7
...
...
@@ -46,7 +46,13 @@
%#
%# END BPS TAGGED BLOCK }}}
<
%
PERL
>
$m->comp("SELF:Heading$ReportAs", Text => loc('RTIR Periodic Report for [_1]', $Constituency) );
if ( $Constituency ){
$m->comp("SELF:Heading$ReportAs", Text => loc('RTIR Periodic Report for [_1]', $Constituency) );
}
else{
$m->comp("SELF:Heading$ReportAs", Text => loc('RTIR Periodic Report') );
}
$m->comp("SELF:TwoColumnsTable$ReportAs",
Body => [
[ loc('Start date'), $rtstart->AsString ],
...
...
@@ -121,6 +127,9 @@ my $filter_by_incident_field = sub {
%$res = %$tickets;
}
# No filter on Constituency if that feature isn't being used
return $res if $field eq 'Constituency' and not $condition;
while( my($id, $t) = each %$res ) {
my $value = $get_incident_field->( $t, $field );
delete $res->{$id} if $value? $value ne $condition: $condition;
...
...
html/RTIR/Reporting/index.html
View file @
deb1f1c7
...
...
@@ -50,6 +50,7 @@
<form
action=
"index.html"
method=
"post"
>
<table>
% unless ( $ConstituencyDisabled ){
<tr>
<td
class=
"label"
><
&|/
l
&
>
Constituency
</
&
>
:
</td>
<td
class=
"value"
>
...
...
@@ -61,6 +62,7 @@
&
>
</td>
</tr>
% }
<tr>
<td
class=
"label"
><
&|/
l
&
>
Start Date:
</
&
></td>
<td
class=
"input"
>
...
...
@@ -92,9 +94,19 @@
</form>
<
%
INIT
>
my $QueueObj = RT::Queue->new($session{'CurrentUser'});
$QueueObj->Load('Incidents');
RT::Logger->error('Unable to load Incidents queue') unless $QueueObj->Id;
my $ConstituencyDisabled = 0;
my $constituency_cf = RT::CustomField->new($session{'CurrentUser'});
my ($ok, $msg) = $constituency_cf->LoadByName(Queue => $QueueObj->Id, Name => 'Constituency');
if ( not $ok or $constituency_cf->Disabled ){
$ConstituencyDisabled = 1;
}
if ( $ARGS{'HTMLReport'} || $ARGS{'TextReport'} || $ARGS{'SpreadsheetReport'} ) {
unless ( $ARGS{'Constituency'} ) {
my $constituency_cf = RT::IR::GetCustomField('Constituency');
unless ( $ARGS{'Constituency'} or $ConstituencyDisabled ) {
$ARGS{'Constituency'} = delete $ARGS{ 'Object-RT::Ticket--CustomField-'. $constituency_cf->Id .'-Values' };
}
my $ext = 'html';
...
...
@@ -105,9 +117,6 @@ if ( $ARGS{'HTMLReport'} || $ARGS{'TextReport'} || $ARGS{'SpreadsheetReport'} )
$m->redirect($url);
}
my $QueueObj = RT::Queue->new($session{'CurrentUser'});
$QueueObj->Load('Incidents');
my $now = RT::Date->new(RT->SystemUser);
$now->SetToNow();
my $end = RT::Date->new(RT->SystemUser);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment