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

SF.net SVN: ledger-smb:[5474] branches/1.3



Revision: 5474
          http://ledger-smb.svn.sourceforge.net/ledger-smb/?rev=5474&view=rev
Author:   einhverfr
Date:     2013-01-04 10:26:40 +0000 (Fri, 04 Jan 2013)
Log Message:
-----------
Merging fix from trunk: Moving to label/button system to show that partnumbers are not editable on invoices and orders.  Note this has minor workflow breaking changes when Javascript is disabled only.  Javascript has been tested in Chrome and Firefox and should work for other browsers.  The framework changes should also make elinks more usable for these screens as well

Modified Paths:
--------------
    branches/1.3/Changelog
    branches/1.3/bin/io.pl
    branches/1.3/bin/ir.pl
    branches/1.3/bin/is.pl
    branches/1.3/bin/oe.pl
    branches/1.3/old-handler.pl

Property Changed:
----------------
    branches/1.3/


Property changes on: branches/1.3
___________________________________________________________________
Modified: svn:mergeinfo
   - /trunk:3711-3712,5424,5446-5448,5451,5457,5459,5461,5466
   + /trunk:3711-3712,5424,5446-5448,5451,5457,5459,5461,5466,5473

Modified: branches/1.3/Changelog
===================================================================
--- branches/1.3/Changelog	2013-01-04 10:03:20 UTC (rev 5473)
+++ branches/1.3/Changelog	2013-01-04 10:26:40 UTC (rev 5474)
@@ -9,6 +9,7 @@
 * Fixing is_zero errors on ar/ap transaction screens w/tax incldued (Chris T)
 * Fixing csv ar transactions not showing taxes (Chris T, 3589640)
 * Fixing demo quotations having descriptions taking too much space (Chris T)
+* Moved to label/button system for deleting lines on invoices (Chris T)
 
 Changelog for 1.3.27
 * Detect whether ledgersmb.conf exists during Makefile.PL run and create if

Modified: branches/1.3/bin/io.pl
===================================================================
--- branches/1.3/bin/io.pl	2013-01-04 10:03:20 UTC (rev 5473)
+++ branches/1.3/bin/io.pl	2013-01-04 10:26:40 UTC (rev 5474)
@@ -84,6 +84,7 @@
 # $locale->text('Oct')
 # $locale->text('Nov')
 # $locale->text('Dec')
