[Koha-patches] [PATCH] Made changes to add sorting on the catalouging screen in the intranet section.

Mason James mason.loves.sushi at gmail.com
Thu Jul 2 09:09:23 CEST 2009


On 2009/07/2, at 6:49 PM, satyanarayana holenarsipur wrote:

> Hi Joe,
>
> Thanks for the quick response.
>
> Yes. It is very similar to main search code. I wanted a sorting  
> feature very similar to what we have now was the search results  
> page. The sort dropdown comes right next to the results table. But  
> I faced a lot of problems while doing this.
>
> The search.pl uses 'getRecords' function to get the records, store  
> it and pas it to the templates.
> The addbooks.pl uses 'SimpleSearch' function to get the records,  
> store it and pass it to the templates.
>
> SimpleSearch has 'offset' as its parameter, but it is only used for  
> pagination function. and cannot be used for sorting the result set.


hiya Satyanarayana

i too recently made a sorting change to addbooks.pl
by simply giving SimpleSearch() a better query.


+    my $ti_query =  qq|ti,rt,wrdl,r3="$query"|;
+
      # find results
-    my ( $error, $marcresults, $total_hits ) = SimpleSearch($query,  
$results_per_page * ($page - 1), $results_per_page);
+    my ( $error, $marcresults, $total_hits ) = SimpleSearch 
($ti_query, $results_per_page * ($page - 1), $results_per_page);


this cleaner method is adequate for your addbooks.pl sorting needs,  
surely?





More information about the Koha-patches mailing list