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

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



Revision: 5502
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=5502&view=rev
Author:   einhverfr
Date:     2013-01-07 09:26:43 +0000 (Mon, 07 Jan 2013)
Log Message:
-----------
Employee save now works

Modified Paths:
--------------
    trunk/LedgerSMB/Scripts/employee.pm
    trunk/UI/Contact/divs/employee.html

Modified: trunk/LedgerSMB/Scripts/employee.pm
===================================================================
--- trunk/LedgerSMB/Scripts/employee.pm	2013-01-06 07:27:50 UTC (rev 5501)
+++ trunk/LedgerSMB/Scripts/employee.pm	2013-01-07 09:26:43 UTC (rev 5502)
@@ -289,10 +289,9 @@
 
 sub save_employee {
     my ($request) = @_;
-    for my $key (qw(start_date end_date dob)){
-         $request->{$key} = LedgerSMB::PGDate->from_input($request->{$key});
-    }
+    $request->{entity_class} = 3;
     $request->{control_code} = $request->{employeenumber};
+    $request->{name} = "$request->{last_name}, $request->{first_name}";
     my $employee = LedgerSMB::Entity::Person::Employee->new(%$request);
     $request->{target_div} = 'credit_div';
     $employee->save;

Modified: trunk/UI/Contact/divs/employee.html
===================================================================
--- trunk/UI/Contact/divs/employee.html	2013-01-06 07:27:50 UTC (rev 5501)
+++ trunk/UI/Contact/divs/employee.html	2013-01-07 09:26:43 UTC (rev 5502)
@@ -16,6 +16,20 @@
                 name = "entity_id"
                value = entity_id
 } ?>	
+<div class="input_line">
+<div class="input_group g1">
+     <?lsmb 
+        PROCESS select element_data = {
+                  label = text('Salutation')
+                   name = 'salutation_id'
+         default_values = [employee.salutation_id]
+                options = salutations
+                  class = 'salutations'
+              text_attr = 'salutation'
+             value_attr = 'id'
+    } ?>
+</div>
+</div>
 <div class="input_line" id="person_name_div"><?lsmb #text('Name:')?>&nbsp;
 <div class="input_group g1">
 <!-- TODO:  Add Saluatation -->

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