diff options
author | khoff <khoff> | 2003-07-07 22:44:40 +0000 |
---|---|---|
committer | khoff <khoff> | 2003-07-07 22:44:40 +0000 |
commit | 5b48183ad64fb7ea119c994ed1a921fcda4a0f9d (patch) | |
tree | e94310cfda08657f475d69cf47b8e4d2d68cd647 /FS | |
parent | 0b6bf02cff2b9cffaea70d81de9396a3a4f56b5d (diff) |
Various virtual field UI updates/bug fixes. Fixed ordered qsearches.
Diffstat (limited to 'FS')
-rw-r--r-- | FS/FS/Record.pm | 6 | ||||
-rwxr-xr-x | FS/bin/freeside-setup | 28 |
2 files changed, 31 insertions, 3 deletions
diff --git a/FS/FS/Record.pm b/FS/FS/Record.pm index 8f31c204a..f0da22798 100644 --- a/FS/FS/Record.pm +++ b/FS/FS/Record.pm @@ -326,12 +326,14 @@ sub qsearch { my %result; tie %result, "Tie::IxHash"; @virtual_fields = "FS::$table"->virtual_fields; + + my @stuff = @{ $sth->fetchall_arrayref( {} ) }; if($pkey) { - %result = %{ $sth->fetchall_hashref( $pkey ) }; + %result = map { $_->{$pkey}, $_ } @stuff; } else { - my @stuff = @{ $sth->fetchall_arrayref( {} ) }; @result{@stuff} = @stuff; } + $sth->finish; if ( keys(%result) and @virtual_fields ) { $statement = diff --git a/FS/bin/freeside-setup b/FS/bin/freeside-setup index 734744efe..a5cfc167a 100755 --- a/FS/bin/freeside-setup +++ b/FS/bin/freeside-setup @@ -1031,7 +1031,7 @@ sub tables_hash_hack { 'columns' => [ 'routernum', 'serial', '', '', 'routername', 'varchar', '', $char_d, - 'svcnum', 'int', '0', '', + 'svcnum', 'int', 'NULL', '', ], 'primary_key' => 'routernum', 'unique' => [], @@ -1122,6 +1122,32 @@ sub tables_hash_hack { 'index' => [], }, + 'part_virtual_field' => { + 'columns' => [ + 'vfieldpart', 'int', '', '', + 'dbtable', 'varchar', '', 32, + 'name', 'varchar', '', 32, + 'check_block', 'text', 'NULL', '', + 'length', 'int', 'NULL', '', + 'list_source', 'text', 'NULL', '', + 'label', 'varchar', 'NULL', 80, + ], + 'primary_key' => 'vfieldpart', + 'unique' => [], + 'index' => [], + }, + + 'virtual_field' => { + 'columns' => [ + 'recnum', 'int', '', '', + 'vfieldpart', 'int', '', '', + 'value', 'varchar', '', 128, + ], + 'primary_key' => '', + 'unique' => [ [ 'vfieldpart', 'recnum' ] ], + 'index' => [], + }, + ); %tables; |