|
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 { |