summaryrefslogtreecommitdiff
path: root/LedgerSMB
diff options
context:
space:
mode:
authoreinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2006-09-23 06:03:43 +0000
committereinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2006-09-23 06:03:43 +0000
commit5cf7df87f87c8333dd6deab69af218e37970bc94 (patch)
treee21482bd109112c0ab003f5f3798fae1c2b569f4 /LedgerSMB
parent36c7b7c2ddf580547a1d4a0cd86a3c8bb32e48ca (diff)
Fixed issues with the creation of function in the upgrade scripts and function
files git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@136 4979c152-3d1c-0410-bac9-87ea11338e46
Diffstat (limited to 'LedgerSMB')
-rwxr-xr-xLedgerSMB/Form.pm26
1 files changed, 26 insertions, 0 deletions
diff --git a/LedgerSMB/Form.pm b/LedgerSMB/Form.pm
index 07c1b3c6..6bca3ddd 100755
--- a/LedgerSMB/Form.pm
+++ b/LedgerSMB/Form.pm
@@ -1280,6 +1280,32 @@ sub db_init {
}
}
+sub get_custom_queries {
+ my ($self, $tablename) = @_;
+ my @rc;
+ my %temphash;
+ my @elements;
+ my $query;
+ for (@{$self->{custom_db_fields}{$tablename}}){
+ @elements = split (/:/, $_);
+ push @{$temphash{$elements[0]}}, $elements[1];
+ }
+ for (keys %temphash){
+ $query = "SELECT ";
+ my $first = 1;
+ for (@{$temphash{$_}}){
+ $query .= "$_";
+ if ($first == 0){
+ $query .= ", "
+ }
+ $first = 0;
+ }
+ $query .= " FROM $_ WHERE field_id = ?";
+ push @rc, $query;
+ }
+ @rc;
+}
+
sub dbconnect {
my ($self, $myconfig) = @_;