Lines 42-74
use C4::Matcher;
Link Here
|
42 |
use C4::UploadedFile; |
42 |
use C4::UploadedFile; |
43 |
use C4::BackgroundJob; |
43 |
use C4::BackgroundJob; |
44 |
use C4::MarcModificationTemplates; |
44 |
use C4::MarcModificationTemplates; |
|
|
45 |
use Koha::Plugins; |
45 |
|
46 |
|
46 |
my $input = new CGI; |
47 |
my $input = new CGI; |
47 |
|
48 |
|
48 |
my $fileID=$input->param('uploadedfileid'); |
49 |
my $fileID = $input->param('uploadedfileid'); |
49 |
my $runinbackground = $input->param('runinbackground'); |
50 |
my $runinbackground = $input->param('runinbackground'); |
50 |
my $completedJobID = $input->param('completedJobID'); |
51 |
my $completedJobID = $input->param('completedJobID'); |
51 |
my $matcher_id = $input->param('matcher'); |
52 |
my $matcher_id = $input->param('matcher'); |
52 |
my $overlay_action = $input->param('overlay_action'); |
53 |
my $overlay_action = $input->param('overlay_action'); |
53 |
my $nomatch_action = $input->param('nomatch_action'); |
54 |
my $nomatch_action = $input->param('nomatch_action'); |
54 |
my $parse_items = $input->param('parse_items'); |
55 |
my $parse_items = $input->param('parse_items'); |
55 |
my $item_action = $input->param('item_action'); |
56 |
my $item_action = $input->param('item_action'); |
56 |
my $comments = $input->param('comments'); |
57 |
my $comments = $input->param('comments'); |
57 |
my $record_type = $input->param('record_type'); |
58 |
my $record_type = $input->param('record_type'); |
58 |
my $encoding = $input->param('encoding'); |
59 |
my $encoding = $input->param('encoding'); |
|
|
60 |
my $to_marc_plugin = $input->param('to_marc_plugin'); |
59 |
my $marc_modification_template = $input->param('marc_modification_template_id'); |
61 |
my $marc_modification_template = $input->param('marc_modification_template_id'); |
60 |
|
62 |
|
61 |
my ($template, $loggedinuser, $cookie) |
63 |
my ( $template, $loggedinuser, $cookie ) = get_template_and_user( |
62 |
= get_template_and_user({template_name => "tools/stage-marc-import.tmpl", |
64 |
{ |
63 |
query => $input, |
65 |
template_name => "tools/stage-marc-import.tmpl", |
64 |
type => "intranet", |
66 |
query => $input, |
65 |
authnotrequired => 0, |
67 |
type => "intranet", |
66 |
flagsrequired => {tools => 'stage_marc_import'}, |
68 |
authnotrequired => 0, |
67 |
debug => 1, |
69 |
flagsrequired => { tools => 'stage_marc_import' }, |
68 |
}); |
70 |
debug => 1, |
|
|
71 |
} |
72 |
); |
69 |
|
73 |
|
70 |
$template->param(SCRIPT_NAME => $ENV{'SCRIPT_NAME'}, |
74 |
$template->param( |
71 |
uploadmarc => $fileID); |
75 |
SCRIPT_NAME => $ENV{'SCRIPT_NAME'}, |
|
|
76 |
uploadmarc => $fileID |
77 |
); |
72 |
|
78 |
|
73 |
my %cookies = parse CGI::Cookie($cookie); |
79 |
my %cookies = parse CGI::Cookie($cookie); |
74 |
my $sessionID = $cookies{'CGISESSID'}->value; |
80 |
my $sessionID = $cookies{'CGISESSID'}->value; |
Lines 128-139
if ($completedJobID) {
Link Here
|
128 |
# FIXME branch code |
134 |
# FIXME branch code |
129 |
my ( $batch_id, $num_valid, $num_items, @import_errors ) = |
135 |
my ( $batch_id, $num_valid, $num_items, @import_errors ) = |
130 |
BatchStageMarcRecords( |
136 |
BatchStageMarcRecords( |
131 |
$record_type, $encoding, |
137 |
$record_type, $encoding, |
132 |
$marcrecord, $filename, |
138 |
$marcrecord, $filename, |
133 |
$marc_modification_template, $comments, |
139 |
$to_marc_plugin, $marc_modification_template, |
134 |
'', $parse_items, |
140 |
$comments, '', |
135 |
0, 50, |
141 |
$parse_items, 0, |
136 |
staging_progress_callback( $job, $dbh ) |
142 |
50, staging_progress_callback( $job, $dbh ) |
137 |
); |
143 |
); |
138 |
|
144 |
|
139 |
my $num_with_matches = 0; |
145 |
my $num_with_matches = 0; |
Lines 186-200
if ($completedJobID) {
Link Here
|
186 |
|
192 |
|
187 |
} else { |
193 |
} else { |
188 |
# initial form |
194 |
# initial form |
189 |
if (C4::Context->preference("marcflavour") eq "UNIMARC") { |
195 |
if ( C4::Context->preference("marcflavour") eq "UNIMARC" ) { |
190 |
$template->param("UNIMARC" => 1); |
196 |
$template->param( "UNIMARC" => 1 ); |
191 |
} |
197 |
} |
192 |
my @matchers = C4::Matcher::GetMatcherList(); |
198 |
my @matchers = C4::Matcher::GetMatcherList(); |
193 |
$template->param(available_matchers => \@matchers); |
199 |
$template->param( available_matchers => \@matchers ); |
194 |
|
200 |
|
195 |
my @templates = GetModificationTemplates(); |
201 |
my @templates = GetModificationTemplates(); |
196 |
$template->param( MarcModificationTemplatesLoop => \@templates ); |
202 |
$template->param( MarcModificationTemplatesLoop => \@templates ); |
197 |
|
203 |
|
|
|
204 |
my @plugins = Koha::Plugins->new()->GetPlugins('to_marc'); |
205 |
$template->param( plugins => \@plugins ); |
198 |
} |
206 |
} |
199 |
|
207 |
|
200 |
output_html_with_http_headers $input, $cookie, $template->output; |
208 |
output_html_with_http_headers $input, $cookie, $template->output; |
201 |
- |
|
|