}
use CGI qw( -no_xhtml);
+use Config::Std;
use Data::Dumper;
use English qw( -no_match_vars );
use List::MoreUtils qw(any);
use SL::Form;
use SL::Locale;
use SL::LXDebug;
+use SL::LxOfficeConf;
use SL::DB::Helper::ALL;
use SL::DB::Helper::Mappings;
our $form;
our $cgi;
our $auth;
+our %lx_office_conf;
our $script = __FILE__;
$script =~ s:.*/::;
exit 1;
}
- my $login = shift @ARGV;
+ SL::LxOfficeConf->read;
- $::userspath = "users";
- $::templates = "templates";
- $::sendmail = "| /usr/sbin/sendmail -t";
+ my $login = shift @ARGV;
$::lxdebug = LXDebug->new();
- require "config/lx-erp.conf";
- require "config/lx-erp-local.conf" if -f "config/lx-erp-local.conf";
-
# locale messages
$::locale = Locale->new("de");
$::form = new Form;
sub process_table {
my @spec = split(/=/, shift, 2);
my $table = $spec[0];
+ my $schema = '';
+ ($schema, $table) = split(m/\./, $table) if $table =~ m/\./;
my $package = ucfirst($spec[1] || $spec[0]);
$package =~ s/_+(.)/uc($1)/ge;
my $meta_file = "${meta_path}/${package}.pm";
my $file = "SL/DB/${package}.pm";
+ $schema = <<CODE if $schema;
+ __PACKAGE__->meta->schema('$schema');
+CODE
+
my $definition = eval <<CODE;
package SL::DB::AUTO::$package;
use SL::DB::Object;
use base qw(SL::DB::Object);
__PACKAGE__->meta->table('$table');
+$schema
__PACKAGE__->meta->auto_initialize;
__PACKAGE__->meta->perl_class_definition(indent => 2); # , braces => 'bsd'