Filename | /usr/share/koha/lib/C4/Koha.pm |
Statements | Executed 6285 statements in 541ms |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
148 | 5 | 3 | 11.1ms | 316ms | GetAuthValCode | C4::Koha::
143 | 5 | 1 | 9.40ms | 315ms | GetKohaAuthorisedValueLib | C4::Koha::
51 | 3 | 2 | 8.52ms | 226ms | GetKohaAuthorisedValues | C4::Koha::
26 | 2 | 2 | 5.42ms | 80.8ms | GetItemTypes | C4::Koha::
57 | 1 | 1 | 4.98ms | 137ms | getitemtypeinfo | C4::Koha::
163 | 5 | 3 | 4.23ms | 13.8ms | getitemtypeimagelocation | C4::Koha::
137 | 1 | 1 | 2.14ms | 5.73ms | getitemtypeimagesrc | C4::Koha::
1 | 1 | 1 | 2.08ms | 2.37ms | BEGIN@28 | C4::Koha::
114 | 5 | 1 | 1.76ms | 2.26ms | xml_escape | C4::Koha::
25 | 1 | 1 | 722µs | 9.42ms | GetNormalizedUPC | C4::Koha::
1 | 1 | 1 | 720µs | 15.0ms | BEGIN@30 | C4::Koha::
1 | 1 | 1 | 603µs | 810µs | BEGIN@31 | C4::Koha::
25 | 1 | 1 | 595µs | 7.71ms | GetNormalizedOCLCNumber | C4::Koha::
25 | 1 | 1 | 540µs | 7.21ms | GetNormalizedEAN | C4::Koha::
530 | 6 | 1 | 513µs | 513µs | CORE:subst (opcode) | C4::Koha::
25 | 1 | 1 | 370µs | 6.83ms | GetNormalizedISBN | C4::Koha::
2 | 1 | 1 | 307µs | 5.39ms | GetAuthorisedValues | C4::Koha::
20 | 2 | 1 | 235µs | 330µs | _normalize_match_point | C4::Koha::
45 | 2 | 1 | 137µs | 137µs | CORE:match (opcode) | C4::Koha::
1 | 1 | 1 | 59µs | 1.94ms | getFacets | C4::Koha::
1 | 1 | 1 | 22µs | 22µs | BEGIN@35 | C4::Koha::
1 | 1 | 1 | 18µs | 24µs | BEGIN@23 | C4::Koha::
1 | 1 | 1 | 16µs | 131µs | BEGIN@27 | C4::Koha::
1 | 1 | 1 | 14µs | 18µs | BEGIN@26 | C4::Koha::
1 | 1 | 1 | 11µs | 11µs | BEGIN@29 | C4::Koha::
1 | 1 | 1 | 11µs | 87µs | BEGIN@33 | C4::Koha::
0 | 0 | 0 | 0s | 0s | AddAuthorisedValue | C4::Koha::
0 | 0 | 0 | 0s | 0s | GetAuthValCodeFromField | C4::Koha::
0 | 0 | 0 | 0s | 0s | GetAuthorisedValueByCode | C4::Koha::
0 | 0 | 0 | 0s | 0s | GetAuthorisedValueCategories | C4::Koha::
0 | 0 | 0 | 0s | 0s | GetCcodes | C4::Koha::
0 | 0 | 0 | 0s | 0s | GetDailyQuote | C4::Koha::
0 | 0 | 0 | 0s | 0s | GetKohaAuthorisedValuesFromField | C4::Koha::
0 | 0 | 0 | 0s | 0s | GetKohaImageurlFromAuthorisedValues | C4::Koha::
0 | 0 | 0 | 0s | 0s | GetPrinter | C4::Koha::
0 | 0 | 0 | 0s | 0s | GetPrinters | C4::Koha::
0 | 0 | 0 | 0s | 0s | GetSupportList | C4::Koha::
0 | 0 | 0 | 0s | 0s | GetSupportName | C4::Koha::
0 | 0 | 0 | 0s | 0s | IsAuthorisedValueCategory | C4::Koha::
0 | 0 | 0 | 0s | 0s | _getImagesFromDirectory | C4::Koha::
0 | 0 | 0 | 0s | 0s | _getSubdirectoryNames | C4::Koha::
0 | 0 | 0 | 0s | 0s | _isbn_cleanup | C4::Koha::
0 | 0 | 0 | 0s | 0s | displayServers | C4::Koha::
0 | 0 | 0 | 0s | 0s | display_marc_indicators | C4::Koha::
0 | 0 | 0 | 0s | 0s | getImageSets | C4::Koha::
0 | 0 | 0 | 0s | 0s | get_infos_of | C4::Koha::
0 | 0 | 0 | 0s | 0s | get_itemtypeinfos_of | C4::Koha::
0 | 0 | 0 | 0s | 0s | get_notforloan_label_of | C4::Koha::
0 | 0 | 0 | 0s | 0s | getallthemes | C4::Koha::
0 | 0 | 0 | 0s | 0s | getauthtype | C4::Koha::
0 | 0 | 0 | 0s | 0s | getauthtypes | C4::Koha::
0 | 0 | 0 | 0s | 0s | getframeworkinfo | C4::Koha::
0 | 0 | 0 | 0s | 0s | getframeworks | C4::Koha::
0 | 0 | 0 | 0s | 0s | getitemtypeimagedir | C4::Koha::
0 | 0 | 0 | 0s | 0s | getnbpages | C4::Koha::
0 | 0 | 0 | 0s | 0s | slashifyDate | C4::Koha::
0 | 0 | 0 | 0s | 0s | subfield_is_koha_internal_p | C4::Koha::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | package C4::Koha; | ||||
2 | |||||
3 | # Copyright 2000-2002 Katipo Communications | ||||
4 | # Parts Copyright 2010 Nelsonville Public Library | ||||
5 | # Parts copyright 2010 BibLibre | ||||
6 | # | ||||
7 | # This file is part of Koha. | ||||
8 | # | ||||
9 | # Koha is free software; you can redistribute it and/or modify it under the | ||||
10 | # terms of the GNU General Public License as published by the Free Software | ||||
11 | # Foundation; either version 2 of the License, or (at your option) any later | ||||
12 | # version. | ||||
13 | # | ||||
14 | # Koha is distributed in the hope that it will be useful, but WITHOUT ANY | ||||
15 | # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR | ||||
16 | # A PARTICULAR PURPOSE. See the GNU General Public License for more details. | ||||
17 | # | ||||
18 | # You should have received a copy of the GNU General Public License along | ||||
19 | # with Koha; if not, write to the Free Software Foundation, Inc., | ||||
20 | # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. | ||||
21 | |||||
22 | |||||
23 | 3 | 31µs | 2 | 31µs | # spent 24µs (18+6) within C4::Koha::BEGIN@23 which was called:
# once (18µs+6µs) by C4::Biblio::BEGIN@33 at line 23 # spent 24µs making 1 call to C4::Koha::BEGIN@23
# spent 6µs making 1 call to strict::import |
24 | #use warnings; FIXME - Bug 2505 | ||||
25 | |||||
26 | 3 | 32µs | 2 | 22µs | # spent 18µs (14+4) within C4::Koha::BEGIN@26 which was called:
# once (14µs+4µs) by C4::Biblio::BEGIN@33 at line 26 # spent 18µs making 1 call to C4::Koha::BEGIN@26
# spent 4µs making 1 call to C4::Context::import |
27 | 3 | 38µs | 2 | 247µs | # spent 131µs (16+116) within C4::Koha::BEGIN@27 which was called:
# once (16µs+116µs) by C4::Biblio::BEGIN@33 at line 27 # spent 131µs making 1 call to C4::Koha::BEGIN@27
# spent 116µs making 1 call to Exporter::import |
28 | 3 | 178µs | 2 | 2.41ms | # spent 2.37ms (2.08+288µs) within C4::Koha::BEGIN@28 which was called:
# once (2.08ms+288µs) by C4::Biblio::BEGIN@33 at line 28 # spent 2.37ms making 1 call to C4::Koha::BEGIN@28
# spent 38µs making 1 call to Exporter::import |
29 | 3 | 32µs | 1 | 11µs | # spent 11µs within C4::Koha::BEGIN@29 which was called:
# once (11µs+0s) by C4::Biblio::BEGIN@33 at line 29 # spent 11µs making 1 call to C4::Koha::BEGIN@29 |
30 | 3 | 153µs | 1 | 15.0ms | # spent 15.0ms (720µs+14.3) within C4::Koha::BEGIN@30 which was called:
# once (720µs+14.3ms) by C4::Biblio::BEGIN@33 at line 30 # spent 15.0ms making 1 call to C4::Koha::BEGIN@30 |
31 | 3 | 128µs | 2 | 946µs | # spent 810µs (603+207) within C4::Koha::BEGIN@31 which was called:
# once (603µs+207µs) by C4::Biblio::BEGIN@33 at line 31 # spent 810µs making 1 call to C4::Koha::BEGIN@31
# spent 136µs making 1 call to autouse::import |
32 | |||||
33 | 3 | 104µs | 2 | 163µs | # spent 87µs (11+76) within C4::Koha::BEGIN@33 which was called:
# once (11µs+76µs) by C4::Biblio::BEGIN@33 at line 33 # spent 87µs making 1 call to C4::Koha::BEGIN@33
# spent 76µs making 1 call to vars::import |
34 | |||||
35 | # spent 22µs within C4::Koha::BEGIN@35 which was called:
# once (22µs+0s) by C4::Biblio::BEGIN@33 at line 78 | ||||
36 | 1 | 1µs | $VERSION = 3.07.00.049; | ||
37 | 1 | 700ns | require Exporter; | ||
38 | 1 | 8µs | @ISA = qw(Exporter); | ||
39 | 1 | 6µs | @EXPORT = qw( | ||
40 | &slashifyDate | ||||
41 | &subfield_is_koha_internal_p | ||||
42 | &GetPrinters &GetPrinter | ||||
43 | &GetItemTypes &getitemtypeinfo | ||||
44 | &GetCcodes | ||||
45 | &GetSupportName &GetSupportList | ||||
46 | &get_itemtypeinfos_of | ||||
47 | &getframeworks &getframeworkinfo | ||||
48 | &getauthtypes &getauthtype | ||||
49 | &getallthemes | ||||
50 | &getFacets | ||||
51 | &displayServers | ||||
52 | &getnbpages | ||||
53 | &get_infos_of | ||||
54 | &get_notforloan_label_of | ||||
55 | &getitemtypeimagedir | ||||
56 | &getitemtypeimagesrc | ||||
57 | &getitemtypeimagelocation | ||||
58 | &GetAuthorisedValues | ||||
59 | &GetAuthorisedValueCategories | ||||
60 | &IsAuthorisedValueCategory | ||||
61 | &GetKohaAuthorisedValues | ||||
62 | &GetKohaAuthorisedValuesFromField | ||||
63 | &GetKohaAuthorisedValueLib | ||||
64 | &GetAuthorisedValueByCode | ||||
65 | &GetKohaImageurlFromAuthorisedValues | ||||
66 | &GetAuthValCode | ||||
67 | &AddAuthorisedValue | ||||
68 | &GetNormalizedUPC | ||||
69 | &GetNormalizedISBN | ||||
70 | &GetNormalizedEAN | ||||
71 | &GetNormalizedOCLCNumber | ||||
72 | &xml_escape | ||||
73 | |||||
74 | $DEBUG | ||||
75 | ); | ||||
76 | 1 | 300ns | $DEBUG = 0; | ||
77 | 1 | 5µs | @EXPORT_OK = qw( GetDailyQuote ); | ||
78 | 1 | 4.68ms | 1 | 22µs | } # spent 22µs making 1 call to C4::Koha::BEGIN@35 |
79 | |||||
80 | # expensive functions | ||||
81 | 1 | 5µs | 1 | 336µs | memoize('GetAuthorisedValues'); # spent 336µs making 1 call to Memoize::memoize |
82 | |||||
83 | =head1 NAME | ||||
84 | |||||
- - | |||||
99 | =head2 slashifyDate | ||||
100 | |||||
- - | |||||
108 | sub slashifyDate { | ||||
109 | |||||
110 | # accepts a date of the form xx-xx-xx[xx] and returns it in the | ||||
111 | # form xx/xx/xx[xx] | ||||
112 | my @dateOut = split( '-', shift ); | ||||
113 | return ("$dateOut[2]/$dateOut[1]/$dateOut[0]"); | ||||
114 | } | ||||
115 | |||||
116 | # FIXME.. this should be moved to a MARC-specific module | ||||
117 | sub subfield_is_koha_internal_p { | ||||
118 | my ($subfield) = @_; | ||||
119 | |||||
120 | # We could match on 'lib' and 'tab' (and 'mandatory', & more to come!) | ||||
121 | # But real MARC subfields are always single-character | ||||
122 | # so it really is safer just to check the length | ||||
123 | |||||
124 | return length $subfield != 1; | ||||
125 | } | ||||
126 | |||||
127 | =head2 GetSupportName | ||||
128 | |||||
- - | |||||
135 | sub GetSupportName{ | ||||
136 | my ($codestring)=@_; | ||||
137 | return if (! $codestring); | ||||
138 | my $resultstring; | ||||
139 | my $advanced_search_types = C4::Context->preference("AdvancedSearchTypes"); | ||||
140 | if (!$advanced_search_types or $advanced_search_types eq 'itemtypes') { | ||||
141 | my $query = qq| | ||||
142 | SELECT description | ||||
143 | FROM itemtypes | ||||
144 | WHERE itemtype=? | ||||
145 | order by description | ||||
146 | |; | ||||
147 | my $sth = C4::Context->dbh->prepare($query); | ||||
148 | $sth->execute($codestring); | ||||
149 | ($resultstring)=$sth->fetchrow; | ||||
150 | return $resultstring; | ||||
151 | } else { | ||||
152 | my $sth = | ||||
153 | C4::Context->dbh->prepare( | ||||
154 | "SELECT lib FROM authorised_values WHERE category = ? AND authorised_value = ?" | ||||
155 | ); | ||||
156 | $sth->execute( $advanced_search_types, $codestring ); | ||||
157 | my $data = $sth->fetchrow_hashref; | ||||
158 | return $$data{'lib'}; | ||||
159 | } | ||||
160 | |||||
161 | } | ||||
162 | =head2 GetSupportList | ||||
163 | |||||
- - | |||||
190 | sub GetSupportList{ | ||||
191 | my $advanced_search_types = C4::Context->preference("AdvancedSearchTypes"); | ||||
192 | if (!$advanced_search_types or $advanced_search_types eq 'itemtypes') { | ||||
193 | my $query = qq| | ||||
194 | SELECT * | ||||
195 | FROM itemtypes | ||||
196 | order by description | ||||
197 | |; | ||||
198 | my $sth = C4::Context->dbh->prepare($query); | ||||
199 | $sth->execute; | ||||
200 | return $sth->fetchall_arrayref({}); | ||||
201 | } else { | ||||
202 | my $advsearchtypes = GetAuthorisedValues($advanced_search_types); | ||||
203 | my @results= map {{itemtype=>$$_{authorised_value},description=>$$_{lib},imageurl=>$$_{imageurl}}} @$advsearchtypes; | ||||
204 | return \@results; | ||||
205 | } | ||||
206 | } | ||||
207 | =head2 GetItemTypes | ||||
208 | |||||
- - | |||||
244 | # spent 80.8ms (5.42+75.3) within C4::Koha::GetItemTypes which was called 26 times, avg 3.11ms/call:
# 25 times (5.24ms+72.5ms) by C4::XSLT::buildKohaItemsNamespace at line 258 of /usr/share/koha/lib/C4/XSLT.pm, avg 3.11ms/call
# once (186µs+2.84ms) by main::RUNTIME at line 205 of /usr/share/koha/opac/cgi-bin/opac/opac-search.pl | ||||
245 | |||||
246 | # returns a reference to a hash of references to itemtypes... | ||||
247 | 26 | 15µs | my %itemtypes; | ||
248 | 26 | 248µs | 26 | 24.9ms | my $dbh = C4::Context->dbh; # spent 24.9ms making 26 calls to C4::Context::dbh, avg 956µs/call |
249 | 26 | 38µs | my $query = qq| | ||
250 | SELECT * | ||||
251 | FROM itemtypes | ||||
252 | |; | ||||
253 | 26 | 684µs | 52 | 5.60ms | my $sth = $dbh->prepare($query); # spent 3.04ms making 26 calls to DBI::db::prepare, avg 117µs/call
# spent 2.57ms making 26 calls to DBD::mysql::db::prepare, avg 99µs/call |
254 | 26 | 29.7ms | 26 | 29.4ms | $sth->execute; # spent 29.4ms making 26 calls to DBI::st::execute, avg 1.13ms/call |
255 | 26 | 21.3ms | 1872 | 24.5ms | while ( my $IT = $sth->fetchrow_hashref ) { # spent 17.7ms making 624 calls to DBI::st::fetchrow_hashref, avg 28µs/call
# spent 3.73ms making 624 calls to DBI::st::fetch, avg 6µs/call
# spent 3.13ms making 624 calls to DBI::common::FETCH, avg 5µs/call |
256 | $itemtypes{ $IT->{'itemtype'} } = $IT; | ||||
257 | } | ||||
258 | 26 | 1.12ms | return ( \%itemtypes ); | ||
259 | } | ||||
260 | |||||
261 | sub get_itemtypeinfos_of { | ||||
262 | my @itemtypes = @_; | ||||
263 | |||||
264 | my $placeholders = join( ', ', map { '?' } @itemtypes ); | ||||
265 | my $query = <<"END_SQL"; | ||||
266 | SELECT itemtype, | ||||
267 | description, | ||||
268 | imageurl, | ||||
269 | notforloan | ||||
270 | FROM itemtypes | ||||
271 | WHERE itemtype IN ( $placeholders ) | ||||
272 | END_SQL | ||||
273 | |||||
274 | return get_infos_of( $query, 'itemtype', undef, \@itemtypes ); | ||||
275 | } | ||||
276 | |||||
277 | # this is temporary until we separate collection codes and item types | ||||
278 | sub GetCcodes { | ||||
279 | my $count = 0; | ||||
280 | my @results; | ||||
281 | my $dbh = C4::Context->dbh; | ||||
282 | my $sth = | ||||
283 | $dbh->prepare( | ||||
284 | "SELECT * FROM authorised_values ORDER BY authorised_value"); | ||||
285 | $sth->execute; | ||||
286 | while ( my $data = $sth->fetchrow_hashref ) { | ||||
287 | if ( $data->{category} eq "CCODE" ) { | ||||
288 | $count++; | ||||
289 | $results[$count] = $data; | ||||
290 | |||||
291 | #warn "data: $data"; | ||||
292 | } | ||||
293 | } | ||||
294 | $sth->finish; | ||||
295 | return ( $count, @results ); | ||||
296 | } | ||||
297 | |||||
298 | =head2 getauthtypes | ||||
299 | |||||
- - | |||||
335 | sub getauthtypes { | ||||
336 | |||||
337 | # returns a reference to a hash of references to authtypes... | ||||
338 | my %authtypes; | ||||
339 | my $dbh = C4::Context->dbh; | ||||
340 | my $sth = $dbh->prepare("select * from auth_types order by authtypetext"); | ||||
341 | $sth->execute; | ||||
342 | while ( my $IT = $sth->fetchrow_hashref ) { | ||||
343 | $authtypes{ $IT->{'authtypecode'} } = $IT; | ||||
344 | } | ||||
345 | return ( \%authtypes ); | ||||
346 | } | ||||
347 | |||||
348 | sub getauthtype { | ||||
349 | my ($authtypecode) = @_; | ||||
350 | |||||
351 | # returns a reference to a hash of references to authtypes... | ||||
352 | my %authtypes; | ||||
353 | my $dbh = C4::Context->dbh; | ||||
354 | my $sth = $dbh->prepare("select * from auth_types where authtypecode=?"); | ||||
355 | $sth->execute($authtypecode); | ||||
356 | my $res = $sth->fetchrow_hashref; | ||||
357 | return $res; | ||||
358 | } | ||||
359 | |||||
360 | =head2 getframework | ||||
361 | |||||
- - | |||||
397 | sub getframeworks { | ||||
398 | |||||
399 | # returns a reference to a hash of references to branches... | ||||
400 | my %itemtypes; | ||||
401 | my $dbh = C4::Context->dbh; | ||||
402 | my $sth = $dbh->prepare("select * from biblio_framework"); | ||||
403 | $sth->execute; | ||||
404 | while ( my $IT = $sth->fetchrow_hashref ) { | ||||
405 | $itemtypes{ $IT->{'frameworkcode'} } = $IT; | ||||
406 | } | ||||
407 | return ( \%itemtypes ); | ||||
408 | } | ||||
409 | |||||
410 | =head2 getframeworkinfo | ||||
411 | |||||
- - | |||||
418 | sub getframeworkinfo { | ||||
419 | my ($frameworkcode) = @_; | ||||
420 | my $dbh = C4::Context->dbh; | ||||
421 | my $sth = | ||||
422 | $dbh->prepare("select * from biblio_framework where frameworkcode=?"); | ||||
423 | $sth->execute($frameworkcode); | ||||
424 | my $res = $sth->fetchrow_hashref; | ||||
425 | return $res; | ||||
426 | } | ||||
427 | |||||
428 | =head2 getitemtypeinfo | ||||
429 | |||||
- - | |||||
438 | # spent 137ms (4.98+132) within C4::Koha::getitemtypeinfo which was called 57 times, avg 2.41ms/call:
# 57 times (4.98ms+132ms) by C4::Biblio::GetAuthorisedValueDesc at line 1585 of /usr/share/koha/lib/C4/Biblio.pm, avg 2.41ms/call | ||||
439 | 57 | 119µs | my ($itemtype, $interface) = @_; | ||
440 | 57 | 359µs | 57 | 54.0ms | my $dbh = C4::Context->dbh; # spent 54.0ms making 57 calls to C4::Context::dbh, avg 947µs/call |
441 | 57 | 1.31ms | 114 | 11.9ms | my $sth = $dbh->prepare("select * from itemtypes where itemtype=?"); # spent 6.40ms making 57 calls to DBI::db::prepare, avg 112µs/call
# spent 5.51ms making 57 calls to DBD::mysql::db::prepare, avg 97µs/call |
442 | 57 | 60.8ms | 57 | 59.9ms | $sth->execute($itemtype); # spent 59.9ms making 57 calls to DBI::st::execute, avg 1.05ms/call |
443 | 57 | 4.52ms | 171 | 5.53ms | my $res = $sth->fetchrow_hashref; # spent 3.90ms making 57 calls to DBI::st::fetchrow_hashref, avg 68µs/call
# spent 953µs making 57 calls to DBI::common::FETCH, avg 17µs/call
# spent 678µs making 57 calls to DBI::st::fetch, avg 12µs/call |
444 | |||||
445 | 57 | 572µs | 57 | 6.45ms | $res->{imageurl} = getitemtypeimagelocation( ( ( defined $interface && $interface eq 'opac' ) ? 'opac' : 'intranet' ), $res->{imageurl} ); # spent 6.45ms making 57 calls to C4::Koha::getitemtypeimagelocation, avg 113µs/call |
446 | |||||
447 | 57 | 3.25ms | return $res; | ||
448 | } | ||||
449 | |||||
450 | =head2 getitemtypeimagedir | ||||
451 | |||||
- - | |||||
460 | sub getitemtypeimagedir { | ||||
461 | my $src = shift || 'opac'; | ||||
462 | if ($src eq 'intranet') { | ||||
463 | return C4::Context->config('intrahtdocs') . '/' .C4::Context->preference('template') . '/img/itemtypeimg'; | ||||
464 | } else { | ||||
465 | return C4::Context->config('opachtdocs') . '/' . C4::Context->preference('opacthemes') . '/itemtypeimg'; | ||||
466 | } | ||||
467 | } | ||||
468 | |||||
469 | # spent 5.73ms (2.14+3.59) within C4::Koha::getitemtypeimagesrc which was called 137 times, avg 42µs/call:
# 137 times (2.14ms+3.59ms) by C4::Koha::getitemtypeimagelocation at line 488, avg 42µs/call | ||||
470 | 137 | 241µs | my $src = shift || 'opac'; | ||
471 | 137 | 828µs | 57 | 2.64ms | if ($src eq 'intranet') { # spent 2.64ms making 57 calls to C4::Context::preference, avg 46µs/call |
472 | return '/intranet-tmpl' . '/' . C4::Context->preference('template') . '/img/itemtypeimg'; | ||||
473 | } else { | ||||
474 | 80 | 1.12ms | 80 | 956µs | return '/opac-tmpl' . '/' . C4::Context->preference('opacthemes') . '/itemtypeimg'; # spent 956µs making 80 calls to C4::Context::preference, avg 12µs/call |
475 | } | ||||
476 | } | ||||
477 | |||||
478 | # spent 13.8ms (4.23+9.54) within C4::Koha::getitemtypeimagelocation which was called 163 times, avg 84µs/call:
# 57 times (1.28ms+5.17ms) by C4::Koha::getitemtypeinfo at line 445, avg 113µs/call
# 32 times (886µs+1.72ms) by C4::Search::searchResults at line 1985 of /usr/share/koha/lib/C4/Search.pm, avg 81µs/call
# 26 times (220µs+0s) by main::RUNTIME at line 234 of /usr/share/koha/opac/cgi-bin/opac/opac-search.pl, avg 8µs/call
# 25 times (619µs+1.41ms) by C4::Search::searchResults at line 1714 of /usr/share/koha/lib/C4/Search.pm, avg 81µs/call
# 23 times (1.22ms+1.24ms) by main::RUNTIME at line 218 of /usr/share/koha/opac/cgi-bin/opac/opac-search.pl, avg 107µs/call | ||||
479 | 163 | 402µs | my ( $src, $image ) = @_; | ||
480 | |||||
481 | 163 | 213µs | return '' if ( !$image ); | ||
482 | 137 | 535µs | require URI::Split; | ||
483 | |||||
484 | 137 | 794µs | 137 | 3.55ms | my $scheme = ( URI::Split::uri_split( $image ) )[0]; # spent 3.55ms making 137 calls to URI::Split::uri_split, avg 26µs/call |
485 | |||||
486 | 137 | 81µs | return $image if ( $scheme ); | ||
487 | |||||
488 | 137 | 1.20ms | 137 | 5.73ms | return getitemtypeimagesrc( $src ) . '/' . $image; # spent 5.73ms making 137 calls to C4::Koha::getitemtypeimagesrc, avg 42µs/call |
489 | } | ||||
490 | |||||
491 | =head3 _getImagesFromDirectory | ||||
492 | |||||
- - | |||||
506 | sub _getImagesFromDirectory { | ||||
507 | my $directoryname = shift; | ||||
508 | return unless defined $directoryname; | ||||
509 | return unless -d $directoryname; | ||||
510 | |||||
511 | if ( opendir ( my $dh, $directoryname ) ) { | ||||
512 | my @images = grep { /\.(gif|png)$/i } readdir( $dh ); | ||||
513 | closedir $dh; | ||||
514 | @images = sort(@images); | ||||
515 | return @images; | ||||
516 | } else { | ||||
517 | warn "unable to opendir $directoryname: $!"; | ||||
518 | return; | ||||
519 | } | ||||
520 | } | ||||
521 | |||||
522 | =head3 _getSubdirectoryNames | ||||
523 | |||||
- - | |||||
536 | sub _getSubdirectoryNames { | ||||
537 | my $directoryname = shift; | ||||
538 | return unless defined $directoryname; | ||||
539 | return unless -d $directoryname; | ||||
540 | |||||
541 | if ( opendir ( my $dh, $directoryname ) ) { | ||||
542 | my @directories = grep { -d File::Spec->catfile( $directoryname, $_ ) && ! ( /^\./ ) } readdir( $dh ); | ||||
543 | closedir $dh; | ||||
544 | return @directories; | ||||
545 | } else { | ||||
546 | warn "unable to opendir $directoryname: $!"; | ||||
547 | return; | ||||
548 | } | ||||
549 | } | ||||
550 | |||||
551 | =head3 getImageSets | ||||
552 | |||||
- - | |||||
570 | sub getImageSets { | ||||
571 | my %params = @_; | ||||
572 | my $checked = $params{'checked'} || ''; | ||||
573 | |||||
574 | my $paths = { staff => { filesystem => getitemtypeimagedir('intranet'), | ||||
575 | url => getitemtypeimagesrc('intranet'), | ||||
576 | }, | ||||
577 | opac => { filesystem => getitemtypeimagedir('opac'), | ||||
578 | url => getitemtypeimagesrc('opac'), | ||||
579 | } | ||||
580 | }; | ||||
581 | |||||
582 | my @imagesets = (); # list of hasrefs of image set data to pass to template | ||||
583 | my @subdirectories = _getSubdirectoryNames( $paths->{'staff'}{'filesystem'} ); | ||||
584 | foreach my $imagesubdir ( @subdirectories ) { | ||||
585 | warn $imagesubdir if $DEBUG; | ||||
586 | my @imagelist = (); # hashrefs of image info | ||||
587 | my @imagenames = _getImagesFromDirectory( File::Spec->catfile( $paths->{'staff'}{'filesystem'}, $imagesubdir ) ); | ||||
588 | my $imagesetactive = 0; | ||||
589 | foreach my $thisimage ( @imagenames ) { | ||||
590 | push( @imagelist, | ||||
591 | { KohaImage => "$imagesubdir/$thisimage", | ||||
592 | StaffImageUrl => join( '/', $paths->{'staff'}{'url'}, $imagesubdir, $thisimage ), | ||||
593 | OpacImageUrl => join( '/', $paths->{'opac'}{'url'}, $imagesubdir, $thisimage ), | ||||
594 | checked => "$imagesubdir/$thisimage" eq $checked ? 1 : 0, | ||||
595 | } | ||||
596 | ); | ||||
597 | $imagesetactive = 1 if "$imagesubdir/$thisimage" eq $checked; | ||||
598 | } | ||||
599 | push @imagesets, { imagesetname => $imagesubdir, | ||||
600 | imagesetactive => $imagesetactive, | ||||
601 | images => \@imagelist }; | ||||
602 | |||||
603 | } | ||||
604 | return \@imagesets; | ||||
605 | } | ||||
606 | |||||
607 | =head2 GetPrinters | ||||
608 | |||||
- - | |||||
620 | sub GetPrinters { | ||||
621 | my %printers; | ||||
622 | my $dbh = C4::Context->dbh; | ||||
623 | my $sth = $dbh->prepare("select * from printers"); | ||||
624 | $sth->execute; | ||||
625 | while ( my $printer = $sth->fetchrow_hashref ) { | ||||
626 | $printers{ $printer->{'printqueue'} } = $printer; | ||||
627 | } | ||||
628 | return ( \%printers ); | ||||
629 | } | ||||
630 | |||||
631 | =head2 GetPrinter | ||||
632 | |||||
- - | |||||
637 | sub GetPrinter { | ||||
638 | my ( $query, $printers ) = @_; # get printer for this query from printers | ||||
639 | my $printer = $query->param('printer'); | ||||
640 | my %cookie = $query->cookie('userenv'); | ||||
641 | ($printer) || ( $printer = $cookie{'printer'} ) || ( $printer = '' ); | ||||
642 | ( $printers->{$printer} ) || ( $printer = ( keys %$printers )[0] ); | ||||
643 | return $printer; | ||||
644 | } | ||||
645 | |||||
646 | =head2 getnbpages | ||||
647 | |||||
- - | |||||
653 | sub getnbpages { | ||||
654 | my ( $nb_items, $nb_items_per_page ) = @_; | ||||
655 | |||||
656 | return int( ( $nb_items - 1 ) / $nb_items_per_page ) + 1; | ||||
657 | } | ||||
658 | |||||
659 | =head2 getallthemes | ||||
660 | |||||
- - | |||||
668 | sub getallthemes { | ||||
669 | my $type = shift; | ||||
670 | my $htdocs; | ||||
671 | my @themes; | ||||
672 | if ( $type eq 'intranet' ) { | ||||
673 | $htdocs = C4::Context->config('intrahtdocs'); | ||||
674 | } | ||||
675 | else { | ||||
676 | $htdocs = C4::Context->config('opachtdocs'); | ||||
677 | } | ||||
678 | opendir D, "$htdocs"; | ||||
679 | my @dirlist = readdir D; | ||||
680 | foreach my $directory (@dirlist) { | ||||
681 | next if $directory eq 'lib'; | ||||
682 | -d "$htdocs/$directory/en" and push @themes, $directory; | ||||
683 | } | ||||
684 | return @themes; | ||||
685 | } | ||||
686 | |||||
687 | # spent 1.94ms (59µs+1.88) within C4::Koha::getFacets which was called:
# once (59µs+1.88ms) by C4::Search::getRecords at line 342 of /usr/share/koha/lib/C4/Search.pm | ||||
688 | 1 | 600ns | my $facets; | ||
689 | 1 | 6µs | 1 | 6µs | if ( C4::Context->preference("marcflavour") eq "UNIMARC" ) { # spent 6µs making 1 call to C4::Context::preference |
690 | $facets = [ | ||||
691 | { | ||||
692 | idx => 'su-to', | ||||
693 | label => 'Topics', | ||||
694 | tags => [ qw/ 600ab 601ab 602a 604at 605a 606ax 610a / ], | ||||
695 | sep => ' - ', | ||||
696 | }, | ||||
697 | { | ||||
698 | idx => 'su-geo', | ||||
699 | label => 'Places', | ||||
700 | tags => [ qw/ 607a / ], | ||||
701 | sep => ' - ', | ||||
702 | }, | ||||
703 | { | ||||
704 | idx => 'su-ut', | ||||
705 | label => 'Titles', | ||||
706 | tags => [ qw/ 500a 501a 503a / ], | ||||
707 | sep => ', ', | ||||
708 | }, | ||||
709 | { | ||||
710 | idx => 'au', | ||||
711 | label => 'Authors', | ||||
712 | tags => [ qw/ 700ab 701ab 702ab / ], | ||||
713 | sep => C4::Context->preference("UNIMARCAuthorsFacetsSeparator"), | ||||
714 | }, | ||||
715 | { | ||||
716 | idx => 'se', | ||||
717 | label => 'Series', | ||||
718 | tags => [ qw/ 225a / ], | ||||
719 | sep => ', ', | ||||
720 | }, | ||||
721 | ]; | ||||
722 | |||||
723 | my $library_facet; | ||||
724 | unless ( C4::Context->preference("singleBranchMode") || GetBranchesCount() == 1 ) { | ||||
725 | $library_facet = { | ||||
726 | idx => 'branch', | ||||
727 | label => 'Libraries', | ||||
728 | tags => [ qw/ 995b / ], | ||||
729 | }; | ||||
730 | } else { | ||||
731 | $library_facet = { | ||||
732 | idx => 'location', | ||||
733 | label => 'Location', | ||||
734 | tags => [ qw/ 995c / ], | ||||
735 | }; | ||||
736 | } | ||||
737 | push( @$facets, $library_facet ); | ||||
738 | } | ||||
739 | else { | ||||
740 | 1 | 24µs | $facets = [ | ||
741 | { | ||||
742 | idx => 'su-to', | ||||
743 | label => 'Topics', | ||||
744 | tags => [ qw/ 650a / ], | ||||
745 | sep => '--', | ||||
746 | }, | ||||
747 | # { | ||||
748 | # idx => 'su-na', | ||||
749 | # label => 'People and Organizations', | ||||
750 | # tags => [ qw/ 600a 610a 611a / ], | ||||
751 | # sep => 'a', | ||||
752 | # }, | ||||
753 | { | ||||
754 | idx => 'su-geo', | ||||
755 | label => 'Places', | ||||
756 | tags => [ qw/ 651a / ], | ||||
757 | sep => '--', | ||||
758 | }, | ||||
759 | { | ||||
760 | idx => 'su-ut', | ||||
761 | label => 'Titles', | ||||
762 | tags => [ qw/ 630a / ], | ||||
763 | sep => '--', | ||||
764 | }, | ||||
765 | { | ||||
766 | idx => 'au', | ||||
767 | label => 'Authors', | ||||
768 | tags => [ qw/ 100a 110a 700a / ], | ||||
769 | sep => ', ', | ||||
770 | }, | ||||
771 | { | ||||
772 | idx => 'se', | ||||
773 | label => 'Series', | ||||
774 | tags => [ qw/ 440a 490a / ], | ||||
775 | sep => ', ', | ||||
776 | }, | ||||
777 | { | ||||
778 | idx => 'itype', | ||||
779 | label => 'ItemTypes', | ||||
780 | tags => [ qw/ 952y 942c / ], | ||||
781 | sep => ', ', | ||||
782 | }, | ||||
783 | ]; | ||||
784 | |||||
785 | 1 | 400ns | my $library_facet; | ||
786 | 1 | 16µs | 5 | 1.97ms | unless ( C4::Context->preference("singleBranchMode") || GetBranchesCount() == 1 ) { # spent 1.88ms making 1 call to C4::Branch::GetBranchesCount
# spent 86µs making 2 calls to DBI::common::DESTROY, avg 43µs/call
# spent 3µs making 1 call to C4::Context::preference
# spent 3µs making 1 call to DBD::_mem::common::DESTROY |
787 | $library_facet = { | ||||
788 | idx => 'branch', | ||||
789 | label => 'Libraries', | ||||
790 | tags => [ qw / 952b / ], | ||||
791 | }; | ||||
792 | } else { | ||||
793 | $library_facet = { | ||||
794 | idx => 'location', | ||||
795 | label => 'Location', | ||||
796 | tags => [ qw / 952c / ], | ||||
797 | }; | ||||
798 | } | ||||
799 | 1 | 2µs | push( @$facets, $library_facet ); | ||
800 | } | ||||
801 | 1 | 6µs | return $facets; | ||
802 | } | ||||
803 | |||||
804 | =head2 get_infos_of | ||||
805 | |||||
- - | |||||
830 | sub get_infos_of { | ||||
831 | my ( $query, $key_name, $value_name, $bind_params ) = @_; | ||||
832 | |||||
833 | my $dbh = C4::Context->dbh; | ||||
834 | |||||
835 | my $sth = $dbh->prepare($query); | ||||
836 | $sth->execute( @$bind_params ); | ||||
837 | |||||
838 | my %infos_of; | ||||
839 | while ( my $row = $sth->fetchrow_hashref ) { | ||||
840 | if ( defined $value_name ) { | ||||
841 | $infos_of{ $row->{$key_name} } = $row->{$value_name}; | ||||
842 | } | ||||
843 | else { | ||||
844 | $infos_of{ $row->{$key_name} } = $row; | ||||
845 | } | ||||
846 | } | ||||
847 | $sth->finish; | ||||
848 | |||||
849 | return \%infos_of; | ||||
850 | } | ||||
851 | |||||
852 | =head2 get_notforloan_label_of | ||||
853 | |||||
- - | |||||
872 | # FIXME - why not use GetAuthorisedValues ?? | ||||
873 | # | ||||
874 | sub get_notforloan_label_of { | ||||
875 | my $dbh = C4::Context->dbh; | ||||
876 | |||||
877 | my $query = ' | ||||
878 | SELECT authorised_value | ||||
879 | FROM marc_subfield_structure | ||||
880 | WHERE kohafield = \'items.notforloan\' | ||||
881 | LIMIT 0, 1 | ||||
882 | '; | ||||
883 | my $sth = $dbh->prepare($query); | ||||
884 | $sth->execute(); | ||||
885 | my ($statuscode) = $sth->fetchrow_array(); | ||||
886 | |||||
887 | $query = ' | ||||
888 | SELECT lib, | ||||
889 | authorised_value | ||||
890 | FROM authorised_values | ||||
891 | WHERE category = ? | ||||
892 | '; | ||||
893 | $sth = $dbh->prepare($query); | ||||
894 | $sth->execute($statuscode); | ||||
895 | my %notforloan_label_of; | ||||
896 | while ( my $row = $sth->fetchrow_hashref ) { | ||||
897 | $notforloan_label_of{ $row->{authorised_value} } = $row->{lib}; | ||||
898 | } | ||||
899 | $sth->finish; | ||||
900 | |||||
901 | return \%notforloan_label_of; | ||||
902 | } | ||||
903 | |||||
904 | =head2 displayServers | ||||
905 | |||||
- - | |||||
928 | sub displayServers { | ||||
929 | my ( $position, $type ) = @_; | ||||
930 | my $dbh = C4::Context->dbh; | ||||
931 | |||||
932 | my $strsth = 'SELECT * FROM z3950servers'; | ||||
933 | my @where_clauses; | ||||
934 | my @bind_params; | ||||
935 | |||||
936 | if ($position) { | ||||
937 | push @bind_params, $position; | ||||
938 | push @where_clauses, ' position = ? '; | ||||
939 | } | ||||
940 | |||||
941 | if ($type) { | ||||
942 | push @bind_params, $type; | ||||
943 | push @where_clauses, ' type = ? '; | ||||
944 | } | ||||
945 | |||||
946 | # reassemble where clause from where clause pieces | ||||
947 | if (@where_clauses) { | ||||
948 | $strsth .= ' WHERE ' . join( ' AND ', @where_clauses ); | ||||
949 | } | ||||
950 | |||||
951 | my $rq = $dbh->prepare($strsth); | ||||
952 | $rq->execute(@bind_params); | ||||
953 | my @primaryserverloop; | ||||
954 | |||||
955 | while ( my $data = $rq->fetchrow_hashref ) { | ||||
956 | push @primaryserverloop, | ||||
957 | { label => $data->{description}, | ||||
958 | id => $data->{name}, | ||||
959 | name => "server", | ||||
960 | value => $data->{host} . ":" . $data->{port} . "/" . $data->{database}, | ||||
961 | encoding => ( $data->{encoding} ? $data->{encoding} : "iso-5426" ), | ||||
962 | checked => "checked", | ||||
963 | icon => $data->{icon}, | ||||
964 | zed => $data->{type} eq 'zed', | ||||
965 | opensearch => $data->{type} eq 'opensearch' | ||||
966 | }; | ||||
967 | } | ||||
968 | return \@primaryserverloop; | ||||
969 | } | ||||
970 | |||||
971 | |||||
972 | =head2 GetKohaImageurlFromAuthorisedValues | ||||
973 | |||||
- - | |||||
980 | sub GetKohaImageurlFromAuthorisedValues { | ||||
981 | my ( $category, $lib ) = @_; | ||||
982 | my $dbh = C4::Context->dbh; | ||||
983 | my $sth = $dbh->prepare("SELECT imageurl FROM authorised_values WHERE category=? AND lib =?"); | ||||
984 | $sth->execute( $category, $lib ); | ||||
985 | while ( my $data = $sth->fetchrow_hashref ) { | ||||
986 | return $data->{'imageurl'}; | ||||
987 | } | ||||
988 | } | ||||
989 | |||||
990 | =head2 GetAuthValCode | ||||
991 | |||||
- - | |||||
996 | # spent 316ms (11.1+305) within C4::Koha::GetAuthValCode which was called 148 times, avg 2.14ms/call:
# 51 times (3.74ms+105ms) by C4::Koha::GetKohaAuthorisedValues at line 1169, avg 2.13ms/call
# 32 times (2.31ms+70.8ms) by C4::Items::GetItemsInfo at line 1286 of /usr/share/koha/lib/C4/Items.pm, avg 2.29ms/call
# 32 times (2.51ms+66.4ms) by C4::Items::GetItemsInfo at line 1292 of /usr/share/koha/lib/C4/Items.pm, avg 2.15ms/call
# 32 times (2.53ms+61.1ms) by C4::Items::GetItemsInfo at line 1280 of /usr/share/koha/lib/C4/Items.pm, avg 1.99ms/call
# once (58µs+2.06ms) by C4::Search::searchResults at line 1657 of /usr/share/koha/lib/C4/Search.pm | ||||
997 | 148 | 428µs | my ($kohafield,$fwcode) = @_; | ||
998 | 148 | 913µs | 148 | 140ms | my $dbh = C4::Context->dbh; # spent 140ms making 148 calls to C4::Context::dbh, avg 944µs/call |
999 | 148 | 156µs | $fwcode='' unless $fwcode; | ||
1000 | 148 | 3.06ms | 296 | 26.4ms | my $sth = $dbh->prepare('select authorised_value from marc_subfield_structure where kohafield=? and frameworkcode=?'); # spent 14.4ms making 148 calls to DBI::db::prepare, avg 97µs/call
# spent 12.0ms making 148 calls to DBD::mysql::db::prepare, avg 81µs/call |
1001 | 148 | 148ms | 148 | 146ms | $sth->execute($kohafield,$fwcode); # spent 146ms making 148 calls to DBI::st::execute, avg 988µs/call |
1002 | 148 | 3.93ms | 148 | 2.38ms | my ($authvalcode) = $sth->fetchrow_array; # spent 2.38ms making 148 calls to DBI::st::fetchrow_array, avg 16µs/call |
1003 | 148 | 7.23ms | return $authvalcode; | ||
1004 | } | ||||
1005 | |||||
1006 | =head2 GetAuthValCodeFromField | ||||
1007 | |||||
- - | |||||
1014 | sub GetAuthValCodeFromField { | ||||
1015 | my ($field,$subfield,$fwcode) = @_; | ||||
1016 | my $dbh = C4::Context->dbh; | ||||
1017 | $fwcode='' unless $fwcode; | ||||
1018 | my $sth; | ||||
1019 | if (defined $subfield) { | ||||
1020 | $sth = $dbh->prepare('select authorised_value from marc_subfield_structure where tagfield=? and tagsubfield=? and frameworkcode=?'); | ||||
1021 | $sth->execute($field,$subfield,$fwcode); | ||||
1022 | } else { | ||||
1023 | $sth = $dbh->prepare('select authorised_value from marc_tag_structure where tagfield=? and frameworkcode=?'); | ||||
1024 | $sth->execute($field,$fwcode); | ||||
1025 | } | ||||
1026 | my ($authvalcode) = $sth->fetchrow_array; | ||||
1027 | return $authvalcode; | ||||
1028 | } | ||||
1029 | |||||
1030 | =head2 GetAuthorisedValues | ||||
1031 | |||||
- - | |||||
1042 | # spent 5.39ms (307µs+5.08) within C4::Koha::GetAuthorisedValues which was called 2 times, avg 2.69ms/call:
# 2 times (307µs+5.08ms) by Memoize::_memoizer at line 247 of Memoize.pm, avg 2.69ms/call | ||||
1043 | 2 | 3µs | my ( $category, $selected, $opac ) = @_; | ||
1044 | 2 | 11µs | 2 | 66µs | my $branch_limit = C4::Context->userenv ? C4::Context->userenv->{"branch"} : ""; # spent 66µs making 2 calls to C4::Context::userenv, avg 33µs/call |
1045 | 2 | 900ns | my @results; | ||
1046 | 2 | 9µs | 2 | 1.84ms | my $dbh = C4::Context->dbh; # spent 1.84ms making 2 calls to C4::Context::dbh, avg 920µs/call |
1047 | 2 | 2µs | my $query = qq{ | ||
1048 | SELECT * | ||||
1049 | FROM authorised_values | ||||
1050 | }; | ||||
1051 | 2 | 600ns | $query .= qq{ | ||
1052 | LEFT JOIN authorised_values_branches ON ( id = av_id ) | ||||
1053 | } if $branch_limit; | ||||
1054 | 2 | 700ns | my @where_strings; | ||
1055 | 2 | 600ns | my @where_args; | ||
1056 | 2 | 2µs | if($category) { | ||
1057 | 2 | 3µs | push @where_strings, "category = ?"; | ||
1058 | 2 | 2µs | push @where_args, $category; | ||
1059 | } | ||||
1060 | 2 | 900ns | if($branch_limit) { | ||
1061 | push @where_strings, "( branchcode = ? OR branchcode IS NULL )"; | ||||
1062 | push @where_args, $branch_limit; | ||||
1063 | } | ||||
1064 | 2 | 6µs | if(@where_strings > 0) { | ||
1065 | $query .= " WHERE " . join(" AND ", @where_strings); | ||||
1066 | } | ||||
1067 | 2 | 2µs | $query .= " GROUP BY lib ORDER BY category, lib, lib_opac"; | ||
1068 | |||||
1069 | 2 | 26µs | 4 | 242µs | my $sth = $dbh->prepare($query); # spent 132µs making 2 calls to DBI::db::prepare, avg 66µs/call
# spent 111µs making 2 calls to DBD::mysql::db::prepare, avg 55µs/call |
1070 | |||||
1071 | 2 | 2.33ms | 2 | 2.31ms | $sth->execute( @where_args ); # spent 2.31ms making 2 calls to DBI::st::execute, avg 1.16ms/call |
1072 | 2 | 802µs | 84 | 965µs | while (my $data=$sth->fetchrow_hashref) { # spent 702µs making 28 calls to DBI::st::fetchrow_hashref, avg 25µs/call
# spent 155µs making 28 calls to DBI::st::fetch, avg 6µs/call
# spent 108µs making 28 calls to DBI::common::FETCH, avg 4µs/call |
1073 | 26 | 28µs | if ( defined $selected and $selected eq $data->{authorised_value} ) { | ||
1074 | $data->{selected} = 1; | ||||
1075 | } | ||||
1076 | else { | ||||
1077 | 26 | 20µs | $data->{selected} = 0; | ||
1078 | } | ||||
1079 | |||||
1080 | 26 | 12µs | if ($opac && $data->{lib_opac}) { | ||
1081 | $data->{lib} = $data->{lib_opac}; | ||||
1082 | } | ||||
1083 | 26 | 15µs | push @results, $data; | ||
1084 | } | ||||
1085 | 2 | 15µs | 2 | 7µs | $sth->finish; # spent 7µs making 2 calls to DBI::st::finish, avg 3µs/call |
1086 | 2 | 63µs | return \@results; | ||
1087 | } | ||||
1088 | |||||
1089 | =head2 GetAuthorisedValueCategories | ||||
1090 | |||||
- - | |||||
1098 | sub GetAuthorisedValueCategories { | ||||
1099 | my $dbh = C4::Context->dbh; | ||||
1100 | my $sth = $dbh->prepare("SELECT DISTINCT category FROM authorised_values ORDER BY category"); | ||||
1101 | $sth->execute; | ||||
1102 | my @results; | ||||
1103 | while (defined (my $category = $sth->fetchrow_array) ) { | ||||
1104 | push @results, $category; | ||||
1105 | } | ||||
1106 | return \@results; | ||||
1107 | } | ||||
1108 | |||||
1109 | =head2 IsAuthorisedValueCategory | ||||
1110 | |||||
- - | |||||
1117 | sub IsAuthorisedValueCategory { | ||||
1118 | my $category = shift; | ||||
1119 | my $query = ' | ||||
1120 | SELECT category | ||||
1121 | FROM authorised_values | ||||
1122 | WHERE BINARY category=? | ||||
1123 | LIMIT 1 | ||||
1124 | '; | ||||
1125 | my $sth = C4::Context->dbh->prepare($query); | ||||
1126 | $sth->execute($category); | ||||
1127 | $sth->fetchrow ? return 1 | ||||
1128 | : return 0; | ||||
1129 | } | ||||
1130 | |||||
1131 | =head2 GetAuthorisedValueByCode | ||||
1132 | |||||
- - | |||||
1140 | sub GetAuthorisedValueByCode { | ||||
1141 | my ( $category, $authvalcode, $opac ) = @_; | ||||
1142 | |||||
1143 | my $field = $opac ? 'lib_opac' : 'lib'; | ||||
1144 | my $dbh = C4::Context->dbh; | ||||
1145 | my $sth = $dbh->prepare("SELECT $field FROM authorised_values WHERE category=? AND authorised_value =?"); | ||||
1146 | $sth->execute( $category, $authvalcode ); | ||||
1147 | while ( my $data = $sth->fetchrow_hashref ) { | ||||
1148 | return $data->{ $field }; | ||||
1149 | } | ||||
1150 | } | ||||
1151 | |||||
1152 | =head2 GetKohaAuthorisedValues | ||||
1153 | |||||
- - | |||||
1164 | # spent 226ms (8.52+218) within C4::Koha::GetKohaAuthorisedValues which was called 51 times, avg 4.44ms/call:
# 25 times (5.72ms+109ms) by C4::XSLT::buildKohaItemsNamespace at line 254 of /usr/share/koha/lib/C4/XSLT.pm, avg 4.60ms/call
# 25 times (2.64ms+104ms) by C4::XSLT::buildKohaItemsNamespace at line 255 of /usr/share/koha/lib/C4/XSLT.pm, avg 4.27ms/call
# once (164µs+4.42ms) by C4::Search::searchResults at line 1654 of /usr/share/koha/lib/C4/Search.pm | ||||
1165 | 51 | 198µs | my ($kohafield,$fwcode,$opac) = @_; | ||
1166 | 51 | 30µs | $fwcode='' unless $fwcode; | ||
1167 | 51 | 26µs | my %values; | ||
1168 | 51 | 398µs | 51 | 48.1ms | my $dbh = C4::Context->dbh; # spent 48.1ms making 51 calls to C4::Context::dbh, avg 943µs/call |
1169 | 51 | 415µs | 204 | 110ms | my $avcode = GetAuthValCode($kohafield,$fwcode); # spent 109ms making 51 calls to C4::Koha::GetAuthValCode, avg 2.13ms/call
# spent 672µs making 102 calls to DBI::common::DESTROY, avg 7µs/call
# spent 192µs making 51 calls to DBD::_mem::common::DESTROY, avg 4µs/call |
1170 | 51 | 52µs | if ($avcode) { | ||
1171 | 51 | 738µs | 102 | 7.57ms | my $sth = $dbh->prepare("select authorised_value, lib, lib_opac from authorised_values where category=? "); # spent 4.07ms making 51 calls to DBI::db::prepare, avg 80µs/call
# spent 3.50ms making 51 calls to DBD::mysql::db::prepare, avg 69µs/call |
1172 | 51 | 52.3ms | 51 | 51.6ms | $sth->execute($avcode); # spent 51.6ms making 51 calls to DBI::st::execute, avg 1.01ms/call |
1173 | 51 | 9.23ms | 724 | 4.50ms | while ( my ($val, $lib, $lib_opac) = $sth->fetchrow_array ) { # spent 4.50ms making 724 calls to DBI::st::fetchrow_array, avg 6µs/call |
1174 | $values{$val} = ($opac && $lib_opac) ? $lib_opac : $lib; | ||||
1175 | } | ||||
1176 | 51 | 2.30ms | return \%values; | ||
1177 | } else { | ||||
1178 | return; | ||||
1179 | } | ||||
1180 | } | ||||
1181 | |||||
1182 | =head2 GetKohaAuthorisedValuesFromField | ||||
1183 | |||||
- - | |||||
1195 | sub GetKohaAuthorisedValuesFromField { | ||||
1196 | my ($field, $subfield, $fwcode,$opac) = @_; | ||||
1197 | $fwcode='' unless $fwcode; | ||||
1198 | my %values; | ||||
1199 | my $dbh = C4::Context->dbh; | ||||
1200 | my $avcode = GetAuthValCodeFromField($field, $subfield, $fwcode); | ||||
1201 | if ($avcode) { | ||||
1202 | my $sth = $dbh->prepare("select authorised_value, lib, lib_opac from authorised_values where category=? "); | ||||
1203 | $sth->execute($avcode); | ||||
1204 | while ( my ($val, $lib, $lib_opac) = $sth->fetchrow_array ) { | ||||
1205 | $values{$val} = ($opac && $lib_opac) ? $lib_opac : $lib; | ||||
1206 | } | ||||
1207 | return \%values; | ||||
1208 | } else { | ||||
1209 | return; | ||||
1210 | } | ||||
1211 | } | ||||
1212 | |||||
1213 | =head2 xml_escape | ||||
1214 | |||||
- - | |||||
1221 | # spent 2.26ms (1.76+497µs) within C4::Koha::xml_escape which was called 114 times, avg 20µs/call:
# 32 times (804µs+276µs) by C4::XSLT::buildKohaItemsNamespace at line 298 of /usr/share/koha/lib/C4/XSLT.pm, avg 34µs/call
# 32 times (419µs+107µs) by C4::XSLT::buildKohaItemsNamespace at line 299 of /usr/share/koha/lib/C4/XSLT.pm, avg 16µs/call
# 32 times (305µs+71µs) by C4::XSLT::buildKohaItemsNamespace at line 302 of /usr/share/koha/lib/C4/XSLT.pm, avg 12µs/call
# 17 times (225µs+41µs) by C4::XSLT::buildKohaItemsNamespace at line 300 of /usr/share/koha/lib/C4/XSLT.pm, avg 16µs/call
# once (9µs+1µs) by C4::XSLT::buildKohaItemsNamespace at line 301 of /usr/share/koha/lib/C4/XSLT.pm | ||||
1222 | 114 | 113µs | my $str = shift; | ||
1223 | 114 | 86µs | return '' unless defined $str; | ||
1224 | 102 | 576µs | 102 | 236µs | $str =~ s/&/&/g; # spent 236µs making 102 calls to C4::Koha::CORE:subst, avg 2µs/call |
1225 | 102 | 268µs | 102 | 60µs | $str =~ s/</</g; # spent 60µs making 102 calls to C4::Koha::CORE:subst, avg 591ns/call |
1226 | 102 | 273µs | 102 | 84µs | $str =~ s/>/>/g; # spent 84µs making 102 calls to C4::Koha::CORE:subst, avg 825ns/call |
1227 | 102 | 263µs | 102 | 58µs | $str =~ s/'/'/g; # spent 58µs making 102 calls to C4::Koha::CORE:subst, avg 568ns/call |
1228 | 102 | 250µs | 102 | 59µs | $str =~ s/"/"/g; # spent 59µs making 102 calls to C4::Koha::CORE:subst, avg 578ns/call |
1229 | 102 | 433µs | return $str; | ||
1230 | } | ||||
1231 | |||||
1232 | =head2 GetKohaAuthorisedValueLib | ||||
1233 | |||||
- - | |||||
1242 | # spent 315ms (9.40+305) within C4::Koha::GetKohaAuthorisedValueLib which was called 143 times, avg 2.20ms/call:
# 32 times (2.07ms+70.1ms) by C4::Items::GetItemsInfo at line 1288 of /usr/share/koha/lib/C4/Items.pm, avg 2.26ms/call
# 32 times (2.16ms+68.8ms) by C4::Items::GetItemsInfo at line 1281 of /usr/share/koha/lib/C4/Items.pm, avg 2.22ms/call
# 32 times (2.09ms+67.9ms) by C4::Items::GetItemsInfo at line 1287 of /usr/share/koha/lib/C4/Items.pm, avg 2.19ms/call
# 32 times (2.11ms+67.4ms) by C4::Items::GetItemsInfo at line 1282 of /usr/share/koha/lib/C4/Items.pm, avg 2.17ms/call
# 15 times (963µs+31.1ms) by C4::Items::GetItemsInfo at line 1292 of /usr/share/koha/lib/C4/Items.pm, avg 2.14ms/call | ||||
1243 | 143 | 284µs | my ($category,$authorised_value,$opac) = @_; | ||
1244 | 143 | 46µs | my $value; | ||
1245 | 143 | 877µs | 143 | 134ms | my $dbh = C4::Context->dbh; # spent 134ms making 143 calls to C4::Context::dbh, avg 937µs/call |
1246 | 143 | 3.06ms | 286 | 26.4ms | my $sth = $dbh->prepare("select lib, lib_opac from authorised_values where category=? and authorised_value=?"); # spent 14.3ms making 143 calls to DBI::db::prepare, avg 100µs/call
# spent 12.1ms making 143 calls to DBD::mysql::db::prepare, avg 84µs/call |
1247 | 143 | 150ms | 143 | 148ms | $sth->execute($category,$authorised_value); # spent 148ms making 143 calls to DBI::st::execute, avg 1.04ms/call |
1248 | 143 | 7.62ms | 429 | 9.61ms | my $data = $sth->fetchrow_hashref; # spent 6.69ms making 143 calls to DBI::st::fetchrow_hashref, avg 47µs/call
# spent 1.65ms making 143 calls to DBI::common::FETCH, avg 12µs/call
# spent 1.27ms making 143 calls to DBI::st::fetch, avg 9µs/call |
1249 | 143 | 413µs | $value = ($opac && $$data{'lib_opac'}) ? $$data{'lib_opac'} : $$data{'lib'}; | ||
1250 | 143 | 5.62ms | return $value; | ||
1251 | } | ||||
1252 | |||||
1253 | =head2 AddAuthorisedValue | ||||
1254 | |||||
- - | |||||
1261 | sub AddAuthorisedValue { | ||||
1262 | my ($category, $authorised_value, $lib, $lib_opac, $imageurl) = @_; | ||||
1263 | |||||
1264 | my $dbh = C4::Context->dbh; | ||||
1265 | my $query = qq{ | ||||
1266 | INSERT INTO authorised_values (category, authorised_value, lib, lib_opac, imageurl) | ||||
1267 | VALUES (?,?,?,?,?) | ||||
1268 | }; | ||||
1269 | my $sth = $dbh->prepare($query); | ||||
1270 | $sth->execute($category, $authorised_value, $lib, $lib_opac, $imageurl); | ||||
1271 | } | ||||
1272 | |||||
1273 | =head2 display_marc_indicators | ||||
1274 | |||||
- - | |||||
1284 | sub display_marc_indicators { | ||||
1285 | my $field = shift; | ||||
1286 | my $indicators = ''; | ||||
1287 | if ($field->tag() >= 10) { | ||||
1288 | $indicators = $field->indicator(1) . $field->indicator(2); | ||||
1289 | $indicators =~ s/ /#/g; | ||||
1290 | } | ||||
1291 | return $indicators; | ||||
1292 | } | ||||
1293 | |||||
1294 | # spent 9.42ms (722µs+8.70) within C4::Koha::GetNormalizedUPC which was called 25 times, avg 377µs/call:
# 25 times (722µs+8.70ms) by C4::Search::searchResults at line 1717 of /usr/share/koha/lib/C4/Search.pm, avg 377µs/call | ||||
1295 | 25 | 58µs | my ($record,$marcflavour) = @_; | ||
1296 | 25 | 37µs | my (@fields,$upc); | ||
1297 | |||||
1298 | 25 | 123µs | if ($marcflavour eq 'UNIMARC') { | ||
1299 | @fields = $record->field('072'); | ||||
1300 | foreach my $field (@fields) { | ||||
1301 | my $upc = _normalize_match_point($field->subfield('a')); | ||||
1302 | if ($upc ne '') { | ||||
1303 | return $upc; | ||||
1304 | } | ||||
1305 | } | ||||
1306 | |||||
1307 | } | ||||
1308 | else { # assume marc21 if not unimarc | ||||
1309 | 25 | 203µs | 25 | 8.17ms | @fields = $record->field('024'); # spent 8.17ms making 25 calls to MARC::Record::field, avg 327µs/call |
1310 | 25 | 50µs | foreach my $field (@fields) { | ||
1311 | 10 | 50µs | 10 | 164µs | my $indicator = $field->indicator(1); # spent 164µs making 10 calls to MARC::Field::indicator, avg 16µs/call |
1312 | 10 | 77µs | 20 | 364µs | my $upc = _normalize_match_point($field->subfield('a')); # spent 193µs making 10 calls to C4::Koha::_normalize_match_point, avg 19µs/call
# spent 170µs making 10 calls to MARC::Field::subfield, avg 17µs/call |
1313 | 10 | 55µs | if ($indicator == 1 and $upc ne '') { | ||
1314 | return $upc; | ||||
1315 | } | ||||
1316 | } | ||||
1317 | } | ||||
1318 | } | ||||
1319 | |||||
1320 | # Normalizes and returns the first valid ISBN found in the record | ||||
1321 | # ISBN13 are converted into ISBN10. This is required to get some book cover images. | ||||
1322 | # spent 6.83ms (370µs+6.46) within C4::Koha::GetNormalizedISBN which was called 25 times, avg 273µs/call:
# 25 times (370µs+6.46ms) by C4::Search::searchResults at line 1720 of /usr/share/koha/lib/C4/Search.pm, avg 273µs/call | ||||
1323 | 25 | 41µs | my ($isbn,$record,$marcflavour) = @_; | ||
1324 | 25 | 10µs | my @fields; | ||
1325 | 25 | 16µs | if ($isbn) { | ||
1326 | # Koha attempts to store multiple ISBNs in biblioitems.isbn, separated by " | " | ||||
1327 | # anything after " | " should be removed, along with the delimiter | ||||
1328 | $isbn =~ s/(.*)( \| )(.*)/$1/; | ||||
1329 | return _isbn_cleanup($isbn); | ||||
1330 | } | ||||
1331 | 25 | 10µs | return unless $record; | ||
1332 | |||||
1333 | 25 | 125µs | if ($marcflavour eq 'UNIMARC') { | ||
1334 | @fields = $record->field('010'); | ||||
1335 | foreach my $field (@fields) { | ||||
1336 | my $isbn = $field->subfield('a'); | ||||
1337 | if ($isbn) { | ||||
1338 | return _isbn_cleanup($isbn); | ||||
1339 | } else { | ||||
1340 | return; | ||||
1341 | } | ||||
1342 | } | ||||
1343 | } | ||||
1344 | else { # assume marc21 if not unimarc | ||||
1345 | 25 | 95µs | 25 | 6.46ms | @fields = $record->field('020'); # spent 6.46ms making 25 calls to MARC::Record::field, avg 259µs/call |
1346 | 25 | 45µs | foreach my $field (@fields) { | ||
1347 | $isbn = $field->subfield('a'); | ||||
1348 | if ($isbn) { | ||||
1349 | return _isbn_cleanup($isbn); | ||||
1350 | } else { | ||||
1351 | return; | ||||
1352 | } | ||||
1353 | } | ||||
1354 | } | ||||
1355 | } | ||||
1356 | |||||
1357 | # spent 7.21ms (540µs+6.67) within C4::Koha::GetNormalizedEAN which was called 25 times, avg 289µs/call:
# 25 times (540µs+6.67ms) by C4::Search::searchResults at line 1718 of /usr/share/koha/lib/C4/Search.pm, avg 289µs/call | ||||
1358 | 25 | 38µs | my ($record,$marcflavour) = @_; | ||
1359 | 25 | 24µs | my (@fields,$ean); | ||
1360 | |||||
1361 | 25 | 119µs | if ($marcflavour eq 'UNIMARC') { | ||
1362 | @fields = $record->field('073'); | ||||
1363 | foreach my $field (@fields) { | ||||
1364 | $ean = _normalize_match_point($field->subfield('a')); | ||||
1365 | if ($ean ne '') { | ||||
1366 | return $ean; | ||||
1367 | } | ||||
1368 | } | ||||
1369 | } | ||||
1370 | else { # assume marc21 if not unimarc | ||||
1371 | 25 | 95µs | 25 | 6.30ms | @fields = $record->field('024'); # spent 6.30ms making 25 calls to MARC::Record::field, avg 252µs/call |
1372 | 25 | 43µs | foreach my $field (@fields) { | ||
1373 | 10 | 33µs | 10 | 80µs | my $indicator = $field->indicator(1); # spent 80µs making 10 calls to MARC::Field::indicator, avg 8µs/call |
1374 | 10 | 61µs | 20 | 293µs | $ean = _normalize_match_point($field->subfield('a')); # spent 155µs making 10 calls to MARC::Field::subfield, avg 16µs/call
# spent 137µs making 10 calls to C4::Koha::_normalize_match_point, avg 14µs/call |
1375 | 10 | 37µs | if ($indicator == 3 and $ean ne '') { | ||
1376 | return $ean; | ||||
1377 | } | ||||
1378 | } | ||||
1379 | } | ||||
1380 | } | ||||
1381 | # spent 7.71ms (595µs+7.11) within C4::Koha::GetNormalizedOCLCNumber which was called 25 times, avg 308µs/call:
# 25 times (595µs+7.11ms) by C4::Search::searchResults at line 1719 of /usr/share/koha/lib/C4/Search.pm, avg 308µs/call | ||||
1382 | 25 | 34µs | my ($record,$marcflavour) = @_; | ||
1383 | 25 | 20µs | my (@fields,$oclc); | ||
1384 | |||||
1385 | 25 | 26µs | if ($marcflavour eq 'UNIMARC') { | ||
1386 | # TODO: add UNIMARC fields | ||||
1387 | } | ||||
1388 | else { # assume marc21 if not unimarc | ||||
1389 | 25 | 90µs | 25 | 6.47ms | @fields = $record->field('035'); # spent 6.47ms making 25 calls to MARC::Record::field, avg 259µs/call |
1390 | 25 | 37µs | foreach my $field (@fields) { | ||
1391 | 25 | 120µs | 25 | 587µs | $oclc = $field->subfield('a'); # spent 587µs making 25 calls to MARC::Field::subfield, avg 23µs/call |
1392 | 25 | 140µs | 25 | 57µs | if ($oclc =~ /OCoLC/) { # spent 57µs making 25 calls to C4::Koha::CORE:match, avg 2µs/call |
1393 | $oclc =~ s/\(OCoLC\)//; | ||||
1394 | return $oclc; | ||||
1395 | } else { | ||||
1396 | 25 | 103µs | return; | ||
1397 | } | ||||
1398 | } | ||||
1399 | } | ||||
1400 | } | ||||
1401 | |||||
1402 | =head2 GetDailyQuote($opts) | ||||
1403 | |||||
- - | |||||
1423 | # This is definitely a candidate for some sort of caching once we finally settle caching/persistence issues... | ||||
1424 | # at least for default option | ||||
1425 | |||||
1426 | sub GetDailyQuote { | ||||
1427 | my %opts = @_; | ||||
1428 | my $dbh = C4::Context->dbh; | ||||
1429 | my $query = ''; | ||||
1430 | my $sth = undef; | ||||
1431 | my $quote = undef; | ||||
1432 | if ($opts{'id'}) { | ||||
1433 | $query = 'SELECT * FROM quotes WHERE id = ?'; | ||||
1434 | $sth = $dbh->prepare($query); | ||||
1435 | $sth->execute($opts{'id'}); | ||||
1436 | $quote = $sth->fetchrow_hashref(); | ||||
1437 | } | ||||
1438 | elsif ($opts{'random'}) { | ||||
1439 | # Fall through... we also return a random quote as a catch-all if all else fails | ||||
1440 | } | ||||
1441 | else { | ||||
1442 | $query = 'SELECT * FROM quotes WHERE timestamp LIKE CONCAT(CURRENT_DATE,\'%\') ORDER BY timestamp DESC LIMIT 0,1'; | ||||
1443 | $sth = $dbh->prepare($query); | ||||
1444 | $sth->execute(); | ||||
1445 | $quote = $sth->fetchrow_hashref(); | ||||
1446 | } | ||||
1447 | unless ($quote) { # if there are not matches, choose a random quote | ||||
1448 | # get a list of all available quote ids | ||||
1449 | $sth = C4::Context->dbh->prepare('SELECT count(*) FROM quotes;'); | ||||
1450 | $sth->execute; | ||||
1451 | my $range = ($sth->fetchrow_array)[0]; | ||||
1452 | if ($range > 1) { | ||||
1453 | # chose a random id within that range if there is more than one quote | ||||
1454 | my $id = int(rand($range)); | ||||
1455 | # grab it | ||||
1456 | $query = 'SELECT * FROM quotes WHERE id = ?;'; | ||||
1457 | $sth = C4::Context->dbh->prepare($query); | ||||
1458 | $sth->execute($id); | ||||
1459 | } | ||||
1460 | else { | ||||
1461 | $query = 'SELECT * FROM quotes;'; | ||||
1462 | $sth = C4::Context->dbh->prepare($query); | ||||
1463 | $sth->execute(); | ||||
1464 | } | ||||
1465 | $quote = $sth->fetchrow_hashref(); | ||||
1466 | # update the timestamp for that quote | ||||
1467 | $query = 'UPDATE quotes SET timestamp = ? WHERE id = ?'; | ||||
1468 | $sth = C4::Context->dbh->prepare($query); | ||||
1469 | $sth->execute(DateTime::Format::MySQL->format_datetime(DateTime->now), $quote->{'id'}); | ||||
1470 | } | ||||
1471 | return $quote; | ||||
1472 | } | ||||
1473 | |||||
1474 | sub _normalize_match_point { | ||||
1475 | 20 | 16µs | my $match_point = shift; | ||
1476 | 20 | 164µs | 20 | 80µs | (my $normalized_match_point) = $match_point =~ /([\d-]*[X]*)/; # spent 80µs making 20 calls to C4::Koha::CORE:match, avg 4µs/call |
1477 | 20 | 84µs | 20 | 15µs | $normalized_match_point =~ s/-//g; # spent 15µs making 20 calls to C4::Koha::CORE:subst, avg 770ns/call |
1478 | |||||
1479 | 20 | 80µs | return $normalized_match_point; | ||
1480 | } | ||||
1481 | |||||
1482 | sub _isbn_cleanup { | ||||
1483 | require Business::ISBN; | ||||
1484 | my $isbn = Business::ISBN->new( $_[0] ); | ||||
1485 | if ( $isbn ) { | ||||
1486 | $isbn = $isbn->as_isbn10 if $isbn->type eq 'ISBN13'; | ||||
1487 | if (defined $isbn) { | ||||
1488 | return $isbn->as_string([]); | ||||
1489 | } | ||||
1490 | } | ||||
1491 | return; | ||||
1492 | } | ||||
1493 | |||||
1494 | 1 | 4µs | 1; | ||
1495 | |||||
1496 | __END__ | ||||
sub C4::Koha::CORE:match; # opcode | |||||
# spent 513µs within C4::Koha::CORE:subst which was called 530 times, avg 967ns/call:
# 102 times (236µs+0s) by C4::Koha::xml_escape at line 1224, avg 2µs/call
# 102 times (84µs+0s) by C4::Koha::xml_escape at line 1226, avg 825ns/call
# 102 times (60µs+0s) by C4::Koha::xml_escape at line 1225, avg 591ns/call
# 102 times (59µs+0s) by C4::Koha::xml_escape at line 1228, avg 578ns/call
# 102 times (58µs+0s) by C4::Koha::xml_escape at line 1227, avg 568ns/call
# 20 times (15µs+0s) by C4::Koha::_normalize_match_point at line 1477, avg 770ns/call |