Bugzilla – Attachment 25904 Details for
Bug 766
Omnibus: Use of CGI::scrolling_list prevents customization in template
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 766: Move GetAuthvalueDropbox to C4::Koha
Bug-766-Move-GetAuthvalueDropbox-to-C4Koha.patch (text/plain), 3.82 KB, created by
Jonathan Druart
on 2014-03-06 16:14:46 UTC
(
hide
)
Description:
Bug 766: Move GetAuthvalueDropbox to C4::Koha
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2014-03-06 16:14:46 UTC
Size:
3.82 KB
patch
obsolete
>From aecdc8280adfea4f1058b9586ab083aa6001c598 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@biblibre.com> >Date: Thu, 6 Mar 2014 17:05:53 +0100 >Subject: [PATCH] Bug 766: Move GetAuthvalueDropbox to C4::Koha > >GetAuthvalueDropbox is in C4::Budgets, this does not make sense. >Only acqui/fetch_sort_dropbox.pl call GetAuthvalueDropbox without using >C4::Koha. >--- > C4/Budgets.pm | 40 ---------------------------------------- > C4/Koha.pm | 38 ++++++++++++++++++++++++++++++++++++++ > acqui/fetch_sort_dropbox.pl | 1 + > 3 files changed, 39 insertions(+), 40 deletions(-) > >diff --git a/C4/Budgets.pm b/C4/Budgets.pm >index 758e98f..1f4e11a 100644 >--- a/C4/Budgets.pm >+++ b/C4/Budgets.pm >@@ -57,8 +57,6 @@ BEGIN { > &AddBudgetPeriod > &DelBudgetPeriod > >- &GetAuthvalueDropbox >- > &ModBudgetPlan > > &GetCurrency >@@ -401,44 +399,6 @@ sub GetBudgetAuthCats { > } > > # ------------------------------------------------------------------- >-sub GetAuthvalueDropbox { >- my ( $authcat, $default ) = @_; >- my $branch_limit = C4::Context->userenv ? C4::Context->userenv->{"branch"} : ""; >- my $dbh = C4::Context->dbh; >- >- my $query = qq{ >- SELECT * >- FROM authorised_values >- }; >- $query .= qq{ >- LEFT JOIN authorised_values_branches ON ( id = av_id ) >- } if $branch_limit; >- $query .= qq{ >- WHERE category = ? >- }; >- $query .= " AND ( branchcode = ? OR branchcode IS NULL )" if $branch_limit; >- $query .= " GROUP BY lib ORDER BY category, lib, lib_opac"; >- my $sth = $dbh->prepare($query); >- $sth->execute( $authcat, $branch_limit ? $branch_limit : () ); >- >- >- my $option_list = []; >- my @authorised_values = ( q{} ); >- while (my $av = $sth->fetchrow_hashref) { >- push @{$option_list}, { >- value => $av->{authorised_value}, >- label => $av->{lib}, >- default => ($default eq $av->{authorised_value}), >- }; >- } >- >- if ( @{$option_list} ) { >- return $option_list; >- } >- return; >-} >- >-# ------------------------------------------------------------------- > sub GetBudgetPeriods { > my ($filters,$orderby) = @_; > return SearchInTable("aqbudgetperiods",$filters, $orderby, undef,undef, undef, "wide"); >diff --git a/C4/Koha.pm b/C4/Koha.pm >index 4202957..09214a5 100644 >--- a/C4/Koha.pm >+++ b/C4/Koha.pm >@@ -1392,6 +1392,44 @@ sub GetNormalizedOCLCNumber { > } > } > >+sub GetAuthvalueDropbox { >+ my ( $authcat, $default ) = @_; >+ my $branch_limit = C4::Context->userenv ? C4::Context->userenv->{"branch"} : ""; >+ my $dbh = C4::Context->dbh; >+ >+ my $query = qq{ >+ SELECT * >+ FROM authorised_values >+ }; >+ $query .= qq{ >+ LEFT JOIN authorised_values_branches ON ( id = av_id ) >+ } if $branch_limit; >+ $query .= qq{ >+ WHERE category = ? >+ }; >+ $query .= " AND ( branchcode = ? OR branchcode IS NULL )" if $branch_limit; >+ $query .= " GROUP BY lib ORDER BY category, lib, lib_opac"; >+ my $sth = $dbh->prepare($query); >+ $sth->execute( $authcat, $branch_limit ? $branch_limit : () ); >+ >+ >+ my $option_list = []; >+ my @authorised_values = ( q{} ); >+ while (my $av = $sth->fetchrow_hashref) { >+ push @{$option_list}, { >+ value => $av->{authorised_value}, >+ label => $av->{lib}, >+ default => ($default eq $av->{authorised_value}), >+ }; >+ } >+ >+ if ( @{$option_list} ) { >+ return $option_list; >+ } >+ return; >+} >+ >+ > =head2 GetDailyQuote($opts) > > Takes a hashref of options >diff --git a/acqui/fetch_sort_dropbox.pl b/acqui/fetch_sort_dropbox.pl >index ce47fb7..ee43f98 100755 >--- a/acqui/fetch_sort_dropbox.pl >+++ b/acqui/fetch_sort_dropbox.pl >@@ -24,6 +24,7 @@ use C4::Context; > use C4::Output; > use C4::Auth; > use C4::Budgets; >+use C4::Koha; > > =head1 NAME > >-- >1.7.10.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 766
:
18538
|
18550
|
18664
|
25904
|
25905
|
25906
|
25907
|
26401
|
27010
|
27011
|
27012
|
27013
|
27014
|
27044
|
27045
|
27046
|
27047
|
27048
|
27396
|
27400
|
27441
|
27442
|
27443
|
27444
|
27445
|
27446
|
27447
|
27448
|
27479
|
27495
|
27665
|
27666
|
27667
|
27668
|
27669
|
27670
|
27671
|
29870
|
29871
|
29872
|
29877
|
30404
|
30405
|
30406
|
30428
|
30430
|
30432
|
30510
|
30511
|
30512