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

SF.net SVN: ledger-smb:[6710] trunk/LedgerSMB



Revision: 6710
          http://sourceforge.net/p/ledger-smb/code/6710
Author:   einhverfr
Date:     2014-01-30 10:14:44 +0000 (Thu, 30 Jan 2014)
Log Message:
-----------
using new requires syntax to designate required fields.

Modified Paths:
--------------
    trunk/LedgerSMB/Request.pm
    trunk/LedgerSMB/Scripts/setup.pm

Modified: trunk/LedgerSMB/Request.pm
===================================================================
--- trunk/LedgerSMB/Request.pm	2014-01-30 07:59:14 UTC (rev 6709)
+++ trunk/LedgerSMB/Request.pm	2014-01-30 10:14:44 UTC (rev 6710)
@@ -48,7 +48,7 @@
 sub requires {
     my $self = shift @_;
     for (@_){
-        die "Required attribute not provided: %1", $_ 
+        Carp::croak(LedgerSMB::App_State->Locale->text("Required attribute not provided: [_1]", $_))
               unless $self->{$_} or $self->{$_} eq '0';
     }
 }

Modified: trunk/LedgerSMB/Scripts/setup.pm
===================================================================
--- trunk/LedgerSMB/Scripts/setup.pm	2014-01-30 07:59:14 UTC (rev 6709)
+++ trunk/LedgerSMB/Scripts/setup.pm	2014-01-30 10:14:44 UTC (rev 6710)
@@ -821,6 +821,7 @@
 
 sub save_user {
     my ($request) = @_;
+    $request->requires(qw(first_name last_name ssn employeenumber));
     $request->{entity_class} = 3;
     $request->{name} = "$request->{last_name}, $request->{first_name}";
     use LedgerSMB::Entity::Person::Employee;

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


------------------------------------------------------------------------------
WatchGuard Dimension instantly turns raw network data into actionable 
security intelligence. It gives you real-time visual feedback on key
security issues and trends.  Skip the complicated setup - simply import
a virtual appliance and go from zero to informed in seconds.
http://pubads.g.doubleclick.net/gampad/clk?id=123612991&iu=/4140/ostg.clktrk
_______________________________________________
Ledger-smb-commits mailing list
..hidden..
https://lists.sourceforge.net/lists/listinfo/ledger-smb-commits