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

(-)a/C4/Csv.pm (-17 lines)
Lines 33-61 $VERSION = 3.07.00.049; Link Here
33
# only export API methods
33
# only export API methods
34
34
35
@EXPORT = qw(
35
@EXPORT = qw(
36
  &GetCsvProfiles
37
  &GetCsvProfile
36
  &GetCsvProfile
38
  &GetCsvProfileId
37
  &GetCsvProfileId
39
  &GetMarcFieldsForCsv
38
  &GetMarcFieldsForCsv
40
);
39
);
41
40
42
41
43
# Returns all informations about csv profiles
44
sub GetCsvProfiles {
45
    my ( $type ) = @_;
46
    my $dbh = C4::Context->dbh;
47
    my $query = "SELECT * FROM export_format";
48
    if ( $type ) {
49
        $query .= " WHERE type = ?";
50
    }
51
52
    $sth = $dbh->prepare($query);
53
    $sth->execute( $type ? $type : () );
54
55
    $sth->fetchall_arrayref({});
56
57
}
58
59
# Returns all informations about a given csv profile
42
# Returns all informations about a given csv profile
60
sub GetCsvProfile {
43
sub GetCsvProfile {
61
    my ($id) = @_;
44
    my ($id) = @_;
(-)a/C4/Record.pm (-2 / +2 lines)
Lines 360-366 Returns a CSV scalar Link Here
360
360
361
C<$biblio> - a list of biblionumbers
361
C<$biblio> - a list of biblionumbers
362
362
363
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)
363
C<$csvprofileid> - the id of the CSV profile to use for the export (see export_format.export_format_id)
364
364
365
C<$itemnumbers> - a list of itemnumbers to export
365
C<$itemnumbers> - a list of itemnumbers to export
366
366
Lines 410-416 Returns a CSV scalar Link Here
410
410
411
C<$biblio> - a biblionumber
411
C<$biblio> - a biblionumber
412
412
413
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)
413
C<$csvprofileid> - the id of the CSV profile to use for the export (see export_format.export_format_id)
414
414
415
C<$header> - true if the headers are to be printed (typically at first pass)
415
C<$header> - true if the headers are to be printed (typically at first pass)
416
416
(-)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 27-32 use C4::Koha; # GetItemTypes Link Here
27
use C4::Output;
27
use C4::Output;
28
28
29
use Koha::Biblioitems;
29
use Koha::Biblioitems;
30
use Koha::CsvProfiles;
30
use Koha::Database;
31
use Koha::Database;
31
use Koha::DateUtils qw( dt_from_string output_pref );
32
use Koha::DateUtils qw( dt_from_string output_pref );
32
use Koha::Exporter::Record;
33
use Koha::Exporter::Record;
Lines 315-321 else { Link Here
315
        itemtypeloop             => \@itemtypesloop,
316
        itemtypeloop             => \@itemtypesloop,
316
        authtypeloop             => \@authtypesloop,
317
        authtypeloop             => \@authtypesloop,
317
        export_remove_fields     => C4::Context->preference("ExportRemoveFields"),
318
        export_remove_fields     => C4::Context->preference("ExportRemoveFields"),
318
        csv_profiles             => C4::Csv::GetCsvProfiles('marc'),
319
        csv_profiles             => [ Koha::CsvProfiles->search({ type => 'marc' }),
319
    );
320
    );
320
321
321
    output_html_with_http_headers $query, $cookie, $template->output;
322
    output_html_with_http_headers $query, $cookie, $template->output;
322
- 

Return to bug 15451