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

SF.net SVN: ledger-smb:[6848] trunk/LedgerSMB/Report



Revision: 6848
          http://sourceforge.net/p/ledger-smb/code/6848
Author:   einhverfr
Date:     2014-02-12 07:24:43 +0000 (Wed, 12 Feb 2014)
Log Message:
-----------
Internal file list report

Added Paths:
-----------
    trunk/LedgerSMB/Report/File/
    trunk/LedgerSMB/Report/File/Internal.pm

Added: trunk/LedgerSMB/Report/File/Internal.pm
===================================================================
--- trunk/LedgerSMB/Report/File/Internal.pm	                        (rev 0)
+++ trunk/LedgerSMB/Report/File/Internal.pm	2014-02-12 07:24:43 UTC (rev 6848)
@@ -0,0 +1,117 @@
+=head1 NAME
+
+LedgerSMB::Report::File::Internal - Files for LSMB processes.
+
+=head1 SYNPOSIS
+
+ LedgerSMB::Report::File::Internal->new(%$request)->render($request);
+
+=cut
+
+package LedgerSMB::Report::File::Internal;
+use Moose;
+extends 'LedgerSMB::Report';
+with 'LedgerSMB::Report::File', 'LedgerSMB::I18N';
+
+sub _set_file_class { return 6; }
+sub _set_ref_key { return 0; }
+
+=head1 DESCRIPTION
+
+This report lists internal files, and provides a form to upload additional
+ones.  Files must be unique by name.
+
+=head1 CRITERIA
+
+None
+
+=head1 STATIC METHODS
+
+=head2 columns
+
+=over
+
+=back
+
+=cut
+
+sub columns {
+    return [
+     { col_id => 'file_name',
+         type => 'href',
+    href_base => 'file.pl?action=get&file_class=' . _set_file_class() . 
+                 "&id=",
+         name => text('File Name'), },
+     { col_id => 'description',
+         type => 'text',
+         name => text('Description'), },
+     { col_id => 'mime_type',
+         type => 'text',
+         name => text('Mime Type'), },
+     { col_id => 'uploaded_at',
+         type => 'text',
+         name => text('Uploaded At'), },
+     { col_id => 'uploaded_by_name',
+         type => 'text',
+         name => text('Uploaded By'), },
+    ];
+}
+
+=head2 header_lines
+
+None
+
+=cut
+
+sub header_lines { return []; }
+
+=head2 name
+
+Internal Files (localized)
+
+=cut
+
+sub name { return text('Internal Files'); }
+
+=head2 set_buttons
+
+Single button, set to add a new file.
+
+=cut
+
+sub set_buttons {
+    return [
+        { name => 'action',
+         value => 'add_internal_file',
+          type => 'submit',
+         class => 'submit',
+        },
+    ];
+}
+
+=head1 METHODS
+
+=head2 run_report
+
+Sets the rows.  This is just a wrapper around LedgerSMB::Report::File->list
+
+=cut
+
+sub run_report {
+    my ($self) = $_;
+    my @rows = $self->list;
+    $_->{row_id} = $_->{id} for @rows;
+    $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 file for more information.
+
+=cut
+
+__PACKAGE__->meta->make_immutable;

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


------------------------------------------------------------------------------
Android apps run on BlackBerry 10
Introducing the new BlackBerry 10.2.1 Runtime for Android apps.
Now with support for Jelly Bean, Bluetooth, Mapview and more.
Get your Android app in front of a whole new audience.  Start now.
http://pubads.g.doubleclick.net/gampad/clk?id=124407151&iu=/4140/ostg.clktrk
_______________________________________________
Ledger-smb-commits mailing list
..hidden..
https://lists.sourceforge.net/lists/listinfo/ledger-smb-commits