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

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



Revision: 6156
          http://sourceforge.net/p/ledger-smb/code/6156
Author:   einhverfr
Date:     2013-10-23 08:17:18 +0000 (Wed, 23 Oct 2013)
Log Message:
-----------
saving now works except that accept_input seems hardwired to true.

Modified Paths:
--------------
    trunk/LedgerSMB/Scripts/configuration.pm
    trunk/LedgerSMB/Setting/Sequence.pm
    trunk/UI/Configuration/sequence.html
    trunk/sql/modules/Settings.sql

Modified: trunk/LedgerSMB/Scripts/configuration.pm
===================================================================
--- trunk/LedgerSMB/Scripts/configuration.pm	2013-10-23 06:58:56 UTC (rev 6155)
+++ trunk/LedgerSMB/Scripts/configuration.pm	2013-10-23 08:17:18 UTC (rev 6156)
@@ -310,9 +310,9 @@
 sub save_sequences {
     my ($request) = @_;
     for my $count (1 .. $request->{count}){
-        if ($request->{"sequence_$count"}){
+        if ($request->{"save_$count"}){
            my %shash;
-           for my $key (qw()){
+           for my $key (qw(accept_input setting_key label prefix sequence suffix)){
               $shash{$key} = $request->{"${key}_$count"};
            }
            my $sequence = LedgerSMB::Setting::Sequence->new(%shash);

Modified: trunk/LedgerSMB/Setting/Sequence.pm
===================================================================
--- trunk/LedgerSMB/Setting/Sequence.pm	2013-10-23 06:58:56 UTC (rev 6155)
+++ trunk/LedgerSMB/Setting/Sequence.pm	2013-10-23 08:17:18 UTC (rev 6156)
@@ -78,6 +78,14 @@
 
 has suffix => (is => 'rw', isa => 'Str', required => 0);
 
+=head2 allow_input
+
+If true (the default) then allow user-entered sequence fields.
+
+=cut
+
+has allow_input => (is => 'rw', isa => 'Bool', required => 0);
+
 =head1 METHODS
 
 =head2 get(label, setting_key)
@@ -124,7 +132,7 @@
        @setting_list = __PACKAGE__->call_procedure(procname => 'sequence__list');
     }
     for my $s (@setting_list){
-       $s = $self->new(%$s);
+       $s = __PACKAGE__->new(%$s);
     }
     return @setting_list;
 }

Modified: trunk/UI/Configuration/sequence.html
===================================================================
--- trunk/UI/Configuration/sequence.html	2013-10-23 06:58:56 UTC (rev 6155)
+++ trunk/UI/Configuration/sequence.html	2013-10-23 08:17:18 UTC (rev 6156)
@@ -19,19 +19,23 @@
 <tr>
  <td><?lsmb PROCESS input element_data = {
            type = 'checkbox'
-           name = 'sequence_' _ count
+           name = 'save_' _ count
           value = 1
      } ?></td>
  <td><?lsmb 
      checked = 0;
-     IF seq.allow_input; checked = 'CHECKED'; ELSE; checked = '0'; END;
+     IF seq.accept_input; checked = 'CHECKED'; ELSE; checked = '0'; END;
      PROCESS input element_data = {
            type = 'checkbox'
-           name = 'allow_input_' _ count
+           name = 'accept_input_' _ count
           value = 1
         checked = checked
      } ?></td>
- <td><?lsmb seq.label ?></td>
+ <td><?lsmb seq.label; PROCESS input element_data = {
+           type = 'hidden'
+           name = 'label_' _ count
+          value = seq.label
+     } ?></td>
  <td><?lsmb PROCESS select element_data = {
              name = 'setting_key_' _ count
           options = setting_keys
@@ -62,13 +66,13 @@
 <tr>
  <td><?lsmb PROCESS input element_data = {
            type = 'checkbox'
-           name = 'sequence_' _ count + 1
+           name = 'save_' _ count 
           value = 1
      } ?></td>
  <td><?lsmb 
      PROCESS input element_data = {
            type = 'checkbox'
-           name = 'allow_input_' _ count 
+           name = 'accept_input' _ count 
           value = 1
      } ?></td>
  <td><?lsmb PROCESS input element_data = {
@@ -100,10 +104,15 @@
      } ?></td>
 </tr>
 </table>
+<?lsmb PROCESS input element_data = {
+             name = 'count'
+             type = 'hidden'
+            value = count
+} ?>
 </div class="button-row">
 <?lsmb PROCESS button element_data = {
              name = 'action'
-            value = 'save'
+            value = 'save_sequences'
              type = 'submit'
             class = 'submit'
              text = text('Save')

Modified: trunk/sql/modules/Settings.sql
===================================================================
--- trunk/sql/modules/Settings.sql	2013-10-23 06:58:56 UTC (rev 6155)
+++ trunk/sql/modules/Settings.sql	2013-10-23 08:17:18 UTC (rev 6156)
@@ -178,7 +178,7 @@
        suffix = coalesce(in_suffix, ''),
        sequence = coalesce(in_sequence, '1'),
        setting_key = in_setting_key,
-       accept_input = in_accept_input
+       accept_input = coalesce(in_accept_input, true)
  WHERE label = in_label;
 
 IF FOUND THEN 
@@ -188,11 +188,11 @@
 
 INSERT INTO lsmb_sequence(label, setting_key, prefix, suffix, sequence, 
                           accept_input)
-VALUES (in_label, in_setting_ley, 
-        coalesce(prefix, ''), 
-        coalesce(suffix, ''), 
-        coalesce(sequence, '1'),
-        in_accept_input
+VALUES (in_label, in_setting_key, 
+        coalesce(in_prefix, ''), 
+        coalesce(in_suffix, ''), 
+        coalesce(in_sequence, '1'),
+        coalesce(in_accept_input, false)
 );
 
 retval := sequence__get(in_label);

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