[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SF.net SVN: ledger-smb: [128] trunk



Revision: 128
          http://svn.sourceforge.net/ledger-smb/?rev=128&view=rev
Author:   einhverfr
Date:     2006-09-21 23:11:45 -0700 (Thu, 21 Sep 2006)

Log Message:
-----------
Now db custom fields are cached in the $form object.  Also there is now a
$form->{dbh} which is a noauto database handle to be used for all db activities.

Modified Paths:
--------------
    trunk/Changelog
    trunk/LedgerSMB/Form.pm
    trunk/menu.pl

Modified: trunk/Changelog
===================================================================
--- trunk/Changelog	2006-09-21 05:25:51 UTC (rev 127)
+++ trunk/Changelog	2006-09-22 06:11:45 UTC (rev 128)
@@ -1,3 +1,9 @@
+Changelog for LedgerSMB 1.1.1
+
+* Fixed problem with parts_short trigger not being created
+* Fixed problem with custom fields functions not being created
+* Pg driver is now checked by default. 
+
 Changelog for LedgerSMB 1.1.0
 
 Database
@@ -11,6 +17,7 @@
 * Added foreign key constraint to acc_trans.chart_id
 * Database backups now use pg_dump
 * Database creation routines now attempt to add plpgsql to the db if not there.
+* Transaction reversal is now enforced by default
 
 Security
 * One is required to change the admin password when it is blank (on first login etc).

Modified: trunk/LedgerSMB/Form.pm
===================================================================
--- trunk/LedgerSMB/Form.pm	2006-09-21 05:25:51 UTC (rev 127)
+++ trunk/LedgerSMB/Form.pm	2006-09-22 06:11:45 UTC (rev 128)
@@ -1261,6 +1261,25 @@
 
 # Database routines used throughout
 
+sub db_init {
+	my ($self, $myconfig) = @_;
+	$self->{dbh} = $self->dbconnect_noauto($myconfig);
+
+	my $query = 
+		"SELECT t.extends, 
+			coalesce (t.table_name, 'custom_' || extends) 
+			|| ':' || f.field_name as field_def
+		FROM custom_table_catalog t
+		JOIN custom_field_catalog f USING (table_id)";
+	my $sth = $self->{dbh}->prepare($query);
+	$sth->execute;
+	my $ref;
+	while ($ref = $sth->fetchrow_hashref(NAME_lc)){
+		push @{$self->{custom_db_fields}{$ref->{extends}}},
+			$ref->{field_def};
+	}
+}
+
 sub dbconnect {
 
 	my ($self, $myconfig) = @_;

Modified: trunk/menu.pl
===================================================================
--- trunk/menu.pl	2006-09-21 05:25:51 UTC (rev 127)
+++ trunk/menu.pl	2006-09-22 06:11:45 UTC (rev 128)
@@ -107,6 +107,8 @@
 $myconfig{dbpasswd} = unpack 'u', $myconfig{dbpasswd};
 map { $form->{$_} = $myconfig{$_} } qw(stylesheet timeout) unless ($form->{type} eq 'preferences');
 
+$form->db_init(\%myconfig);
+
 if ($form{path} ne 'bin/lynx'){ $form{path} = 'bin/mozilla';}	
 
 # did sysadmin lock us out


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.