Bug 8230: (follow-up) repair regression on order search

This patch repairs a regression introduced by the main
patch where it became impossible to search for cancelled
orders from the advanced order search form.

This patch also tweaks the wording on the order status
drop-down on the order search form to clarify that the
default status filter is orders that have any status
except cancelled.

To test:

[1] Before applying this patch, perform an advanced
    order search (acqui/histsearch.pl) for orders
    with status cancelled.  Observe that no hits are returned.
[2] Apply the patch and run the search again.  This time,
    the cancelled orders should be returned.

Signed-off-by: Galen Charlton <gmc@esilibrary.com>
(cherry picked from commit 44eb833889)
Signed-off-by: Fridolin SOMERS <fridolin.somers@biblibre.com>
This commit is contained in:
Galen Charlton 2013-12-13 23:42:26 +00:00 committed by Fridolin SOMERS
parent 0929a7e2b6
commit 896a62b43b
2 changed files with 4 additions and 3 deletions

View File

@ -2241,8 +2241,9 @@ sub GetHistory {
$query .= " WHERE 1 ";
$query .= " AND (datecancellationprinted is NULL or datecancellationprinted='0000-00-00') "
if not $get_canceled_order or ( defined $orderstatus and $orderstatus ne 'cancelled' );
unless ($get_canceled_order or (defined $orderstatus and $orderstatus eq 'cancelled')) {
$query .= " AND (datecancellationprinted is NULL or datecancellationprinted='0000-00-00') ";
}
my @query_params = ();

View File

@ -52,7 +52,7 @@
<label for="orderstatus">Order status: </label>
<select name="orderstatus" id="orderstatus">
[% IF orderstatus == "" %]
<option value=""></option>
<option value="">Any status except cancelled</option>
[% ELSE %]
<option value="" selected="selected"></option>
[% END %]