From 8e4656991ca316d188f03c726114ebb2c970d686 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. --- .../prog/en/modules/basket/basket.tt | 2 +- .../prog/en/modules/basket/sendbasketform.tt | 23 +++++++++++++--- .../modules/virtualshelves/sendshelfform.tt | 26 +++++++++++++++---- .../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, 44 insertions(+), 16 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 85cf354cd27..6ce053fb4f2 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 108aa1ea927..2817fca762f 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,25 @@ 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

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

Problem sending the cart...

[% END %] - + + + [% ELSE %] [% INCLUDE 'blocking_errors.inc' %] @@ -31,9 +38,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 3817c570344..f7ec0bd828e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/sendshelfform.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/virtualshelves/sendshelfform.tt @@ -2,9 +2,9 @@ Sending your list › Lists › Koha [% INCLUDE 'doc-head-close.inc' %] - + [% INCLUDE 'blocking_errors.inc' %] -
[% IF ( email ) %] +
[% IF ( email ) %] [% IF ( SENT ) %]

Message sent

@@ -12,9 +12,17 @@

Close window

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

Problem sending the list...

+

Problem sending the list...

[% END %] - + + + [% ELSE %]
@@ -32,7 +40,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 9882e5cecf7..9723983cda4 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 f72d58452bf..5a0a21ad84e 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 abb3193bd7e..e10ebdb9b8a 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