From 105a9fccd54ddf695a77580861497385434f5be8 Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Wed, 12 Aug 2020 14:47:47 +0000 Subject: [PATCH] Bug 23302: Less clicks on Z3950 search results Content-Type: text/plain; charset=utf-8 Functional change: Instead of requiring two clicks for each option in the Actions menu, we add a default action based on previous activity. NOTE: In order to prioritize MARC and Card preview actions, we will only remember Import and Order when it is not preceded by a preview. In other words: If you directly click Import, Import comes back. If you click Card and Import, Card comes back. Technical changes: [1] Combine Preview and Order button on Acquisition Z3950 search. [2] Use Actions link as default action and add button with caret to open the dropdown. [3] Keep last action in localStorage (sessionStorage makes not much sense for the popups), prioritizing previews. [4] Where needed, add title attributes to dropdown links. Use class 'chosen' to differentiate preview popups from import/order actions. [5] Replace previewMARC by previewData in Authority Z3950 search. Remove duplicate code. [6] Use link href from template instead of constructing link in javascript. [7] Removing unused linktools markup from acqui template. Test plan: [1] Start on acqui Z3950. Choose Card once from the menu and then Order. [2] Start auth Z3950. Verify that Default is MARC now. Close popup. (Since Card is no option here.) [3] Start cataloguing Z3950. Verify that you have Card as default. Click Import rightaway. [4] Back to auth Z3950. Verify that Import is default. Click Import. [5] Back to acqui Z3950. Verify that MARC is default (no Import here). Click Order. Go back and verify that Order is now default. Signed-off-by: Marcel de Rooy --- .../prog/en/modules/acqui/z3950_search.tt | 17 ++--- .../en/modules/cataloguing/z3950_auth_search.tt | 15 ++--- .../prog/en/modules/cataloguing/z3950_search.tt | 9 ++- koha-tmpl/intranet-tmpl/prog/js/z3950_search.js | 77 +++++++++++----------- 4 files changed, 57 insertions(+), 61 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/z3950_search.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/z3950_search.tt index f3aab65199..ac22016ad0 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/z3950_search.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/z3950_search.tt @@ -8,9 +8,6 @@ [% USE Koha %] @@ -111,14 +108,13 @@ tr.selected { background-color : #FFFFCC; } tr.selected td { background-color : [% IF ( Koha.Preference('AdditionalFieldsInZ3950ResultSearch') != '' ) %] Additional fields [% END %] - Preview -   + Actions [% FOREACH breeding_loo IN breeding_loop %] [% IF ( breeding_loo.breedingid ) %] - [% breeding_loo.server | html %] + [% breeding_loo.server | html %] [% breeding_loo.title | html %] [% breeding_loo.author | html %] [% breeding_loo.isbn | html %] @@ -137,16 +133,14 @@ tr.selected { background-color : #FFFFCC; } tr.selected td { background-color : [% END %] - [% tp('verb', 'Order') | html %] [% END %] [% END %] @@ -228,6 +222,7 @@ tr.selected { background-color : #FFFFCC; } tr.selected td { background-color : [% INCLUDE 'datatables.inc' %] [% Asset.js("lib/jquery/plugins/jquery.checkboxes.min.js") | $raw %] [% Asset.js("js/z3950_search.js") | $raw %] + [% INCLUDE 'z3950_search.inc' %] - [% INCLUDE 'z3950_search.inc' %] [% END %] [% INCLUDE 'intranet-bottom.inc' %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/z3950_auth_search.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/z3950_auth_search.tt index b66e9d6d99..15e58fb6a2 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/z3950_auth_search.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/z3950_auth_search.tt @@ -89,12 +89,10 @@ [% breeding_loo.heading_code | html %] @@ -103,12 +101,12 @@ [% END %] -