Bugzilla – Attachment 156590 Details for
Bug 14092
Add ability to search on 'all statuses' to orders search
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 14092: Add 'any status' option to acq order search form
Bug-14092-Add-any-status-option-to-acq-order-searc.patch (text/plain), 4.43 KB, created by
Marcel de Rooy
on 2023-10-06 07:10:22 UTC
(
hide
)
Description:
Bug 14092: Add 'any status' option to acq order search form
Filename:
MIME Type:
Creator:
Marcel de Rooy
Created:
2023-10-06 07:10:22 UTC
Size:
4.43 KB
patch
obsolete
>From 4279c4fccaf53b61618587f949eb7f2ada59e948 Mon Sep 17 00:00:00 2001 >From: Katrin Fischer <katrin.fischer@bsz-bw.de> >Date: Fri, 15 Sep 2023 17:09:00 +0000 >Subject: [PATCH] Bug 14092: Add 'any status' option to acq order search form >Content-Type: text/plain; charset=utf-8 > >Sometimes it's really helpful to see all orders for a basket, a >vendor or a standing order, including the cancelled ones. >Currently this is not possible, as we have search options for >every single status and one for "any except cancelled", >but no "Any status" option. > >This patch adds the "Any status" option. The sometimes >appearing empty entry is updated to "Any status except cancelled" >as this is what it does. > >Testing data: >* Requires multiple order lines with different order status >* Must include at least one order line with status 'cancelled' > >To test: >* Go to acquisitions >* Open the advanced search page from the top search options: > Order search > config icon > Advanced search link >* Verify the status pull down looks as described above >* Apply patch >* Verify there is now an "Any status" option in the pull down >* Try searches for different status, including "Any status" >* Verify the results are as expected >* Create a new basket >* Create an order line by 'From an existing order (copy)' >* Verify the search form there also works as expected > >Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> >--- > acqui/duplicate_orders.pl | 12 ++++++++++++ > acqui/histsearch.pl | 10 ++++++++++ > .../intranet-tmpl/prog/en/includes/filter-orders.inc | 7 ++++++- > 3 files changed, 28 insertions(+), 1 deletion(-) > >diff --git a/acqui/duplicate_orders.pl b/acqui/duplicate_orders.pl >index c0b82f5431..d8f38993be 100755 >--- a/acqui/duplicate_orders.pl >+++ b/acqui/duplicate_orders.pl >@@ -82,11 +82,23 @@ $filters->{to_placed_on} = $to_placed_on; > my ( @result_order_loop, @selected_order_loop ); > my @ordernumbers = split ',', scalar $input->param('ordernumbers') || ''; > if ( $op eq 'select' ) { >+ >+ # Set filter for 'all status' >+ if ( $filters->{orderstatus} eq "any" ) { >+ delete( $filters->{orderstatus} ); >+ $filters->{get_canceled_order} = 1; >+ } >+ > @result_order_loop = map { > my $order = $_; > ( grep {$_ eq $order->{ordernumber}} @ordernumbers ) ? () : $order > } @{ C4::Acquisition::GetHistory(%$filters) }; > >+ # Reset order status for 'all status' >+ if ( $filters->{get_canceled_order} ) { >+ $filters->{orderstatus} = "any"; >+ } >+ > @selected_order_loop = > scalar @ordernumbers > ? @{ C4::Acquisition::GetHistory( ordernumbers => \@ordernumbers ) } >diff --git a/acqui/histsearch.pl b/acqui/histsearch.pl >index 097fa3b217..289c1c1e59 100755 >--- a/acqui/histsearch.pl >+++ b/acqui/histsearch.pl >@@ -114,6 +114,11 @@ while ( my $additional_field = $additional_fields->next ) { > } > $filters->{additional_fields} = \@additional_field_filters; > >+# Set filter for 'all status' >+if ( $filters->{orderstatus} eq "any" ) { >+ delete( $filters->{orderstatus} ); >+ $filters->{get_canceled_order} = 1; >+} > > my $order_loop; > # If we're supplied any value then we do a search. Otherwise we don't. >@@ -121,6 +126,11 @@ if ($do_search) { > $order_loop = GetHistory(%$filters); > } > >+# Reset order status for 'all status' >+if ( $filters->{get_canceled_order} ) { >+ $filters->{orderstatus} = "any"; >+} >+ > my $budgetperiods = C4::Budgets::GetBudgetPeriods; > my $bp_loop = $budgetperiods; > for my $bp ( @{$budgetperiods} ) { >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/filter-orders.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/filter-orders.inc >index f23c42fbea..2621455506 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/filter-orders.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/filter-orders.inc >@@ -51,7 +51,12 @@ > [% IF filters.orderstatus == "" %] > <option value="">Any status except cancelled</option> > [% ELSE %] >- <option value="" selected="selected"></option> >+ <option value="" selected="selected">Any status except cancelled</option> >+ [% END %] >+ [% IF filters.orderstatus == "any" %] >+ <option value="any" selected="selected">Any status</option> >+ [% ELSE %] >+ <option value="any">Any status</option> > [% END %] > [% IF filters.orderstatus == "new" %] > <option value="new" selected="selected">New</option> >-- >2.30.2
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 14092
:
38702
|
155851
|
155853
|
156093
|
156097
|
156098
|
156100
|
156101
|
156526
|
156527
| 156590 |
156591