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

(-)a/C4/ImportBatch.pm (-8 / +4 lines)
Lines 1128-1140 sub SetImportRecordMatches { Link Here
1128
1128
1129
sub _create_import_record {
1129
sub _create_import_record {
1130
    my ($batch_id, $record_sequence, $marc_record, $record_type, $encoding, $z3950random) = @_;
1130
    my ($batch_id, $record_sequence, $marc_record, $record_type, $encoding, $z3950random) = @_;
1131
1131
    my $marcxml_old = " "; # placeholder because import_records.marcxml_old is NOT NULL with no DEFAULT set
1132
    my $dbh = C4::Context->dbh;
1132
    my $dbh = C4::Context->dbh;
1133
    my $sth = $dbh->prepare("INSERT INTO import_records (import_batch_id, record_sequence, marc, marcxml, 
1133
    my $sth = $dbh->prepare("INSERT INTO import_records (import_batch_id, record_sequence, marc, marcxml, marcxml_old, record_type, encoding, z3950random)
1134
                                                         record_type, encoding, z3950random)
1134
                                    VALUES (?, ?, ?, ?, ?, ?, ?, ?)");
1135
                                    VALUES (?, ?, ?, ?, ?, ?, ?)");
1135
    $sth->execute($batch_id, $record_sequence, $marc_record->as_usmarc(), $marc_record->as_xml(), $marcxml_old, $record_type, $encoding, $z3950random);
1136
    $sth->execute($batch_id, $record_sequence, $marc_record->as_usmarc(), $marc_record->as_xml(),
1137
                  $record_type, $encoding, $z3950random);
1138
    my $import_record_id = $dbh->{'mysql_insertid'};
1136
    my $import_record_id = $dbh->{'mysql_insertid'};
1139
    $sth->finish();
1137
    $sth->finish();
1140
    return $import_record_id;
1138
    return $import_record_id;
Lines 1152-1158 sub _update_import_record_marc { Link Here
1152
1150
1153
sub _add_biblio_fields {
1151
sub _add_biblio_fields {
1154
    my ($import_record_id, $marc_record) = @_;
1152
    my ($import_record_id, $marc_record) = @_;
1155
1156
    my ($title, $author, $isbn, $issn) = _parse_biblio_fields($marc_record);
1153
    my ($title, $author, $isbn, $issn) = _parse_biblio_fields($marc_record);
1157
    my $dbh = C4::Context->dbh;
1154
    my $dbh = C4::Context->dbh;
1158
    # FIXME no controlnumber, originalsource
1155
    # FIXME no controlnumber, originalsource
Lines 1160-1166 sub _add_biblio_fields { Link Here
1160
    my $sth = $dbh->prepare("INSERT INTO import_biblios (import_record_id, title, author, isbn, issn) VALUES (?, ?, ?, ?, ?)");
1157
    my $sth = $dbh->prepare("INSERT INTO import_biblios (import_record_id, title, author, isbn, issn) VALUES (?, ?, ?, ?, ?)");
1161
    $sth->execute($import_record_id, $title, $author, $isbn, $issn);
1158
    $sth->execute($import_record_id, $title, $author, $isbn, $issn);
1162
    $sth->finish();
1159
    $sth->finish();
1163
                
1164
}
1160
}
1165
1161
1166
sub _update_biblio_fields {
1162
sub _update_biblio_fields {
(-)a/tools/stage-marc-import.pl (-2 / +8 lines)
Lines 25-31 Link Here
25
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
25
# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
26
26
27
use strict;
27
use strict;
28
#use warnings; FIXME - Bug 2505
28
use warnings;
29
30
#use Sys::Syslog; #XXX
31
#openlog('Koha_Import','' ,'LOCAL0');
32
33
#syslog('debug|local0', "Starting up tools/stage-marc-import.pl"); #XXX
29
34
30
# standard or CPAN modules used
35
# standard or CPAN modules used
31
use CGI;
36
use CGI;
Lines 129-134 if ($completedJobID) { Link Here
129
134
130
    }
135
    }
131
136
137
    # open STDERR, '>', "/home/koha/koha.git/var/log/koha-import.log"; # uncomment to log errors from child process; fix path for your install; logfile must be owned by apache user
138
132
    # FIXME branch code
139
    # FIXME branch code
133
    my ($batch_id, $num_valid, $num_items, @import_errors) = BatchStageMarcRecords($syntax, $marcrecord, $filename, 
140
    my ($batch_id, $num_valid, $num_items, @import_errors) = BatchStageMarcRecords($syntax, $marcrecord, $filename, 
134
                                                                                   $comments, '', $parse_items, 0,
141
                                                                                   $comments, '', $parse_items, 0,
135
- 

Return to bug 5366