Bug 17600: Standardize our EXPORT_OK
[srvgit] / cataloguing / editor.pl
index a0e6c83..c2864a3 100755 (executable)
 use Modern::Perl;
 
 use CGI;
-use MARC::Record;
 
-use C4::Auth;
-use C4::Biblio;
+use C4::Auth qw( get_template_and_user );
 use C4::Context;
-use C4::Output;
+use C4::Output qw( output_html_with_http_headers );
 use DBIx::Class::ResultClass::HashRefInflator;
 use Koha::Database;
 use Koha::MarcSubfieldStructures;
 use Koha::BiblioFrameworks;
+use Koha::KeyboardShortcuts;
 
 my $input = CGI->new;
 
@@ -39,7 +38,6 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
         template_name   => 'cataloguing/editor.tt',
         query           => $input,
         type            => 'intranet',
-        authnotrequired => 0,
         flagsrequired   => {
             editcatalogue => {
                 'edit_catalogue'  => 1,
@@ -51,6 +49,13 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
 
 my $schema = Koha::Database->new->schema;
 
+my @keyboard_shortcuts = Koha::KeyboardShortcuts->search();
+
+# Keyboard shortcuts
+$template->param(
+    shortcuts => \@keyboard_shortcuts,
+);
+
 # Available import batches
 $template->{VARS}->{editable_batches} = [ $schema->resultset('ImportBatch')->search(
     {
@@ -62,6 +67,7 @@ $template->{VARS}->{editable_batches} = [ $schema->resultset('ImportBatch')->sea
 
 # Needed information for cataloging plugins
 $template->{VARS}->{DefaultLanguageField008} = pack( 'A3', C4::Context->preference('DefaultLanguageField008') || 'eng' );
+$template->{VARS}->{DefaultCountryField008} = pack( 'A3', C4::Context->preference('DefaultCountryField008') || '|||' );
 
 my $authtags = Koha::MarcSubfieldStructures->search({ authtypecode => { '!=' => '' }, 'frameworkcode' => '' });
 $template->{VARS}->{authtags} = $authtags;
@@ -74,7 +80,7 @@ my $dbh = C4::Context->dbh;
 $template->{VARS}->{z3950_servers} = $dbh->selectall_arrayref( q{
     SELECT * FROM z3950servers
     WHERE recordtype != 'authority' AND servertype = 'zed'
-    ORDER BY servername
+    ORDER BY rank,servername
 }, { Slice => {} } );
 
 output_html_with_http_headers $input, $cookie, $template->output;