projects
/
koha-ffzg.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
5216516
)
minor bugfix
author
genjimoto
<genjimoto>
Thu, 2 Jun 2005 04:36:22 +0000
(
04:36
+0000)
committer
genjimoto
<genjimoto>
Thu, 2 Jun 2005 04:36:22 +0000
(
04:36
+0000)
opac/searchoptions.pl
patch
|
blob
|
history
diff --git
a/opac/searchoptions.pl
b/opac/searchoptions.pl
index
6448d46
..
943727e
100644
(file)
--- a/
opac/searchoptions.pl
+++ b/
opac/searchoptions.pl
@@
-33,24
+33,23
@@
my $avail = $query->param("avail");
my $brancheslist;
my $count=0;
my $newquery='';
my $brancheslist;
my $count=0;
my $newquery='';
-my $subfoundbool=0;
-my $itemtypefoundbool=0;
-my $branchfoundbool=0;
+my $keywordfoundbool=0;
my $itemtypeslist;
my $itemtypescatlist;
my $itemtypessubcatlist;
my $mediatypeslist;
my $itemtypeslist;
my $itemtypescatlist;
my $itemtypessubcatlist;
my $mediatypeslist;
+
$count=0;
my $dbh=C4::Context->dbh;
$newquery='op=do_search&nbstatements='.$nbstatements;
$count=0;
my $dbh=C4::Context->dbh;
$newquery='op=do_search&nbstatements='.$nbstatements;
-if ($allcategoriesbool
eq ''
&& $category ne ''){
+if ($allcategoriesbool
== 0
&& $category ne ''){
my $sth=$dbh->prepare("select itemtypecodes from categorytable where categorycode=?");
$sth->execute($category);
$itemtypescatlist = $sth->fetchrow .'|';
$sth->finish;
}
my $sth=$dbh->prepare("select itemtypecodes from categorytable where categorycode=?");
$sth->execute($category);
$itemtypescatlist = $sth->fetchrow .'|';
$sth->finish;
}
-if ($allmediatypesbool
eq ''
&& @mediatypeswanted ne ''){
+if ($allmediatypesbool
== 0
&& @mediatypeswanted ne ''){
foreach my $mediatype (@mediatypeswanted){
my $sth=$dbh->prepare("select itemtypecodes from mediatypetable where mediatypecode=?");
$sth->execute($mediatype);
foreach my $mediatype (@mediatypeswanted){
my $sth=$dbh->prepare("select itemtypecodes from mediatypetable where mediatypecode=?");
$sth->execute($mediatype);
@@
-59,7
+58,7
@@
if ($allmediatypesbool eq '' && @mediatypeswanted ne ''){
}
}
}
}
-if ($allsubcategoriesbool
eq ''
&& @subcategorieswanted ne ''){
+if ($allsubcategoriesbool
== 0
&& @subcategorieswanted ne ''){
foreach my $subcategory (@subcategorieswanted){
my $sth=$dbh->prepare("select itemtypecodes from subcategorytable where subcategorycode=?");
$sth->execute($subcategory);
foreach my $subcategory (@subcategorieswanted){
my $sth=$dbh->prepare("select itemtypecodes from subcategorytable where subcategorycode=?");
$sth->execute($subcategory);
@@
-68,13
+67,13
@@
if ($allsubcategoriesbool eq '' && @subcategorieswanted ne ''){
}
}
}
}
-if ($allitemtypesbool
ne ''
){
-#warn @itemtypeswanted;
+if ($allitemtypesbool
== 0
){
+
$itemtypeslist .=$itemtypescatlist.$itemtypessubcatlist.$mediatypeslist.$itemtypessearched.join ("|", @itemtypeswanted)
} else {
$itemtypeslist .=$itemtypescatlist.$itemtypessubcatlist.$mediatypeslist.$itemtypessearched
}
$itemtypeslist .=$itemtypescatlist.$itemtypessubcatlist.$mediatypeslist.$itemtypessearched.join ("|", @itemtypeswanted)
} else {
$itemtypeslist .=$itemtypescatlist.$itemtypessubcatlist.$mediatypeslist.$itemtypessearched
}
-#warn $itemtypeslist;
+
if ($allbranchesbool == 0){
$brancheslist = join("|",@brancheswanted)
}
if ($allbranchesbool == 0){
$brancheslist = join("|",@brancheswanted)
}
@@
-96,15
+95,15
@@
if ($searchtype eq 'NewSearch'){
$newquery .= $operator[$count];
$newquery .= '&value='.$value[$count];
if ($marclist[$count] eq ''){
$newquery .= $operator[$count];
$newquery .= '&value='.$value[$count];
if ($marclist[$count] eq ''){
- if ($
sub
foundbool=0){
- $
sub
foundbool=1;
+ if ($
keyword
foundbool=0){
+ $
keyword
foundbool=1;
$newquery .=" ".join(" ",@keywords)
}
}
$count++;
}
$newquery .=" ".join(" ",@keywords)
}
}
$count++;
}
- if ($
sub
foundbool == 0 && $query->param('keysub') ne ''){
+ if ($
keyword
foundbool == 0 && $query->param('keysub') ne ''){
$newquery .= '&marclist=&and_or=and&excluding=&operator=contains&value=';
$newquery .=join(" ",@keywords)
}
$newquery .= '&marclist=&and_or=and&excluding=&operator=contains&value=';
$newquery .=join(" ",@keywords)
}