Author: jleroux
Date: Wed Dec 21 21:14:26 2011
New Revision: 1221889

URL: http://svn.apache.org/viewvc?rev=1221889&view=rev
Log:
A modified patch from Leon "Help screen/navigation do not take into account 
content expiration" https://issues.apache.org/jira/browse/OFBIZ-4626

To enable a disabled html element, there're only two ways, remove "disabled" 
attribute or use javascript to set disable property to false. The patch updates 
trivial to enable submit button in ListInvoices.ftl and batchPayments.ftl. btw, 
it's not w2c compliance to set disabled attribute to other value than 
'disabled'.

jleroux: Actually W3C does not define any value for disabled 
http://www.w3.org/TR/html4/interact/forms.html#adef-disabled and its value in 
javascript is a boolean so we should rather use true instead of 'disabled' (we 
could also use false instead of remove it seems, but anyway...)

So more files need to be changed, though they all use ".removeAttr('disabled')"

Modified:
    
ofbiz/trunk/applications/accounting/webapp/accounting/finaccounttrans/FinAccountTrans.ftl
    
ofbiz/trunk/applications/accounting/webapp/accounting/payment/depositWithdrawPayments.ftl
    ofbiz/trunk/applications/accounting/webapp/ap/invoices/CommissionRun.ftl
    ofbiz/trunk/applications/accounting/webapp/ap/invoices/PurchaseInvoices.ftl
    ofbiz/trunk/applications/accounting/webapp/ar/invoice/ListInvoices.ftl
    ofbiz/trunk/applications/accounting/webapp/ar/payment/batchPayments.ftl

Modified: 
ofbiz/trunk/applications/accounting/webapp/accounting/finaccounttrans/FinAccountTrans.ftl
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/accounting/finaccounttrans/FinAccountTrans.ftl?rev=1221889&r1=1221888&r2=1221889&view=diff
==============================================================================
--- 
ofbiz/trunk/applications/accounting/webapp/accounting/finaccounttrans/FinAccountTrans.ftl
 (original)
+++ 
ofbiz/trunk/applications/accounting/webapp/accounting/finaccounttrans/FinAccountTrans.ftl
 Wed Dec 21 21:14:26 2011
@@ -74,7 +74,7 @@ function getFinAccountTransRunningTotalA
             jQuery('#endingBalance').html(jQuery('#endingBalanceInput').val());
 
         }
-        jQuery('#submitButton').attr('disabled', 'disabled');
+        jQuery('#submitButton').attr('disabled', true);
     }
 }
 </script>

Modified: 
ofbiz/trunk/applications/accounting/webapp/accounting/payment/depositWithdrawPayments.ftl
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/accounting/payment/depositWithdrawPayments.ftl?rev=1221889&r1=1221888&r2=1221889&view=diff
==============================================================================
--- 
ofbiz/trunk/applications/accounting/webapp/accounting/payment/depositWithdrawPayments.ftl
 (original)
+++ 
ofbiz/trunk/applications/accounting/webapp/accounting/payment/depositWithdrawPayments.ftl
 Wed Dec 21 21:14:26 2011
@@ -63,7 +63,7 @@ function getPaymentRunningTotal() {
         });
     } else {
         jQuery('#showPaymentRunningTotal').html("");
-        jQuery('#submitButton').attr('disabled', 'disabled');
+        jQuery('#submitButton').attr('disabled', true);
     }
 }
 

Modified: 
ofbiz/trunk/applications/accounting/webapp/ap/invoices/CommissionRun.ftl
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/ap/invoices/CommissionRun.ftl?rev=1221889&r1=1221888&r2=1221889&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/webapp/ap/invoices/CommissionRun.ftl 
(original)
+++ ofbiz/trunk/applications/accounting/webapp/ap/invoices/CommissionRun.ftl 
Wed Dec 21 21:14:26 2011
@@ -68,7 +68,7 @@ function enableSubmitButton() {
     if (!isSingle && jQuery('#serviceName').val() != "") {
         jQuery('#submitButton').removeAttr("disabled"); 
     } else {
-        jQuery('#submitButton').attr('disabled', 'disabled');
+        jQuery('#submitButton').attr('disabled', true);
     }
 }
 

