From 6900e766130442f7baff42545f1b0b6bfdb0e508 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Thu, 31 May 2018 13:29:33 +0000 Subject: [PATCH] Bug 15360: Incorrect or mislabeled behavior on Authorities "New from Z39.50" Button This patch makes a third stab at resolving this issue by reorganizing the authorities toolbar buttons to more closely match the bibliographic toolbar buttons: - "New from Z39.50" has been added to the "New authority" dropdown. - "Edit" is now a dropdown, like on the bibliographic detail page: - Edit record - Edit as new (duplicate) - Replace record via Z39.50/SRU - Delete record To test, apply the patch and go to the authorities module. Testing with existing Z39.50 authority sources configured: - On the authorities home page and the authorities search results page, the "New authority" menu should have a "New from Z39.50" link. - View the details for an authority record. The menus should appear as described above. Test each option. Remove all Z39.50 authority servers and test again. The "New from Z39.50" link should no longer appear. Signed-off-by: Charles Farmer Signed-off-by: Katrin Fischer Signed-off-by: Nick Clemens Signed-off-by: Martin Renvoize --- authorities/detail.pl | 9 ++ .../prog/en/includes/authorities-toolbar.inc | 85 ++++++++++--------- .../prog/en/includes/authorities_js.inc | 21 +++-- 3 files changed, 66 insertions(+), 49 deletions(-) diff --git a/authorities/detail.pl b/authorities/detail.pl index 8dd4b77835..4589c62f83 100755 --- a/authorities/detail.pl +++ b/authorities/detail.pl @@ -51,6 +51,7 @@ use Koha::Authorities; use Koha::Authority::Types; use Koha::Token; +use Koha::Z3950Servers; our ($tagslib); @@ -214,6 +215,13 @@ chop $biblio_fields if $biblio_fields; build_tabs ($template, $record, $dbh,"",$query); +my $servers = Koha::Z3950Servers->search( + { + recordtype => 'authority', + servertype => ['zed', 'sru'], + }, +); + my $type = $authority_types->find($authtypecode); $template->param( authid => $authid, @@ -223,6 +231,7 @@ $template->param( authtypecode => $authtypecode, authority_types => $authority_types, csrf_token => Koha::Token->new->generate_csrf({ session_id => scalar $query->cookie('CGISESSID') }), + servers => $servers, ); $template->{VARS}->{marcflavour} = C4::Context->preference("marcflavour"); diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/authorities-toolbar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/authorities-toolbar.inc index b42074a380..3c5b40faba 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/authorities-toolbar.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/authorities-toolbar.inc @@ -1,47 +1,56 @@ [% INCLUDE 'blocking_errors.inc' %] [% IF ( authid || CAN_user_editauthorities) %] -
- -[% IF ( authid ) %] - [% IF ( CAN_user_editauthorities ) %] - - - [% UNLESS ( count ) %] - +
+ [% IF ( CAN_user_editauthorities ) %] +
+ + New authority + + + +
[% END %] - [% END %] - - -[% END %] -[% IF ( CAN_user_editauthorities ) %] -
- New authority - - - + + + [% END %]
- [% IF servers.count > 0 %] - - [% END %] -[% END %] -
[% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/authorities_js.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/authorities_js.inc index 6e3b176d62..7584c9f53a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/authorities_js.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/authorities_js.inc @@ -1,4 +1,4 @@ - + \ No newline at end of file -- 2.39.5