(bug #2881) preselect default sorting
authorNahuel ANGELINETTI <nahuel.angelinetti@biblibre.com>
Tue, 23 Dec 2008 14:00:27 +0000 (15:00 +0100)
committerGalen Charlton <galen.charlton@liblime.com>
Wed, 31 Dec 2008 17:10:31 +0000 (11:10 -0600)
This patch just set a variable with the name of default sorting, and value 1

Signed-off-by: Galen Charlton <galen.charlton@liblime.com>
catalogue/search.pl
opac/opac-search.pl

index 13b137b..014d4f6 100755 (executable)
@@ -265,7 +265,12 @@ if ( $template_type eq 'advsearch' ) {
     
     my $secondary_servers_loop;# = displaySecondaryServers();
     $template->param(outer_sup_servers_loop => $secondary_servers_loop,);
-    
+
+    # set the default sorting
+    my $default_sort_by = C4::Context->preference('defaultSortField')."_".C4::Context->preference('defaultSortOrder')
+        if (C4::Context->preference('OPACdefaultSortField') && C4::Context->preference('OPACdefaultSortOrder'));
+    $template->param($default_sort_by => 1);
+
     # determine what to display next to the search boxes (ie, boolean option
     # shouldn't appear on the first one, scan indexes should, adding a new
     # box should only appear on the last, etc.
index ddccb84..e5e916d 100755 (executable)
@@ -179,7 +179,12 @@ if ( $template_type eq 'advsearch' ) {
     
     my $secondary_servers_loop;# = displaySecondaryServers();
     $template->param(outer_sup_servers_loop => $secondary_servers_loop,);
-    
+
+    # set the default sorting
+    my $default_sort_by = C4::Context->preference('OPACdefaultSortField')."_".C4::Context->preference('OPACdefaultSortOrder') 
+        if (C4::Context->preference('OPACdefaultSortField') && C4::Context->preference('OPACdefaultSortOrder'));
+    $template->param($default_sort_by => 1);
+
     # determine what to display next to the search boxes (ie, boolean option
     # shouldn't appear on the first one, scan indexes should, adding a new
     # box should only appear on the last, etc.