From 59bdcf6b28a62a80aed643fde38056884e59087d Mon Sep 17 00:00:00 2001 From: Nahuel ANGELINETTI Date: Tue, 23 Dec 2008 15:00:27 +0100 Subject: [PATCH] (bug #2881) preselect default sorting This patch just set a variable with the name of default sorting, and value 1 --- catalogue/search.pl | 7 ++++++- opac/opac-search.pl | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/catalogue/search.pl b/catalogue/search.pl index 4c37fb9b72..902318a91d 100755 --- a/catalogue/search.pl +++ b/catalogue/search.pl @@ -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. diff --git a/opac/opac-search.pl b/opac/opac-search.pl index b9a3af2c8e..fd3d782b7a 100755 --- a/opac/opac-search.pl +++ b/opac/opac-search.pl @@ -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. -- 2.39.5