@@ -, +, @@ suggestions of current branch - Create pending suggestions in several branches - Connect with user in koha-conf.xml to have no selected branch (you see NO LIBRARY SET) - On main page, look at "Suggestions pending approval" - Click on this link - In suggestions management page, click on "Go" near "Status" - Come back to main page - Select a branch (with pending suggestions) - On main page, look at "Suggestions pending approval" - Click on this link --- C4/Suggestions.pm | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) --- a/C4/Suggestions.pm +++ a/C4/Suggestions.pm @@ -364,7 +364,7 @@ sub GetSuggestionByStatus { &CountSuggestion($status) -Count the number of aqorders with the status given on input argument. +Count the number of aqorders of current branch and with the status given on input argument. the arg status can be : =over 2 @@ -408,8 +408,13 @@ sub CountSuggestion { FROM suggestions WHERE STATUS=? }; + my @params = ($status); + unless ($userenv->{branch} eq 'NO_LIBRARY_SET') { + $query .= q{ AND branchcode=? }; + push @params, $userenv->{branch}; + } $sth = $dbh->prepare($query); - $sth->execute($status); + $sth->execute(@params); } my ($result) = $sth->fetchrow; return $result; --