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

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



Revision: 6345
          http://sourceforge.net/p/ledger-smb/code/6345
Author:   einhverfr
Date:     2014-01-02 11:31:49 +0000 (Thu, 02 Jan 2014)
Log Message:
-----------
Basic workflows now for template editing

Added Paths:
-----------
    trunk/LedgerSMB/Report/Listings/Templates.pm
    trunk/template.pl

Added: trunk/LedgerSMB/Report/Listings/Templates.pm
===================================================================
--- trunk/LedgerSMB/Report/Listings/Templates.pm	                        (rev 0)
+++ trunk/LedgerSMB/Report/Listings/Templates.pm	2014-01-02 11:31:49 UTC (rev 6345)
@@ -0,0 +1,105 @@
+=head1 NAME
+
+LedgerSMB::Report::Listings::Templates - A List of templates installed in the 
+db for LedgerSMB
+
+=head1 SYNOPSIS
+
+   LedgerSMB::Report::Listings::Templates->new(%$request)->render($request);
+
+=head1 DESCRIPTION
+
+Provides a listing of templates installed in the db (for things like invoices 
+and orders).  This is not used for the user interface templates.
+
+=cut
+
+package LedgerSMB::Report::Listings::Templates;
+use Moose;
+extends 'LedgerSMB::Report';
+
+=head1 CRITERIA PROPERTIES
+
+=head2 language_code (string)
+
+Filters by language code.  If undefined, lists only ones with no language 
+defined.
+
+=cut
+
+has language_code => (is => 'ro', isa => 'Str', required => 0);
+
+=head1 REPORT CONSTANT FUNCTIONS
+
+=head2 columns
+
+=over
+
+=item template_name
+
+=item format
+
+=back
+
+=cut
+
+sub columns {
+    return [
+      { col_id => 'template_name'
+          name => LedgerSMB::Report::text('File Name'),
+          type => 'href',
+     href_base => 'templates.pl?action=display&' },
+      { col_id => 'format'
+          name => LedgerSMB::Report::text('Format'),
+          type => 'text' },
+   ];
+}
+
+
+=head2 header_lines
+
+Just the language_code
+
+=cut
+
+sub header_lines { return [
+      { name => 'language_code', text => LedgerSMB::Report::text('Language') },
+    ]
+};
+
+=head2 name
+
+=cut
+
+sub name { return LedgerSMB::Report::text('Template Listing') };
+
+=head1 METHODS
+
+=head2 run_report
+
+Populates the $report->rows.
+
+=cut
+
+sub run_report {
+    my ($self) = @_;
+    my @rows = $self->exec_method(funcname => 'templates__list');
+    for my $ref(@rows){
+        $ref->{row_id} = 
+          "template_name=$ref->{template_name}&" . 
+          "language_code=$ref->{language_code}&format=$ref->{format}";
+    }
+    $self->rows(\@rows);
+}
+
+=head1 COPYRIGHT
+
+COPYRIGHT (C) 2014 The LedgerSMB Core Team
+
+This file may be re-used under the terms of the GNU General Public License
+version 2 or at your option any later version.  Please see the included 
+LICENSE.txt for more information.
+
+=cut
+
+__PACKAGE__->meta->make_immutable;

Copied: trunk/template.pl (from rev 6343, trunk/login.pl)
===================================================================
--- trunk/template.pl	                        (rev 0)
+++ trunk/template.pl	2014-01-02 11:31:49 UTC (rev 6345)
@@ -0,0 +1,8 @@
+#!/usr/bin/perl
+
+use FindBin;
+BEGIN {
+  lib->import($FindBin::Bin) unless $ENV{mod_perl}
+}
+
+require 'lsmb-request.pl';

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


------------------------------------------------------------------------------
Rapidly troubleshoot problems before they affect your business. Most IT 
organizations don't have a clear picture of how application performance 
affects their revenue. With AppDynamics, you get 100% visibility into your 
Java,.NET, & PHP application. Start your 15-day FREE TRIAL of AppDynamics Pro!
http://pubads.g.doubleclick.net/gampad/clk?id=84349831&iu=/4140/ostg.clktrk
_______________________________________________
Ledger-smb-commits mailing list
..hidden..
https://lists.sourceforge.net/lists/listinfo/ledger-smb-commits