Bugzilla – Attachment 5495 Details for
Bug 6673
Create Batch Label from Staged MARC Records fails after upgrade to 3.4.x
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Expanded patch
0001-Bug-6733-change-branchcode-call-in-Labels-to-use-use.patch (text/plain), 4.04 KB, created by
Ian Walls
on 2011-09-21 15:13:40 UTC
(
hide
)
Description:
Expanded patch
Filename:
MIME Type:
Creator:
Ian Walls
Created:
2011-09-21 15:13:40 UTC
Size:
4.04 KB
patch
obsolete
>From 9748c796d08ddee8f6ad38c477db9616fb7cc94e Mon Sep 17 00:00:00 2001 >From: Ian Walls <ian.walls@bywatersolutions.com> >Date: Wed, 21 Sep 2011 11:08:33 -0400 >Subject: [PATCH] Bug 6733: change branchcode call in Labels to use userenv instead of LoginBranchname > >In the 5 places in the label editor, the user's current branch is determined by taking >the LoginBranchname and doing a reverse look up for the branchcode. This is an unnecessary >query, since C4::Context->userenv has the immediate access to the branchcode; this is how >it's summoned in all other points in the Koha code. > >This addresses bug 6673 because, since the move to T:T, the call in tools/manage-marc-import.pl >has used in correct syntax: $template->param('LoginBranchname') instead of $template->{VARS}->param('LoginBranchname') >--- > labels/label-edit-batch.pl | 2 +- > labels/label-manage.pl | 2 +- > patroncards/edit-batch.pl | 2 +- > patroncards/manage.pl | 2 +- > tools/manage-marc-import.pl | 2 +- > 5 files changed, 5 insertions(+), 5 deletions(-) > >diff --git a/labels/label-edit-batch.pl b/labels/label-edit-batch.pl >index 29d2dd3..8740c57 100755 >--- a/labels/label-edit-batch.pl >+++ b/labels/label-edit-batch.pl >@@ -61,7 +61,7 @@ my @label_ids = $cgi->param('label_id') if $cgi->param('label_id'); > my @item_numbers = $cgi->param('item_number') if $cgi->param('item_number'); > my $barcode = $cgi->param('barcode') if $cgi->param('barcode'); > >-my $branch_code = get_branch_code_from_name($template->{VARS}->{'LoginBranchname'}); >+my $branch_code = C4::Context->userenv->{'branch'}; > > if ($op eq 'remove') { > $batch = C4::Labels::Batch->retrieve(batch_id => $batch_id); >diff --git a/labels/label-manage.pl b/labels/label-manage.pl >index 70302e8..c70ea6c 100755 >--- a/labels/label-manage.pl >+++ b/labels/label-manage.pl >@@ -74,7 +74,7 @@ my $op = $cgi->param('op') || 'none'; > my $element_id = $cgi->param('element_id') || undef; > my $error = $cgi->param('error') || 0; > >-my $branch_code = ($label_element eq 'batch' ? get_branch_code_from_name($template->{VARS}->{'LoginBranchname'}) : ''); >+my $branch_code = ($label_element eq 'batch' ? C4::Context->userenv->{'branch'} : ''); > > if ($op eq 'delete') { > if ($label_element eq 'layout') {$error = C4::Labels::Layout::delete(layout_id => $element_id);} >diff --git a/patroncards/edit-batch.pl b/patroncards/edit-batch.pl >index 50bbbf4..fb0abf5 100755 >--- a/patroncards/edit-batch.pl >+++ b/patroncards/edit-batch.pl >@@ -60,7 +60,7 @@ my @item_numbers = $cgi->param('item_number') if $cgi->param('item_number'); > my @borrower_numbers = $cgi->param('borrower_number') if $cgi->param('borrower_number'); > my $errstr = $cgi->param('error') || ''; > >-my $branch_code = get_branch_code_from_name($template->{VARS}->{'LoginBranchname'}); >+my $branch_code = C4::Context->userenv->{'branch'}; > > if ($op eq 'remove') { > $batch = C4::Patroncards::Batch->retrieve(batch_id => $batch_id); >diff --git a/patroncards/manage.pl b/patroncards/manage.pl >index 71e1b82..46361cc 100755 >--- a/patroncards/manage.pl >+++ b/patroncards/manage.pl >@@ -73,7 +73,7 @@ my $display_columns = { layout => [ # db column => {col label > }; > > my $errstr = ($cgi->param('error') ? $cgi->param('error') : ''); >-my $branch_code = ($card_element eq 'batch' ? get_branch_code_from_name($template->{VARS}->{'LoginBranchname'}) : ''); >+my $branch_code = ($card_element eq 'batch' ? C4::Context->userenv->{'branch'} : ''); > > if ($op eq 'delete') { > my $err = 0; >diff --git a/tools/manage-marc-import.pl b/tools/manage-marc-import.pl >index 3c43dab..34d2639 100755 >--- a/tools/manage-marc-import.pl >+++ b/tools/manage-marc-import.pl >@@ -189,7 +189,7 @@ sub redo_matching { > sub create_labelbatch_from_importbatch { > my ($batch_id) = @_; > my $err = undef; >- my $branch_code = get_branch_code_from_name($template->param('LoginBranchname')); >+ my $branch_code = C4::Context->userenv->{'branch'}; > my $batch = C4::Labels::Batch->new(branch_code => $branch_code); > my @items = GetItemNumbersFromImportBatch($batch_id); > if (grep{$_ == 0} @items) { >-- >1.7.4 >
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 6673
:
4869
|
4874
|
5495
|
5620