+#
 
 sub _calc_taxes {
     $form->{subtotal} = $form->{invsubtotal};
@@ -339,8 +340,17 @@
 
 $column_data{runningnumber} =
           qq|<td><input name="runningnumber_$i" size=3 value=$i></td>|;
-        $column_data{partnumber} =
+        if ($form->{"partnumber_$i"}){
+           $column_data{partnumber} =
+           qq|<td> $form->{"partnumber_$i"} 
+                 <button type="submit" class="submit" value="$i" 
+                         name="delete_line">X</button>
+                 <input type="hidden" name="partnumber_$i"
+                       value="$form->{"partnumber_$i"}" /></td>|;
+        } else {
+            $column_data{partnumber} =
 qq|<td><input name="partnumber_$i" size=15 value="$form->{"partnumber_$i"}" accesskey="$i" title="[Alt-$i]">$skunumber</td>|;
+        }
         $column_data{qty} =
 qq|<td align=right><input name="qty_$i" title="$form->{"onhand_$i"}" size="5" value="|
           . $form->format_amount( \%myconfig, $form->{"qty_$i"} )

Modified: branches/1.3/bin/ir.pl
===================================================================
--- branches/1.3/bin/ir.pl	2013-01-04 10:03:20 UTC (rev 5473)
+++ branches/1.3/bin/ir.pl	2013-01-04 10:26:40 UTC (rev 5474)
@@ -306,6 +306,7 @@
 
 sub form_header {
 
+    $form->{nextsub} = 'update';
 
     # set option selected
     for (qw(AP currency)) {
@@ -408,6 +409,14 @@
     print qq|
 <body onLoad="document.forms[0].${focus}.focus()" />
 | . $form->open_status_div . qq|
+<script> 
+function on_return_submit(){
+    if (window.event.keyCode == 13){
+        document.forms[0].submit()
+    }
+}
+</script>
+<form method=post action="$form->{script}" onkeypress="on_return_submit()">
 
 <form method=post action="$form->{script}">
 |;
@@ -415,9 +424,11 @@
          print qq|$form->{notice}<br/>|;
     }
     $form->{vc} = "vendor";
+    $form->{nextsub} = 'update';
     $form->hide_form(
         qw(id title vc type terms creditlimit creditremaining closedto locked 
-           shipped oldtransdate recurring reverse batch_id subtype form_id)
+           shipped oldtransdate recurring reverse batch_id subtype form_id
+           nextsub)
     );
 
     print qq|
@@ -1055,6 +1066,7 @@
     if ( $form->{import_text} ) {
         &import_text;
     }
+    delete $form->{"partnumber_$form->{delete_line}"} if $form->{delete_line};
     $form->{exchangerate} =
       $form->parse_amount( \%myconfig, $form->{exchangerate} );
 

Modified: branches/1.3/bin/is.pl
===================================================================
--- branches/1.3/bin/is.pl	2013-01-04 10:03:20 UTC (rev 5473)
+++ branches/1.3/bin/is.pl	2013-01-04 10:26:40 UTC (rev 5474)
@@ -338,6 +338,7 @@
 }
 
 sub form_header {
+    $form->{nextsub} = 'update';
 
     # set option selected
     for (qw(AR currency)) {
@@ -444,15 +445,21 @@
     print qq|
 <body onLoad="document.forms[0].${focus}.focus()" /> 
 | . $form->open_status_div . qq|
-
-<form method=post action="$form->{script}">
+<script> 
+function on_return_submit(){
+    if (window.event.keyCode == 13){
+        document.forms[0].submit()
+    }
+}
+</script>
+<form method=post action="$form->{script}" onkeypress="on_return_submit()">
 |;
 
     $form->hide_form(
         qw(form_id id type printed emailed queued title vc terms discount 
            creditlimit creditremaining tradediscount business closedto locked 
            shipped oldtransdate recurring reverse batch_id subtype 
-           meta_number)
+           meta_number nextsub)
     );
 
     if ($form->{notice}){
@@ -1096,6 +1103,8 @@
 
 sub update {
     on_update();#TODO meaning ?
+    delete $form->{"partnumber_$form->{delete_line}"} if $form->{delete_line};
+
     $form->{taxes} = {};
     $form->{exchangerate} =
       $form->parse_amount( \%myconfig, $form->{exchangerate} );

Modified: branches/1.3/bin/oe.pl
===================================================================
--- branches/1.3/bin/oe.pl	2013-01-04 10:03:20 UTC (rev 5473)
+++ branches/1.3/bin/oe.pl	2013-01-04 10:26:40 UTC (rev 5474)
@@ -332,7 +332,7 @@
 
 sub form_header {
 
-
+    $form->{nextsub} = 'update';
    
     $checkedopen   = ( $form->{closed} ) ? ""        : "checked";
     $checkedclosed = ( $form->{closed} ) ? "checked" : "";
@@ -583,6 +583,14 @@
     print qq|
 <body onLoad="document.forms[0].${focus}.focus()" />
 | . $form->open_status_div . qq|
+<script> 
+function on_return_submit(){
+    if (window.event.keyCode == 13){
+        document.forms[0].submit()
+    }
+}
+</script>
+<form method=post action="$form->{script}" onkeypress="on_return_submit()">
 
 <form method=post action="$form->{script}">
 |;
@@ -592,7 +600,7 @@
     }
     $form->hide_form(qw(entity_control_code meta_number));
     $form->hide_form(
-        qw(id type formname media format printed emailed queued vc title discount creditlimit creditremaining tradediscount business recurring form_id)
+        qw(id type formname media format printed emailed queued vc title discount creditlimit creditremaining tradediscount business recurring form_id nextsub)
     );
 
     print qq|
@@ -967,7 +975,9 @@
 }
 
 sub update {
+    $form->{nextsub} = 'update';
 
+    delete $form->{"partnumber_$form->{delete_line}"} if $form->{delete_line};
     if ( $form->{type} eq 'generate_purchase_order' ) {
 
         for ( 1 .. $form->{rowcount} ) {

Modified: branches/1.3/old-handler.pl
===================================================================
--- branches/1.3/old-handler.pl	2013-01-04 10:03:20 UTC (rev 5473)
+++ branches/1.3/old-handler.pl	2013-01-04 10:26:40 UTC (rev 5474)
@@ -89,6 +89,7 @@
 $locale = LedgerSMB::Locale->get_handle( ${LedgerSMB::Sysconfig::language} )
   or $form->error( __FILE__ . ':' . __LINE__ . ": Locale not loaded: $!\n" );
 
+$form->{action} = $form->{nextsub} if (!$form->{action} and $form->{nextsub});
 
 # we use $script for the language module
 $form->{script} = $script;

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