[Koha-cvs] koha/opac opac-zoomsearch.pl [dev_week]

Joshua Ferraro jmf at kados.org
Wed Jun 7 23:17:27 CEST 2006


CVSROOT:	/sources/koha
Module name:	koha
Branch:		dev_week
Changes by:	Joshua Ferraro <kados>	06/06/07 21:17:27

Modified files:
	opac           : opac-zoomsearch.pl 

Log message:
	adding some variables for the template

CVSWeb URLs:
http://cvs.savannah.gnu.org/viewcvs/koha/opac/opac-zoomsearch.pl?cvsroot=koha&only_with_tag=dev_week&r1=1.1.2.4&r2=1.1.2.5

Patches:
Index: opac-zoomsearch.pl
===================================================================
RCS file: /sources/koha/koha/opac/Attic/opac-zoomsearch.pl,v
retrieving revision 1.1.2.4
retrieving revision 1.1.2.5
diff -u -b -r1.1.2.4 -r1.1.2.5
--- opac-zoomsearch.pl	7 Jun 2006 20:21:11 -0000	1.1.2.4
+++ opac-zoomsearch.pl	7 Jun 2006 21:17:27 -0000	1.1.2.5
@@ -10,12 +10,13 @@
 use CGI;
 my $query=new CGI;
 my $op = $query->param('op'); #show the search form or execute the search
-my $query_form = $query->param('query_form'); # which query form was submitted
 my $cql_query = $query->param('cql_query');
 my @newresults;
 my ($template,$borrowernumber,$cookie);
 my @forminputs;		#this is for the links to navigate among the results when they are more than the maximum number of results per page
 my $searchdesc;
+my $search_type = $query->param('search_type');
+
 ## Check if we're searching
 if ($op eq 'get_results') { # Yea, we're searching, load the results template
 	($template, $borrowernumber, $cookie)
@@ -173,6 +174,19 @@
                         );        
 		push @branchloop, \%row;
 	}
+
+	# set the default tab, etc.
+	my $search_type = $query->param('query_form');
+	if ((!$search_type) || ($search_type eq 'cql'))  {
+		$template->param(cql_search => 1);
+	} elsif ($search_type eq 'advanced') {
+		$template->param(advanced_search => 1);
+	} elsif ($search_type eq 'power') {
+		$template->param(power_search => 1);
+	} elsif ($search_type eq 'proximity') {
+		$template->param(proximity_search => 1);
+	}
+
 	$template->param(
 			branchloop=>\@branchloop,
 			itemtypeloop=>\@itemtypeloop,
@@ -188,12 +202,12 @@
 	my ($type,$query,$reorder,$num,$startfrom) = @_;
 	my $dbh = C4::Context->dbh;
 	my $zconn=C4::Context->Zconn("biblioserver");
-warn ($type,$query,$reorder,$num,$startfrom) ;
+
+	warn ($type,$query,$reorder,$num,$startfrom) ;
 	if ($zconn eq "error") {
 		return("error with connection",undef); #FIXME: better error handling
 	}
 	
-
 	my $zoom_query_obj;
 	eval {
 	if ($type eq 'cql') {
@@ -205,6 +219,7 @@
 	if ($@) {
 		return("error with search: $@",undef); #FIXME: better error handling
     }	
+
 	# PERFORM THE SEARCH
 	my $result;
 	eval {
@@ -214,12 +229,13 @@
 	if ($@) {
 		return("error with search: $@",undef); #FIXME: better error handling
 	}
-if ($reorder){
-warn $reorder;
-if($result->sort("yaz","$reorder")<0){
-warn "sort did not work";
-}
-}
+
+#	if ($reorder){
+#		warn $reorder;
+#		if($result->sort("yaz","$reorder")<0){
+#			warn "sort did not work";
+#		}
+#	}
 	my $i;
 	my $numresults = $result->size() if  ($result);
 	my @results;





More information about the Koha-cvs mailing list