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

(-)a/C4/ImportBatch.pm (-5 / +4 lines)
Lines 1350-1362 sub SetImportRecordMatches { Link Here
1350
1350
1351
sub _create_import_record {
1351
sub _create_import_record {
1352
    my ($batch_id, $record_sequence, $marc_record, $record_type, $encoding, $z3950random, $marc_type) = @_;
1352
    my ($batch_id, $record_sequence, $marc_record, $record_type, $encoding, $z3950random, $marc_type) = @_;
1353
    my $marcxml_old = " "; # placeholder because import_records.marcxml_old is NOT NULL with no DEFAULT set
1353
1354
1354
    my $dbh = C4::Context->dbh;
1355
    my $dbh = C4::Context->dbh;
1355
    my $sth = $dbh->prepare("INSERT INTO import_records (import_batch_id, record_sequence, marc, marcxml, 
1356
    my $sth = $dbh->prepare("INSERT INTO import_records (import_batch_id, record_sequence, marc, marcxml, 
1356
                                                         record_type, encoding, z3950random)
1357
                                                        marcxml_old, record_type, encoding, z3950random)
1357
                                    VALUES (?, ?, ?, ?, ?, ?, ?)");
1358
                                    VALUES (?, ?, ?, ?, ?, ?, ?, ?)");
1358
    $sth->execute($batch_id, $record_sequence, $marc_record->as_usmarc(), $marc_record->as_xml($marc_type),
1359
    $sth->execute($batch_id, $record_sequence, $marc_record->as_usmarc(), $marc_record->as_xml($marc_type),
1359
                  $record_type, $encoding, $z3950random);
1360
                  $marcxml_old, $record_type, $encoding, $z3950random);
1360
    my $import_record_id = $dbh->{'mysql_insertid'};
1361
    my $import_record_id = $dbh->{'mysql_insertid'};
1361
    $sth->finish();
1362
    $sth->finish();
1362
    return $import_record_id;
1363
    return $import_record_id;
Lines 1388-1394 sub _add_auth_fields { Link Here
1388
1389
1389
sub _add_biblio_fields {
1390
sub _add_biblio_fields {
1390
    my ($import_record_id, $marc_record) = @_;
1391
    my ($import_record_id, $marc_record) = @_;
1391
1392
    my ($title, $author, $isbn, $issn) = _parse_biblio_fields($marc_record);
1392
    my ($title, $author, $isbn, $issn) = _parse_biblio_fields($marc_record);
1393
    my $dbh = C4::Context->dbh;
1393
    my $dbh = C4::Context->dbh;
1394
    # FIXME no controlnumber, originalsource
1394
    # FIXME no controlnumber, originalsource
Lines 1396-1402 sub _add_biblio_fields { Link Here
1396
    my $sth = $dbh->prepare("INSERT INTO import_biblios (import_record_id, title, author, isbn, issn) VALUES (?, ?, ?, ?, ?)");
1396
    my $sth = $dbh->prepare("INSERT INTO import_biblios (import_record_id, title, author, isbn, issn) VALUES (?, ?, ?, ?, ?)");
1397
    $sth->execute($import_record_id, $title, $author, $isbn, $issn);
1397
    $sth->execute($import_record_id, $title, $author, $isbn, $issn);
1398
    $sth->finish();
1398
    $sth->finish();
1399
                
1400
}
1399
}
1401
1400
1402
sub _update_biblio_fields {
1401
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 130-135 if ($completedJobID) { Link Here
130
135
131
    }
136
    }
132
137
138
    # 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
139
133
    # FIXME branch code
140
    # FIXME branch code
134
    my ($batch_id, $num_valid, $num_items, @import_errors) = BatchStageMarcRecords($record_type, $encoding, $marcrecord, $filename, $comments, '', $parse_items, 0, 50, staging_progress_callback($job, $dbh));
141
    my ($batch_id, $num_valid, $num_items, @import_errors) = BatchStageMarcRecords($record_type, $encoding, $marcrecord, $filename, $comments, '', $parse_items, 0, 50, staging_progress_callback($job, $dbh));
135
142
136
- 

Return to bug 5366