projects
/
kivitendo-erp.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Ein System von Hooks, die vor oder nach Actions ausgeführt werden können
[kivitendo-erp.git]
/
SL
/
Common.pm
diff --git
a/SL/Common.pm
b/SL/Common.pm
index
bdc4c5d
..
e7bed37
100644
(file)
--- a/
SL/Common.pm
+++ b/
SL/Common.pm
@@
-8,11
+8,15
@@
package Common;
package Common;
+use utf8;
+use strict;
+
use Time::HiRes qw(gettimeofday);
use Time::HiRes qw(gettimeofday);
+use Data::Dumper;
use SL::DBUtils;
use SL::DBUtils;
-use vars qw(@db_encodings %db_encoding_to_charset);
+use vars qw(@db_encodings %db_encoding_to_charset
%charset_to_db_encoding
);
@db_encodings = (
{ "label" => "ASCII", "dbencoding" => "SQL_ASCII", "charset" => "ASCII" },
@db_encodings = (
{ "label" => "ASCII", "dbencoding" => "SQL_ASCII", "charset" => "ASCII" },
@@
-283,8
+287,9
@@
sub retrieve_vendor {
my $query =
qq!SELECT id, name, customernumber, (street || ', ' || zipcode || city) AS address FROM customer ! .
my $query =
qq!SELECT id, name, customernumber, (street || ', ' || zipcode || city) AS address FROM customer ! .
- qq!WHERE $filter business_id = (SELECT id FROM business WHERE description =
'Händler
') ! .
+ qq!WHERE $filter business_id = (SELECT id FROM business WHERE description =
?
') ! .
qq!ORDER BY $order_by $order_dir!;
qq!ORDER BY $order_by $order_dir!;
+ push @filter_values, $::locale->{iconv_utf8}->convert('Händler');
my $sth = $dbh->prepare($query);
$sth->execute(@filter_values) ||
$form->dberror($query . " (" . join(", ", @filter_values) . ")");
my $sth = $dbh->prepare($query);
$sth->execute(@filter_values) ||
$form->dberror($query . " (" . join(", ", @filter_values) . ")");
@@
-345,6
+350,10
@@
sub webdav_folder {
($path, $number) = ("anfragen", $form->{quonumber});
} elsif ($form->{type} eq "purchase_order") {
($path, $number) = ("lieferantenbestellungen", $form->{ordnumber});
($path, $number) = ("anfragen", $form->{quonumber});
} elsif ($form->{type} eq "purchase_order") {
($path, $number) = ("lieferantenbestellungen", $form->{ordnumber});
+ } elsif ($form->{type} eq "sales_delivery_order") {
+ ($path, $number) = ("verkaufslieferscheine", $form->{donumber});
+ } elsif ($form->{type} eq "purchase_delivery_order") {
+ ($path, $number) = ("einkaufslieferscheine", $form->{donumber});
} elsif ($form->{type} eq "credit_note") {
($path, $number) = ("gutschriften", $form->{invnumber});
} elsif ($form->{vc} eq "customer") {
} elsif ($form->{type} eq "credit_note") {
($path, $number) = ("gutschriften", $form->{invnumber});
} elsif ($form->{vc} eq "customer") {
@@
-366,7
+375,7
@@
sub webdav_folder {
my $base_path = substr($ENV{'SCRIPT_NAME'}, 1);
$base_path =~ s|[^/]+$||;
$base_path =~ s|/$||;
my $base_path = substr($ENV{'SCRIPT_NAME'}, 1);
$base_path =~ s|[^/]+$||;
$base_path =~ s|/$||;
- # wo kommt der wert f
ür dir her? es wird doch gar nichts übergeben? fix fü
r strict my $dir jb 21.2.
+ # wo kommt der wert f
ür dir her? es wird doch gar nichts übergeben? fix fü
r strict my $dir jb 21.2.
if (opendir my $dir, $path) {
foreach my $file (sort { lc $a cmp lc $b } readdir $dir) {
next if (($file eq '.') || ($file eq '..'));
if (opendir my $dir, $path) {
foreach my $file (sort { lc $a cmp lc $b } readdir $dir) {
next if (($file eq '.') || ($file eq '..'));
@@
-381,7
+390,7
@@
sub webdav_folder {
push @{ $form->{WEBDAV} }, {
'name' => $fname,
push @{ $form->{WEBDAV} }, {
'name' => $fname,
- 'link' =>
($ENV{"HTTPS"} ? "https://" : "http://") . $ENV{'SERVER_NAME'} . "/
$base_path/$file",
+ 'link' =>
"
$base_path/$file",
'type' => $is_directory ? $main::locale->text('Directory') : $main::locale->text('File'),
};
}
'type' => $is_directory ? $main::locale->text('Directory') : $main::locale->text('File'),
};
}
@@
-516,6
+525,8
@@
sub check_params {
foreach my $key (@_) {
if ((ref $key eq '') && !defined $params->{$key}) {
my $subroutine = (caller(1))[3];
foreach my $key (@_) {
if ((ref $key eq '') && !defined $params->{$key}) {
my $subroutine = (caller(1))[3];
+ $main::lxdebug->message(LXDebug->BACKTRACE_ON_ERROR, "[Common::check_params] failed, params object dumped below");
+ $main::lxdebug->message(LXDebug->BACKTRACE_ON_ERROR, Dumper($params));
$main::form->error($main::locale->text("Missing parameter #1 in call to sub #2.", $key, $subroutine));
} elsif (ref $key eq 'ARRAY') {
$main::form->error($main::locale->text("Missing parameter #1 in call to sub #2.", $key, $subroutine));
} elsif (ref $key eq 'ARRAY') {
@@
-529,6
+540,8
@@
sub check_params {
if (!$found) {
my $subroutine = (caller(1))[3];
if (!$found) {
my $subroutine = (caller(1))[3];
+ $main::lxdebug->message(LXDebug->BACKTRACE_ON_ERROR, "[Common::check_params] failed, params object dumped below");
+ $main::lxdebug->message(LXDebug->BACKTRACE_ON_ERROR, Dumper($params));
$main::form->error($main::locale->text("Missing parameter (at least one of #1) in call to sub #2.", join(', ', @{ $key }), $subroutine));
}
}
$main::form->error($main::locale->text("Missing parameter (at least one of #1) in call to sub #2.", join(', ', @{ $key }), $subroutine));
}
}