X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;ds=inline;f=httemplate%2Fedit%2Fquick-charge.html;h=dde89176708863e4a72ebe0496986d783c85ff3d;hb=f822e27a1e00594332ffa487a1c284234c5580a6;hp=cbf1dcb745d187f8d3ea22992fca0e77cf9649ed;hpb=2d918c2c9f7685fddfb7c9bc9c54a2fee3bf3e4c;p=freeside.git diff --git a/httemplate/edit/quick-charge.html b/httemplate/edit/quick-charge.html index cbf1dcb74..dde891767 100644 --- a/httemplate/edit/quick-charge.html +++ b/httemplate/edit/quick-charge.html @@ -1,26 +1,48 @@ -<% include("/elements/header-popup.html", 'One-time charge entry', '', - ( $cgi->param('error') ? '' : 'onload="addRow()"' ), - ) -%> +<& /elements/header.html, mt('One-time charge'), '', + ( ($quotationnum || $cgi->param('error')) ? '' : 'onload="addRow()"' ), +&> -<% include('/elements/error.html') %> + + + + + + +<& /elements/error.html &> -
@@ -125,10 +393,26 @@ function validate_quick_charge () { var rownum = <% $row %>; - function possiblyAddRow() { + function possiblyAddRow(e) { + if ( ( rownum - this.getAttribute('rownum') ) == 1 ) { addRow(); } + +% if ( $curuser->option('disable_enter_submit_onetimecharge') ) { + + var key; + if (window.event) + key = window.event.keyCode; //IE + else + key = e.which; //firefox, others + + return (key != 13); + +% } else { + return true; +% } + } function addRow() { @@ -143,14 +427,16 @@ function validate_quick_charge () { var description_cell = document.createElement('TD'); - var description_input = document.createElement('INPUT'); - description_input.setAttribute('name', 'description'+rownum); - description_input.setAttribute('id', 'description'+rownum); - description_input.setAttribute('size', 60); - description_input.setAttribute('maxLength', 65); - description_input.setAttribute('rownum', rownum); - description_input.onkeyup = possiblyAddRow; - description_cell.appendChild(description_input); + //var description_input = document.createElement('INPUT'); + var di = document.createElement('INPUT'); + di.setAttribute('name', 'description'+rownum); + di.setAttribute('id', 'description'+rownum); + di.setAttribute('size', 60); + di.setAttribute('maxLength', 65); + di.setAttribute('rownum', rownum); + di.onkeyup = possiblyAddRow; + di.onkeypress = enable_quick_charge; + description_cell.appendChild(di); row.appendChild(description_cell); @@ -166,19 +452,68 @@ function validate_quick_charge () {