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 <lucas@bywatersolutions.com>

Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Owen Leonard 2023-11-17 16:29:39 +00:00 committed by Katrin Fischer
parent 58b89df435
commit afcd869fae
No known key found for this signature in database
GPG Key ID: 0EF6E2C03357A834
3 changed files with 25 additions and 11 deletions

View File

@ -92,10 +92,13 @@
</div>
</div>
</div>
<div class="row">
<div class="col-xs-12">
<fieldset class="action"><input type="button" class="close" value="Close window" /></fieldset>
</div>
</div>
<nav class="navbar navbar-default navbar-fixed-bottom">
<div class="container-fluid">
<fieldset class="action">
<button type="button" class="btn btn-default close_window focus">Close window</button>
</fieldset>
</div>
</nav>
[% INCLUDE 'intranet-bottom.inc' popup_window=1 %]

View File

@ -19,7 +19,7 @@
<h1> Choose adult category </h1>
[% IF patron_categories %]
<form method="post" action="update-child.pl">
<form method="post" id="updatechildf" action="update-child.pl">
[% INCLUDE 'csrf-token.inc' %]
<fieldset>
<table id="catst">
@ -45,11 +45,15 @@
<input type="hidden" name="op" value="cud-update" />
<input type="hidden" name="borrowernumber" value="[% borrowernumber | html %]" />
<input type="hidden" name="cattype" value="[% cattype | html %]" />
<fieldset class="action">
<input class="submit" type="submit" value="Submit" />
<a href="#" class="cancel close">Cancel</a>
</fieldset>
</fieldset>
<nav class="navbar navbar-default navbar-fixed-bottom">
<div class="container-fluid">
<fieldset class="action">
<input class="btn btn-primary" type="submit" value="Submit" />
<button type="button" class="btn btn-default close_window">Cancel</button>
</fieldset>
</div>
</nav>
</form>
[% END %]
[% END %]
@ -68,6 +72,13 @@
],
"paginate": false
}));
$("#updatechildf").validate({
rules: {
catcode: {
required: true,
},
}
});
});
</script>
[% IF ( SUCCESS ) %]

View File

@ -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();
}