From 5aa60ee6671630d478c15b032e526b8ab63b7c19 Mon Sep 17 00:00:00 2001 From: tipaul Date: Mon, 3 Jan 2005 10:48:33 +0000 Subject: [PATCH] * 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. --- C4/Biblio.pm | 10 ++- C4/SearchMarc.pm | 12 +-- .../default/en/catalogue/MARCdetail.tmpl | 80 ++++++++++++++----- .../parameters/marc_subfields_structure.tmpl | 1 + 4 files changed, 76 insertions(+), 27 deletions(-) diff --git a/C4/Biblio.pm b/C4/Biblio.pm index ef527cbb63..3424cdd9e9 100644 --- a/C4/Biblio.pm +++ b/C4/Biblio.pm @@ -253,7 +253,7 @@ sub MARCgettagslib { $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" +"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); @@ -265,12 +265,13 @@ sub MARCgettagslib { my $seealso; my $hidden; my $isurl; + my $link; while ( ( $tag, $subfield, $lib, $tab, $mandatory, $repeatable, $authorised_value, $authtypecode, $value_builder, $kohafield, $seealso, $hidden, - $isurl ) + $isurl, $link ) = $sth->fetchrow ) { @@ -285,6 +286,7 @@ sub MARCgettagslib { $res->{$tag}->{$subfield}->{seealso} = $seealso; $res->{$tag}->{$subfield}->{hidden} = $hidden; $res->{$tag}->{$subfield}->{isurl} = $isurl; + $res->{$tag}->{$subfield}->{link} = $link; } return $res; } @@ -2632,6 +2634,10 @@ Paul POULAIN paul.poulain@free.fr # $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) # In 2.4, a new DB structure will highly speed things and this limit will be removed. diff --git a/C4/SearchMarc.pm b/C4/SearchMarc.pm index e4a4abf050..5f8d71ecbe 100644 --- a/C4/SearchMarc.pm +++ b/C4/SearchMarc.pm @@ -166,6 +166,7 @@ $marcflavour ("MARC21" or "UNIMARC") determines which tags are used for retrievi 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 # from marc_subfield_table as m1, marc_subfield_table as m2 @@ -190,10 +191,11 @@ sub catalogsearch { $orderby = "biblio.title" unless $orderby; #last minute stripping out of ' and , - foreach $_ (@$value) { - $_=~ s/\'/ /g; - $_=~ s/\,/ /g; - } +# paul : quoting, it's done a few lines lated. +# foreach $_ (@$value) { +# $_=~ s/\'/ /g; +# $_=~ s/\,/ /g; +# } for(my $i = 0 ; $i <= $#{$value} ; $i++) { @@ -201,7 +203,7 @@ sub catalogsearch { @$value[$i] =~ s/\*/%/g; # remove % at the beginning @$value[$i] =~ s/^%//g; - @$value[$i] =~ s/(\.|\?|\:|\!|\'|,|\-|\"|\(|\)|\[|\]|\{|\})/ /g; + @$value[$i] =~ s/(\.|\?|\:|\!|\'|,|\-|\"|\(|\)|\[|\]|\{|\})/ /g if @$operator[$i] eq "contains"; if(@$excluding[$i]) # NOT statements { $any_not = 1; diff --git a/koha-tmpl/intranet-tmpl/default/en/catalogue/MARCdetail.tmpl b/koha-tmpl/intranet-tmpl/default/en/catalogue/MARCdetail.tmpl index 217efba060..cf0057ed06 100644 --- a/koha-tmpl/intranet-tmpl/default/en/catalogue/MARCdetail.tmpl +++ b/koha-tmpl/intranet-tmpl/default/en/catalogue/MARCdetail.tmpl @@ -85,8 +85,12 @@

@@ -111,8 +115,12 @@

@@ -137,8 +145,12 @@

@@ -163,8 +175,12 @@

@@ -189,8 +205,12 @@

@@ -215,8 +235,12 @@

@@ -241,8 +265,12 @@

@@ -267,8 +295,12 @@

@@ -293,8 +325,12 @@

@@ -319,8 +355,12 @@

diff --git a/koha-tmpl/intranet-tmpl/default/en/parameters/marc_subfields_structure.tmpl b/koha-tmpl/intranet-tmpl/default/en/parameters/marc_subfields_structure.tmpl index fe9559e5ea..368b457dc3 100644 --- a/koha-tmpl/intranet-tmpl/default/en/parameters/marc_subfields_structure.tmpl +++ b/koha-tmpl/intranet-tmpl/default/en/parameters/marc_subfields_structure.tmpl @@ -136,6 +136,7 @@ Auth value :, Authority :, Plugin :, + Link:, ">//images/edittrash.png" width="32" hspace="0" vspace="0" border="0"> -- 2.39.5