From c0c3be24bdd3656f6eb3d9bc3aa42755b8d42b40 Mon Sep 17 00:00:00 2001 From: Alex Arnaud Date: Tue, 25 May 2010 14:40:59 +0200 Subject: [PATCH] (BUG #4811) suggestion.pl: display borrowers name in suggestion information filters (Suggested By, Managed by, Accepted by) --- C4/Search.pm | 2 +- .../prog/en/modules/suggestion/suggestion.tmpl | 4 ++-- suggestion/suggestion.pl | 6 +++--- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/C4/Search.pm b/C4/Search.pm index 2ddc268..1c7bdd6 100644 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -2541,7 +2541,7 @@ sub GetDistinctValues { my $dbh = C4::Context->dbh; warn "select DISTINCT($column) as value, count(*) as cnt from $table group by lib order by $column " if $DEBUG; my $sth = $dbh->prepare( - "select DISTINCT($column) as value, count(*) as cnt from $table " . ( $string ? " where $column like \"$string%\"" : "" ) . "group by value order by $column " ); + "select DISTINCT($column) as value, count(*) as cnt from $table " . ( $string ? " where $column like \"$string%\" and $column is not null " : " where $column is not null " ) . "group by value order by $column " ); $sth->execute; my $elements = $sth->fetchall_arrayref( {} ); return $elements; diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tmpl index 30350ac..74cc5fb 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tmpl @@ -305,11 +305,11 @@ h4.collapse a { font-size : 80%; text-decoration: none; } fieldset.brief ol { di
  • diff --git a/suggestion/suggestion.pl b/suggestion/suggestion.pl index ed190ac..4358811 100755 --- a/suggestion/suggestion.pl +++ b/suggestion/suggestion.pl @@ -57,7 +57,7 @@ sub GetCriteriumDesc { return ( $criteriumvalue eq 'ASKED' ? "Pending" : ucfirst( lc($criteriumvalue) ) ) if ( $displayby =~ /status/i ); return ( GetBranchName($criteriumvalue) ) if ( $displayby =~ /branchcode/ ); return ( GetSupportName($criteriumvalue) ) if ( $displayby =~ /itemtype/ ); - if ( $displayby =~ /managedby/ || $displayby =~ /acceptedby/ ) { + if ( $displayby =~ /managedby/ || $displayby =~ /acceptedby/ || $displayby =~ /suggestedby/) { my $borr = C4::Members::GetMember( borrowernumber => $criteriumvalue ); return "" unless $borr; @@ -125,8 +125,8 @@ if ( $op =~ /save/i ) { } elsif ( $op eq "change" ) { if ( $$suggestion_ref{"STATUS"} ) { if ( my $tmpstatus = lc( $$suggestion_ref{"STATUS"} ) =~ /ACCEPTED|REJECTED/i ) { - $$suggestion_ref{ "$tmpstatus" . "date" } = C4::Dates->today; - $$suggestion_ref{ "$tmpstatus" . "by" } = C4::Context->userenv->{number}; + $$suggestion_ref{ lc( $$suggestion_ref{"STATUS"}) . "date" } = C4::Dates->today; + $$suggestion_ref{ lc( $$suggestion_ref{"STATUS"}) . "by" } = C4::Context->userenv->{number}; } $$suggestion_ref{"manageddate"} = C4::Dates->today; $$suggestion_ref{"managedby"} = C4::Context->userenv->{number}; -- 1.6.3.3