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

(-)a/C4/MarcModificationTemplates.pm (-1 / +1 lines)
Lines 112-118 sub AddModificationTemplate { Link Here
112
    my $sth = $dbh->prepare("INSERT INTO marc_modification_templates ( name ) VALUES ( ? )");
112
    my $sth = $dbh->prepare("INSERT INTO marc_modification_templates ( name ) VALUES ( ? )");
113
    $sth->execute($template_name);
113
    $sth->execute($template_name);
114
114
115
    my $template_id = $dbh->last_insert_id(undef, undef, 'marc_modification_templates');
115
    my $template_id = $dbh->last_insert_id( undef, undef, 'marc_modification_templates' );
116
116
117
    if ($template_id_copy) {
117
    if ($template_id_copy) {
118
        my @actions = GetModificationTemplateActions($template_id_copy);
118
        my @actions = GetModificationTemplateActions($template_id_copy);
(-)a/C4/Record.pm (-3 / +9 lines)
Lines 446-457 sub marc2csv { Link Here
446
        for my $itemnumber (@$itemnumbers) {
446
        for my $itemnumber (@$itemnumbers) {
447
            my $item         = Koha::Items->find($itemnumber);
447
            my $item         = Koha::Items->find($itemnumber);
448
            my $biblionumber = $item->biblio->biblionumber;
448
            my $biblionumber = $item->biblio->biblionumber;
449
            $output .= marcrecord2csv( $biblionumber, $id, $firstpass, $csv, $fieldprocessing, [$itemnumber], $marc_modification_template_id ) // '';
449
            $output .= marcrecord2csv(
450
                $biblionumber, $id, $firstpass, $csv, $fieldprocessing, [$itemnumber],
451
                $marc_modification_template_id
452
            ) // '';
450
            $firstpass = 0;
453
            $firstpass = 0;
451
        }
454
        }
452
    } else {
455
    } else {
453
        foreach my $biblio (@$biblios) {
456
        foreach my $biblio (@$biblios) {
454
            $output .= marcrecord2csv( $biblio, $id, $firstpass, $csv, $fieldprocessing, undef, $marc_modification_template_id ) // '';
457
            $output .= marcrecord2csv(
458
                $biblio, $id, $firstpass, $csv, $fieldprocessing, undef,
459
                $marc_modification_template_id
460
            ) // '';
455
            $firstpass = 0;
461
            $firstpass = 0;
456
        }
462
        }
457
    }
463
    }
Lines 495-501 sub marcrecord2csv { Link Here
495
    return unless $record;
501
    return unless $record;
496
502
497
    if ($marc_modification_template_id) {
503
    if ($marc_modification_template_id) {
498
        C4::MarcModificationTemplates::ModifyRecordWithTemplate($marc_modification_template_id, $record);
504
        C4::MarcModificationTemplates::ModifyRecordWithTemplate( $marc_modification_template_id, $record );
499
    }
505
    }
500
506
501
    # Getting the framework
507
    # Getting the framework
(-)a/Koha/Exporter/Record.pm (-10 / +10 lines)
Lines 159-172 sub _get_biblio_for_export { Link Here
159
sub export {
159
sub export {
160
    my ($params) = @_;
160
    my ($params) = @_;
161
161
162
    my $record_type        = $params->{record_type};
162
    my $record_type                   = $params->{record_type};
163
    my $record_ids         = $params->{record_ids} || [];
163
    my $record_ids                    = $params->{record_ids} || [];
164
    my $format             = $params->{format};
164
    my $format                        = $params->{format};
165
    my $itemnumbers        = $params->{itemnumbers} || [];    # Does not make sense with record_type eq auths
165
    my $itemnumbers                   = $params->{itemnumbers} || [];    # Does not make sense with record_type eq auths
166
    my $export_items       = $params->{export_items};
166
    my $export_items                  = $params->{export_items};
167
    my $dont_export_fields = $params->{dont_export_fields};
167
    my $dont_export_fields            = $params->{dont_export_fields};
168
    my $csv_profile_id     = $params->{csv_profile_id};
168
    my $csv_profile_id                = $params->{csv_profile_id};
169
    my $output_filepath    = $params->{output_filepath};
169
    my $output_filepath               = $params->{output_filepath};
170
    my $marc_modification_template_id = $params->{marc_modification_template_id};
170
    my $marc_modification_template_id = $params->{marc_modification_template_id};
171
171
172
    if ( !$record_type ) {
172
    if ( !$record_type ) {
Lines 197-203 sub export { Link Here
197
            }
197
            }
198
198
199
            if ($marc_modification_template_id) {
199
            if ($marc_modification_template_id) {
200
                C4::MarcModificationTemplates::ModifyRecordWithTemplate($marc_modification_template_id, $record);
200
                C4::MarcModificationTemplates::ModifyRecordWithTemplate( $marc_modification_template_id, $record );
201
            }
201
            }
202
202
203
            print $record->as_usmarc();
203
            print $record->as_usmarc();
Lines 214-220 sub export { Link Here
214
            next unless $record;
214
            next unless $record;
215
215
216
            if ($marc_modification_template_id) {
216
            if ($marc_modification_template_id) {
217
                C4::MarcModificationTemplates::ModifyRecordWithTemplate($marc_modification_template_id, $record);
217
                C4::MarcModificationTemplates::ModifyRecordWithTemplate( $marc_modification_template_id, $record );
218
            }
218
            }
219
219
220
            print MARC::File::XML::record($record);
220
            print MARC::File::XML::record($record);
(-)a/tools/export.pl (-2 / +1 lines)
Lines 236-242 if ( $op eq "cud-export" ) { Link Here
236
                csv_profile_id                 => $csv_profile_id,
236
                csv_profile_id                 => $csv_profile_id,
237
                export_items                   => ( not $dont_export_items ),
237
                export_items                   => ( not $dont_export_items ),
238
                only_export_items_for_branches => $only_export_items_for_branches,
238
                only_export_items_for_branches => $only_export_items_for_branches,
239
                marc_modification_template_id => scalar $query->param('marc_modification_template_id'),
239
                marc_modification_template_id  => scalar $query->param('marc_modification_template_id'),
240
            }
240
            }
241
        );
241
        );
242
    } elsif ( $record_type eq 'db' or $record_type eq 'conf' ) {
242
    } elsif ( $record_type eq 'db' or $record_type eq 'conf' ) {
243
- 

Return to bug 24679