Merge branch 'master' of https://github.com/jgoodman/Freeside
[freeside.git] / rt / share / html / Elements / Tabs
index a82cdd1..6eae81d 100755 (executable)
@@ -2,7 +2,7 @@
 %#
 %# COPYRIGHT:
 %#
-%# This software is Copyright (c) 1996-2013 Best Practical Solutions, LLC
+%# This software is Copyright (c) 1996-2014 Best Practical Solutions, LLC
 %#                                          <sales@bestpractical.com>
 %#
 %# (Except where explicitly superseded by other copyright notices)
@@ -56,7 +56,7 @@ $request_path =~ s!/{2,}!/!g;
 my $query_string = sub {
     my %args = @_;
     my $u    = URI->new();
-    $u->query_form(%args);
+    $u->query_form(map { $_ => $args{$_} } sort keys %args);
     return $u->query;
 };
 
@@ -660,8 +660,10 @@ my $build_main_nav = sub {
                     if ( $item_map->{$id}->{next} ) {
                         $search->child( next =>
                             title => loc('Next') . ' >',  class => "nav", path => "/Ticket/Display.html?id=" . $item_map->{$id}->{next});
-                        $search->child( last =>
-                            title => loc('Last') . ' >>', class => "nav", path => "/Ticket/Display.html?id=" . $item_map->{last});
+                        if ( $item_map->{last} ) {
+                            $search->child( last =>
+                                title => loc('Last') . ' >>', class => "nav", path => "/Ticket/Display.html?id=" . $item_map->{last});
+                        }
                     }
                 }
             }