Bugzilla – Attachment 76606 Details for
Bug 15360
Incorrect or mislabeled behavior on Authorities "New from Z39.50" Button
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 15360: Incorrect or mislabeled behavior on Authorities "New from Z39.50" Button
Bug-15360-Incorrect-or-mislabeled-behavior-on-Auth.patch (text/plain), 9.76 KB, created by
Katrin Fischer
on 2018-07-01 20:40:50 UTC
(
hide
)
Description:
Bug 15360: Incorrect or mislabeled behavior on Authorities "New from Z39.50" Button
Filename:
MIME Type:
Creator:
Katrin Fischer
Created:
2018-07-01 20:40:50 UTC
Size:
9.76 KB
patch
obsolete
>From 3137b119a4561e02ccc88a773364828c6d28c127 Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >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 <charles.farmer@inLibro.com> > >Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de> >--- > 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) %] > >-<div id="toolbar" class="btn-toolbar"> >- >-[% IF ( authid ) %] >- [% IF ( CAN_user_editauthorities ) %] >- <div class="btn-group"><a class="btn btn-default btn-sm" id="editAuth" href="authorities.pl?authid=[% authid %]"><i class="fa fa-pencil"></i> Edit</a></div> >- <div class="btn-group"><a class="btn btn-default btn-sm" id="dupAuth" href="authorities.pl?authid=[% authid %]&op=duplicate"><i class="fa fa-copy"></i> Duplicate</a></div> >- [% UNLESS ( count ) %] >- <div class="btn-group"><a href="#" class="btn btn-default btn-sm" id="delAuth"><i class="fa fa-trash"></i> Delete</a></div> >+ <div id="toolbar" class="btn-toolbar"> >+ [% IF ( CAN_user_editauthorities ) %] >+ <div class="btn-group"> >+ <a class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown" href="#"> >+ <i class="fa fa-plus"></i> New authority >+ <span class="caret"></span> >+ </a> >+ <ul class="dropdown-menu"> >+ [% IF servers.count > 0 %] >+ <li><a id="z3950_new" href="#">New from Z39.50</a></li> >+ <li role="separator" class="divider"></li> >+ [% END %] >+ [% FOREACH authority_type IN authority_types %] >+ <li><a href="/cgi-bin/koha/authorities/authorities.pl?authtypecode=[% authority_type.authtypecode %]">[% authority_type.authtypetext %]</a></li> >+ [% END %] >+ </ul> >+ </div> > [% END %] >- [% END %] >- >- <div class="btn-group"> >- <a class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown" href="#"><i class="fa fa-download"></i> Save >- <span class="caret"></span> >- </a> >- <ul class="dropdown-menu"> >- <li><a href="/cgi-bin/koha/authorities/export.pl?format=mads&op=export&authid=[% authid %]">MADS (XML)</a></li> >- <li><a href="/cgi-bin/koha/authorities/export.pl?format=marcxml&op=export&authid=[% authid %]">MARCXML</a></li> >- <li><a href="/cgi-bin/koha/authorities/export.pl?format=marc8&op=export&authid=[% authid %]">MARC (non-Unicode/MARC-8)</a></li> >- <li><a href="/cgi-bin/koha/authorities/export.pl?format=utf8&op=export&authid=[% authid %]">MARC (Unicode/UTF-8)</a></li> >- </ul> >- </div> >-[% END %] > >-[% IF ( CAN_user_editauthorities ) %] >- <div class="btn-group"> >- <a class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown" href="#"><i class="fa fa-plus"></i> New authority >- <span class="caret"></span> >- </a> >- <ul class="dropdown-menu"> >- [% FOREACH authority_type IN authority_types %] >- <li><a href="/cgi-bin/koha/authorities/authorities.pl?authtypecode=[% authority_type.authtypecode %]">[% authority_type.authtypetext %]</a></li> >+ [% IF ( authid ) %] >+ [% IF ( CAN_user_editauthorities ) %] >+ <div class="btn-group"> >+ <button class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown"> >+ <i class="fa fa-pencil"></i> Edit <span class="caret"></span> >+ </button> >+ <ul class="dropdown-menu"> >+ <li><a id="editAuth" href="/cgi-bin/koha/authorities/authorities.pl?authid=[% authid %]">Edit record</a></li> >+ <li><a id="dupAuth" href="/cgi-bin/koha/authorities/authorities.pl?authid=[% authid %]&op=duplicate">Edit as new (duplicate)</a></li> >+ [% IF servers.count > 0 %] >+ <li><a id="z3950_replace" href="#">Replace record via Z39.50/SRU</a></li> >+ [% END %] >+ [% UNLESS ( count ) %] >+ <li><a href="#" id="delAuth">Delete record</a></li> >+ [% END %] >+ </ul> >+ </div> > [% END %] >- </ul> >+ >+ <div class="btn-group"> >+ <a class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown" href="#"><i class="fa fa-download"></i> Save >+ <span class="caret"></span> >+ </a> >+ <ul class="dropdown-menu"> >+ <li><a href="/cgi-bin/koha/authorities/export.pl?format=mads&op=export&authid=[% authid %]">MADS (XML)</a></li> >+ <li><a href="/cgi-bin/koha/authorities/export.pl?format=marcxml&op=export&authid=[% authid %]">MARCXML</a></li> >+ <li><a href="/cgi-bin/koha/authorities/export.pl?format=marc8&op=export&authid=[% authid %]">MARC (non-Unicode/MARC-8)</a></li> >+ <li><a href="/cgi-bin/koha/authorities/export.pl?format=utf8&op=export&authid=[% authid %]">MARC (Unicode/UTF-8)</a></li> >+ </ul> >+ </div> >+ [% END %] > </div> >- [% IF servers.count > 0 %] >- <div class="btn-group"> >- <a class="btn btn-default btn-sm" id="z3950submit" href="#"><i class="fa fa-search"></i> New from Z39.50</a> >- </div> >- [% END %] >-[% END %] >-</div> > > [% 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 @@ >-<script type="text/javascript"> >+<script> > > function mergeAuth(authid, summary) { > var alreadySelected = $.cookie('auth_to_merge'); >@@ -65,15 +65,14 @@ $(document).ready(function () { > return false; > }); > >- $("#z3950submit").click(function(){ >- [% IF ( authid ) %] >- if (confirm(_("Please note that this Z39.50 search could replace the current record."))){ >- window.open("/cgi-bin/koha/cataloguing/z3950_auth_search.pl?authid=[% authid %]","z3950search",'width=800,height=500,location=yes,toolbar=no,scrollbars=yes,resize=yes'); >- } >- [% ELSE %] >- window.open("/cgi-bin/koha/cataloguing/z3950_auth_search.pl","z3950search",'width=800,height=500,location=yes,toolbar=no,scrollbars=yes,resize=yes'); >- [% END %] >- return false; >+ $("#z3950_new").click(function(e){ >+ e.preventDefault(); >+ window.open("/cgi-bin/koha/cataloguing/z3950_auth_search.pl","z3950search",'width=800,height=500,location=yes,toolbar=no,scrollbars=yes,resize=yes'); >+ }); >+ >+ $("#z3950_replace").click(function(e){ >+ e.preventDefault(); >+ window.open("/cgi-bin/koha/cataloguing/z3950_auth_search.pl?authid=[% authid %]","z3950search",'width=800,height=500,location=yes,toolbar=no,scrollbars=yes,resize=yes'); > }); > > var searchType = '[% marclist %]'; >@@ -89,4 +88,4 @@ $(document).ready(function () { > > }); > >-</script> >+</script> >\ No newline at end of file >-- >2.17.1
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 15360
:
46261
|
46273
|
46308
|
46565
|
75703
|
76584
| 76606