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

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



Revision: 4927
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=4927&view=rev
Author:   einhverfr
Date:     2012-06-20 08:29:44 +0000 (Wed, 20 Jun 2012)
Log Message:
-----------

Adding framework for per-country employee forms

Modified Paths:
--------------
    trunk/LedgerSMB/Scripts/employee.pm

Added Paths:
-----------
    trunk/LedgerSMB/Scripts/employee/
    trunk/LedgerSMB/Scripts/employee/country.pm
    trunk/UI/Contact/divs/country_us_w4.html

Added: trunk/LedgerSMB/Scripts/employee/country.pm
===================================================================
--- trunk/LedgerSMB/Scripts/employee/country.pm	                        (rev 0)
+++ trunk/LedgerSMB/Scripts/employee/country.pm	2012-06-20 08:29:44 UTC (rev 4927)
@@ -0,0 +1,43 @@
+=head1 NAME
+
+LedgerSMB::Scripts::employee::country - Country info for employee management
+
+=head1 SYNOPSYS
+
+none really.  This just allows viewing of certain info,
+
+=head1 VARIABLES
+
+=over
+
+=item country_divs
+
+This is a hashref where country_id => arrayref of hashrefs, where that hashref 
+has the following keys:
+
+=over
+
+=item div_title
+
+=item file
+
+=item save_sproc
+
+=back
+
+=cut
+
+our %country_divs = (
+
+       "232" => [ { div_title => 'W4', # UNITED STATES
+                         file => 'country_us_w4',
+                   save_sproc => 'employee_us__save_w4' }]
+}
+
+=back
+
+=head1 COPYRIGHT
+
+=cut
+
+1;

Modified: trunk/LedgerSMB/Scripts/employee.pm
===================================================================
--- trunk/LedgerSMB/Scripts/employee.pm	2012-06-20 06:44:03 UTC (rev 4926)
+++ trunk/LedgerSMB/Scripts/employee.pm	2012-06-20 08:29:44 UTC (rev 4927)
@@ -26,6 +26,7 @@
 use LedgerSMB::DBObject::Entity::User;
 use LedgerSMB::App_State;
 use LedgerSMB::Template;
+use LedgerSMB::Scripts::employee::country;
 
 use strict;
 use warnings;
@@ -105,6 +106,16 @@
                notes => $locale->text('Notes'),
     );
 
+    if ($LedgerSMB::Scripts::employee::country::country_divs{
+            $employee->{country_id}
+    }){
+        for my $cform (@{$LedgerSMB::Scripts::employee::country::country_divs{
+            $employee->{country_id}
+         }}){
+             push @DIVS, $cform->{file};
+             $DIV_LABEL{$cform->{file}} = $cform->{div_title};
+         }
+
     # DIVS contents
     my $entity_id = $employee->{entity_id};
 

Added: trunk/UI/Contact/divs/country_us_w4.html
===================================================================
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.