[Rt-commit] rtir branch, 2.6/pass-constituency-to-reporting, created. 2.6.2rc1-1-g8535f78

Kevin Falcone falcone at bestpractical.com
Thu Aug 9 19:01:42 EDT 2012


The branch, 2.6/pass-constituency-to-reporting has been created
        at  8535f782e33e2d5697a9600ddc23b6db127d3231 (commit)

- Log -----------------------------------------------------------------
commit 8535f782e33e2d5697a9600ddc23b6db127d3231
Author: Kevin Falcone <falcone at bestpractical.com>
Date:   Thu Aug 9 18:51:56 2012 -0400

    Ensure that reports are passed the Constituency selected on the index.html
    
    Back in 2.4, EditRTIRField would put a Constituency field in as a hidden
    field with a pointer to which element in the $ARGS to look up to get the
    selected value.  Because we stopped doing this in 2.6,
    $ARGS{Constituency} doesn't exist and can't be used to pull the selected
    value out.  The smalled fix appears to be to load the CF and just use it
    to get the expected data out of %ARGS.
    
    If you're not using constituencies, I don't think Reports work terribly
    well, so some future work is required to hide the empty dropdown and
    ensure that limits don't rely on them.

diff --git a/html/RTIR/Reporting/index.html b/html/RTIR/Reporting/index.html
index 89d5055..ae18a1a 100644
--- a/html/RTIR/Reporting/index.html
+++ b/html/RTIR/Reporting/index.html
@@ -75,9 +75,9 @@
 
 <%INIT>
 if ( $ARGS{'HTMLReport'} || $ARGS{'TextReport'} || $ARGS{'SpreadsheetReport'} ) {
-    if ( $ARGS{'Constituency'} ) {
-        delete $ARGS{ 'Object-RT::Ticket--'. $ARGS{'Constituency'} .'-Magic' };
-        $ARGS{'Constituency'} = delete $ARGS{ 'Object-RT::Ticket--'. $ARGS{'Constituency'} };
+    unless ( $ARGS{'Constituency'} ) {
+        my $constituency_cf = RT::IR::GetCustomField('Constituency');
+        $ARGS{'Constituency'} = delete $ARGS{ 'Object-RT::Ticket--CustomField-'. $constituency_cf->Id .'-Values' };
     }
     my $ext = 'html';
     $ext = 'txt' if $ARGS{'TextReport'};

-----------------------------------------------------------------------


More information about the Rt-commit mailing list