From bdff0866f37cded4d1aaabd214ee22209864b0f6 Mon Sep 17 00:00:00 2001 From: einhverfr Date: Mon, 9 Jul 2007 02:21:21 +0000 Subject: Moving menu over to new template and stored proc model. THe menu expansion/contraction doesn't quite work yet and there needs to be some additional help on the CSS/Javascript side of this. Also, this makes a few changes to the lower-level Perl API. Classes calling LedgerSMB::call_procedure() directly may need some editing but I believe I got them all. These changes were necessary to accomodate zero-argument stored procedures. git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@1355 4979c152-3d1c-0410-bac9-87ea11338e46 --- LedgerSMB.pm | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'LedgerSMB.pm') diff --git a/LedgerSMB.pm b/LedgerSMB.pm index 6192fe8d..89aa2f92 100755 --- a/LedgerSMB.pm +++ b/LedgerSMB.pm @@ -536,11 +536,12 @@ sub call_procedure { my $self = shift @_; my %args = @_; my $procname = $args{procname}; - my @args = @{ $args{args} }; + my @call_args; + @call_args = @{ $args{args} } if defined $args{args}; my $order_by = $args{order_by}; my $argstr = ""; my @results; - for ( 1 .. scalar @args ) { + for ( 1 .. scalar @call_args ) { $argstr .= "?, "; } $argstr =~ s/\, $//; @@ -550,7 +551,11 @@ sub call_procedure { } $query =~ s/\(\)/($argstr)/; my $sth = $self->{dbh}->prepare($query); - $sth->execute(@args); + if (scalar @call_args){ + $sth->execute(@call_args); + } else { + $sth->execute(); + } my @types = @{$sth->{TYPE}}; my @names = @{$sth->{NAME_lc}}; while ( my $ref = $sth->fetchrow_hashref('NAME_lc') ) { -- cgit v1.2.3