Bugzilla – Attachment 67 Details for
Bug 1091
Do a second search with shorter terms if there are no results found
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
proposed patches.
opac-search_secondpass.patch (text/plain), 2.75 KB, created by
Chris Cormack
on 2006-05-31 06:59:00 UTC
(
hide
)
Description:
proposed patches.
Filename:
MIME Type:
Creator:
Chris Cormack
Created:
2006-05-31 06:59:00 UTC
Size:
2.75 KB
patch
obsolete
>diff -rc koha-2.2.5-orig/opac-cgi/opac-search.pl koha-2.2.5-patch/opac-cgi/opac-search.pl >*** koha-2.2.5-orig/opac-cgi/opac-search.pl 2006-01-13 14:24:19.000000000 -0700 >--- koha-2.2.5-patch/opac-cgi/opac-search.pl 2006-05-23 16:19:52.000000000 -0600 >*************** >*** 74,82 **** > } > } > findseealso($dbh,\@tags); > my ($results,$total) = catalogsearch($dbh, \@tags,\@and_or, > \@excluding, \@operator, \@value, > $startfrom*$resultsperpage, $resultsperpage,$orderby,$desc_or_asc); > if ($total ==1) { > if (C4::Context->preference("BiblioDefaultView") eq "normal") { > print $query->redirect("/cgi-bin/koha/opac-detail.pl?bib=".@$results[0]->{biblionumber}); >--- 88,144 ---- > } > } > findseealso($dbh,\@tags); >+ SearchPoint: > my ($results,$total) = catalogsearch($dbh, \@tags,\@and_or, > \@excluding, \@operator, \@value, > $startfrom*$resultsperpage, $resultsperpage,$orderby,$desc_or_asc); > > # hide records not to be returned in opac. > for (my $i=0; $i <= $#$results; $i++) { > if ($$results[$i]->{notforopac}) { > splice @$results,$i,1; # remove that element > $i--; # counter $i++ in for() > $total-- if ($total <= $resultsperpage); # one less total > } > } > > # hide record not in this branch if IndependantBranches > if (C4::Context->preference("IndependantBranches") && $branch) { > for (my $i=0; $i <= $#$results; $i++) { > my @items = @{$$results[$i]->{CN}}; > for (my $it=0; $it <= $#items; $it++) { > if ($items[$it]{holdingbranch} != $branch) { > splice @items,$it,1; # remove that element > $it--; # counter $it++ in for() > $$results[$i]{totitem}--; > } else { # IndependantBranches is on, so hide holdingbranch > $items[$it]{holdingbranch} = ""; > $items[$it]{holdingbranchname} = ""; > $items[$it]{location} = ""; > } > } > if (@items) { > @{$$results[$i]->{CN}} = @items; # re-store items > $$results[$i]->{totitem} = $#items + 1; > } else { > splice @$results,$i,1; # items empty, remove record > $i--; # counter $i++ in for() > $total--; # one less total > } > } > } >! >! if ($total == 0 && $passes == 0) { >! #first pass, no results. chop search terms down and try again. >! for ($list_index = 0; $list_index <= $#marclist; $list_index++) { >! if ($marclist[$list_index] =~ /(biblio.title)|(biblio.author)|(bibliosubject.subject)|(biblio.seriestitle)|(biblioitems.publishercode)|()/) { >! $value[$list_index] = substr($value[$list_index],0,4); >! } >! } >! $passes++; >! goto SearchPoint; >! } >! > if ($total ==1) { > if (C4::Context->preference("BiblioDefaultView") eq "normal") { > print $query->redirect("/cgi-bin/koha/opac-detail.pl?bib=".@$results[0]->{biblionumber});
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 1091
:
67