Koha/cataloguing/editor.pl
Nick Clemens 8b7342a823 Bug 21411: Advanced cataloging editor - rancor - Allow configuration of Keyboard
This patch allows for redfining the keyboard shortcuts used in rancor.
For now these are set globally (per instance)
Ctrl-S is a codemirror setting and cannot be altered

To test:
 1 - Apply patches
 2 - update database
 3 - Load the advanced cataloging editor
 4 - Click the "Keyboard shortcuts" button
 5 - Ensure the list looks correct
 6 - Note that 'Ctrl-S' note sit cannot be remapped
 7 - Note the 'Redefine shortcuts' link at the top of the menu
 8 - Confirm all the listed shortcuts work as expected
 9 - Click the 'Redefine' link
10 - Ensure current mappings load correctly
11 - Read explanation and verify it makes sense
12 - Remap some functions
13 - Return to the cataloging editor
14 - Confirm your mappings work

Signed-off-by: Liz Rea <liz@catalyst.net.nz>

Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>

Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
2019-05-10 18:59:39 +00:00

88 lines
2.6 KiB
Perl
Executable file

#!/usr/bin/perl
#
# Copyright 2013 ByWater
#
# This file is part of Koha.
#
# Koha is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 3 of the License, or
# (at your option) any later version.
#
# Koha is distributed in the hope that it will be useful, but
# WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with Koha; if not, see <http://www.gnu.org/licenses>.
#
use Modern::Perl;
use CGI;
use MARC::Record;
use C4::Auth;
use C4::Biblio;
use C4::Context;
use C4::Output;
use DBIx::Class::ResultClass::HashRefInflator;
use Koha::Database;
use Koha::MarcSubfieldStructures;
use Koha::BiblioFrameworks;
use Koha::KeyboardShortcuts;
my $input = CGI->new;
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
{
template_name => 'cataloguing/editor.tt',
query => $input,
type => 'intranet',
authnotrequired => 0,
flagsrequired => {
editcatalogue => {
'edit_catalogue' => 1,
'advanced_editor' => 1
},
}
}
);
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(
{
batch_type => [ 'batch', 'webservice' ],
import_status => 'staged',
},
{ result_class => 'DBIx::Class::ResultClass::HashRefInflator' },
) ];
# Needed information for cataloging plugins
$template->{VARS}->{DefaultLanguageField008} = pack( 'A3', C4::Context->preference('DefaultLanguageField008') || 'eng' );
my $authtags = Koha::MarcSubfieldStructures->search({ authtypecode => { '!=' => '' }, 'frameworkcode' => '' });
$template->{VARS}->{authtags} = $authtags;
my $frameworks = Koha::BiblioFrameworks->search({}, { order_by => ['frameworktext'] });
$template->{VARS}->{frameworks} = $frameworks;
# Z39.50 servers
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
}, { Slice => {} } );
output_html_with_http_headers $input, $cookie, $template->output;