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

SF.net SVN: ledger-smb:[4784] trunk



Revision: 4784
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=4784&view=rev
Author:   einhverfr
Date:     2012-05-27 00:34:19 +0000 (Sun, 27 May 2012)
Log Message:
-----------
Removing XLS support from trunk, will remove from 1.3 on further discussion

Modified Paths:
--------------
    trunk/UI/Contact/pricelist.html
    trunk/UI/Reports/display_report.html
    trunk/bin/am.pl
    trunk/bin/rp.pl

Removed Paths:
-------------
    trunk/LedgerSMB/Template/XLS.pm
    trunk/UI/form-dynatable.xlst

Deleted: trunk/LedgerSMB/Template/XLS.pm
===================================================================
--- trunk/LedgerSMB/Template/XLS.pm	2012-05-26 08:47:09 UTC (rev 4783)
+++ trunk/LedgerSMB/Template/XLS.pm	2012-05-27 00:34:19 UTC (rev 4784)
@@ -1,137 +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;
-    if (eval {$rawvars->can('to_output')}){
-       $rawvars = $rawvars->to_output;
-    }
-    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: trunk/UI/Contact/pricelist.html
===================================================================
--- trunk/UI/Contact/pricelist.html	2012-05-26 08:47:09 UTC (rev 4783)
+++ trunk/UI/Contact/pricelist.html	2012-05-27 00:34:19 UTC (rev 4784)
@@ -87,11 +87,6 @@
              credit_id ?>&entity_id=<?lsmb entity_id 
      ?>">[<?lsmb text('PDF') ?>]</a>
 <?lsmb END;
-IF FORMATS.grep('XLS').size() 
-?> <a href="customer.pl?action=pricelist&format=XLS&credit_id=<?lsmb 
-             credit_id ?>&entity_id=<?lsmb entity_id 
-     ?>">[<?lsmb text('XLS') ?>]</a>
-<?lsmb END;
 
 IF FORMATS.grep('ODS').size() 
 ?> <a href="customer.pl?action=pricelist&format=ODS&credit_id=<?lsmb 

Modified: trunk/UI/Reports/display_report.html
===================================================================
--- trunk/UI/Reports/display_report.html	2012-05-26 08:47:09 UTC (rev 4783)
+++ trunk/UI/Reports/display_report.html	2012-05-27 00:34:19 UTC (rev 4784)
@@ -36,9 +36,6 @@
 ?>
 <a href="<?lsmb LINK _ '&format=CSV' ?>">[<?lsmb text('CSV') ?>]</a>&nbsp;
 <?lsmb END;
-IF FORMATS.grep('XLS').size() ?>
-<a href="<?lsmb LINK _ '&format=XLS' ?>">[<?lsmb text('XLS') ?>]</a>&nbsp;
-<?lsmb END;
 IF FORMATS.grep('ODS').size() ?>
 <a href="<?lsmb LINK _ '&format=ODS' ?>">[<?lsmb text('ODS') ?>]</a>&nbsp;
 <?lsmb END; ?>

Deleted: trunk/UI/form-dynatable.xlst
===================================================================
--- trunk/UI/form-dynatable.xlst	2012-05-26 08:47:09 UTC (rev 4783)
+++ trunk/UI/form-dynatable.xlst	2012-05-27 00:34:19 UTC (rev 4784)
@@ -1,30 +0,0 @@
-<workbook>
-	<worksheet name="test">
-		<format bottom="1"><row>
-	<?lsmb FOREACH column IN columns ?>
-	<?lsmb IF heading.$column.text ?>
-			<cell text="<?lsmb heading.$column.text ?>" />
-	<?lsmb ELSE ?>
-			<cell text="<?lsmb heading.$column ?>" />
-	<?lsmb END; END ?>
-		</row></format>
-	<?lsmb FOREACH row IN rows ?>
-		<row>
-		<?lsmb FOREACH column IN columns ?>
-			<?lsmb IF row.$column.text.defined ?>
-			<cell text="<?lsmb row.$column.text ?>" />
-			<?lsmb ELSE ?>
-			<cell text="<?lsmb row.$column ?>" />
-			<?lsmb END ?>
-		<?lsmb END ?>
-		</row>
-	<?lsmb END ?>
-	<?lsmb IF totals; t = [] ?>
-	<row>
-		<?lsmb FOREACH column IN columns ?>
-		<cell text="<?lsmb totals.$column ?>" />
-		<?lsmb END ?>
-	</row>
-	<?lsmb END ?>
-	</worksheet>
-</workbook>

Modified: trunk/bin/am.pl
===================================================================
--- trunk/bin/am.pl	2012-05-26 08:47:09 UTC (rev 4783)
+++ trunk/bin/am.pl	2012-05-27 00:34:19 UTC (rev 4784)
@@ -267,11 +267,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: trunk/bin/rp.pl
===================================================================
--- trunk/bin/rp.pl	2012-05-26 08:47:09 UTC (rev 4783)
+++ trunk/bin/rp.pl	2012-05-27 00:34:19 UTC (rev 4784)
@@ -827,11 +827,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}",

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