5 # Script for handling import of MARC data into Koha db
8 # Koha library project www.koha.org
10 # Licensed under the GPL
13 # Copyright 2000-2002 Katipo Communications
15 # This file is part of Koha.
17 # Koha is free software; you can redistribute it and/or modify it under the
18 # terms of the GNU General Public License as published by the Free Software
19 # Foundation; either version 2 of the License, or (at your option) any later
22 # Koha is distributed in the hope that it will be useful, but WITHOUT ANY
23 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
24 # A PARTICULAR PURPOSE. See the GNU General Public License for more details.
26 # You should have received a copy of the GNU General Public License along with
27 # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
28 # Suite 330, Boston, MA 02111-1307 USA
32 # standard or CPAN modules used
37 use C4::Interface::CGI::Output;
46 # HTML colors for alternating lines
54 my $userid=$ENV{'REMOTE_USER'};
57 my $dbh = C4::Context->dbh;
59 my $uploadmarc=$input->param('uploadmarc');
60 my $overwrite_biblio = $input->param('overwrite_biblio');
61 my $filename = $input->param('filename');
62 my $syntax = $input->param('syntax');
63 my ($template, $loggedinuser, $cookie)
64 = get_template_and_user({template_name => "tools/breeding.tmpl",
68 flagsrequired => {parameters => 1, management => 1, tools => 1},
72 $template->param(SCRIPT_NAME => $ENV{'SCRIPT_NAME'},
73 uploadmarc => $uploadmarc);
74 if ($uploadmarc && length($uploadmarc)>0) {
76 while (<$uploadmarc>) {
79 my ($notmarcrecord,$alreadyindb,$alreadyinfarm,$imported) = ImportBreeding($marcrecord,$overwrite_biblio,$filename,$syntax,"");
81 $template->param(imported => $imported,
82 alreadyindb => $alreadyindb,
83 alreadyinfarm => $alreadyinfarm,
84 notmarcrecord => $notmarcrecord,
85 total => $imported+$alreadyindb+$alreadyinfarm+$notmarcrecord,
90 output_html_with_http_headers $input, $cookie, $template->output;
96 # log cleared, as marcimport is (almost) rewritten from scratch.
98 # Revision 1.3 2006/09/27 21:19:22 tgarip1957
99 # Finalized XML version for intranet
101 # Revision 1.2.4.1 2005/04/07 10:10:52 tipaul
102 # copying processz3950queue from 2.0 branch. The 2.2 version misses an important fix