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

SF.net SVN: ledger-smb:[6151] trunk/LedgerSMB/Scripts/configuration.pm



Revision: 6151
          http://sourceforge.net/p/ledger-smb/code/6151
Author:   einhverfr
Date:     2013-10-22 14:56:36 +0000 (Tue, 22 Oct 2013)
Log Message:
-----------
Sequence screen workflows

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

Modified: trunk/LedgerSMB/Scripts/configuration.pm
===================================================================
--- trunk/LedgerSMB/Scripts/configuration.pm	2013-10-22 14:42:45 UTC (rev 6150)
+++ trunk/LedgerSMB/Scripts/configuration.pm	2013-10-22 14:56:36 UTC (rev 6151)
@@ -9,6 +9,7 @@
 =cut
 package LedgerSMB::Scripts::configuration;
 use LedgerSMB::Setting;
+use LedgerSMB::Setting::Sequence;
 use LedgerSMB::AM; # To be removed, only for template directories right now
 use strict;
 use warnings;
@@ -239,6 +240,22 @@
     });
 }
 
+=item sequence_screen
+
+No inputs expected or used
+
+=cut
+
+sub sequence_screen {
+    my ($request) = @_;
+    @{$request->{sequence_list}} = LedgerSMB::Setting::Sequence->list();
+    LedgerSMB::Template->new_UI(
+        user => $LedgerSMB::App_State::User, 
+        locale => $locale,
+        template => 'Configuration/sequences')->render($request);
+      
+}
+
 =item save_defaults
 
 Saves settings from the defaults screen
@@ -286,6 +303,21 @@
     return ..hidden..;
 }
 
+sub save_sequences {
+    my ($request) = @_;
+    for my $count (1 .. $request->{count}){
+        if ($request->{"sequence_$count"}){
+           my %shash;
+           for my $key (qw()){
+              $shash{$key} = $request->{"${key}_$count"};
+           }
+           my $sequence = LedgerSMB::Setting::Sequence->new(%shash);
+           $sequence->save;
+        }
+    }
+    sequence_screen($request);
+}
+
 =back
 
 =head1 COPYRIGHT

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


------------------------------------------------------------------------------
October Webinars: Code for Performance
Free Intel webinars can help you accelerate application performance.
Explore tips for MPI, OpenMP, advanced profiling, and more. Get the most from 
the latest Intel processors and coprocessors. See abstracts and register >
http://pubads.g.doubleclick.net/gampad/clk?id=60135991&iu=/4140/ostg.clktrk
_______________________________________________
Ledger-smb-commits mailing list
..hidden..
https://lists.sourceforge.net/lists/listinfo/ledger-smb-commits