# Suite 330, Boston, MA 02111-1307 USA
use strict;
+#use warnings; FIXME - Bug 2505
require Exporter;
use CGI;
use C4::Auth; # get_template_and_user
if ($displayby =~/managedby/||$displayby =~/acceptedby/){
my $borr=C4::Members::GetMember(borrowernumber=>$criteriumvalue);
return "" unless $borr;
-# warn '$borr : ',Data::Dumper::Dumper($borr);
- return $$borr{firstname}.", ".$$borr{surname};
- }
+ return $$borr{firstname} . ", " . $$borr{surname};
+ }
+ if ( $displayby =~ /budgetid/) {
+ my $budget = GetBudget($criteriumvalue);
+ return "" unless $budget;
+ return $$budget{budget_name};
+ }
}
my $input = CGI->new;
# the index parameter is different for item-level itemtypes
my $supportlist=GetSupportList();
foreach my $support(@$supportlist){
- $$support{'selected'}= $$support{'code'} eq $$suggestion_ref{'itemtype'};
+ $$support{'selected'}= $$support{'itemtype'} eq $$suggestion_ref{'itemtype'};
if ($$support{'imageurl'}){
$$support{'imageurl'}= getitemtypeimagelocation( 'intranet', $$support{'imageurl'} );
}
}
$template->param(itemtypeloop=>$supportlist);
+my $patron_reason_loop = GetAuthorisedValues("OPAC_SUG",$$suggestion_ref{'patronreason'});
+$template->param(patron_reason_loop=>$patron_reason_loop);
+
#Budgets management
my $searchbudgets={ budget_branchcode=>$branchfilter} if $branchfilter;
my $budgets = GetBudgets($searchbudgets);
$template->param( budgetsloop => $budgets);
-my %hashlists;
-foreach my $field qw(managedby acceptedby suggestedby STATUS){
+# get currencies and rates
+my @rates = GetCurrencies();
+my $count = scalar @rates;
+
+my @loop_currency = ();
+for ( my $i = 0 ; $i < $count ; $i++ ) {
+ my %line;
+ $line{currcode} = $rates[$i]->{'currency'};
+ $line{rate} = $rates[$i]->{'rate'};
+ $line{selected} = 1 if ($$suggestion_ref{'currency'} && $line{'currcode'} eq $$suggestion_ref{'currency'});
+ push @loop_currency, \%line;
+}
+
+$template->param(loop_currency => \@loop_currency);
+
+$template->param(
+ price => sprintf("%.2f", $$suggestion_ref{'price'}||0),
+ total => sprintf("%.2f", $$suggestion_ref{'total'}||0),
+);
+
+my %hashlists;
+foreach my $field qw(managedby acceptedby suggestedby budgetid STATUS) {
my $values_list;
$values_list=GetDistinctValues("suggestions.".$field) ;
my @codes_list = map{
$hashlists{lc($field)."_loop"}=\@codes_list;
}
$template->param(%hashlists);
-
+$template->param(DHTMLcalendar_dateformat => C4::Dates->DHTMLcalendar(),);
output_html_with_http_headers $input, $cookie, $template->output;