Bug 38766: Use uri filter for all parameters in referer link

Also fixes the confirmation message for deleting.

To test:
1. Go to Acquisitions and create some invoices
    i. Search for a vendor (can submit a blank search box)
    ii. Click on vendor name
    iii. Click "Receive shipments" button
    iv. In the "Receive a new shipment" section, enter any value in the
        "Vendor invoice" field and click "Next"
    v. Click the "My Vendor" breadcrumb and repeat iii-iv a few times
2. Go to Acquisitions > Invoices
3. Specify search filters for shipment to/from dates (that include the
   invoices you entered) and search for invoices
4. Try opening, closing, and deleting individual invoices using the
   Action menu
--> Internal server error! "The given date <date> does not match the
    date format (iso)".
--> Also, note that there is no confirmation dialog when deleting
5. Apply patch
6. Repeat steps 2-4
--> Confirm that invoices can be opened and closed using the drop-down
    menu with no issue
--> Confirm that both open and closed invoices can be deleted with no
    issue, and that a confirmation message displays before deleting

Note for QA: search for $KohaDates within invoices.tt, and confirm that
the $KohaDates filter is now only used for display, never for Internal
data storage/flow

Signed-off-by: Brendan Lawlor <blawlor@clamsnet.org>
Signed-off-by: Katrin Fischer <katrin.fischer@bsz-bw.de>
This commit is contained in:
Emily Lamancusa 2024-12-20 12:43:14 -05:00 committed by Katrin Fischer
parent 674ff624b3
commit 47f35a4017
No known key found for this signature in database
GPG Key ID: 0EF6E2C03357A834
1 changed files with 3 additions and 6 deletions

View File

