X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=sidebyside;f=SL%2FForm.pm;h=d2a51e6247124178033014f0eb16afd153878370;hb=63b3e9b39fe288260a3d6103db86359b3339f21a;hp=d5bb9c3d3a19ddeab86e565e06cd302f5ef3a905;hpb=d4b177761705664e043109244defa9ebbe673c8e;p=kivitendo-erp.git
diff --git a/SL/Form.pm b/SL/Form.pm
index d5bb9c3d3..d2a51e624 100644
--- a/SL/Form.pm
+++ b/SL/Form.pm
@@ -37,8 +37,6 @@
package Form;
-#use strict;
-
use Data::Dumper;
use CGI;
@@ -59,6 +57,8 @@ use Template;
use List::Util qw(first max min sum);
use List::MoreUtils qw(any);
+use strict;
+
my $standard_dbh;
END {
@@ -314,7 +314,7 @@ sub new {
_recode_recursively($iconv, $self);
}
- delete $self{INPUT_ENCODING};
+ delete $self->{INPUT_ENCODING};
}
$self->{action} = lc $self->{action};
@@ -630,6 +630,8 @@ sub create_http_response {
sub header {
$main::lxdebug->enter_sub();
+ # extra code ist 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) = @_;
if ($self->{header}) {
@@ -674,13 +676,23 @@ sub header {
|;
}
- my $fokus = qq| document.$self->{fokus}.focus();| if ($self->{"fokus"});
+ my $fokus = qq|
+
+ | if $self->{"fokus"};
#Set Calendar
my $jsscript = "";
if ($self->{jsscript} == 1) {
$jsscript = qq|
+
+
@@ -711,13 +723,9 @@ sub header {
$jsscript
$ajax
-
+ $fokus
+
+
@@ -1585,7 +1593,7 @@ sub get_standard_dbh {
my ($self, $myconfig) = @_;
if ($standard_dbh && !$standard_dbh->{Active}) {
- $main::lxdebug->message(LXDebug::INFO, "get_standard_dbh: \$standard_dbh is defined but not Active anymore");
+ $main::lxdebug->message(LXDebug->INFO(), "get_standard_dbh: \$standard_dbh is defined but not Active anymore");
undef $standard_dbh;
}
@@ -2065,11 +2073,11 @@ sub get_duedate {
my ($self, $myconfig, $reference_date) = @_;
- my $reference_date = $reference_date ? conv_dateq($reference_date) . '::DATE' : 'current_date';
+ $reference_date = $reference_date ? conv_dateq($reference_date) . '::DATE' : 'current_date';
- my $dbh = $self->get_standard_dbh($myconfig);
- my $query = qq|SELECT ${reference_date} + terms_netto FROM payment_terms WHERE id = ?|;
- my ($duedate) = selectrow_query($self, $dbh, $query, $self->{payment_id});
+ my $dbh = $self->get_standard_dbh($myconfig);
+ my $query = qq|SELECT ${reference_date} + terms_netto FROM payment_terms WHERE id = ?|;
+ my ($duedate) = selectrow_query($self, $dbh, $query, $self->{payment_id});
$main::lxdebug->leave_sub();
@@ -2196,7 +2204,7 @@ sub _get_charts {
my $transdate = quote_db_date($params->{transdate});
my $query =
- qq|SELECT c.id, c.accno, c.description, c.link, tk.taxkey_id, tk.tax_id | .
+ qq|SELECT c.id, c.accno, c.description, c.link, c.charttype, tk.taxkey_id, tk.tax_id | .
qq|FROM chart c | .
qq|LEFT JOIN taxkeys tk ON | .
qq|(tk.id = (SELECT id FROM taxkeys | .
@@ -2735,7 +2743,7 @@ sub all_departments {
ORDER BY description|;
$self->{all_departments} = selectall_hashref_query($self, $dbh, $query);
- delete($self->{all_departments}) unless (@{ $self->{all_departments} });
+ delete($self->{all_departments}) unless (@{ $self->{all_departments} || [] });
$main::lxdebug->leave_sub();
}