From ae98e61004cb4e604240ad292582c10bc3b93c5d Mon Sep 17 00:00:00 2001 From: tipaul Date: Tue, 4 Apr 2006 13:32:08 +0000 Subject: [PATCH] just some tweakings (no changes). nonfillingchar systempref won't work in UNIMARC (as there is no indicator to set it) --- C4/SearchMarc.pm | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/C4/SearchMarc.pm b/C4/SearchMarc.pm index b738e7bd8f..3761c2103d 100644 --- a/C4/SearchMarc.pm +++ b/C4/SearchMarc.pm @@ -335,7 +335,7 @@ sub catalogsearch { push @result,$bibid; } } -if (C4::Context->preference("sortbynonfiling")==1) { +if (C4::Context->preference("sortbynonfiling")) { #~~#~~# next part added by SH Modified by JF # This code resorts the biblio.title results eliminating the # marc non-filing chars @@ -351,13 +351,7 @@ if (C4::Context->preference("sortbynonfiling")==1) { # # if ($orderby eq "biblio.title") { #don't sort by title if another orderby is specified - my $msth = $dbh->prepare("SELECT tagfield, tagsubfield FROM marc_subfield_structure WHERE kohafield='biblio.title'"); - $msth->execute(); # get MARC tag and subfield that is mapped to biblio.title - my $tagdata = $msth->fetchrow_hashref; - my $tag = $tagdata->{tagfield}; - my $subfieldcode = $tagdata->{tagsubfield}; - $msth->finish; - + my ($tag,$subfieldcode) = MARCfind_marc_from_kohafield($dbh,'biblio.title',''); my $tsth = $dbh->prepare("SELECT title, tag_indicator FROM marc_biblio, marc_subfield_table, biblio WHERE marc_biblio.bibid = ? AND marc_subfield_table.bibid=marc_biblio.bibid @@ -372,11 +366,11 @@ if (C4::Context->preference("sortbynonfiling")==1) { $tsth->execute($bibidno,$tag,$subfieldcode); my $titledat = $tsth->fetchrow_hashref; $sorttitle = lc($titledat->{title}); - #warn "Here's the sorttitle beforehand:".$sorttitle; +# warn "Here's the sorttitle beforehand: $titledat->{tag_indicator}=".$sorttitle; if (length($titledat->{tag_indicator})==2) { my $filechar=substr($titledat->{tag_indicator},1,1); $sorttitle = substr($sorttitle,$filechar,-1,""); #remove nonfiling characters - # warn "Here it is afterwards:".$sorttitle; +# warn "Here it is afterwards:".$sorttitle; } $titles{$bibidno} = $sorttitle; #} = $bibidno; # push @resultnew, $titles{$sorttitle};