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>
(cherry picked from commit fbec80904f)
Signed-off-by: Baptiste Wojtkowski <baptiste.wojtkowski@biblibre.com>
This commit is contained in:
Owen Leonard 2025-01-28 12:35:15 +00:00 committed by Baptiste Wojtkowski
parent df2c94173e
commit f836b03d2c
No known key found for this signature in database
GPG Key ID: 47A8A13E10BC0D40
1 changed files with 2 additions and 7 deletions

View File

@ -137,7 +137,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><a target="_blank" href="printfeercpt.pl?accountlines_id=[% account.accountlines_id | uri %]" class="receipt-print-action dropdown-item"><i class="fa fa-print"></i> Print</a></li>
@ -147,8 +147,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>
@ -474,11 +474,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 %]