[Koha-cvs] CVS: koha/C4 SearchMarc.pm,1.38,1.39

doXulting doxulting at users.sourceforge.net
Thu Mar 3 10:32:06 CET 2005


Update of /cvsroot/koha/koha/C4
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv17748/C4

Modified Files:
	SearchMarc.pm 
Log Message:
Added a param to catalogsearch to allow selection of order (ASC or DESC)

Index: SearchMarc.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/SearchMarc.pm,v
retrieving revision 1.38
retrieving revision 1.39
diff -C2 -r1.38 -r1.39
*** SearchMarc.pm	1 Mar 2005 13:40:49 -0000	1.38
--- SearchMarc.pm	3 Mar 2005 09:32:04 -0000	1.39
***************
*** 166,170 ****
  
  sub catalogsearch {
! 	my ($dbh, $tags, $and_or, $excluding, $operator, $value, $offset,$length,$orderby) = @_;
  	# build the sql request. She will look like :
  	# select m1.bibid
--- 166,170 ----
  
  sub catalogsearch {
! 	my ($dbh, $tags, $and_or, $excluding, $operator, $value, $offset,$length,$orderby, $desc_or_asc) = @_;
  	# build the sql request. She will look like :
  	# select m1.bibid
***************
*** 189,193 ****
  	my $any_not = 0;
  	$orderby = "biblio.title" unless $orderby;
! 	
  	#last minute stripping out of ' and ,
  # paul : quoting, it's done a few lines lated.
--- 189,193 ----
  	my $any_not = 0;
  	$orderby = "biblio.title" unless $orderby;
! 	$desc_or_asc = "ASC" unless $desc_or_asc;
  	#last minute stripping out of ' and ,
  # paul : quoting, it's done a few lines lated.
***************
*** 277,285 ****
  	my $sth;
  	if ($sql_where2) {
! 		$sth = $dbh->prepare("select distinct m1.bibid from biblio,biblioitems,marc_biblio,$sql_tables where biblio.biblionumber=marc_biblio.biblionumber and biblio.biblionumber=biblioitems.biblionumber and m1.bibid=marc_biblio.bibid and $sql_where2 and ($sql_where1) order by $orderby");
! 		warn "Q2 : select distinct m1.bibid from biblio,biblioitems,marc_biblio,$sql_tables where biblio.biblionumber=marc_biblio.biblionumber and biblio.biblionumber=biblioitems.biblionumber and m1.bibid=marc_biblio.bibid and $sql_where2 and ($sql_where1) order by $orderby term is  @$value";
  	} else {
! 		$sth = $dbh->prepare("select distinct m1.bibid from biblio,biblioitems,marc_biblio,$sql_tables where biblio.biblionumber=marc_biblio.biblionumber and biblio.biblionumber=biblioitems.biblionumber and m1.bibid=marc_biblio.bibid and $sql_where1 order by $orderby");
! 		warn "Q : select distinct m1.bibid from biblio,biblioitems,marc_biblio,$sql_tables where biblio.biblionumber=marc_biblio.biblionumber and biblio.biblionumber=biblioitems.biblionumber and m1.bibid=marc_biblio.bibid and $sql_where1 order by $orderby";
  	}
  	$sth->execute();
--- 277,285 ----
  	my $sth;
  	if ($sql_where2) {
! 		$sth = $dbh->prepare("select distinct m1.bibid from biblio,biblioitems,marc_biblio,$sql_tables where biblio.biblionumber=marc_biblio.biblionumber and biblio.biblionumber=biblioitems.biblionumber and m1.bibid=marc_biblio.bibid and $sql_where2 and ($sql_where1) order by $orderby $desc_or_asc");
! 		warn "Q2 : select distinct m1.bibid from biblio,biblioitems,marc_biblio,$sql_tables where biblio.biblionumber=marc_biblio.biblionumber and biblio.biblionumber=biblioitems.biblionumber and m1.bibid=marc_biblio.bibid and $sql_where2 and ($sql_where1) order by $orderby $desc_or_asc term is  @$value";
  	} else {
! 		$sth = $dbh->prepare("select distinct m1.bibid from biblio,biblioitems,marc_biblio,$sql_tables where biblio.biblionumber=marc_biblio.biblionumber and biblio.biblionumber=biblioitems.biblionumber and m1.bibid=marc_biblio.bibid and $sql_where1 order by $orderby $desc_or_asc");
! 		warn "Q : select distinct m1.bibid from biblio,biblioitems,marc_biblio,$sql_tables where biblio.biblionumber=marc_biblio.biblionumber and biblio.biblionumber=biblioitems.biblionumber and m1.bibid=marc_biblio.bibid and $sql_where1 order by $orderby $desc_or_asc";
  	}
  	$sth->execute();





More information about the Koha-cvs mailing list