View | Details | Raw Unified | Return to bug 15451
Collapse All | Expand All

(-)a/C4/Csv.pm (-17 lines)
Lines 31-59 use vars qw(@ISA @EXPORT); Link Here
31
# only export API methods
31
# only export API methods
32
32
33
@EXPORT = qw(
33
@EXPORT = qw(
34
  &GetCsvProfiles
35
  &GetCsvProfile
34
  &GetCsvProfile
36
  &GetCsvProfileId
35
  &GetCsvProfileId
37
  &GetMarcFieldsForCsv
36
  &GetMarcFieldsForCsv
38
);
37
);
39
38
40
39
41
# Returns all informations about csv profiles
42
sub GetCsvProfiles {
43
    my ( $type ) = @_;
44
    my $dbh = C4::Context->dbh;
45
    my $query = "SELECT * FROM export_format";
46
    if ( $type ) {
47
        $query .= " WHERE type = ?";
48
    }
49
50
    $sth = $dbh->prepare($query);
51
    $sth->execute( $type ? $type : () );
52
53
    $sth->fetchall_arrayref({});
54
55
}
56
57
# Returns all informations about a given csv profile
40
# Returns all informations about a given csv profile
58
sub GetCsvProfile {
41
sub GetCsvProfile {
59
    my ($id) = @_;
42
    my ($id) = @_;
(-)a/C4/Record.pm (-2 / +2 lines)
Lines 401-407 Returns a CSV scalar Link Here
401
401
402
C<$biblio> - a list of biblionumbers
402
C<$biblio> - a list of biblionumbers
403
403
404
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)
404
C<$csvprofileid> - the id of the CSV profile to use for the export (see export_format.export_format_id)
405
405
406
C<$itemnumbers> - a list of itemnumbers to export
406
C<$itemnumbers> - a list of itemnumbers to export
407
407
Lines 451-457 Returns a CSV scalar Link Here
451
451
452
C<$biblio> - a biblionumber
452
C<$biblio> - a biblionumber
453
453
454
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)
454
C<$csvprofileid> - the id of the CSV profile to use for the export (see export_format.export_format_id)
455
455
456
C<$header> - true if the headers are to be printed (typically at first pass)
456
C<$header> - true if the headers are to be printed (typically at first pass)
457
457
(-)a/serials/claims.pl (-4 / +4 lines)
Lines 17-24 Link Here
17
# You should have received a copy of the GNU General Public License
17
# You should have received a copy of the GNU General Public License
18
# along with Koha; if not, see <http://www.gnu.org/licenses>.
18
# along with Koha; if not, see <http://www.gnu.org/licenses>.
19
19
20
use strict;
20
use Modern::Perl;
21
use warnings;
22
use CGI qw ( -utf8 );
21
use CGI qw ( -utf8 );
23
use C4::Auth;
22
use C4::Auth;
24
use C4::Serials;
23
use C4::Serials;
Lines 29-35 use C4::Letters; Link Here
29
use C4::Branch;    # GetBranches GetBranchesLoop
28
use C4::Branch;    # GetBranches GetBranchesLoop
30
use C4::Koha qw( GetAuthorisedValues );
29
use C4::Koha qw( GetAuthorisedValues );
31
use Koha::AdditionalField;
30
use Koha::AdditionalField;
32
use C4::Csv qw( GetCsvProfiles );
31
use Koha::CsvProfiles;
32
use C4::Csv;
33
33
34
my $input = CGI->new;
34
my $input = CGI->new;
35
35
Lines 107-113 $template->param( Link Here
107
        claimletter => $claimletter,
107
        claimletter => $claimletter,
108
        branchloop   => $branchloop,
108
        branchloop   => $branchloop,
109
        additional_fields_for_subscription => $additional_fields,
109
        additional_fields_for_subscription => $additional_fields,
110
        csv_profiles => C4::Csv::GetCsvProfiles( "sql" ),
110
        csv_profiles => [ Koha::CsvProfiles->search({ type => 'sql' }) ],
111
        letters => $letters,
111
        letters => $letters,
112
        (uc(C4::Context->preference("marcflavour"))) => 1
112
        (uc(C4::Context->preference("marcflavour"))) => 1
113
        );
113
        );
(-)a/tools/export.pl (-2 / +2 lines)
Lines 28-33 use C4::Output; Link Here
28
28
29
use Koha::Authority::Types;
29
use Koha::Authority::Types;
30
use Koha::Biblioitems;
30
use Koha::Biblioitems;
31
use Koha::CsvProfiles;
31
use Koha::Database;
32
use Koha::Database;
32
use Koha::DateUtils qw( dt_from_string output_pref );
33
use Koha::DateUtils qw( dt_from_string output_pref );
33
use Koha::Exporter::Record;
34
use Koha::Exporter::Record;
Lines 309-315 else { Link Here
309
        itemtypeloop             => \@itemtypesloop,
310
        itemtypeloop             => \@itemtypesloop,
310
        authority_types          => $authority_types,
311
        authority_types          => $authority_types,
311
        export_remove_fields     => C4::Context->preference("ExportRemoveFields"),
312
        export_remove_fields     => C4::Context->preference("ExportRemoveFields"),
312
        csv_profiles             => C4::Csv::GetCsvProfiles('marc'),
313
        csv_profiles             => [ Koha::CsvProfiles->search({ type => 'marc' }),
313
    );
314
    );
314
315
315
    output_html_with_http_headers $query, $cookie, $template->output;
316
    output_html_with_http_headers $query, $cookie, $template->output;
316
- 

Return to bug 15451