# WARNING: 4-character tab stops here
# Copyright 2000-2002 Katipo Communications
+# Parts Copyright 2010 Biblibre
#
# This file is part of Koha.
#
# don't run the search if no search term !
if ($op eq "do_search" && $query) {
+ ( $template, $loggedinuser, $cookie ) = get_template_and_user(
+ { template_name => "serials/result.tmpl",
+ query => $input,
+ type => "intranet",
+ authnotrequired => 0,
+ flagsrequired => {catalogue => 1, serials => '*'},
+ debug => 1,
+ }
+ );
+
# add the itemtype limit if applicable
my $itemtypelimit = $input->param('itemtypelimit');
if ( $itemtypelimit ) {
- if (!$advanced_search_types or $advanced_search_types eq 'itemtypes') {
- $query .= " AND $itype_or_itemtype=$itemtypelimit";
- } else {
- $query .= " AND $advanced_search_types=$itemtypelimit";
- }
+ my $QParser;
+ $QParser = C4::Context->queryparser if (C4::Context->preference('UseQueryParser'));
+ my $op;
+ if ($QParser) {
+ $op = '&&';
+ } else {
+ $op = 'and';
+ }
+ if (!$advanced_search_types or $advanced_search_types eq 'itemtypes') {
+ $query .= " $op $itype_or_itemtype:$itemtypelimit";
+ } else {
+ $query .= " $op $advanced_search_types:$itemtypelimit";
+ }
}
$debug && warn $query;
$resultsperpage= $input->param('resultsperpage');
$resultsperpage = 20 if(!defined $resultsperpage);
my ($error, $marcrecords, $total_hits) = SimpleSearch($query, $startfrom*$resultsperpage, $resultsperpage);
- my $total = scalar @$marcrecords;
+ my $total = 0;
+ if (defined $marcrecords ) {
+ $total = scalar @{$marcrecords};
+ }
if (defined $error) {
$template->param(query_error => $error);
$resultsloop{author} = $biblio->{'author'};
$resultsloop{publishercode} = $biblio->{'publishercode'};
$resultsloop{publicationyear} = $biblio->{'publicationyear'};
+ $resultsloop{issn} = $biblio->{'issn'};
push @results, \%resultsloop;
}
- ($template, $loggedinuser, $cookie)
- = get_template_and_user({template_name => "serials/result.tmpl",
- query => $input,
- type => "intranet",
- authnotrequired => 0,
- flagsrequired => {serials => 1},
- flagsrequired => {catalogue => 1},
- debug => 1,
- });
-
# multi page display gestion
my $displaynext=0;
my $displayprev=$startfrom;
numbers=>\@numbers,
);
} # end of if ($op eq "do_search" & $query)
- else {
+else {
+ ($template, $loggedinuser, $cookie)
+ = get_template_and_user({template_name => "serials/subscription-bib-search.tmpl",
+ query => $input,
+ type => "intranet",
+ authnotrequired => 0,
+ flagsrequired => {catalogue => 1, serials => '*'},
+ debug => 1,
+ });
+ # load the itemtypes
+ my $itemtypes = GetItemTypes;
my @itemtypesloop;
if (!$advanced_search_types or $advanced_search_types eq 'itemtypes') {
# load the itemtypes
}
}
- ($template, $loggedinuser, $cookie)
- = get_template_and_user({template_name => "serials/subscription-bib-search.tmpl",
- query => $input,
- type => "intranet",
- authnotrequired => 0,
- flagsrequired => {catalogue => 1, serials=>1},
- debug => 1,
- });
-
if ($op eq "do_search") {
$template->param("no_query" => 1);