bug 1542 followup - tweak to keep handling the UI selected value out of C4
authorGalen Charlton <gmcharlt@gmail.com>
Sun, 14 Feb 2010 23:30:08 +0000 (18:30 -0500)
committerGalen Charlton <gmcharlt@gmail.com>
Sun, 14 Feb 2010 23:31:21 +0000 (18:31 -0500)
Signed-off-by: Galen Charlton <gmcharlt@gmail.com>

C4/Reports/Guided.pm
reports/dictionary.pl

index 3cdd5b4..108d57a 100644 (file)
@@ -162,7 +162,6 @@ sub get_report_areas {
         my %hashrep;
         $hashrep{id}   = $i + 1;
         $hashrep{name} = $reports[$i];
-        $hashrep{selected} = 1 if $hashrep{id} == $area;
         push @reports2, \%hashrep;
     }
     return ( \@reports2 );
index 3fd4e52..4f3814e 100755 (executable)
@@ -55,7 +55,10 @@ my   ( $template, $borrowernumber, $cookie ) = get_template_and_user(
 
 if ($phase eq 'View Dictionary'){
        # view the dictionary we use to set up abstract variables such as all borrowers over fifty who live in a certain town
-       my $areas = get_report_areas($area);
+       my $areas = get_report_areas();
+    foreach (@{ $areas }) {
+        $_->{selected} = 1 if $_->{id} eq $area; # mark active area
+    }
        my $definitions = get_from_dictionary($area);
        $template->param( 'areas' => $areas ,
                'start_dictionary' => 1,