Filename | /usr/share/koha/opac/cgi-bin/opac/opac-search.pl |
Statements | Executed 728 statements in 23.2ms |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
1536 | 31 | 11 | 1.72s | 1.72s | execute (xsub) | DBI::st::
1425 | 2 | 2 | 1.36s | 1.36s | ping (xsub) | DBI::db::
161 | 1 | 1 | 168ms | 182ms | selectrow_array (xsub) | DBI::db::
50 | 1 | 1 | 69.0ms | 69.0ms | inflate (xsub) | Compress::Raw::Zlib::inflateStream::
1669 | 17 | 6 | 46.5ms | 78.2ms | fetchrow_hashref (xsub) | DBI::st::
25 | 1 | 1 | 43.7ms | 43.7ms | transform (xsub) | XML::LibXSLT::Stylesheet::
5 | 3 | 2 | 41.6ms | 41.6ms | do (xsub) | DBI::db::
1472 | 33 | 11 | 20.0ms | 139ms | prepare (xsub) | DBI::db::
2944 | 45 | 12 | 18.2ms | 18.2ms | DESTROY (xsub) | DBI::common::
1675 | 21 | 8 | 16.6ms | 16.6ms | FETCH (xsub) | DBI::common::
1366 | 7 | 4 | 15.2ms | 15.2ms | fetchrow_array (xsub) | DBI::st::
1669 | 17 | 6 | 15.2ms | 15.2ms | fetch (xsub) | DBI::st::
1 | 1 | 1 | 13.4ms | 942ms | BEGIN@46 | main::
1 | 1 | 1 | 12.3ms | 62.3ms | BEGIN@48 | main::
1 | 1 | 1 | 6.79ms | 9.46ms | BEGIN@51 | main::
1 | 1 | 1 | 5.36ms | 221ms | BEGIN@31 | main::
1472 | 45 | 12 | 4.69ms | 4.69ms | DESTROY (xsub) | DBD::_mem::common::
521 | 5 | 5 | 3.36ms | 3.36ms | fetchrow (xsub) | DBI::st::
1 | 1 | 1 | 2.19ms | 79.7ms | BEGIN@45 | main::
25 | 1 | 1 | 1.55ms | 1.55ms | _output_string (xsub) | XML::LibXSLT::Stylesheet::
12 | 7 | 2 | 1.28ms | 1.28ms | STORE (xsub) | DBI::common::
1 | 1 | 1 | 975µs | 5.63ms | BEGIN@54 | main::
132 | 4 | 3 | 923µs | 923µs | finish (xsub) | DBI::st::
1 | 1 | 1 | 902µs | 1.60ms | BEGIN@53 | main::
28 | 3 | 3 | 664µs | 2.82ms | fetchall_arrayref (xsub) | DBI::st::
50 | 1 | 1 | 615µs | 615µs | DESTROY (xsub) | Compress::Raw::Zlib::inflateStream::
375 | 2 | 2 | 573µs | 573µs | SvREADONLY (xsub) | Internals::
1 | 1 | 1 | 438µs | 6.56ms | BEGIN@25 | main::
1 | 1 | 1 | 202µs | 202µs | disconnect_all (xsub) | DBI::dr::
7 | 3 | 1 | 134µs | 134µs | CORE:sort (opcode) | main::
8 | 7 | 1 | 109µs | 109µs | CORE:match (opcode) | main::
1 | 1 | 1 | 61µs | 1.42ms | selectall_arrayref (xsub) | DBI::db::
3 | 3 | 1 | 45µs | 62µs | interface | C4::Templates::
30 | 5 | 5 | 38µs | 38µs | DESTROY (xsub) | Regexp::
1 | 1 | 1 | 38µs | 9.73ms | connect (xsub) | DBI::dr::
2 | 2 | 1 | 34µs | 48µs | theme | C4::Templates::
1 | 1 | 1 | 29µs | 102µs | BEGIN@47 | main::
1 | 1 | 1 | 26µs | 32µs | _input_cgi_parse | main::
17 | 1 | 1 | 26µs | 26µs | hv_clear_placeholders (xsub) | Internals::
1 | 1 | 1 | 23µs | 738µs | BEGIN@49 | main::
3 | 3 | 1 | 21µs | 31µs | lang | C4::Templates::
1 | 1 | 1 | 21µs | 174µs | BEGIN@52 | main::
2 | 2 | 1 | 20µs | 32µs | filename | C4::Templates::
1 | 1 | 1 | 18µs | 495µs | BEGIN@50 | main::
1 | 1 | 1 | 18µs | 155µs | BEGIN@64 | main::
1 | 1 | 1 | 16µs | 144µs | BEGIN@58 | main::
1 | 1 | 1 | 16µs | 38µs | BEGIN@59 | main::
1 | 1 | 1 | 15µs | 64µs | BEGIN@57 | main::
2 | 2 | 1 | 13µs | 19µs | preferredtheme | C4::Templates::
1 | 1 | 1 | 13µs | 2.39ms | BEGIN@85 | main::
1 | 1 | 1 | 13µs | 90µs | BEGIN@56 | main::
1 | 1 | 1 | 12µs | 12µs | bootstrap (xsub) | String::CRC32::
1 | 1 | 1 | 10µs | 10µs | CORE:regcomp (opcode) | main::
4 | 1 | 1 | 9µs | 9µs | FLAGS (xsub) | B::SV::
1 | 1 | 1 | 8µs | 8µs | connected (xsub) | DBI::db::
1 | 1 | 1 | 6µs | 6µs | CORE:match (opcode) | DBI::Const::GetInfo::ODBC::
1 | 1 | 1 | 6µs | 8µs | activethemes | C4::Templates::
1 | 1 | 1 | 5µs | 8µs | htdocs | C4::Templates::
3 | 3 | 1 | 5µs | 5µs | CORE:subst (opcode) | main::
1 | 1 | 1 | 5µs | 5µs | CORE:match (opcode) | DBI::Const::GetInfo::ANSI::
0 | 0 | 0 | 0s | 0s | RUNTIME | main::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
0 | 21 | 764µs | Profile 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 | ||
1 | 1 | 5.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 | ||||
25 | 3 | 213µs | 2 | 6.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 # 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 | ||||
31 | 3 | 239µs | 2 | 222ms | # spent 221ms (5.36+215) within main::BEGIN@31 which was called:
# once (5.36ms+215ms) by main::RUNTIME at line 31 # spent 221ms making 1 call to main::BEGIN@31
# spent 1.34ms making 1 call to C4::Context::import |
32 | |||||
33 | 1 | 8µs | 1 | 2.36ms | my $searchengine = C4::Context->preference("SearchEngine"); # spent 2.36ms making 1 call to C4::Context::preference |
34 | 1 | 146µs | for ( $searchengine ) { | ||
35 | 1 | 98µs | 1 | 75µ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 | } | ||||
40 | 1 | 19µs | 1 | 13µs | when ( /^Zebra$/ ) { # spent 13µs making 1 call to main::CORE:match |
41 | |||||
42 | } | ||||
43 | } | ||||
44 | |||||
45 | 3 | 146µs | 2 | 79.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 # spent 79.7ms making 1 call to main::BEGIN@45
# spent 183µs making 1 call to Exporter::import |
46 | 3 | 220µs | 2 | 943ms | # spent 942ms (13.4+929) within main::BEGIN@46 which was called:
# once (13.4ms+929ms) by main::RUNTIME at line 46 # spent 942ms making 1 call to main::BEGIN@46
# spent 491µs making 1 call to Exporter::import |
47 | 3 | 59µs | 2 | 175µs | # spent 102µs (29+73) within main::BEGIN@47 which was called:
# once (29µs+73µs) by main::RUNTIME at line 47 # spent 102µs making 1 call to main::BEGIN@47
# spent 73µs making 1 call to Exporter::import |
48 | 3 | 246µs | 2 | 62.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 # spent 62.3ms making 1 call to main::BEGIN@48
# spent 339µs making 1 call to Exporter::import |
49 | 3 | 44µs | 2 | 1.45ms | # spent 738µs (23+715) within main::BEGIN@49 which was called:
# once (23µs+715µs) by main::RUNTIME at line 49 # spent 738µs making 1 call to main::BEGIN@49
# spent 715µs making 1 call to Exporter::import |
50 | 3 | 45µs | 2 | 973µs | # spent 495µs (18+478) within main::BEGIN@50 which was called:
# once (18µs+478µs) by main::RUNTIME at line 50 # spent 495µs making 1 call to main::BEGIN@50
# spent 478µs making 1 call to Exporter::import |
51 | 3 | 185µs | 2 | 9.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 # spent 9.46ms making 1 call to main::BEGIN@51
# spent 125µs making 1 call to Exporter::import |
52 | 3 | 40µs | 2 | 327µs | # spent 174µs (21+153) within main::BEGIN@52 which was called:
# once (21µs+153µs) by main::RUNTIME at line 52 # spent 174µs making 1 call to main::BEGIN@52
# spent 153µs making 1 call to Exporter::import |
53 | 3 | 188µs | 2 | 1.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 # spent 1.60ms making 1 call to main::BEGIN@53
# spent 5µs making 1 call to UNIVERSAL::import |
54 | 3 | 197µs | 2 | 5.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 # spent 5.63ms making 1 call to main::BEGIN@54
# spent 110µs making 1 call to Exporter::import |
55 | |||||
56 | 3 | 34µs | 2 | 167µs | # spent 90µs (13+77) within main::BEGIN@56 which was called:
# once (13µs+77µs) by main::RUNTIME at line 56 # spent 90µs making 1 call to main::BEGIN@56
# spent 77µs making 1 call to POSIX::import |
57 | 3 | 37µs | 2 | 113µs | # spent 64µs (15+49) within main::BEGIN@57 which was called:
# once (15µs+49µs) by main::RUNTIME at line 57 # spent 64µs making 1 call to main::BEGIN@57
# spent 49µs making 1 call to Exporter::import |
58 | 3 | 40µs | 2 | 272µs | # spent 144µs (16+128) within main::BEGIN@58 which was called:
# once (16µs+128µs) by main::RUNTIME at line 58 # spent 144µs making 1 call to main::BEGIN@58
# spent 128µs making 1 call to JSON::import |
59 | 3 | 53µs | 2 | 61µs | # spent 38µs (16+23) within main::BEGIN@59 which was called:
# once (16µs+23µs) by main::RUNTIME at line 59 # spent 38µs making 1 call to main::BEGIN@59
# spent 23µs making 1 call to Exporter::import |
60 | |||||
61 | 1 | 10µs | 1 | 2.19ms | my $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 | ||||
64 | 3 | 172µs | 2 | 293µs | # spent 155µs (18+138) within main::BEGIN@64 which was called:
# once (18µs+138µs) by main::RUNTIME at line 64 # spent 155µs making 1 call to main::BEGIN@64
# spent 138µs making 1 call to CGI::import |
65 | 1 | 8µs | 1 | 4.60ms | my $cgi = new CGI; # spent 4.60ms making 1 call to CGI::new |
66 | |||||
67 | 1 | 3µs | 1 | 10µs | my $branch_group_limit = $cgi->param("branch_group_limit"); # spent 10µs making 1 call to CGI::param |
68 | 1 | 600ns | if ( $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 | ||||
86 | 1 | 10µs | 1 | 2.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 | } | ||||
90 | 1 | 8.71ms | 1 | 2.39ms | } # spent 2.39ms making 1 call to main::BEGIN@85 |
91 | |||||
92 | 1 | 800ns | my ($template,$borrowernumber,$cookie); | ||
93 | 1 | 6µs | 1 | 5.48ms | my $lang = C4::Templates::getlanguage($cgi, 'opac'); # spent 5.48ms making 1 call to C4::Templates::getlanguage |
94 | # decide which template to use | ||||
95 | 1 | 300ns | my $template_name; | ||
96 | 1 | 2µs | my $template_type = 'basic'; | ||
97 | 1 | 7µs | 1 | 31µs | my @params = $cgi->param("limit"); # spent 31µs making 1 call to CGI::param |
98 | |||||
99 | |||||
100 | 1 | 5µs | 1 | 15µs | my $format = $cgi->param("format") || ''; # spent 15µs making 1 call to CGI::param |
101 | 1 | 10µs | 1 | 2.20ms | my $build_grouped_results = C4::Context->preference('OPACGroupResults'); # spent 2.20ms making 1 call to C4::Context::preference |
102 | 1 | 25µs | 2 | 42µs | if ($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 | } | ||||
105 | elsif (@params && $build_grouped_results) { | ||||
106 | $template_name = 'opac-results-grouped.tmpl'; | ||||
107 | } | ||||
108 | elsif ((@params>=1) || ($cgi->param("q")) || ($cgi->param('multibranchlimit')) || ($cgi->param('limit-yr')) ) { | ||||
109 | $template_name = 'opac-results.tmpl'; | ||||
110 | } | ||||
111 | else { | ||||
112 | $template_name = 'opac-advsearch.tmpl'; | ||||
113 | $template_type = 'advsearch'; | ||||
114 | } | ||||
115 | # load the template | ||||
116 | 1 | 90µs | 2 | 319ms | ($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 | ); | ||||
123 | 1 | 16µs | 2 | 2.42ms | if ($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 | ||||
128 | 1 | 900ns | my @cart_list; | ||
129 | |||||
130 | 1 | 8µs | 1 | 100µs | if($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 | |||||
135 | 1 | 2µs | if ($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 | } | ||||
141 | 1 | 12µs | 3 | 18µs | if (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 | } | ||||
144 | elsif (C4::Context->preference("marcflavour") eq "MARC21" ) { | ||||
145 | $template->param('usmarc' => 1); | ||||
146 | } | ||||
147 | 1 | 9µs | 2 | 2.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 |
148 | 1 | 9µs | 2 | 2.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 | |||||
150 | 1 | 9µs | 2 | 2.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 | |||||
153 | 1 | 5µs | 1 | 7µs | if (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 | |||||
162 | 1 | 6µs | 1 | 7µs | if (C4::Context->preference('TagsEnabled')) { # spent 7µs making 1 call to C4::Context::preference |
163 | 1 | 8µs | 1 | 17µs | $template->param(TagsEnabled => 1); # spent 17µs making 1 call to C4::Templates::param |
164 | 1 | 5µs | foreach (qw(TagsShowOnList TagsInputOnList)) { | ||
165 | 2 | 19µs | 3 | 4.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 | |||||
195 | 1 | 9µs | 7 | 12.1ms | my $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 |
196 | 1 | 15µs | 5 | 2.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) | ||||
201 | 1 | 10µs | 1 | 2.43ms | my $languages_limit_loop = getAllLanguages($lang); # spent 2.43ms making 1 call to Memoize::__ANON__[(eval 1015)[Memoize.pm:73]:1] |
202 | 1 | 8µs | 1 | 20µ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 | ||||
205 | 1 | 13µs | 4 | 3.77ms | my $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 | ||||
207 | 1 | 12µs | 1 | 19µs | my $itype_or_itemtype = (C4::Context->preference("item-level_itypes"))?'itype':'itemtype'; # spent 19µs making 1 call to C4::Context::preference |
208 | 1 | 900ns | my @advancedsearchesloop; | ||
209 | 1 | 700ns | my $cnt; | ||
210 | 1 | 6µs | 1 | 1.90ms | my $advanced_search_types = C4::Context->preference("AdvancedSearchTypes") || "itemtypes"; # spent 1.90ms making 1 call to C4::Context::preference |
211 | 1 | 7µs | my @advanced_search_types = split(/\|/, $advanced_search_types); | ||
212 | |||||
213 | 1 | 3µs | foreach my $advanced_srch_type (@advanced_search_types) { | ||
214 | 3 | 7µs | if ($advanced_srch_type eq 'itemtypes') { | ||
215 | # itemtype is a special case, since it's not defined in authorized values | ||||
216 | 1 | 600ns | my @itypesloop; | ||
217 | 1 | 108µs | 1 | 86µs | foreach my $thisitemtype ( sort {$itemtypes->{$a}->{'description'} cmp $itemtypes->{$b}->{'description'} } keys %$itemtypes ) { # spent 86µs making 1 call to main::CORE:sort |
218 | 23 | 243µs | 23 | 2.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 | ); | ||||
224 | 23 | 60µs | push @itypesloop, \%row; | ||
225 | } | ||||
226 | 1 | 4µs | my %search_code = ( advanced_search_type => $advanced_srch_type, | ||
227 | code_loop => \@itypesloop ); | ||||
228 | 1 | 2µs | push @advancedsearchesloop, \%search_code; | ||
229 | } else { | ||||
230 | # covers all the other cases: non-itemtype authorized values | ||||
231 | 2 | 11µs | 2 | 5.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 |
232 | 2 | 1µs | my @authvalueloop; | ||
233 | 2 | 5µs | for my $thisitemtype (@$advsearchtypes) { | ||
234 | 26 | 177µs | 26 | 109µ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 | ); | ||||
241 | 26 | 50µs | push @authvalueloop, \%row; | ||
242 | } | ||||
243 | 2 | 6µs | my %search_code = ( advanced_search_type => $advanced_srch_type, | ||
244 | code_loop => \@authvalueloop ); | ||||
245 | 2 | 4µs | push @advancedsearchesloop, \%search_code; | ||
246 | } | ||||
247 | } | ||||
248 | 1 | 17µs | 1 | 25µ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 | ||||
255 | 1 | 2µs | if ( $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) | ||||
331 | 1 | 23µs | 1 | 268µs | my $params = $cgi->Vars; # spent 268µs making 1 call to CGI::AUTOLOAD |
332 | 1 | 700ns | my $tag; | ||
333 | 1 | 14µs | 1 | 158µ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 | ||||
337 | 1 | 1µs | my $pasarParams = ''; | ||
338 | 1 | 600ns | my $j = 0; | ||
339 | 1 | 28µs | 2 | 225µs | for (keys %$params) { # spent 225µs making 2 calls to CGI::AUTOLOAD, avg 113µs/call |
340 | 1 | 4µs | 1 | 17µs | my @pasarParam = $cgi->param($_); # spent 17µs making 1 call to CGI::param |
341 | 1 | 2µs | for my $paramValue(@pasarParam) { | ||
342 | 1 | 700ns | $pasarParams .= '&' if ($j > 0); | ||
343 | 1 | 1µs | $pasarParams .= $_ . '=' . $paramValue; | ||
344 | 1 | 2µ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 | ||||
351 | 1 | 400ns | my @sort_by; | ||
352 | 1 | 400ns | my $default_sort_by; | ||
353 | 1 | 22µs | 4 | 5.53ms | if ( 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 | |||||
360 | 1 | 6µs | my @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/; | ||
361 | 1 | 6µs | 1 | 21µs | @sort_by = $cgi->param('sort_by'); # spent 21µs making 1 call to CGI::param |
362 | 1 | 2µs | $sort_by[0] = $default_sort_by if !$sort_by[0] && defined($default_sort_by); | ||
363 | 1 | 2µs | foreach my $sort (@sort_by) { | ||
364 | 1 | 6µs | if ( $sort ~~ @allowed_sortby ) { | ||
365 | $template->param($sort => 1); | ||||
366 | } | ||||
367 | } | ||||
368 | 1 | 7µs | 1 | 12µ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) | ||||
371 | 1 | 3µs | 1 | 9µs | my @servers = $cgi->param('server'); # spent 9µs making 1 call to CGI::param |
372 | 1 | 1µs | unless (@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 | ||||
380 | 1 | 2µs | 1 | 8µs | my @operators = $cgi->param('op'); # spent 8µs making 1 call to CGI::param |
381 | 1 | 2µ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 | ||||
385 | 1 | 5µs | 1 | 21µs | my @indexes = $cgi->param('idx'); # spent 21µs making 1 call to CGI::param |
386 | 1 | 2µs | @indexes = map { uri_unescape($_) } @indexes; | ||
387 | |||||
388 | # if a simple index (only one) display the index used in the top search box | ||||
389 | 1 | 900ns | if ($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 | ||||
393 | 1 | 6µs | 1 | 24µs | my @operands = $cgi->param('q'); # spent 24µs making 1 call to CGI::param |
394 | 2 | 10µs | 1 | 18µs | @operands = map { uri_unescape($_) } @operands; # spent 18µs making 1 call to URI::Escape::uri_unescape |
395 | |||||
396 | 1 | 5µs | $template->{VARS}->{querystring} = join(' ', @operands); | ||
397 | |||||
398 | # if a simple search, display the value in the search box | ||||
399 | 1 | 2µs | if ($operands[0] && !$operands[1]) { | ||
400 | 1 | 800ns | my $ms_query = $operands[0]; | ||
401 | 1 | 10µs | 1 | 1µs | $ms_query =~ s/ #\S+//; # spent 1µs making 1 call to main::CORE:subst |
402 | 1 | 3µs | 1 | 6µ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 | ||||
406 | 1 | 3µs | 1 | 41µs | my @limits = $cgi->param('limit'); # spent 41µs making 1 call to CGI::param |
407 | 1 | 900ns | @limits = map { uri_unescape($_) } @limits; | ||
408 | |||||
409 | 1 | 12µs | 1 | 16µs | if($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 | |||||
414 | 1 | 600ns | my $available; | ||
415 | 1 | 2µs | foreach my $limit(@limits) { | ||
416 | if ($limit =~/available/) { | ||||
417 | $available = 1; | ||||
418 | } | ||||
419 | } | ||||
420 | 1 | 3µs | 1 | 6µs | $template->param(available => $available); # spent 6µs making 1 call to C4::Templates::param |
421 | |||||
422 | # append year limits if they exist | ||||
423 | 1 | 14µs | 1 | 12µs | if ($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 | ||||
437 | 1 | 5µs | 1 | 13µs | my $scan = $params->{'scan'}; # spent 13µs making 1 call to CGI::FETCH |
438 | 1 | 6µs | 1 | 1.72ms | my $count = C4::Context->preference('OPACnumSearchResults') || 20; # spent 1.72ms making 1 call to C4::Context::preference |
439 | 1 | 6µs | 1 | 2.12ms | my $countRSS = C4::Context->preference('numSearchRSSResults') || 50; # spent 2.12ms making 1 call to C4::Context::preference |
440 | 1 | 9µs | 1 | 20µs | my $results_per_page = $params->{'count'} || $count; # spent 20µs making 1 call to CGI::FETCH |
441 | 1 | 5µs | 1 | 12µs | my $offset = $params->{'offset'} || 0; # spent 12µs making 1 call to CGI::FETCH |
442 | 1 | 3µs | 1 | 8µs | my $page = $cgi->param('page') || 1; # spent 8µs making 1 call to CGI::param |
443 | 1 | 600ns | $offset = ($page-1)*$results_per_page if $page>1; | ||
444 | 1 | 300ns | my $hits; | ||
445 | 1 | 5µs | 1 | 12µs | my $expanded_facet = $params->{'expand'}; # spent 12µs making 1 call to CGI::FETCH |
446 | |||||
447 | # Define some global variables | ||||
448 | 1 | 1µs | my ($error,$query,$simple_query,$query_cgi,$query_desc,$limit,$limit_cgi,$limit_desc,$stopwords_removed,$query_type); | ||
449 | |||||
450 | 1 | 400ns | my @results; | ||
451 | |||||
452 | ## I. BUILD THE QUERY | ||||
453 | 1 | 14µs | 1 | 45.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 | ||||
456 | 9 | 32µs | my @elements; | ||
457 | for my $this_cgi ( split('&',shift) ) { | ||||
458 | next unless $this_cgi; | ||||
459 | 2 | 6µ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 | ||||
466 | 1 | 5µs | 1 | 32µs | my @query_inputs = _input_cgi_parse($query_cgi); # spent 32µs making 1 call to main::_input_cgi_parse |
467 | 1 | 8µs | 1 | 22µ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 | ||||
470 | 1 | 2µs | my @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 | ||||
479 | 1 | 8µs | 1 | 2.35ms | if (C4::Context->preference('OpacSuppression')) { # spent 2.35ms making 1 call to C4::Context::preference |
480 | # OPAC suppression by IP address | ||||
481 | 1 | 8µs | 1 | 1.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 { | ||||
489 | 1 | 4µs | $query = "($query) not Suppress=1"; | ||
490 | } | ||||
491 | } | ||||
492 | |||||
493 | 1 | 6µs | 1 | 12µs | $template->param ( LIMIT_INPUTS => \@limit_inputs ); # spent 12µs making 1 call to C4::Templates::param |
494 | 1 | 13µs | 2 | 2.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 | ||||
497 | 1 | 1µs | my $total = 0; # the total results for the whole set | ||
498 | 1 | 500ns | my $facets; # this object stores the faceted results that display on the left-hand of the results page | ||
499 | 1 | 500ns | my @results_array; | ||
500 | 1 | 400ns | my $results_hashref; | ||
501 | 1 | 800ns | my @coins; | ||
502 | |||||
503 | 1 | 3µs | if ($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 { | ||||
518 | 1 | 5µs | $pasarParams .= '&query=' . $query; | ||
519 | 1 | 2µs | $pasarParams .= '&count=' . $results_per_page; | ||
520 | 1 | 2µs | $pasarParams .= '&simple_query=' . $simple_query; | ||
521 | 1 | 900ns | $pasarParams .= '&query_type=' . $query_type if ($query_type); | ||
522 | 1 | 2µs | eval { | ||
523 | 1 | 16µs | 1 | 190ms | ($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 | ||||
527 | 1 | 2µs | if ($facets) { | ||
528 | 1 | 2µs | foreach my $f (@$facets) { | ||
529 | 5 | 68µs | 5 | 43µ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 | } | ||||
531 | 1 | 10µs | 1 | 6µ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); | ||||
535 | 1 | 900ns | if ($@ || $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 | ||||
543 | 1 | 700ns | my @sup_results_array; | ||
544 | 1 | 4µs | for (my $i=0;$i<@servers;$i++) { | ||
545 | 1 | 2µs | my $server = $servers[$i]; | ||
546 | 1 | 13µs | 1 | 7µs | if ($server && $server =~/biblioserver/) { # this is the local bibliographic server # spent 7µs making 1 call to main::CORE:match |
547 | 1 | 2µs | $hits = $results_hashref->{$server}->{"hits"}; | ||
548 | 1 | 6µs | 1 | 22µs | my $page = $cgi->param('page') || 0; # spent 22µs making 1 call to CGI::param |
549 | 1 | 600ns | my @newresults; | ||
550 | 1 | 3µ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 { | ||||
560 | 1 | 16µs | 7 | 5.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 | ||||
566 | 1 | 5µs | foreach my $line (@newresults) { | ||
567 | 25 | 50µs | if ( not exists $line->{'size'} ) { $line->{'size'} = "" } | ||
568 | # while we're checking each line, see if item is in the cart | ||||
569 | 25 | 31µs | if ( grep {$_ eq $line->{'biblionumber'}} @cart_list) { | ||
570 | $line->{'incart'} = 1; | ||||
571 | } | ||||
572 | } | ||||
573 | |||||
574 | |||||
575 | 1 | 1µs | my $tag_quantity; | ||
576 | 1 | 14µs | 2 | 20µ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')) { | ||||
578 | 1 | 3µs | foreach (@newresults) { | ||
579 | 25 | 79µs | my $bibnum = $_->{biblionumber} or next; | ||
580 | 25 | 616µs | 100 | 62.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 |
581 | 25 | 505µs | 100 | 69.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 | |||||
586 | 1 | 9µs | 1 | 13µs | if (C4::Context->preference('COinSinOPACResults')) { # spent 13µs making 1 call to C4::Context::preference |
587 | 1 | 3µs | foreach (@newresults) { | ||
588 | 25 | 212µs | 100 | 564ms | 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 |
589 | 25 | 251µs | 25 | 35.3ms | $_->{coins} = GetCOinSBiblio($record); # spent 35.3ms making 25 calls to C4::Biblio::GetCOinSBiblio, avg 1.41ms/call |
590 | 25 | 921µs | 25 | 2.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 | |||||
608 | 1 | 4µs | 1 | 4µ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 | |||||
618 | 1 | 5µs | if ($results_hashref->{$server}->{"hits"}){ | ||
619 | $total = $total + $results_hashref->{$server}->{"hits"}; | ||||
620 | } | ||||
621 | |||||
622 | # Opac search history | ||||
623 | 1 | 500ns | my $newsearchcookie; | ||
624 | 1 | 3µs | 1 | 4µs | if (C4::Context->preference('EnableOpacSearchHistory')) { # spent 4µs making 1 call to C4::Context::preference |
625 | 1 | 7µs | 1 | 91µs | my @recentSearches = ParseSearchHistoryCookie($cgi); # spent 91µs making 1 call to C4::Auth::ParseSearchHistoryCookie |
626 | |||||
627 | # Adding the new search if needed | ||||
628 | 1 | 15µs | 1 | 495µs | my $path_info = $cgi->url(-path_info=>1); # spent 495µs making 1 call to CGI::AUTOLOAD |
629 | 1 | 4µs | 1 | 248µs | my $query_cgi_history = $cgi->url(-query=>1); # spent 248µs making 1 call to CGI::url |
630 | 1 | 22µs | 2 | 12µ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 |
631 | 1 | 4µs | 1 | 1µs | $query_cgi_history =~ s/;/&/g; # spent 1µs making 1 call to main::CORE:subst |
632 | 1 | 33µs | my $query_desc_history = "$query_desc, $limit_desc"; | ||
633 | |||||
634 | 1 | 3µs | if (!$borrowernumber || $borrowernumber eq '') { | ||
635 | # To a cookie (the user is not logged in) | ||||
636 | 1 | 1µs | if (!$offset) { | ||
637 | 1 | 14µs | 2 | 93µ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 | }; | ||||
643 | 1 | 7µs | 1 | 13µs | $template->param(ShowOpacRecentSearchLink => 1); # spent 13µs making 1 call to C4::Templates::param |
644 | } | ||||
645 | |||||
646 | 1 | 900ns | shift @recentSearches if (@recentSearches > 15); | ||
647 | # Pushing the cookie back | ||||
648 | 1 | 16µs | 3 | 735µ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 | ); | ||||
654 | 1 | 1µ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 | ||||
665 | 1 | 1µ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 | } | ||||
677 | 1 | 2µs | if ($hits) { | ||
678 | 1 | 1µ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 | ||||
680 | 1 | 2µs | $pasarParams .= '&listBiblios='; | ||
681 | 1 | 700ns | my $j = 0; | ||
682 | 1 | 2µs | foreach (@newresults) { | ||
683 | 25 | 46µs | my $bibnum = ($_->{biblionumber})?$_->{biblionumber}:0; | ||
684 | 25 | 10µs | $pasarParams .= $bibnum . ','; | ||
685 | 25 | 4µs | $j++; | ||
686 | 25 | 18µs | last if ($j == $results_per_page); | ||
687 | } | ||||
688 | 1 | 12µs | 1 | 5µs | chop $pasarParams if ($pasarParams =~ /,$/); # spent 5µs making 1 call to main::CORE:match |
689 | 1 | 7µs | 1 | 2µs | $pasarParams .= '&total=' . int($total) if ($pasarParams !~ /total=(?:[0-9]+)?/); # spent 2µs making 1 call to main::CORE:match |
690 | 1 | 46µs | 3 | 4.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 |
691 | 1 | 8µs | 2 | 1.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 |
692 | 1 | 11µs | 1 | 41µs | $session->param('busc' => $pasarParams); # spent 41µs making 1 call to CGI::Session::param |
693 | } | ||||
694 | # | ||||
695 | } | ||||
696 | 1 | 7µs | 1 | 14µs | $template->param(total => $hits); # spent 14µs making 1 call to C4::Templates::param |
697 | 1 | 900ns | my $limit_cgi_not_availablity = $limit_cgi; | ||
698 | 1 | 500ns | $limit_cgi_not_availablity =~ s/&limit=available//g if defined $limit_cgi_not_availablity; | ||
699 | 1 | 2µs | 1 | 5µs | $template->param(limit_cgi_not_availablity => $limit_cgi_not_availablity); # spent 5µs making 1 call to C4::Templates::param |
700 | 1 | 2µs | 1 | 4µs | $template->param(limit_cgi => $limit_cgi); # spent 4µs making 1 call to C4::Templates::param |
701 | 1 | 2µs | 1 | 20µs | $template->param(countrss => $countRSS ); # spent 20µs making 1 call to C4::Templates::param |
702 | 1 | 2µs | 1 | 7µs | $template->param(query_cgi => $query_cgi); # spent 7µs making 1 call to C4::Templates::param |
703 | 1 | 2µs | 1 | 5µs | $template->param(query_desc => $query_desc); # spent 5µs making 1 call to C4::Templates::param |
704 | 1 | 2µs | 1 | 5µs | $template->param(limit_desc => $limit_desc); # spent 5µs making 1 call to C4::Templates::param |
705 | 1 | 2µs | 1 | 5µs | $template->param(offset => $offset); # spent 5µs making 1 call to C4::Templates::param |
706 | 1 | 2µs | 1 | 5µs | $template->param(DisplayMultiPlaceHold => $DisplayMultiPlaceHold); # spent 5µs making 1 call to C4::Templates::param |
707 | 1 | 2µs | 1 | 4µs | if ($query_desc || $limit_desc) { # spent 4µs making 1 call to C4::Templates::param |
708 | $template->param(searchdesc => 1); | ||||
709 | } | ||||
710 | 1 | 700ns | $template->param(stopwords_removed => "@$stopwords_removed") if $stopwords_removed; | ||
711 | 1 | 2µs | 1 | 5µs | $template->param(results_per_page => $results_per_page); # spent 5µs making 1 call to C4::Templates::param |
712 | 1 | 6µs | 1 | 8µs | my $hide = C4::Context->preference('OpacHiddenItems'); # spent 8µs making 1 call to C4::Context::preference |
713 | 1 | 500ns | $hide = ($hide =~ m/\S/) if $hide; # Just in case it has some spaces/new lines | ||
714 | 1 | 900ns | my $branch = ''; | ||
715 | 1 | 5µs | 1 | 8µs | if (C4::Context->userenv){ # spent 8µs making 1 call to C4::Context::userenv |
716 | $branch = C4::Context->userenv->{branch}; | ||||
717 | } | ||||
718 | 1 | 2µs | 1 | 2.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( | ||||
751 | 1 | 13µs | 2 | 2.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 | ); | ||||
755 | 1 | 5µs | 1 | 5µs | if (C4::Context->preference("OPACLocalCoverImages")){ # spent 5µs making 1 call to C4::Context::preference |
756 | 1 | 3µs | 1 | 5µs | $template->param(OPACLocalCoverImages => 1); # spent 5µs making 1 call to C4::Templates::param |
757 | 1 | 10µs | 2 | 2.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 | ||||
760 | 1 | 600ns | my @page_numbers; | ||
761 | # total number of pages there will be | ||||
762 | 1 | 45µs | 1 | 30µs | my $pages = ceil($hits / $results_per_page); # spent 30µs making 1 call to POSIX::ceil |
763 | # default page number | ||||
764 | 1 | 700ns | my $current_page_number = 1; | ||
765 | 1 | 700ns | if ($offset) { | ||
766 | $current_page_number = ( $offset / $results_per_page + 1 ); | ||||
767 | } | ||||
768 | 1 | 400ns | my $previous_page_offset; | ||
769 | 1 | 1µs | if ( $offset >= $results_per_page ) { | ||
770 | $previous_page_offset = $offset - $results_per_page; | ||||
771 | } | ||||
772 | 1 | 1µ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; | ||||
775 | 1 | 2µs | if ($current_page_number < 10) { | ||
776 | # just show the first 10 pages | ||||
777 | # Loop through the pages | ||||
778 | 1 | 600ns | my $pages_to_show = 10; | ||
779 | 1 | 2µs | $pages_to_show = $pages if $pages<10; | ||
780 | 1 | 11µs | for ($i=1; $i<=$pages_to_show;$i++) { | ||
781 | # the offset for this page | ||||
782 | 10 | 7µs | my $this_offset = (($i*$results_per_page)-$results_per_page); | ||
783 | # the page number for this page | ||||
784 | 10 | 3µs | my $this_page_number = $i; | ||
785 | # put it in the array | ||||
786 | 10 | 40µ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 | |||||
793 | 1 | 600ns | } | ||
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 | } | ||||
812 | 1 | 6µs | 1 | 12µ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; | ||||
814 | 1 | 6µs | 1 | 5µ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' => "&idx=an&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 | ||||
853 | 1 | 3µs | 1 | 6µs | $template->param( outer_sup_results_loop => \@sup_results_array); # spent 6µs making 1 call to C4::Templates::param |
854 | 1 | 600ns | } #/end of the for loop | ||
855 | #$template->param(FEDERATED_RESULTS => \@results_array); | ||||
856 | |||||
857 | 1 | 9µs | 2 | 2.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 | |||||
867 | 1 | 3µs | 1 | 5µs | if ($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... | ||||
873 | 1 | 7µs | 1 | 1.05ms | my ($totalref, $pubshelves, $barshelves)= # spent 1.05ms making 1 call to C4::VirtualShelves::GetSomeShelfNames |
874 | C4::VirtualShelves::GetSomeShelfNames($borrowernumber,'COMBO',1); | ||||
875 | 1 | 6µs | 1 | 17µ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 | |||||
882 | 1 | 2µs | my $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 | ||||
885 | 1 | 4µs | 1 | 4.17ms | if (C4::Context->preference('GoogleIndicTransliteration')) { # spent 4.17ms making 1 call to C4::Context::preference |
886 | $template->param('GoogleIndicTransliteration' => 1); | ||||
887 | } | ||||
888 | 1 | 10µs | 1 | 1.91ms | $template->{VARS}->{'BiblioItemtypeImage'} = C4::Context->preference('BiblioItemtypeImage'); # spent 1.91ms making 1 call to C4::Context::preference |
889 | |||||
890 | 1 | 9µs | 1 | 1.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/ ); | ||||
893 | 1 | 6µs | 1 | 2.07ms | $template->{VARS}->{IDreamBooksReviews} = C4::Context->preference('IDreamBooksReviews'); # spent 2.07ms making 1 call to C4::Context::preference |
894 | 1 | 7µs | 1 | 1.99ms | $template->{VARS}->{IDreamBooksReadometer} = C4::Context->preference('IDreamBooksReadometer'); # spent 1.99ms making 1 call to C4::Context::preference |
895 | 1 | 7µs | 1 | 2.26ms | $template->{VARS}->{IDreamBooksResults} = C4::Context->preference('IDreamBooksResults'); # spent 2.26ms making 1 call to C4::Context::preference |
896 | |||||
897 | 1 | 7µs | 1 | 17µs | $template->param( borrowernumber => $borrowernumber); # spent 17µs making 1 call to C4::Templates::param |
898 | 1 | 1.63ms | 2 | 862ms | output_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 | |||||
# 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 | |||||
# 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 | |||||
# 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 | |||||
# 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 | |||||
# 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 | |||||
# 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 | |||||
# 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 | |||||
# 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 | |||||
# 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 | |||||
# 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 | |||||
# 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 | |||||
# 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 | |||||
# 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 | |||||
# 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 | |||||
# 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 | |||||
# 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 | |||||
# 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 | |||||
# 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 | |||||
# 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 | |||||
# 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 | |||||
# 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 | |||||
# 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 | |||||
# 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 | |||||
# 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 | |||||
# 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 | |||||
# 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 | |||||
# spent 12µs within String::CRC32::bootstrap which was called:
# once (12µs+0s) by DynaLoader::bootstrap at line 215 of DynaLoader.pm | |||||
# 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 | |||||
# 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 | |||||
# 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 | |||||
# spent 10µs within main::CORE:regcomp which was called:
# once (10µs+0s) by main::RUNTIME at line 630 | |||||
sub main::CORE:sort; # opcode | |||||
sub main::CORE:subst; # opcode |