calamaris: Fix viewing reports.
authorMichael Tremer <michael.tremer@ipfire.org>
Mon, 26 Nov 2012 09:55:32 +0000 (10:55 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Mon, 26 Nov 2012 09:55:32 +0000 (10:55 +0100)
Fixes that only the last created report could be viewed (#10259).

config/rootfiles/core/65/filelists/files
html/cgi-bin/logs.cgi/calamaris.dat

index a2f3ab8..f481777 100644 (file)
@@ -1,5 +1,6 @@
 etc/system-release
 etc/issue
+srv/web/ipfire/cgi-bin/logs.cgi/calamaris.dat
 srv/web/ipfire/cgi-bin/ovpnmain.cgi
 usr/sbin/ovpn-ccd-convert
 var/ipfire/general-functions.pl
index 19a3693..4ee60c2 100644 (file)
@@ -98,6 +98,7 @@ if ($reportsettings{'ACTION'} eq $Lang::tr{'calamaris create report'})
        delete $reportsettings{'DAY_END'};
        delete $reportsettings{'MONTH_END'};
        delete $reportsettings{'YEAR_END'};
+       delete $reportsettings{'REPORT'};
 
        &General::writehash("${General::swroot}/proxy/calamaris/settings", \%reportsettings);
 
@@ -493,12 +494,11 @@ END
 if (@reports)
 {
        print "<td><select name='REPORT' size='5'>\n";
-       my $n=0;
        foreach (@reports)
        {
                @reportdata=split(/#/);
                print "\t<option ";
-               if ($n eq '0') { print "selected "; $reportsettings{'REPORT'}=$reportdata[1]; $n++}
+               if ($reportsettings{'REPORT'} eq $reportdata[1]) { print "selected ";}
                print "value='$reportdata[1]'>$reportdata[2] &nbsp;-&nbsp; $reportdata[3]</option>\n";
        }
        print "</select></td>\n";