← Index
NYTProf Performance Profile   « block view • line view • sub view »
For /usr/share/koha/opac/cgi-bin/opac/opac-search.pl
  Run on Tue Oct 15 17:10:45 2013
Reported on Tue Oct 15 17:11:21 2013

Filename/usr/share/koha/opac/cgi-bin/opac/opac-search.pl
StatementsExecuted 728 statements in 23.2ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
153631111.72s1.72sDBI::st::::execute DBI::st::execute (xsub)
1425221.36s1.36sDBI::db::::ping DBI::db::ping (xsub)
16111168ms182msDBI::db::::selectrow_array DBI::db::selectrow_array (xsub)
501169.0ms69.0msCompress::Raw::Zlib::inflateStream::::inflateCompress::Raw::Zlib::inflateStream::inflate (xsub)
166917646.5ms78.2msDBI::st::::fetchrow_hashref DBI::st::fetchrow_hashref (xsub)
251143.7ms43.7msXML::LibXSLT::Stylesheet::::transform XML::LibXSLT::Stylesheet::transform (xsub)
53241.6ms41.6msDBI::db::::do DBI::db::do (xsub)
1472331120.0ms139msDBI::db::::prepare DBI::db::prepare (xsub)
2944451218.2ms18.2msDBI::common::::DESTROY DBI::common::DESTROY (xsub)
167521816.6ms16.6msDBI::common::::FETCH DBI::common::FETCH (xsub)
13667415.2ms15.2msDBI::st::::fetchrow_array DBI::st::fetchrow_array (xsub)
166917615.2ms15.2msDBI::st::::fetch DBI::st::fetch (xsub)
11113.4ms942msmain::::BEGIN@46 main::BEGIN@46
11112.3ms62.3msmain::::BEGIN@48 main::BEGIN@48
1116.79ms9.46msmain::::BEGIN@51 main::BEGIN@51
1115.36ms221msmain::::BEGIN@31 main::BEGIN@31
147245124.69ms4.69msDBD::_mem::common::::DESTROY DBD::_mem::common::DESTROY (xsub)
521553.36ms3.36msDBI::st::::fetchrow DBI::st::fetchrow (xsub)
1112.19ms79.7msmain::::BEGIN@45 main::BEGIN@45
25111.55ms1.55msXML::LibXSLT::Stylesheet::::_output_string XML::LibXSLT::Stylesheet::_output_string (xsub)
12721.28ms1.28msDBI::common::::STORE DBI::common::STORE (xsub)
111975µs5.63msmain::::BEGIN@54 main::BEGIN@54
13243923µs923µsDBI::st::::finish DBI::st::finish (xsub)
111902µs1.60msmain::::BEGIN@53 main::BEGIN@53
2833664µs2.82msDBI::st::::fetchall_arrayref DBI::st::fetchall_arrayref (xsub)
5011615µs615µsCompress::Raw::Zlib::inflateStream::::DESTROYCompress::Raw::Zlib::inflateStream::DESTROY (xsub)
37522573µs573µsInternals::::SvREADONLY Internals::SvREADONLY (xsub)
111438µs6.56msmain::::BEGIN@25 main::BEGIN@25
111202µs202µsDBI::dr::::disconnect_all DBI::dr::disconnect_all (xsub)
731134µs134µsmain::::CORE:sort main::CORE:sort (opcode)
871109µs109µsmain::::CORE:match main::CORE:match (opcode)
11161µs1.42msDBI::db::::selectall_arrayref DBI::db::selectall_arrayref (xsub)
33145µs62µsC4::Templates::::interface C4::Templates::interface
305538µs38µsRegexp::::DESTROY Regexp::DESTROY (xsub)
11138µs9.73msDBI::dr::::connect DBI::dr::connect (xsub)
22134µs48µsC4::Templates::::theme C4::Templates::theme
11129µs102µsmain::::BEGIN@47 main::BEGIN@47
11126µs32µsmain::::_input_cgi_parse main::_input_cgi_parse
171126µs26µsInternals::::hv_clear_placeholders Internals::hv_clear_placeholders (xsub)
11123µs738µsmain::::BEGIN@49 main::BEGIN@49
33121µs31µsC4::Templates::::lang C4::Templates::lang
11121µs174µsmain::::BEGIN@52 main::BEGIN@52
22120µs32µsC4::Templates::::filename C4::Templates::filename
11118µs495µsmain::::BEGIN@50 main::BEGIN@50
11118µs155µsmain::::BEGIN@64 main::BEGIN@64
11116µs144µsmain::::BEGIN@58 main::BEGIN@58
11116µs38µsmain::::BEGIN@59 main::BEGIN@59
11115µs64µsmain::::BEGIN@57 main::BEGIN@57
22113µs19µsC4::Templates::::preferredtheme C4::Templates::preferredtheme
11113µs2.39msmain::::BEGIN@85 main::BEGIN@85
11113µs90µsmain::::BEGIN@56 main::BEGIN@56
11112µs12µsString::CRC32::::bootstrap String::CRC32::bootstrap (xsub)
11110µs10µsmain::::CORE:regcomp main::CORE:regcomp (opcode)
4119µs9µsB::SV::::FLAGS B::SV::FLAGS (xsub)
1118µs8µsDBI::db::::connected DBI::db::connected (xsub)
1116µs6µsDBI::Const::GetInfo::ODBC::::CORE:match DBI::Const::GetInfo::ODBC::CORE:match (opcode)
1116µs8µsC4::Templates::::activethemes C4::Templates::activethemes
1115µs8µsC4::Templates::::htdocs C4::Templates::htdocs
3315µs5µsmain::::CORE:subst main::CORE:subst (opcode)
1115µs5µsDBI::Const::GetInfo::ANSI::::CORE:match DBI::Const::GetInfo::ANSI::CORE:match (opcode)
0000s0smain::::RUNTIME main::RUNTIME
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
021764µsProfile data that couldn't be associated with a specific line:
# spent 364µs making 1 call to DBI::END # spent 155µs making 8 calls to Template::Document::AUTOLOAD, avg 19µs/call # spent 124µs making 1 call to Template::Provider::DESTROY # spent 50µs making 1 call to XML::LibXML::END # spent 17µs making 1 call to C4::Tags::INIT # spent 15µs making 1 call to Template::Context::DESTROY # spent 7µs making 1 call to CGI::DESTROY # spent 7µs making 1 call to C4::Auth::END # spent 6µs making 1 call to C4::Search::END # spent 4µs making 1 call to C4::Budgets::END # spent 4µs making 1 call to C4::Accounts::END # spent 4µs making 1 call to C4::Members::END # spent 4µs making 1 call to C4::Output::END # spent 3µs making 1 call to Template::Stash::XS::DESTROY
115.51ms#!/usr/bin/perl
2
3# Copyright 2008 Garry Collum and the Koha Development team
4# Copyright 2010 BibLibre
5# Copyright 2011 KohaAloha, NZ
6# Copyright 2012 Catalyst IT, NZ
7#
8# This file is part of Koha.
9#
10# Koha is free software; you can redistribute it and/or modify it under the
11# terms of the GNU General Public License as published by the Free Software
12# Foundation; either version 2 of the License, or (at your option) any later
13# version.
14#
15# Koha is distributed in the hope that it will be useful, but WITHOUT ANY
16# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
17# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
18#
19# You should have received a copy of the GNU General Public License along
20# with Koha; if not, write to the Free Software Foundation, Inc.,
21# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
22
23# Script to perform searching
24# Mostly copied from search.pl, see POD there
253213µs26.62ms
# spent 6.56ms (438µs+6.12) within main::BEGIN@25 which was called: # once (438µs+6.12ms) by main::RUNTIME at line 25
use Modern::Perl;
# spent 6.56ms making 1 call to main::BEGIN@25 # spent 62µs making 1 call to Modern::Perl::import
26
27## STEP 1. Load things that are used in both search page and
28# results page and decide which template to load, operations
29# to perform, etc.
30## load Koha modules
313239µs2222ms
# spent 221ms (5.36+215) within main::BEGIN@31 which was called: # once (5.36ms+215ms) by main::RUNTIME at line 31
use C4::Context;
# spent 221ms making 1 call to main::BEGIN@31 # spent 1.34ms making 1 call to C4::Context::import
32
3318µs12.36msmy $searchengine = C4::Context->preference("SearchEngine");
# spent 2.36ms making 1 call to C4::Context::preference
341146µsfor ( $searchengine ) {
35198µs175µs when ( /^Solr$/ ) {
# spent 75µs making 1 call to main::CORE:match
36 warn "We use Solr";
37 require 'opac/search.pl';
38 exit;
39 }
40119µs113µs when ( /^Zebra$/ ) {
# spent 13µs making 1 call to main::CORE:match
41
42 }
43}
44
453146µs279.9ms
# spent 79.7ms (2.19+77.5) within main::BEGIN@45 which was called: # once (2.19ms+77.5ms) by main::RUNTIME at line 45
use C4::Output;
# spent 79.7ms making 1 call to main::BEGIN@45 # spent 183µs making 1 call to Exporter::import
463220µs2943ms
# spent 942ms (13.4+929) within main::BEGIN@46 which was called: # once (13.4ms+929ms) by main::RUNTIME at line 46
use C4::Auth qw(:DEFAULT get_session ParseSearchHistoryCookie);
# spent 942ms making 1 call to main::BEGIN@46 # spent 491µs making 1 call to Exporter::import
47359µs2175µs
# spent 102µs (29+73) within main::BEGIN@47 which was called: # once (29µs+73µs) by main::RUNTIME at line 47
use C4::Languages qw(getAllLanguages);
# spent 102µs making 1 call to main::BEGIN@47 # spent 73µs making 1 call to Exporter::import
483246µs262.7ms
# spent 62.3ms (12.3+50.0) within main::BEGIN@48 which was called: # once (12.3ms+50.0ms) by main::RUNTIME at line 48
use C4::Search;
# spent 62.3ms making 1 call to main::BEGIN@48 # spent 339µs making 1 call to Exporter::import
49344µs21.45ms
# spent 738µs (23+715) within main::BEGIN@49 which was called: # once (23µs+715µs) by main::RUNTIME at line 49
use C4::Biblio; # GetBiblioData
# spent 738µs making 1 call to main::BEGIN@49 # spent 715µs making 1 call to Exporter::import
50345µs2973µs
# spent 495µs (18+478) within main::BEGIN@50 which was called: # once (18µs+478µs) by main::RUNTIME at line 50
use C4::Koha;
# spent 495µs making 1 call to main::BEGIN@50 # spent 478µs making 1 call to Exporter::import
513185µs29.59ms
# spent 9.46ms (6.79+2.68) within main::BEGIN@51 which was called: # once (6.79ms+2.68ms) by main::RUNTIME at line 51
use C4::Tags qw(get_tags);
# spent 9.46ms making 1 call to main::BEGIN@51 # spent 125µs making 1 call to Exporter::import
52340µs2327µs
# spent 174µs (21+153) within main::BEGIN@52 which was called: # once (21µs+153µs) by main::RUNTIME at line 52
use C4::Branch; # GetBranches
# spent 174µs making 1 call to main::BEGIN@52 # spent 153µs making 1 call to Exporter::import
533188µs21.60ms
# spent 1.60ms (902µs+695µs) within main::BEGIN@53 which was called: # once (902µs+695µs) by main::RUNTIME at line 53
use C4::SocialData;
# spent 1.60ms making 1 call to main::BEGIN@53 # spent 5µs making 1 call to UNIVERSAL::import
543197µs25.74ms
# spent 5.63ms (975µs+4.66) within main::BEGIN@54 which was called: # once (975µs+4.66ms) by main::RUNTIME at line 54
use C4::Ratings;
# spent 5.63ms making 1 call to main::BEGIN@54 # spent 110µs making 1 call to Exporter::import
55
56334µs2167µs
# spent 90µs (13+77) within main::BEGIN@56 which was called: # once (13µs+77µs) by main::RUNTIME at line 56
use POSIX qw(ceil floor strftime);
# spent 90µs making 1 call to main::BEGIN@56 # spent 77µs making 1 call to POSIX::import
57337µs2113µs
# spent 64µs (15+49) within main::BEGIN@57 which was called: # once (15µs+49µs) by main::RUNTIME at line 57
use URI::Escape;
# spent 64µs making 1 call to main::BEGIN@57 # spent 49µs making 1 call to Exporter::import
58340µs2272µs
# spent 144µs (16+128) within main::BEGIN@58 which was called: # once (16µs+128µs) by main::RUNTIME at line 58
use JSON qw/decode_json encode_json/;
# spent 144µs making 1 call to main::BEGIN@58 # spent 128µs making 1 call to JSON::import
59353µs261µs
# spent 38µs (16+23) within main::BEGIN@59 which was called: # once (16µs+23µs) by main::RUNTIME at line 59
use Business::ISBN;
# spent 38µs making 1 call to main::BEGIN@59 # spent 23µs making 1 call to Exporter::import
60
61110µs12.19msmy $DisplayMultiPlaceHold = C4::Context->preference("DisplayMultiPlaceHold");
# spent 2.19ms making 1 call to C4::Context::preference
62# create a new CGI object
63# FIXME: no_undef_params needs to be tested
643172µs2293µs
# spent 155µs (18+138) within main::BEGIN@64 which was called: # once (18µs+138µs) by main::RUNTIME at line 64
use CGI qw('-no_undef_params');
# spent 155µs making 1 call to main::BEGIN@64 # spent 138µs making 1 call to CGI::import
6518µs14.60msmy $cgi = new CGI;
# spent 4.60ms making 1 call to CGI::new
66
6713µs110µsmy $branch_group_limit = $cgi->param("branch_group_limit");
# spent 10µs making 1 call to CGI::param
681600nsif ( $branch_group_limit ) {
69 if ( $branch_group_limit =~ /^multibranchlimit-/ ) {
70 # For search groups we are going to convert this branch_group_limit CGI
71 # parameter into a multibranchlimit CGI parameter for the purposes of
72 # actually performing the query
73 $cgi->param(
74 -name => 'multibranchlimit',
75 -values => substr($branch_group_limit, 17)
76 );
77 } else {
78 $cgi->append(
79 -name => 'limit',
80 -values => [ $branch_group_limit ]
81 );
82 }
83}
84
85
# spent 2.39ms (13µs+2.37) within main::BEGIN@85 which was called: # once (13µs+2.37ms) by main::RUNTIME at line 90
BEGIN {
86110µs12.37ms if (C4::Context->preference('BakerTaylorEnabled')) {
# spent 2.37ms making 1 call to C4::Context::preference
87 require C4::External::BakerTaylor;
88 import C4::External::BakerTaylor qw(&image_url &link_url);
89 }
9018.71ms12.39ms}
# spent 2.39ms making 1 call to main::BEGIN@85
91
921800nsmy ($template,$borrowernumber,$cookie);
9316µs15.48msmy $lang = C4::Templates::getlanguage($cgi, 'opac');
# spent 5.48ms making 1 call to C4::Templates::getlanguage
94# decide which template to use
951300nsmy $template_name;
9612µsmy $template_type = 'basic';
9717µs131µsmy @params = $cgi->param("limit");
# spent 31µs making 1 call to CGI::param
98
99
10015µs115µsmy $format = $cgi->param("format") || '';
# spent 15µs making 1 call to CGI::param
101110µs12.20msmy $build_grouped_results = C4::Context->preference('OPACGroupResults');
# spent 2.20ms making 1 call to C4::Context::preference
102125µs242µsif ($format =~ /(rss|atom|opensearchdescription)/) {
# spent 38µs making 1 call to CGI::param # spent 3µs making 1 call to main::CORE:match
103 $template_name = 'opac-opensearch.tmpl';
104}
105elsif (@params && $build_grouped_results) {
106 $template_name = 'opac-results-grouped.tmpl';
107}
108elsif ((@params>=1) || ($cgi->param("q")) || ($cgi->param('multibranchlimit')) || ($cgi->param('limit-yr')) ) {
109 $template_name = 'opac-results.tmpl';
110}
111else {
112 $template_name = 'opac-advsearch.tmpl';
113 $template_type = 'advsearch';
114}
115# load the template
116190µs2319ms($template, $borrowernumber, $cookie) = get_template_and_user({
# spent 317ms making 1 call to C4::Auth::get_template_and_user # spent 2.29ms making 1 call to C4::Context::preference
117 template_name => $template_name,
118 query => $cgi,
119 type => "opac",
120 authnotrequired => ( C4::Context->preference("OpacPublic") ? 1 : 0 ),
121 }
122);
123116µs22.42msif ($template_name eq 'opac-results.tmpl') {
# spent 2.41ms making 1 call to C4::Context::preference # spent 12µs making 1 call to C4::Templates::param
124 $template->param('COinSinOPACResults' => C4::Context->preference('COinSinOPACResults'));
125}
126
127# get biblionumbers stored in the cart
1281900nsmy @cart_list;
129
13018µs1100µsif($cgi->cookie("bib_list")){
# spent 100µs making 1 call to CGI::cookie
131 my $cart_list = $cgi->cookie("bib_list");
132 @cart_list = split(/\//, $cart_list);
133}
134
13512µsif ($format eq 'rss2' or $format eq 'opensearchdescription' or $format eq 'atom') {
136 $template->param($format => 1);
137 $template->param(timestamp => strftime("%Y-%m-%dT%H:%M:%S-00:00", gmtime)) if ($format eq 'atom');
138 # FIXME - the timestamp is a hack - the biblio update timestamp should be used for each
139 # entry, but not sure if that's worth an extra database query for each bib
140}
141112µs318µsif (C4::Context->preference("marcflavour") eq "UNIMARC" ) {
# spent 10µs making 2 calls to C4::Context::preference, avg 5µs/call # spent 8µs making 1 call to C4::Templates::param
142 $template->param('UNIMARC' => 1);
143}
144elsif (C4::Context->preference("marcflavour") eq "MARC21" ) {
145 $template->param('usmarc' => 1);
146}
14719µs22.30ms$template->param( 'AllowOnShelfHolds' => C4::Context->preference('AllowOnShelfHolds') );
# spent 2.29ms making 1 call to C4::Context::preference # spent 12µs making 1 call to C4::Templates::param
14819µs22.16ms$template->param( 'OPACNoResultsFound' => C4::Context->preference('OPACNoResultsFound') );
# spent 2.14ms making 1 call to C4::Context::preference # spent 11µs making 1 call to C4::Templates::param
149
15019µs22.07ms$template->param(
# spent 2.05ms making 1 call to C4::Context::preference # spent 11µs making 1 call to C4::Templates::param
151 OpacStarRatings => C4::Context->preference("OpacStarRatings") );
152
15315µs17µsif (C4::Context->preference('BakerTaylorEnabled')) {
# spent 7µs making 1 call to C4::Context::preference
154 $template->param(
155 BakerTaylorEnabled => 1,
156 BakerTaylorImageURL => &image_url(),
157 BakerTaylorLinkURL => &link_url(),
158 BakerTaylorBookstoreURL => C4::Context->preference('BakerTaylorBookstoreURL'),
159 );
160}
161
16216µs17µsif (C4::Context->preference('TagsEnabled')) {
# spent 7µs making 1 call to C4::Context::preference
16318µs117µs $template->param(TagsEnabled => 1);
# spent 17µs making 1 call to C4::Templates::param
16415µs foreach (qw(TagsShowOnList TagsInputOnList)) {
165219µs34.39ms C4::Context->preference($_) and $template->param($_ => 1);
# spent 4.37ms making 2 calls to C4::Context::preference, avg 2.19ms/call # spent 11µs making 1 call to C4::Templates::param
166 }
167}
168
169## URI Re-Writing
170# Deprecated, but preserved because it's interesting :-)
171# The same thing can be accomplished with mod_rewrite in
172# a more elegant way
173#
174#my $rewrite_flag;
175#my $uri = $cgi->url(-base => 1);
176#my $relative_url = $cgi->url(-relative=>1);
177#$uri.="/".$relative_url."?";
178#warn "URI:$uri";
179#my @cgi_params_list = $cgi->param();
180#my $url_params = $cgi->Vars;
181#
182#for my $each_param_set (@cgi_params_list) {
183# $uri.= join "", map "\&$each_param_set=".$_, split("\0",$url_params->{$each_param_set}) if $url_params->{$each_param_set};
184#}
185#warn "New URI:$uri";
186# Only re-write a URI if there are params or if it already hasn't been re-written
187#unless (($cgi->param('r')) || (!$cgi->param()) ) {
188# print $cgi->redirect( -uri=>$uri."&r=1",
189# -cookie => $cookie);
190# exit;
191#}
192
193# load the branches
194
19519µs712.1msmy $branches = GetBranches(); # used later in *getRecords, probably should be internalized by those functions after caching in C4::Branch is established
# spent 12.1ms making 1 call to C4::Branch::GetBranches # spent 20µs making 4 calls to DBI::common::DESTROY, avg 5µs/call # spent 7µs making 2 calls to DBD::_mem::common::DESTROY, avg 3µs/call
196115µs52.00ms$template->param(
# spent 1.97ms making 1 call to C4::Branch::GetBranchCategories # spent 19µs making 1 call to C4::Templates::param # spent 9µs making 2 calls to DBI::common::DESTROY, avg 4µs/call # spent 2µs making 1 call to DBD::_mem::common::DESTROY
197 searchdomainloop => GetBranchCategories(undef,'searchdomain'),
198);
199
200# load the language limits (for search)
201110µs12.43msmy $languages_limit_loop = getAllLanguages($lang);
# spent 2.43ms making 1 call to Memoize::__ANON__[(eval 1015)[Memoize.pm:73]:1]
20218µs120µs$template->param(search_languages_loop => $languages_limit_loop,);
# spent 20µs making 1 call to C4::Templates::param
203
204# load the Type stuff
205113µs43.77msmy $itemtypes = GetItemTypes;
# spent 3.74ms making 1 call to C4::Koha::GetItemTypes # spent 20µs making 2 calls to DBI::common::DESTROY, avg 10µs/call # spent 6µs making 1 call to DBD::_mem::common::DESTROY
206# the index parameter is different for item-level itemtypes
207112µs119µsmy $itype_or_itemtype = (C4::Context->preference("item-level_itypes"))?'itype':'itemtype';
# spent 19µs making 1 call to C4::Context::preference
2081900nsmy @advancedsearchesloop;
2091700nsmy $cnt;
21016µs11.90msmy $advanced_search_types = C4::Context->preference("AdvancedSearchTypes") || "itemtypes";
# spent 1.90ms making 1 call to C4::Context::preference
21117µsmy @advanced_search_types = split(/\|/, $advanced_search_types);
212
21313µsforeach my $advanced_srch_type (@advanced_search_types) {
21437µs if ($advanced_srch_type eq 'itemtypes') {
215 # itemtype is a special case, since it's not defined in authorized values
2161600ns my @itypesloop;
2171108µs186µs foreach my $thisitemtype ( sort {$itemtypes->{$a}->{'description'} cmp $itemtypes->{$b}->{'description'} } keys %$itemtypes ) {
# spent 86µs making 1 call to main::CORE:sort
21823243µs232.13ms my %row =( number=>$cnt++,
# spent 2.13ms making 23 calls to C4::Koha::getitemtypeimagelocation, avg 93µs/call
219 ccl => "$itype_or_itemtype,phr",
220 code => $thisitemtype,
221 description => $itemtypes->{$thisitemtype}->{'description'},
222 imageurl=> getitemtypeimagelocation( 'opac', $itemtypes->{$thisitemtype}->{'imageurl'} ),
223 );
2242360µs push @itypesloop, \%row;
225 }
22614µs my %search_code = ( advanced_search_type => $advanced_srch_type,
227 code_loop => \@itypesloop );
22812µs push @advancedsearchesloop, \%search_code;
229 } else {
230 # covers all the other cases: non-itemtype authorized values
231211µs25.68ms my $advsearchtypes = GetAuthorisedValues($advanced_srch_type, '', 'opac');
# spent 5.68ms making 2 calls to Memoize::__ANON__[(eval 1015)[Memoize.pm:73]:1], avg 2.84ms/call
23221µs my @authvalueloop;
23325µs for my $thisitemtype (@$advsearchtypes) {
23426177µs26109µs my %row =(
# spent 109µs making 26 calls to C4::Koha::getitemtypeimagelocation, avg 4µs/call
235 number=>$cnt++,
236 ccl => $advanced_srch_type,
237 code => $thisitemtype->{authorised_value},
238 description => $thisitemtype->{'lib_opac'} || $thisitemtype->{'lib'},
239 imageurl => getitemtypeimagelocation( 'opac', $thisitemtype->{'imageurl'} ),
240 );
2412650µs push @authvalueloop, \%row;
242 }
24326µs my %search_code = ( advanced_search_type => $advanced_srch_type,
244 code_loop => \@authvalueloop );
24524µs push @advancedsearchesloop, \%search_code;
246 }
247}
248117µs125µs$template->param(advancedsearchesloop => \@advancedsearchesloop);
# spent 25µs making 1 call to C4::Templates::param
249
250# # load the itypes (Called item types in the template -- just authorized values for searching)
251# my ($itypecount,@itype_loop) = GetCcodes();
252# $template->param(itypeloop=>\@itype_loop,);
253
254# The following should only be loaded if we're bringing up the advanced search template
25512µsif ( $template_type && $template_type eq 'advsearch' ) {
256 # load the servers (used for searching -- to do federated searching, etc.)
257 my $primary_servers_loop;# = displayPrimaryServers();
258 $template->param(outer_servers_loop => $primary_servers_loop,);
259
260 my $secondary_servers_loop;
261 $template->param(outer_sup_servers_loop => $secondary_servers_loop,);
262
263 # set the default sorting
264 if ( C4::Context->preference('OPACdefaultSortField')
265 && C4::Context->preference('OPACdefaultSortOrder') ) {
266 my $default_sort_by =
267 C4::Context->preference('OPACdefaultSortField') . '_'
268 . C4::Context->preference('OPACdefaultSortOrder');
269 $template->param( sort_by => $default_sort_by );
270 }
271
272 # determine what to display next to the search boxes (ie, boolean option
273 # shouldn't appear on the first one, scan indexes should, adding a new
274 # box should only appear on the last, etc.
275 my @search_boxes_array;
276 my $search_boxes_count = 3; # begin whith 3 boxes
277 for (my $i=1;$i<=$search_boxes_count;$i++) {
278 # if it's the first one, don't display boolean option, but show scan indexes
279 if ($i==1) {
280 push @search_boxes_array,
281 {
282 scan_index => 1,
283 };
284
285 }
286 # if it's the last one, show the 'add field' box
287 elsif ($i==$search_boxes_count) {
288 push @search_boxes_array,
289 {
290 boolean => 1,
291 add_field => 1,
292 };
293 }
294 else {
295 push @search_boxes_array,
296 {
297 boolean => 1,
298 };
299 }
300
301 }
302 $template->param(uc( C4::Context->preference("marcflavour")) => 1, # we already did this for UNIMARC
303 advsearch => 1,
304 search_boxes_loop => \@search_boxes_array);
305
306 # use the global setting by default
307 if ( C4::Context->preference("expandedSearchOption") == 1 ) {
308 $template->param( expanded_options => C4::Context->preference("expandedSearchOption") );
309 }
310 # but let the user override it
311 if (defined $cgi->param('expanded_options')) {
312 if ( ($cgi->param('expanded_options') == 0) || ($cgi->param('expanded_options') == 1 ) ) {
313 $template->param( expanded_options => $cgi->param('expanded_options'));
314 }
315 }
316
317 if (C4::Context->preference('OPACNumbersPreferPhrase')) {
318 $template->param('numbersphr' => 1);
319 }
320
321 output_html_with_http_headers $cgi, $cookie, $template->output;
322 exit;
323}
324
325### OK, if we're this far, we're performing an actual search
326
327# Fetch the paramater list as a hash in scalar context:
328# * returns paramater list as tied hash ref
329# * we can edit the values by changing the key
330# * multivalued CGI paramaters are returned as a packaged string separated by "\0" (null)
331123µs1268µsmy $params = $cgi->Vars;
# spent 268µs making 1 call to CGI::AUTOLOAD
3321700nsmy $tag;
333114µs1158µs$tag = $params->{tag} if $params->{tag};
# spent 158µs making 1 call to CGI::AUTOLOAD
334
335
336# String with params with the search criteria for the paging in opac-detail
33711µsmy $pasarParams = '';
3381600nsmy $j = 0;
339128µs2225µsfor (keys %$params) {
# spent 225µs making 2 calls to CGI::AUTOLOAD, avg 113µs/call
34014µs117µs my @pasarParam = $cgi->param($_);
# spent 17µs making 1 call to CGI::param
34112µs for my $paramValue(@pasarParam) {
3421700ns $pasarParams .= '&amp;' if ($j > 0);
34311µs $pasarParams .= $_ . '=' . $paramValue;
34412µs $j++;
345 }
346}
347
348# Params that can have more than one value
349# sort by is used to sort the query
350# in theory can have more than one but generally there's just one
3511400nsmy @sort_by;
3521400nsmy $default_sort_by;
353122µs45.53msif ( C4::Context->preference('OPACdefaultSortField')
# spent 5.53ms making 4 calls to C4::Context::preference, avg 1.38ms/call
354 && C4::Context->preference('OPACdefaultSortOrder') ) {
355 $default_sort_by =
356 C4::Context->preference('OPACdefaultSortField') . '_'
357 . C4::Context->preference('OPACdefaultSortOrder');
358}
359
36016µsmy @allowed_sortby = qw /acqdate_asc acqdate_dsc author_az author_za call_number_asc call_number_dsc popularity_asc popularity_dsc pubdate_asc pubdate_dsc relevance title_az title_za/;
36116µs121µs@sort_by = $cgi->param('sort_by');
# spent 21µs making 1 call to CGI::param
36212µs$sort_by[0] = $default_sort_by if !$sort_by[0] && defined($default_sort_by);
36312µsforeach my $sort (@sort_by) {
36416µs if ( $sort ~~ @allowed_sortby ) {
365 $template->param($sort => 1);
366 }
367}
36817µs112µs$template->param('sort_by' => $sort_by[0]);
# spent 12µs making 1 call to C4::Templates::param
369
370# Use the servers defined, or just search our local catalog(default)
37113µs19µsmy @servers = $cgi->param('server');
# spent 9µs making 1 call to CGI::param
37211µsunless (@servers) {
373 #FIXME: this should be handled using Context.pm
374 @servers = ("biblioserver");
375 # @servers = C4::Context->config("biblioserver");
376}
377
378# operators include boolean and proximity operators and are used
379# to evaluate multiple operands
38012µs18µsmy @operators = $cgi->param('op');
# spent 8µs making 1 call to CGI::param
38112µs@operators = map { uri_unescape($_) } @operators;
382
383# indexes are query qualifiers, like 'title', 'author', etc. They
384# can be single or multiple parameters separated by comma: kw,right-Truncation
38515µs121µsmy @indexes = $cgi->param('idx');
# spent 21µs making 1 call to CGI::param
38612µs@indexes = map { uri_unescape($_) } @indexes;
387
388# if a simple index (only one) display the index used in the top search box
3891900nsif ($indexes[0] && !$indexes[1]) {
390 $template->param("ms_".$indexes[0] => 1);
391}
392# an operand can be a single term, a phrase, or a complete ccl query
39316µs124µsmy @operands = $cgi->param('q');
# spent 24µs making 1 call to CGI::param
394210µs118µs@operands = map { uri_unescape($_) } @operands;
# spent 18µs making 1 call to URI::Escape::uri_unescape
395
39615µs$template->{VARS}->{querystring} = join(' ', @operands);
397
398# if a simple search, display the value in the search box
39912µsif ($operands[0] && !$operands[1]) {
4001800ns my $ms_query = $operands[0];
401110µs11µs $ms_query =~ s/ #\S+//;
# spent 1µs making 1 call to main::CORE:subst
40213µs16µs $template->param(ms_value => $ms_query);
# spent 6µs making 1 call to C4::Templates::param
403}
404
405# limits are use to limit to results to a pre-defined category such as branch or language
40613µs141µsmy @limits = $cgi->param('limit');
# spent 41µs making 1 call to CGI::param
4071900ns@limits = map { uri_unescape($_) } @limits;
408
409112µs116µsif($params->{'multibranchlimit'}) {
# spent 16µs making 1 call to CGI::FETCH
410 my $multibranch = '('.join( " or ", map { "branch: $_ " } @{ GetBranchesInCategory( $params->{'multibranchlimit'} ) } ).')';
411 push @limits, $multibranch if ($multibranch ne '()');
412}
413
4141600nsmy $available;
41512µsforeach my $limit(@limits) {
416 if ($limit =~/available/) {
417 $available = 1;
418 }
419}
42013µs16µs$template->param(available => $available);
# spent 6µs making 1 call to C4::Templates::param
421
422# append year limits if they exist
423114µs112µsif ($params->{'limit-yr'}) {
# spent 12µs making 1 call to CGI::FETCH
424 if ($params->{'limit-yr'} =~ /\d{4}-\d{4}/) {
425 my ($yr1,$yr2) = split(/-/, $params->{'limit-yr'});
426 push @limits, "yr,st-numeric,ge=$yr1 and yr,st-numeric,le=$yr2";
427 }
428 elsif ($params->{'limit-yr'} =~ /\d{4}/) {
429 push @limits, "yr,st-numeric=$params->{'limit-yr'}";
430 }
431 else {
432 #FIXME: Should return a error to the user, incorect date format specified
433 }
434}
435
436# Params that can only have one value
43715µs113µsmy $scan = $params->{'scan'};
# spent 13µs making 1 call to CGI::FETCH
43816µs11.72msmy $count = C4::Context->preference('OPACnumSearchResults') || 20;
# spent 1.72ms making 1 call to C4::Context::preference
43916µs12.12msmy $countRSS = C4::Context->preference('numSearchRSSResults') || 50;
# spent 2.12ms making 1 call to C4::Context::preference
44019µs120µsmy $results_per_page = $params->{'count'} || $count;
# spent 20µs making 1 call to CGI::FETCH
44115µs112µsmy $offset = $params->{'offset'} || 0;
# spent 12µs making 1 call to CGI::FETCH
44213µs18µsmy $page = $cgi->param('page') || 1;
# spent 8µs making 1 call to CGI::param
4431600ns$offset = ($page-1)*$results_per_page if $page>1;
4441300nsmy $hits;
44515µs112µsmy $expanded_facet = $params->{'expand'};
# spent 12µs making 1 call to CGI::FETCH
446
447# Define some global variables
44811µsmy ($error,$query,$simple_query,$query_cgi,$query_desc,$limit,$limit_cgi,$limit_desc,$stopwords_removed,$query_type);
449
4501400nsmy @results;
451
452## I. BUILD THE QUERY
453114µs145.8ms( $error,$query,$simple_query,$query_cgi,$query_desc,$limit,$limit_cgi,$limit_desc,$stopwords_removed,$query_type) = buildQuery(\@operators,\@operands,\@indexes,\@limits,\@sort_by, 0, $lang);
# spent 45.8ms making 1 call to C4::Search::buildQuery
454
455
# spent 32µs (26+6) within main::_input_cgi_parse which was called: # once (26µs+6µs) by main::RUNTIME at line 466
sub _input_cgi_parse {
456932µs my @elements;
457 for my $this_cgi ( split('&',shift) ) {
458 next unless $this_cgi;
45926µs $this_cgi =~ /(.*?)=(.*)/;
# spent 6µs making 2 calls to main::CORE:match, avg 3µs/call
460 push @elements, { input_name => $1, input_value => $2 };
461 }
462 return @elements;
463}
464
465## parse the query_cgi string and put it into a form suitable for <input>s
46615µs132µsmy @query_inputs = _input_cgi_parse($query_cgi);
# spent 32µs making 1 call to main::_input_cgi_parse
46718µs122µs$template->param ( QUERY_INPUTS => \@query_inputs );
# spent 22µs making 1 call to C4::Templates::param
468
469## parse the limit_cgi string and put it into a form suitable for <input>s
47012µsmy @limit_inputs = $limit_cgi ? _input_cgi_parse($limit_cgi) : ();
471
472# add OPAC 'hidelostitems'
473#if (C4::Context->preference('hidelostitems') == 1) {
474# # either lost ge 0 or no value in the lost register
475# $query ="($query) and ( (lost,st-numeric <= 0) or ( allrecords,AlwaysMatches='' not lost,AlwaysMatches='') )";
476#}
477#
478# add OPAC suppression - requires at least one item indexed with Suppress
47918µs12.35msif (C4::Context->preference('OpacSuppression')) {
# spent 2.35ms making 1 call to C4::Context::preference
480 # OPAC suppression by IP address
48118µs11.97ms if (C4::Context->preference('OpacSuppressionByIPRange')) {
# spent 1.97ms making 1 call to C4::Context::preference
482 my $IPAddress = $ENV{'REMOTE_ADDR'};
483 my $IPRange = C4::Context->preference('OpacSuppressionByIPRange');
484 if ($IPAddress !~ /^$IPRange/) {
485 $query = "($query) not Suppress=1";
486 }
487 }
488 else {
48914µs $query = "($query) not Suppress=1";
490 }
491}
492
49316µs112µs$template->param ( LIMIT_INPUTS => \@limit_inputs );
# spent 12µs making 1 call to C4::Templates::param
494113µs22.01ms$template->param ( OPACResultsSidebar => C4::Context->preference('OPACResultsSidebar'));
# spent 1.99ms making 1 call to C4::Context::preference # spent 19µs making 1 call to C4::Templates::param
495
496## II. DO THE SEARCH AND GET THE RESULTS
49711µsmy $total = 0; # the total results for the whole set
4981500nsmy $facets; # this object stores the faceted results that display on the left-hand of the results page
4991500nsmy @results_array;
5001400nsmy $results_hashref;
5011800nsmy @coins;
502
50313µsif ($tag) {
504 $query_cgi = "tag=" .$tag . "&" . $query_cgi;
505 my $taglist = get_tags({term=>$tag, approved=>1});
506 $results_hashref->{biblioserver}->{hits} = scalar (@$taglist);
507 my @biblist = (map {GetBiblioData($_->{biblionumber})} @$taglist);
508 my @marclist = (map {$_->{marc}} @biblist );
509 $DEBUG and printf STDERR "taglist (%s biblionumber)\nmarclist (%s records)\n", scalar(@$taglist), scalar(@marclist);
510 $results_hashref->{biblioserver}->{RECORDS} = \@marclist;
511 # FIXME: tag search and standard search should work together, not exclusively
512 # FIXME: No facets for tags search.
513} elsif ($build_grouped_results) {
514 eval {
515 ($error, $results_hashref, $facets) = C4::Search::pazGetRecords($query,$simple_query,\@sort_by,\@servers,$results_per_page,$offset,$expanded_facet,$branches,$query_type,$scan);
516 };
517} else {
51815µs $pasarParams .= '&amp;query=' . $query;
51912µs $pasarParams .= '&amp;count=' . $results_per_page;
52012µs $pasarParams .= '&amp;simple_query=' . $simple_query;
5211900ns $pasarParams .= '&amp;query_type=' . $query_type if ($query_type);
52212µs eval {
523116µs1190ms ($error, $results_hashref, $facets) = getRecords($query,$simple_query,\@sort_by,\@servers,$results_per_page,$offset,$expanded_facet,$branches,$itemtypes,$query_type,$scan,1);
# spent 190ms making 1 call to C4::Search::getRecords
524 };
525}
526# This sorts the facets into alphabetical order
52712µsif ($facets) {
52812µs foreach my $f (@$facets) {
529568µs543µs $f->{facets} = [ sort { uc($a->{facet_title_value}) cmp uc($b->{facet_title_value}) } @{ $f->{facets} } ];
# spent 43µs making 5 calls to main::CORE:sort, avg 9µs/call
530 }
531110µs16µs @$facets = sort {$a->{expand} cmp $b->{expand}} @$facets;
# spent 6µs making 1 call to main::CORE:sort
532}
533
534# use Data::Dumper; print STDERR "-" x 25, "\n", Dumper($results_hashref);
5351900nsif ($@ || $error) {
536 $template->param(query_error => $error.$@);
537 output_html_with_http_headers $cgi, $cookie, $template->output;
538 exit;
539}
540
541# At this point, each server has given us a result set
542# now we build that set for template display
5431700nsmy @sup_results_array;
54414µsfor (my $i=0;$i<@servers;$i++) {
54512µs my $server = $servers[$i];
546113µs17µs if ($server && $server =~/biblioserver/) { # this is the local bibliographic server
# spent 7µs making 1 call to main::CORE:match
54712µs $hits = $results_hashref->{$server}->{"hits"};
54816µs122µs my $page = $cgi->param('page') || 0;
# spent 22µs making 1 call to CGI::param
5491600ns my @newresults;
55013µs if ($build_grouped_results) {
551 foreach my $group (@{ $results_hashref->{$server}->{"GROUPS"} }) {
552 # because pazGetRecords handles retieving only the records
553 # we want as specified by $offset and $results_per_page,
554 # we need to set the offset parameter of searchResults to 0
555 my @group_results = searchResults( 'opac', $query_desc, $group->{'group_count'},$results_per_page, 0, $scan,
556 $group->{"RECORDS"});
557 push @newresults, { group_label => $group->{'group_label'}, GROUP_RESULTS => \@group_results };
558 }
559 } else {
560116µs75.46s @newresults = searchResults('opac', $query_desc, $hits, $results_per_page, $offset, $scan,
# spent 5.46s making 1 call to C4::Search::searchResults # spent 48µs making 4 calls to DBI::common::DESTROY, avg 12µs/call # spent 12µs making 2 calls to DBD::_mem::common::DESTROY, avg 6µs/call
561 $results_hashref->{$server}->{"RECORDS"});
562 }
563
564 # must define a value for size if not present in DB
565 # in order to avoid problems generated by the default size value in TT
56615µs foreach my $line (@newresults) {
5672550µs if ( not exists $line->{'size'} ) { $line->{'size'} = "" }
568 # while we're checking each line, see if item is in the cart
5692531µs if ( grep {$_ eq $line->{'biblionumber'}} @cart_list) {
570 $line->{'incart'} = 1;
571 }
572 }
573
574
57511µs my $tag_quantity;
576114µs220µs if (C4::Context->preference('TagsEnabled') and
# spent 20µs making 2 calls to C4::Context::preference, avg 10µs/call
577 $tag_quantity = C4::Context->preference('TagsShowOnList')) {
57813µs foreach (@newresults) {
5792579µs my $bibnum = $_->{biblionumber} or next;
58025616µs10062.5ms $_->{itemsissued} = CountItemsIssued( $bibnum );
# spent 62.1ms making 25 calls to C4::Biblio::CountItemsIssued, avg 2.48ms/call # spent 330µs making 50 calls to DBI::common::DESTROY, avg 7µs/call # spent 104µs making 25 calls to DBD::_mem::common::DESTROY, avg 4µs/call
58125505µs10069.0ms $_ ->{'TagLoop'} = get_tags({biblionumber=>$bibnum, approved=>1, 'sort'=>'-weight',
# spent 68.7ms making 25 calls to C4::Tags::get_tags, avg 2.75ms/call # spent 259µs making 50 calls to DBI::common::DESTROY, avg 5µs/call # spent 60µs making 25 calls to DBD::_mem::common::DESTROY, avg 2µs/call
582 limit=>$tag_quantity });
583 }
584 }
585
58619µs113µs if (C4::Context->preference('COinSinOPACResults')) {
# spent 13µs making 1 call to C4::Context::preference
58713µs foreach (@newresults) {
58825212µs100564ms my $record = GetMarcBiblio($_->{'biblionumber'});
# spent 563ms making 25 calls to C4::Biblio::GetMarcBiblio, avg 22.5ms/call # spent 866µs making 50 calls to DBI::common::DESTROY, avg 17µs/call # spent 95µs making 25 calls to DBD::_mem::common::DESTROY, avg 4µs/call
58925251µs2535.3ms $_->{coins} = GetCOinSBiblio($record);
# spent 35.3ms making 25 calls to C4::Biblio::GetCOinSBiblio, avg 1.41ms/call
59025921µs252.06ms if ( C4::Context->preference( "Babeltheque" ) and $_->{normalized_isbn} ) {
# spent 2.06ms making 25 calls to C4::Context::preference, avg 83µs/call
591 my $isbn = Business::ISBN->new( $_->{normalized_isbn} );
592 next if not $isbn;
593 $isbn = $isbn->as_isbn13->as_string;
594 $isbn =~ s/-//g;
595 my $social_datas = C4::SocialData::get_data( $isbn );
596 next if not $social_datas;
597 for my $key ( keys %$social_datas ) {
598 $_->{$key} = $$social_datas{$key};
599 if ( $key eq 'score_avg' ){
600 $_->{score_int} = sprintf("%.0f", $$social_datas{score_avg} );
601 }
602 }
603 }
604 }
605 }
606
607
60814µs14µs if ( C4::Context->preference('OpacStarRatings') eq 'all' ) {
# spent 4µs making 1 call to C4::Context::preference
609 foreach my $res (@newresults) {
610 my $rating = GetRating( $res->{'biblionumber'}, $borrowernumber );
611 $res->{'rating_value'} = $rating->{'rating_value'};
612 $res->{'rating_total'} = $rating->{'rating_total'};
613 $res->{'rating_avg'} = $rating->{'rating_avg'};
614 $res->{'rating_avg_int'} = $rating->{'rating_avg_int'};
615 }
616 }
617
61815µs if ($results_hashref->{$server}->{"hits"}){
619 $total = $total + $results_hashref->{$server}->{"hits"};
620 }
621
622 # Opac search history
6231500ns my $newsearchcookie;
62413µs14µs if (C4::Context->preference('EnableOpacSearchHistory')) {
# spent 4µs making 1 call to C4::Context::preference
62517µs191µs my @recentSearches = ParseSearchHistoryCookie($cgi);
# spent 91µs making 1 call to C4::Auth::ParseSearchHistoryCookie
626
627 # Adding the new search if needed
628115µs1495µs my $path_info = $cgi->url(-path_info=>1);
# spent 495µs making 1 call to CGI::AUTOLOAD
62914µs1248µs my $query_cgi_history = $cgi->url(-query=>1);
# spent 248µs making 1 call to CGI::url
630122µs212µs $query_cgi_history =~ s/^$path_info\?//;
# spent 10µs making 1 call to main::CORE:regcomp # spent 2µs making 1 call to main::CORE:subst
63114µs11µs $query_cgi_history =~ s/;/&/g;
# spent 1µs making 1 call to main::CORE:subst
632133µs my $query_desc_history = "$query_desc, $limit_desc";
633
63413µs if (!$borrowernumber || $borrowernumber eq '') {
635 # To a cookie (the user is not logged in)
63611µs if (!$offset) {
637114µs293µs push @recentSearches, {
# spent 93µs making 2 calls to Encode::decode_utf8, avg 47µs/call
638 "query_desc" => Encode::decode_utf8($query_desc) || "unknown",
639 "query_cgi" => Encode::decode_utf8($query_cgi) || "unknown",
640 "time" => time(),
641 "total" => $total
642 };
64317µs113µs $template->param(ShowOpacRecentSearchLink => 1);
# spent 13µs making 1 call to C4::Templates::param
644 }
645
6461900ns shift @recentSearches if (@recentSearches > 15);
647 # Pushing the cookie back
648116µs3735µs $newsearchcookie = $cgi->cookie(
# spent 466µs making 1 call to JSON::PP::encode_json # spent 165µs making 1 call to CGI::cookie # spent 103µs making 1 call to URI::Escape::uri_escape
649 -name => 'KohaOpacRecentSearches',
650 # We uri_escape the whole serialized structure so we're sure we won't have any encoding problems
651 -value => uri_escape( encode_json(\@recentSearches) ),
652 -expires => ''
653 );
65411µs $cookie = [$cookie, $newsearchcookie];
655 }
656 else {
657 # To the session (the user is logged in)
658 if (!$offset) {
659 AddSearchHistory($borrowernumber, $cgi->cookie("CGISESSID"), $query_desc_history, $query_cgi_history, $total);
660 $template->param(ShowOpacRecentSearchLink => 1);
661 }
662 }
663 }
664 ## If there's just one result, redirect to the detail page
66511µs if ($total == 1 && $format ne 'rss2'
666 && $format ne 'opensearchdescription' && $format ne 'atom') {
667 my $biblionumber=$newresults[0]->{biblionumber};
668 if (C4::Context->preference('BiblioDefaultView') eq 'isbd') {
669 print $cgi->redirect("/cgi-bin/koha/opac-ISBDdetail.pl?biblionumber=$biblionumber");
670 } elsif (C4::Context->preference('BiblioDefaultView') eq 'marc') {
671 print $cgi->redirect("/cgi-bin/koha/opac-MARCdetail.pl?biblionumber=$biblionumber");
672 } else {
673 print $cgi->redirect("/cgi-bin/koha/opac-detail.pl?biblionumber=$biblionumber");
674 }
675 exit;
676 }
67712µs if ($hits) {
67811µs if ( !$build_grouped_results ) {
679 # We build the encrypted list of first OPACnumSearchResults biblios to pass with the search criteria for paging on opac-detail
68012µs $pasarParams .= '&amp;listBiblios=';
6811700ns my $j = 0;
68212µs foreach (@newresults) {
6832546µs my $bibnum = ($_->{biblionumber})?$_->{biblionumber}:0;
6842510µs $pasarParams .= $bibnum . ',';
685254µs $j++;
6862518µs last if ($j == $results_per_page);
687 }
688112µs15µs chop $pasarParams if ($pasarParams =~ /,$/);
# spent 5µs making 1 call to main::CORE:match
68917µs12µs $pasarParams .= '&amp;total=' . int($total) if ($pasarParams !~ /total=(?:[0-9]+)?/);
# spent 2µs making 1 call to main::CORE:match
690146µs34.70ms if ($pasarParams) {
# spent 3.58ms making 1 call to CGI::Session::DESTROY # spent 1.11ms making 1 call to CGI::Session::Driver::DBI::DESTROY # spent 7µs making 1 call to CGI::DESTROY
69118µs21.94ms my $session = get_session($cgi->cookie("CGISESSID"));
# spent 1.90ms making 1 call to C4::Auth::get_session # spent 40µs making 1 call to CGI::cookie
692111µs141µs $session->param('busc' => $pasarParams);
# spent 41µs making 1 call to CGI::Session::param
693 }
694 #
695 }
69617µs114µs $template->param(total => $hits);
# spent 14µs making 1 call to C4::Templates::param
6971900ns my $limit_cgi_not_availablity = $limit_cgi;
6981500ns $limit_cgi_not_availablity =~ s/&limit=available//g if defined $limit_cgi_not_availablity;
69912µs15µs $template->param(limit_cgi_not_availablity => $limit_cgi_not_availablity);
# spent 5µs making 1 call to C4::Templates::param
70012µs14µs $template->param(limit_cgi => $limit_cgi);
# spent 4µs making 1 call to C4::Templates::param
70112µs120µs $template->param(countrss => $countRSS );
# spent 20µs making 1 call to C4::Templates::param
70212µs17µs $template->param(query_cgi => $query_cgi);
# spent 7µs making 1 call to C4::Templates::param
70312µs15µs $template->param(query_desc => $query_desc);
# spent 5µs making 1 call to C4::Templates::param
70412µs15µs $template->param(limit_desc => $limit_desc);
# spent 5µs making 1 call to C4::Templates::param
70512µs15µs $template->param(offset => $offset);
# spent 5µs making 1 call to C4::Templates::param
70612µs15µs $template->param(DisplayMultiPlaceHold => $DisplayMultiPlaceHold);
# spent 5µs making 1 call to C4::Templates::param
70712µs14µs if ($query_desc || $limit_desc) {
# spent 4µs making 1 call to C4::Templates::param
708 $template->param(searchdesc => 1);
709 }
7101700ns $template->param(stopwords_removed => "@$stopwords_removed") if $stopwords_removed;
71112µs15µs $template->param(results_per_page => $results_per_page);
# spent 5µs making 1 call to C4::Templates::param
71216µs18µs my $hide = C4::Context->preference('OpacHiddenItems');
# spent 8µs making 1 call to C4::Context::preference
7131500ns $hide = ($hide =~ m/\S/) if $hide; # Just in case it has some spaces/new lines
7141900ns my $branch = '';
71515µs18µs if (C4::Context->userenv){
# spent 8µs making 1 call to C4::Context::userenv
716 $branch = C4::Context->userenv->{branch};
717 }
71812µs12.36ms if ( C4::Context->preference('HighlightOwnItemsOnOPAC') ) {
# spent 2.36ms making 1 call to C4::Context::preference
719 if (
720 ( ( C4::Context->preference('HighlightOwnItemsOnOPACWhich') eq 'PatronBranch' ) && $branch )
721 ||
722 C4::Context->preference('HighlightOwnItemsOnOPACWhich') eq 'OpacURLBranch'
723 ) {
724 my $branchname;
725 if ( C4::Context->preference('HighlightOwnItemsOnOPACWhich') eq 'PatronBranch' ) {
726 $branchname = $branches->{$branch}->{'branchname'};
727 }
728 elsif ( C4::Context->preference('HighlightOwnItemsOnOPACWhich') eq 'OpacURLBranch' ) {
729 $branchname = $branches->{ $ENV{'BRANCHCODE'} }->{'branchname'};
730 }
731
732 foreach my $res ( @newresults ) {
733 my @new_loop;
734 my @top_loop;
735 my @old_loop = @{$res->{'available_items_loop'}};
736 foreach my $item ( @old_loop ) {
737 if ( $item->{'branchname'} eq $branchname ) {
738 $item->{'this_branch'} = 1;
739 push( @top_loop, $item );
740 } else {
741 push( @new_loop, $item );
742 }
743 }
744 my @complete_loop = ( @top_loop, @new_loop );
745 $res->{'available_items_loop'} = \@complete_loop;
746 }
747 }
748 }
749
750 $template->param(
751113µs22.06ms SEARCH_RESULTS => \@newresults,
# spent 2.04ms making 1 call to C4::Context::preference # spent 21µs making 1 call to C4::Templates::param
752 OPACItemsResultsDisplay => (C4::Context->preference("OPACItemsResultsDisplay")),
753 suppress_result_number => $hide,
754 );
75515µs15µs if (C4::Context->preference("OPACLocalCoverImages")){
# spent 5µs making 1 call to C4::Context::preference
75613µs15µs $template->param(OPACLocalCoverImages => 1);
# spent 5µs making 1 call to C4::Templates::param
757110µs22.13ms $template->param(OPACLocalCoverImagesPriority => C4::Context->preference("OPACLocalCoverImagesPriority"));
# spent 2.12ms making 1 call to C4::Context::preference # spent 12µs making 1 call to C4::Templates::param
758 }
759 ## Build the page numbers on the bottom of the page
7601600ns my @page_numbers;
761 # total number of pages there will be
762145µs130µs my $pages = ceil($hits / $results_per_page);
# spent 30µs making 1 call to POSIX::ceil
763 # default page number
7641700ns my $current_page_number = 1;
7651700ns if ($offset) {
766 $current_page_number = ( $offset / $results_per_page + 1 );
767 }
7681400ns my $previous_page_offset;
76911µs if ( $offset >= $results_per_page ) {
770 $previous_page_offset = $offset - $results_per_page;
771 }
77211µs my $next_page_offset = $offset + $results_per_page;
773 # If we're within the first 10 pages, keep it simple
774 #warn "current page:".$current_page_number;
77512µs if ($current_page_number < 10) {
776 # just show the first 10 pages
777 # Loop through the pages
7781600ns my $pages_to_show = 10;
77912µs $pages_to_show = $pages if $pages<10;
780111µs for ($i=1; $i<=$pages_to_show;$i++) {
781 # the offset for this page
782107µs my $this_offset = (($i*$results_per_page)-$results_per_page);
783 # the page number for this page
784103µs my $this_page_number = $i;
785 # put it in the array
7861040µs push @page_numbers,
787 { offset => $this_offset,
788 pg => $this_page_number,
789 highlight => $this_page_number == $current_page_number,
790 sort_by => join ' ', @sort_by
791 };
792
7931600ns }
794
795 }
796 # now, show twenty pages, with the current one smack in the middle
797 else {
798 for ($i=$current_page_number; $i<=($current_page_number + 20 );$i++) {
799 my $this_offset = ((($i-9)*$results_per_page)-$results_per_page);
800 my $this_page_number = $i-9;
801 if ( $this_page_number <= $pages ) {
802 push @page_numbers,
803 { offset => $this_offset,
804 pg => $this_page_number,
805 highlight => $this_page_number == $current_page_number,
806 sort_by => join ' ', @sort_by
807 };
808 }
809 }
810
811 }
81216µs112µs $template->param( PAGE_NUMBERS => \@page_numbers,
# spent 12µs making 1 call to C4::Templates::param
813 previous_page_offset => $previous_page_offset) unless $pages < 2;
81416µs15µs $template->param(next_page_offset => $next_page_offset) unless $pages eq $current_page_number;
# spent 5µs making 1 call to C4::Templates::param
815 }
816 # no hits
817 else {
818 my $nohits = C4::Context->preference('OPACNoResultsFound');
819 if ($nohits and $nohits=~/{QUERY_KW}/){
820 # extracting keywords in case of relaunching search
821 (my $query_kw=$query_desc)=~s/ and|or / /g;
822 $query_kw = Encode::decode_utf8($query_kw);
823 my @query_kw=($query_kw=~ /([-\w]+\b)(?:[^,:]|$)/g);
824 $query_kw=join('+',@query_kw);
825 $nohits=~s/{QUERY_KW}/$query_kw/g;
826 $template->param('OPACNoResultsFound' =>$nohits);
827 }
828 $template->param(
829 searchdesc => 1,
830 query_desc => $query_desc,
831 limit_desc => $limit_desc,
832 query_cgi => $query_cgi,
833 limit_cgi => $limit_cgi
834 );
835 }
836 } # end of the if local
837 # asynchronously search the authority server
838 elsif ($server && $server =~/authorityserver/) { # this is the local authority server
839 my @inner_sup_results_array;
840 for my $sup_record ( @{$results_hashref->{$server}->{"RECORDS"}} ) {
841 my $marc_record_object = MARC::Record->new_from_usmarc($sup_record);
842 my $title_field = $marc_record_object->field(100);
843 push @inner_sup_results_array, {
844 'title' => $title_field->subfield('a'),
845 'link' => "&amp;idx=an&amp;q=".$marc_record_object->field('001')->as_string(),
846 };
847 }
848 my $servername = $server;
849 push @sup_results_array, { servername => $servername,
850 inner_sup_results_loop => \@inner_sup_results_array} if @inner_sup_results_array;
851 }
852 # FIXME: can add support for other targets as needed here
85313µs16µs $template->param( outer_sup_results_loop => \@sup_results_array);
# spent 6µs making 1 call to C4::Templates::param
8541600ns} #/end of the for loop
855#$template->param(FEDERATED_RESULTS => \@results_array);
856
85719µs22.05ms$template->param(
# spent 2.03ms making 1 call to C4::Context::preference # spent 27µs making 1 call to C4::Templates::param
858 #classlist => $classlist,
859 total => $total,
860 opacfacets => 1,
861 facets_loop => $facets,
862 displayFacetCount=> C4::Context->preference('displayFacetCount')||0,
863 scan => $scan,
864 search_error => $error,
865);
866
86713µs15µsif ($query_desc || $limit_desc) {
# spent 5µs making 1 call to C4::Templates::param
868 $template->param(searchdesc => 1);
869}
870
871# VI. BUILD THE TEMPLATE
872# Build drop-down list for 'Add To:' menu...
87317µs11.05msmy ($totalref, $pubshelves, $barshelves)=
# spent 1.05ms making 1 call to C4::VirtualShelves::GetSomeShelfNames
874 C4::VirtualShelves::GetSomeShelfNames($borrowernumber,'COMBO',1);
87516µs117µs$template->param(
# spent 17µs making 1 call to C4::Templates::param
876 addbarshelves => $totalref->{bartotal},
877 addbarshelvesloop => $barshelves,
878 addpubshelves => $totalref->{pubtotal},
879 addpubshelvesloop => $pubshelves,
880 );
881
88212µsmy $content_type = ($format eq 'rss' or $format eq 'atom') ? $format : 'html';
883
884# If GoogleIndicTransliteration system preference is On Set paramter to load Google's javascript in OPAC search screens
88514µs14.17msif (C4::Context->preference('GoogleIndicTransliteration')) {
# spent 4.17ms making 1 call to C4::Context::preference
886 $template->param('GoogleIndicTransliteration' => 1);
887}
888110µs11.91ms$template->{VARS}->{'BiblioItemtypeImage'} = C4::Context->preference('BiblioItemtypeImage');
# spent 1.91ms making 1 call to C4::Context::preference
889
89019µs11.99ms$template->{VARS}->{DidYouMean} =
# spent 1.99ms making 1 call to C4::Context::preference
891 ( defined C4::Context->preference('OPACdidyoumean')
892 && C4::Context->preference('OPACdidyoumean') =~ m/enable/ );
89316µs12.07ms$template->{VARS}->{IDreamBooksReviews} = C4::Context->preference('IDreamBooksReviews');
# spent 2.07ms making 1 call to C4::Context::preference
89417µs11.99ms$template->{VARS}->{IDreamBooksReadometer} = C4::Context->preference('IDreamBooksReadometer');
# spent 1.99ms making 1 call to C4::Context::preference
89517µs12.26ms$template->{VARS}->{IDreamBooksResults} = C4::Context->preference('IDreamBooksResults');
# spent 2.26ms making 1 call to C4::Context::preference
896
89717µs117µs $template->param( borrowernumber => $borrowernumber);
# spent 17µs making 1 call to C4::Templates::param
89811.63ms2862msoutput_with_http_headers $cgi, $cookie, $template->output, $content_type;
# spent 852ms making 1 call to C4::Templates::output # spent 10.1ms making 1 call to C4::Output::output_with_http_headers
 
# spent 9µs within B::SV::FLAGS which was called 4 times, avg 2µs/call: # 4 times (9µs+0s) by JSON::PP::value_to_json at line 432 of JSON/PP.pm, avg 2µs/call
sub B::SV::FLAGS; # xsub
# spent 615µs within Compress::Raw::Zlib::inflateStream::DESTROY which was called 50 times, avg 12µs/call: # 50 times (615µs+0s) by Compress::Zlib::memGunzip at line 698 of Cache/Memcached.pm, avg 12µs/call
sub Compress::Raw::Zlib::inflateStream::DESTROY; # xsub
# spent 69.0ms within Compress::Raw::Zlib::inflateStream::inflate which was called 50 times, avg 1.38ms/call: # 50 times (69.0ms+0s) by Compress::Zlib::memGunzip at line 551 of Compress/Zlib.pm, avg 1.38ms/call
sub Compress::Raw::Zlib::inflateStream::inflate; # xsub
# spent 4.69ms within DBD::_mem::common::DESTROY which was called 1472 times, avg 3µs/call: # 174 times (453µs+0s) by C4::Biblio::GetAuthorisedValueDesc at line 92 of /usr/share/koha/lib/C4/XSLT.pm, avg 3µs/call # 161 times (527µs+0s) by C4::Context::preference at line 559 of /usr/share/koha/lib/C4/Context.pm, avg 3µs/call # 96 times (335µs+0s) by C4::Items::GetItemsInfo at line 1246 of /usr/share/koha/lib/C4/Items.pm, avg 3µs/call # 75 times (380µs+0s) by C4::Items::GetItemsInfo at line 248 of /usr/share/koha/lib/C4/XSLT.pm, avg 5µs/call # 64 times (191µs+0s) by C4::Branch::GetBranchName at line 1580 of /usr/share/koha/lib/C4/Biblio.pm, avg 3µs/call # 57 times (268µs+0s) by C4::Koha::getitemtypeinfo at line 1585 of /usr/share/koha/lib/C4/Biblio.pm, avg 5µs/call # 51 times (169µs+0s) by C4::Koha::GetAuthValCode at line 1169 of /usr/share/koha/lib/C4/Koha.pm, avg 3µs/call # 50 times (210µs+0s) by C4::Branch::GetBranches at line 257 of /usr/share/koha/lib/C4/XSLT.pm, avg 4µs/call # 50 times (154µs+0s) by C4::Biblio::GetFrameworkCode or C4::Koha::GetKohaAuthorisedValues at line 255 of /usr/share/koha/lib/C4/XSLT.pm, avg 3µs/call # 50 times (154µs+0s) by C4::Biblio::GetFrameworkCode or C4::Koha::GetKohaAuthorisedValues at line 254 of /usr/share/koha/lib/C4/XSLT.pm, avg 3µs/call # 47 times (125µs+0s) by C4::Koha::GetAuthValCode or C4::Koha::GetKohaAuthorisedValueLib at line 1292 of /usr/share/koha/lib/C4/Items.pm, avg 3µs/call # 32 times (111µs+0s) by C4::Koha::GetKohaAuthorisedValueLib at line 1282 of /usr/share/koha/lib/C4/Items.pm, avg 3µs/call # 32 times (106µs+0s) by C4::Koha::GetAuthValCode at line 1280 of /usr/share/koha/lib/C4/Items.pm, avg 3µs/call # 32 times (96µs+0s) by C4::Circulation::GetTransfers at line 265 of /usr/share/koha/lib/C4/XSLT.pm, avg 3µs/call # 32 times (90µs+0s) by C4::Circulation::GetTransfers at line 1925 of /usr/share/koha/lib/C4/Search.pm, avg 3µs/call # 32 times (84µs+0s) by C4::Koha::GetAuthValCode at line 1286 of /usr/share/koha/lib/C4/Items.pm, avg 3µs/call # 32 times (77µs+0s) by C4::Koha::GetKohaAuthorisedValueLib at line 1281 of /usr/share/koha/lib/C4/Items.pm, avg 2µs/call # 32 times (75µs+0s) by C4::Reserves::GetReserveStatus at line 761 of /usr/share/koha/lib/C4/Reserves.pm, avg 2µs/call # 32 times (71µs+0s) by C4::Reserves::GetReserveStatus at line 267 of /usr/share/koha/lib/C4/XSLT.pm, avg 2µs/call # 32 times (70µs+0s) by C4::Reserves::GetReserveStatus at line 1926 of /usr/share/koha/lib/C4/Search.pm, avg 2µs/call # 32 times (68µs+0s) by C4::Koha::GetKohaAuthorisedValueLib at line 1287 of /usr/share/koha/lib/C4/Items.pm, avg 2µs/call # 32 times (67µs+0s) by C4::Koha::GetKohaAuthorisedValueLib at line 1288 of /usr/share/koha/lib/C4/Items.pm, avg 2µs/call # 25 times (118µs+0s) by C4::Koha::GetItemTypes at line 258 of /usr/share/koha/lib/C4/XSLT.pm, avg 5µs/call # 25 times (104µs+0s) by C4::Biblio::CountItemsIssued at line 580, avg 4µs/call # 25 times (95µs+0s) by C4::Biblio::GetMarcBiblio at line 588, avg 4µs/call # 25 times (84µs+0s) by C4::Biblio::GetFrameworkCode at line 1702 of /usr/share/koha/lib/C4/Search.pm, avg 3µs/call # 25 times (80µs+0s) by C4::Biblio::GetFrameworkCode at line 77 of /usr/share/koha/lib/C4/XSLT.pm, avg 3µs/call # 25 times (67µs+0s) by C4::Biblio::GetRecordValue at line 1709 of /usr/share/koha/lib/C4/Search.pm, avg 3µs/call # 25 times (60µs+0s) by C4::Tags::get_tags at line 581, avg 2µs/call # 25 times (57µs+0s) by C4::Biblio::GetRecordValue at line 1708 of /usr/share/koha/lib/C4/Search.pm, avg 2µs/call # 25 times (54µs+0s) by C4::Biblio::GetRecordValue at line 1710 of /usr/share/koha/lib/C4/Search.pm, avg 2µs/call # 3 times (14µs+0s) by C4::XSLT::getAuthorisedValues4MARCSubfields at line 120 of /usr/share/koha/lib/C4/XSLT.pm, avg 5µs/call # 2 times (18µs+0s) by C4::Branch::GetBranches at line 161 of /usr/share/koha/lib/C4/Branch.pm, avg 9µs/call # 2 times (12µs+0s) by C4::Search::searchResults at line 560, avg 6µs/call # 2 times (7µs+0s) by C4::Branch::GetBranches at line 195, avg 3µs/call # 2 times (6µs+0s) by C4::Koha::GetAuthorisedValues at line 247 of Memoize.pm, avg 3µs/call # once (6µs+0s) by C4::Koha::GetItemTypes at line 205 # once (5µs+0s) by C4::Koha::GetKohaAuthorisedValues at line 1654 of /usr/share/koha/lib/C4/Search.pm # once (5µs+0s) by C4::Koha::GetAuthValCode at line 1657 of /usr/share/koha/lib/C4/Search.pm # once (3µs+0s) by C4::Context::_new_marcfromkohafield at line 1010 of /usr/share/koha/lib/C4/Context.pm # once (3µs+0s) by C4::Search::searchResults at line 1666 of /usr/share/koha/lib/C4/Search.pm # once (2µs+0s) by C4::Branch::GetBranchCategories at line 196 # once (2µs+0s) by C4::Branch::GetBranchCategories at line 381 of /usr/share/koha/lib/C4/Auth.pm # once (2µs+0s) by DBD::_::db::selectall_arrayref at line 197 of /usr/share/koha/lib/C4/VirtualShelves.pm # once (2µs+0s) by C4::Branch::GetBranchesCount at line 786 of /usr/share/koha/lib/C4/Koha.pm
sub DBD::_mem::common::DESTROY; # xsub
# spent 5µs within DBI::Const::GetInfo::ANSI::CORE:match which was called: # once (5µs+0s) by DBI::Const::GetInfoType::BEGIN@45 at line 41 of DBI/Const/GetInfo/ANSI.pm
sub DBI::Const::GetInfo::ANSI::CORE:match; # opcode
# spent 6µs within DBI::Const::GetInfo::ODBC::CORE:match which was called: # once (6µs+0s) by DBI::Const::GetInfoType::BEGIN@46 at line 38 of DBI/Const/GetInfo/ODBC.pm
sub DBI::Const::GetInfo::ODBC::CORE:match; # opcode
# spent 18.2ms within DBI::common::DESTROY which was called 2944 times, avg 6µs/call: # 348 times (1.84ms+0s) by C4::Biblio::GetAuthorisedValueDesc at line 92 of /usr/share/koha/lib/C4/XSLT.pm, avg 5µs/call # 322 times (1.97ms+0s) by C4::Context::preference at line 559 of /usr/share/koha/lib/C4/Context.pm, avg 6µs/call # 192 times (1.33ms+0s) by C4::Items::GetItemsInfo at line 1246 of /usr/share/koha/lib/C4/Items.pm, avg 7µs/call # 150 times (1.36ms+0s) by C4::Items::GetItemsInfo at line 248 of /usr/share/koha/lib/C4/XSLT.pm, avg 9µs/call # 128 times (739µs+0s) by C4::Branch::GetBranchName at line 1580 of /usr/share/koha/lib/C4/Biblio.pm, avg 6µs/call # 114 times (971µs+0s) by C4::Koha::getitemtypeinfo at line 1585 of /usr/share/koha/lib/C4/Biblio.pm, avg 9µs/call # 102 times (693µs+0s) by C4::Koha::GetAuthValCode at line 1169 of /usr/share/koha/lib/C4/Koha.pm, avg 7µs/call # 100 times (672µs+0s) by C4::Biblio::GetFrameworkCode or C4::Koha::GetKohaAuthorisedValues at line 255 of /usr/share/koha/lib/C4/XSLT.pm, avg 7µs/call # 100 times (661µs+0s) by C4::Branch::GetBranches at line 257 of /usr/share/koha/lib/C4/XSLT.pm, avg 7µs/call # 100 times (528µs+0s) by C4::Biblio::GetFrameworkCode or C4::Koha::GetKohaAuthorisedValues at line 254 of /usr/share/koha/lib/C4/XSLT.pm, avg 5µs/call # 94 times (550µs+0s) by C4::Koha::GetAuthValCode or C4::Koha::GetKohaAuthorisedValueLib at line 1292 of /usr/share/koha/lib/C4/Items.pm, avg 6µs/call # 64 times (418µs+0s) by C4::Koha::GetAuthValCode at line 1280 of /usr/share/koha/lib/C4/Items.pm, avg 7µs/call # 64 times (410µs+0s) by C4::Koha::GetAuthValCode at line 1286 of /usr/share/koha/lib/C4/Items.pm, avg 6µs/call # 64 times (377µs+0s) by C4::Reserves::GetReserveStatus at line 1926 of /usr/share/koha/lib/C4/Search.pm, avg 6µs/call # 64 times (320µs+0s) by C4::Circulation::GetTransfers at line 1925 of /usr/share/koha/lib/C4/Search.pm, avg 5µs/call # 64 times (308µs+0s) by C4::Koha::GetKohaAuthorisedValueLib at line 1281 of /usr/share/koha/lib/C4/Items.pm, avg 5µs/call # 64 times (305µs+0s) by C4::Circulation::GetTransfers at line 265 of /usr/share/koha/lib/C4/XSLT.pm, avg 5µs/call # 64 times (289µs+0s) by C4::Reserves::GetReserveStatus at line 267 of /usr/share/koha/lib/C4/XSLT.pm, avg 5µs/call # 64 times (279µs+0s) by C4::Koha::GetKohaAuthorisedValueLib at line 1287 of /usr/share/koha/lib/C4/Items.pm, avg 4µs/call # 64 times (278µs+0s) by C4::Koha::GetKohaAuthorisedValueLib at line 1288 of /usr/share/koha/lib/C4/Items.pm, avg 4µs/call # 64 times (277µs+0s) by C4::Reserves::GetReserveStatus at line 761 of /usr/share/koha/lib/C4/Reserves.pm, avg 4µs/call # 64 times (275µs+0s) by C4::Koha::GetKohaAuthorisedValueLib at line 1282 of /usr/share/koha/lib/C4/Items.pm, avg 4µs/call # 50 times (866µs+0s) by C4::Biblio::GetMarcBiblio at line 588, avg 17µs/call # 50 times (330µs+0s) by C4::Biblio::CountItemsIssued at line 580, avg 7µs/call # 50 times (330µs+0s) by C4::Biblio::GetFrameworkCode at line 1702 of /usr/share/koha/lib/C4/Search.pm, avg 7µs/call # 50 times (319µs+0s) by C4::Biblio::GetFrameworkCode at line 77 of /usr/share/koha/lib/C4/XSLT.pm, avg 6µs/call # 50 times (274µs+0s) by C4::Biblio::GetRecordValue at line 1709 of /usr/share/koha/lib/C4/Search.pm, avg 5µs/call # 50 times (259µs+0s) by C4::Tags::get_tags at line 581, avg 5µs/call # 50 times (251µs+0s) by C4::Koha::GetItemTypes at line 258 of /usr/share/koha/lib/C4/XSLT.pm, avg 5µs/call # 50 times (248µs+0s) by C4::Biblio::GetRecordValue at line 1708 of /usr/share/koha/lib/C4/Search.pm, avg 5µs/call # 50 times (215µs+0s) by C4::Biblio::GetRecordValue at line 1710 of /usr/share/koha/lib/C4/Search.pm, avg 4µs/call # 6 times (44µs+0s) by C4::XSLT::getAuthorisedValues4MARCSubfields at line 120 of /usr/share/koha/lib/C4/XSLT.pm, avg 7µs/call # 4 times (52µs+0s) by C4::Koha::GetAuthorisedValues at line 247 of Memoize.pm, avg 13µs/call # 4 times (48µs+0s) by C4::Search::searchResults at line 560, avg 12µs/call # 4 times (20µs+0s) by C4::Branch::GetBranches at line 161 of /usr/share/koha/lib/C4/Branch.pm, avg 5µs/call # 4 times (20µs+0s) by C4::Branch::GetBranches at line 195, avg 5µs/call # 2 times (29µs+0s) by C4::Koha::GetAuthValCode at line 1657 of /usr/share/koha/lib/C4/Search.pm, avg 14µs/call # 2 times (20µs+0s) by C4::Koha::GetItemTypes at line 205, avg 10µs/call # 2 times (10µs+0s) by C4::Branch::GetBranchesCount at line 786 of /usr/share/koha/lib/C4/Koha.pm, avg 5µs/call # 2 times (10µs+0s) by C4::Koha::GetKohaAuthorisedValues at line 1654 of /usr/share/koha/lib/C4/Search.pm, avg 5µs/call # 2 times (9µs+0s) by C4::Search::searchResults at line 1666 of /usr/share/koha/lib/C4/Search.pm, avg 5µs/call # 2 times (9µs+0s) by C4::Branch::GetBranchCategories at line 381 of /usr/share/koha/lib/C4/Auth.pm, avg 5µs/call # 2 times (9µs+0s) by C4::Branch::GetBranchCategories at line 196, avg 4µs/call # 2 times (7µs+0s) by C4::Context::_new_marcfromkohafield at line 1010 of /usr/share/koha/lib/C4/Context.pm, avg 3µs/call # 2 times (6µs+0s) by DBD::_::db::selectall_arrayref at line 197 of /usr/share/koha/lib/C4/VirtualShelves.pm, avg 3µs/call
sub DBI::common::DESTROY; # xsub
# spent 16.6ms within DBI::common::FETCH which was called 1675 times, avg 10µs/call: # 624 times (3.35ms+0s) by DBI::st::fetchrow_hashref at line 255 of /usr/share/koha/lib/C4/Koha.pm, avg 5µs/call # 297 times (2.65ms+0s) by DBI::st::fetchrow_hashref at line 124 of /usr/share/koha/lib/C4/Branch.pm, avg 9µs/call # 174 times (2.05ms+0s) by DBI::st::fetchrow_hashref at line 1596 of /usr/share/koha/lib/C4/Biblio.pm, avg 12µs/call # 143 times (1.58ms+0s) by DBI::st::fetchrow_hashref at line 1248 of /usr/share/koha/lib/C4/Koha.pm, avg 11µs/call # 75 times (1.02ms+0s) by DBI::st::fetchrow_hashref at line 683 of /usr/share/koha/lib/C4/Biblio.pm, avg 14µs/call # 57 times (1.25ms+0s) by DBI::st::fetchrow_hashref at line 1246 of /usr/share/koha/lib/C4/Items.pm, avg 22µs/call # 57 times (841µs+0s) by DBI::st::fetchrow_hashref at line 443 of /usr/share/koha/lib/C4/Koha.pm, avg 15µs/call # 32 times (1.38ms+0s) by DBI::st::fetchrow_hashref at line 1316 of /usr/share/koha/lib/C4/Items.pm, avg 43µs/call # 32 times (576µs+0s) by DBI::st::fetchrow_hashref at line 1274 of /usr/share/koha/lib/C4/Items.pm, avg 18µs/call # 32 times (509µs+0s) by DBI::st::fetchrow_hashref at line 1249 of /usr/share/koha/lib/C4/Items.pm, avg 16µs/call # 32 times (345µs+0s) by DBI::st::fetchrow_hashref at line 2039 of DBI.pm, avg 11µs/call # 28 times (105µs+0s) by DBI::st::fetchrow_hashref at line 1072 of /usr/share/koha/lib/C4/Koha.pm, avg 4µs/call # 25 times (316µs+0s) by DBI::st::fetchrow_hashref at line 1257 of /usr/share/koha/lib/C4/Biblio.pm, avg 13µs/call # 25 times (315µs+0s) by DBI::st::fetchrow_hashref at line 2627 of /usr/share/koha/lib/C4/Biblio.pm, avg 13µs/call # 24 times (127µs+0s) by DBI::st::fetchrow_hashref at line 1667 of /usr/share/koha/lib/C4/Search.pm, avg 5µs/call # 11 times (75µs+0s) by DBI::st::fetchrow_hashref at line 1648 of /usr/share/koha/lib/C4/Search.pm, avg 7µs/call # 3 times (28µs+0s) by CGI::Session::Driver::DBI::DESTROY at line 141 of CGI/Session/Driver/DBI.pm, avg 9µs/call # once (18µs+0s) by C4::Context::_new_dbh at line 811 of /usr/share/koha/lib/C4/Context.pm # once (9µs+0s) by DBI::st::fetchrow_hashref at line 606 of /usr/share/koha/lib/C4/Branch.pm # once (6µs+0s) by C4::Context::_new_dbh at line 812 of /usr/share/koha/lib/C4/Context.pm # once (6µs+0s) by DBI::__ANON__[/usr/lib/perl5/DBI.pm:728] at line 717 of DBI.pm
sub DBI::common::FETCH; # xsub
# spent 1.28ms within DBI::common::STORE which was called 12 times, avg 107µs/call: # 3 times (1.23ms+0s) by DBI::__ANON__[/usr/lib/perl5/DBI.pm:728] at line 714 of DBI.pm, avg 410µs/call # 2 times (10µs+0s) by C4::Context::_new_dbh at line 810 of /usr/share/koha/lib/C4/Context.pm, avg 5µs/call # 2 times (9µs+0s) by C4::Context::_new_dbh at line 811 of /usr/share/koha/lib/C4/Context.pm, avg 4µs/call # 2 times (8µs+0s) by C4::Context::_new_dbh at line 812 of /usr/share/koha/lib/C4/Context.pm, avg 4µs/call # once (12µs+0s) by DBI::__ANON__[/usr/lib/perl5/DBI.pm:728] at line 717 of DBI.pm # once (12µs+0s) by DBI::connect at line 732 of DBI.pm # once (2µs+0s) by C4::Context::_new_dbh at line 824 of /usr/share/koha/lib/C4/Context.pm
sub DBI::common::STORE; # xsub
# spent 8µs within DBI::db::connected which was called: # once (8µs+0s) by DBI::__ANON__[/usr/lib/perl5/DBI.pm:728] at line 723 of DBI.pm
sub DBI::db::connected; # xsub
# spent 41.6ms within DBI::db::do which was called 5 times, avg 8.32ms/call: # 3 times (39.3ms+0s) by CGI::Session::Driver::mysql::store at line 50 of CGI/Session/Driver/mysql.pm, avg 13.1ms/call # once (1.32ms+0s) by C4::Context::_new_dbh at line 813 of /usr/share/koha/lib/C4/Context.pm # once (1.02ms+0s) by C4::Context::_new_dbh at line 825 of /usr/share/koha/lib/C4/Context.pm
sub DBI::db::do; # xsub
# spent 1.36s within DBI::db::ping which was called 1425 times, avg 955µs/call: # 1422 times (1.36s+0s) by C4::Context::dbh at line 856 of /usr/share/koha/lib/C4/Context.pm, avg 955µs/call # 3 times (2.97ms+0s) by CGI::Session::Driver::DBI::DESTROY at line 136 of CGI/Session/Driver/DBI.pm, avg 991µs/call
sub DBI::db::ping; # xsub
# spent 139ms (20.0+119) within DBI::db::prepare which was called 1472 times, avg 94µs/call: # 174 times (2.39ms+14.3ms) by C4::Biblio::GetAuthorisedValueDesc at line 1594 of /usr/share/koha/lib/C4/Biblio.pm, avg 96µs/call # 161 times (1.29ms+12.8ms) by DBI::db::selectrow_array at line 558 of /usr/share/koha/lib/C4/Context.pm, avg 88µs/call # 148 times (2.15ms+10.9ms) by C4::Koha::GetAuthValCode at line 1000 of /usr/share/koha/lib/C4/Koha.pm, avg 88µs/call # 143 times (2.10ms+10.3ms) by C4::Koha::GetKohaAuthorisedValueLib at line 1246 of /usr/share/koha/lib/C4/Koha.pm, avg 86µs/call # 100 times (1.76ms+8.66ms) by C4::Biblio::GetFrameworkCode at line 2085 of /usr/share/koha/lib/C4/Biblio.pm, avg 104µs/call # 75 times (1.03ms+6.18ms) by C4::Biblio::GetRecordValue at line 678 of /usr/share/koha/lib/C4/Biblio.pm, avg 96µs/call # 64 times (938µs+5.97ms) by C4::Circulation::GetTransfers at line 2785 of /usr/share/koha/lib/C4/Circulation.pm, avg 108µs/call # 64 times (913µs+5.41ms) by C4::Branch::GetBranchName at line 182 of /usr/share/koha/lib/C4/Branch.pm, avg 99µs/call # 64 times (1.06ms+5.20ms) by C4::Reserves::GetReserveStatus at line 754 of /usr/share/koha/lib/C4/Reserves.pm, avg 98µs/call # 57 times (956µs+5.23ms) by C4::Koha::getitemtypeinfo at line 441 of /usr/share/koha/lib/C4/Koha.pm, avg 108µs/call # 51 times (534µs+3.33ms) by C4::Koha::GetKohaAuthorisedValues at line 1171 of /usr/share/koha/lib/C4/Koha.pm, avg 76µs/call # 32 times (394µs+2.59ms) by C4::Reserves::GetReserveStatus at line 760 of /usr/share/koha/lib/C4/Reserves.pm, avg 93µs/call # 32 times (282µs+2.32ms) by C4::Items::GetItemsInfo at line 1298 of /usr/share/koha/lib/C4/Items.pm, avg 81µs/call # 32 times (313µs+2.29ms) by C4::Items::GetItemsInfo at line 1269 of /usr/share/koha/lib/C4/Items.pm, avg 81µs/call # 32 times (350µs+2.04ms) by C4::Items::GetItemsInfo at line 1309 of /usr/share/koha/lib/C4/Items.pm, avg 75µs/call # 27 times (445µs+2.16ms) by C4::Branch::GetBranches at line 117 of /usr/share/koha/lib/C4/Branch.pm, avg 96µs/call # 27 times (377µs+2.21ms) by C4::Branch::GetBranches at line 120 of /usr/share/koha/lib/C4/Branch.pm, avg 96µs/call # 26 times (353µs+2.60ms) by C4::Koha::GetItemTypes at line 253 of /usr/share/koha/lib/C4/Koha.pm, avg 114µs/call # 25 times (431µs+3.06ms) by C4::Items::GetItemsInfo at line 1240 of /usr/share/koha/lib/C4/Items.pm, avg 139µs/call # 25 times (387µs+2.35ms) by C4::Biblio::GetMarcBiblio at line 1255 of /usr/share/koha/lib/C4/Biblio.pm, avg 109µs/call # 25 times (340µs+2.14ms) by C4::Items::GetItemsInfo at line 1234 of /usr/share/koha/lib/C4/Items.pm, avg 99µs/call # 25 times (380µs+1.97ms) by C4::Tags::get_tags at line 283 of /usr/share/koha/lib/C4/Tags.pm, avg 94µs/call # 25 times (356µs+1.99ms) by C4::Biblio::CountItemsIssued at line 2625 of /usr/share/koha/lib/C4/Biblio.pm, avg 94µs/call # 25 times (247µs+1.62ms) by C4::Items::GetItemsInfo at line 1245 of /usr/share/koha/lib/C4/Items.pm, avg 75µs/call # 3 times (55µs+336µs) by C4::XSLT::getAuthorisedValues4MARCSubfields at line 122 of /usr/share/koha/lib/C4/XSLT.pm, avg 130µs/call # 2 times (28µs+171µs) by C4::Koha::GetAuthorisedValues at line 1069 of /usr/share/koha/lib/C4/Koha.pm, avg 99µs/call # 2 times (26µs+166µs) by C4::Branch::GetBranchCategories at line 365 of /usr/share/koha/lib/C4/Branch.pm, avg 96µs/call # once (20µs+114µs) by C4::Search::searchResults at line 1646 of /usr/share/koha/lib/C4/Search.pm # once (15µs+80µs) by C4::Search::searchResults at line 1662 of /usr/share/koha/lib/C4/Search.pm # once (12µs+78µs) by DBD::_::db::selectall_arrayref at line 1634 of DBI.pm # once (12µs+61µs) by C4::Branch::GetBranchesCount at line 604 of /usr/share/koha/lib/C4/Branch.pm # once (9µs+51µs) by C4::Search::searchResults at line 1677 of /usr/share/koha/lib/C4/Search.pm # once (10µs+42µs) by C4::Context::_new_marcfromkohafield at line 1022 of /usr/share/koha/lib/C4/Context.pm
sub DBI::db::prepare; # xsub
# spent 1.42ms (61µs+1.36) within DBI::db::selectall_arrayref which was called: # once (61µs+1.36ms) by C4::VirtualShelves::GetSomeShelfNames at line 197 of /usr/share/koha/lib/C4/VirtualShelves.pm
sub DBI::db::selectall_arrayref; # xsub
# spent 182ms (168+14.1) within DBI::db::selectrow_array which was called 161 times, avg 1.13ms/call: # 161 times (168ms+14.1ms) by C4::Context::preference at line 558 of /usr/share/koha/lib/C4/Context.pm, avg 1.13ms/call
sub DBI::db::selectrow_array; # xsub
# spent 9.73ms (38µs+9.69) within DBI::dr::connect which was called: # once (38µs+9.69ms) by DBI::__ANON__[/usr/lib/perl5/DBI.pm:728] at line 662 of DBI.pm
sub DBI::dr::connect; # xsub
# spent 202µs within DBI::dr::disconnect_all which was called: # once (202µs+0s) by DBI::disconnect_all at line 740 of DBI.pm
sub DBI::dr::disconnect_all; # xsub
# spent 1.72s within DBI::st::execute which was called 1536 times, avg 1.12ms/call: # 270 times (275ms+0s) by C4::Branch::GetBranches at line 125 of /usr/share/koha/lib/C4/Branch.pm, avg 1.02ms/call # 174 times (174ms+0s) by C4::Biblio::GetAuthorisedValueDesc at line 1595 of /usr/share/koha/lib/C4/Biblio.pm, avg 1000µs/call # 148 times (153ms+0s) by C4::Koha::GetAuthValCode at line 1001 of /usr/share/koha/lib/C4/Koha.pm, avg 1.04ms/call # 143 times (146ms+0s) by C4::Koha::GetKohaAuthorisedValueLib at line 1247 of /usr/share/koha/lib/C4/Koha.pm, avg 1.02ms/call # 100 times (109ms+0s) by C4::Biblio::GetFrameworkCode at line 2086 of /usr/share/koha/lib/C4/Biblio.pm, avg 1.09ms/call # 75 times (84.3ms+0s) by C4::Biblio::GetRecordValue at line 679 of /usr/share/koha/lib/C4/Biblio.pm, avg 1.12ms/call # 64 times (72.0ms+0s) by C4::Circulation::GetTransfers at line 2786 of /usr/share/koha/lib/C4/Circulation.pm, avg 1.12ms/call # 64 times (68.5ms+0s) by C4::Reserves::GetReserveStatus at line 755 of /usr/share/koha/lib/C4/Reserves.pm, avg 1.07ms/call # 64 times (63.1ms+0s) by C4::Branch::GetBranchName at line 183 of /usr/share/koha/lib/C4/Branch.pm, avg 986µs/call # 57 times (56.5ms+0s) by C4::Koha::getitemtypeinfo at line 442 of /usr/share/koha/lib/C4/Koha.pm, avg 990µs/call # 51 times (53.3ms+0s) by C4::Koha::GetKohaAuthorisedValues at line 1172 of /usr/share/koha/lib/C4/Koha.pm, avg 1.04ms/call # 32 times (56.5ms+0s) by C4::Items::GetItemsInfo at line 1314 of /usr/share/koha/lib/C4/Items.pm, avg 1.77ms/call # 32 times (44.4ms+0s) by C4::Items::GetItemsInfo at line 1248 of /usr/share/koha/lib/C4/Items.pm, avg 1.39ms/call # 32 times (36.4ms+0s) by C4::Reserves::GetReserveStatus at line 761 of /usr/share/koha/lib/C4/Reserves.pm, avg 1.14ms/call # 32 times (35.5ms+0s) by C4::Items::GetItemsInfo at line 1273 of /usr/share/koha/lib/C4/Items.pm, avg 1.11ms/call # 32 times (32.5ms+0s) by C4::Items::GetItemsInfo at line 1305 of /usr/share/koha/lib/C4/Items.pm, avg 1.02ms/call # 27 times (29.5ms+0s) by C4::Branch::GetBranches at line 118 of /usr/share/koha/lib/C4/Branch.pm, avg 1.09ms/call # 26 times (28.7ms+0s) by C4::Koha::GetItemTypes at line 254 of /usr/share/koha/lib/C4/Koha.pm, avg 1.10ms/call # 25 times (84.5ms+0s) by C4::Items::GetItemsInfo at line 1235 of /usr/share/koha/lib/C4/Items.pm, avg 3.38ms/call # 25 times (35.9ms+0s) by C4::Biblio::GetMarcBiblio at line 1256 of /usr/share/koha/lib/C4/Biblio.pm, avg 1.44ms/call # 25 times (32.9ms+0s) by C4::Tags::get_tags at line 284 of /usr/share/koha/lib/C4/Tags.pm, avg 1.32ms/call # 25 times (29.5ms+0s) by C4::Biblio::CountItemsIssued at line 2626 of /usr/share/koha/lib/C4/Biblio.pm, avg 1.18ms/call # 3 times (2.27ms+0s) by C4::XSLT::getAuthorisedValues4MARCSubfields at line 127 of /usr/share/koha/lib/C4/XSLT.pm, avg 756µs/call # 2 times (2.41ms+0s) by C4::Koha::GetAuthorisedValues at line 1071 of /usr/share/koha/lib/C4/Koha.pm, avg 1.21ms/call # 2 times (2.07ms+0s) by C4::Branch::GetBranchCategories at line 366 of /usr/share/koha/lib/C4/Branch.pm, avg 1.04ms/call # once (9.36ms+0s) by C4::Context::_new_marcfromkohafield at line 1023 of /usr/share/koha/lib/C4/Context.pm # once (3.75ms+0s) by C4::Search::searchResults at line 1678 of /usr/share/koha/lib/C4/Search.pm # once (976µs+0s) by DBD::_::db::selectall_arrayref at line 1636 of DBI.pm # once (925µs+0s) by C4::Search::searchResults at line 1647 of /usr/share/koha/lib/C4/Search.pm # once (892µs+0s) by C4::Branch::GetBranchesCount at line 605 of /usr/share/koha/lib/C4/Branch.pm # once (778µs+0s) by C4::Search::searchResults at line 1666 of /usr/share/koha/lib/C4/Search.pm
sub DBI::st::execute; # xsub
# spent 15.2ms within DBI::st::fetch which was called 1669 times, avg 9µs/call: # 624 times (3.94ms+0s) by DBI::st::fetchrow_hashref at line 255 of /usr/share/koha/lib/C4/Koha.pm, avg 6µs/call # 297 times (3.76ms+0s) by DBI::st::fetchrow_hashref at line 124 of /usr/share/koha/lib/C4/Branch.pm, avg 13µs/call # 174 times (1.60ms+0s) by DBI::st::fetchrow_hashref at line 1596 of /usr/share/koha/lib/C4/Biblio.pm, avg 9µs/call # 143 times (1.25ms+0s) by DBI::st::fetchrow_hashref at line 1248 of /usr/share/koha/lib/C4/Koha.pm, avg 9µs/call # 75 times (599µs+0s) by DBI::st::fetchrow_hashref at line 683 of /usr/share/koha/lib/C4/Biblio.pm, avg 8µs/call # 57 times (1.07ms+0s) by DBI::st::fetchrow_hashref at line 1246 of /usr/share/koha/lib/C4/Items.pm, avg 19µs/call # 57 times (738µs+0s) by DBI::st::fetchrow_hashref at line 443 of /usr/share/koha/lib/C4/Koha.pm, avg 13µs/call # 32 times (428µs+0s) by DBI::st::fetchrow_hashref at line 1274 of /usr/share/koha/lib/C4/Items.pm, avg 13µs/call # 32 times (358µs+0s) by DBI::st::fetchrow_hashref at line 1316 of /usr/share/koha/lib/C4/Items.pm, avg 11µs/call # 32 times (255µs+0s) by DBI::st::fetchrow_hashref at line 1249 of /usr/share/koha/lib/C4/Items.pm, avg 8µs/call # 32 times (252µs+0s) by DBI::st::fetchrow_hashref at line 2039 of DBI.pm, avg 8µs/call # 28 times (109µs+0s) by DBI::st::fetchrow_hashref at line 1072 of /usr/share/koha/lib/C4/Koha.pm, avg 4µs/call # 25 times (389µs+0s) by DBI::st::fetchrow_hashref at line 1257 of /usr/share/koha/lib/C4/Biblio.pm, avg 16µs/call # 25 times (203µs+0s) by DBI::st::fetchrow_hashref at line 2627 of /usr/share/koha/lib/C4/Biblio.pm, avg 8µs/call # 24 times (139µs+0s) by DBI::st::fetchrow_hashref at line 1667 of /usr/share/koha/lib/C4/Search.pm, avg 6µs/call # 11 times (75µs+0s) by DBI::st::fetchrow_hashref at line 1648 of /usr/share/koha/lib/C4/Search.pm, avg 7µs/call # once (6µs+0s) by DBI::st::fetchrow_hashref at line 606 of /usr/share/koha/lib/C4/Branch.pm
sub DBI::st::fetch; # xsub
# spent 2.82ms (664µs+2.15) within DBI::st::fetchall_arrayref which was called 28 times, avg 101µs/call: # 25 times (564µs+1.79ms) by C4::Tags::get_tags at line 289 of /usr/share/koha/lib/C4/Tags.pm, avg 94µs/call # 2 times (53µs+202µs) by C4::Branch::GetBranchCategories at line 368 of /usr/share/koha/lib/C4/Branch.pm, avg 127µs/call # once (47µs+166µs) by DBD::_::db::selectall_arrayref at line 1644 of DBI.pm
sub DBI::st::fetchall_arrayref; # xsub
# spent 3.36ms within DBI::st::fetchrow which was called 521 times, avg 6µs/call: # 304 times (1.04ms+0s) by C4::Context::_new_marcfromkohafield at line 1024 of /usr/share/koha/lib/C4/Context.pm, avg 3µs/call # 100 times (1.50ms+0s) by C4::Biblio::GetFrameworkCode at line 2087 of /usr/share/koha/lib/C4/Biblio.pm, avg 15µs/call # 44 times (207µs+0s) by C4::XSLT::getAuthorisedValues4MARCSubfields at line 129 of /usr/share/koha/lib/C4/XSLT.pm, avg 5µs/call # 41 times (175µs+0s) by C4::Search::searchResults at line 1680 of /usr/share/koha/lib/C4/Search.pm, avg 4µs/call # 32 times (436µs+0s) by C4::Items::GetItemsInfo at line 1306 of /usr/share/koha/lib/C4/Items.pm, avg 14µs/call
sub DBI::st::fetchrow; # xsub
# spent 15.2ms within DBI::st::fetchrow_array which was called 1366 times, avg 11µs/call: # 724 times (5.15ms+0s) by C4::Koha::GetKohaAuthorisedValues at line 1173 of /usr/share/koha/lib/C4/Koha.pm, avg 7µs/call # 270 times (3.84ms+0s) by C4::Branch::GetBranches at line 126 of /usr/share/koha/lib/C4/Branch.pm, avg 14µs/call # 148 times (2.65ms+0s) by C4::Koha::GetAuthValCode at line 1002 of /usr/share/koha/lib/C4/Koha.pm, avg 18µs/call # 64 times (1.14ms+0s) by C4::Circulation::GetTransfers at line 2787 of /usr/share/koha/lib/C4/Circulation.pm, avg 18µs/call # 64 times (1.11ms+0s) by C4::Branch::GetBranchName at line 184 of /usr/share/koha/lib/C4/Branch.pm, avg 17µs/call # 64 times (951µs+0s) by C4::Reserves::GetReserveStatus at line 756 of /usr/share/koha/lib/C4/Reserves.pm, avg 15µs/call # 32 times (403µs+0s) by C4::Reserves::GetReserveStatus at line 762 of /usr/share/koha/lib/C4/Reserves.pm, avg 13µs/call
sub DBI::st::fetchrow_array; # xsub
# spent 78.2ms (46.5+31.7) within DBI::st::fetchrow_hashref which was called 1669 times, avg 47µs/call: # 624 times (12.0ms+7.28ms) by C4::Koha::GetItemTypes at line 255 of /usr/share/koha/lib/C4/Koha.pm, avg 31µs/call # 297 times (11.6ms+6.41ms) by C4::Branch::GetBranches at line 124 of /usr/share/koha/lib/C4/Branch.pm, avg 61µs/call # 174 times (4.69ms+3.65ms) by C4::Biblio::GetAuthorisedValueDesc at line 1596 of /usr/share/koha/lib/C4/Biblio.pm, avg 48µs/call # 143 times (3.22ms+2.83ms) by C4::Koha::GetKohaAuthorisedValueLib at line 1248 of /usr/share/koha/lib/C4/Koha.pm, avg 42µs/call # 75 times (1.95ms+1.62ms) by C4::Biblio::GetRecordValue at line 683 of /usr/share/koha/lib/C4/Biblio.pm, avg 48µs/call # 57 times (4.05ms+2.32ms) by C4::Items::GetItemsInfo at line 1246 of /usr/share/koha/lib/C4/Items.pm, avg 112µs/call # 57 times (2.12ms+1.58ms) by C4::Koha::getitemtypeinfo at line 443 of /usr/share/koha/lib/C4/Koha.pm, avg 65µs/call # 32 times (1.12ms+1.74ms) by C4::Items::GetItemsInfo at line 1316 of /usr/share/koha/lib/C4/Items.pm, avg 90µs/call # 32 times (1.33ms+1.00ms) by C4::Items::GetItemsInfo at line 1274 of /usr/share/koha/lib/C4/Items.pm, avg 73µs/call # 32 times (767µs+764µs) by C4::Items::GetItemsInfo at line 1249 of /usr/share/koha/lib/C4/Items.pm, avg 48µs/call # 32 times (738µs+598µs) by DBD::_::st::fetchall_arrayref at line 2039 of DBI.pm, avg 42µs/call # 28 times (334µs+214µs) by C4::Koha::GetAuthorisedValues at line 1072 of /usr/share/koha/lib/C4/Koha.pm, avg 20µs/call # 25 times (798µs+705µs) by C4::Biblio::GetMarcBiblio at line 1257 of /usr/share/koha/lib/C4/Biblio.pm, avg 60µs/call # 25 times (904µs+518µs) by C4::Biblio::CountItemsIssued at line 2627 of /usr/share/koha/lib/C4/Biblio.pm, avg 57µs/call # 24 times (442µs+266µs) by C4::Search::searchResults at line 1667 of /usr/share/koha/lib/C4/Search.pm, avg 29µs/call # 11 times (367µs+150µs) by C4::Search::searchResults at line 1648 of /usr/share/koha/lib/C4/Search.pm, avg 47µs/call # once (25µs+15µs) by C4::Branch::GetBranchesCount at line 606 of /usr/share/koha/lib/C4/Branch.pm
sub DBI::st::fetchrow_hashref; # xsub
# spent 923µs within DBI::st::finish which was called 132 times, avg 7µs/call: # 64 times (535µs+0s) by C4::Branch::GetBranchName at line 185 of /usr/share/koha/lib/C4/Branch.pm, avg 8µs/call # 64 times (366µs+0s) by C4::Circulation::GetTransfers at line 2788 of /usr/share/koha/lib/C4/Circulation.pm, avg 6µs/call # 2 times (14µs+0s) by C4::Branch::GetBranchCategories at line 369 of /usr/share/koha/lib/C4/Branch.pm, avg 7µs/call # 2 times (8µs+0s) by C4::Koha::GetAuthorisedValues at line 1085 of /usr/share/koha/lib/C4/Koha.pm, avg 4µs/call
sub DBI::st::finish; # xsub
# spent 573µs within Internals::SvREADONLY which was called 375 times, avg 2µs/call: # 358 times (548µs+0s) by constant::import at line 111 of constant.pm, avg 2µs/call # 17 times (25µs+0s) by Hash::Util::lock_ref_keys at line 61 of Hash/Util.pm, avg 1µs/call
sub Internals::SvREADONLY; # xsub
# spent 26µs within Internals::hv_clear_placeholders which was called 17 times, avg 2µs/call: # 17 times (26µs+0s) by Hash::Util::lock_ref_keys at line 49 of Hash/Util.pm, avg 2µs/call
sub Internals::hv_clear_placeholders; # xsub
# spent 38µs within Regexp::DESTROY which was called 30 times, avg 1µs/call: # 16 times (11µs+0s) by C4::Languages::regex_lang_subtags at line 257 of /usr/share/koha/lib/C4/Templates.pm, avg 669ns/call # 8 times (18µs+0s) by Template::Parser::split_text at line 285 of Template/Parser.pm, avg 2µs/call # 4 times (4µs+0s) by Date::Manip::Base::_config_var_setdate at line 1420 of Date/Manip/Base.pm, avg 1µs/call # once (3µs+0s) by C4::Languages::regex_lang_subtags at line 440 of /usr/share/koha/lib/C4/Languages.pm # once (2µs+0s) by Date::Manip::Date::BEGIN@14 at line 14 of Date/Manip/Date.pm
sub Regexp::DESTROY; # xsub
# spent 12µs within String::CRC32::bootstrap which was called: # once (12µs+0s) by DynaLoader::bootstrap at line 215 of DynaLoader.pm
sub String::CRC32::bootstrap; # xsub
# spent 1.55ms within XML::LibXSLT::Stylesheet::_output_string which was called 25 times, avg 62µs/call: # 25 times (1.55ms+0s) by XML::LibXSLT::StylesheetWrapper::output_string at line 489 of XML/LibXSLT.pm, avg 62µs/call
sub XML::LibXSLT::Stylesheet::_output_string; # xsub
# spent 43.7ms within XML::LibXSLT::Stylesheet::transform which was called 25 times, avg 1.75ms/call: # 25 times (43.7ms+0s) by XML::LibXSLT::StylesheetWrapper::transform at line 462 of XML/LibXSLT.pm, avg 1.75ms/call
sub XML::LibXSLT::Stylesheet::transform; # xsub
# spent 109µs within main::CORE:match which was called 8 times, avg 14µs/call: # 2 times (6µs+0s) by main::_input_cgi_parse at line 459, avg 3µs/call # once (75µs+0s) by main::RUNTIME at line 35 # once (13µs+0s) by main::RUNTIME at line 40 # once (7µs+0s) by main::RUNTIME at line 546 # once (5µs+0s) by main::RUNTIME at line 688 # once (3µs+0s) by main::RUNTIME at line 102 # once (2µs+0s) by main::RUNTIME at line 689
sub main::CORE:match; # opcode
# spent 10µs within main::CORE:regcomp which was called: # once (10µs+0s) by main::RUNTIME at line 630
sub main::CORE:regcomp; # opcode
# spent 134µs within main::CORE:sort which was called 7 times, avg 19µs/call: # 5 times (43µs+0s) by main::RUNTIME at line 529, avg 9µs/call # once (86µs+0s) by main::RUNTIME at line 217 # once (6µs+0s) by main::RUNTIME at line 531
sub main::CORE:sort; # opcode
# spent 5µs within main::CORE:subst which was called 3 times, avg 2µs/call: # once (2µs+0s) by main::RUNTIME at line 630 # once (1µs+0s) by main::RUNTIME at line 401 # once (1µs+0s) by main::RUNTIME at line 631
sub main::CORE:subst; # opcode