X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=SL%2FForm.pm;h=444bfdcaac06b091b60f5fea3562108d47a245d3;hb=3ac9bdcaf2633da20fc12464eddc946417689b48;hp=d4c456ab3d6ba91f2894653574ab6f6c8405ca20;hpb=f43900dd2dc883a18c3aab1d1fb760ca47e88874;p=kivitendo-erp.git
diff --git a/SL/Form.pm b/SL/Form.pm
index d4c456ab3..444bfdcaa 100644
--- a/SL/Form.pm
+++ b/SL/Form.pm
@@ -1,4 +1,4 @@
-#=====================================================================
+#====================================================================
# LX-Office ERP
# Copyright (C) 2004
# Based on SQL-Ledger Version 2.1.9
@@ -36,9 +36,17 @@
#======================================================================
package Form;
+use Data::Dumper;
+
+use Cwd;
+use HTML::Template;
+use SL::Template;
+use CGI::Ajax;
+use SL::Menu;
+use CGI;
sub _input_to_hash {
- $main::lxdebug->enter_sub();
+ $main::lxdebug->enter_sub(2);
my $input = $_[0];
my %in = ();
@@ -49,13 +57,13 @@ sub _input_to_hash {
$in{$name} = unescape(undef, $value);
}
- $main::lxdebug->leave_sub();
+ $main::lxdebug->leave_sub(2);
return %in;
}
sub _request_to_hash {
- $main::lxdebug->enter_sub();
+ $main::lxdebug->enter_sub(2);
my ($input) = @_;
my ($i, $loc, $key, $val);
@@ -106,11 +114,11 @@ sub _request_to_hash {
}
}
- $main::lxdebug->leave_sub();
+ $main::lxdebug->leave_sub(2);
return %ATTACH;
} else {
- $main::lxdebug->leave_sub();
+ $main::lxdebug->leave_sub(2);
return _input_to_hash($input);
}
}
@@ -135,13 +143,10 @@ sub new {
my %parameters = _request_to_hash($_);
map({ $self->{$_} = $parameters{$_}; } keys(%parameters));
- $self->{menubar} = 1 if $self->{path} =~ /lynx/i;
-
$self->{action} = lc $self->{action};
- $self->{action} =~ s/( |-|,|#)/_/g;
+ $self->{action} =~ s/( |-|,|\#)/_/g;
- $self->{version} = "2.1.2";
- $self->{dbversion} = "2.1.2";
+ $self->{version} = "2.4.1";
$main::lxdebug->leave_sub();
@@ -161,7 +166,7 @@ sub debug {
}
sub escape {
- $main::lxdebug->enter_sub();
+ $main::lxdebug->enter_sub(2);
my ($self, $str, $beenthere) = @_;
@@ -172,13 +177,13 @@ sub escape {
$str =~ s/([^a-zA-Z0-9_.-])/sprintf("%%%02x", ord($1))/ge;
- $main::lxdebug->leave_sub();
+ $main::lxdebug->leave_sub(2);
return $str;
}
sub unescape {
- $main::lxdebug->enter_sub();
+ $main::lxdebug->enter_sub(2);
my ($self, $str) = @_;
@@ -187,7 +192,7 @@ sub unescape {
$str =~ s/%([0-9a-fA-Z]{2})/pack("c",hex($1))/eg;
- $main::lxdebug->leave_sub();
+ $main::lxdebug->leave_sub(2);
return $str;
}
@@ -195,61 +200,71 @@ sub unescape {
sub quote {
my ($self, $str) = @_;
- if ($str && ! ref($str)) {
- $str =~ s/"/"/g;
+ if ($str && !ref($str)) {
+ $str =~ s/\"/"/g;
}
$str;
}
-
sub unquote {
my ($self, $str) = @_;
- if ($str && ! ref($str)) {
- $str =~ s/"/"/g;
+ if ($str && !ref($str)) {
+ $str =~ s/"/\"/g;
}
$str;
}
-
+sub quote_html {
+ $main::lxdebug->enter_sub(2);
+
+ my ($self, $str) = @_;
+
+ my %replace =
+ ('order' => ['"', '<', '>'],
+ '<' => '<',
+ '>' => '>',
+ '"' => '"',
+ );
+
+ map({ $str =~ s/$_/$replace{$_}/g; } @{ $replace{"order"} });
+
+ $main::lxdebug->leave_sub(2);
+
+ return $str;
+}
+
sub hide_form {
my $self = shift;
if (@_) {
- for (@_) { print qq|\n| }
+ for (@_) {
+ print qq|\n|;
+ }
} else {
delete $self->{header};
- for (sort keys %$self) { print qq|\n| }
+ for (sort keys %$self) {
+ print qq|\n|;
+ }
}
-
+
}
sub error {
$main::lxdebug->enter_sub();
my ($self, $msg) = @_;
-
if ($ENV{HTTP_USER_AGENT}) {
$msg =~ s/\n/
/g;
-
- $self->header;
-
- print qq|
-
$msg - - -