3 # Copyright 2013 ByWater
5 # This file is part of Koha.
7 # Koha is free software; you can redistribute it and/or modify it under the
8 # terms of the GNU General Public License as published by the Free Software
9 # Foundation; either version 2 of the License, or (at your option) any later
12 # Koha is distributed in the hope that it will be useful, but WITHOUT ANY
13 # WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
14 # A PARTICULAR PURPOSE. See the GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License along
17 # with Koha; if not, write to the Free Software Foundation, Inc.,
18 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
21 use Modern::Perl '2009';
30 use DBIx::Class::ResultClass::HashRefInflator;
35 my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
37 template_name => 'cataloguing/editor.tt',
41 flagsrequired => { editcatalogue => 'edit_catalogue' },
45 my $schema = Koha::Database->new->schema;
47 # Available import batches
48 $template->{VARS}->{editable_batches} = [ $schema->resultset('ImportBatch')->search(
50 batch_type => [ 'batch', 'webservice' ],
51 import_status => 'staged',
53 { result_class => 'DBIx::Class::ResultClass::HashRefInflator' },
56 # Needed information for cataloging plugins
57 $template->{VARS}->{DefaultLanguageField008} = pack( 'A3', C4::Context->preference('DefaultLanguageField008') || 'eng' );
60 my $dbh = C4::Context->dbh;
61 $template->{VARS}->{z3950_servers} = $dbh->selectall_arrayref( q{
62 SELECT * FROM z3950servers
63 WHERE recordtype != 'authority' AND servertype = 'zed'
67 output_html_with_http_headers $input, $cookie, $template->output;