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

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



Revision: 3581
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=3581&view=rev
Author:   einhverfr
Date:     2011-07-27 18:35:49 +0000 (Wed, 27 Jul 2011)

Log Message:
-----------
Some extra doc strings
File attachment tables now display on journal entry screen.
File attachment screen not yet loading

Modified Paths:
--------------
    trunk/LedgerSMB/DBObject.pm
    trunk/LedgerSMB/File.pm
    trunk/UI/journal/journal_entry.html
    trunk/scripts/file.pl

Modified: trunk/LedgerSMB/DBObject.pm
===================================================================
--- trunk/LedgerSMB/DBObject.pm	2011-07-27 13:22:19 UTC (rev 3580)
+++ trunk/LedgerSMB/DBObject.pm	2011-07-27 18:35:49 UTC (rev 3581)
@@ -43,14 +43,6 @@
 =item _db_array_literal(@elements) creates a multiple dimension db array from 
 	preparsed db arrays or other data which does not need to be escaped.
 
-=back
-
-=head1 Copyright (C) 2007, The LedgerSMB core team.
-
-This file is licensed under the Gnu General Public License version 2, or at your
-option any later version.  A copy of the license should have been included with
-your software.
-
 =cut
 
 package LedgerSMB::DBObject;
@@ -101,6 +93,12 @@
     return $self;
 }
 
+=item set_ordering
+
+Sets the ordering used by default for specific functions called by exec_method
+
+=cut
+
 sub set_ordering {
     my ($self, $args) = @_;
     $self->{_order_method}->{$args->{method}} = 
@@ -183,6 +181,13 @@
     }
 }
 
+
+=item run_custom_queries
+
+Backward-compatible with 1.2 custom query system for moving forward.
+
+=cut
+
 sub run_custom_queries {
     my ( $self, $tablename, $query_type, $linenum ) = @_;
     my $dbh = $self->{dbh};
@@ -348,3 +353,13 @@
 }
 
 1;
+
+=back
+
+=head1 Copyright (C) 2007, The LedgerSMB core team.
+
+This file is licensed under the Gnu General Public License version 2, or at your
+option any later version.  A copy of the license should have been included with
+your software.
+
+=cut

Modified: trunk/LedgerSMB/File.pm
===================================================================
--- trunk/LedgerSMB/File.pm	2011-07-27 13:22:19 UTC (rev 3580)
+++ trunk/LedgerSMB/File.pm	2011-07-27 18:35:49 UTC (rev 3581)
@@ -63,6 +63,10 @@
 
 Referential key for the file to attach to.
 
+=item reference
+
+Reference control code (text string) for attached financial database object.
+
 =item file_class
 
 ID of the file class.
@@ -71,8 +75,12 @@
 
 ID of class of the original attachment point (for a link)
 
-=item x-info
+=item dbobject
 
+Object for db interface.
+
+=item x_info
+
 A hash for extended information
 
 Note additionally the $self hashref contains the basic required attributes for
@@ -104,6 +112,38 @@
 
 =over
 
+=item new
+
+Returns a blessed object
+
+=item to_hashref
+
+Returns a hashref of properties for the object.
+
+=cut
+
+sub to_hashref {
+    my $self = shift @_;
+    my $hashref = {    attached_by_id =>  $self->attached_by_id,
+                       attached_by    =>  $self->attached_by,
+                       attached_at    =>  $self->attached_at,
+                       reference      =>  $self->reference,
+                       content        =>  $self->content,
+                       mime_type_id   =>  $self->mime_type_id,
+                       mime_type_text =>  $self->mime_type_text,
+                       file_name      =>  $self->file_name,
+                       description    =>  $self->description,
+                       id             =>  $self->id,
+                       ref_key        =>  $self->ref_key,
+                       file_class     =>  $self->file_class,
+                       src_class      =>  $self->sec_class,
+                       dbobject       =>  $self->dbobject,
+                       x_info         =>  \{$self->x_info}
+    };
+    return $hashref;
+
+}
+
 =item new_dbobject
 
 $file->new_dbobject({base => (LedgerSMB | LedgerSMB::Form), 

Modified: trunk/UI/journal/journal_entry.html
===================================================================
--- trunk/UI/journal/journal_entry.html	2011-07-27 13:22:19 UTC (rev 3580)
+++ trunk/UI/journal/journal_entry.html	2011-07-27 18:35:49 UTC (rev 3581)
@@ -301,6 +301,55 @@
            } ?>
 
 <?lsmb END ?>
+<?lsmb IF form.id ?>
+<table width="100%">
+<tr class="listtop">
+<th colspan="4"><?lsmb text('Attached and Linked Files') ?></th>
+<tr class="listheading">
+<th><?lsmb text('File name') ?></th>
+<th><?lsmb text('File type') ?></th>
+<th><?lsmb text('Attached at') ?></th>
+<th><?lsmb text('Attached by') ?></th>
+</tr>
+<?lsmb FOREACH file IN form.files ?>
+<tr>
+<td><?lsmb file.file_name() ?></td> 
+<td><?lsmb file.mime_type_text() ?></td> 
+<td><?lsmb file.attached_at() ?></td> 
+<td><?lsmb file.attached_by() ?></td> 
+</tr>
+<?lsmb END ?>
+</table>
+<table width="100%">
+<tr class="listheading">
+<th><?lsmb text('File name') ?></th>
+<th><?lsmb text('File type') ?></th>
+<th><?lsmb text('Attached To Type') ?></th>
+<th><?lsmb text('Attached To') ?></th>
+<th><?lsmb text('Attached at') ?></th>
+<th><?lsmb text('Attached by') ?></th>
+</tr>
+<?lsmb 
+FOREACH link IN form.file_links; 
+        aclass="&nbsp;";
+        IF link.src_class() == 1;
+            aclass="Transaction";
+        ELSIF link.src_class() == 2;
+            aclass="Order";
+        END; ?>
+<tr>
+<td><?lsmb file.file_name() ?></td> 
+<td><?lsmb file.mime_type_text() ?></td> 
+<td><?lsmb aclass ?></td> 
+<td><?lsmb file.reference() ?></td> 
+<td><?lsmb file.attached_at() ?></td> 
+<td><?lsmb file.attached_by() ?></td> 
+</tr>
+<?lsmb END # FOREACH ?>
+</table>
+<a href="file.pl?action=show_attachment_screen&attach_to=<?lsmb form.id 
+   ?>">[<?lsmb text('Attach') ?>]</a>
+<?lsmb END # IF form.id ?>
 </form>
 </body>
 </html>

Modified: trunk/scripts/file.pl
===================================================================
--- trunk/scripts/file.pl	2011-07-27 13:22:19 UTC (rev 3580)
+++ trunk/scripts/file.pl	2011-07-27 18:35:49 UTC (rev 3581)
@@ -56,7 +56,7 @@
 
 sub show_attachment_screen {
     my ($request) = @_;
-    my $template = LedgerSMB::Template(
+    my $template = LedgerSMB::Template->new(
         user     => $request->{_user},
         locale   => $request->{_locale},
         path     => 'UI/file',


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