Bugzilla – Attachment 11163 Details for
Bug 7919
Display of values depending on the connexion library (authorised values, patron categories, extended attributes)
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 7919: Followup: using LEFT JOIN instead of JOIN for 2 files
Bug-7919-Followup-using-LEFT-JOIN-instead-of-JOIN-.patch (text/plain), 3.29 KB, created by
Jonathan Druart
on 2012-07-27 12:24:24 UTC
(
hide
)
Description:
Bug 7919: Followup: using LEFT JOIN instead of JOIN for 2 files
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2012-07-27 12:24:24 UTC
Size:
3.29 KB
patch
obsolete
>From 8556cb5076b072cf4fef0752846358545635f330 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Fri, 27 Jul 2012 14:24:02 +0200 >Subject: [PATCH] Bug 7919: Followup: using LEFT JOIN instead of JOIN for 2 > files > >--- > cataloguing/addbiblio.pl | 5 +++-- > tools/batchMod.pl | 14 +++++++------- > 2 files changed, 10 insertions(+), 9 deletions(-) > >diff --git a/cataloguing/addbiblio.pl b/cataloguing/addbiblio.pl >index 7fe8975..89eb66c 100755 >--- a/cataloguing/addbiblio.pl >+++ b/cataloguing/addbiblio.pl >@@ -221,8 +221,8 @@ sub build_authorized_values_list { > else { > my $branch_limit = C4::Context->userenv ? C4::Context->userenv->{"branch"} : ""; > $authorised_values_sth->execute( >+ $tagslib->{$tag}->{$subfield}->{authorised_value}, > $branch_limit ? $branch_limit : (), >- $tagslib->{$tag}->{$subfield}->{authorised_value} > ); > > push @authorised_values, "" >@@ -528,8 +528,9 @@ sub build_tabs { > my $branch_limit = C4::Context->userenv ? C4::Context->userenv->{"branch"} : ""; > my $query = "SELECT authorised_value, lib > FROM authorised_values"; >- $query .= qq{ JOIN authorised_values_branches ON ( id = av_id AND ( branchcode = ? OR branchcode IS NULL ) )} if $branch_limit; >+ $query .= qq{ LEFT JOIN authorised_values_branches ON ( id = av_id )} if $branch_limit; > $query .= " WHERE category = ?"; >+ $query .= " AND ( branchcode = ? OR branchcode IS NULL )" if $branch_limit; > $query .= " GROUP BY lib ORDER BY lib, lib_opac"; > my $authorised_values_sth = $dbh->prepare( $query ); > >diff --git a/tools/batchMod.pl b/tools/batchMod.pl >index 90e1a0b..bd52e94 100755 >--- a/tools/batchMod.pl >+++ b/tools/batchMod.pl >@@ -265,12 +265,12 @@ if ($op eq "show"){ > # now, build the item form for entering a new item > my @loop_data =(); > my $i=0; >-my $query = qq{ >- SELECT authorised_value, lib FROM authorised_values >- JOIN authorised_values_branches ON ( id = av_id AND ( branchcode = ? OR branchcode IS NULL ) ) >- WHERE category = ? >- GROUP BY lib ORDER BY lib, lib_opac >-}; >+my $branch_limit = C4::Context->userenv ? C4::Context->userenv->{"branch"} : ""; >+my $query = qq{SELECT authorised_value, lib FROM authorised_values}; >+$query .= qq{ LEFT JOIN authorised_values_branches ON ( id = av_id ) } if $branch_limit; >+$query .= qq{ WHERE category = ?}; >+$query .= qq{ AND ( branchcode = ? OR branchcode IS NULL ) } if $branch_limit; >+$query .= qq{ GROUP BY lib ORDER BY lib, lib_opac}; > my $authorised_values_sth = $dbh->prepare( $query ); > > my $branches = GetBranchesLoop(); # build once ahead of time, instead of multiple times later. >@@ -364,7 +364,7 @@ foreach my $tag (sort keys %{$tagslib}) { > } > else { > push @authorised_values, ""; # unless ( $tagslib->{$tag}->{$subfield}->{mandatory} ); >- $authorised_values_sth->execute( C4::Context->userenv ? C4::Context->userenv->{"branch"} : "", $tagslib->{$tag}->{$subfield}->{authorised_value} ); >+ $authorised_values_sth->execute( $tagslib->{$tag}->{$subfield}->{authorised_value}, $branch_limit ? $branch_limit : () ); > while ( my ( $value, $lib ) = $authorised_values_sth->fetchrow_array ) { > push @authorised_values, $value; > $authorised_lib{$value} = $lib; >-- >1.7.7.3
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 7919
:
8939
|
9170
|
9973
|
9984
|
10424
|
11163
|
11168
|
11373
|
11751
|
13736
|
13862
|
13867
|
13868
|
13891
|
13901
|
13952
|
13953
|
14162
|
14163
|
14184
|
14287
|
14350
|
14372
|
14377