Bugzilla – Attachment 50181 Details for
Bug 15451
Move the CSV related code to Koha::CsvProfile[s]
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 15451: Koha::CsvProfiles - Remove GetCsvProfiles
Bug-15451-KohaCsvProfiles---Remove-GetCsvProfiles.patch (text/plain), 4.09 KB, created by
Jonathan Druart
on 2016-04-13 08:37:22 UTC
(
hide
)
Description:
Bug 15451: Koha::CsvProfiles - Remove GetCsvProfiles
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2016-04-13 08:37:22 UTC
Size:
4.09 KB
patch
obsolete
>From 32798619eb8a313cebb1a58ce1054b575435b3c6 Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Wed, 30 Dec 2015 18:16:01 +0000 >Subject: [PATCH] Bug 15451: Koha::CsvProfiles - Remove GetCsvProfiles > >This subroutine did the same job as GetCsvProfilesLoop, so this patch >applies the same changes as the previous patch. > >Test plan: >1/ Claim some serials, sql profiles should be listed >2/ Export records using the export tool. MARC profiles should be listed. >--- > C4/Csv.pm | 17 ----------------- > C4/Record.pm | 4 ++-- > serials/claims.pl | 8 ++++---- > tools/export.pl | 3 ++- > 4 files changed, 8 insertions(+), 24 deletions(-) > >diff --git a/C4/Csv.pm b/C4/Csv.pm >index 275fb49..7c8f824 100644 >--- a/C4/Csv.pm >+++ b/C4/Csv.pm >@@ -31,29 +31,12 @@ use vars qw(@ISA @EXPORT); > # only export API methods > > @EXPORT = qw( >- &GetCsvProfiles > &GetCsvProfile > &GetCsvProfileId > &GetMarcFieldsForCsv > ); > > >-# Returns all informations about csv profiles >-sub GetCsvProfiles { >- my ( $type ) = @_; >- my $dbh = C4::Context->dbh; >- my $query = "SELECT * FROM export_format"; >- if ( $type ) { >- $query .= " WHERE type = ?"; >- } >- >- $sth = $dbh->prepare($query); >- $sth->execute( $type ? $type : () ); >- >- $sth->fetchall_arrayref({}); >- >-} >- > # Returns all informations about a given csv profile > sub GetCsvProfile { > my ($id) = @_; >diff --git a/C4/Record.pm b/C4/Record.pm >index d24d631..a3c1e8e 100644 >--- a/C4/Record.pm >+++ b/C4/Record.pm >@@ -401,7 +401,7 @@ Returns a CSV scalar > > C<$biblio> - a list of biblionumbers > >-C<$csvprofileid> - the id of the CSV profile to use for the export (see export_format.export_format_id and the GetCsvProfiles function in C4::Csv) >+C<$csvprofileid> - the id of the CSV profile to use for the export (see export_format.export_format_id) > > C<$itemnumbers> - a list of itemnumbers to export > >@@ -451,7 +451,7 @@ Returns a CSV scalar > > C<$biblio> - a biblionumber > >-C<$csvprofileid> - the id of the CSV profile to use for the export (see export_format.export_format_id and the GetCsvProfiles function in C4::Csv) >+C<$csvprofileid> - the id of the CSV profile to use for the export (see export_format.export_format_id) > > C<$header> - true if the headers are to be printed (typically at first pass) > >diff --git a/serials/claims.pl b/serials/claims.pl >index 6a71cc8..3a2f8e8 100755 >--- a/serials/claims.pl >+++ b/serials/claims.pl >@@ -17,8 +17,7 @@ > # You should have received a copy of the GNU General Public License > # along with Koha; if not, see <http://www.gnu.org/licenses>. > >-use strict; >-use warnings; >+use Modern::Perl; > use CGI qw ( -utf8 ); > use C4::Auth; > use C4::Serials; >@@ -29,7 +28,8 @@ use C4::Letters; > use C4::Branch; # GetBranches GetBranchesLoop > use C4::Koha qw( GetAuthorisedValues ); > use Koha::AdditionalField; >-use C4::Csv qw( GetCsvProfiles ); >+use Koha::CsvProfiles; >+use C4::Csv; > > my $input = CGI->new; > >@@ -107,7 +107,7 @@ $template->param( > claimletter => $claimletter, > branchloop => $branchloop, > additional_fields_for_subscription => $additional_fields, >- csv_profiles => C4::Csv::GetCsvProfiles( "sql" ), >+ csv_profiles => [ Koha::CsvProfiles->search({ type => 'sql' }) ], > letters => $letters, > (uc(C4::Context->preference("marcflavour"))) => 1 > ); >diff --git a/tools/export.pl b/tools/export.pl >index efcd544..f625370 100755 >--- a/tools/export.pl >+++ b/tools/export.pl >@@ -28,6 +28,7 @@ use C4::Output; > > use Koha::Authority::Types; > use Koha::Biblioitems; >+use Koha::CsvProfiles; > use Koha::Database; > use Koha::DateUtils qw( dt_from_string output_pref ); > use Koha::Exporter::Record; >@@ -307,7 +308,7 @@ else { > itemtypeloop => \@itemtypesloop, > authority_types => $authority_types, > export_remove_fields => C4::Context->preference("ExportRemoveFields"), >- csv_profiles => C4::Csv::GetCsvProfiles('marc'), >+ csv_profiles => [ Koha::CsvProfiles->search({ type => 'marc' }), > ); > > output_html_with_http_headers $query, $cookie, $template->output; >-- >2.7.0
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 15451
:
46108
|
46109
|
46110
|
46111
|
46112
|
46113
|
46114
|
46306
|
50178
|
50179
|
50180
|
50181
|
50182
|
50183
|
50184
|
50185
|
50860
|
50861
|
50862
|
50863
|
50864
|
50865
|
50866
|
50867
|
50868
|
50985
|
53623
|
53624
|
53625
|
53626
|
53627
|
53628
|
53629
|
53630
|
53631
|
53641