Bugzilla – Attachment 38472 Details for
Bug 14057
Inventory is painfully slow
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14057 - A Rough Start
Bug-14057---A-Rough-Start.patch (text/plain), 2.04 KB, created by
Mark Tompsett
on 2015-04-24 04:43:04 UTC
(
hide
)
Description:
Bug 14057 - A Rough Start
Filename:
MIME Type:
Creator:
Mark Tompsett
Created:
2015-04-24 04:43:04 UTC
Size:
2.04 KB
patch
obsolete
>From 9ea296c31c9f7983c758bf93e6247bfcd0790643 Mon Sep 17 00:00:00 2001 >From: Mark Tompsett <mtompset@hotmail.com> >Date: Fri, 24 Apr 2015 00:40:46 -0400 >Subject: [PATCH] Bug 14057 - A Rough Start > >This patch is a rough start. I believe it runs exponentially >faster, but its equality to the previous version needs to be >tested before I clean it up to acceptable standards. >--- > C4/Items.pm | 16 ++++++++++------ > 1 file changed, 10 insertions(+), 6 deletions(-) > >diff --git a/C4/Items.pm b/C4/Items.pm >index f443d38..6021c85 100644 >--- a/C4/Items.pm >+++ b/C4/Items.pm >@@ -1120,16 +1120,20 @@ sub GetItemsForInventory { > $sth->execute( @bind_params ); > my ($iTotalRecords) = $sth->fetchrow_array(); > >+ my $query_mapping = "select TA.kohafield,TA.authorised_value AS category,TA.frameworkcode,TB.authorised_value,IF(TB.lib_opac>'',TB.lib_opac,TB.lib) AS OPAC,TB.lib AS Intranet,TB.lib_opac from marc_subfield_structure as TA JOIN authorised_values as TB ON TA.authorised_value=TB.category where TA.kohafield>'' and TA.authorised_value>''"; >+ $sth = $dbh->prepare($query_mapping); >+ $sth->execute(); >+ my $avmapping; >+ while (my $row = $sth->fetchrow_hashref) { >+ $avmapping->{$row->{kohafield}}->{$row->{frameworkcode}}->{$row->{authorised_value}} = $row->{OPAC}; >+ } >+ > foreach my $row (@$tmpresults) { > > # Auth values > foreach (keys %$row) { >- # If the koha field is mapped to a marc field >- my ($f, $sf) = GetMarcFromKohaField("items.$_", $row->{'frameworkcode'}); >- if ($f and $sf) { >- # We replace the code with it's description >- my $authvals = C4::Koha::GetKohaAuthorisedValuesFromField($f, $sf, $row->{'frameworkcode'}); >- $row->{$_} = $authvals->{$row->{$_}} if defined $authvals->{$row->{$_}}; >+ if (defined($avmapping->{"items.$_"}->{$row->{'frameworkcode'}}->{$row->{$_}})) { >+ $row->{$_} = $avmapping->{"items.$_"}->{$row->{'frameworkcode'}}->{$row->{$_}}; > } > } > push @results, $row; >-- >1.9.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 14057
:
38472
|
38482
|
38483
|
38500
|
38506
|
38507
|
38525
|
38621
|
38622
|
38636
|
38733