Lines 102-111
sub update_bib {
Link Here
|
102 |
|
102 |
|
103 |
my $result = {}; |
103 |
my $result = {}; |
104 |
my $inxml = $query->param('POSTDATA'); |
104 |
my $inxml = $query->param('POSTDATA'); |
105 |
print $query->header(-type => 'text/xml', -charset => 'utf-8'); |
|
|
106 |
|
105 |
|
107 |
my $record = eval {MARC::Record::new_from_xml( $inxml, "UTF-8", C4::Context->preference('marcflavour'))}; |
106 |
my $record = eval {MARC::Record::new_from_xml( $inxml, "UTF-8", C4::Context->preference('marcflavour'))}; |
108 |
my $do_not_escape = 0; |
107 |
my $do_not_escape = 0; |
|
|
108 |
|
109 |
|
109 |
if ($@) { |
110 |
if ($@) { |
110 |
$result->{'status'} = "failed"; |
111 |
$result->{'status'} = "failed"; |
111 |
$result->{'error'} = $@; |
112 |
$result->{'error'} = $@; |
Lines 134-140
sub update_bib {
Link Here
|
134 |
if ($template) { |
135 |
if ($template) { |
135 |
ModifyRecordWithTemplate( $template_id, $record ); |
136 |
ModifyRecordWithTemplate( $template_id, $record ); |
136 |
} else { |
137 |
} else { |
137 |
croak "No MARC modification template exists with id \"$template_id\""; |
138 |
print $query->header(-type => 'text/xml', -status => '500 Internal Server Error'); |
|
|
139 |
print XMLout({ error => 'missing_marc_modification_template' }, NoAttr => 1, RootName => 'response', XMLDecl => 1); |
140 |
exit 0; |
138 |
} |
141 |
} |
139 |
} |
142 |
} |
140 |
|
143 |
|
Lines 149-155
sub update_bib {
Link Here
|
149 |
$result->{'marcxml'} = $xml; |
152 |
$result->{'marcxml'} = $xml; |
150 |
$do_not_escape = 1; |
153 |
$do_not_escape = 1; |
151 |
} |
154 |
} |
152 |
|
155 |
print $query->header(-type => 'text/xml', -charset => 'utf-8'); |
153 |
print XMLout($result, NoAttr => 1, RootName => 'response', XMLDecl => 1, NoEscape => $do_not_escape); |
156 |
print XMLout($result, NoAttr => 1, RootName => 'response', XMLDecl => 1, NoEscape => $do_not_escape); |
154 |
} |
157 |
} |
155 |
|
158 |
|
156 |
- |
|
|