summaryrefslogtreecommitdiff
path: root/LedgerSMB.pm
diff options
context:
space:
mode:
authoreinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2007-04-04 20:15:17 +0000
committereinhverfr <einhverfr@4979c152-3d1c-0410-bac9-87ea11338e46>2007-04-04 20:15:17 +0000
commit8c0545736ca0d25bb326aec79ac5833069eabb3f (patch)
tree509bfabb788c61094b74c20f72d7fe527b6370f8 /LedgerSMB.pm
parent5c3a962f492011bebe096a5a4b007062152df2d7 (diff)
Removed LedgerSMB::format_fields since this should be done by the template engine
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@1029 4979c152-3d1c-0410-bac9-87ea11338e46
Diffstat (limited to 'LedgerSMB.pm')
-rwxr-xr-xLedgerSMB.pm48
1 files changed, 1 insertions, 47 deletions
diff --git a/LedgerSMB.pm b/LedgerSMB.pm
index e938a660..51f10115 100755
--- a/LedgerSMB.pm
+++ b/LedgerSMB.pm
@@ -39,10 +39,6 @@ LedgerSMB::User at some point in the future.
If $amount is a Bigfloat, it is returned as is. If it is a string, it is
parsed according to the user preferences stored in the LedgerSMB::User object.
-=item format_fields (fields => \@array);
-This function converts fields to their appropriate representation in
-HTML/SGML/XML or LaTeX.
-
=item is_blank (name => $string)
This function returns true if $self->{$string} only consists of whitespace
characters or is an empty string.
@@ -136,7 +132,7 @@ sub new {
}
- if (($self->{script} =~ m#(\.\.|\\|/)#)){
+ if (($self->{script} =~ m#(..|\\|/)#)){
$self->error("Access Denied");
}
@@ -250,48 +246,6 @@ sub redirect {
}
}
-sub format_fields {
- # Based on SQL-Ledger's Form::format_string
- # We should look at moving this into LedgerSMB::Template.
- # And cleaning it up...... Chris
-
- my $self = shift @_;
- my %args = @_;
- my @fields = @{$args{fields}};
-
- my $format = $self->{format};
-
- if ($self->{format} =~ /(postscript|pdf)/) {
- $format = 'tex';
- }
-
- my %replace = (
- 'order' => {
- html => [ '<', '>', '\n', '\r' ],
- txt => [ '\n', '\r' ],
- tex => [ quotemeta('\\'), '&', '\n','\r',
- '\$', '%', '_', '#',
- quotemeta('^'), '{', '}', '<', '>', '£'
- ] },
- html => { '<' => '&lt;', '>' => '&gt;','\n' => '<br />',
- '\r' => '<br />' },
- txt => { '\n' => "\n", '\r' => "\r" },
- tex => {'&' => '\&', '$' => '\$', '%' => '\%', '_' => '\_',
- '#' => '\#', quotemeta('^') => '\^\\', '{' => '\{',
- '}' => '\}', '<' => '$<$', '>' => '$>$',
- '\n' => '\newline ', '\r' => '\newline ',
- '£' => '\pounds ', quotemeta('\\') => '/'}
- );
-
- my $key;
-
- foreach $key (@{ $replace{order}{$format} }) {
- for (@fields) { $self->{$_} =~ s/$key/$replace{$format}{$key}/g }
- }
-
-}
-
-
# TODO: Either we should have an amount class with formats and such attached
# Or maybe we should move this into the user class...
sub format_amount {