From 24708fad478ce6484e7a6987e17ffa58855b7d27 Mon Sep 17 00:00:00 2001 From: einhverfr Date: Mon, 30 Jun 2008 21:24:59 +0000 Subject: Adding batch_search_mini api Addressing issue on create batch screen of searching through all batches Adding error message in LedgerSMB::call_procedure if procname is undefined. git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@2178 4979c152-3d1c-0410-bac9-87ea11338e46 --- LedgerSMB/Batch.pm | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'LedgerSMB/Batch.pm') diff --git a/LedgerSMB/Batch.pm b/LedgerSMB/Batch.pm index 142a6bb4..34d0185c 100644 --- a/LedgerSMB/Batch.pm +++ b/LedgerSMB/Batch.pm @@ -31,11 +31,26 @@ sub get_search_criteria { } sub get_search_results { - my ($self) = @_; - @{$self->{search_results}} = $self->exec_method(funcname => 'batch_search'); + my ($self, $args) = @_; + if ($args->{mini}){ + $search_proc = "batch_search_mini"; + } else { + $search_proc = "batch_search"; + } + @{$self->{search_results}} = $self->exec_method(funcname => $search_proc); return @{$self->{search_results}}; } +sub get_class_id { + my ($self, $type) = @_; + @results = $self->call_procedure( + procname => 'batch_get_class_id', + args => [$type] + ); + my $result = pop @results; + return $result->{batch_get_class_id}; +} + sub post { my ($self) = @_; ($self->{post_return_ref}) = $self->exec_method(funcname => 'batch_post'); -- cgit v1.2.3