From 160bfe32adaa4dc7a8476e8434e2db0f5ea85e22 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 Signed-off-by: Tomas Cohen Arazi --- .../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 4b7d58aabe..36edd9fa2e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/basket/basket.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/basket/basket.tt @@ -67,7 +67,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 7908430f76..a867f96782 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/basket/sendbasketform.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/basket/sendbasketform.tt @@ -7,18 +7,27 @@ [% END %] [% 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' %] @@ -36,9 +45,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 92546a120d..cd4462c0eb 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/sendshelfform.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/sendshelfform.tt @@ -8,19 +8,26 @@ [% END %] [% 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 %]
@@ -38,7 +45,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 397d5f745d..d7288c9376 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/shelves.tt @@ -945,7 +945,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.39.5