summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortetragon <tetragon@4979c152-3d1c-0410-bac9-87ea11338e46>2007-05-17 00:21:22 +0000
committertetragon <tetragon@4979c152-3d1c-0410-bac9-87ea11338e46>2007-05-17 00:21:22 +0000
commit0a4abf20866526b5803ab3fbe0e484ad7cda3588 (patch)
tree7195abd46a6bb123184216f1f4fe295f6eda3eba
parenta8b15f586f8f9e40e4941ac4148dca6705ce744c (diff)
POD fixes and POD syntax tests
git-svn-id: https://ledger-smb.svn.sourceforge.net/svnroot/ledger-smb/trunk@1202 4979c152-3d1c-0410-bac9-87ea11338e46
-rwxr-xr-xLedgerSMB.pm54
-rw-r--r--LedgerSMB/Contact.pm10
-rw-r--r--LedgerSMB/DBObject.pm7
-rw-r--r--LedgerSMB/Employee.pm16
-rw-r--r--LedgerSMB/Locale.pm73
-rw-r--r--LedgerSMB/Location.pm17
-rw-r--r--LedgerSMB/Setting.pm14
-rwxr-xr-xLedgerSMB/Template.pm17
-rwxr-xr-xLedgerSMB/Template/HTML.pm19
-rw-r--r--t/97-pod.t14
10 files changed, 164 insertions, 77 deletions
diff --git a/LedgerSMB.pm b/LedgerSMB.pm
index c07276bb..2cfee9c6 100755
--- a/LedgerSMB.pm
+++ b/LedgerSMB.pm
@@ -1,3 +1,4 @@
+
=head1 NAME
LedgerSMB The Base class for many LedgerSMB objects, including DBObject.
@@ -9,10 +10,14 @@ in database objects (LedgerSMB::DBObject)
=head1 METHODS
+=over
+
=item new ()
+
This method creates a new base request instance.
=item date_to_number (user => $LedgerSMB::User, date => $string);
+
This function takes the date in the format provided and returns a numeric
string in YYMMDD format. This may be moved to User in the future.
@@ -36,18 +41,22 @@ preferences, the negative format (- or DR/CR). Note that it may move to
LedgerSMB::User at some point in the future.
=item parse_amount (user => $LedgerSMB::User::hash, amount => $variable);
+
If $amount is a Bigfloat, it is returned as is. If it is a string, it is
parsed according to the user preferences stored in the LedgerSMB::User object.
=item is_blank (name => $string)
+
This function returns true if $self->{$string} only consists of whitespace
characters or is an empty string.
=item is_run_mode ('(cli|cgi|mod_perl)')
+
This function returns 1 if the run mode is what is specified. Otherwise
returns 0.
=item is_allowed_role(allowed_roles => @role_names)
+
This function returns 1 if the user's roles include any of the roles in
@role_names. Currently it returns 1 when this is not found as well but when
role permissions are introduced, this will change to 0.
@@ -58,6 +67,7 @@ This function determines the likely number of rows needed to hold text in a
textbox. It returns either that number or max, which ever is lower.
=item merge ($hashref, keys => @list, index => $number);
+
This command merges the $hashref into the current object. If keys are
specified, only those keys are used. Otherwise all keys are merged.
@@ -71,33 +81,37 @@ $self->{callback}, and if this is not set, goes to an info screen and prints
$msg.
=item redo_rows (fields => \@list, count => $integer, [index => $string);
+
This function is undergoing serious redesign at the moment. If index is
defined, that field is used for ordering the rows. If not, runningnumber is
used. Behavior is not defined when index points to a field containing
non-numbers.
+=back
+
=head1 Copyright (C) 2006, The LedgerSMB core team.
-# This work contains copyrighted information from a number of sources all used
-# with permission.
-#
-# This file contains source code included with or based on SQL-Ledger which
-# is Copyright Dieter Simader and DWS Systems Inc. 2000-2005 and licensed
-# under the GNU General Public License version 2 or, at your option, any later
-# version. For a full list including contact information of contributors,
-# maintainers, and copyright holders, see the CONTRIBUTORS file.
-#
-# Original Copyright Notice from SQL-Ledger 2.6.17 (before the fork):
-# Copyright (C) 2000
-#
-# Author: DWS Systems Inc.
-# Web: http://www.sql-ledger.org
-#
-# Contributors: Thomas Bayen <bayen@gmx.de>
-# Antti Kaihola <akaihola@siba.fi>
-# Moritz Bunkus (tex)
-# Jim Rawlings <jim@your-dba.com> (DB2)
-#======================================================================
+ # This work contains copyrighted information from a number of sources
+ # all used with permission.
+ #
+ # This file contains source code included with or based on SQL-Ledger
+ # which is Copyright Dieter Simader and DWS Systems Inc. 2000-2005
+ # and licensed under the GNU General Public License version 2 or, at
+ # your option, any later version. For a full list including contact
+ # information of contributors, maintainers, and copyright holders,
+ # see the CONTRIBUTORS file.
+ #
+ # Original Copyright Notice from SQL-Ledger 2.6.17 (before the fork):
+ # Copyright (C) 2000
+ #
+ # Author: DWS Systems Inc.
+ # Web: http://www.sql-ledger.org
+ #
+ # Contributors: Thomas Bayen <bayen@gmx.de>
+ # Antti Kaihola <akaihola@siba.fi>
+ # Moritz Bunkus (tex)
+ # Jim Rawlings <jim@your-dba.com> (DB2)
+ #====================================================================
=cut
use CGI;
diff --git a/LedgerSMB/Contact.pm b/LedgerSMB/Contact.pm
index 14f3ee6e..473e50c5 100644
--- a/LedgerSMB/Contact.pm
+++ b/LedgerSMB/Contact.pm
@@ -10,21 +10,27 @@ This module creates object instances based on LedgerSMB's in-database ORM.
=head1 METHODS
The following method is static:
+
+=over
+
=item new ($LedgerSMB object);
The following methods are passed through to stored procedures via Autoload.
=item save
+
=item get
+
=item search
The above list may grow over time, and may depend on other installed modules.
+=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.
-=back
-
=cut
diff --git a/LedgerSMB/DBObject.pm b/LedgerSMB/DBObject.pm
index 109c22ff..6d298ecb 100644
--- a/LedgerSMB/DBObject.pm
+++ b/LedgerSMB/DBObject.pm
@@ -9,6 +9,8 @@ This module creates object instances based on LedgerSMB's in-database ORM.
=head1 METHODS
+=over
+
=item new ($class, base => $LedgerSMB::hash)
This is the base constructor for all child classes. It must be used with base
@@ -21,16 +23,17 @@ this way as is any information that is needed.
=item exec_method ($self, procname => $function_name, args => \@args)
=item merge ($hashref, @attrs)
+
copies @attrs from $hashref to $self.
+=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.
-=back
-
=cut
package LedgerSMB::DBObject;
diff --git a/LedgerSMB/Employee.pm b/LedgerSMB/Employee.pm
index dd74be75..d0b09829 100644
--- a/LedgerSMB/Employee.pm
+++ b/LedgerSMB/Employee.pm
@@ -10,23 +10,35 @@ This module creates object instances based on LedgerSMB's in-database ORM.
=head1 METHODS
The following method is static:
+
+=over
+
=item new ($LedgerSMB object);
+=back
+
The following methods are passed through to stored procedures via Autoload.
+
+=over
+
=item save
+
=item get
+
=item search
+
=item list_managers
The above list may grow over time, and may depend on other installed modules.
+=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.
-=back
-
=cut
package LedgerSMB::Employee;
diff --git a/LedgerSMB/Locale.pm b/LedgerSMB/Locale.pm
index 7ef8563e..90b269db 100644
--- a/LedgerSMB/Locale.pm
+++ b/LedgerSMB/Locale.pm
@@ -8,6 +8,8 @@ Locale support module for LedgerSMB. Uses Locale::Maketext::Lexicon as a base.
=head1 METHODS
+=over
+
=item get_handle ($language_code)
Returns a locale handle for accessing the other methods. Inherited from
Locale::Maketext.
@@ -21,42 +23,45 @@ Returns the given date after formatting it. If $longformat is set, the date
will be givin in the form of "_('September') 23 2007". If $longformat is not
set, the date will be output in the format specified by $myconfig->{dateformat}.
+=back
+
=head1 Copyright (C) 2006, The LedgerSMB core team.
-#=====================================================================
-#
-# Locale support module for LedgerSMB
-# LedgerSMB::Locale
-#
-# LedgerSMB
-# Small Medium Business Accounting software
-# http://www.ledgersmb.org/
-#
-#
-# Copyright (C) 2006
-# 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.
-#
-# This file contains source code included with or based on SQL-Ledger which
-# is Copyright Dieter Simader and DWS Systems Inc. 2000-2005 and licensed
-# under the GNU General Public License version 2 or, at your option, any later
-# version. For a full list including contact information of contributors,
-# maintainers, and copyright holders, see the CONTRIBUTORS file.
-#
-# Original Copyright Notice from SQL-Ledger 2.6.17 (before the fork):
-# Copyright (C) 2000
-#
-# Author: DWS Systems Inc.
-# Web: http://www.sql-ledger.org
-#
-# Contributors: Thomas Bayen <bayen@gmx.de>
-# Antti Kaihola <akaihola@siba.fi>
-# Moritz Bunkus (tex)
-# Jim Rawlings <jim@your-dba.com> (DB2)
-#
-#======================================================================
+ #====================================================================
+ #
+ # Locale support module for LedgerSMB
+ # LedgerSMB::Locale
+ #
+ # LedgerSMB
+ # Small Medium Business Accounting software
+ # http://www.ledgersmb.org/
+ #
+ #
+ # Copyright (C) 2006
+ # 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.
+ #
+ # This file contains source code included with or based on SQL-Ledger
+ # which is Copyright Dieter Simader and DWS Systems Inc. 2000-2005
+ # and licensed under the GNU General Public License version 2 or, at
+ # your option, any later version. For a full list including contact
+ # information of contributors, maintainers, and copyright holders,
+ # see the CONTRIBUTORS file.
+ #
+ # Original Copyright Notice from SQL-Ledger 2.6.17 (before the fork):
+ # Copyright (C) 2000
+ #
+ # Author: DWS Systems Inc.
+ # Web: http://www.sql-ledger.org
+ #
+ # Contributors: Thomas Bayen <bayen@gmx.de>
+ # Antti Kaihola <akaihola@siba.fi>
+ # Moritz Bunkus (tex)
+ # Jim Rawlings <jim@your-dba.com> (DB2)
+ #
+ #====================================================================
=cut
package LedgerSMB::Locale;
diff --git a/LedgerSMB/Location.pm b/LedgerSMB/Location.pm
index 929e1a6c..fd878774 100644
--- a/LedgerSMB/Location.pm
+++ b/LedgerSMB/Location.pm
@@ -10,24 +10,37 @@ This module creates object instances based on LedgerSMB's in-database ORM.
=head1 METHODS
The following method is static:
+
+=over
+
=item new ($LedgerSMB object);
+=back
+
The following methods are passed through to stored procedures:
+
+=over
+
=item save
+
=item get
+
=item search
+
=item list_all
+
=item delete (via Autoload)
+=back
+
The above list may grow over time, and may depend on other installed modules.
=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.
-=back
-
=cut
package LedgerSMB::Location;
diff --git a/LedgerSMB/Setting.pm b/LedgerSMB/Setting.pm
index 282bfd8e..5ce6ca66 100644
--- a/LedgerSMB/Setting.pm
+++ b/LedgerSMB/Setting.pm
@@ -10,9 +10,17 @@ This module creates object instances based on LedgerSMB's in-database ORM.
=head1 METHODS
The following method is static:
+
+=over
+
=item new ($LedgerSMB object);
+=back
+
The following methods are passed through to stored procedures:
+
+=over
+
=item get ($self->{key})
=item get_default_accounts() (via AUTOLOAD) returns a list of accounts.
@@ -20,20 +28,22 @@ The following methods are passed through to stored procedures:
=item set ($self->{key}, $self->{value})
=item parse_incriment ($self->{key})
+
This function updates a default entry in the database, incrimenting the last
set of digits not including <?lsmb ?> tags or non-digits, and then parses the
returned value, doing tag substitution. The final value is then returned by
the function.
+=back
+
The above list may grow over time, and may depend on other installed modules.
=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.
-=back
-
=cut
package LedgerSMB::Setting;
diff --git a/LedgerSMB/Template.pm b/LedgerSMB/Template.pm
index ce66a0eb..938b8254 100755
--- a/LedgerSMB/Template.pm
+++ b/LedgerSMB/Template.pm
@@ -1,3 +1,4 @@
+
=head1 NAME
LedgerSMB::Template - Template support module for LedgerSMB
@@ -9,13 +10,15 @@ forthcoming.
=head1 METHODS
+=over
+
=item new(user => \%myconfig, template => $string, format => 'HTML', [language => $string,] [include_path => $path]);
- This command instantiates a new template:
- template is the file name of the template to be processed.
- format is the type of format to be used. Currently only HTML is supported
- language (optional) specifies the language for template selection.
- include_path allows one to override the template directory and use this with user interface templates.
+This command instantiates a new template:
+template is the file name of the template to be processed.
+format is the type of format to be used. Currently only HTML is supported
+language (optional) specifies the language for template selection.
+include_path allows one to override the template directory and use this with user interface templates.
=item render($hashref)
@@ -27,9 +30,11 @@ Currently email and server-side printing are not supported.
This command checks for valid langages. Returns 1 if the language is valid,
0 if it is not.
+=back
+
=head1 Copyright 2007, The LedgerSMB Core Team
-This file is licensed under the Gnu General Public License version 2, or at your
+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.
diff --git a/LedgerSMB/Template/HTML.pm b/LedgerSMB/Template/HTML.pm
index 62834f70..9f1ae252 100755
--- a/LedgerSMB/Template/HTML.pm
+++ b/LedgerSMB/Template/HTML.pm
@@ -5,23 +5,28 @@ LedgerSMB::Template::HTML Template support module for LedgerSMB
=head1 METHODS
+=over
+
=item get_template ()
=item preprocess ($vars)
+
This method returns a reference to a hash that contains a copy of the passed
hashref's data with HTML entities converted to escapes.
=item postprocess ()
+=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.
+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
use Error qw(:try);
diff --git a/t/97-pod.t b/t/97-pod.t
new file mode 100644
index 00000000..b194a441
--- /dev/null
+++ b/t/97-pod.t
@@ -0,0 +1,14 @@
+#!/usr/bin/perl
+#
+# t/97-pod.t
+#
+# Checks POD syntax.
+#
+
+use strict;
+use warnings;
+
+use Test::More;
+eval "use Test::Pod 1.00";
+plan skip_all => "Test::Pod 1.00 required for testing POD" if $@;
+all_pod_files_ok('LedgerSMB.pm', all_pod_files('LedgerSMB'));