}
sub adminlogin {
- my $form = $main::form;
- my $locale = $main::locale;
+ my $form = $main::form;
+ my $locale = $main::locale;
$form->{title} = qq|Lx-Office ERP $form->{version} | . $locale->text('Administration');
}
sub check_auth_db_and_tables {
- my $form = $main::form;
- my $locale = $main::locale;
+ my $form = $main::form;
+ my $locale = $main::locale;
my %params;
}
sub create_auth_db {
- my $form = $main::form;
+ my $form = $main::form;
$main::auth->create_database('superuser' => $form->{db_superuser},
- 'superuser_password' => $form->{db_superuser_password},
- 'template' => $form->{db_template});
+ 'superuser_password' => $form->{db_superuser_password},
+ 'template' => $form->{db_template});
login();
}
sub create_auth_tables {
- my $form = $main::form;
- my $locale = $main::locale;
+ my $form = $main::form;
+ my $locale = $main::locale;
$main::auth->create_tables();
$main::auth->set_session_value('rpw', $form->{rpw});
sub migrate_users {
$main::lxdebug->enter_sub();
- my $form = $main::form;
- my $locale = $main::locale;
+ my $form = $main::form;
+ my $locale = $main::locale;
my $memberdir = "";
}
sub create_standard_group_ask {
- my $form = $main::form;
- my $locale = $main::locale;
+ my $form = $main::form;
+ my $locale = $main::locale;
$form->{title} = $locale->text('Create a standard group');
}
sub create_standard_group {
- my $form = $main::form;
- my $locale = $main::locale;
+ my $form = $main::form;
+ my $locale = $main::locale;
my %members = $main::auth->read_all_users();
- my $groups = $main::auth->read_groups();
+ my $groups = $main::auth->read_groups();
foreach my $group (values %{$groups}) {
if (($form->{group_id} != $group->{id})
sub user_migration_complete {
my $standard_group_created = shift;
- my $form = $main::form;
- my $locale = $main::locale;
+ my $form = $main::form;
+ my $locale = $main::locale;
$form->{title} = $locale->text('User migration complete');
$form->header();
}
sub list_users {
- my $form = $main::form;
- my $locale = $main::locale;
+ my $form = $main::form;
+ my $locale = $main::locale;
my %members = $main::auth->read_all_users();
}
sub add_user {
+ my $form = $main::form;
+ my $locale = $main::locale;
- my $form = $main::form;
- my $locale = $main::locale;
+ $form->{title} = "Lx-Office ERP " . $locale->text('Administration') . " / " . $locale->text('Add User');
- $form->{title} =
- "Lx-Office ERP "
- . $locale->text('Administration') . " / "
- . $locale->text('Add User');
-
- my $myconfig = {
+ my $myconfig = {
"vclimit" => 200,
"countrycode" => "de",
"numberformat" => "1.000,00",
}
sub edit_user {
- my $form = $main::form;
- my $locale = $main::locale;
-
+ my $form = $main::form;
+ my $locale = $main::locale;
- $form->{title} =
- "Lx-Office ERP "
- . $locale->text('Administration') . " / "
- . $locale->text('Edit User');
- $form->{edit} = 1;
+ $form->{title} = "Lx-Office ERP " . $locale->text('Administration') . " / " . $locale->text('Edit User');
+ $form->{edit} = 1;
$form->isblank("login", $locale->text("The login is missing."));
sub edit_user_form {
my ($myconfig) = @_;
- my $form = $main::form;
- my $locale = $main::locale;
+ my $form = $main::form;
+ my $locale = $main::locale;
my @valid_dateformats = qw(mm-dd-yy mm/dd/yy dd-mm-yy dd/mm/yy dd.mm.yy yyyy-mm-dd);
$form->{ALL_DATEFORMATS} = [ map { { "format" => $_, "selected" => $_ eq $myconfig->{dateformat} } } @valid_dateformats ];
}
sub save_user {
- my $form = $main::form;
- my $locale = $main::locale;
+ my $form = $main::form;
+ my $locale = $main::locale;
$form->{dbdriver} = 'Pg';
}
sub save_user_as_new {
- my $form = $main::form;
+ my $form = $main::form;
$form->{login} = $form->{new_user_login};
delete @{$form}{qw(edit new_user_login)};
}
sub delete_user {
- my $form = $main::form;
- my $locale = $main::locale;
+ my $form = $main::form;
+ my $locale = $main::locale;
my %members = $main::auth->read_all_users();
my $templates = $members{$form->{login}}->{templates};
}
sub get_value {
- my $line = shift;
-
- my $form = $main::form;
-
+ my $line = shift;
my ($null, $value) = split(/=/, $line, 2);
# remove comments
}
sub pg_database_administration {
- my $form = $main::form;
+ my $form = $main::form;
$form->{dbdriver} = 'Pg';
dbselect_source();
}
sub dbselect_source {
- my $form = $main::form;
- my $locale = $main::locale;
+ my $form = $main::form;
+ my $locale = $main::locale;
$form->{dbport} = '5432';
$form->{dbuser} = 'postgres';
}
sub test_db_connection {
- my $form = $main::form;
- my $locale = $main::locale;
+ my $form = $main::form;
+ my $locale = $main::locale;
$form->{dbdriver} = 'Pg';
User::dbconnect_vars($form, $form->{dbname});
}
sub update_dataset {
- my $form = $main::form;
- my $locale = $main::locale;
+ my $form = $main::form;
+ my $locale = $main::locale;
- $form->{title} =
- "Lx-Office ERP "
- . $locale->text('Database Administration') . " / "
- . $locale->text('Update Dataset');
+ $form->{title} = "Lx-Office ERP " . $locale->text('Database Administration') . " / " . $locale->text('Update Dataset');
my @need_updates = User->dbneedsupdate($form);
$form->{NEED_UPDATES} = \@need_updates;
}
sub dbupdate {
- my $form = $main::form;
- my $locale = $main::locale;
+ my $form = $main::form;
+ my $locale = $main::locale;
$form->{stylesheet} = "lx-office-erp.css";
$form->{title} = $locale->text("Dataset upgrade");
}
sub create_dataset {
- my $form = $main::form;
- my $locale = $main::locale;
+ my $form = $main::form;
+ my $locale = $main::locale;
$form->{dbsources} = join " ", map { "[${_}]" } sort User->dbsources($form);
- $form->{CHARTS} = [];
+ $form->{CHARTS} = [];
opendir SQLDIR, "sql/." or $form->error($ERRNO);
foreach my $item (sort grep /-chart\.sql\z/, readdir SQLDIR) {
}
}
- $form->{title} =
- "Lx-Office ERP "
- . $locale->text('Database Administration') . " / "
- . $locale->text('Create Dataset');
+ $form->{title} = "Lx-Office ERP " . $locale->text('Database Administration') . " / " . $locale->text('Create Dataset');
$form->header();
print $form->parse_html_template("admin/create_dataset");
}
sub dbcreate {
- my $form = $main::form;
- my $locale = $main::locale;
+ my $form = $main::form;
+ my $locale = $main::locale;
$form->isblank("db", $locale->text('Dataset missing!'));
User->dbcreate(\%$form);
- $form->{title} =
- "Lx-Office ERP "
- . $locale->text('Database Administration') . " / "
- . $locale->text('Create Dataset');
+ $form->{title} = "Lx-Office ERP " . $locale->text('Database Administration') . " / " . $locale->text('Create Dataset');
$form->header();
print $form->parse_html_template("admin/dbcreate");
}
sub delete_dataset {
- my $form = $main::form;
- my $locale = $main::locale;
+ my $form = $main::form;
+ my $locale = $main::locale;
my @dbsources = User->dbsources_unused($form);
$form->error($locale->text('Nothing to delete!')) unless @dbsources;
- $form->{title} =
- "Lx-Office ERP "
- . $locale->text('Database Administration') . " / "
- . $locale->text('Delete Dataset');
+ $form->{title} = "Lx-Office ERP " . $locale->text('Database Administration') . " / " . $locale->text('Delete Dataset');
$form->{DBSOURCES} = [ map { { "name", $_ } } sort @dbsources ];
$form->header();
}
sub dbdelete {
- my $form = $main::form;
- my $locale = $main::locale;
+ my $form = $main::form;
+ my $locale = $main::locale;
if (!$form->{db}) {
$form->error($locale->text('No Dataset selected!'));
User->dbdelete(\%$form);
- $form->{title} =
- "Lx-Office ERP "
- . $locale->text('Database Administration') . " / "
- . $locale->text('Delete Dataset');
+ $form->{title} = "Lx-Office ERP " . $locale->text('Database Administration') . " / " . $locale->text('Delete Dataset');
$form->header();
print $form->parse_html_template("admin/dbdelete");
}
sub backup_dataset {
- my $form = $main::form;
- my $locale = $main::locale;
+ my $form = $main::form;
+ my $locale = $main::locale;
- $form->{title} =
- "Lx-Office ERP "
- . $locale->text('Database Administration') . " / "
- . $locale->text('Backup Dataset');
+ $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.'));
}
sub backup_dataset_start {
- my $form = $main::form;
- my $locale = $main::locale;
+ my $form = $main::form;
+ my $locale = $main::locale;
- $form->{title} =
- "Lx-Office ERP "
- . $locale->text('Database Administration') . " / "
- . $locale->text('Backup Dataset');
+ $form->{title} = "Lx-Office ERP " . $locale->text('Database Administration') . " / " . $locale->text('Backup Dataset');
$main::pg_dump_exe ||= "pg_dump";
unlink "${tmpdir}/.pgpass", $tmp;
rmdir $tmpdir;
- $form->{title} =
- "Lx-Office ERP "
- . $locale->text('Database Administration') . " / "
- . $locale->text('Backup Dataset');
+ $form->{title} = "Lx-Office ERP " . $locale->text('Database Administration') . " / " . $locale->text('Backup Dataset');
$form->header();
print $form->parse_html_template("admin/backup_dataset_email_done");
}
sub restore_dataset {
- my $form = $main::form;
- my $locale = $main::locale;
+ my $form = $main::form;
+ my $locale = $main::locale;
- $form->{title} =
- "Lx-Office ERP "
- . $locale->text('Database Administration') . " / "
- . $locale->text('Restore Dataset');
+ $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.'));
}
sub restore_dataset_start {
- my $form = $main::form;
- my $locale = $main::locale;
+ my $form = $main::form;
+ my $locale = $main::locale;
- $form->{title} =
- "Lx-Office ERP "
- . $locale->text('Database Administration') . " / "
- . $locale->text('Restore Dataset');
+ $form->{title} = "Lx-Office ERP " . $locale->text('Database Administration') . " / " . $locale->text('Restore Dataset');
$main::pg_restore_exe ||= "pg_restore";
}
sub unlock_system {
- my $form = $main::form;
- my $locale = $main::locale;
+ my $form = $main::form;
+ my $locale = $main::locale;
unlink "$main::userspath/nologin";
}
sub lock_system {
- my $form = $main::form;
- my $locale = $main::locale;
+ my $form = $main::form;
+ my $locale = $main::locale;
open(FH, ">$main::userspath/nologin")
or $form->error($locale->text('Cannot create Lock!'));
}
sub edit {
- my $form = $main::form;
+ my $form = $main::form;
$form->{edit_nextsub} ||= 'edit_user';
}
sub save {
- my $form = $main::form;
+ my $form = $main::form;
$form->{save_nextsub} ||= 'save_user';
}
sub dispatcher {
- my $form = $main::form;
- my $locale = $main::locale;
+ my $form = $main::form;
+ my $locale = $main::locale;
foreach my $action (qw(create_standard_group dont_create_standard_group
save_user delete_user save_user_as_new)) {