Modified: 
ofbiz/trunk/applications/accounting/webapp/ap/invoices/PurchaseInvoices.ftl
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/ap/invoices/PurchaseInvoices.ftl?rev=1221889&r1=1221888&r2=1221889&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/webapp/ap/invoices/PurchaseInvoices.ftl 
(original)
+++ ofbiz/trunk/applications/accounting/webapp/ap/invoices/PurchaseInvoices.ftl 
Wed Dec 21 21:14:26 2011
@@ -71,7 +71,7 @@ function getInvoiceRunningTotal() {
         }
 
     } else {
-        jQuery('#submitButton').attr('disabled', 'disabled');
+        jQuery('#submitButton').attr('disabled', true);
         jQuery('#showInvoiceRunningTotal').html("");
     }
 }

Modified: ofbiz/trunk/applications/accounting/webapp/ar/invoice/ListInvoices.ftl
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/ar/invoice/ListInvoices.ftl?rev=1221889&r1=1221888&r2=1221889&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/webapp/ar/invoice/ListInvoices.ftl 
(original)
+++ ofbiz/trunk/applications/accounting/webapp/ar/invoice/ListInvoices.ftl Wed 
Dec 21 21:14:26 2011
@@ -64,11 +64,11 @@ under the License.
             });
 
             if(jQuery('#serviceName').val() != "") {
-                jQuery('#submitButton').attr('disabled', '');
+                jQuery('#submitButton').removeAttr('disabled');
             }
 
         } else {
-            jQuery('#submitButton').attr('disabled', 'disabled');
+            jQuery('#submitButton').attr('disabled', true);
             jQuery('#showInvoiceRunningTotal').html("");
         }
     }
@@ -104,7 +104,9 @@ under the License.
         });
 
         if(anyChecked && (jQuery('#serviceName').val() != "")) {
-            jQuery('#submitButton').attr('disabled' , '');
+            jQuery('#submitButton').removeAttr('disabled');
+        } else {
+            jQuery('#submitButton').attr('disabled', true);
         }
     }
 //]]>
@@ -179,6 +181,7 @@ under the License.
               <td><@ofbizCurrency amount=invoicePaymentInfo.amount 
isoCode=defaultOrganizationPartyCurrencyUomId/></td>
               <td><@ofbizCurrency amount=invoicePaymentInfo.paidAmount 
isoCode=defaultOrganizationPartyCurrencyUomId/></td>
               <td><@ofbizCurrency amount=invoicePaymentInfo.outstandingAmount 
isoCode=defaultOrganizationPartyCurrencyUomId/></td>
+              mlml
               <td align="right"><input type="checkbox" 
id="invoiceId_${invoice_index}" name="invoiceIds" value="${invoice.invoiceId}" 
onclick="javascript:getInvoiceRunningTotal();"/></td>
             </tr>
             <#-- toggle the row color -->

Modified: 
ofbiz/trunk/applications/accounting/webapp/ar/payment/batchPayments.ftl
URL: 
http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/ar/payment/batchPayments.ftl?rev=1221889&r1=1221888&r2=1221889&view=diff
==============================================================================
--- ofbiz/trunk/applications/accounting/webapp/ar/payment/batchPayments.ftl 
(original)
+++ ofbiz/trunk/applications/accounting/webapp/ar/payment/batchPayments.ftl Wed 
Dec 21 21:14:26 2011
@@ -65,11 +65,13 @@ function getPaymentRunningTotal() {
         });
 
         if(jQuery('#serviceName').val() != "") {
-            jQuery('#submitButton').attr('disabled', '');
+            jQuery('#submitButton').removeAttr('disabled');
+        } else {
+            jQuery('#submitButton').attr('disabled', true);
         }
 
     } else {
-        jQuery('#submitButton').attr('disabled', 'disabled');
+        jQuery('#submitButton').attr('disabled', true);
         jQuery('#showPaymentRunningTotal').html("");
     }
 }
@@ -108,9 +110,9 @@ function setServiceName(selection) {
     });
 
     if(anyChecked && (jQuery('#serviceName').val() != "")) {
-        jQuery('#submitButton').attr('disabled' , '');
+        jQuery('#submitButton').removeAttr('disabled');
     } else {
-       jQuery('#submitButton').attr('disabled' , 'disabled');
+       jQuery('#submitButton').attr('disabled' , true);
     }
 
 }


Reply via email to