set_user_rights() {
chown -R www-data:www-data /usr/lib/lx-office-erp/users
chown -R www-data:www-data /usr/lib/lx-office-erp/templates
- chown www-data:www-data /etc/lx-office-erp/lx-erp.conf
+ chown www-data:www-data /etc/lx-office-erp/lx_office.conf
chown www-data:www-data /usr/lib/lx-office-erp/menu.ini
chown www-data:www-data /etc/lx-office-erp/authentication.pl
- chmod 0600 /etc/lx-office-erp/lx-erp.conf
+ chmod 0600 /etc/lx-office-erp/lx_office.conf
chmod 0600 /etc/lx-office-erp/authentication.pl
}
}
mk_new_menu() {
- if [ -e /usr/lib/lx-office-crm ] ; then
+ if [ -e /usr/lib/lx-office-crm ] ; then
#crm vorhanden, dann die menu.ini mit der höchsten VersNr nehmen
- for i in `ls -1 /usr/lib/lx-office-crm/update/menu*ini` ; do
+ for i in `ls -1 /usr/lib/lx-office-crm/update/menu*ini` ; do
cat $i > /usr/lib/lx-office-erp/menu.ini
done;
cat /usr/lib/lx-office-erp/menu.default >> /usr/lib/lx-office-erp/menu.ini
else
cp /usr/lib/lx-office-erp/menu.default /usr/lib/lx-office-erp/menu.ini
fi
-}
+}
mk_new_config() {
- if ! [ -f /etc/lx-office-erp/lx-erp.conf ] ; then
- cp /etc/lx-office-erp/lx-erp.conf.default /etc/lx-office-erp/lx-erp.conf
+ if ! [ -f /etc/lx-office-erp/lx_office.conf ] ; then
+ cp /etc/lx-office-erp/lx_office.conf.default /etc/lx-office-erp/lx_office.conf
fi
-}
+}
mk_links() {
if ! [ -f /usr/lib/lx-office-erp/config/authentication.pl ] ; then
ln -s /etc/lx-office-erp/authentication.pl /usr/lib/lx-office-erp/config/authentication.pl
fi;
- if ! [ -f /usr/lib/lx-office-erp/config/lx-erp.conf ] ; then
- ln -s /etc/lx-office-erp/lx-erp.conf /usr/lib/lx-office-erp/config/lx-erp.conf
+ if ! [ -f /usr/lib/lx-office-erp/config/lx_office.conf ] ; then
+ ln -s /etc/lx-office-erp/lx_office.conf /usr/lib/lx-office-erp/config/lx_office.conf
fi;
- if [ -e /etc/apache2 ] ; then
+ if [ -e /etc/apache2 ] ; then
if ! [ -f /etc/apache2/conf.d/lx-office-erp.apache2.conf ] ; then
ln -s /etc/lx-office-erp/lx-office-erp.apache2.conf /etc/apache2/conf.d/lx-office-erp.apache2.conf
fi;
fi;
- if [ -e /etc/cherokee/sites-available ] ; then
+ if [ -e /etc/cherokee/sites-available ] ; then
if ! [ -f /etc/cherokee/sites-available/lx-office-erp.cherokee ] ; then
cat /etc/lx-office-erp/lx-office-erp.cherokee.handler >> /etc/cherokee/sites-available/default
ln -s /etc/lx-office-erp/lx-office-erp.cherokee /etc/cherokee/sites-available/lx-office-erp.cherokee
fi;
}
reload_web_server() {
- if [ -f /etc/init.d/apache* ] ; then
+ if [ -f /etc/init.d/apache* ] ; then
/etc/init.d/apache* reload
fi
- if [ -f /etc/init.d/cherokee ] ; then
+ if [ -f /etc/init.d/cherokee ] ; then
/etc/init.d/cherokee reload
fi
}
install|configure)
echo " ! "`date`" $1 !" >> /tmp/lxo-erp.log
-
+
mk_new_menu
mk_new_config
config_postgresql_factory_script
cp -a $SRC/*.pl usr/lib/lx-office-erp
cp $SRC/VERSION usr/lib/lx-office-erp
cp $SRC/index.html usr/lib/lx-office-erp
-cp $SRC/config/lx-erp.conf etc/lx-office-erp/lx-erp.conf.default
+cp $SRC/config/lx_office.conf.default etc/lx-office-erp/lx_office.conf.default
cp $SRC/config/authentication.pl.default etc/lx-office-erp/
cp $SRC/menu.ini usr/lib/lx-office-erp/menu.default
cp -a $SRC/css var/lib/lx-office-erp
sub save_preferences {
$main::lxdebug->enter_sub();
- my ($self, $myconfig, $form, $webdav) = @_;
+ my ($self, $myconfig, $form) = @_;
my $dbh = $form->get_standard_dbh($myconfig);
$myconfig->{$item} = $form->{$item};
}
- $myconfig->save_member($main::memberfile);
+ $myconfig->save_member;
my $auth = $main::auth;
- if ($auth->can_change_password()
- && defined $form->{new_password}
- && ($form->{new_password} ne '********')) {
- $auth->change_password($form->{login}, $form->{new_password});
-
- $form->{password} = $form->{new_password};
- $auth->set_session_value('password', $form->{password});
- $auth->create_or_refresh_session();
- }
-
$main::lxdebug->leave_sub();
return $rc;
sub delete_transaction {
$main::lxdebug->enter_sub();
- my ($self, $myconfig, $form, $spool) = @_;
+ my ($self, $myconfig, $form) = @_;
# connect to database
my $dbh = $form->dbconnect_noauto($myconfig);
$main::lxdebug->message(LXDebug->DEBUG1(), "Auth::create_database DSN: $dsn");
- my $charset = $main::dbcharset;
+ my $charset = $::lx_office_conf{system}->{dbcharset};
$charset ||= Common::DEFAULT_CHARSET;
my $encoding = $Common::charset_to_db_encoding{$charset};
$encoding ||= 'UNICODE';
my $self = shift;
my $dbh = $self->dbconnect();
- my $charset = $main::dbcharset;
+ my $charset = $::lx_office_conf{system}->{dbcharset};
$charset ||= Common::DEFAULT_CHARSET;
$dbh->rollback();
--- /dev/null
+package SL::Auth::PasswordPolicy;
+
+use strict;
+
+use parent qw(Rose::Object);
+
+use constant OK => 0;
+use constant TOO_SHORT => 1;
+use constant TOO_LONG => 2;
+use constant MISSING_LOWERCASE => 4;
+use constant MISSING_UPPERCASE => 8;
+use constant MISSING_DIGIT => 16;
+use constant MISSING_SPECIAL_CHAR => 32;
+use constant INVALID_CHAR => 64;
+use constant WEAK => 128;
+
+use Rose::Object::MakeMethods::Generic
+(
+ 'scalar --get_set_init' => 'config',
+);
+
+sub verify {
+ my ($self, $password, $is_admin) = @_;
+
+ my $cfg = $self->config;
+ return OK() unless $cfg && %{ $cfg };
+ return OK() if $is_admin && $cfg->{disable_policy_for_admin};
+
+ my $result = OK();
+ $result |= TOO_SHORT() if $cfg->{min_length} && (length($password) < $cfg->{min_length});
+ $result |= TOO_LONG() if $cfg->{max_length} && (length($password) > $cfg->{max_length});
+ $result |= MISSING_LOWERCASE() if $cfg->{require_lowercase} && $password !~ m/[a-z]/;
+ $result |= MISSING_UPPERCASE() if $cfg->{require_uppercase} && $password !~ m/[A-Z]/;
+ $result |= MISSING_DIGIT() if $cfg->{require_digit} && $password !~ m/[0-9]/;
+ $result |= MISSING_SPECIAL_CHAR() if $cfg->{require_special_character} && $password !~ $cfg->{special_characters_re};
+ $result |= INVALID_CHAR() if $cfg->{invalid_characters_re} && $password =~ $cfg->{invalid_characters_re};
+
+ if ($cfg->{use_cracklib}) {
+ require Crypt::Cracklib;
+ $result |= WEAK() if !Crypt::Cracklib::check($password);
+ }
+
+ return $result;
+}
+
+sub errors {
+ my ($self, $result) = @_;
+
+ my @errors;
+
+ push @errors, $::locale->text('The password is too short (minimum length: #1).', $self->config->{min_length}) if $result & TOO_SHORT();
+ push @errors, $::locale->text('The password is too long (maximum length: #1).', $self->config->{max_length}) if $result & TOO_LONG();
+ push @errors, $::locale->text('A lower-case character is required.') if $result & MISSING_LOWERCASE();
+ push @errors, $::locale->text('An upper-case character is required.') if $result & MISSING_UPPERCASE();
+ push @errors, $::locale->text('A digit is required.') if $result & MISSING_DIGIT();
+ push @errors, $::locale->text('The password is weak (e.g. it can be found in a dictionary).') if $result & WEAK();
+
+ if ($result & MISSING_SPECIAL_CHAR()) {
+ my $char_list = join ' ', sort split(m//, $self->config->{special_characters});
+ push @errors, $::locale->text('A special character is required (valid characters: #1).', $char_list);
+ }
+
+ if (($result & INVALID_CHAR())) {
+ my $char_list = join ' ', sort split(m//, $self->config->{ $self->config->{invalid_characters} ? 'invalid_characters' : 'valid_characters' });
+ push @errors, $::locale->text('An invalid character was used (invalid characters: #1).', $char_list) if $self->config->{invalid_characters};
+ push @errors, $::locale->text('An invalid character was used (valid characters: #1).', $char_list) if $self->config->{valid_characters};
+ }
+
+ return @errors;
+}
+
+
+sub init_config {
+ my ($self) = @_;
+
+ my %cfg = %{ $::emmvee_conf{password_policy} || {} };
+
+ $cfg{valid_characters} =~ s/[ \n\r]//g if $cfg{valid_characters};
+ $cfg{invalid_characters} =~ s/[ \n\r]//g if $cfg{invalid_characters};
+ $cfg{invalid_characters_re} = '[^' . quotemeta($cfg{valid_characters}) . ']' if $cfg{valid_characters};
+ $cfg{invalid_characters_re} = '[' . quotemeta($cfg{invalid_characters}) . ']' if $cfg{invalid_characters};
+ $cfg{special_characters} = '!@#$%^&*()_+=[]{}<>\'"|\\,;.:?-';
+ $cfg{special_characters_re} = '[' . quotemeta($cfg{special_characters}) . ']';
+
+ map { $cfg{"require_${_}"} = $cfg{"require_${_}"} =~ m/^(?:1|true|t|yes|y)$/i } qw(lowercase uppercase digit special_char);
+
+ $self->config(\%cfg);
+}
+
+1;
+__END__
+
+=pod
+
+=encoding utf8
+
+=head1 NAME
+
+SL::Auth::PasswordPolicy - Verify a given password against the policy
+set in the configuration file
+
+=head1 SYNOPSIS
+
+ my $verifier = SL::Auth::PasswordPolicy->new;
+ my $result = $verifier->verify($password);
+ if ($result != SL::Auth::PasswordPolicy->OK()) {
+ print "Errors: " . join(' ', $verifier->errors($result)) . "\n";
+ }
+
+=head1 CONSTANTS
+
+=over 4
+
+=item C<OK>
+
+Password is OK.
+
+=item C<TOO_SHORT>
+
+The password is too short.
+
+=item C<TOO_LONG>
+
+The password is too long.
+
+=item C<MISSING_LOWERCASE>
+
+The password is missing a lower-case character.
+
+=item C<MISSING_UPPERCASE>
+
+The password is missing an upper-case character.
+
+=item C<MISSING_DIGIT>
+
+The password is missing a digit.
+
+=item C<MISSING_SPECIAL_CHAR>
+
+The password is missing a special character. Special characters are
+the following: ! " # $ % & ' ( ) * + , - . : ; E<lt> = E<gt> ? @ [ \ ]
+^ _ { | }
+
+=item C<INVALID_CHAR>
+
+The password contains an invalid character.
+
+=back
+
+=head1 FUNCTIONS
+
+=over 4
+
+=item C<verify $password, $is_admin>
+
+Checks whether or not the password matches the policy. Returns C<OK()>
+if it does and an error code otherwise (binary or'ed of the error
+constants).
+
+If C<$is_admin> is trueish and the configuration specifies that the
+policy checks are disabled for the administrator then C<verify> will
+always return C<OK()>.
+
+=item C<errors $code>
+
+Returns an array of human-readable strings describing the issues set
+in C<$code> which should be the result of L</verify>.
+
+=back
+
+=head1 BUGS
+
+Nothing here yet.
+
+=head1 AUTHOR
+
+Moritz Bunkus E<lt>m.bunkus@linet-services.deE<gt>
+
+=cut
sub delete_spool {
$main::lxdebug->enter_sub();
- my ($self, $myconfig, $form, $spool) = @_;
+ my ($self, $myconfig, $form) = @_;
+
+ my $spool = $::lx_office_conf{paths}->{spool};
# connect to database, turn AutoCommit off
my $dbh = $form->dbconnect_noauto($myconfig);
sub print_spool {
$main::lxdebug->enter_sub();
- my ($self, $myconfig, $form, $spool, $output) = @_;
+ my ($self, $myconfig, $form, $output) = @_;
+
+ my $spool = $::lx_office_conf{paths}->{spool};
# connect to database
my $dbh = $form->dbconnect($myconfig);
sub _send_email {
my ($posted_invoices, $printed_invoices) = @_;
- read_config 'config/lx_office.conf' => my %config;
+ my %config = %::lx_office_conf;
return if !$config{periodic_invoices} || !$config{periodic_invoices}->{send_email_to} || !scalar @{ $posted_invoices };
$form->throw_on_error(sub {
eval {
- $form->parse_template(\%::myconfig, $::userspath);
+ $form->parse_template(\%::myconfig);
1;
} || die $EVAL_ERROR->{error};
});
delete $form->{OUT};
- $form->parse_template($myconfig, $main::userspath);
+ $form->parse_template($myconfig);
$main::lxdebug->leave_sub();
}
do_statement($form, $sth, $query, @values);
- my $valid_index = "$params{name_prefix}cvar_$config->{name}$params{name_postfix}_valid";
- $self->save_custom_variables_validity(trans_id => $params{trans_id}, config_id => $config->{id},
- validity => ($params{variables}{$valid_index} || $params{always_valid} ? 1 : 0)
- );
+ if ($params{save_validity}) {
+ my $valid_index = "$params{name_prefix}cvar_$config->{name}$params{name_postfix}_valid";
+ $self->save_custom_variables_validity(trans_id => $params{trans_id},
+ config_id => $config->{id},
+ validity => ($params{variables}{$valid_index} || $params{always_valid} ? 1 : 0)
+ );
+ }
}
$sth->finish();
my ($form) = @_;
return $main::lxdebug->leave_sub()
- unless ($main::webdav && $form->{id});
+ unless ($::lx_office_conf{system}->{webdav} && $form->{id});
my ($path, $number);
my $content_type = $options->{type} eq 'js' ? 'text/javascript' : 'text/html';
print $::form->create_http_response(content_type => $content_type,
- charset => $::dbcharset || Common::DEFAULT_CHARSET());
+ charset => $::lx_office_conf{system}->{dbcharset} || Common::DEFAULT_CHARSET());
} else {
$::form->{title} = $locals{title} if $locals{title};
AUTH => $::auth,
FORM => $::form,
LOCALE => $::locale,
- LXCONFIG => { dbcharset => $::dbcharset,
- webdav => $::webdav,
- lizenzen => $::lizenzen,
- latex_templates => $::latex,
- opendocument_templates => $::opendocument_templates,
- vertreter => $::vertreter,
- show_best_before => $::show_best_before,
- },
+ LXCONFIG => \%::lx_office_conf,
LXDEBUG => $::lxdebug,
MYCONFIG => \%::myconfig,
SELF => $self,
PLUGIN_BASE => 'SL::Template::Plugin',
INCLUDE_PATH => '.:templates/webpages',
COMPILE_EXT => '.tcc',
- COMPILE_DIR => $::userspath . '/templates-cache',
+ COMPILE_DIR => $::lx_office_conf{paths}->{userspath} . '/templates-cache',
}) || croak;
return $self->{__basepriv_template_obj};
=item * C<LOCALE> -- C<$::locale>
-=item * C<LXCONFIG> -- all parameters from C<config/lx-erp.conf> with
-the same name they appear in the file (e.g. C<dbcharset>, C<webdav>
-etc)
+=item * C<LXCONFIG> -- all parameters from C<config/lx_office.conf>
+with the same name they appear in the file (first level is the
+section, second the actual variable, e.g. C<system.dbcharset>,
+C<features.webdav> etc)
=item * C<LXDEBUG> -- C<$::lxdebug>
my $path;
if ($token =~ m|^(\d+)-(\d+)-(\d+)$|) {
- $path = "${main::userspath}/datev-export-${1}-${2}-${3}";
+ $path = $::lx_office_conf{paths}->{userspath} . "/datev-export-${1}-${2}-${3}";
}
$main::lxdebug->leave_sub();
sub clean_temporary_directories {
$main::lxdebug->enter_sub();
- foreach my $path (glob "${main::userspath}/datev-export-*") {
+ foreach my $path (glob($::lx_office_conf{paths}->{userspath} . "/datev-export-*")) {
next unless (-d $path);
my $mtime = (stat($path))[9];
sub get_first {
shift->get_all(
+ @_,
limit => 1,
)->[0];
}
sub _calculate_assembly_item {
my ($self, $data, $part, $total_qty, $base_factor) = @_;
- return 0 if $::eur || !$data->{is_invoice};
+ return 0 if $::lx_office_conf{system}->{eur} || !$data->{is_invoice};
foreach my $assembly_entry (@{ $part->assemblies }) {
push @{ $data->{assembly_items}->[-1] }, { part => $assembly_entry->part,
_dbg("cpsi tq " . $total_qty);
- return 0 if $::eur || !$data->{is_invoice} || !$total_qty;
+ return 0 if $::lx_office_conf{system}->{eur} || !$data->{is_invoice} || !$total_qty;
my ($entry);
$base_factor ||= 1;
=item 6. Items in C<invoice> are updated according to their allocation
status (regarding for costs of goold sold). Will only be done if
Lx-Office is not configured to use Einnahmenüberschussrechnungen
-(C<$::eur>).
+(see config/lx_office.conf, section "system", variable "eur").
=item 7. The invoice and its items are saved.
return 0 if !@unapplied_scripts;
- my $db_charset = $main::dbcharset || Common::DEFAULT_CHARSET;
+ my $db_charset = $::lx_office_conf{system}->{dbcharset} || Common::DEFAULT_CHARSET;
$self->{form}->{login} ||= 'admin';
map { $_->{description} = SL::Iconv::convert($_->{charset}, $db_charset, $_->{description}) } values %{ $self->{all_controls} };
sub save_dunning {
$main::lxdebug->enter_sub();
- my ($self, $myconfig, $form, $rows, $userspath, $spool) = @_;
+ my ($self, $myconfig, $form, $rows) = @_;
# connect to database
my $dbh = $form->dbconnect_noauto($myconfig);
$copies *= 1;
$copies = 1 unless $copies;
- my $inputfiles = join " ", map { "${main::spool}/$_ " x $copies } @{ $form->{DUNNING_PDFS} };
+ my $spool = $::lx_office_conf{paths}->{spool};
+ my $inputfiles = join " ", map { "$spool/$_ " x $copies } @{ $form->{DUNNING_PDFS} };
my $dunning_id = $form->{dunning_id};
$dunning_id =~ s|[^\d]||g;
- my $in = IO::File->new("gs -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=- $inputfiles |");
+ my $in = IO::File->new($::lx_office_conf{applications}->{ghostscript} . " -dBATCH -dNOPAUSE -q -sDEVICE=pdfwrite -sOutputFile=- $inputfiles |");
$form->error($main::locale->text('Could not spawn ghostscript.')) unless $in;
if ($form->{media} eq 'printer') {
$in->close();
- map { unlink("${main::spool}/$_") } @{ $form->{DUNNING_PDFS} };
+ map { unlink("$spool/$_") } @{ $form->{DUNNING_PDFS} };
$main::lxdebug->leave_sub();
}
$self->set_template_options($myconfig, $form);
my $filename = "dunning_${dunning_id}_" . Common::unique_id() . ".pdf";
- $form->{OUT} = ">${main::spool}/$filename";
+ my $spool = $::lx_office_conf{paths}->{spool};
+ $form->{OUT} = ">${spool}/$filename";
$form->{keep_tmpfile} = 1;
delete $form->{tmpfile};
push @{ $form->{DUNNING_PDFS} }, $filename;
- push @{ $form->{DUNNING_PDFS_EMAIL} }, { 'filename' => "${main::spool}/$filename",
+ push @{ $form->{DUNNING_PDFS_EMAIL} }, { 'filename' => "${spool}/$filename",
'name' => "dunning_${dunning_id}.pdf" };
- $form->parse_template($myconfig, $main::userspath);
+ $form->parse_template($myconfig);
$dbh->disconnect() unless $provided_dbh;
my $filename = Common::unique_id() . "dunning_invoice_${dunning_id}.pdf";
- $form->{OUT} = ">$main::spool/$filename";
+ my $spool = $::lx_office_conf{paths}->{spool};
+ $form->{OUT} = ">$spool/$filename";
$form->{keep_tmpfile} = 1;
delete $form->{tmpfile};
map { delete $form->{$_} } grep /^[a-z_]+_\d+$/, keys %{ $form };
- $form->parse_template($myconfig, $main::userspath);
+ $form->parse_template($myconfig);
restore_form($saved_form);
push @{ $form->{DUNNING_PDFS} }, $filename;
- push @{ $form->{DUNNING_PDFS_EMAIL} }, { 'filename' => "${main::spool}/$filename",
+ push @{ $form->{DUNNING_PDFS_EMAIL} }, { 'filename' => "${spool}/$filename",
'name' => "dunning_invoice_${dunning_id}.pdf" };
$dbh->disconnect() unless $provided_dbh;
$form->{saved_donumber} = $form->{donumber};
- Common::webdav_folder($form) if ($main::webdav);
+ Common::webdav_folder($form);
$main::lxdebug->leave_sub();
my $myconfig = \%main::myconfig;
my $form = $main::form;
- my $spool = $main::spool;
+ my $spool = $::lx_office_conf{paths}->{spool};
# connect to database
my $dbh = $form->get_standard_dbh($myconfig);
$sth->finish();
}
- Common::webdav_folder($form) if ($main::webdav);
+ Common::webdav_folder($form);
$main::lxdebug->leave_sub();
use English qw(-no_match_vars);
use SL::Auth;
use SL::LXDebug;
+use SL::LxOfficeConf;
use SL::Locale;
use SL::Common;
use SL::Helper::DateTime;
my $template = shift;
my $error_type = shift || '';
- $::locale = Locale->new($::language);
+ $::locale = Locale->new($::lx_office_conf{system}->{language});
$::form->{error} = $::locale->text('The session is invalid or has expired.') if ($error_type eq 'session');
$::form->{error} = $::locale->text('Incorrect password!.') if ($error_type eq 'password');
- $::myconfig{countrycode} = $::language;
+ $::myconfig{countrycode} = $::lx_office_conf{system}->{language};
$::form->{stylesheet} = 'css/lx-office-erp.css';
$::form->header;
}
sub pre_startup_setup {
- eval {
- package main;
- require "config/lx-erp.conf";
- };
- eval {
- package main;
- require "config/lx-erp-local.conf";
- } if -f "config/lx-erp-local.conf";
+ SL::LxOfficeConf->read;
+ _init_environment();
eval {
package main;
# canonial globals. if it's not here, chances are it will get refactored someday.
{
no warnings 'once';
- $::userspath = "users";
- $::templates = "templates";
- $::memberfile = "users/members";
- $::menufile = "menu.ini";
- $::sendmail = "| /usr/sbin/sendmail -t";
$::lxdebug = LXDebug->new;
$::auth = SL::Auth->new;
$::form = undef;
%::myconfig = ();
%::called_subs = (); # currently used for recursion detection
-
- read_config 'config/lx_office.conf' => %::lx_office_conf if -f "config/lx_office.conf";
- _decode_recursively(\%::lx_office_conf);
}
$SIG{__WARN__} = sub {
$self->unrequire_bin_mozilla;
$::cgi = CGI->new('');
- $::locale = Locale->new($::language);
+ $::locale = Locale->new($::lx_office_conf{system}->{language});
$::form = Form->new;
%::called_subs = ();
my $session_result = $::auth->restore_session;
$::auth->create_or_refresh_session;
- $::form->error($::locale->text('System currently down for maintenance!')) if -e "$::userspath/nologin" && $script ne 'admin';
+ $::form->error($::locale->text('System currently down for maintenance!')) if -e ($::lx_office_conf{paths}->{userspath} . "/nologin") && $script ne 'admin';
if ($script eq 'login' or $script eq 'admin' or $script eq 'kopf') {
$::form->{titlebar} = "Lx-Office " . $::locale->text('Version') . " $::form->{version}";
return $self->{interface} =~ m/f(?:ast)cgi/i ? $self->{request}->GetHandles() : (\*STDIN, \*STDOUT, \*STDERR);
}
-sub _decode_recursively {
- my ($obj) = @_;
+sub _init_environment {
+ my %key_map = ( lib => { name => 'PERL5LIB', append_path => 1 },
+ path => { name => 'PATH', append_path => 1 },
+ );
+ my $cfg = $::lx_office_conf{environment} || {};
- while (my ($key, $value) = each %{ $obj }) {
- if (ref($value) eq 'HASH') {
- _decode_recursively($value);
- } else {
- $obj->{$key} = decode('UTF-8', $value);
+ while (my ($key, $value) = each %{ $cfg }) {
+ next unless $value;
+
+ my $info = $key_map{$key} || {};
+ $key = $info->{name} || $key;
+
+ if ($info->{append_path}) {
+ $value = ':' . $value unless $value =~ m/^:/ || !$ENV{$key};
+ $value = $ENV{$key} . $value;
}
+
+ $ENV{$key} = $value;
}
}
sub fix_print_and_internal_encoding_after_0_68 {
return if version->new("$FCGI::VERSION")->numify <= version->new("0.68")->numify;
- return if lc($::dbcharset) !~ m/^(?:utf-?8|unicode)$/;
+ return if lc($::lx_office_conf{system}->{dbcharset}) !~ m/^(?:utf-?8|unicode)$/;
my $encoder = Encode::find_encoding('UTF-8');
my $original_fcgi_print = \&FCGI::Stream::PRINT;
$self->_request_to_hash($content);
}
- my $db_charset = $main::dbcharset;
+ my $db_charset = $::lx_office_conf{system}->{dbcharset};
$db_charset ||= Common::DEFAULT_CHARSET;
my $encoding = $self->{INPUT_ENCODING} || $db_charset;
# extra code is currently only used by menuv3 and menuv4 to set their css.
# it is strongly deprecated, and will be changed in a future version.
my ($self, $extra_code) = @_;
- my $db_charset = $::dbcharset || Common::DEFAULT_CHARSET;
+ my $db_charset = $::lx_office_conf{system}->{dbcharset} || Common::DEFAULT_CHARSET;
my @header;
$::lxdebug->leave_sub and return if !$ENV{HTTP_USER_AGENT} || $self->{header}++;
my ($self) = @_;
- my $db_charset = $main::dbcharset ? $main::dbcharset : Common::DEFAULT_CHARSET;
+ my $db_charset = $::lx_office_conf{system}->{dbcharset} || Common::DEFAULT_CHARSET;
my $cgi = $main::cgi || CGI->new('');
my $output = $cgi->header('-charset' => $db_charset);
my $language;
if (!%::myconfig || !$::myconfig{"countrycode"}) {
- $language = $main::language;
+ $language = $::lx_office_conf{system}->{language};
} else {
$language = $main::myconfig{"countrycode"};
}
map { $additional_params->{"myconfig_${_}"} = $main::myconfig{$_}; } keys %::myconfig;
}
- $additional_params->{"conf_dbcharset"} = $::dbcharset;
- $additional_params->{"conf_webdav"} = $::webdav;
- $additional_params->{"conf_lizenzen"} = $::lizenzen;
- $additional_params->{"conf_latex_templates"} = $::latex;
- $additional_params->{"conf_opendocument_templates"} = $::opendocument_templates;
- $additional_params->{"conf_vertreter"} = $::vertreter;
- $additional_params->{"conf_show_best_before"} = $::show_best_before;
- $additional_params->{"conf_parts_image_css"} = $::parts_image_css;
- $additional_params->{"conf_parts_listing_images"} = $::parts_listing_images;
- $additional_params->{"conf_parts_show_image"} = $::parts_show_image;
+ $additional_params->{"conf_dbcharset"} = $::lx_office_conf{system}->{dbcharset};
+ $additional_params->{"conf_webdav"} = $::lx_office_conf{system}->{webdav};
+ $additional_params->{"conf_lizenzen"} = $::lx_office_conf{system}->{lizenzen};
+ $additional_params->{"conf_latex_templates"} = $::lx_office_conf{print_templates}->{latex};
+ $additional_params->{"conf_opendocument_templates"} = $::lx_office_conf{print_templates}->{opendocument};
+ $additional_params->{"conf_vertreter"} = $::lx_office_conf{system}->{vertreter};
+ $additional_params->{"conf_show_best_before"} = $::lx_office_conf{system}->{show_best_before};
+ $additional_params->{"conf_parts_image_css"} = $::lx_office_conf{features}->{parts_image_css};
+ $additional_params->{"conf_parts_listing_images"} = $::lx_office_conf{features}->{parts_listing_images};
+ $additional_params->{"conf_parts_show_image"} = $::lx_office_conf{features}->{parts_show_image};
if (%main::debug_options) {
map { $additional_params->{'DEBUG_' . uc($_)} = $main::debug_options{$_} } keys %main::debug_options;
'PLUGIN_BASE' => 'SL::Template::Plugin',
'INCLUDE_PATH' => '.:templates/webpages',
'COMPILE_EXT' => '.tcc',
- 'COMPILE_DIR' => $::userspath . '/templates-cache',
+ 'COMPILE_DIR' => $::lx_office_conf{paths}->{userspath} . '/templates-cache',
})) || die;
}
sub parse_template {
$main::lxdebug->enter_sub();
- my ($self, $myconfig, $userspath) = @_;
+ my ($self, $myconfig) = @_;
my $out;
local (*IN, *OUT);
+ my $userspath = $::lx_office_conf{paths}->{userspath};
+
$self->{"cwd"} = getcwd();
$self->{"tmpdir"} = $self->{cwd} . "/${userspath}";
map { $mail->{$_} = $self->{$_} }
qw(cc bcc subject message version format);
- $mail->{charset} = $main::dbcharset ? $main::dbcharset : Common::DEFAULT_CHARSET;
+ $mail->{charset} = $::lx_office_conf{system}->{dbcharset} || Common::DEFAULT_CHARSET;
$mail->{to} = $self->{EMAIL_RECIPIENT} ? $self->{EMAIL_RECIPIENT} : $self->{email};
$mail->{from} = qq|"$myconfig->{name}" <$myconfig->{email}>|;
$mail->{fileid} = "$fileid.";
close(FH);
}
- if ($self->{tmpfile} && ! $::keep_temp_files) {
+ if ($self->{tmpfile} && !($::lx_office_conf{debug} && $::lx_office_conf{debug}->{keep_temp_files})) {
$self->{tmpfile} =~ s|.*/||g;
# strip extension
$self->{tmpfile} =~ s/\.\w+$//g;
}
}
- CVar->save_custom_variables('dbh' => $dbh,
- 'module' => 'IC',
- 'trans_id' => $form->{id},
- 'variables' => $form);
+ CVar->save_custom_variables(dbh => $dbh,
+ module => 'IC',
+ trans_id => $form->{id},
+ variables => $form,
+ save_validity => 1);
# commit
my $rc = $dbh->commit;
$form->{"qty_$i"} = $form->parse_amount($myconfig, $form->{"qty_$i"});
$form->{"qty_$i"} *= -1 if $form->{storno};
- $form->{"inventory_accno_$i"} = $form->{"expense_accno_$i"} if $main::eur;
+ $form->{"inventory_accno_$i"} = $form->{"expense_accno_$i"} if $::lx_office_conf{system}->{eur};
# get item baseunit
if (!$item_units{$form->{"id_$i"}}) {
# delete zero entries
do_query($form, $dbh, qq|DELETE FROM acc_trans WHERE amount = 0|);
- Common::webdav_folder($form) if ($main::webdav);
+ Common::webdav_folder($form);
# Link this record to the records it was created from.
RecordLinks->create_links('dbh' => $dbh,
}
$sth->finish();
- Common::webdav_folder($form) if ($main::webdav);
+ Common::webdav_folder($form);
$dbh->disconnect();
# save printed, emailed and queued
$form->save_status($dbh);
- Common::webdav_folder($form) if ($main::webdav);
+ Common::webdav_folder($form);
# Link this record to the records it was created from.
RecordLinks->create_links('dbh' => $dbh,
# sellprice is the cost of the item
my $linetotal = $form->round_amount(($ref->{sellprice} * $qty) / ( ($ref->{price_factor} || 1) * ( $basefactor || 1 )), 2);
- if (!$main::eur) {
+ if (!$::lx_office_conf{system}->{eur}) {
$ref->{expense_accno} = ($form->{"expense_accno_$row"}) ? $form->{"expense_accno_$row"} : $ref->{expense_accno};
# add to expense
$form->{amount_cogs}{ $form->{id} }{ $ref->{expense_accno} } += -$linetotal;
sub delete_invoice {
$main::lxdebug->enter_sub();
- my ($self, $myconfig, $form, $spool) = @_;
+ my ($self, $myconfig, $form) = @_;
# connect to database
my $dbh = $form->dbconnect_noauto($myconfig);
$dbh->disconnect;
if ($rc) {
+ my $spool = $::lx_office_conf{paths}->{spool};
map { unlink "$spool/$_" if -f "$spool/$_"; } @spoolfiles;
}
}
$sth->finish;
- Common::webdav_folder($form) if ($main::webdav);
+ Common::webdav_folder($form);
}
my $rc = $dbh->commit;
my ($price, $selectedpricegroup_id) = split(/--/, $form->{"sellprice_pg_$i"});
my $pricegroup_old = $form->{"pricegroup_old_$i"};
+
+ # sellprice has format 13,0000 or 0,00000, can't check for 0 numerically
+ my $sellprice = $form->{"sellprice_$i"};
+ my $pricegroup_id = $form->{"pricegroup_id_$i"};
$form->{"new_pricegroup_$i"} = $selectedpricegroup_id;
$form->{"old_pricegroup_$i"} = $pricegroup_old;
$pkr->{price} = $form->format_amount($myconfig, $pkr->{price}, 5);
if ($selectedpricegroup_id eq undef) {
- if ($pkr->{pricegroup_id} eq $form->{customer_klass}) {
+ # new entries in article list, either old invoice was loaded (edit) or a new article was added
+ # Case A: open old invoice, no pricegroup selected
+ # Case B: add new article to invoice, no pricegroup selected
+ # to distinguish case A and B the variable pricegroup_id_$i is used
+ # for new articles this variable isn't defined, for loaded articles it is
+ # sellprice can't be used, as it already has 0,00 set
+
+ if ($pkr->{pricegroup_id} eq $form->{"pricegroup_id_$i"} and defined $form->{"pricegroup_id_$i"}) {
+ # Case A
$pkr->{selected} = ' selected';
+ } elsif ($pkr->{pricegroup_id} eq $form->{customer_klass}
+ and not defined $form->{"pricegroup_id_$i"}
+ and $pkr->{price} != 0 # only use customer pricegroup price if it has a value, else use default_sellprice
+ # for the case where pricegroup prices haven't been set
+ ) {
+ # Case B: use default pricegroup of customer
+
+ $pkr->{selected} = ' selected'; # unless $form->{selected};
+
# no customer pricesgroup set
if ($pkr->{price} == $pkr->{default_sellprice}) {
} else {
# this sub should not set anything and only return. --sschoeling, 20090506
-# $form->{"sellprice_$i"} = $pkr->{price};
+# is this correct? put in again... -- grichardson 20110119
+ $form->{"sellprice_$i"} = $pkr->{price};
}
- } elsif ($pkr->{price} == $pkr->{default_sellprice}) {
+ } elsif ($pkr->{price} == $pkr->{default_sellprice} and $pkr->{default_sellprice} != 0) {
$pkr->{price} = $form->{"sellprice_$i"};
$pkr->{selected} = ' selected';
}
- } else {
+ }
+
+ # existing article: pricegroup or price changed
+ if ($selectedpricegroup_id or $selectedpricegroup_id == 0) {
if ($selectedpricegroup_id ne $pricegroup_old) {
+ # pricegroup has changed
if ($pkr->{pricegroup_id} eq $selectedpricegroup_id) {
$pkr->{selected} = ' selected';
}
- } elsif ( ( $form->parse_amount($myconfig, $price_new)
- != $form->parse_amount($myconfig, $form->{"sellprice_$i"}))
- and ($price_new ne 0)) {
+ } elsif (($price_new != $form->{"sellprice_$i"}) and ($price_new ne 0) and defined $price_new) {
+ # sellprice has changed
+ # when loading existing invoices $price_new is NULL
if ($pkr->{pricegroup_id} == 0) {
$pkr->{price} = $form->{"sellprice_$i"};
$pkr->{selected} = ' selected';
}
} elsif ($pkr->{pricegroup_id} eq $selectedpricegroup_id) {
+ # neither sellprice nor pricegroup changed
$pkr->{selected} = ' selected';
- if ( ($pkr->{pricegroup_id} == 0)
- and ($pkr->{price} == $form->{"sellprice_$i"})) {
+ if ( ($pkr->{pricegroup_id} == 0) and ($pkr->{price} == $form->{"sellprice_$i"})) {
# $pkr->{price} = $form->{"sellprice_$i"};
} else {
$pkr->{price} = $form->{"sellprice_$i"};
my $type = shift;
my $self = {};
+ _init_globals_from_config();
+
$self->{"calldepth"} = 0;
$self->{"file"} = $file_name || "/tmp/lx-office-debug.log";
$self->{"target"} = FILE_TARGET;
bless($self, $type);
}
+my $globals_inited_from_config;
+sub _init_globals_from_config {
+ return if $globals_inited_from_config;
+ $globals_inited_from_config = 1;
+
+ my $cfg = $::lx_office_conf{debug} || {};
+
+ $global_level = NONE() if $cfg->{global_level} =~ /NONE/;
+ foreach my $level (grep { $_} split(m/\s+/, $cfg->{global_level})) {
+ $global_level |= eval "${level}()";
+ }
+
+ $watch_form = $cfg->{watch_form};
+ $file_name = $cfg->{file_name} || "/tmp/lx-office-debug.log";
+}
+
sub set_target {
my ($self, $target, $file) = @_;
my ($type, $country) = @_;
- $country ||= $::language;
+ $country ||= $::lx_office_conf{system}->{language};
$country =~ s|.*/||;
$country =~ s|\.||g;
}
}
- my $db_charset = $main::dbcharset || Common::DEFAULT_CHARSET;
- $self->{is_utf8} = (any { lc($::dbcharset || '') eq $_ } qw(utf8 utf-8 unicode)) ? 1 : 0;
+ my $db_charset = $::lx_office_conf{system}->{dbcharset} || Common::DEFAULT_CHARSET;
+ $self->{is_utf8} = (any { lc($::lx_office_conf{system}->{dbcharset} || '') eq $_ } qw(utf8 utf-8 unicode)) ? 1 : 0;
if ($self->{is_utf8}) {
binmode STDOUT, ":utf8";
--- /dev/null
+package SL::LxOfficeConf;
+
+use strict;
+
+use Config::Std;
+use Encode;
+
+sub read {
+ my $file = -f 'config/lx_office.conf' ? 'config/lx_office.conf' : 'config/lx_office.conf.default';
+ read_config $file => %::lx_office_conf;
+ _decode_recursively(\%::lx_office_conf);
+}
+
+sub _decode_recursively {
+ my ($obj) = @_;
+
+ while (my ($key, $value) = each %{ $obj }) {
+ if (ref($value) eq 'HASH') {
+ _decode_recursively($value);
+ } else {
+ $obj->{$key} = decode('UTF-8', $value);
+ }
+ }
+}
+
+1;
my %temp_form = ( %{ $form }, 'myconfig_email' => $email );
my $template = SL::Template::create(type => 'PlainText', form => \%temp_form);
- my $sendmail = $template->parse_block($main::sendmail);
+ my $sendmail = $template->parse_block($::lx_office_conf{applications}->{sendmail});
- if (!open(OUT, $sendmail)) {
+ if (!open(OUT, "|$sendmail")) {
$main::lxdebug->leave_sub();
return "$sendmail : $!";
}
$form->{saved_xyznumber} = $form->{$form->{type} =~ /_quotation$/ ?
"quonumber" : "ordnumber"};
- Common::webdav_folder($form) if ($main::webdav);
+ Common::webdav_folder($form);
my $rc = $dbh->commit;
sub delete {
$main::lxdebug->enter_sub();
- my ($self, $myconfig, $form, $spool) = @_;
+ my ($self, $myconfig, $form) = @_;
# connect to database
my $dbh = $form->dbconnect_noauto($myconfig);
$dbh->disconnect;
if ($rc) {
+ my $spool = $::lx_office_conf{paths}->{spool};
foreach $spoolfile (@spoolfiles) {
unlink "$spool/$spoolfile" if $spoolfile;
}
$form->{exchangerate} = $form->get_exchangerate($dbh, $form->{currency}, $form->{transdate}, ($form->{vc} eq 'customer') ? "buy" : "sell");
- Common::webdav_folder($form) if ($main::webdav);
+ Common::webdav_folder($form);
$self->load_periodic_invoice_config($form);
my $num_columns = scalar @visible_columns;
my $num_header_rows = 1;
- my $font_encoding = $main::dbcharset || 'ISO-8859-15';
+ my $font_encoding = $::lx_office_conf{system}->{dbcharset} || 'ISO-8859-15';
foreach my $name (@visible_columns) {
push @column_props, { 'justify' => $self->{columns}->{$name}->{align} eq 'right' ? 'right' : 'left' };
my %params = @_;
my $package = "SL::Template::" . $params{type};
- $package->new($params{file_name}, $params{form}, $params{myconfig} || \%::myconfig, $params{userspath} || $::userspath);
+ $package->new($params{file_name}, $params{form}, $params{myconfig} || \%::myconfig, $params{userspath} || $::lx_office_conf{paths}->{userspath});
}
1;
$psfile .= ".ps";
}
- system("html2ps -f html2ps-config < $form->{tmpfile} > $psfile");
+ system($::lx_office_conf{applications}->{html2ps} . " -f html2ps-config < $form->{tmpfile} > $psfile");
if ($?) {
$self->{"error"} = $form->cleanup();
$self->cleanup();
$pdffile .= ".pdf";
}
- system("html2ps -f html2ps-config < $form->{tmpfile} | ps2pdf - $pdffile");
+ system($::lx_office_conf{applications}->{html2ps} . " -f html2ps-config < $form->{tmpfile} | ps2pdf - $pdffile");
if ($?) {
$self->{"error"} = $form->cleanup();
$self->cleanup();
}
sub _get_latex_path {
- return $main::latex_bin || 'pdflatex';
+ return $::lx_office_conf{applications}->{latex} || 'pdflatex';
}
sub get_mime_type() {
my $self = $type->SUPER::new(@_);
$self->{"rnd"} = int(rand(1000000));
- $self->{"iconv"} = SL::Iconv->new($main::dbcharset, "UTF-8");
+ $self->{"iconv"} = SL::Iconv->new($::lx_office_conf{system}->{dbcharset}, "UTF-8");
$self->set_tag_style('<%', '%>');
$self->{quot_re} = '"';
my $pid = fork();
if (0 == $pid) {
$main::lxdebug->message(LXDebug->DEBUG2(), " Child execing\n");
- exec($main::xvfb_bin, $display, "-screen", "0", "640x480x8", "-nolisten", "tcp");
+ exec($::lx_office_conf{applications}->{xvfb}, $display, "-screen", "0", "640x480x8", "-nolisten", "tcp");
}
sleep(3);
$main::lxdebug->message(LXDebug->DEBUG2(), " parent dont sleeping\n");
sub is_openoffice_running {
$main::lxdebug->enter_sub();
- my $output = `./scripts/oo-uno-test-conn.py $main::openofficeorg_daemon_port 2> /dev/null`;
+ my $cmd = "./scripts/oo-uno-test-conn.py " . $::lx_office_conf{print_templates}->{openofficeorg_daemon_port} . " 2> /dev/null";
+ my $output = `$cmd`;
chomp $output;
my $res = ($? == 0) || $output;
exit if ($new_pid);
my $ssres = setsid();
$main::lxdebug->message(LXDebug->DEBUG2(), " Child execing\n");
- my @cmdline = ($main::openofficeorg_writer_bin,
+ my @cmdline = ($::lx_office_conf{applications}->{openofficeorg_writer},
"-minimized", "-norestore", "-nologo", "-nolockcheck",
"-headless",
"-accept=socket,host=localhost,port=" .
- $main::openofficeorg_daemon_port . ";urp;");
+ $::lx_office_conf{print_templates}->{openofficeorg_daemon_port} . ";urp;");
exec(@cmdline);
}
}
my @cmdline;
- if (!$main::openofficeorg_daemon) {
- @cmdline = ($main::openofficeorg_writer_bin,
+ if (!$::lx_office_conf{print_templates}->{openofficeorg_daemon}) {
+ @cmdline = ($::lx_office_conf{applications}->{openofficeorg_writer},
"-minimized", "-norestore", "-nologo", "-nolockcheck",
"-headless",
"file:${filename}.odt",
}
@cmdline = ("./scripts/oo-uno-convert-pdf.py",
- $main::openofficeorg_daemon_port,
+ $::lx_office_conf{print_templates}->{openofficeorg_daemon_port},
"${filename}.odt");
}
}
# update the tables
- if (!open(FH, ">$main::userspath/nologin")) {
+ if (!open(FH, ">" . $::lx_office_conf{paths}->{userspath} . "/nologin")) {
$form->show_generic_error($main::locale->text('A temporary file could not be created. ' .
'Please verify that the directory "#1" is writeable by the webserver.',
- $main::userspath),
+ $::lx_office_conf{paths}->{userspath}),
'back_button' => 1);
}
close(FH);
# remove lock file
- unlink("$main::userspath/nologin");
+ unlink($::lx_office_conf{paths}->{userspath} . "/nologin");
my $menufile =
$self->{"menustyle"} eq "v3" ? "menuv3.pl" :
closedir(SQLDIR);
}
- my $db_charset = $main::dbcharset;
+ my $db_charset = $::lx_office_conf{system}->{dbcharset};
$db_charset ||= Common::DEFAULT_CHARSET;
my $dbupdater = SL::DBUpgrade2->new(form => $form, dbdriver => $form->{dbdriver});
$form->{sid} = $form->{dbdefault};
my $rc = -2;
- my $db_charset = $main::dbcharset || Common::DEFAULT_CHARSET;
+ my $db_charset = $::lx_office_conf{system}->{dbcharset} || Common::DEFAULT_CHARSET;
map { $_->{description} = SL::Iconv::convert($_->{charset}, $db_charset, $_->{description}) } values %{ $dbupdater->{all_controls} };
use Sys::Hostname;
use SL::Auth;
+use SL::Auth::PasswordPolicy;
use SL::Form;
use SL::Iconv;
use SL::Mailer;
::end_of_request();
}
- if (-f $main::memberfile) {
+ my $memberfile = $::lx_office_conf{paths}->{memberfile};
+ if (-f $memberfile) {
my $memberdir = "";
- if ($main::memberfile =~ m|^.*/|) {
+ if ($memberfile =~ m|^.*/|) {
$memberdir = $&;
}
$form->{title} = $locale->text('User data migration');
$form->header();
- print $form->parse_html_template('admin/user_migration', { 'memberfile' => $main::memberfile,
+ print $form->parse_html_template('admin/user_migration', { 'memberfile' => $memberfile,
'backupdir' => $backupdir });
::end_of_request();
$main::auth->set_session_value('rpw', $form->{rpw});
$main::auth->create_or_refresh_session();
- if (!-f $main::memberfile) {
+ my $memberfile = $::lx_office_conf{paths}->{memberfile};
+ if (!-f $memberfile) {
# New installation -- create a standard group with full access
my %members;
my $group = {
my $memberdir = "";
- if ($main::memberfile =~ m|^.*/|) {
+ my $memberfile = $::lx_office_conf{paths}->{memberfile};
+ if ($memberfile =~ m|^.*/|) {
$memberdir = $&;
}
$form->error(sprintf($locale->text('The directory "%s" could not be created:\n%s'), $backupdir, $!));
}
- copy $main::memberfile, "users/member-file-migration/members";
+ copy $memberfile, "users/member-file-migration/members";
- my $in = IO::File->new($main::memberfile, "r");
+ my $in = IO::File->new($memberfile, "r");
$form->error($locale->text('Could not open the old memberfile.')) if (!$in);
}
}
- unlink $main::memberfile;
+ unlink $memberfile;
my @member_list = sort { lc $a->{login} cmp lc $b->{login} } values %members;
map { $_->{templates} =~ s|.*/||; } values %members;
$form->{title} = "Lx-Office ERP " . $locale->text('Administration');
- $form->{LOCKED} = -e "$main::userspath/nologin";
+ $form->{LOCKED} = -e _nologin_file_name();
$form->{MEMBERS} = [ @members{sort { lc $a cmp lc $b } keys %members} ];
$form->header();
}
# is there a templates basedir
- if (!-d "$main::templates") {
- $form->error(sprintf($locale->text("The directory %s does not exist."), $main::templates));
+ if (!-d $::lx_office_conf{paths}->{templates}) {
+ $form->error(sprintf($locale->text("The directory %s does not exist."), $::lx_office_conf{paths}->{templates}));
}
- opendir TEMPLATEDIR, "$main::templates/." or $form->error("$main::templates : $ERRNO");
+ opendir TEMPLATEDIR, $::lx_office_conf{paths}->{templates} or $form->error($::lx_office_conf{paths}->{templates} . " : $ERRNO");
my @all = readdir(TEMPLATEDIR);
- my @alldir = sort grep { -d "$main::templates/$_" && !/^\.\.?$/ } @all;
- my @allhtml = sort grep { -f "$main::templates/$_" && /\.html$/ } @all;
+ my @alldir = sort grep { -d ($::lx_office_conf{paths}->{templates} . "/$_") && !/^\.\.?$/ } @all;
+ my @allhtml = sort grep { -f ($::lx_office_conf{paths}->{templates} . "/$_") && /\.html$/ } @all;
closedir TEMPLATEDIR;
@alldir = grep !/\.(html|tex|sty|odt|xml|txb)$/, @alldir;
}
# is there a basedir
- if (!-d "$main::templates") {
- $form->error(sprintf($locale->text("The directory %s does not exist."), $main::templates));
+ if (!-d $::lx_office_conf{paths}->{templates}) {
+ $form->error(sprintf($locale->text("The directory %s does not exist."), $::lx_office_conf{paths}->{templates}));
}
# add base directory to $form->{templates}
$form->{templates} =~ s|.*/||;
- $form->{templates} = "$main::templates/$form->{templates}";
+ $form->{templates} = $::lx_office_conf{paths}->{templates} . "/$form->{templates}";
my $myconfig = new User($form->{login});
$myconfig->save_member();
- if ($main::auth->can_change_password()
- && defined $form->{new_password}
- && ($form->{new_password} ne '********')) {
- $main::auth->change_password($form->{login}, $form->{new_password});
- }
-
$form->{templates} =~ s|.*/||;
- $form->{templates} = "$main::templates/$form->{templates}";
+ $form->{templates} = $::lx_office_conf{paths}->{templates} . "/$form->{templates}";
$form->{mastertemplates} =~ s|.*/||;
# create user template directory and copy master files
umask(007);
# copy templates to the directory
- opendir TEMPLATEDIR, "$main::templates/." or $form->error("$main::templates : $ERRNO");
+ opendir TEMPLATEDIR, $::lx_office_conf{paths}->{templates} or $form->error($::lx_office_conf{paths}->{templates} . " : $ERRNO");
my @templates = grep /$form->{mastertemplates}.*?\.(html|tex|sty|odt|xml|txb)$/,
readdir TEMPLATEDIR;
closedir TEMPLATEDIR;
foreach my $file (@templates) {
- open(TEMP, "$main::templates/$file")
- or $form->error("$main::templates/$file : $ERRNO");
+ open(TEMP, $::lx_office_conf{paths}->{templates} . "/$file")
+ or $form->error($::lx_office_conf{paths}->{templates} . "/$file : $ERRNO");
$file =~ s/\Q$form->{mastertemplates}\E-//;
open(NEW, ">$form->{templates}/$file")
}
}
- $form->redirect($locale->text('User saved!'));
+ if ($main::auth->can_change_password()
+ && defined $form->{new_password}
+ && ($form->{new_password} ne '********')) {
+ my $verifier = SL::Auth::PasswordPolicy->new;
+ my $result = $verifier->verify($form->{new_password}, 1);
+
+ if ($result != SL::Auth::PasswordPolicy->OK()) {
+ $form->error($::locale->text('The settings were saved, but the password was not changed.') . ' ' . join(' ', $verifier->errors($result)));
+ }
+ $main::auth->change_password($form->{login}, $form->{new_password});
+ }
+
+ $form->redirect($locale->text('User saved!'));
}
sub save_user_as_new {
}
closedir SQLDIR;
- my $default_charset = $main::dbcharset;
+ my $default_charset = $::lx_office_conf{system}->{dbcharset};
$default_charset ||= Common::DEFAULT_CHARSET;
my $cluster_encoding = User->dbclusterencoding($form);
if ($cluster_encoding && ($cluster_encoding =~ m/^(?:UTF-?8|UNICODE)$/i)) {
- if ($main::dbcharset !~ m/^UTF-?8$/i) {
+ if ($::lx_office_conf{system}->{dbcharset} !~ m/^UTF-?8$/i) {
$form->show_generic_error($locale->text('The selected PostgreSQL installation uses UTF-8 as its encoding. ' .
'Therefore you have to configure Lx-Office to use UTF-8 as well.'),
'back_button' => 1);
$form->{title} = "Lx-Office ERP " . $locale->text('Database Administration') . " / " . $locale->text('Backup Dataset');
- if ("$main::pg_dump_exe" eq "DISABLED") {
- $form->error($locale->text('Database backups and restorations are disabled in lx-erp.conf.'));
+ if ($::lx_office_conf{applications}->{pg_dump} eq "DISABLED") {
+ $form->error($locale->text('Database backups and restorations are disabled in the configuration.'));
}
my @dbsources = sort User->dbsources($form);
$form->{title} = "Lx-Office ERP " . $locale->text('Database Administration') . " / " . $locale->text('Backup Dataset');
- $main::pg_dump_exe ||= "pg_dump";
+ my $pg_dump_exe = $::lx_office_conf{applications}->{pg_dump} || "pg_dump";
- if ("$main::pg_dump_exe" eq "DISABLED") {
- $form->error($locale->text('Database backups and restorations are disabled in lx-erp.conf.'));
+ if ("$pg_dump_exe" eq "DISABLED") {
+ $form->error($locale->text('Database backups and restorations are disabled in the configuration.'));
}
$form->isblank("dbname", $locale->text('The dataset name is missing.'));
push @args, ("-p", $form->{dbport}) if ($form->{dbport});
push @args, $form->{dbname};
- my $cmd = "$main::pg_dump_exe " . join(" ", map { s/\\/\\\\/g; s/\"/\\\"/g; $_ } @args);
+ my $cmd = "$pg_dump_exe " . join(" ", map { s/\\/\\\\/g; s/\"/\\\"/g; $_ } @args);
my $name = "dataset_backup_$form->{dbname}_" . strftime("%Y%m%d", localtime()) . ".tar";
if ($form->{destination} ne "email") {
map { $mail->{$_} = $form->{$_} } qw(from to cc subject message);
- $mail->{charset} = $main::dbcharset ? $main::dbcharset : Common::DEFAULT_CHARSET;
+ $mail->{charset} = $::lx_office_conf{system}->{dbcharset} || Common::DEFAULT_CHARSET;
$mail->{attachments} = [ { "filename" => $tmp, "name" => $name } ];
$mail->send();
$form->{title} = "Lx-Office ERP " . $locale->text('Database Administration') . " / " . $locale->text('Restore Dataset');
- if ("$main::pg_restore_exe" eq "DISABLED") {
- $form->error($locale->text('Database backups and restorations are disabled in lx-erp.conf.'));
+ if ($::lx_office_conf{applications}->{pg_restore} eq "DISABLED") {
+ $form->error($locale->text('Database backups and restorations are disabled in the configuration.'));
}
- my $default_charset = $main::dbcharset;
+ my $default_charset = $::lx_office_conf{system}->{dbcharset};
$default_charset ||= Common::DEFAULT_CHARSET;
$form->{DBENCODINGS} = [];
$form->{title} = "Lx-Office ERP " . $locale->text('Database Administration') . " / " . $locale->text('Restore Dataset');
- $main::pg_restore_exe ||= "pg_restore";
+ my $pg_restore_exe = $::lx_office_conf{applications}->{pg_restore} || "pg_restore";
- if ("$main::pg_restore_exe" eq "DISABLED") {
- $form->error($locale->text('Database backups and restorations are disabled in lx-erp.conf.'));
+ if ("$pg_restore_exe" eq "DISABLED") {
+ $form->error($locale->text('Database backups and restorations are disabled in the configuration.'));
}
$form->isblank("new_dbname", $locale->text('The dataset name is missing.'));
push @args, ("-p", $form->{dbport}) if ($form->{dbport});
push @args, $tmp;
- my $cmd = "$main::pg_restore_exe " . join(" ", map { s/\\/\\\\/g; s/\"/\\\"/g; $_ } @args);
+ my $cmd = "$pg_restore_exe " . join(" ", map { s/\\/\\\\/g; s/\"/\\\"/g; $_ } @args);
my $in = IO::File->new("$cmd 2>&1 |");
my $form = $main::form;
my $locale = $main::locale;
- unlink "$main::userspath/nologin";
+ unlink _nologin_file_name();;
$form->{callback} = "admin.pl?action=list_users";
my $form = $main::form;
my $locale = $main::locale;
- open(FH, ">$main::userspath/nologin")
+ open(FH, ">" . _nologin_file_name())
or $form->error($locale->text('Cannot create Lock!'));
close(FH);
::end_of_request() if SL::DBUpgrade2->new(form => $::form, dbdriver => 'Pg', auth => 1)->apply_admin_dbupgrade_scripts(1);
}
+sub _nologin_file_name {
+ return $::lx_office_conf{paths}->{userspath} . '/nologin';
+}
+
1;
use utf8;
use SL::Auth;
+use SL::Auth::PasswordPolicy;
use SL::AM;
use SL::CA;
use SL::Form;
$form->{title} = $locale->text('Type of Business');
my @column_index = qw(description discount customernumberinit);
- push @column_index, 'salesman' if $::vertreter;
+ push @column_index, 'salesman' if $::lx_office_conf{system}->{vertreter};
my %column_header;
$column_header{description} =
qq|<th class=listheading width=60%>|
$form->format_amount(\%myconfig, $form->{discount} * 100);
my $salesman_code;
- if ($::vertreter) {
+ if ($::lx_office_conf{system}->{vertreter}) {
$salesman_code = qq|
<tr>
<th align="right">| . $locale->text('Representative') . qq|</th>
}
my $linkaccounts;
- if (!$main::eur) {
+ if (!$::lx_office_conf{system}->{eur}) {
$linkaccounts = qq|
<tr>
<th align=right>| . $locale->text('Inventory') . qq|</th>
_build_cfg_options('numberformat', ('1,000.00', '1000.00', '1.000,00', '1000,00'));
my @formats = ();
- if ($main::opendocument_templates && $main::openofficeorg_writer_bin &&
- $main::xvfb_bin && (-x $main::openofficeorg_writer_bin) && (-x $main::xvfb_bin)) {
+ if ($::lx_office_conf{print_templates}->{opendocument}
+ && $::lx_office_conf{applications}->{openofficeorg_writer} && (-x $::lx_office_conf{applications}->{openofficeorg_writer})
+ && $::lx_office_conf{applications}->{xvfb} && (-x $::lx_office_conf{applications}->{xvfb})) {
push(@formats, { "name" => $locale->text("PDF (OpenDocument/OASIS)"),
"value" => "opendocument_pdf" });
}
- if ($main::latex_templates) {
+ if ($::lx_office_conf{print_templates}->{latex}) {
push(@formats, { "name" => $locale->text("PDF"), "value" => "pdf" });
}
push(@formats, { "name" => "HTML", "value" => "html" });
- if ($main::latex_templates) {
+ if ($::lx_office_conf{print_templates}->{latex}) {
push(@formats, { "name" => $locale->text("Postscript"),
"value" => "postscript" });
}
- if ($main::opendocument_templates) {
+ if ($::lx_office_conf{print_templates}->{opendocument}) {
push(@formats, { "name" => $locale->text("OpenDocument/OASIS"),
"value" => "opendocument" });
}
TODO->save_user_config('login' => $form->{login}, %{ $form->{todo_cfg} || { } });
- $form->redirect($locale->text('Preferences saved!')) if (AM->save_preferences(\%myconfig, \%$form, 0));
+ if (AM->save_preferences(\%myconfig, $form)) {
+ if ($::auth->can_change_password()
+ && defined $form->{new_password}
+ && ($form->{new_password} ne '********')) {
+ my $verifier = SL::Auth::PasswordPolicy->new;
+ my $result = $verifier->verify($form->{new_password});
+
+ if ($result != SL::Auth::PasswordPolicy->OK()) {
+ $form->error($::locale->text('The settings were saved, but the password was not changed.') . ' ' . join(' ', $verifier->errors($result)));
+ }
+
+ $::auth->change_password($form->{login}, $form->{new_password});
+
+ $form->{password} = $form->{new_password};
+ $::auth->set_session_value('password', $form->{password});
+ $::auth->create_or_refresh_session();
+ }
+
+ $form->redirect($locale->text('Preferences saved!'));
+ }
+
$form->error($locale->text('Cannot save preferences!'));
$main::lxdebug->leave_sub();
$main::auth->assert('general_ledger');
- if (AP->delete_transaction(\%myconfig, \%$form, $main::spool)) {
+ if (AP->delete_transaction(\%myconfig, \%$form)) {
# saving the history
if(!exists $form->{addition}) {
$form->{snumbers} = qq|invnumber_| . $form->{invnumber};
$form->{exchangerate} = $form->{forex} if $form->{forex};
# format amounts
- $form->{exchangerate} =
- $form->format_amount(\%myconfig, $form->{exchangerate});
-
- if ($form->{exchangerate} == 0) {
- $form->{exchangerate} = "";
- }
-
- $form->{creditlimit} =
- $form->format_amount(\%myconfig, $form->{creditlimit}, 0, "0");
- $form->{creditremaining} =
- $form->format_amount(\%myconfig, $form->{creditremaining}, 0, "0");
+ $form->{exchangerate} = $form->{exchangerate} ? $form->format_amount(\%myconfig, $form->{exchangerate}) : '';
+ $form->{creditlimit} = $form->format_amount(\%myconfig, $form->{creditlimit}, 0, "0");
+ $form->{creditremaining} = $form->format_amount(\%myconfig, $form->{creditremaining}, 0, "0");
$exchangerate = qq|
<input type=hidden name=forex value=$form->{forex}>
$form->{callback} .= "&header=1" if $form->{callback};
$form->redirect($locale->text('Removed spoolfiles!'))
- if (BP->delete_spool(\%myconfig, \%$form, $main::spool));
+ if (BP->delete_spool(\%myconfig, \%$form));
$form->error($locale->text('Cannot remove files!'));
$main::lxdebug->leave_sub();
if ($form->{"checked_$i"}) {
$form->info($locale->text('Printing ... '));
- if (BP->print_spool(\%myconfig, \%$form, $main::spool, "| $selected_printer")) {
+ if (BP->print_spool(\%myconfig, \%$form, "| $selected_printer")) {
print $locale->text('done');
$form->redirect($locale->text('Marked entries printed!'));
}
my $i = 0;
my $j = 0;
my $spoolfile;
+ my $spool = $::lx_office_conf{paths}->{spool};
foreach my $ref (@{ $form->{SPOOL} }) {
"<td><a href=$module?action=edit&id=$ref->{id}&type=$form->{type}&callback=$callback>$ref->{quonumber}</a></td>";
$column_data{name} = "<td>$ref->{name}</td>";
$column_data{spoolfile} =
- qq|<td><a href=$main::spool/$ref->{spoolfile}>$ref->{spoolfile}</a></td>
+ qq|<td><a href=$spool/$ref->{spoolfile}>$ref->{spoolfile}</a></td>
<input type=hidden name="spoolfile_$i" value=$ref->{spoolfile}>
|;
$form->{title} = $locale->text('Chart of Accounts');
- if ($main::eur) {
+ if ($::lx_office_conf{system}->{eur}) {
$form->{method} = "cash";
}
<td colspan=3><select name=department>$form->{selectdepartment}</select></td>
</tr>
| if $form->{selectdepartment};
- my $accrual = ($main::eur) ? "" : "checked";
- my $cash = ($main::eur) ? "checked" : "";
+ my $accrual = $::lx_office_conf{system}->{eur} ? "" : "checked";
+ my $cash = $::lx_office_conf{system}->{eur} ? "checked" : "";
my $name_1 = "fromdate";
my $id_1 = "fromdate";
$form->{description} =~ s/\"/"/g;
+ my $eur = $::lx_office_conf{system}->{eur};
+
print qq|
<body onLoad="$onload">
<input type=hidden name=accno value=$form->{accno}>
<input type=hidden name=description value="$form->{description}">
<input type=hidden name=sort value=transdate>
-<input type=hidden name=eur value=$main::eur>
+<input type=hidden name=eur value=$eur>
<input type=hidden name=accounttype value=$form->{accounttype}>
<table border=0 width=100%>
use Carp;
use SL::Common;
+use SL::DB::Helper::Mappings;
use SL::DBUtils;
use SL::Form;
use SL::MoreCommon;
$main::lxdebug->leave_sub();
}
-if ($::use_rdbo) {
- eval {
- require SL::DB::Helper::Mappings;
- sub db {
- goto &SL::DB::Helper::Mappings::db;
- }
- } or die $@;
+sub db {
+ goto &SL::DB::Helper::Mappings::db;
}
1;
taxzones => "ALL_TAXZONES");
$form->get_pricegroup(\%myconfig, { all => 1 });
- $form->get_lists(customers => { key => "ALL_SALESMAN_CUSTOMERS", business_is_salesman => 1 }) if $::vertreter;
+ $form->get_lists(customers => { key => "ALL_SALESMAN_CUSTOMERS", business_is_salesman => 1 }) if $::lx_office_conf{system}->{vertreter};
$form->{ALL_SALESMEN} = $form->{ALL_EMPLOYEES};
$form->{taxincluded} = ($form->{taxincluded}) ? "checked" : "";
$::form->isblank("name", $::locale->text("Name missing!"));
- if ($::form->{new_salesman_id} && $::vertreter) {
+ if ($::form->{new_salesman_id} && $::lx_office_conf{system}->{vertreter}) {
$::form->{salesman_id} = $::form->{new_salesman_id};
delete $::form->{new_salesman_id};
}
foreach my $level (values %{ $levels }) {
next unless scalar @{ $level };
- DN->save_dunning(\%myconfig, $form, $level, $main::userspath, $main::spool);
+ DN->save_dunning(\%myconfig, $form, $level);
}
}
"customer_id" => $form->{"customer_id_$i"},
"next_dunning_config_id" => $form->{"next_dunning_config_id_$i"},
"email" => $form->{"email_$i"}, } ];
- DN->save_dunning(\%myconfig, $form, $level, $main::userspath, $main::spool);
+ DN->save_dunning(\%myconfig, $form, $level);
}
}
$form->all_vc(\%myconfig, $form->{vc}, ($form->{vc} eq 'customer') ? "AR" : "AP");
# retrieve order/quotation
- $form->{webdav} = $main::webdav;
+ $form->{webdav} = $::lx_office_conf{system}->{webdav};
$form->{jsscript} = 1;
my $editing = $form->{id};
map { $form->{"${_}_$form->{rowcount}"} = $ref->{$_} } keys %{ $ref };
map { $form->{"${_}_$form->{rowcount}"} = $form->format_amount(\%myconfig, $ref->{$_}) } qw(qty sellprice lastcost);
- if ($vc_discount){ # falls wir einen Lieferanten/Kundenrabatt haben
+ if ($vc_discount){ # falls wir einen Lieferanten/Kundenrabatt haben
# und keinen anderen discount wert an $i ...
$form->{"discount_$form->{rowcount}"} ||= $vc_discount; # ... nehmen wir diesen Rabatt
}
foreach my $request (@{ DO->unpack_stock_information('packed' => $form->{"stock_out_$i"}) }) {
$request->{parts_id} = $form->{"id_$i"};
$request->{base_qty} = $request->{qty} * $units->{$request->{unit}}->{factor} / $base_unit_factor;
- $request->{project_id} = $form->{"project_id_$i"} ? $form->{"project_id_$i"} : $form->{globalproject_id};
+ $request->{project_id} = $form->{"project_id_$i"} ? $form->{"project_id_$i"} : $form->{globalproject_id};
my $map_key = join '--', ($form->{"id_$i"}, @{$request}{qw(warehouse_id bin_id chargenumber bestbefore)});
my $pinfo = $part_info_map{$request->{parts_id}};
my $binfo = $bin_info_map{$request->{bin_id}};
- if ($main::show_best_before) {
+ if ($::lx_office_conf{system}->{show_best_before}) {
push @{ $form->{ERRORS} }, $locale->text("There is not enough available of '#1' at warehouse '#2', bin '#3', #4, #5, for the transfer of #6.",
$pinfo->{description},
$binfo->{warehouse_description},
$auth->assert('part_service_assembly_edit');
- $form->{eur} = $main::eur; # config dumps into namespace - yuck
+ $form->{eur} = $::lx_office_conf{system}->{eur}; # config dumps into namespace - yuck
$form->{pg_keys} = sub { "$_[0]->{partsgroup}--$_[0]->{id}" };
$form->{description_area} = ($form->{rows} = $form->numtextrows($form->{description}, 40)) > 1;
$form->{notes_rows} = max 4, $form->numtextrows($form->{notes}, 40), $form->numtextrows($form->{formel}, 40);
return if (scalar(@missing_modules) == 0);
use SL::Locale;
- my $locale = new Locale($main::language, "installationcheck");
+
+ my $locale = new Locale($::lx_office_conf{system}->{language}, "installationcheck");
print(qq|content-type: text/html
if ($item->{selected} && ($pricegroup_id != 0)) {
$form->{"pricegroup_old_$j"} = $pricegroup_id;
$form->{"price_new_$j"} = $price;
- $form->{"sellprice_$j"} = $price;
+ # edit: don't change the sellprice here
+ # $form->{"sellprice_$j"} = $price; # this must only be updated for existing articles, not new ones
}
if ($pricegroup_id == 0) {
$form->{"price_new_$j"} = $form->{"sellprice_$j"};
::end_of_request();
}
- Common::webdav_folder($form) if ($main::webdav);
+ Common::webdav_folder($form);
# if ( $form->{print_and_post}
# && $form->{second_run}
# for last row and report
# set pricegroup drop down list from report menu
if ($form->{"sellprice_$i"} != 0) {
+ # remember the pricegroup_id in pricegroup_old
+ # but don't overwrite it
$form->{"pricegroup_old_$i"} = $form->{"pricegroup_id_$i"};
my $default_option = $form->{"sellprice_$i"}.'--'.$form->{"pricegroup_id_$i"};
- $column_data{sellprice_pg} = NTI($cgi->popup_menu("sellpricepg_$i", [ $default_option ], $default_option, { $default_option => $form->{"pricegroup_$i"} || '' }));
+ $column_data{sellprice_pg} = NTI($cgi->popup_menu("sellprice_pg_$i", [ $default_option ], $default_option, { $default_option => $form->{"pricegroup_$i"} || '' }));
} else {
$column_data{sellprice_pg} = qq| |;
}
qw(bin listprice inventory_accno income_accno expense_accno unit weight
assembly taxaccounts partsgroup formel longdescription not_discountable
part_payment_id partnotes id lastcost price_factor_id price_factor);
- push @new_fields, "lizenzen" if ($main::lizenzen);
+ push @new_fields, "lizenzen" if $::lx_office_conf{system}->{lizenzen};
push @new_fields, grep { m/^ic_cvar_/ } keys %{ $form->{item_list}->[0] };
my $i = 0;
foreach my $ref (@{ $form->{item_list} }) {
my $checked = ($i++) ? "" : "checked";
- if ($main::lizenzen) {
+ if ($::lx_office_conf{system}->{lizenzen}) {
if ($ref->{inventory_accno} > 0) {
$ref->{"lizenzen"} = qq|<option></option>|;
foreach my $item (@{ $form->{LIZENZEN}{ $ref->{"id"} } }) {
$form->{payment_id} = $form->{"part_payment_id_$i"};
}
- if ($main::lizenzen) {
+ if ($::lx_office_conf{system}->{lizenzen}) {
map { $form->{"${_}_$i"} = $form->{"new_${_}_$j"} } qw(lizenzen);
}
my $script = $form->{"script"};
$script =~ s|.*/||;
$script =~ s|.pl$||;
- $locale = new Locale($main::language, $script);
+ $locale = new Locale($::lx_office_conf{system}->{language}, $script);
map { $form->{"select$_"} = "" } ($form->{vc}, "currency");
push @MEDIA, grep $_,
opthash("screen", $form->{OP}{screen}, $locale->text('Screen')),
- ($form->{printers} && scalar @{ $form->{printers} } && $main::latex_templates) ?
+ ($form->{printers} && scalar @{ $form->{printers} } && $::lx_office_conf{print_templates}->{latex}) ?
opthash("printer", $form->{OP}{printer}, $locale->text('Printer')) : undef,
- ($main::latex_templates && !$options{no_queue}) ?
+ ($::lx_office_conf{print_templates}->{latex} && !$options{no_queue}) ?
opthash("queue", $form->{OP}{queue}, $locale->text('Queue')) : undef
if ($form->{media} ne 'email');
push @FORMAT, grep $_,
- ($main::opendocument_templates && $main::openofficeorg_writer_bin && $main::xvfb_bin
- && (-x $main::openofficeorg_writer_bin) && (-x $main::xvfb_bin)
+ ($::lx_office_conf{print_templates}->{opendocument} && $::lx_office_conf{applications}->{openofficeorg_writer} && $::lx_office_conf{applications}->{xvfb}
+ && (-x $::lx_office_conf{applications}->{openofficeorg_writer}) && (-x $::lx_office_conf{applications}->{xvfb})
&& !$options{no_opendocument_pdf}) ?
opthash("opendocument_pdf", $form->{DF}{"opendocument_pdf"}, $locale->text("PDF (OpenDocument/OASIS)")) : undef,
- ($main::latex_templates) ?
+ ($::lx_office_conf{print_templates}->{latex}) ?
opthash("pdf", $form->{DF}{pdf}, $locale->text('PDF')) : undef,
- ($main::latex_templates && !$options{no_postscript}) ?
+ ($::lx_office_conf{print_templates}->{latex} && !$options{no_postscript}) ?
opthash("postscript", $form->{DF}{postscript}, $locale->text('Postscript')) : undef,
(!$options{no_html}) ?
opthash("html", $form->{DF}{html}, "HTML") : undef,
- ($main::opendocument_templates && !$options{no_opendocument}) ?
+ ($::lx_office_conf{print_templates}->{opendocument} && !$options{no_opendocument}) ?
opthash("opendocument", $form->{DF}{opendocument}, $locale->text("OpenDocument/OASIS")) : undef,
- ($main::excel_templates && !$options{no_excel}) ?
+ ($::lx_office_conf{print_templates}->{excel} && !$options{no_excel}) ?
opthash("excel", $form->{DF}{excel}, $locale->text("Excel")) : undef;
push @LANGUAGE_ID,
);
my %template_vars = (
- display_copies => scalar @{ $form->{printers} || [] } && $main::latex_templates && $form->{media} ne 'email',
+ display_copies => scalar @{ $form->{printers} || [] } && $::lx_office_conf{print_templates}->{latex} && $form->{media} ne 'email',
display_remove_draft => (!$form->{id} && $form->{draft_id}),
display_groupitems => !$dont_display_groupitems{$form->{type}},
groupitems_checked => $form->{groupitems} ? "checked" : '',
my $filename;
if ($filename = $queued{ $form->{formname} }) {
$form->{queued} =~ s/\Q$form->{formname} $filename\E//;
- unlink "$main::spool/$filename";
+ unlink $::lx_office_conf{paths}->{spool} . "/$filename";
$filename =~ s/\..*$//g;
} else {
$filename = time;
}
$filename .= ($form->{postscript}) ? '.ps' : '.pdf';
- $form->{OUT} = ">$main::spool/$filename";
+ $form->{OUT} = ">" . $::lx_office_conf{paths}->{spool} . "/$filename";
# add type
$form->{queued} .= " $form->{formname} $filename";
}
# /saving the history
- $form->parse_template(\%myconfig, $main::userspath);
+ $form->parse_template(\%myconfig);
$form->{callback} = "";
$form->{vc} = 'vendor';
# create links
- $form->{webdav} = $main::webdav;
+ $form->{webdav} = $::lx_office_conf{system}->{webdav};
$form->{jsscript} = 1;
$form->create_links("AP", \%myconfig, "vendor");
$form->{vc} = 'customer';
# create links
- $form->{webdav} = $main::webdav;
- $form->{lizenzen} = $main::lizenzen;
+ $form->{webdav} = $::lx_office_conf{system}->{webdav};
+ $form->{lizenzen} = $::lx_office_conf{system}->{lizenzen};
$form->create_links("AR", \%myconfig, "customer");
# get pricegroups for parts
IS->get_pricegroups_for_parts(\%myconfig, \%$form);
- set_pricegroup($_) for 1 .. $form->{rowcount};
+
+ # Problem: set_pricegroup resets the sellprice of old invoices to the price
+ # currently defined in the pricegroup, which is a problem if the price has
+ # changed, as the old invoice gets the new price
+ # set_pricegroup must never be called, when an old invoice is initially loaded
+
+ # set_pricegroup($_) for 1 .. $form->{rowcount};
}
$main::lxdebug->leave_sub();
}
$form->{"qty_$i"} = $form->format_amount(\%myconfig, $form->{"qty_$i"});
- if ($main::lizenzen) {
+ if ($::lx_office_conf{system}->{lizenzen}) {
if ($form->{"inventory_accno_$i"} ne "") {
$form->{"lizenzen_$i"} = qq|<option></option>|;
foreach my $item (@{ $form->{LIZENZEN}{ $form->{"id_$i"} } }) {
$form->{paidaccounts} = 1;
$form->{rowcount}--;
$form->{invdate} = $form->current_date(\%myconfig);
+
+ # remember pricegroups for "use as template"
+ IS->get_pricegroups_for_parts(\%myconfig, \%$form);
+ set_pricegroup($_) for 1 .. $form->{rowcount};
+
&display_form;
$main::lxdebug->leave_sub();
$main::auth->assert('invoice_edit');
- if (IS->delete_invoice(\%myconfig, \%$form, $main::spool)) {
+ if (IS->delete_invoice(\%myconfig, \%$form)) {
# saving the history
if(!exists $form->{addition}) {
$form->{snumbers} = qq|invnumber_| . $form->{invnumber};
$form->{title} = $locale->text('Add License');
- if (!$main::lizenzen) {
+ if (!$::lx_office_conf{system}->{lizenzen}) {
$form->error(
$locale->text(
- 'The licensing module has been deactivated in lx-erp.conf.')
+ 'The licensing module has been deactivated in the configuration.')
);
}
$form->{title} = $locale->text('Licenses');
- if (!$main::lizenzen) {
+ if (!$::lx_office_conf{system}->{lizenzen}) {
$form->error(
$locale->text(
- 'The licensing module has been deactivated in lx-erp.conf.')
+ 'The licensing module has been deactivated in the configuration.')
);
}
sub show_error {
my $template = shift;
my %myconfig = %main::myconfig;
- $myconfig{countrycode} = $main::language;
+ $myconfig{countrycode} = $::lx_office_conf{system}->{language};
$form->{stylesheet} = 'css/lx-office-erp.css';
$form->header();
$::lxdebug->enter_sub;
my $framesize = _calc_framesize() - 2;
- my $menu = Menu->new($::menufile);
+ my $menu = Menu->new("menu.ini");
$mainlevel = $::form->{level};
$::form->{title} = $::locale->text('Lx-Office');
$::form->header;
my $form = $main::form;
my %myconfig = %main::myconfig;
- my $charset = $main::dbcharset || 'ISO-8859-1';
+ my $charset = $::lx_office_conf{system}->{dbcharset} || 'ISO-8859-1';
my $callback = $form->unescape($form->{callback});
$callback = URI->new($callback)->rel($callback) if $callback;
$callback = "login.pl?action=company_logo" if $callback =~ /^(\.\/)?$/;
my $mainlevel = $form->{level};
$mainlevel =~ s/$mainlevel--//g;
- my $menu = Menu->new($::menufile);
+ my $menu = Menu->new("menu.ini");
$| = 1;
my $mainlevel = $form->{level};
$mainlevel =~ s/$mainlevel--//g;
- my $menu = Menu->new($::menufile);
+ my $menu = Menu->new("menu.ini");
$| = 1;
my $mainlevel = $form->{level};
$mainlevel =~ s/\Q$mainlevel\E--//g;
- my $menu = Menu->new($::menufile);
+ my $menu = Menu->new("menu.ini");
$| = 1;
my $mainlevel = $form->{level};
$mainlevel =~ s/\Q$mainlevel\E--//g;
- my $menu = Menu->new($::menufile);
+ my $menu = Menu->new("menu.ini");
$| = 1;
$form->all_vc(\%myconfig, $form->{vc}, ($form->{vc} eq 'customer') ? "AR" : "AP");
# retrieve order/quotation
- $form->{webdav} = $main::webdav;
+ $form->{webdav} = $::lx_office_conf{system}->{webdav};
$form->{jsscript} = 1;
my $editing = $form->{id};
print $form->parse_html_template("oe/form_footer", {
%TMPL_VAR,
- webdav => $main::webdav,
+ webdav => $::lx_office_conf{system}->{webdav},
print_options => print_options(inline => 1),
label_edit => $locale->text("Edit the $form->{type}"),
label_workflow => $locale->text("Workflow $form->{type}"),
$msg = $locale->text('Quotation deleted!');
$err = $locale->text('Cannot delete quotation!');
}
- if (OE->delete(\%myconfig, \%$form, $main::spool)){
+ if (OE->delete(\%myconfig, \%$form)){
# saving the history
if(!exists $form->{addition}) {
$form->{snumbers} = qq|ordnumber_| . $form->{ordnumber};
}
+ # show pricegroup in newly loaded invoice when creating invoice from quotation/order
+ IS->get_pricegroups_for_parts(\%myconfig, \%$form);
+ set_pricegroup($_) for 1 .. $form->{rowcount};
+
&display_form;
$main::lxdebug->leave_sub();
$form->language_payment(\%myconfig);
- Common::webdav_folder($form) if ($main::webdav);
+ Common::webdav_folder($form);
&form_header;
$form->{title} = $locale->text($title{ $form->{report} });
- my $accrual = ($main::eur) ? "" : "checked";
- my $cash = ($main::eur) ? "checked" : "";
+ my $accrual = $::lx_office_conf{system}->{eur} ? "" : "checked";
+ my $cash = $::lx_office_conf{system}->{eur} ? "checked" : "";
my $year = (localtime)[5] + 1900;
$form->{attachment_filename} = $locale->quote_special_chars('filenames', $locale->text("Statement") . "_$form->{todate}.$attachment_suffix");
$form->{attachment_filename} =~ s/\s+/_/g;
- $form->parse_template(\%myconfig, $main::userspath);
+ $form->parse_template(\%myconfig);
}
}
} else {
$media = qq|
<option value=screen $form->{OP}{screen}>| . $locale->text('Screen');
- if ($myconfig{printer} && $main::latex_templates) {
+ if ($myconfig{printer} && $::lx_office_conf{print_templates}->{latex}) {
$media .= qq|
<option value=printer $form->{OP}{printer}>| . $locale->text('Printer');
}
}
my $format;
- if ($main::latex_templates) {
+ if ($::lx_office_conf{print_templates}->{latex}) {
$format .= qq|
<option value=html $form->{DF}{html}>| . $locale->text('HTML')
. qq| <option value=pdf $form->{DF}{pdf}>| . $locale->text('PDF')
<td><select name=media>$media</select></td>
|;
- if ($myconfig{printer} && $main::latex_templates && $form->{media} ne 'email') {
+ if ($myconfig{printer} && $::lx_office_conf{print_templates}->{latex} && $form->{media} ne 'email') {
$output .= qq|
<td>| . $locale->text('Copies') . qq|
<input name=copies size=2 value=$form->{copies}></td>
my $sepa_xml = SL::SEPA::XML->new('company' => $myconfig->{company},
'creditor_id' => $myconfig->{sepa_creditor_id},
- 'src_charset' => $main::dbcharset || 'ISO-8859-15',
+ 'src_charset' => $::lx_office_conf{system}->{dbcharset} || 'ISO-8859-15',
'message_id' => $message_id,
'grouped' => 1,
'collection' => $vc eq 'customer',
$form->error($locale->text('The warehouse or the bin is missing.'));
}
- if (!$main::show_best_before) {
+ if (!$::lx_office_conf{system}->{show_best_before}) {
$form->{bestbefore} = '';
}
+++ /dev/null
-use Cwd;
-
-use vars qw(
-$dbcharset $eur $ghostscript_bin $html2ps_bin $language $latex_bin
-$latex_templates $lizenzen $memberfile $opendocument_templates
-$openofficeorg_daemon $openofficeorg_daemon_port $openofficeorg_writer_bin
-$pg_dump_exe $pg_restore_exe $sendmail $show_best_before $sid $spool $templates
-$use_rdbo $userspath $vertreter $webdav $xvfb_bin
-);
-
-# path to user configuration files
-$userspath = "users";
-
-# spool directory for batch printing
-$spool = "spool";
-
-# templates base directory
-$templates = "templates";
-
-# member file
-$memberfile = "users/members";
-
-# Wenn Einnahmen-Überschussrechnung, dann auf 1 setzen
-# Wenn Bilanzierung (z.B. GmbH), dann auf 0 setzen
-$eur = 1;
-
-# location of sendmail
-$sendmail = '| /usr/sbin/sendmail -t<%if myconfig_email%> -f <%myconfig_email%><%end%>';
-
-# set language for login and admin
-# currently "de" (German), "de_DE" (new German) and "en" (English, not perfect) are available
-$language = "de";
-
-# Oracle
-$sid = "T80509";
-$ENV{"ORACLE_HOME"} = "/usr/local/oracle";
-
-# if you have latex installed set to 1
-$latex_templates = 1;
-
-# if the server can't find gzip, latex, dvips or pdflatex, add the path
-$ENV{PATH} .= ":/usr/local/bin";
-
-# on mac os X using Fink's Perl libs, add the path
-$ENV{PERL5LIB} .= ":/sw/lib/perl5";
-
-# Aktivierung der verschiedenen Spezialmodule
-$webdav = 0;
-$lizenzen = 1;
-$vertreter = 0;
-$excel_templates = 0; # Minimalunterstützung für Excel-Druckvorlagen
-
-# Zeige Felder für Mindesthaltbarkeitsdatum
-$show_best_before = 0;
-
-## Support fuer OpenDocument-Vorlagen
-# Diese Option legt fest, ob OpenDocument-Vorlagen generell verfuegbar sind.
-$opendocument_templates = 1;
-
-# Die folgenden zwei Variablen legen Pfade zu Programmen fest, die benoetigt
-# werden, um OpenDocument-Vorlagen in PDFs umzuwandeln.
-
-# Pfad zu OpenOffice.org writer
-$openofficeorg_writer_bin = "/usr/bin/oowriter";
-
-# Soll OpenOffice dauerhaft gestartet bleiben? Die Konvertierung nachfolgender
-# Dokumente geht dann schneller. Allerdings wird auf dem System ein
-# installiertes Python mit den Python-UNO-Bindings benoetigt, die Bestandteil
-# von OpenOffice sind.
-$openofficeorg_daemon = 1;
-$openofficeorg_daemon_port = 2002;
-
-# Pfad zum "X virtual frame buffer", unter dem OpenOffice gestartet wird.
-# Zusaetzlich muessen die Programme "xauth" und "mcookie" gefunden werden
-# koennen, was eine Aenderung an PATH bedeuten kann.
-$ENV{"PATH"} = $ENV{"PATH"} . ":/usr/X11R6/bin:/usr/X11/bin";
-$xvfb_bin = "/usr/bin/Xvfb";
-
-# Das charset, in dem die Daten in der Datenbank abgelegt sind.
-$dbcharset = 'UTF-8'; # Für UNICODE UTF-8
-# $dbcharset = "ISO-8859-15";
-
-
-# Pfad zu 'html2ps' zum Export von Listenansichten als PDF
-$html2ps_bin = "/usr/bin/html2ps";
-$ghostscript_bin = "/usr/bin/gs";
-
-# Name von bzw. Pfad zu 'pdflatex' oder einer anderen kompatiblen Version
-# wie z.B. 'xetex'
-$latex_bin = 'pdflatex';
-
-# Datenbankbackups werden mit dem externen Programm "pg_dump" erledigt.
-# Wenn es nicht im aktuellen Pfad vorhanden ist, so muss hier der vollständige
-# Pfad eingetragen werden. Wenn die Variable auf "DISABLED" gesetzt wird,
-# so wird der Menüpunkt zum Backup von Datenbanken im Administrationsfrontend
-# nicht angeboten.
-# Das gleiche gilt analog für das Wiederherstellen mittels "pg_restore".
-$pg_dump_exe = "pg_dump";
-$pg_restore_exe = "pg_restore";
-
-# Rose::DB::Object Environment laden.
-# Die RDBO Klassen bieten für Addon Schreiber sehr einfache Interfaces zu den
-# bestehenden Klassen, haben aber den Nachteil, dass der Start des Programms
-# etwa 2s mehr dauert. Damit fällt die Möglichkeit Lx-Office über CGI zu
-# betreiben weg.
-$use_rdbo = 1;
-
-# Globale Debug-Ausgaben (de-)aktivieren? Moegliche Werte sind
-# LXDebug::NONE - keine Debugausgaben
-# LXDebug::INFO
-# LXDebug::DEBUG1
-# LXDebug::DEBUG2
-# LXDebug::QUERY - SQL Queries
-# LXDebug::TRACE - Tracing von Funktionsaufrufen
-# LXDebug::BACKTRACE_ON_ERROR - Vollständiger Aufrufpfad, wenn $form->error() aufgerufen wird
-# LXDebug::REQUEST_TIMER - Timing von Requests loggen
-# LXDebug::WARN - warnings
-# LXDebug::ALL - alle Debugausgaben
-#
-# LXDebug::DEVEL - wie INFO | QUERY | TRACE | BACKTRACE_ON_ERROR
-#
-# Beipiel:
-# $LXDebug::global_level = LXDebug::TRACE | LXDebug::QUERY;
-$LXDebug::global_level = LXDebug->NONE;
-
-# Überwachung der Inhalte von $form aktiviert oder nicht? Wenn ja,
-# dann können einzelne Variablen mit
-# $form->{"Watchdog::<variablenname>"} = 1;
-# überwacht werden. Bedeutet aber auch einen Geschwindigkeitsverlust,
-# weshalb sie normalerweise deaktiviert ist.
-$LXDebug::watch_form = 0;
-
-# Zum debuggen von Latexausgaben. Wenn diese Option auf 1 gesetzt wird, werden
-# temporäre Dateien, die bei der Erstellung von PDFs aus Latex erzeugt werden,
-# nach Abschluß der Erstellung oder im Fehlerfall nicht gelöscht, damit man sie
-# untersuchen kann.
-$::keep_temp_files = 0;
-
-1;
+++ /dev/null
-use Cwd;
-
-use vars qw(
- $dbcharset $eur $ghostscript_bin $html2ps_bin $language $latex_bin
- $latex_templates $lizenzen $memberfile $opendocument_templates
- $openofficeorg_daemon $openofficeorg_daemon_port $openofficeorg_writer_bin
- $parts_image_css $parts_listing_images $parts_show_image $pg_dump_exe
- $pg_restore_exe $sendmail $show_best_before $sid $spool $templates $userspath
- $vertreter $webdav $xvfb_bin
-);
-
-
-# path to user configuration files
-$userspath = "users";
-
-# spool directory for batch printing
-$spool = "spool";
-
-# templates base directory
-$templates = "templates";
-
-# member file
-$memberfile = "users/members";
-
-# Wenn nicht Bilanzierung dann auf 1 setzen
-$eur = 1;
-
-# location of sendmail
-$sendmail = '| /usr/sbin/sendmail -t<%if myconfig_email%> -f <%myconfig_email%><%end%>';
-
-# set language for login and admin
-$language = "de";
-
-# Oracle
-$sid = "T80509";
-$ENV{"ORACLE_HOME"} = "/usr/local/oracle";
-
-# if you have latex installed set to 1
-$latex_templates = 1;
-
-# if the server can't find gzip, latex, dvips or pdflatex, add the path
-$ENV{PATH} .= ":/usr/local/bin";
-
-# on mac os X using Fink's Perl libs, add the path
-$ENV{PERL5LIB} .= ":/sw/lib/perl5";
-
-# Aktivierung der verschiedenen Spezialmodule
-$webdav = 0;
-$lizenzen = 1;
-$vertreter = 0;
-
-# Zeige Felder für Mindesthaltbarkeitsdatum
-$show_best_before = 0;
-
-## Artikelbilder anzeigen
-# Artikelbild in der Detailansicht anzeigen
-$parts_show_image = 1; # [0|1]
-$parts_image_css = 'border:0;float:left;max-width:250px;margin-top:20px:margin-right:10px;margin-left:10px;'; # [belibige valide css definiton]
-# Artikelbilder per default in den Suchergebnissen anzeigen
-$parts_listing_images = 0; # [0|1]
-
-## Support fuer OpenDocument-Vorlagen
-# Diese Option legt fest, ob OpenDocument-Vorlagen generell verfuegbar sind.
-$opendocument_templates = 1;
-
-# Die folgenden zwei Variablen legen Pfade zu Programmen fest, die benoetigt
-# werden, um OpenDocument-Vorlagen in PDFs umzuwandeln.
-
-# Pfad zu OpenOffice.org writer
-$openofficeorg_writer_bin = "/usr/bin/oowriter";
-
-# Soll OpenOffice dauerhaft gestartet bleiben? Die Konvertierung nachfolgender
-# Dokumente geht dann schneller. Allerdings wird auf dem System ein
-# installiertes Python mit den Python-UNO-Bindings benoetigt, die Bestandteil
-# von OpenOffice sind.
-$openofficeorg_daemon = 1;
-$openofficeorg_daemon_port = 2002;
-
-# Pfad zum "X virtual frame buffer", unter dem OpenOffice gestartet wird.
-# Zusaetzlich muessen die Programme "xauth" und "mcookie" gefunden werden
-# koennen, was eine Aenderung an PATH bedeuten kann.
-$ENV{"PATH"} = $ENV{"PATH"} . ":/usr/X11R6/bin:/usr/X11/bin";
-$xvfb_bin = "/usr/bin/Xvfb";
-
-# Das charset, in dem die Daten in der Datenbank abgelegt sind.
-$dbcharset = 'UTF-8'; # Für UNICODE UTF-8
-# $dbcharset = "ISO-8859-15";
-
-
-# Pfad zu 'html2ps' zum Export von Listenansichten als PDF
-$html2ps_bin = "/usr/bin/html2ps";
-$ghostscript_bin = "/usr/bin/gs";
-
-# Name von bzw. Pfad zu 'pdflatex' oder einer anderen kompatiblen Version
-# wie z.B. 'xetex'
-$latex_bin = 'pdflatex';
-
-# Datenbankbackups werden mit dem externen Programm "pg_dump" erledigt.
-# Wenn es nicht im aktuellen Pfad vorhanden ist, so muss hier der vollständige
-# Pfad eingetragen werden. Wenn die Variable auf "DISABLED" gesetzt wird,
-# so wird der Menüpunkt zum Backup von Datenbanken im Administrationsfrontend
-# nicht angeboten.
-# Das gleiche gilt analog für das Wiederherstellen mittels "pg_restore".
-$pg_dump_exe = "pg_dump";
-$pg_restore_exe = "pg_restore";
-
-# Globale Debug-Ausgaben (de-)aktivieren? Moegliche Werte sind
-# LXDebug::NONE - keine Debugausgaben
-# LXDebug::INFO
-# LXDebug::DEBUG1
-# LXDebug::DEBUG2
-# LXDebug::QUERY - SQL Queries
-# LXDebug::TRACE - Tracing von Funktionsaufrufen
-# LXDebug::BACKTRACE_ON_ERROR - Vollständiger Aufrufpfad, wenn $form->error() aufgerufen wird
-# LXDebug::REQUEST_TIMER - Timing von Requests loggen
-# LXDebug::WARN - warnings
-# LXDebug::ALL - alle Debugausgaben
-#
-# LXDebug::DEVEL - wie INFO | QUERY | TRACE | BACKTRACE_ON_ERROR
-#
-# Beipiel:
-# $LXDebug::global_level = LXDebug::TRACE | LXDebug::QUERY;
-$LXDebug::global_level = LXDebug::NONE;
-
-# Überwachung der Inhalte von $form aktiviert oder nicht? Wenn ja,
-# dann können einzelne Variablen mit
-# $form->{"Watchdog::<variablenname>"} = 1;
-# überwacht werden. Bedeutet aber auch einen Geschwindigkeitsverlust,
-# weshalb sie normalerweise deaktiviert ist.
-$LXDebug::watch_form = 0;
-
-# Zum debuggen von Latexausgaben. Wenn diese Option auf 1 gesetzt wird, werden
-# temporäre Dateien, die bei der Erstellung von PDFs aus Latex erzeugt werden,
-# nach Abschluß der Erstellung oder im Fehlerfall nicht gelöscht, damit man sie
-# untersuchen kann.
-$::keep_temp_files = 0;
-
-1;
+[system]
+# EUR: Einnahmen-Überschussrechnung (net income method). Set this to 1
+# if your company uses the net income method and to 0 for balacing.
+eur = 1
+
+# Set language for login and admin forms. Currently "de" (German),
+# "de_DE" (new German) and "en" (English, not perfect) are available.
+language = de
+
+# The database charset. Must match the database cluster you want to
+# connect to.
+dbcharset = UTF-8
+
+[features]
+# Activate certain optional features and modules.
+webdav = 0
+lizenzen = 1
+vertreter = 0
+
+# Show fields used for the best before date
+show_best_before = 0
+
+## Pictures for parts
+# Show the picture in the part form
+parts_show_image = 1
+# Style the picture with the following CSS code:
+parts_image_css = border:0;float:left;max-width:250px;margin-top:20px:margin-right:10px;margin-left:10px;
+# Show the picture in the results when you search for parts
+parts_listing_images = 0
+
+[paths]
+# path to temporary files (must be writeable by the web server)
+userspath = users
+# spool directory for batch printing
+spool = spool
+# templates base directory
+templates = templates
+# Path to the old memberfile (ignored on new installations)
+memberfile = users/members
+
+[applications]
+# Location of sendmail
+sendmail = /usr/sbin/sendmail -t<%if myconfig_email%> -f <%myconfig_email%><%end%>
+# Location of OpenOffice.org writer
+openofficeorg_writer = oowriter
+# Location of the X virtual frame buffer used for OpenOffice
+xvfb = Xvfb
+# Location of the html2ps binary
+html2ps = html2ps
+# Location of the Ghostscript binary
+ghostscript = gs
+# Location of the pdflatex (or compatible, e.g. xetex) binary
+latex = pdflatex
+# Location of the two executables "pg_dump" and "pg_restore" used for
+# database backup and restoration from the admin section. If
+# "pg_dump" or "pg_restore" is set to "DISABLED" then the
+# corresponding option (backup/restoration) will be hidden from the
+# admin section.
+pg_dump = pg_dump
+pg_restore = pg_restore
+
+[environment]
+# Add the following paths to the PATH environment variable.
+path = /usr/local/bin:/usr/X11R6/bin:/usr/X11/bin
+# Add the following paths to the PERL5LIB environment variable.
+# "/sw/lib/perl5" is for Mac OS X with Fink's Perl.
+lib = /sw/lib/perl5
+
+[print_templates]
+# If you have LaTeX installed set to 1
+latex = 1
+# Minimal support for Excel print templates
+excel = 0
+# Enable or disable support for OpenDocument print templates
+opendocument = 1
+# Chose whether or not OpenOffice should remain running after a
+# conversion. If yes then the conversion of subsequent documents will
+# be a lot faster. You need to have Python and the Python UNO bindings
+# (part of OpenOffice) installed.
+openofficeorg_daemon = 1
+openofficeorg_daemon_port = 2002
+
[task_server]
# User name to use for database access
login = mb
[periodic_invoices]
# The user name a report about the posted and printed invoices is sent
# to.
-send_email_to = login
+send_email_to = mb
# The "From:" header for said email.
email_from = Lx-Office Daemon <root@localhost>
# The subject for said email.
# The template file used for the email's body.
email_template = templates/webpages/oe/periodic_invoices_email.txt
-[Console]
+[console]
# autologin to use if none is given
-login = demo
+login = mb
# autorun lines will be executed after autologin.
# be warned that loading huge libraries will noticably lengthen startup time.
-#autorun = use SL::Module
-# = use SL::Other::Module
+autorun = require "bin/mozilla/common.pl";
+ = use English qw(-no_match_vars);
+ = use List::Util qw(min max);
+ = use Sort::Naturally;
+ = my ($a, $b, $e, $f, @a1, @a2, %h);
+ = sub take { my $max = shift; my $r = ref($_[0]) eq 'ARRAY' ? $_[0] : \@_; return @{$r}[0..List::Util::min($max, scalar(@{$r})) - 1]; }
# location of history file for permanent history
history_file = users/console_history
= log4perl.appender.A1.mode=append
= log4perl.appender.A1.layout=Log::Log4perl::Layout::PatternLayout
= log4perl.appender.A1.layout.ConversionPattern=%d %p> %F{1}:%L %M - %m%n
+
+# Activate certain global debug messages. If you want to combine
+# several options then list them seperated by spaces.
+#
+# Possible values include:
+# NONE - no debug output (default)
+# INFO
+# DEBUG1
+# DEBUG2
+# QUERY - Dump SQL queries (only in legacy code; see also "dbix_log4perl" above)
+# TRACE - Track function calls and returns
+# BACKTRACE_ON_ERROR - Print a function call backtrace when $form->error() is called
+# REQUEST_TIMER - Log timing of HTTP requests
+# WARN - warnings
+# ALL - all possible debug messages
+#
+# DEVEL - sames as "INFO QUERY TRACE BACKTRACE_ON_ERROR REQUEST_TIMER"
+#
+# Example:
+# global_level = TRACE QUERY
+global_level = NONE
+
+# Activate monitoring of the content of $form. If it is active then
+# monitoring can be turned on for certain variables with the
+# following:
+# $form->{"Watchdog::<variable>"} = 1;
+# Monitoring has a performance cost and is therefore deactivated by
+# default.
+watch_form = 0
+
+# If you want to debug the creation of LaTeX files then set this to 1.
+# That way the temporary LaTeX files created during PDF creation are
+# not removed and remain in the "users" directory.
+keep_temp_files = 0
+
+# The file name where the debug messages are written to.
+file_name = /tmp/mb-lxdebug.log
Wenn Sie für die Lx-Office-Installation nicht den europäischen
Schriftsatz ISO-8859-15 sondern UTF-8 (Unicode) benutzen wollen, so
müssen Sie vor dem Anlegen der Datenbank in der Datei
-@code{config/lx-erp.conf} die Variable @code{$dbcharset} auf den Wert
-@samp{UTF-8} setzen. Zusätzlich muss beim Anlegen der Datenbank
-@samp{UTF-8 Unicode} als Schriftsatz ausgewählt werden.
+@code{config/lx_office.conf} die Variable @code{dbcharset} im
+Abschnitt @code{system} auf den Wert @samp{UTF-8} setzen. Zusätzlich
+muss beim Anlegen der Datenbank @samp{UTF-8 Unicode} als Schriftsatz
+ausgewählt werden.
Bitte beachten Sie, dass alle Datenbanken den selben Zeichensatz
verwenden müssen, da diese Einstellungen momentan global in Lx-Office
erzeugt. Lx-Office kann dabei sowohl neue OpenDocument-Dokumente als
auch aus diesen direkt PDF-Dateien erzeugen. Um die Unterstützung von
OpenDocument-Vorlagen zu aktivieren muss in der Datei
-@code{config/lx-erp.conf} die Variable @code{$opendocument_templates}
-auf @samp{1} stehen. Dieses ist die Standardeinstellung.
+@code{config/lx_office.conf} die Variable @code{opendocument} im
+Abschnitt @code{print_templates} auf @samp{1} stehen. Dieses ist die
+Standardeinstellung.
-Weiterhin muss in der Datei @code{config/lx-erp.conf} die Variable
-@code{$dbcharset} auf die Zeichenkodierung gesetzt werden, die auch
-bei der Speicherung der Daten in der Datenbank verwendet wird. Diese
-ist in den meisten Fällen "UTF-8".
+Weiterhin muss in der Datei @code{config/lx_office.conf} die Variable
+@code{dbcharset} im Abschnitt @code{system} auf die Zeichenkodierung
+gesetzt werden, die auch bei der Speicherung der Daten in der
+Datenbank verwendet wird. Diese ist in den meisten Fällen "UTF-8".
Während die Erzeugung von reinen OpenDocument-Dateien keinerlei
weitere Software benötigt, wird zur Umwandlung dieser Dateien in PDF
(xvfb) installiert werden. Bei Debian ist er im Paket ``xvfb''
enthalten. Andere Distributionen enthalten ihn in anderen Paketen.
-Nach der Installation müssen in der Datei @code{config/lx-erp.conf}
-zwei weitere Variablen angepasst werden:
-@code{$openofficeorg_writer_bin} muss den vollständigen Pfad zur
-OpenOffice.org Writer-Anwendung enthalten. @code{$xvfb_bin} muss den
-Pfad zum ``X virtual frame buffer'' enthalten.
+Nach der Installation müssen in der Datei @code{config/lx_config.conf}
+zwei weitere Variablen angepasst werden: @code{openofficeorg_writer}
+muss den vollständigen Pfad zur OpenOffice.org Writer-Anwendung
+enthalten. @code{xvfb} muss den Pfad zum ``X virtual frame buffer''
+enthalten. Beide stehen im Abschnitt @code{applications}.
Zusätzlich gibt es zwei verschiedene Arten, wie Lx-Office mit
OpenOffice kommuniziert. Die erste Variante, die benutzt wird, wenn
libdatetime-perl libdbi-perl libdbd-pg-perl libpg-perl
libemail-address-perl libio-stringy-perl liblist-moreutils-perl
libpdf-api2-perl libtemplate-perl libtext-csv-xs-perl
-libtext-iconv-perl liburi-perl libxml-writer-perl libyaml-perl
-librose-object-perl librose-db-perl librose-db-object-perl
-libreadonly-xs-perl'
+libtext-iconv-perl liburi-perl libxml-writer-perl libyaml-perl'
Für Fedora Core benötigen Sie diese Pakete:
Wenn Sie für die Lx-Office-Installation nicht den europäischen
Schriftsatz ISO-8859-15 sondern UTF-8 (Unicode) benutzen wollen, so
müssen Sie vor dem Anlegen der Datenbank in der Datei
-`config/lx-erp.conf' die Variable `$dbcharset' auf den Wert `UTF-8'
-setzen. Zusätzlich muss beim Anlegen der Datenbank `UTF-8 Unicode' als
-Schriftsatz ausgewählt werden.
+`config/lx_office.conf' die Variable `dbcharset' im Abschnitt `system'
+auf den Wert `UTF-8' setzen. Zusätzlich muss beim Anlegen der Datenbank
+`UTF-8 Unicode' als Schriftsatz ausgewählt werden.
Bitte beachten Sie, dass alle Datenbanken den selben Zeichensatz
verwenden müssen, da diese Einstellungen momentan global in Lx-Office
Lx-Office kann dabei sowohl neue OpenDocument-Dokumente als auch aus
diesen direkt PDF-Dateien erzeugen. Um die Unterstützung von
OpenDocument-Vorlagen zu aktivieren muss in der Datei
-`config/lx-erp.conf' die Variable `$opendocument_templates' auf `1'
-stehen. Dieses ist die Standardeinstellung.
+`config/lx_office.conf' die Variable `opendocument' im Abschnitt
+`print_templates' auf `1' stehen. Dieses ist die Standardeinstellung.
- Weiterhin muss in der Datei `config/lx-erp.conf' die Variable
-`$dbcharset' auf die Zeichenkodierung gesetzt werden, die auch bei der
-Speicherung der Daten in der Datenbank verwendet wird. Diese ist in den
-meisten Fällen "UTF-8".
+ Weiterhin muss in der Datei `config/lx_office.conf' die Variable
+`dbcharset' im Abschnitt `system' auf die Zeichenkodierung gesetzt
+werden, die auch bei der Speicherung der Daten in der Datenbank
+verwendet wird. Diese ist in den meisten Fällen "UTF-8".
Während die Erzeugung von reinen OpenDocument-Dateien keinerlei
weitere Software benötigt, wird zur Umwandlung dieser Dateien in PDF
(xvfb) installiert werden. Bei Debian ist er im Paket "xvfb"
enthalten. Andere Distributionen enthalten ihn in anderen Paketen.
- Nach der Installation müssen in der Datei `config/lx-erp.conf' zwei
-weitere Variablen angepasst werden: `$openofficeorg_writer_bin' muss
+ Nach der Installation müssen in der Datei `config/lx_config.conf'
+zwei weitere Variablen angepasst werden: `openofficeorg_writer' muss
den vollständigen Pfad zur OpenOffice.org Writer-Anwendung enthalten.
-`$xvfb_bin' muss den Pfad zum "X virtual frame buffer" enthalten.
+`xvfb' muss den Pfad zum "X virtual frame buffer" enthalten. Beide
+stehen im Abschnitt `applications'.
Zusätzlich gibt es zwei verschiedene Arten, wie Lx-Office mit
OpenOffice kommuniziert. Die erste Variante, die benutzt wird, wenn die
<p>Wenn Sie für die Lx-Office-Installation nicht den europäischen
Schriftsatz ISO-8859-15 sondern UTF-8 (Unicode) benutzen wollen, so
müssen Sie vor dem Anlegen der Datenbank in der Datei
-<code>config/lx-erp.conf</code> die Variable <code>$dbcharset</code> auf den Wert
-‘<samp><span class="samp">UTF-8</span></samp>’ setzen. Zusätzlich muss beim Anlegen der Datenbank
-‘<samp><span class="samp">UTF-8 Unicode</span></samp>’ als Schriftsatz ausgewählt werden.
+<code>config/lx_office.conf</code> die Variable <code>dbcharset</code> im
+Abschnitt <code>system</code> auf den Wert ‘<samp><span class="samp">UTF-8</span></samp>’ setzen. Zusätzlich
+muss beim Anlegen der Datenbank ‘<samp><span class="samp">UTF-8 Unicode</span></samp>’ als Schriftsatz
+ausgewählt werden.
<p>Bitte beachten Sie, dass alle Datenbanken den selben Zeichensatz
verwenden müssen, da diese Einstellungen momentan global in Lx-Office
erzeugt. Lx-Office kann dabei sowohl neue OpenDocument-Dokumente als
auch aus diesen direkt PDF-Dateien erzeugen. Um die Unterstützung von
OpenDocument-Vorlagen zu aktivieren muss in der Datei
-<code>config/lx-erp.conf</code> die Variable <code>$opendocument_templates</code>
-auf ‘<samp><span class="samp">1</span></samp>’ stehen. Dieses ist die Standardeinstellung.
+<code>config/lx_office.conf</code> die Variable <code>opendocument</code> im
+Abschnitt <code>print_templates</code> auf ‘<samp><span class="samp">1</span></samp>’ stehen. Dieses ist die
+Standardeinstellung.
- <p>Weiterhin muss in der Datei <code>config/lx-erp.conf</code> die Variable
-<code>$dbcharset</code> auf die Zeichenkodierung gesetzt werden, die auch
-bei der Speicherung der Daten in der Datenbank verwendet wird. Diese
-ist in den meisten Fällen "UTF-8".
+ <p>Weiterhin muss in der Datei <code>config/lx_office.conf</code> die Variable
+<code>dbcharset</code> im Abschnitt <code>system</code> auf die Zeichenkodierung
+gesetzt werden, die auch bei der Speicherung der Daten in der
+Datenbank verwendet wird. Diese ist in den meisten Fällen "UTF-8".
<p>Während die Erzeugung von reinen OpenDocument-Dateien keinerlei
weitere Software benötigt, wird zur Umwandlung dieser Dateien in PDF
(xvfb) installiert werden. Bei Debian ist er im Paket “xvfb”
enthalten. Andere Distributionen enthalten ihn in anderen Paketen.
- <p>Nach der Installation müssen in der Datei <code>config/lx-erp.conf</code>
-zwei weitere Variablen angepasst werden:
-<code>$openofficeorg_writer_bin</code> muss den vollständigen Pfad zur
-OpenOffice.org Writer-Anwendung enthalten. <code>$xvfb_bin</code> muss den
-Pfad zum “X virtual frame buffer” enthalten.
+ <p>Nach der Installation müssen in der Datei <code>config/lx_config.conf</code>
+zwei weitere Variablen angepasst werden: <code>openofficeorg_writer</code>
+muss den vollständigen Pfad zur OpenOffice.org Writer-Anwendung
+enthalten. <code>xvfb</code> muss den Pfad zum “X virtual frame buffer”
+enthalten. Beide stehen im Abschnitt <code>applications</code>.
<p>Zusätzlich gibt es zwei verschiedene Arten, wie Lx-Office mit
OpenOffice kommuniziert. Die erste Variante, die benutzt wird, wenn
Distribution sollte für die automatische Installation der anderen
zwei Pakete sorgen)
+ Neue Gruppenrechte
+ ------------------
+
+Es wurde ein neues Recht "Druck" eingeführt. Dieses bestimmt, ob die
+Benutzerin das Menü "Druck" zu Gesicht bekommt oder nicht, unabhängig
+davon, wie die Rechte für die einzelnen Unterpunkte gesetzt sind.
+
+Für bereits bestehende Gruppen muss es sofern gewünscht vom
+Administrator manuell gewährt werden.
+
Upgrade auf v2.6.1
==================
# Veränderungen von Lx-Office ERP #
###################################
-
-
-
+2011-02-?? - Release 2.6.2
Größere neue Features:
Das Program läuft jetzt optional unter FastCGI, und damit etwa um
Faktor 10 schneller. Siehe Dokumentation in doc INSTALL.fcgi.
+ - Neues Gruppenrecht "Druck"
+
+ Es wurde ein neues Recht "Druck" eingeführt. Dieses bestimmt, ob
+ die Benutzerin das Menü "Druck" zu Gesicht bekommt oder nicht,
+ unabhängig davon, wie die Rechte für die einzelnen Unterpunkte
+ gesetzt sind.
+
+ Für bereits bestehende Gruppen muss es sofern gewünscht vom
+ Administrator manuell gewährt werden.
+
Kleinere neue Features und Detailverbesserungen:
- Druckvorlage optional auf Excel erweitert, um Variablen die sich nicht in foreach-Schleifen
Liste gefixter Bugs aus dem Bugtracker:
-
- - Bug 1388 - Berichte sind defekt, wenn abweichendes Datumsformat (ISO) eingestellt ist
- - Bug 1395 - Einlagern ueber Lieferschein: Einheiten entsprechen nicht den Standardeinheiten der Artikel
- - Bug 1398 - Im Lagerjournal werden Projektnummern nicht erfasst
- - Bug 1409 - Bei "Erzeugnis fertigen" wird nur der Bestand der letzten Komponente geprüft
- - Bug 1412 - Wenn die Ware ausgewählt werden muss wird der Rabatt verworfen
- - Bug 1421 - Stornorechnungen loeschen bereitet Probleme
- - Bug 1484 - Das Ankreuzfeld 'alle' hat keine Funktion wenn man einen Auswahlliste (multibox) an Lieferanten hat
- Es wird trotzdem nach der Auswahlliste gefiltert und die Option 'alle' wird
- ignoriert auch wenn man auf Erneuern klickt.
- Das Eingabefeld 'Betrag' im oberen Teil der Maske hat in Lx-Office
- keinen Sinn mehr, da nur noch über die Auswahl der offenen
- Kreditorenposten ein Zahlungsausgang veranlasst wird.
- Neu-Aufbau Lx-Office Bildschirm
- Nach einer erfolgreichen Buchung erscheint die Meldung: 'Zahlung gebucht.' und
- die Startseite wird angezeigt. Wünschenwert wäre es, wenn man in
- Zahlungsverkehr bleiben würde, optimalerweise mit vorbelegten Feldern.
- - Bug 1502 - 2. Zahlung buchen, auch wenn die erste Zahlung in einen abgeschlossenen Zeitraum liegt
-
+ - Bugfix 1131: Einkaufslieferscheine: Mengen muessen beim Auslagern manuell in die maske eingetragen werden
+ - Bugfix 1154: Debitoren und Kreditoren werden nicht korrekt gebucht
+ - Bugfix 1185: Preis überschreiben bei Preisgruppe
+ - Bugfix 1220: Zahlungsverkehr - Zahlungseingang: Aufteilung des Rechnungsbetrages
+ - Bugfix 1277: Fehler in der BWA Zuordnung in den SKR03 und dem daraus generierten skr04
+ - Bugfix 1298: SKR04 überarbeitet
+ - Bugfix 1302: Inkonsistenz in Buchungsdaten: In Verkaufsrechnungen wird die Zahlung nicht angezeit, Gegenbuchung fehlt
+ - Bugfix 1367: Feature-Vorschlag: SEPA auch für Lastschriften von Debitoren unterstützen
+ - Bugfix 1370: Umlautfehler beim Erfassen einer Einkaufsrechnung
+ - Bugfix 1375: Übersetzungsdateien im Verzeichnis ""locale/de/"" immer noch in ISO-8859-15 kodiert statt UTF-8
+ - Bugfix 1376: Benutzerdefinierte Variablen sollten auch im mahnsystem zur Verfuegung stehen
+ - Bugfix 1378: leere Buchungen (text, beschreibung und referenz) bei Splittbuchungen
+ - Bugfix 1381: missing files in package
+ - Bugfix 1383: Dienstleistungen in Stammdaten und Lager
+ - Bugfix 1384: Zinsen bei Mahnung falsch berechnet
+ - Bugfix 1387: Englische Eingabemaske bei Aufruf von Deb./Kred.-buchung aus Buchungsjournal
+ - Bugfix 1388: Berichte sind defekt, wenn abweichendes Datumsformat (ISO) eingestellt ist
+ - Bugfix 1389: Bilanz repariert
+ - Bugfix 1393: CSV-Export sollte ohne Tausender-Trenner erfolgen
+ - Bugfix 1395: Einlagern ueber Lieferschein: Einheiten entsprechen nicht den Standardeinheiten der Artikl
+ - Bugfix 1398: Im Lagerjournal werden Projektnummern nicht erfasst
+ - Bugfix 1399: Lieferdaten zu einzelnen Positionen ""verrutschen"" beim Loeschen hoeherer Positionszeilen
+ - Bugfix 1400: Lieferscheine: Usability bei Auslagerung - Positionsindikator
+ - Bugfix 1406: Kunde erfassen
+ - Bugfix 1410: Beschriftung bei Eingabe der Einkaufsrechnung falsch
+ - Bugfix 1412: Wenn die Ware ausgewählt werden muss wird der Rabatt verworfen
+ - Bugfix 1414: Einfügen der \usepackage{textcomp}-Zeile in TeX-Templates ungünstig
+ - Bugfix 1422: Loeschen von Stornos bereitet eine Reihe von Problemen: (3)Gutschriften aus Rechnungen, die einstmals storniert wurden
+ - Bugfix 1429: Debitorenbuchungen 1: Wechsel des Debitoren loescht Bemerkungsfeld nicht
+ - Bugfix 1432: Mahnläufe: Nach manuellem Zurücksetzen der Mahnstufen gibt es ein Chaos bei der weiteren Erzeugung
+ - Bugfix 1439: Sortierkriterium ""Strasse"" in Listenansicht der Lieferanten geht nicht
+ - Bugfix 1440: Eingrenzen der angelegten Waren nach Lieferant liefert immer kein Ergebnis
+ - Bugfix 1445: Kleines Chaos bei Vorlagenbezeichnungen zu Lieferscheinen: picklist, packing_list, sales_delivery_order
+ - Bugfix 1449: Konto 3170 langfristige Verbindlichkeiten SKR04 Aktiva
+ - Bugfix 1451: Menüsetup Alt (seitlich) wird nicht lokalisiert
+ - Bugfix 1452: Fehler bei Lokalisierung der Überschriften und weiterer Beschriftungen
+ - Bugfix 1454: mehrere Rechnungen mit gleicher Rechnungsnummer möglich
+ - Bugfix 1455: Feld wird nach Einlagerung nicht zurückgesetzt.
+ - Bugfix 1456: Lieferanschrift wird im Workflow nicht zuverlässig vom Auftrag in den Lieferschein übernommen
+ - Bugfix 1459: Gruppen bearbteien unter FCGI
+ - Bugfix 1467: System entsperren nicht möglich
+ - Bugfix 1468: Title Javascript setzt den Titel auch, wenn die Informationen nicht verfügbar sind.
+ - Bugfix 1469: Umlaute gehen auf der Startseite kaputt bei update von 2.6.1 auf unstable (August 2010)
+ - Bugfix 1470: Falsche Übersetzung für ""Expenses EU without UStId""
+ - Bugfix 1471: System -> Historien Suchmaschinen gibt folgenden Fehler:
+ - Bugfix 1472: Bei fehlender config/authentication.pl -> Webserver Error 500
+ - Bugfix 1475: Workflow Angebot -> Rechnung wird Angebotsnummer nicht übernommen
+ - Bugfix 1477: Sicherheitsloch bei 2.6er Versionen
+ - Bugfix 1479: Debian Paket bauen schlägt fehl
+ - Bugfix 1480: Filter für Abteilungen ohne Ergebnis
+ - Bugfix 1483: Formelberechnung und Zahlenformat
+ - Bugfix 1484: Zahlungsausgang diverses
+ - Bugfix 1485: Rechnung->neuer Artikel->Speichern->Fehler ""Can't use string ... as a HASH ref ... bin/mozilla/io.pl line 2075""
+ - Bugfix 1487: Wechselkurs wird falsch ausgelesen
+ - Bugfix 1488: Ust-Voranmeldung - Elster-Export nach Taxbird
+ - Bugfix 1491: Nitpicking: Beim ersten Login in eine DB werden im Text HTML Formatierungen ausgegeben, nicht interpretiert
+ - Bugfix 1492: ""Korrekturen im Hauptbuch"" wirft Fehler
+ - Bugfix 1494: undokumentiert -- dependency parent.pm / Dokumentvariable ustid
+ - Bugfix 1495: Ansicht von Artikelbilderen (Suchergebnis/Artikelmaske)
+ - Bugfix 1496: Grad-Symbol (°) verursacht Latex-Fehler
+ - Bugfix 1498: (versehentlicher?) commit der menu.ini mit crm Spalte
+ - Bugfix 1499: Einstellungen ""Nicht rabattierfähig"" ist nicht für Dienstleistungen verfügbar (z.B. Versandkosten)
+ - Bugfix 1502: Bücherkontrolle prüft auch ALTE Zahlungseingänge
+ - Bugfix 1504: UStVa Modul SQL Fehler: ""text >= integer"" nicht erlaubt
+ - Bugfix 1506: Email-Formular: Mailadresse der Firma anstelle des Ansprechpartners
+ - Bugfix 1517: Kreditorrechnung: Wechselkurs bei gleichem Re.-Datum nicht vorhanden
+ - Bugfix 1520: Division-by-Zero-Fehler bei einigen Rechnungsbuchungen
+ - Bugfix 1521: Fix von Bug 1521 bringt neuen Fehler bei Login und Verkaufsmasken
+ - Bugfix 1523: Rabatt geht verloren, wenn Rechnung aus Lieferscheinliste generiert wird
+ - Bugfix 1524: Kundenrabatt geht verloren (wie 1284, aber auch Einkauf)
+ - Bugfix 1528: Vorlagen
+ - Bugfix 1529: falsche Tabellendefinition in Default-request_quotation.tex
+ - Bugfix 1530: Debitorenbuchung: Abfragefehler bei Kontonummer mit ""."" (Punkt) oder Text
+ - Bugfix 1533: Zahlungen in Rechnungsmaske einbuchen scheitert an locale
+ - Bugfix 1535: CSV-Exporte sind nicht mehr UTF8
+ - Bugfix 1536: 'Alte' dbupgrade Skripte die SL::DBUtils verwenden sind defekt
+ - Bugfix 1537: Debitoren: Feld curr in Tabelle ar wird nicht gefüllt
+ - Bugfix 1541: Preisgruppeneintrag in Einkaufsrechungen ??
+ - Bugfix 1547: Kreditorenbuchung in Fremdwährung: Steuerfehler
+ - Bugfix 1550: Sortieren einer Kundenauflistung ""vergisst"" gewählte Filterkriterien
+ - Bugfix 1552: Diverse Probleme mit der Sortierfunktion bei Stammdaten
+ - Bugfix 1553: Diese Kundennummer wird bereits verwendet. - Obwohl keine eingetragen ist
+ - Bugfix 1554: Kein Wechselkurs bei Debitotenbuchung in Fremdwährung unter 1 bei gleichem Datum
+ - Bugfix 1555: Sonderzeichen nicht korrekt escaped (Stückliste beim Erstellen eines Erzeugnisses)
+ - Bugfix 1561: benutzerdefinierte Variable wird unabsichtlich deaktiviert
+ - Bugfix 1562: Fehlender Hinweis im changelog zu gaenderten Rechten Beim Druck
2010-03-24 - Release 2.6.1
'4. Quarter' => '4. Quartal',
'<b>What</b> do you want to look for?' => '<b>Wonach</b> wollen Sie suchen?',
'A Buchungsgruppe consists of a descriptive name and the account numbers for the income and expense accounts for those four tax zones as well as the inventory account number.' => 'Eine Buchungsgruppe besteht aus einem deskriptiven Namen, den Erlös- und Aufwandskonten für diese vier Steuerzonen sowie aus einem Inventarkonto.',
+ 'A digit is required.' => 'Eine Ziffer ist vorgeschrieben.',
'A group named "Full Access" has been created.' => 'Eine Gruppe namens "Vollzugriff" wurde angelegt.',
'A group with that name does already exist.' => 'Eine Gruppe mit diesem Namen gibt es bereits.',
'A lot of the usability of Lx-Office has been enhanced with javascript. Although it is currently possible to use every aspect of Lx-Office without javascript, we strongly recommend it. In a future version this may change and javascript may be necessary to access advanced features.' => 'Die Bedienung von Lx-Office wurde an vielen Stellen mit Javascript verbessert. Obwohl es derzeit möglich ist, jeden Aspekt von Lx-Office auch ohne Javascript zu benutzen, empfehlen wir es. In einer zukünftigen Version wird Javascript eventuell notwendig sein um weitergehende Features zu benutzen.',
+ 'A lower-case character is required.' => 'Ein Kleinbuchstabe ist vorgeschrieben.',
+ 'A special character is required (valid characters: #1).' => 'Ein Sonderzeichen ist vorgeschrieben (gültige Zeichen: #1).',
'A temporary directory could not be created:' => 'Ein temporäres Verzeichnis konnte nicht erstellt werden:',
'A temporary file could not be created. Please verify that the directory "#1" is writeable by the webserver.' => 'Eine temporäre Datei konnte nicht angelegt werden. Bitte stellen Sie sicher, dass das Verzeichnis "#1" vom Webserver beschrieben werden darf.',
'A temporary file could not be created:' => 'Eine temporäre Datei konnte nicht erstellt werden:',
'Amount' => 'Betrag',
'Amount Due' => 'Betrag fällig',
'Amount has to be greater then zero! Wrong row number: ' => 'Leere Eingabe oder Werte kleiner, gleich null eingegeben. Fehler in Reihe Nummer: ',
+ 'An invalid character was used (invalid characters: #1).' => 'Ein ungültiges Zeichen wurde benutzt (ungültige Zeichen: #1).',
+ 'An invalid character was used (valid characters: #1).' => 'Ein ungültiges Zeichen wurde benutzt (gültige Zeichen: #1).',
+ 'An upper-case character is required.' => 'Ein Großbuchstabe ist vorgeschrieben.',
'Annotations' => 'Anmerkungen',
'Another user with the login #1 does already exist.' => 'Es existiert bereits ein anderer Benutzer mit diesem Login.',
'Ap aging on %s' => 'Offene Verbindlichkeiten zum %s',
'Database Host' => 'Datenbankcomputer',
'Database User' => 'Datenbankbenutzer',
'Database User missing!' => 'Datenbankbenutzer fehlt!',
- 'Database backups and restorations are disabled in lx-erp.conf.' => 'Datenbanksicherungen und -wiederherstellungen sind in der lx-erp.conf deaktiviert.',
+ 'Database backups and restorations are disabled in the configuration.' => 'Datenbanksicherungen und -wiederherstellungen sind in der Konfiguration deaktiviert.',
'Database name' => 'Datenbankname',
'Database template' => 'Datenbankvorlage',
'Database update error:' => 'Fehler beim Datenbankupgrade:',
'Help Template Variables' => 'Hilfe zu Dokumenten-Variablen',
'Here\'s an example command line:' => 'Hier ist eine Kommandozeile, die als Beispiel dient:',
'Hide by default' => 'Standardmäßig verstecken',
- 'History' => 'Historie',
'History Search' => 'Historien Suche',
'History Search Engine' => 'Historien Suchmaschine',
'Homepage' => 'Homepage',
'The group has been saved.' => 'Die Gruppe wurde gespeichert.',
'The group memberships have been saved.' => 'Die Gruppenmitgliedschaften wurden gespeichert.',
'The group name is missing.' => 'Der Gruppenname fehlt.',
- 'The licensing module has been deactivated in lx-erp.conf.' => 'Das Lizenzverwaltungsmodul wurde in lx-erp.conf deaktiviert.',
+ 'The licensing module has been deactivated in the configuration.' => 'Das Lizenzverwaltungsmodul wurde in der Konfiguration deaktiviert.',
'The list has been printed.' => 'Die Liste wurde ausgedruckt.',
'The login is missing.' => 'Das Login fehlt.',
'The name in row %d has already been used before.' => 'Der Name in Zeile %d wurde vorher bereits benutzt.',
'The parts have been removed.' => 'Die Waren wurden aus dem Lager entnommen.',
'The parts have been stocked.' => 'Die Artikel wurden eingelagert.',
'The parts have been transferred.' => 'Die Waren wurden umgelagert.',
+ 'The password is too long (maximum length: #1).' => 'Das Passwort ist zu lang (maximale Länge: #1).',
+ 'The password is too short (minimum length: #1).' => 'Das Password ist zu kurz (minimale Länge: #1).',
+ 'The password is weak (e.g. it can be found in a dictionary).' => 'Das Passwort ist schwach (z.B. wenn es in einem Wörterbuch steht).',
'The payments have been posted.' => 'Die Zahlungen wurden gebucht.',
'The pg_dump process could not be started.' => 'Der pg_dump-Prozess konnte nicht gestartet werden.',
'The pg_restore process could not be started.' => 'Der pg_restore-Prozess konnte nicht gestartet werden.',
'The selected warehouse does not exist.' => 'Das ausgewählte Lager existiert nicht.',
'The selected warehouse is empty.' => 'Das ausgewählte Lager ist leer.',
'The session is invalid or has expired.' => 'Sie sind von Lx-Office abgemeldet.',
+ 'The settings were saved, but the password was not changed.' => 'Die Einstellungen wurden gespeichert, aber das Passwort wurde nicht geändert.',
'The source warehouse does not contain any bins.' => 'Das Quelllager enthält keine Lagerplätze.',
'The start date is missing.' => 'Das Startdatum fehlt.',
'The subject is missing.' => 'Der Betreff fehlt.',
'4. Quarter' => '4. Quartal',
'<b>What</b> do you want to look for?' => '<b>Wonach</b> wollen Sie suchen?',
'A Buchungsgruppe consists of a descriptive name and the account numbers for the income and expense accounts for those four tax zones as well as the inventory account number.' => 'Eine Buchungsgruppe besteht aus einem deskriptiven Namen, den Erlös- und Aufwandskonten für diese vier Steuerzonen sowie aus einem Inventarkonto.',
+ 'A digit is required.' => '',
'A group named "Full Access" has been created.' => 'Eine Gruppe namens "Vollzugriff" wurde angelegt.',
'A group with that name does already exist.' => 'Eine Gruppe mit diesem Namen gibt es bereits.',
'A lot of the usability of Lx-Office has been enhanced with javascript. Although it is currently possible to use every aspect of Lx-Office without javascript, we strongly recommend it. In a future version this may change and javascript may be necessary to access advanced features.' => 'Die Bedienung von Lx-Office wurde an vielen Stellen mit Javascript verbessert. Obwohl es derzeit möglich ist, jeden Aspekt von Lx-Office auch ohne Javascript zu benutzen, empfehlen wir es. In einer zukünftigen Version wird Javascript eventuell notwendig sein um weitergehende Features zu benutzen.',
+ 'A lower-case character is required.' => '',
+ 'A special character is required (valid characters: #1).' => '',
'A temporary directory could not be created:' => 'Ein temporäres Verzeichnis konnte nicht erstellt werden:',
'A temporary file could not be created. Please verify that the directory "#1" is writeable by the webserver.' => 'Eine temporäre Datei konnte nicht angelegt werden. Bitte stellen Sie sicher, dass das Verzeichnis "#1" vom Webserver beschrieben werden darf.',
'A temporary file could not be created:' => 'Eine temporäre Datei konnte nicht erstellt werden:',
'Amount' => 'Betrag',
'Amount Due' => 'Betrag fällig',
'Amount has to be greater then zero! Wrong row number: ' => '"Betrag" muss größer Null sein. Fehlerhafte Zeile: ',
+ 'An invalid character was used (invalid characters: #1).' => '',
+ 'An invalid character was used (valid characters: #1).' => '',
+ 'An upper-case character is required.' => '',
'Annotations' => 'Hilfe',
'Another user with the login #1 does already exist.' => 'Es existiert bereits ein anderer Benutzer mit diesem Login.',
'Ap aging on %s' => 'Offene Verbindlichkeiten zum %s',
'Company Name' => 'Firmenname',
'Compare to' => 'Gegenüberstellen zu',
'Configuration of individual TODO items' => 'Konfiguration für die einzelnen Aufgabenlistenpunkte',
+ 'Configure' => '',
'Confirm' => 'Bestätigen',
'Confirm!' => 'Bestätigen Sie!',
'Confirmation' => 'Auftragsbestätigung',
'Database Host' => 'Datenbankcomputer',
'Database User' => 'Datenbankbenutzer',
'Database User missing!' => 'Datenbankbenutzer fehlt!',
- 'Database backups and restorations are disabled in lx-erp.conf.' => 'Datenbanksicherungen und -wiederherstellungen sind in der lx-erp.conf deaktiviert.',
+ 'Database backups and restorations are disabled in the configuration.' => 'Datenbanksicherungen und -wiederherstellungen sind in der Konfiguration deaktiviert.',
'Database name' => 'Datenbankname',
'Database template' => 'Datenbankvorlage',
'Database update error:' => 'Fehler beim Datenbankupgrade:',
'Edit rights' => 'Rechte bearbeiten',
'Edit templates' => 'Vorlagen bearbeiten',
'Edit the Delivery Order' => 'Lieferschein bearbeiten',
+ 'Edit the configuration for periodic invoices' => '',
'Edit the membership of all users in all groups:' => 'Bearbeiten der Mitgliedschaft aller Benutzer in allen Gruppen:',
'Edit the purchase_order' => 'Bearbeiten des Lieferantenauftrags',
'Edit the request_quotation' => 'Bearbeiten der Preisanfrage',
'Element disabled' => 'Element deaktiviert',
'Employee' => 'Bearbeiter',
'Empty transaction!' => 'Buchung ist leer!',
+ 'End date' => '',
'Enter a description for this new draft.' => 'Geben Sie eine Beschreibung für diesen Entwurf ein.',
'Enter longdescription' => 'Langtext eingeben',
'Enter the requested execution date or leave empty for the quickest possible execution:' => 'Geben Sie das jeweils gewünschte Ausführungsdatum an, oder lassen Sie das Feld leer für die schnellstmögliche Ausführung:',
'Export date' => 'Exportdatum',
'Export date from' => 'Exportdatum von',
'Export date to' => 'Exportdatum bis',
+ 'Extend automatically by n months' => '',
'Extended' => 'Gesamt',
'Extension Of Time' => 'Dauerfristverlängerung',
'Factor' => 'Faktor',
'Help Template Variables' => 'Hilfe zu Dokumenten-Variablen',
'Here\'s an example command line:' => 'Hier ist eine Kommandozeile, die als Beispiel dient:',
'Hide by default' => 'Standardmäßig verstecken',
- 'History' => 'Historie',
'History Search' => 'Historien Suche',
'History Search Engine' => 'Historien Suchmaschine',
'Homepage' => 'Homepage',
'Payment posted!' => 'Zahlung gebucht!',
'Payment terms deleted!' => 'Zahlungskonditionen gelöscht!',
'Payments' => 'Zahlungsausgänge',
+ 'Per. Inv.' => '',
'Period' => 'Zeitraum',
'Period:' => 'Zeitraum:',
+ 'Periodic Invoices' => '',
+ 'Periodic invoices active' => '',
+ 'Periodic invoices inactive' => '',
+ 'Periodicity' => '',
'Personal settings' => 'Meine Daten',
'Pg Database Administration' => 'Datenbankadministration',
'Phone' => 'Telefon',
'Pricegroups' => 'Preisgruppen',
'Print' => 'Drucken',
'Print and Post' => 'Drucken und Buchen',
+ 'Print automatically' => '',
'Print dunnings' => 'Mahnungen drucken',
'Print list' => 'Liste ausdrucken',
'Print options' => 'Drucken',
'Spoolfile' => 'Druckdatei',
'Start Dunning Process' => 'Neue Mahnung',
'Start analysis' => 'Analyse beginnen',
+ 'Start date' => '',
'Start the correction assistant' => 'Korrekturassistenten starten',
'Startdate_coa' => 'Gültig ab',
'Starting Balance' => 'Eröffnungsbilanzwerte',
'Statement Balance' => 'Sammelrechnungsbilanz',
'Statement sent to' => 'Sammelrechnung verschickt an',
'Statements sent to printer!' => 'Sammelrechnungen an Drucker geschickt!',
+ 'Status' => '',
'Step 1 of 3: Parts' => 'Schritt 1 von 3: Waren',
'Step 2' => 'Schritt 2',
'Step 2 of 3: Services' => 'Schritt 2 von 3: Dienstleistungen',
'The dunning process started' => 'Der Mahnprozess ist gestartet.',
'The dunnings have been printed.' => 'Die Mahnung(en) wurden gedruckt.',
'The email address is missing.' => 'Die Emailadresse fehlt.',
+ 'The end date is the last day for which invoices will possibly be created.' => '',
'The factor is missing in row %d.' => 'Der Faktor fehlt in Zeile %d.',
'The factor is missing.' => 'Der Faktor fehlt.',
'The first reason is that Lx-Office contained a bug which resulted in the wrong taxkeys being recorded for transactions in which two entries are posted for the same chart with different taxkeys.' => 'Zum Einen gab es einen Bug in Lx-Office, der dazu führte, dass bei Buchungen mit verschiedenen Steuerschlüssel auf ein Konto teilweise falsche Steuerschlüssel gespeichert wurden.',
'The group has been saved.' => 'Die Gruppe wurde gespeichert.',
'The group memberships have been saved.' => 'Die Gruppenmitgliedschaften wurden gespeichert.',
'The group name is missing.' => 'Der Gruppenname fehlt.',
- 'The licensing module has been deactivated in lx-erp.conf.' => 'Das Lizenzverwaltungsmodul wurde in lx-erp.conf deaktiviert.',
+ 'The licensing module has been deactivated in the configuration.' => 'Das Lizenzverwaltungsmodul wurde in der Konfiguration deaktiviert.',
'The list has been printed.' => 'Die Liste wurde ausgedruckt.',
'The login is missing.' => 'Das Login fehlt.',
'The name in row %d has already been used before.' => 'Der Name in Zeile %d wurde vorher bereits benutzt.',
'The parts have been removed.' => 'Die Waren wurden aus dem Lager entnommen.',
'The parts have been stocked.' => 'Die Artikel wurden eingelagert.',
'The parts have been transferred.' => 'Die Waren wurden umgelagert.',
+ 'The password is too long (maximum length: #1).' => '',
+ 'The password is too short (minimum length: #1).' => '',
+ 'The password is weak (e.g. it can be found in a dictionary).' => '',
'The payments have been posted.' => 'Die Zahlungen wurden gebucht.',
'The pg_dump process could not be started.' => 'Der pg_dump-Prozess konnte nicht gestartet werden.',
'The pg_restore process could not be started.' => 'Der pg_restore-Prozess konnte nicht gestartet werden.',
'The selected warehouse does not exist.' => 'Das ausgewählte Lager existiert nicht.',
'The selected warehouse is empty.' => 'Das ausgewählte Lager ist leer.',
'The session is invalid or has expired.' => 'Sie sind von Lx-Office abgemeldet.',
+ 'The settings were saved, but the password was not changed.' => '',
'The source warehouse does not contain any bins.' => 'Das Quelllager enthält keine Lagerplätze.',
+ 'The start date is missing.' => '',
'The subject is missing.' => 'Der Betreff fehlt.',
'The tables for user management and authentication do not exist. They will be created in the next step in the following database:' => 'Die Tabellen zum Speichern der Benutzerdaten und zur Benutzerauthentifizierung wurden nicht gefunden. Sie werden in der folgenden Datenbank angelegt:',
'The tabulator character' => 'Das Tabulator-Symbol',
'Warehouse management' => 'Lagerverwaltung/Bestandsveränderung',
'Warehouse saved.' => 'Lager gespeichert.',
'Warehouses' => 'Lager',
+ 'Warning' => '',
'Warnings during template upgrade' => 'Warnungen bei Aktualisierung der Dokumentenvorlagen',
'WebDAV link' => 'WebDAV-Link',
'Weight' => 'Gewicht',
'[email]' => '[email]',
'account_description' => 'Beschreibung',
'accrual' => 'Bilanzierung (Soll-Versteuerung)',
+ 'active' => '',
'all entries' => 'alle Einträge',
'ap_aging_list' => 'liste_offene_verbindlichkeiten',
'ar_aging_list' => 'liste_offene_forderungen',
'general_ledger_list' => 'buchungsjournal',
'history' => 'Historie',
'history search engine' => 'Historien Suchmaschine',
+ 'inactive' => '',
'invoice' => 'Rechnung',
'invoice_list' => 'debitorenbuchungsliste',
'lead deleted!' => 'Kundenquelle gelöscht',
'mark as paid' => 'als bezahlt markieren',
'missing' => 'Fehlbestand',
'month' => 'Monatliche Abgabe',
+ 'monthly' => '',
'new Window' => 'neues Fenster',
'no' => 'nein',
'no bestbefore' => 'keine Mindesthaltbarkeit',
'no chargenumber' => 'keine Chargennummer',
'none (pricegroup)' => 'keine',
+ 'not configured' => '',
'not executed' => 'nicht ausgeführt',
'not transferred in yet' => 'noch nicht eingelagert',
'not transferred out yet' => 'noch nicht ausgelagert',
'purchase_order' => 'Auftrag',
'purchase_order_list' => 'lieferantenauftragsliste',
'quarter' => 'Vierteljährliche (quartalsweise) Abgabe',
+ 'quarterly' => '',
'quotation_list' => 'angebotsliste',
'release_material' => 'Materialausgabebe',
'report_generator_dispatch_to is not defined.' => 'report_generator_dispatch_to ist nicht definiert.',
'tax_taxdescription' => 'Steuername',
'tax_taxkey' => 'Steuerschlüssel',
'taxnumber' => 'Automatikkonto',
+ 'terminated' => '',
'to (date)' => 'bis',
'to (time)' => 'bis',
'transfer' => 'Umlagerung',
'warehouse_journal_list' => 'lagerbuchungsliste',
'warehouse_report_list' => 'lagerbestandsliste',
'wrongformat' => 'Falsches Format',
+ 'yearly' => '',
'yes' => 'ja',
};
require Exporter;
require DynaLoader;
+
+
use vars qw($VERSION @ISA @EXPORT_OK %EXPORT_TAGS);
@ISA = qw(Exporter DynaLoader);
all => [ qw(any all none notall true false firstidx first_index lastidx
last_index insert_after insert_after_string apply after after_incl before
before_incl indexes firstval first_value lastval last_value each_array
- each_arrayref pairwise natatime mesh zip uniq minmax part) ],
+ each_arrayref pairwise natatime mesh zip uniq minmax part bsearch) ],
);
@EXPORT_OK = ( @{ $EXPORT_TAGS{'all'} } );
-$VERSION = '0.22';
+$VERSION = '0.25_02';
eval {
local $ENV{PERL_DL_NONLAZY} = 0 if $ENV{PERL_DL_NONLAZY};
eval <<'EOP' if not defined &any;
+require POSIX;
+
sub any (&@) {
my $f = shift;
return if ! @_;
sub none (&@) {
my $f = shift;
- return if ! @_;
+ return 1 if ! @_;
for (@_) {
return 0 if $f->();
}
sub uniq (@) {
my %h;
- map { $h{$_}++ == 0 ? $_ : () } @_;
+ my $ref = \1;
+ map { $h{defined $_ ? $_ : $ref}++ == 0 ? $_ : () } @_;
}
sub minmax (@) {
return @parts;
}
+sub bsearch(&@) {
+ my $code = shift;
+
+ my $rc;
+ my $i = 0;
+ my $j = @_;
+ do {
+ my $k = int(($i + $j) / 2);
+
+ return if $k >= @_;
+
+ local *_ = \$_[$k];
+ $rc = $code->();
+
+ $rc == 0 and
+ return wantarray ? $_ : 1;
+
+ if ($rc < 0) {
+ $i = $k + 1;
+ } else {
+ $j = $k - 1;
+ }
+ } until $i > $j;
+
+ return;
+}
+
sub _XScompiled {
return 0;
}
EOP
+die $@ if $@;
*first_index = \&firstidx;
*last_index = \&lastidx;
my $i = 0;
my @part = part { $idx[$++ % 3] } 1 .. 8; # [1, 4, 7], [2, 3, 5, 6, 8]
+=item bsearch BLOCK LIST
+
+Performs a binary search on LIST which must be a sorted list of values. BLOCK
+must return a negative value if the current element (stored in C<$_>) is smaller,
+a positive value if it is bigger and zero if it matches.
+
+Returns a boolean value in scalar context. In list context, it returns the element
+if it was found, otherwise the empty list.
+
=back
=head1 EXPORTS
=head1 VERSION
-This is version 0.22.
+This is version 0.25_01.
=head1 BUGS
=head1 AUTHOR
-Tassilo von Parseval, E<lt>tassilo.von.parseval@rwth-aachen.deE<gt>
+Tassilo von Parseval, E<lt>vparseval@gmail.comE<gt>
=head1 COPYRIGHT AND LICENSE
-Copyright (C) 2004-2006 by Tassilo von Parseval
+Copyright (C) 2004-2009 by Tassilo von Parseval
This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself, either Perl version 5.8.4 or,
push @INC, "modules/fallback"; # Only use our own versions of modules if there's no system version.
}
-use Config::Std;
use Data::Dumper;
use Devel::REPL 1.002001;
use Term::ReadLine::Perl::Bind; # use sane key binding for rxvt users
-read_config 'config/lx_office.conf' => my %config;
+use SL::LxOfficeConf;
+SL::LxOfficeConf->read;
-my $login = shift || $config{Console}{login} || 'demo';
-my $history_file = $config{Console}{history_file} || '/tmp/lxoffice_console_history.log'; # fallback if users is not writable
-my $autorun = $config{Console}{autorun};
+my $login = shift || $::lx_office_conf{console}{login} || 'demo';
+my $history_file = $::lx_office_conf{console}{history_file} || '/tmp/lxoffice_console_history.log'; # fallback if users is not writable
+my $autorun = $::lx_office_conf{console}{autorun};
# will be configed eventually
my @plugins = qw(History LexEnv Colors MultiLine::PPI FancyPrompt PermanentHistory AutoloadModules);
use CGI qw( -no_xhtml);
use DateTime;
use SL::Auth;
-use SL::Dispatcher;
use SL::Form;
use SL::Helper::DateTime;
use SL::Locale;
package main;
- { no warnings 'once';
- $::userspath = "users";
- $::templates = "templates";
- $::sendmail = "| /usr/sbin/sendmail -t";
- }
-
- eval { require "config/lx-erp.conf"; };
- eval { require "config/lx-erp-local.conf"; } if -f "config/lx-erp-local.conf";
-
$::lxdebug = LXDebug->new;
- $::locale = Locale->new($::language);
+ $::locale = Locale->new($::lx_office_conf{system}->{language});
$::cgi = CGI->new qw();
$::form = Form->new;
$::auth = SL::Auth->new;
- read_config 'config/lx_office.conf' => %::lx_office_conf;
- SL::Dispatcher::_decode_recursively(\%::lx_office_conf);
-
die 'cannot reach auth db' unless $::auth->session_tables_present;
$::auth->restore_session;
use utf8;
use English '-no_match_vars';
+use Config::Std;
use DBI;
use Data::Dumper;
use Getopt::Long;
use Text::Iconv;
use SL::LXDebug;
+use SL::LxOfficeConf;
+SL::LxOfficeConf->read;
our $lxdebug = LXDebug->new();
use SL::Auth;
#######
#######
-eval { require "config/lx-erp.conf"; };
-eval { require "config/lx-erp-local.conf"; } if (-f "config/lx-erp-local.conf");
-
$form = Form->new();
$locale = Locale->new("de");
my $basedir = "../..";
my $locales_dir = ".";
my $bindir = "$basedir/bin/mozilla";
-my @progdirs = ( "$basedir/SL/Controller", "$basedir/SL/Template/Plugin" );
+my @progdirs = ( "$basedir/SL/Controller", "$basedir/SL/Template/Plugin", "$basedir/SL/Auth" );
my $dbupdir = "$basedir/sql/Pg-upgrade";
my $dbupdir2 = "$basedir/sql/Pg-upgrade2";
my $menufile = "menu.ini";
}
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;
use SL::Form;
use SL::Template;
-$userspath = "users";
-$templates = "templates";
-$memberfile = "users/members";
$sendmail = "| /usr/sbin/sendmail -t";
$| = 1;
$lxdebug = LXDebug->new();
-require "lx-erp.conf";
-
$form = new Form;
$form->{"script"} = "oe.pl";
}
use CGI qw( -no_xhtml);
-use Config::Std;
use Cwd;
use Daemon::Generic;
use Data::Dumper;
use SL::Form;
use SL::Helper::DateTime;
use SL::LXDebug;
+use SL::LxOfficeConf;
use SL::Locale;
our %lx_office_conf;
package main;
- { no warnings 'once';
- $::userspath = "users";
- $::templates = "templates";
- $::sendmail = "| /usr/sbin/sendmail -t";
- }
-
- eval { require "config/lx-erp.conf"; 1; } or die $EVAL_ERROR;
- eval { require "config/lx-erp-local.conf"; 1; } or die $EVAL_ERROR if -f "config/lx-erp-local.conf";
-
$::lxdebug = LXDebug->new;
- $::locale = Locale->new($::language);
+ $::locale = Locale->new($::lx_office_conf{system}->{language});
$::cgi = CGI->new qw();
$::form = Form->new;
$::auth = SL::Auth->new;
sub gd_preconfig {
my $self = shift;
- read_config $self->{configfile} => %lx_office_conf;
+ SL::LxOfficeConf->read;
die "Missing section [task_server] in config file" unless $lx_office_conf{task_server};
die "Missing key 'login' in section [task_server] in config file" unless $lx_office_conf{task_server}->{login};
foreach my $job (@{ $jobs }) {
# Provide fresh global variables in case legacy code modifies
# them somehow.
- $::locale = Locale->new($::language);
+ $::locale = Locale->new($::lx_office_conf{system}->{language});
$::form = Form->new;
$job->run;
mkdir($pidbase) if !-d $pidbase;
-newdaemon(configfile => "${cwd}/config/lx_office.conf",
+my $file = -f "${cwd}/config/lx_office.conf" ? "${cwd}/config/lx_office.conf" : "${cwd}/config/lx_office.conf.default";
+newdaemon(configfile => $file,
progname => 'lx-office-task-server',
pidbase => "${pidbase}/",
);
$sth->execute() || mydberror($query);
my $query_update = "UPDATE parts SET buchungsgruppen_id = ?";
- $query_update .= ", inventory_accno_id = ?" if ($main::eur);
+ $query_update .= ", inventory_accno_id = ?" if $::lx_office_conf{system}->{eur};
$query_update .= " WHERE id = ?";
my $sth_update = $dbh->prepare($query_update);
while (my $ref = $sth->fetchrow_hashref()) {
foreach my $bg (@{$buchungsgruppen}) {
- if (($main::eur ||
+ if (($::lx_office_conf{system}->{eur} ||
($ref->{"inventory_accno_id"} == $bg->{"inventory_accno_id"})) &&
($ref->{"income_accno_id"} == $bg->{"income_accno_id_0"}) &&
($ref->{"expense_accno_id"} == $bg->{"expense_accno_id_0"})) {
my @values = ($bg->{"id"}, $ref->{"id"});
- splice(@values, 1, 0, $bg->{"inventory_accno_id"}) if ($main::eur);
+ splice(@values, 1, 0, $bg->{"inventory_accno_id"}) if $::lx_office_conf{system}->{eur};
$sth_update->execute(@values) ||
mydberror($query_update . " (" . join(", ", @values) . ")");
last;
if (($ref->{"income_accno_id"} == $bg->{"income_accno_id_0"}) &&
($ref->{"expense_accno_id"} == $bg->{"expense_accno_id_0"})) {
my @values = ($bg->{"id"}, $ref->{"id"});
- splice(@values, 1, 0, undef) if ($main::eur);
+ splice(@values, 1, 0, undef) if $::lx_office_conf{system}->{eur};
$sth_update->execute(@values) ||
mydberror($query_update . " (" . join(", ", @values) . ")");
last;
$entry->{"ACC_INVENTORY"} = $acc_inventory;
$entry->{"ACC_INCOME"} = $acc_income;
$entry->{"ACC_EXPENSE"} = $acc_expense;
- $entry->{"eur"} = $main::eur;
+ $entry->{"eur"} = $::lx_office_conf{system}->{eur};
}
# $form->parse_html_template("dbupgrade/buchungsgruppen_parts")
# If balancing is off then force parts.inventory_accno_id to
# a single value for parts.
- force_inventory_accno_id_for_parts() if ($main::eur);
+ force_inventory_accno_id_for_parts() if $::lx_office_conf{system}->{eur};
# Force "IC" to be present in chart.link for all accounts
# which have been used as inventory accounts in parts.
--- /dev/null
+-- @tag: invalid_entries_in_custom_variables_validity
+-- @description: Ungültige Einträge in custom_variables_validity bereinigen
+-- @depends: release_2_6_1
+-- @charset: utf-8
+DELETE FROM custom_variables_validity
+WHERE trans_id NOT IN (
+ SELECT id
+ FROM parts
+);