Bugzilla – Attachment 179178 Details for
Bug 37211
All notes in the patron account transactions table should be editable
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 37211: Make notes in patron transactions table editable
Bug-37211-Make-notes-in-patron-transactions-table-.patch (text/plain), 5.84 KB, created by
Lucas Gass (lukeg)
on 2025-03-11 19:43:14 UTC
(
hide
)
Description:
Bug 37211: Make notes in patron transactions table editable
Filename:
MIME Type:
Creator:
Lucas Gass (lukeg)
Created:
2025-03-11 19:43:14 UTC
Size:
5.84 KB
patch
obsolete
>From 3cf21a9bf0fd595b07e4836c77ebe4570255949c Mon Sep 17 00:00:00 2001 >From: Lucas Gass <lucas@bywatersolutions.com> >Date: Tue, 11 Mar 2025 19:23:06 +0000 >Subject: [PATCH] Bug 37211: Make notes in patron transactions table editable > >--- > .../prog/en/modules/members/boraccount.tt | 71 +++++++++++++++++++ > members/boraccount.pl | 22 ++++++ > 2 files changed, 93 insertions(+) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt >index 1d40d4b3c0d..d08a8655a65 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/boraccount.tt >@@ -132,6 +132,21 @@ > [% account.checkout.library.branchname | html %] > [% END %] > </td> >+ <td> >+ [% account.note | html_line_break %] >+ [% IF CAN_user_updatecharges_edit_notes %] >+ <button >+ type="button" >+ class="btn btn-default btn-xs edit-action" >+ data-toggle="modal" >+ data-target="#editNoteModal" >+ data-accountline="[% account.accountlines_id | html %]" >+ data-note="[% account.note | html %]" >+ data-member="[% account.borrowernumber | html %]" >+ ><i class="fa-solid fa-pen"></i> Edit</button >+ > >+ [% END %] >+ </td> > <td>[% IF account.itemnumber %][% Branches.GetName( account.item.homebranch ) | html %][% END %]</td> > <td>[% account.note | html_line_break %]</td> > [% IF account.amount <= 0 %] >@@ -477,6 +492,50 @@ > </div> > <!-- /#voidPaymentModal --> > >+<!-- Edit note modal --> >+<div class="modal" id="editNoteModal" tabindex="-1" role="dialog" aria-labelledby="editNoteLabel"> >+ <form id="edit_form" action="/cgi-bin/koha/members/boraccount.pl" method="post" enctype="multipart/form-data" class="validated"> >+ [% INCLUDE 'csrf-token.inc' %] >+ <input type="hidden" name="accountlines_id" value="" id="noteline" /> >+ <input type="hidden" name="op" value="cud-edit_note" /> >+ <input type="hidden" name="borrowernumber" value="[% account.borrowernumber | html %]" /> >+ >+ <div class="modal-dialog" role="document"> >+ <div class="modal-content"> >+ <div class="modal-header"> >+ <button type="button" class="closebtn" data-dismiss="modal" aria-label="Close"> >+ <span aria-hidden="true">×</span> >+ </button> >+ <h4 class="modal-title" id="editNoteLabel">Edit note</h4> >+ </div> >+ >+ <div class="modal-body"> >+ <fieldset class="rows"> >+ <ol> >+ <li> >+ <label for="edited_note">Note: </label> >+ <input name="edited_note" id="edited_note" value="" /> >+ </li> >+ </ol> >+ </fieldset> >+ <!-- /.rows --> >+ </div> >+ <!-- /.modal-body --> >+ >+ <div class="modal-footer"> >+ <button type="submit" class="btn btn-default">Confirm</button> >+ <button type="button" class="btn btn-default" data-dismiss="modal">Cancel</button> >+ </div> >+ <!-- /.modal-footer --> >+ </div> >+ <!-- /.modal-content --> >+ </div> >+ <!-- /.modal-dialog --> >+ </form> >+ <!-- /#void_form --> >+</div> >+<!-- /#editNoteModal --> >+ > <!-- Cancel charge modal --> > <div class="modal" id="cancelChargeModal" tabindex="-1" role="dialog" aria-labelledby="cancelChangreLabel"> > <form method="post" action="/cgi-bin/koha/members/cancel-charge.pl"> >@@ -606,6 +665,18 @@ > $('#accountlines_id').val(item); > }); > >+ $("#editNoteModal").on("shown.bs.modal", function(e) { >+ var button = $(e.relatedTarget); >+ var item = button.data('item'); >+ $("#item + span").replaceWith(item); >+ >+ var accountline = button.data('accountline'); >+ $('#noteline').val(accountline); >+ >+ var note = button.data('note'); >+ $('#edited_note').val(note); >+ }); >+ > $(".receipt-email-action").on("click", function(e){ > e.preventDefault(); > return $(this).siblings('form').submit(); >diff --git a/members/boraccount.pl b/members/boraccount.pl >index 4798e8ed41a..0332879c7b5 100755 >--- a/members/boraccount.pl >+++ b/members/boraccount.pl >@@ -226,6 +226,28 @@ if ( $op eq 'cud-send_receipt' ) { > } > } > >+if ( $op eq 'cud-edit_note' ) { >+ >+ output_and_exit_if_error( $input, $cookie, $template, { check => 'csrf_token' } ); >+ >+ my $payment_id = scalar $input->param('accountlines_id'); >+ my $note = scalar $input->param('edited_note'); >+ >+ my $payment = Koha::Account::Lines->find($payment_id); >+ >+ $schema->txn_do( >+ sub { >+ # Update the note and date in the account line >+ $payment->set( >+ { >+ date => \'NOW()', >+ note => $note >+ } >+ )->store(); >+ } >+ ); >+} >+ > #get account details > my $total = $patron->account->balance; > >-- >2.39.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 37211
:
168211
|
168212
|
170002
|
170003
|
170218
|
170219
|
177244
|
177245
|
177248
|
177249
|
177250
|
177251
|
177252
|
177261
| 179178 |
179179
|
179180
|
179181
|
179182
|
179963
|
179967
|
179972
|
179977
|
180923