From afcd869faeb5756c4b5578c07da1e02fee9f225e Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Fri, 17 Nov 2023 16:29:39 +0000 Subject: [PATCH] Bug 35362: Update patron module pop-up windows with consistent footer markup This patch updates two patron-related templates in order to style submission and close buttons in a fixed footer at the bottom of the window, with markup consistent with other pop-up windows. The patch also updates the "Update child" popup js so that it uses the same window-opening function we use elsewhere. I also added form validation to the category selection form to help prevent errors if someone submits the form without making a selection. To test, apply the patch and go to the Patrons module - Click "New patron" and add a patron with the same first and last name of a patron already in the database. - When you save the new patron record the page should reload with an error message: "Duplicate patron record?" - Click "View existing record" - A pop-up window should appear with patron information. - Confirm that the window's footer looks correct. - Locate a patron with an age-limited child category. In the sample data the "Juvenile" category works. - View the patron detail page and click More -> Update child to adult patron. - A pop-up window should appear with patron category selection options. - Try submitting the form without making a selection. You should see a message about fields being required. - Select a category and submit the form to confirm that the controls work correctly. Signed-off-by: Lucas Gass Signed-off-by: Kyle M Hall Signed-off-by: Katrin Fischer --- .../en/modules/members/moremember-brief.tt | 13 +++++++----- .../prog/en/modules/members/update-child.tt | 21 ++++++++++++++----- .../intranet-tmpl/prog/js/members-menu.js | 2 +- 3 files changed, 25 insertions(+), 11 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember-brief.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember-brief.tt index bec0c9c4fa..4c07cbf432 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember-brief.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember-brief.tt @@ -92,10 +92,13 @@ -
-
-
-
-
+ + [% INCLUDE 'intranet-bottom.inc' popup_window=1 %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/update-child.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/update-child.tt index 9f7e5e700c..0f019bd3b4 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/update-child.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/update-child.tt @@ -19,7 +19,7 @@

Choose adult category

[% IF patron_categories %] -
+ [% INCLUDE 'csrf-token.inc' %]
@@ -45,11 +45,15 @@ -
- - Cancel -
+ [% END %] [% END %] @@ -68,6 +72,13 @@ ], "paginate": false })); + $("#updatechildf").validate({ + rules: { + catcode: { + required: true, + }, + } + }); }); [% IF ( SUCCESS ) %] diff --git a/koha-tmpl/intranet-tmpl/prog/js/members-menu.js b/koha-tmpl/intranet-tmpl/prog/js/members-menu.js index c3989d98aa..cbd91ce13e 100644 --- a/koha-tmpl/intranet-tmpl/prog/js/members-menu.js +++ b/koha-tmpl/intranet-tmpl/prog/js/members-menu.js @@ -127,7 +127,7 @@ function confirm_updatechild() { function update_child() { if( number_of_adult_categories > 1 ){ - window.open('/cgi-bin/koha/members/update-child.pl?op=multi&borrowernumber=' + borrowernumber,'UpdateChild','width=400,height=300,toolbar=no,scrollbars=yes,resizable=yes'); + openWindow('/cgi-bin/koha/members/update-child.pl?op=multi&borrowernumber=' + borrowernumber,'UpdateChild'); } else { confirm_updatechild(); } -- 2.39.5