@ -104,16 +104,16 @@
<li><a class="dropdown-item" href="/cgi-bin/koha/acqui/invoice.pl?invoiceid=[% invoice.invoiceid | uri %]"><i class="fa fa-search"></i> Details</a></li>
[% IF invoice.closedate %]
[% IF CAN_user_acquisition_reopen_closed_invoices %]
<li><a class="dropdown-item submit-form-link" data-action="invoice.pl" data-op="cud-reopen" data-invoiceid="[% invoice.invoiceid | uri %]" data-referer="/cgi-bin/koha/acqui/invoices.pl?op=do_search&invoicenumber=[% invoicenumber | html %]&supplier=[% booksellerid | html %]&shipmentdatefrom=[% shipmentdatefrom | $KohaDates %]&shipmentdateto=[% shipmentdateto | $KohaDates %]&billingdatefrom=[% billingdatefrom | $KohaDates %]&billingdateto=[% billingdateto | $KohaDates %]&isbneanissn=[% isbneanissn | html %]&title=[% title | html %]&author=[% author | html %]&publisher=[% publisher | html %]&publicationyear=[% publicationyear | html %]&branch=[% branch | html %]" data-method="post"><i class="fa-solid fa-rotate"></i> Reopen</a></li>
<li><a class="dropdown-item submit-form-link" data-action="invoice.pl" data-op="cud-reopen" data-invoiceid="[% invoice.invoiceid | uri %]" data-referer="/cgi-bin/koha/acqui/invoices.pl?op=do_search&invoicenumber=[% invoicenumber | uri %]&supplier=[% booksellerid | uri %]&shipmentdatefrom=[% shipmentdatefrom | uri %]&shipmentdateto=[% shipmentdateto | uri %]&billingdatefrom=[% billingdatefrom | uri %]&billingdateto=[% billingdateto | uri %]&isbneanissn=[% isbneanissn | uri %]&title=[% title | uri %]&author=[% author | uri %]&publisher=[% publisher | uri %]&publicationyear=[% publicationyear | uri %]&branch=[% branch | uri %]" data-method="post"><i class="fa-solid fa-rotate"></i> Reopen</a></li>
[% END %]
[% ELSE %]
[% IF CAN_user_acquisition_edit_invoices %]
<li><a class="dropdown-item submit-form-link" data-action="invoice.pl" data-op="cud-close" data-invoiceid="[% invoice.invoiceid | html %]" data-referer="/cgi-bin/koha/acqui/invoices.pl?op=do_search&invoicenumber=[% invoicenumber | html %]&supplier=[% booksellerid | html %]&shipmentdatefrom=[% shipmentdatefrom | $KohaDates %]&shipmentdateto=[% shipmentdateto | $KohaDates %]&billingdatefrom=[% billingdatefrom | $KohaDates %]&billingdateto=[% billingdateto | $KohaDates %]&isbneanissn=[% isbneanissn | html %]&title=[% title | html %]&author=[% author | html %]&publisher=[% publisher | html %]&publicationyear=[% publicationyear | html %]&branch=[% branch | html %]" data-method="post"><i class="fa fa-times-circle"></i> Close</a></li>
<li><a class="dropdown-item submit-form-link" data-action="invoice.pl" data-op="cud-close" data-invoiceid="[% invoice.invoiceid | html %]" data-referer="/cgi-bin/koha/acqui/invoices.pl?op=do_search&invoicenumber=[% invoicenumber | uri %]&supplier=[% booksellerid | uri %]&shipmentdatefrom=[% shipmentdatefrom | uri %]&shipmentdateto=[% shipmentdateto | uri %]&billingdatefrom=[% billingdatefrom | uri %]&billingdateto=[% billingdateto | uri %]&isbneanissn=[% isbneanissn | uri %]&title=[% title | uri %]&author=[% author | uri %]&publisher=[% publisher | uri %]&publicationyear=[% publicationyear | uri %]&branch=[% branch | uri %]" data-method="post"><i class="fa fa-times-circle"></i> Close</a></li>
[% END %]
[% END # /IF invoice.closedate %]
[% UNLESS invoice.receivedbiblios || invoice.receiveditems %]
[% IF CAN_user_acquisition_delete_invoices %]
<li><a class="dropdown-item submit-form-link" data-action="invoice.pl" data-op="cud-delete" data-invoiceid="[% invoice.invoiceid | html %]" data-referer="/cgi-bin/koha/acqui/invoices.pl?op=do_search&invoicenumber=[% invoicenumber | html %]&supplier=[% booksellerid | html %]&shipmentdatefrom=[% shipmentdatefrom | $KohaDates %]&shipmentdateto=[% shipmentdateto | $KohaDates %]&billingdatefrom=[% billingdatefrom | $KohaDates %]&billingdateto=[% billingdateto | $KohaDates %]&isbneanissn=[% isbneanissn | uri %]&title=[% title | html %]%26author=[% author | html %]&publisher=[% publisher | html %]&publicationyear=[% publicationyear | html %]&branch=[% branch | html %]" data-method="post"><i class="fa fa-trash-can"></i> Delete</a></li>
<li><a class="dropdown-item submit-form-link" data-action="invoice.pl" data-op="cud-delete" data-confirmation-msg="Are you sure you want to delete this invoice?" data-invoiceid="[% invoice.invoiceid | html %]" data-referer="/cgi-bin/koha/acqui/invoices.pl?op=do_search&invoicenumber=[% invoicenumber | uri %]&supplier=[% booksellerid | uri %]&shipmentdatefrom=[% shipmentdatefrom | uri %]&shipmentdateto=[% shipmentdateto | uri %]&billingdatefrom=[% billingdatefrom | uri %]&billingdateto=[% billingdateto | uri %]&isbneanissn=[% isbneanissn | uri %]&title=[% title | uri %]&author=[% author | uri %]&publisher=[% publisher | uri %]&publicationyear=[% publicationyear | uri %]&branch=[% branch | uri %]" data-method="post"><i class="fa fa-trash-can"></i> Delete</a></li>
[% END %]
[% END %]
</ul>
@ -440,9 +440,6 @@
});
});
$(".delete_invoice").click(function(){
return confirmDelete(_("Are you sure you want to delete this invoice?"));
});
var resultst = $("table.result").dataTable($.extend(true, {}, dataTablesDefaults, {
"paging": false,
"columnDefs": [