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

SF.net SVN: ledger-smb:[4820] branches/1.3



Revision: 4820
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=4820&view=rev
Author:   einhverfr
Date:     2012-06-02 11:07:07 +0000 (Sat, 02 Jun 2012)
Log Message:
-----------
Removing long-broken XLS support.

Modified Paths:
--------------
    branches/1.3/Changelog
    branches/1.3/Makefile.PL
    branches/1.3/bin/am.pl
    branches/1.3/bin/rp.pl

Removed Paths:
-------------
    branches/1.3/LedgerSMB/Template/XLS.pm

Modified: branches/1.3/Changelog
===================================================================
--- branches/1.3/Changelog	2012-06-02 09:30:38 UTC (rev 4819)
+++ branches/1.3/Changelog	2012-06-02 11:07:07 UTC (rev 4820)
@@ -15,6 +15,7 @@
 * Fixed button disable inverted (Chris T)
 * Fixed internal server error on requirements report (Chris T, h/t Nigel T)
 * Fixed formatting issues with long dates and ISO db dates (Chris T 3525843)
+* Removing XLS support which has been broken for some time (Chris T)
 
 David M is David Mora
 Nigel T is Nigel Titley

Deleted: branches/1.3/LedgerSMB/Template/XLS.pm
===================================================================
--- branches/1.3/LedgerSMB/Template/XLS.pm	2012-06-02 09:30:38 UTC (rev 4819)
+++ branches/1.3/LedgerSMB/Template/XLS.pm	2012-06-02 11:07:07 UTC (rev 4820)
@@ -1,134 +0,0 @@
-
-=head1 NAME
-
-LedgerSMB::Template::XLS - Template support module for LedgerSMB
-
-=head1 SYNOPSIS
-
-Excel spreadsheet output.  For details about the XML template document
-elements, see Excel::Template.  For details about various parameters used, see
-Spreadsheet::WriteExcel.  As this module uses Excel::Template::Plus, flow
-control and variable substitution are handled with TT with the usual for LSMB
-tag formatting of <?lsmb foo ?> instead of the more HTML::Template-like forms
-of Excel::Template.
-
-=head1 METHODS
-
-=over
-
-=item get_template ($name)
-
-Returns the appropriate template filename for this format.  '.xlst' is the
-extension that was chosen for the templates.
-
-=item preprocess ($vars)
-
-Returns $vars.
-
-=item process ($parent, $cleanvars)
-
-Processes the template for text.
-
-=item postprocess ($parent)
-
-Returns the output filename.
-
-=back
-
-=head1 Copyright (C) 2007, The LedgerSMB core team.
-
-This work contains copyrighted information from a number of sources all used
-with permission.  
-
-It is released under the GNU General Public License Version 2 or, at your 
-option, any later version.  See COPYRIGHT file for details.  For a full list 
-including contact information of contributors, maintainers, and copyright 
-holders, see the CONTRIBUTORS file.
-=cut
-
-package LedgerSMB::Template::XLS;
-
-use warnings;
-use strict;
-
-use Error qw(:try);
-use CGI::Simple::Standard qw(:html);
-use Excel::Template::Plus;
-use LedgerSMB::Template::TTI18N;
-my $binmode = ':utf8';
-binmode STDOUT, $binmode;
-binmode STDERR, $binmode;
-
-
-sub get_template {
-	my $name = shift;
-	return "${name}.xlst";
-}
-
-sub preprocess {
-    my $rawvars = shift;
-    my $vars;
-    my $type = ref $rawvars;
-
-    #XXX fix escaping function
-    return $rawvars if $type =~ /^LedgerSMB::Locale/;
-    return $rawvars unless defined $rawvars;
-    if ( $type eq 'ARRAY' ) {
-        for (@{$rawvars}) {
-            push @{$vars}, preprocess( $_ );
-        }
-    } elsif (!$type) {
-        return escapeHTML($rawvars);
-    } elsif ($type eq 'SCALAR' or $type eq 'Math::BigInt::GMP') {
-        return escapeHTML($$rawvars);
-    } else { # Hashes and objects
-        for ( keys %{$rawvars} ) {
-            $vars->{preprocess($_)} = preprocess( $rawvars->{$_} );
-        }
-    }
-    
-    return $vars;
-}
-
-sub process {
-	my $parent = shift;
-	my $cleanvars = shift;
-	my $template;
-	my $source;
-	my $tempdir = ${LedgerSMB::Sysconfig::tempdir};
-        $parent->{binmode} = $binmode;
-	$parent->{outputfile} ||= "$tempdir/$parent->{template}-output-$$";
-
-	if (ref $parent->{template} eq 'SCALAR') {
-		$source = $parent->{template};
-	} elsif (ref $parent->{template} eq 'ARRAY') {
-		$source = join "\n", @{$parent->{template}};
-	} else {
-		$source = get_template($parent->{template});
-	}
-	$template = Excel::Template::Plus->new(
-		engine => 'TT',
-		template => $source,
-		params => {%$cleanvars, %$LedgerSMB::Template::TTI18N::ttfuncs,
-			'escape' => \&preprocess},
-		config => {
-			INCLUDE_PATH => [$parent->{include_path_lang}, $parent->{include_path}, 'UI/lib'],
-			START_TAG => quotemeta('<?lsmb'),
-			END_TAG => quotemeta('?>'),
-			DELIMITER => ';',
-			DEBUG => ($parent->{debug})? 'dirs': undef,
-			DEBUG_FORMAT => '',},
-	);
-	$template->write_file("$parent->{outputfile}.xls");
-
-	$parent->{mimetype} = 'application/vnd.ms-excel';
-}
-
-sub postprocess {
-	my $parent = shift;
-	$parent->{rendered} = "$parent->{outputfile}.xls" if $parent->{outputfile};
-	return $parent->{rendered};
-}
-
-1;
-

