From 80cdd265613ead646d1084590ce8df9b6435ea84 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Thu, 17 Aug 2023 07:14:26 +0000 Subject: [PATCH] Bug 34553: Update send list and send cart popup footers This patch updates the templates behind the "send cart" and "send list" pop-ups in order to make the style of the footer consistent with some recently-updated similar examples, like the catalog's Z39.50 search popup. The patch also makes a minor change to our global JavaScript include so we can get away from using the "close" class as a trigger for closing a pop-up window. Bootstrap has a built-in "close" class that we always have to override. "close_window" is added as another class to use, and the other instances can be cleaned up overy time. To test, apply the patch and perform a catalog search in the staff interface. - Add one or more items to the cart. - Open the cart popup and click the "Send" button. - In the pop-up window, confirm that the footer looks correct. - Test the process of using the tab key between input fields and submit/cancel buttons. All controls should be accessible. - Test the "Cancel" button to confirm that it closes the window. - Reopen the window and test sending the email. - On the confirmation page, confirm that the footer looks correct and that the "Close window" button works. - Test the same processes in the Lists module: View a list in the staff interface and test the process of sending a list. Signed-off-by: Andrew Auld Signed-off-by: Katrin Fischer --- .../prog/en/modules/basket/basket.tt | 2 +- .../prog/en/modules/basket/sendbasketform.tt | 31 ++++++++++++++----- .../modules/virtualshelves/sendshelfform.tt | 27 ++++++++++++---- .../prog/en/modules/virtualshelves/shelves.tt | 2 +- koha-tmpl/intranet-tmpl/prog/js/basket.js | 5 +-- .../intranet-tmpl/prog/js/staff-global.js | 2 +- 6 files changed, 49 insertions(+), 20 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/basket/basket.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/basket/basket.tt index 85cf354cd2..6ce053fb4f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/basket/basket.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/basket/basket.tt @@ -62,7 +62,7 @@ Print Empty and close - Hide window + Hide window diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/basket/sendbasketform.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/basket/sendbasketform.tt index 108aa1ea92..d5c1f4ae1f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/basket/sendbasketform.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/basket/sendbasketform.tt @@ -2,18 +2,27 @@ Sending your cart › [% IF ( LibraryNameTitle ) %][% LibraryNameTitle | html %][% ELSE %]Koha online[% END %] catalog [% INCLUDE 'doc-head-close.inc' %] - +
[% IF ( email_add ) %] [% IF ( SENT ) %] -

Message sent

-

The cart was sent to: [% email_add | html %]

-

Close window

+
+

Message sent

+

The cart was sent to: [% email_add | html %]

+
[% END %] [% IF ( error ) %] -

Problem sending the cart...

+
Problem sending the cart...
[% END %] - + + + [% ELSE %] [% INCLUDE 'blocking_errors.inc' %] @@ -31,9 +40,17 @@ -
Cancel
+ + [% END %]
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/sendshelfform.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/sendshelfform.tt index 3817c57034..59e585ff27 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/sendshelfform.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/sendshelfform.tt @@ -2,19 +2,26 @@ Sending your list › Lists › Koha [% INCLUDE 'doc-head-close.inc' %] - + [% INCLUDE 'blocking_errors.inc' %] -
[% IF ( email ) %] +
[% IF ( email ) %] [% IF ( SENT ) %]

Message sent

The list was sent to: [% email | html %]

-

Close window

[% END %] [% IF ( error ) %] -

Problem sending the list...

+

Problem sending the list...

[% END %] - + + + [% ELSE %]
@@ -32,7 +39,15 @@
  • -
    Cancel
    + +
    [% END %]
    diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt index ee7b98290c..1221bf7bba 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt @@ -942,7 +942,7 @@ [% IF op == 'view' %] function sendList(){ - open(CGIBIN+'virtualshelves/sendshelf.pl?shelfid=[% shelf.shelfnumber | html %]','win_form','scrollbars=no,resizable=no,height=300,width=450,top=50,left=100'); + openWindow( CGIBIN + 'virtualshelves/sendshelf.pl?shelfid=[% shelf.shelfnumber | html %]' ); } $(document).ready(function() { diff --git a/koha-tmpl/intranet-tmpl/prog/js/basket.js b/koha-tmpl/intranet-tmpl/prog/js/basket.js index f72d58452b..5a0a21ad84 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/basket.js +++ b/koha-tmpl/intranet-tmpl/prog/js/basket.js @@ -367,11 +367,8 @@ function quit() { function sendBasket() { var valCookie = readCookie(nameCookie); var strCookie = nameParam + "=" + valCookie; - var loc = CGIBIN + "basket/sendbasket.pl?" + strCookie; - - var optWin="scrollbars=no,resizable=no,height=400,width=650,top=50,left=100"; - open(loc,"win_form",optWin); + openWindow( loc, "win_form" ); } function downloadBasket() { diff --git a/koha-tmpl/intranet-tmpl/prog/js/staff-global.js b/koha-tmpl/intranet-tmpl/prog/js/staff-global.js index 3f62a2f6c0..0c274c3a7f 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/staff-global.js +++ b/koha-tmpl/intranet-tmpl/prog/js/staff-global.js @@ -59,7 +59,7 @@ $(document).ready(function() { $( e.target.hash ).find("input:text:first").focus(); }); - $(".close").click(function(){ window.close(); }); + $(".close, .close_window").click(function(){ window.close(); }); $("#checkin_search form").preventDoubleFormSubmit(); -- 2.30.2