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

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



Revision: 5920
          http://sourceforge.net/p/ledger-smb/code/5920
Author:   einhverfr
Date:     2013-07-24 08:32:40 +0000 (Wed, 24 Jul 2013)
Log Message:
-----------
correcting locked description handling, since disabled controls are not submitted on form send, also ensured it affects order/quote entry as well, to be merged with 1.3

Modified Paths:
--------------
    trunk/LedgerSMB/OE.pm
    trunk/bin/io.pl
    trunk/bin/oe.pl

Modified: trunk/LedgerSMB/OE.pm
===================================================================
--- trunk/LedgerSMB/OE.pm	2013-07-24 08:11:04 UTC (rev 5919)
+++ trunk/LedgerSMB/OE.pm	2013-07-24 08:32:40 UTC (rev 5920)
@@ -616,6 +616,12 @@
 		SELECT value, current_date FROM defaults
 		 WHERE setting_key = 'curr'|;
     ( $form->{currencies}, $form->{transdate} ) = $dbh->selectrow_array($query);
+    
+    $query = qq|
+		SELECT value FROM defaults
+		 WHERE setting_key = 'lock_description'|;
+    ( $form->{lock_description}) = $dbh->selectrow_array($query);
+    
 
     if ( $form->{id} ) {
 

Modified: trunk/bin/io.pl
===================================================================
--- trunk/bin/io.pl	2013-07-24 08:11:04 UTC (rev 5919)
+++ trunk/bin/io.pl	2013-07-24 08:32:40 UTC (rev 5920)
@@ -326,20 +326,23 @@
         $linetotal = $form->round_amount( $linetotal * $form->{"qty_$i"}, 
                                          $moneyplaces);
 
-        if (
-            ( $rows = $form->numtextrows( $form->{"description_$i"}, 46, 6 ) ) >
-            1 )
-        {
-            $form->{"description_$i"} =
-              $form->quote( $form->{"description_$i"} );
-            $column_data{description} =
-qq|<td><textarea name="description_$i" rows=$rows $desc_disabled cols=46 wrap=soft>$form->{"description_$i"}</textarea></td>|;
-        }
-        else {
-            $form->{"description_$i"} =
-              $form->quote( $form->{"description_$i"} );
-            $column_data{description} =
+        $form->{"description_$i"} = $form->quote( $form->{"description_$i"} );
+        if ($desc_disabled){
+            $column_data{description} = qq|<td>$form->{"description_$i"} |
+             . qq|<input type="hidden" name="description_$i"
+                        value="$form->{"description_$i"}" /></td>|
+        } else {
+            if (
+                ( $rows = $form->numtextrows( $form->{"description_$i"}, 46, 6 ) ) >
+                1 )
+            {
+                    $column_data{description} =
+qq|<td><textarea name="description_$i" rows=$rows cols=46 wrap=soft>$form->{"description_$i"}</textarea></td>|;
+            }
+            else {
+                 $column_data{description} =
 qq|<td><input name="description_$i" $desc_disabled size=48 value="$form->{"description_$i"}"></td>|;
+            }
         }
 
         for (qw(partnumber sku unit)) {

Modified: trunk/bin/oe.pl
===================================================================
--- trunk/bin/oe.pl	2013-07-24 08:11:04 UTC (rev 5919)
+++ trunk/bin/oe.pl	2013-07-24 08:32:40 UTC (rev 5920)
@@ -617,7 +617,8 @@
     }
     $form->hide_form(qw(entity_control_code meta_number address city));
     $form->hide_form(
-        qw(id type formname media format printed emailed queued vc title discount creditlimit creditremaining tradediscount business recurring form_id nextsub)
+        qw(id type formname media format printed emailed queued vc title discount creditlimit creditremaining tradediscount business recurring form_id nextsub
+   lock_description)
     );
 
     print qq|

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