summaryrefslogtreecommitdiff
path: root/LedgerSMB.pm
diff options
context:
space:
mode:
authoreinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2007-07-09 02:21:21 +0000
committereinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2007-07-09 02:21:21 +0000
commitbdff0866f37cded4d1aaabd214ee22209864b0f6 (patch)
tree41a7e40fd585a8fd7bc044226d551c55348ce303 /LedgerSMB.pm
parentae39575800beeff17d7b4ef5a188df850939cd82 (diff)
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
Diffstat (limited to 'LedgerSMB.pm')
-rwxr-xr-xLedgerSMB.pm11
1 files changed, 8 insertions, 3 deletions
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') ) {