Fix bug on ordering column with sorttable. Thanks to David Walser for the report.

This commit is contained in:
Darold Gilles 2013-03-08 00:15:47 +01:00
parent 6d6a1ebea4
commit e8fff65b88
1 changed files with 14 additions and 14 deletions

View File

@ -1607,8 +1607,8 @@ sub _print_mime_stat
print $out qq{ print $out qq{
</tr>}; </tr>};
} }
my $sortpos = 2; my $sortpos = 1;
$sortpos = 3 if ($self->{OrderMime} eq 'bytes'); $sortpos = 2 if ($self->{OrderMime} eq 'bytes');
print $out qq{ print $out qq{
</tbody> </tbody>
</table> </table>
@ -1866,9 +1866,9 @@ sub _print_network_stat
<td style="text-align: left;">$network_stat{$net}{url}</td> <td style="text-align: left;">$network_stat{$net}{url}</td>
</tr> </tr>
}; };
my $sortpos = 2; my $sortpos = 1;
$sortpos = 3 if ($self->{OrderNetwork} eq 'bytes'); $sortpos = 2 if ($self->{OrderNetwork} eq 'bytes');
$sortpos = 4 if ($self->{OrderNetwork} eq 'duration'); $sortpos = 3 if ($self->{OrderNetwork} eq 'duration');
print $outnet qq{ print $outnet qq{
<script type="text/javascript">sortpos = $sortpos;</script> <script type="text/javascript">sortpos = $sortpos;</script>
<div class="uplink"> <div class="uplink">
@ -1880,9 +1880,9 @@ sub _print_network_stat
} }
print $out "</tbody></table>\n"; print $out "</tbody></table>\n";
my $sortpos = 2; my $sortpos = 1;
$sortpos = 3 if ($self->{OrderNetwork} eq 'bytes'); $sortpos = 2 if ($self->{OrderNetwork} eq 'bytes');
$sortpos = 4 if ($self->{OrderNetwork} eq 'duration'); $sortpos = 3 if ($self->{OrderNetwork} eq 'duration');
print $out qq{ print $out qq{
<script type="text/javascript">sortpos = $sortpos;</script> <script type="text/javascript">sortpos = $sortpos;</script>
<div class="uplink"> <div class="uplink">
@ -2103,9 +2103,9 @@ sub _print_user_stat
$self->_print_footer(\$outusr); $self->_print_footer(\$outusr);
$outusr->close(); $outusr->close();
} }
my $sortpos = 2; my $sortpos = 1;
$sortpos = 3 if ($self->{OrderUser} eq 'bytes'); $sortpos = 2 if ($self->{OrderUser} eq 'bytes');
$sortpos = 4 if ($self->{OrderUser} eq 'duration'); $sortpos = 3 if ($self->{OrderUser} eq 'duration');
print $out qq{ print $out qq{
</tbody> </tbody>
</table> </table>
@ -2339,9 +2339,9 @@ sub _print_user_detail
print $$out qq{ print $$out qq{
</tr>}; </tr>};
} }
my $sortpos = 2; my $sortpos = 1;
$sortpos = 3 if ($self->{OrderUrl} eq 'bytes'); $sortpos = 2 if ($self->{OrderUrl} eq 'bytes');
$sortpos = 4 if ($self->{OrderUrl} eq 'duration'); $sortpos = 3 if ($self->{OrderUrl} eq 'duration');
print $$out qq{ print $$out qq{
</tbody> </tbody>
</table> </table>