[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

SF.net SVN: ledger-smb: [1028] branches/1.2-experimental/LedgerSMB.pm



Revision: 1028
          http://svn.sourceforge.net/ledger-smb/?rev=1028&view=rev
Author:   einhverfr
Date:     2007-04-04 13:14:21 -0700 (Wed, 04 Apr 2007)

Log Message:
-----------
Removed LedgerSMB::format_fields since this should be done by the template engine

Modified Paths:
--------------
    branches/1.2-experimental/LedgerSMB.pm

Modified: branches/1.2-experimental/LedgerSMB.pm
===================================================================
--- branches/1.2-experimental/LedgerSMB.pm	2007-04-04 19:58:36 UTC (rev 1027)
+++ branches/1.2-experimental/LedgerSMB.pm	2007-04-04 20:14:21 UTC (rev 1028)
@@ -39,10 +39,6 @@
 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 => ..hidden..);
-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.
@@ -250,48 +246,6 @@
 	}
 }
 
-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 {


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.