[Koha-cvs] CVS: koha/C4 Biblio.pm,1.113,1.114 SearchMarc.pm,1.35,1.36

Paul POULAIN tipaul at users.sourceforge.net
Mon Jan 3 11:48:40 CET 2005


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

Modified Files:
	Biblio.pm SearchMarc.pm 
Log Message:
* bugfix for the search on a MARC detail, when you clic on the magnifying glass (caused an internal server error)
* partial support of the "linkage" MARC feature : if you enter a "link" on a MARC subfield, the magnifying glass won't search on the field, but on the linked field. I agree it's a partial support. Will be improved, but I need to investigate MARC21 & UNIMARC diffs on this topic.

Index: Biblio.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/Biblio.pm,v
retrieving revision 1.113
retrieving revision 1.114
diff -C2 -r1.113 -r1.114
*** Biblio.pm	10 Dec 2004 16:27:53 -0000	1.113
--- Biblio.pm	3 Jan 2005 10:48:33 -0000	1.114
***************
*** 254,258 ****
      $sth =
        $dbh->prepare(
! "select tagfield,tagsubfield,$libfield as lib,tab, mandatory, repeatable,authorised_value,authtypecode,value_builder,kohafield,seealso,hidden,isurl from marc_subfield_structure where frameworkcode=? order by tagfield,tagsubfield"
      );
      $sth->execute($frameworkcode);
--- 254,258 ----
      $sth =
        $dbh->prepare(
! "select tagfield,tagsubfield,$libfield as lib,tab, mandatory, repeatable,authorised_value,authtypecode,value_builder,kohafield,seealso,hidden,isurl,link from marc_subfield_structure where frameworkcode=? order by tagfield,tagsubfield"
      );
      $sth->execute($frameworkcode);
***************
*** 266,269 ****
--- 266,270 ----
      my $hidden;
      my $isurl;
+ 	my $link;
  
      while (
***************
*** 271,275 ****
          $mandatory,     $repeatable, $authorised_value, $authtypecode,
          $value_builder, $kohafield,  $seealso,          $hidden,
!         $isurl )
          = $sth->fetchrow
        )
--- 272,276 ----
          $mandatory,     $repeatable, $authorised_value, $authtypecode,
          $value_builder, $kohafield,  $seealso,          $hidden,
!         $isurl,			$link )
          = $sth->fetchrow
        )
***************
*** 286,289 ****
--- 287,291 ----
          $res->{$tag}->{$subfield}->{hidden}           = $hidden;
          $res->{$tag}->{$subfield}->{isurl}            = $isurl;
+         $res->{$tag}->{$subfield}->{link}            = $link;
      }
      return $res;
***************
*** 2633,2636 ****
--- 2635,2642 ----
  # $Id$
  # $Log$
+ # Revision 1.114  2005/01/03 10:48:33  tipaul
+ # * bugfix for the search on a MARC detail, when you clic on the magnifying glass (caused an internal server error)
+ # * partial support of the "linkage" MARC feature : if you enter a "link" on a MARC subfield, the magnifying glass won't search on the field, but on the linked field. I agree it's a partial support. Will be improved, but I need to investigate MARC21 & UNIMARC diffs on this topic.
+ #
  # Revision 1.113  2004/12/10 16:27:53  tipaul
  # limiting the number of search term to 8. There was no limit before, but 8 words seems to be the upper limit mySQL can deal with (in less than a second. tested on a DB with 13 000 items)

Index: SearchMarc.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/SearchMarc.pm,v
retrieving revision 1.35
retrieving revision 1.36
diff -C2 -r1.35 -r1.36
*** SearchMarc.pm	10 Dec 2004 16:27:53 -0000	1.35
--- SearchMarc.pm	3 Jan 2005 10:48:36 -0000	1.36
***************
*** 167,170 ****
--- 167,171 ----
  sub catalogsearch {
  	my ($dbh, $tags, $and_or, $excluding, $operator, $value, $offset,$length,$orderby) = @_;
+ 	warn "@$tags[0], @$and_or[0], @$excluding[0], @$operator[0], @$value[0], $offset,$length,$orderby";
  	# build the sql request. She will look like :
  	# select m1.bibid
***************
*** 191,198 ****
  	
  	#last minute stripping out of ' and ,
! 	foreach $_ (@$value) {
! 	$_=~ s/\'/ /g;
! 	$_=~ s/\,/ /g;
! 	}
  	
  	for(my $i = 0 ; $i <= $#{$value} ; $i++)
--- 192,200 ----
  	
  	#last minute stripping out of ' and ,
! # paul : quoting, it's done a few lines lated.
! # 	foreach $_ (@$value) {
! # 		$_=~ s/\'/ /g;
! # 		$_=~ s/\,/ /g;
! # 	}
  	
  	for(my $i = 0 ; $i <= $#{$value} ; $i++)
***************
*** 202,206 ****
  		# remove % at the beginning
  		@$value[$i] =~ s/^%//g;
! 	    @$value[$i] =~ s/(\.|\?|\:|\!|\'|,|\-|\"|\(|\)|\[|\]|\{|\})/ /g;
  		if(@$excluding[$i])	# NOT statements
  		{
--- 204,208 ----
  		# remove % at the beginning
  		@$value[$i] =~ s/^%//g;
! 	    @$value[$i] =~ s/(\.|\?|\:|\!|\'|,|\-|\"|\(|\)|\[|\]|\{|\})/ /g if @$operator[$i] eq "contains";
  		if(@$excluding[$i])	# NOT statements
  		{





More information about the Koha-cvs mailing list