Modified: branches/1.3/Makefile.PL
===================================================================
--- branches/1.3/Makefile.PL	2012-06-02 09:30:38 UTC (rev 4819)
+++ branches/1.3/Makefile.PL	2012-06-02 11:07:07 UTC (rev 4820)
@@ -68,10 +68,6 @@
     'XML::Twig' => 0,
     'OpenOffice::OODoc' => 0;
 
-feature 'Excel output',
-    -default => 0,
-    'Excel::Template::Plus' => 0;
-
 Makefile->postamble(
      qq{installdb :: \n\tLSMB_INSTALL_DB=1 LSMB_TEST_DB=1 make test\n}
 );

Modified: branches/1.3/bin/am.pl
===================================================================
--- branches/1.3/bin/am.pl	2012-06-02 09:30:38 UTC (rev 4819)
+++ branches/1.3/bin/am.pl	2012-06-02 11:07:07 UTC (rev 4820)
@@ -260,11 +260,10 @@
 
     my %can_load;
     $can_load{CSV} = 1;
-    $can_load{XLS} = eval { require Excel::Template::Plus };
     $can_load{ODS} = eval { require OpenOffice::OODoc };
 
     my @buttons;
-    for my $type (qw(CSV XLS ODS)) {
+    for my $type (qw(CSV ODS)) {
         push @buttons, {
             name => 'action',
             value => lc "${type}_list_account",

Modified: branches/1.3/bin/rp.pl
===================================================================
--- branches/1.3/bin/rp.pl	2012-06-02 09:30:38 UTC (rev 4819)
+++ branches/1.3/bin/rp.pl	2012-06-02 11:07:07 UTC (rev 4820)
@@ -833,11 +833,10 @@
 
     my %can_load;
     $can_load{CSV} = 1;
-    $can_load{XLS} =  eval { require Excel::Template::Plus };
     $can_load{ODS} =  eval { require OpenOffice::OODoc };
 
     my @buttons;
-    for my $type (qw(CSV XLS ODS)) {
+    for my $type (qw(CSV ODS)) {
         push @buttons, {
             name => 'action',
             value => lc "${type}_$form->{nextsub}",
@@ -1251,10 +1250,9 @@
 
     my %can_load;
     $can_load{CSV} = 1;
-    $can_load{XLS} = ! eval { require Excel::Template::Plus };
     $can_load{ODS} = ! eval { require OpenOffice::OODoc };
 
-    for my $type (qw(CSV XLS ODS)) {
+    for my $type (qw(CSV ODS)) {
         push @buttons, {
             name => 'action',
             value => lc "${type}_$form->{nextsub}",

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