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

SF.net SVN: ledger-smb:[3605] trunk/scripts



Revision: 3605
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=3605&view=rev
Author:   einhverfr
Date:     2011-07-30 19:44:09 +0000 (Sat, 30 Jul 2011)

Log Message:
-----------
Doc strings for employee.pl and user.pl

Modified Paths:
--------------
    trunk/scripts/employee.pl
    trunk/scripts/user.pl

Modified: trunk/scripts/employee.pl
===================================================================
--- trunk/scripts/employee.pl	2011-07-30 19:21:47 UTC (rev 3604)
+++ trunk/scripts/employee.pl	2011-07-30 19:44:09 UTC (rev 3605)
@@ -16,6 +16,8 @@
 
 =head1 METHODS
 
+=over 
+
 =cut
 
 package LedgerSMB::Scripts::employee;
@@ -25,10 +27,6 @@
 
 #require 'lsmb-request.pl';
 
-=pod
-
-=over
-
 =item get($self, $request, $user)
 
 Requires form var: id
@@ -37,8 +35,6 @@
 point of uniqueness. Shows (appropriate to user privileges) and allows editing
 of the employee informations.
 
-=back
-
 =cut
 
 
@@ -60,7 +56,13 @@
         
 }
 
+=item add_location
 
+Adds a location to an employee and returns to the edit employee screen.
+Standard location inputs apply.
+
+=cut
+
 sub add_location {
     my ($request) = @_;
     my $employee= LedgerSMB::DBObject::Employee->new({base => $request, copy => 'all'});
@@ -74,16 +76,10 @@
 	
 }
 
-=pod
-
-=over
-
 =item add
 
 This method creates a blank screen for entering a employee's information.
 
-=back
-
 =cut 
 
 sub add {
@@ -94,20 +90,20 @@
     _render_main_screen($employee);
 }
 
-=pod
-
-=over
-
 =item delete_contact
 
 Deletes the selected contact info record
 
 Must include company_id or credit_id (credit_id used if both are provided) plus:
 
-* contact_class_id
-* contact
-* form_id
+=over
 
+=item contact_class_id
+
+=item contact
+
+=item form_id
+
 =back
 
 =cut
@@ -122,10 +118,6 @@
     _render_main_screen( $employee);
 }
 
-=pod
-
-=over
-
 =item delete_location
 
 Deletes the selected contact info record
@@ -136,8 +128,6 @@
 * location_id 
 * form_id
 
-=back
-
 =cut
 
 sub delete_location {
@@ -150,19 +140,20 @@
     _render_main_screen( $employee);
 }
 
-=pod
-
-=over
-
 =item edit_bank_account($request)
 
 displays screen to a bank account
 
 Required data:
-bank_account_id
-bic
-iban
 
+=over 
+
+=item bank_account_id
+
+=item bic
+
+=item iban
+
 =back
 
 =cut
@@ -174,19 +165,20 @@
     _render_main_screen( $employee);
 }
 
-=pod
-
-=over
-
 =item delete_bank_acct
 
 Deletes the selected bank account record
 
 Required request variables:
-* bank_account_id
-* entity_id
-* form_id
 
+=over
+
+=item bank_account_id
+
+=item entity_id
+
+=item form_id
+
 =back
 
 =cut
@@ -211,64 +203,12 @@
     }
     return 1;
 }
-=pod
 
-=over
-
-=item search($self, $request, $user)
-
-Requires form var: search_pattern
-
-Directly calls the database function search, and returns a set of all employees
-found that match the search parameters. Search parameters search over address 
-as well as employee/Company name.
-
-=back
-
-=cut
-
-sub search {
-    my ($request) = @_;
-    
-    if ($request->type() eq 'POST') {
-        # assume it's asking us to do the search, now
-        
-        my $employee = LedgerSMB::DBObject::Employee->new(base => $request, copy => 'all');
-        $employee->set(entity_class=>3);
-        my $results = $employee->search($employee->{search_pattern});
-
-        my $template = LedgerSMB::Template->new( user => $user, 
-    	template => 'Contact/employee', language => $user->{language}, 
-            format => 'HTML');
-        $template->render($results);
-        
-    }
-    else {
-        
-        # grab the happy search page out.
-        
-        my $template = LedgerSMB::Template->new( 
-		user => $user,
-		path => 'UI/Contact' ,
-    		template => 'employee_search', 
-		locale => $request->{_locale}, 
-		format => 'HTML');
-            
-        $template->render();
-    }
-}
-
-=pod
-
-=over
-
 =item save($self, $request, $user)
 
 Saves a employee to the database. The function will update or insert a new 
 employee as needed, and will generate a new Company ID for the employee if needed.
 
