X-Git-Url: http://koha-dev.rot13.org:8081/gitweb/?a=blobdiff_plain;f=serials%2Fsubscription-bib-search.pl;h=623efe28f9bcd02eedd6874d65f0857792f90a4b;hb=d8e702dd25dfb09f99620ea9f5d3251033d16864;hp=f247f909273da615389a7a476469f542f2127c62;hpb=f36c042b80f053b7f75dfc1aff12a312e5a59134;p=koha_gimpoz diff --git a/serials/subscription-bib-search.pl b/serials/subscription-bib-search.pl index f247f90927..623efe28f9 100755 --- a/serials/subscription-bib-search.pl +++ b/serials/subscription-bib-search.pl @@ -2,6 +2,7 @@ # WARNING: 4-character tab stops here # Copyright 2000-2002 Katipo Communications +# Parts Copyright 2010 Biblibre # # This file is part of Koha. # @@ -14,9 +15,9 @@ # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR # A PARTICULAR PURPOSE. See the GNU General Public License for more details. # -# You should have received a copy of the GNU General Public License along with -# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place, -# Suite 330, Boston, MA 02111-1307 USA +# You should have received a copy of the GNU General Public License along +# with Koha; if not, write to the Free Software Foundation, Inc., +# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. =head1 NAME @@ -76,6 +77,16 @@ my $query = $input->param('q'); # 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 ) { @@ -90,7 +101,10 @@ if ($op eq "do_search" && $query) { $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); @@ -113,20 +127,11 @@ if ($op eq "do_search" && $query) { $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; @@ -178,7 +183,17 @@ if ($op eq "do_search" && $query) { 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 @@ -214,15 +229,6 @@ if ($op eq "do_search" && $query) { } } - ($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);