From d0981fba0634c46c48ac17bc78a00bb1ad2bdfef Mon Sep 17 00:00:00 2001 From: Henri-Damien LAURENT Date: Wed, 26 Aug 2009 01:40:22 +0200 Subject: [PATCH] Suggestions : Adding default value for STATUS Signed-off-by: Galen Charlton --- C4/Suggestions.pm | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/C4/Suggestions.pm b/C4/Suggestions.pm index b31772f0ee..1c90ff0dc7 100644 --- a/C4/Suggestions.pm +++ b/C4/Suggestions.pm @@ -111,7 +111,7 @@ sub SearchSuggestion { LEFT JOIN categories AS C1 ON C1.categorycode = U1.categorycode LEFT JOIN branches AS B1 ON B1.branchcode = U1.branchcode LEFT JOIN branches AS B2 ON B2.branchcode = U2.branchcode - WHERE status NOT IN ('CLAIMED') + WHERE STATUS NOT IN ('CLAIMED') } , map { if ( my $s = $$suggestion{$_} ) { push @sql_params,'%'.$s.'%'; @@ -132,7 +132,7 @@ sub SearchSuggestion { foreach my $field (grep { my $fieldname=$_; any {$fieldname eq $_ } qw< - status branchcode itemtype suggestedby managedby acceptedby + STATUS branchcode itemtype suggestedby managedby acceptedby bookfundid biblionumber >} keys %$suggestion ) { @@ -288,7 +288,7 @@ sub CountSuggestion { my $query = qq | SELECT count(*) FROM suggestions - WHERE status=? + WHERE STATUS=? |; $sth = $dbh->prepare($query); $sth->execute($status); @@ -297,7 +297,7 @@ sub CountSuggestion { my $query = qq | SELECT count(*) FROM suggestions LEFT JOIN borrowers ON borrowers.borrowernumber=suggestions.suggestedby - WHERE status=? + WHERE STATUS=? AND (borrowers.branchcode='' OR borrowers.branchcode =?) |; $sth = $dbh->prepare($query); @@ -308,7 +308,7 @@ sub CountSuggestion { my $query = qq | SELECT count(*) FROM suggestions - WHERE status=? + WHERE STATUS=? |; $sth = $dbh->prepare($query); $sth->execute($status); @@ -328,6 +328,7 @@ Insert a new suggestion on database with value given on input arg. sub NewSuggestion { my ($suggestion) = @_; + $suggestion->{STATUS}="ASKED" unless $suggestion->{STATUS}; return InsertInTable("suggestions",$suggestion); } -- 2.39.5