projects
/
kivitendo-erp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
FlattenToForm: Preis- und Rabatt-Quellen berücksichtigen.
[kivitendo-erp.git]
/
SL
/
DBUpgrade2.pm
diff --git
a/SL/DBUpgrade2.pm
b/SL/DBUpgrade2.pm
index
65944f2
..
4fb1ba9
100644
(file)
--- a/
SL/DBUpgrade2.pm
+++ b/
SL/DBUpgrade2.pm
@@
-7,7
+7,6
@@
use List::MoreUtils qw(any);
use SL::Common;
use SL::DBUpgrade2::Base;
use SL::DBUtils;
use SL::Common;
use SL::DBUpgrade2::Base;
use SL::DBUtils;
-use SL::Iconv;
use strict;
use strict;
@@
-27,7
+26,7
@@
sub init {
$params{path_suffix} ||= '';
$params{schema} ||= '';
$params{path_suffix} ||= '';
$params{schema} ||= '';
- $params{path}
= "sql/Pg-upgrade2" . $params{path_suffix};
+ $params{path}
||
= "sql/Pg-upgrade2" . $params{path_suffix};
map { $self->{$_} = $params{$_} } keys %params;
map { $self->{$_} = $params{$_} } keys %params;
@@
-39,8
+38,6
@@
sub path {
}
sub parse_dbupdate_controls {
}
sub parse_dbupdate_controls {
- $::lxdebug->enter_sub();
-
my ($self) = @_;
my $form = $self->{form};
my ($self) = @_;
my $form = $self->{form};
@@
-52,7
+49,7
@@
sub parse_dbupdate_controls {
my $path = $self->path;
foreach my $file_name (<$path/*.sql>, <$path/*.pl>) {
my $path = $self->path;
foreach my $file_name (<$path/*.sql>, <$path/*.pl>) {
- next unless (open(IN, $file_name));
+ next unless (open(IN,
"<:encoding(UTF-8)",
$file_name));
my $file = $file_name;
$file =~ s|.*/||;
my $file = $file_name;
$file =~ s|.*/||;
@@
-60,6
+57,7
@@
sub parse_dbupdate_controls {
my $control = {
"priority" => 1000,
"depends" => [],
my $control = {
"priority" => 1000,
"depends" => [],
+ "locales" => [],
};
while (<IN>) {
};
while (<IN>) {
@@
-74,6
+72,8
@@
sub parse_dbupdate_controls {
if ($fields[0] eq "depends") {
push(@{$control->{"depends"}}, split(/\s+/, $fields[1]));
if ($fields[0] eq "depends") {
push(@{$control->{"depends"}}, split(/\s+/, $fields[1]));
+ } elsif ($fields[0] eq "locales") {
+ push @{$control->{locales}}, $fields[1];
} else {
$control->{$fields[0]} = $fields[1];
}
} else {
$control->{$fields[0]} = $fields[1];
}
@@
-122,8
+122,6
@@
sub parse_dbupdate_controls {
$self->{all_controls} = \%all_controls;
$self->{all_controls} = \%all_controls;
- $::lxdebug->leave_sub();
-
return $self;
}
return $self;
}
@@
-133,7
+131,7
@@
sub process_query {
my ($self, $dbh, $filename, $version_or_control) = @_;
my $form = $self->{form};
my ($self, $dbh, $filename, $version_or_control) = @_;
my $form = $self->{form};
- my $fh = IO::File->new($filename, "
r
");
+ my $fh = IO::File->new($filename, "
<:encoding(UTF-8)
");
my $query = "";
my $sth;
my @quote_chars;
my $query = "";
my $sth;
my @quote_chars;
@@
-146,8
+144,6
@@
sub process_query {
$dbh->begin_work();
while (<$fh>) {
$dbh->begin_work();
while (<$fh>) {
- $_ = SL::Iconv::convert('UTF-8', 'UTF-8', $_);
-
# Remove DOS and Unix style line endings.
chomp;
# Remove DOS and Unix style line endings.
chomp;
@@
-333,8
+329,6
@@
sub apply_admin_dbupgrade_scripts {
$self->{form}->{login} ||= 'admin';
$self->{form}->{login} ||= 'admin';
- map { $_->{description} = SL::Iconv::convert('UTF-8', 'UTF-8', $_->{description}) } values %{ $self->{all_controls} };
-
if ($called_from_admin) {
$self->{form}->{title} = $::locale->text('Dataset upgrade');
$self->{form}->header;
if ($called_from_admin) {
$self->{form}->{title} = $::locale->text('Dataset upgrade');
$self->{form}->header;
@@
-383,13
+377,11
@@
sub _control_error {
}
sub _dbupdate2_calculate_depth {
}
sub _dbupdate2_calculate_depth {
- $::lxdebug->enter_sub(2);
-
my ($tree, $tag) = @_;
my $node = $tree->{$tag};
my ($tree, $tag) = @_;
my $node = $tree->{$tag};
- return
$::lxdebug->leave_sub(2)
if (defined($node->{"depth"}));
+ return if (defined($node->{"depth"}));
my $max_depth = 0;
my $max_depth = 0;
@@
-400,8
+392,6
@@
sub _dbupdate2_calculate_depth {
}
$node->{"depth"} = $max_depth + 1;
}
$node->{"depth"} = $max_depth + 1;
-
- $::lxdebug->leave_sub(2);
}
sub sort_dbupdate_controls {
}
sub sort_dbupdate_controls {