From e4aa38ede1fa2f02d4ce9fb8641813092e56b6be Mon Sep 17 00:00:00 2001 From: Kyle M Hall Date: Wed, 14 May 2014 11:29:52 -0400 Subject: [PATCH] Bug 12257 - Suggestions management displays all librarians as "Unknown" If you inspect the filter pulldowns for suggested, accepted, or managed by, all the users are listed as "Unknown" instead of his or her name. Test Plan: 1) Browse to suggestions/suggestion.pl 2) Check the Suggested by, Managed by, and/or Accepted by pulldowns 3) Note the names are all listed as "Unknown" 4) Apply this patch 5) Reload the page 6) Note the names now appear --- suggestion/suggestion.pl | 16 ++++++++++------ 1 files changed, 10 insertions(+), 6 deletions(-) diff --git a/suggestion/suggestion.pl b/suggestion/suggestion.pl index 949cca3..323ad12 100755 --- a/suggestion/suggestion.pl +++ b/suggestion/suggestion.pl @@ -59,22 +59,26 @@ sub Init{ sub GetCriteriumDesc{ my ($criteriumvalue,$displayby)=@_; - unless ( grep { /$criteriumvalue/ } qw(ASKED ACCEPTED REJECTED CHECKED) ) { - return GetAuthorisedValueByCode('SUGGEST_STATUS', $criteriumvalue ) || "Unknown"; - } - 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 =~/suggestedby/||$displayby =~/managedby/||$displayby =~/acceptedby/){ my $borr=C4::Members::GetMember(borrowernumber=>$criteriumvalue); return "" unless $borr; return $$borr{surname} . ", " . $$borr{firstname}; } + if ( $displayby =~ /budgetid/) { my $budget = GetBudget($criteriumvalue); return "" unless $budget; return $$budget{budget_name}; } + + unless ( grep { /$criteriumvalue/ } qw(ASKED ACCEPTED REJECTED CHECKED) ) { + return GetAuthorisedValueByCode('SUGGEST_STATUS', $criteriumvalue ) || "Unknown"; + } + + return ($criteriumvalue eq 'ASKED'?"Pending":ucfirst(lc( $criteriumvalue))) if ($displayby =~/status/i); + return (GetBranchName($criteriumvalue)) if ($displayby =~/branchcode/); + return (GetSupportName($criteriumvalue)) if ($displayby =~/itemtype/); } my $input = CGI->new; -- 1.7.2.5