From 6b7eb7a447d4d9ce844b944f6d7b58d58098f169 Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Tue, 26 Mar 2013 09:58:57 -0400 Subject: [PATCH] Bug 9928 - no way to see all purchase suggestions at all Test Plan: 1) Apply patch 3) Create suggestions for multiple libraries 2) Select 'Any' for the 'For' field under 'Acquisition information' 3) Note you are seeing the suggestions for all branches Signed-off-by: Nicole C. Engard Works as described Signed-off-by: Chris Cormack Signed-off-by: Katrin Fischer Patch fixes wrong behaviour. All tests and QA script pass. Signed-off-by: Jared Camins-Esakov --- C4/Suggestions.pm | 13 ++++++++++++- .../prog/en/modules/suggestion/suggestion.tt | 4 ++-- 2 files changed, 14 insertions(+), 3 deletions(-) diff --git a/C4/Suggestions.pm b/C4/Suggestions.pm index ddd1d6a088..131f117b07 100644 --- a/C4/Suggestions.pm +++ b/C4/Suggestions.pm @@ -143,11 +143,22 @@ sub SearchSuggestion { }; } } + } else { + if ( defined $suggestion->{branchcode} && $suggestion->{branchcode} ) { + unless ( $suggestion->{branchcode} eq '__ANY__' ) { + push @sql_params, $suggestion->{branchcode}; + push @query, qq{ AND suggestions.branchcode=? }; + } + } else { + push @query, qq{ + AND (suggestions.branchcode='' OR suggestions.branchcode IS NULL) + }; + } } # filter on nillable fields foreach my $field ( - qw( STATUS branchcode itemtype suggestedby managedby acceptedby budgetid biblionumber ) + qw( STATUS itemtype suggestedby managedby acceptedby budgetid biblionumber ) ) { if ( exists $suggestion->{$field} ) { diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt index fcb8eca79e..f8566c9dfd 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt @@ -325,7 +325,7 @@ $(document).ready(function() { calcNewsuggTotal(); });
Acquisition information
  1. @@ -555,7 +555,7 @@ $(document).ready(function() { calcNewsuggTotal(); });
-- 2.39.5