Bug 39021: Fix badly formatted dropdown on patron account transactions page

This patch makes minor markup changes in order for the "Email" menu item
to be styled correctly after the Bootstrap upgrade. The patch also
simplifies the submission of the form by removing unnecessary JS event
handling.

To test, apply the patch and locate a patron record to view.

- Open the "Accounting" tab
- Click "Create manual invoice"
- Put a charge on the patron's account and click "Save and pay"
- Pay the charge
- Click "Transactions"
  - In the "Actions" column there should be a "Receipt" menu.
  - The "Email" item should be correctly formatted, matching the "Print"
    entry.
  - Clicking "Email" should result in the page refreshing, with the
    message "Receipt sent" at the top.
  - If you don't have email set up you can confirm that the message was
    queued by creating an SQL report: "SELECT * FROM `message_queue`"
  - The report should show the message with the receipt you emailed.

Sponsored-by: Athens County Public Libraries
Signed-off-by: David Nind <david@davidnind.com>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Owen Leonard 2025-01-28 12:35:15 +00:00 committed by Katrin Fischer
parent 3b207c44cc
commit fbec80904f
No known key found for this signature in database
GPG Key ID: 0EF6E2C03357A834
1 changed files with 2 additions and 7 deletions

View File

@ -144,7 +144,7 @@
<td class="actions">
[% IF ( account.is_credit ) %]
[% IF Koha.Preference('UseEmailReceipts') %]
<div class="btn-group">
<div class="btn-group dropup">
<button class="btn btn-xs btn-default dropdown-toggle" data-bs-toggle="dropdown" aria-expanded="false"><i class="fa fa-receipt"></i> Receipt</button>
<ul class="dropdown-menu dropdown-menu-end">
<li
@ -156,8 +156,8 @@
<input type="hidden" name="op" value="cud-send_receipt" />
<input type="hidden" name="accountlines_id" value="[% account.accountlines_id | html %]" />
<input type="hidden" name="borrowernumber" value="[% account.borrowernumber | html %]" />
<button type="submit" class="dropdown-item receipt-email-action"> <i class="fa fa-envelope"></i> Email </button>
</form>
<a href="#" class="receipt-email-action"><i class="fa fa-envelope"></i> Email</a>
</li>
</ul>
</div>
@ -510,11 +510,6 @@
$("#discount").attr({ "value": (0).format_price(), "max": amountoutstanding, "min": 0 });
$("#discount").focus();
});
$(".receipt-email-action").on("click", function(e){
e.preventDefault();
return $(this).siblings('form').submit();
});
});
</script>
[% END %]