-=back
-
 =cut
 
 sub save {
@@ -287,6 +227,12 @@
     _render_main_screen($employee);
 }
 
+=item search
+
+Displays the search criteria screen
+
+=cut
+
 sub search {
     my $request = shift @_;
     my $template = LedgerSMB::Template->new(
@@ -299,6 +245,12 @@
     $template->render($request);
 }
 
+=item search_results
+
+Displays search results.
+
+=cut
+
 sub search_results {
     my $request = shift @_;
     my $employee = LedgerSMB::DBObject::Employee->new({base => $request});
@@ -361,6 +313,12 @@
     });
 }
 
+=item edit
+
+displays the edit employee screen. Requires id field to be set.
+
+=cut
+
 sub edit{
     my $request = shift @_;
     my $employee = LedgerSMB::DBObject::Employee->new({base => $request});
@@ -389,6 +347,12 @@
     $template->render($employee);
 }
 
+=item save_contact
+
+Saves contact info and returns to edit employee screen
+
+=cut
+
 sub save_contact {
     my ($request) = @_;
     my $employee = LedgerSMB::DBObject::Employee->new({base => $request});
@@ -397,6 +361,13 @@
     _render_main_screen($employee );
 }
 
+=item save_bank_account
+
+Saves bank account information (bic, iban, id required) and returns to the 
+edit employee screen
+
+=cut
+
 sub save_bank_account {
     my ($request) = @_;
     my $employee = LedgerSMB::DBObject::Employee->new({base => $request});
@@ -405,6 +376,13 @@
     _render_main_screen($employee);
 }
 
+=item save_notes
+
+Attaches note (subject, note, id required) and returns to the edit employee
+screen.
+
+=cut
+
 sub save_notes {
     my ($request) = @_;
     my $employee = LedgerSMB::DBObject::Employee->new({base => $request});
@@ -414,4 +392,16 @@
 }
     
 eval { do "scripts/custom/employee.pl"};
+
+=back
+
+=head1 COPYRIGHT
+
+Copyright (C) 2009 LedgerSMB Core Team.  This file is licensed under the GNU 
+General Public License version 2, or at your option any later version.  Please
+see the included License.txt for details.
+
+=cut
+
+
 1;

Modified: trunk/scripts/user.pl
===================================================================
--- trunk/scripts/user.pl	2011-07-30 19:21:47 UTC (rev 3604)
+++ trunk/scripts/user.pl	2011-07-30 19:44:09 UTC (rev 3605)
@@ -1,11 +1,28 @@
-#=====================================================================
-# LedgerSMB
-# Small Medium Business Accounting software
-# http://www.ledgersmb.org/
-#
-#
-# Copyright (C) 2006
+=pod
 
+=head1 NAME
+
+LedgerSMB::Scripts::user
+
+=head1 SYNPOSIS
+
+User preferences and password setting routines for LedgerSMB.  These are all
+accessible to all users and do not perform administrative functions.
+
+=head1 DIFFERENCES FROM ADMIN MODULE
+
+Although there is some overlap between this module and that of the admin module,
+particularly regarding the setting of passwords, there are subtle differences as
+well.  Most notably an administrative password reset is valid by default for
+only one day, while the duration of a user password change is fully configurable
+and defaults to indefinite validity.
+
+=head1 METHODS
+
+=over
+
+=cut
+package LedgerSMB::Scripts::user;
 use LedgerSMB;
 use LedgerSMB::Template;
 use LedgerSMB::DBObject::User;
@@ -14,8 +31,12 @@
 
 my $slash = "::";
 
-package LedgerSMB::Scripts::user;
+=item preferences_screen
 
+Displays the preferences screen.  No inputs needed.
+
+=cut
+
 sub preference_screen {
     my ($request) = @_;
     my $user = LedgerSMB::DBObject::User->new({base => $request});
@@ -40,6 +61,13 @@
     $template->render($user);
 }
 
+=item save_preferences
+
+Saves preferences from inputs on preferences screen and returns to the same
+screen.
+
+=cut
+
 sub save_preferences {
     my ($request) = @_;
     my $user = LedgerSMB::DBObject::User->new({base => $request});
@@ -51,6 +79,13 @@
     preference_screen($user);
 }
 
+=item change_password
+
+Changes the password, leaves other preferences in place, and returns to the
+preferences screen
+
+=cut
+
 sub change_password {
     my ($request) = @_;
     my $user = LedgerSMB::DBObject::User->new({base => $request});
@@ -60,3 +95,15 @@
     }
     preference_screen($user);
 }
+
+=back
+
+=head1 COPYRIGHT
+
+Copyright (C) 2009 LedgerSMB Core Team.  This file is licensed under the GNU 
+General Public License version 2, or at your option any later version.  Please
+see the included License.txt for details.
+
+=cut
+
+


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