summaryrefslogtreecommitdiff
path: root/httemplate
diff options
context:
space:
mode:
authorivan <ivan>2011-04-27 00:48:10 +0000
committerivan <ivan>2011-04-27 00:48:10 +0000
commit69a17ed7c31d23670f715ad639ab16b12392dcc1 (patch)
tree93bc0aa9618cd7e5e8757a207376b3c5d0f5887d /httemplate
parente7c2224fdf499bd9cdf3759920378ec360eb965e (diff)
fix submission bug w/chrome, RT#12638
Diffstat (limited to 'httemplate')
-rw-r--r--httemplate/elements/form-file_upload.html4
-rw-r--r--httemplate/misc/cdr-import.html22
-rw-r--r--httemplate/misc/cust_main-import.cgi22
-rw-r--r--httemplate/misc/cust_pkg-import.html22
-rw-r--r--httemplate/misc/inventory_item-import.html32
-rw-r--r--httemplate/misc/part_device-import.html22
-rw-r--r--httemplate/misc/phone_avail-import.html23
-rw-r--r--httemplate/misc/rate-import.html22
-rw-r--r--httemplate/misc/rate_edit_excel.html22
-rw-r--r--httemplate/misc/tax-import.cgi23
10 files changed, 109 insertions, 105 deletions
diff --git a/httemplate/elements/form-file_upload.html b/httemplate/elements/form-file_upload.html
index 4ab70ad9c..45b6c97f2 100644
--- a/httemplate/elements/form-file_upload.html
+++ b/httemplate/elements/form-file_upload.html
@@ -72,7 +72,7 @@ Example:
ACTION = "<% $fsurl %>misc/file-upload.html"
METHOD = "POST"
ENCTYPE = "multipart/form-data"
- onSubmit = "return doUpload(this, <% $opt{key} %>gotUploaded)"
+ onSubmit = "<% $opt{onsubmit} %>return doUpload(this, <% $opt{key} %>gotUploaded)"
>
<%init>
@@ -90,4 +90,6 @@ my $msg_or_url = $opt{message}
}
: $opt{url};
+$opt{onsubmit} .= ';' if $opt{onsubmit} && $opt{onsubmit} !~ /;\s*$/;
+
</%init>
diff --git a/httemplate/misc/cdr-import.html b/httemplate/misc/cdr-import.html
index 7af6c521f..05d0bbc3c 100644
--- a/httemplate/misc/cdr-import.html
+++ b/httemplate/misc/cdr-import.html
@@ -1,14 +1,14 @@
<% include("/elements/header.html",'Call Detail Record Import') %>
-<% include( '/elements/form-file_upload.html',
- 'name' => 'CDRImportForm',
- 'action' => 'process/cdr-import.html',
- 'num_files' => 1,
- 'fields' => [ 'format', 'cdrbatch', ],
- 'message' => 'CDR import successful',
- 'url' => $p."search/cdr.html?cdrbatch=$cdrbatch",
- )
-%>
+<& /elements/form-file_upload.html,
+ 'name' => 'CDRImportForm',
+ 'action' => 'process/cdr-import.html',
+ 'num_files' => 1,
+ 'fields' => [ 'format', 'cdrbatch', ],
+ 'message' => 'CDR import successful',
+ 'url' => $p."search/cdr.html?cdrbatch=$cdrbatch",
+ 'onsubmit' => "document.CDRImportForm.submitButton.disabled=true;",
+&>
Import a file containing Call Detail Records (CDRs).<BR><BR>
@@ -36,9 +36,9 @@ Import a file containing Call Detail Records (CDRs).<BR><BR>
<TR>
<TD COLSPAN=2 ALIGN="center" STYLE="padding-top:6px">
<INPUT TYPE = "submit"
- ID = "submit"
+ ID = "submitButton"
+ NAME = "submitButton"
VALUE = "Import file"
- onClick = "document.InventoryItemImportForm.submit.disabled=true;"
>
</TD>
</TR>
diff --git a/httemplate/misc/cust_main-import.cgi b/httemplate/misc/cust_main-import.cgi
index 028876c3a..664651069 100644
--- a/httemplate/misc/cust_main-import.cgi
+++ b/httemplate/misc/cust_main-import.cgi
@@ -3,15 +3,15 @@
Import a file containing customer records.
<BR><BR>
-<% include( '/elements/form-file_upload.html',
- 'name' => 'CustomerImportForm',
- 'action' => 'process/cust_main-import.cgi',
- 'num_files' => 1,
- 'fields' => [ 'agentnum', 'custbatch', 'format' ],
- 'message' => 'Customer import successful',
- 'url' => $p."search/cust_main.html?custbatch=$custbatch",
- )
-%>
+<& /elements/form-file_upload.html,
+ 'name' => 'CustomerImportForm',
+ 'action' => 'process/cust_main-import.cgi',
+ 'num_files' => 1,
+ 'fields' => [ 'agentnum', 'custbatch', 'format' ],
+ 'message' => 'Customer import successful',
+ 'url' => $p."search/cust_main.html?custbatch=$custbatch",
+ 'onsubmit' => "document.CustomerImportForm.submitButton.disabled=true;",
+&>
<% &ntable("#cccccc", 2) %>
@@ -69,9 +69,9 @@ Import a file containing customer records.
<TR>
<TD COLSPAN=2 ALIGN="center" STYLE="padding-top:6px">
<INPUT TYPE = "submit"
- ID = "submit"
+ NAME = "submitButton"
+ ID = "submitButton"
VALUE = "Import file"
- onClick = "document.CustomerImportForm.submit.disabled=true;"
>
</TD>
</TR>
diff --git a/httemplate/misc/cust_pkg-import.html b/httemplate/misc/cust_pkg-import.html
index b29884d66..f86d317b9 100644
--- a/httemplate/misc/cust_pkg-import.html
+++ b/httemplate/misc/cust_pkg-import.html
@@ -3,15 +3,15 @@
Import a file containing package records.
<BR><BR>
-<% include( '/elements/form-file_upload.html',
- 'name' => 'PackageImportForm',
- 'action' => 'process/cust_pkg-import.html',
- 'num_files' => 1,
- 'fields' => [ 'agentnum', 'pkgbatch', 'format' ],
- 'message' => 'Package import successful',
- 'url' => $p."search/cust_pkg.cgi?pkgbatch=$pkgbatch",
- )
-%>
+<& /elements/form-file_upload.html,
+ 'name' => 'PackageImportForm',
+ 'action' => 'process/cust_pkg-import.html',
+ 'num_files' => 1,
+ 'fields' => [ 'agentnum', 'pkgbatch', 'format' ],
+ 'message' => 'Package import successful',
+ 'url' => $p."search/cust_pkg.cgi?pkgbatch=$pkgbatch",
+ 'onsubmit' => "document.PackageImportForm.submitButton.disabled=true;"
+&>
<% &ntable("#cccccc", 2) %>
@@ -49,9 +49,9 @@ Import a file containing package records.
<TR>
<TD COLSPAN=2 ALIGN="center" STYLE="padding-top:6px">
<INPUT TYPE = "submit"
- ID = "submit"
+ NAME = "submitButton"
+ ID = "submitButton"
VALUE = "Import file"
- onClick = "document.PackageImportForm.submit.disabled=true;"
>
</TD>
</TR>
diff --git a/httemplate/misc/inventory_item-import.html b/httemplate/misc/inventory_item-import.html
index d264bafc5..37898739a 100644
--- a/httemplate/misc/inventory_item-import.html
+++ b/httemplate/misc/inventory_item-import.html
@@ -3,18 +3,18 @@
Import a file containing <% PL($inventory_class->classname) %>, one per line.
<BR><BR>
-<% include( '/elements/form-file_upload.html',
- 'name' => 'InventoryItemImportForm',
- 'action' => 'process/inventory_item-import.html',
- 'num_files' => 1,
- #'fields' => [ 'format', 'itembatch', 'classnum', 'agentnum' ],
- 'fields' => [ 'format', 'classnum', 'agentnum', ],
- 'message' => 'Inventory import successful',
- #XXX redirect via $itembatch? or just back to class browse?
- #'url' => $p."search/phone_avail.html?availbatch=$availbatch",
- 'url' => $p."search/inventory_item.html?classnum=$classnum;avail=1",
- )
-%>
+<& /elements/form-file_upload.html,
+ 'name' => 'InventoryImportForm',
+ 'action' => 'process/inventory_item-import.html',
+ 'num_files' => 1,
+ #'fields' => [ 'format', 'itembatch', 'classnum', 'agentnum' ],
+ 'fields' => [ 'format', 'classnum', 'agentnum', ],
+ 'message' => 'Inventory import successful',
+ #XXX redirect via $itembatch? or just back to class browse?
+ #'url' => $p."search/phone_avail.html?availbatch=$availbatch",
+ 'url' => $p."search/inventory_item.html?classnum=$classnum;avail=1",
+ 'onsubmit' => "document.InventoryImportForm.submitButton.disabled=true;",
+&>
<% &ntable("#cccccc", 2) %>
@@ -37,10 +37,10 @@ Import a file containing <% PL($inventory_class->classname) %>, one per line.
<TR>
<TD COLSPAN=2 ALIGN="center" STYLE="padding-top:6px">
- <INPUT TYPE = "submit"
- ID = "submit"
- VALUE = "Import file"
- onClick = "document.InventoryItemImportForm.submit.disabled=true;"
+ <INPUT TYPE = "submit"
+ NAME = "submitButton"
+ ID = "submitButton"
+ VALUE = "Import file"
>
</TD>
</TR>
diff --git a/httemplate/misc/part_device-import.html b/httemplate/misc/part_device-import.html
index 7bd640459..7cf8167dc 100644
--- a/httemplate/misc/part_device-import.html
+++ b/httemplate/misc/part_device-import.html
@@ -3,15 +3,15 @@
Import a file containing phone device types, one per line.
<BR><BR>
-<% include( '/elements/form-file_upload.html',
- 'name' => 'PartDeviceImportForm',
- 'action' => 'process/part_device-import.html',
- 'num_files' => 1,
- 'fields' => [ 'format', ],
- 'message' => 'Device type import successful',
- 'url' => $p.'browse/part_device.html',
- )
-%>
+<& /elements/form-file_upload.html,
+ 'name' => 'PartDeviceImportForm',
+ 'action' => 'process/part_device-import.html',
+ 'num_files' => 1,
+ 'fields' => [ 'format', ],
+ 'message' => 'Device type import successful',
+ 'url' => $p.'browse/part_device.html',
+ 'onsubmit' => "document.PartDeviceImportForm.submitButton.disabled=true;",
+&>
<% &ntable("#cccccc", 2) %>
@@ -26,9 +26,9 @@ Import a file containing phone device types, one per line.
<TR>
<TD COLSPAN=2 ALIGN="center" STYLE="padding-top:6px">
<INPUT TYPE = "submit"
- ID = "submit"
+ ID = "submitButton"
+ NAME = "submitButton"
VALUE = "Import file"
- onClick = "document.PartDeviceImportForm.submit.disabled=true;"
>
</TD>
</TR>
diff --git a/httemplate/misc/phone_avail-import.html b/httemplate/misc/phone_avail-import.html
index b6fea7ec2..0febfbcf5 100644
--- a/httemplate/misc/phone_avail-import.html
+++ b/httemplate/misc/phone_avail-import.html
@@ -3,15 +3,16 @@
Import a file containing phone numbers (DIDs).
<BR><BR>
-<% include( '/elements/form-file_upload.html',
- 'name' => 'PhonenumImportForm',
- 'action' => 'process/phone_avail-import.html',
- 'num_files' => 1,
- 'fields' => [ 'format', 'availbatch', 'exportnum', 'countrycode', 'ordernum', 'confirmed', 'vendor_order_id' ],
- 'message' => 'DID import successful',
- 'url' => $p."search/phone_avail.html?availbatch=$availbatch",
- )
-%>
+<& /elements/form-file_upload.html,
+ 'name' => 'PhonenumImportForm',
+ 'action' => 'process/phone_avail-import.html',
+ 'num_files' => 1,
+ 'fields' => [ 'format', 'availbatch', 'exportnum', 'countrycode',
+ 'ordernum', 'confirmed', 'vendor_order_id' ],
+ 'message' => 'DID import successful',
+ 'url' => $p."search/phone_avail.html?availbatch=$availbatch",
+ 'onsubmit' => "document.PhonenumImportForm.submitButton.disabled=true;",
+&>
<% &ntable("#cccccc", 2) %>
@@ -86,9 +87,9 @@ Import a file containing phone numbers (DIDs).
<TR>
<TD COLSPAN=2 ALIGN="center" STYLE="padding-top:6px">
<INPUT TYPE = "submit"
- ID = "submit"
+ ID = "submitButton"
+ NAME = "submitButton"
VALUE = "Import file"
- onClick = "document.PhonenumImportForm.submit.disabled=true;"
>
</TD>
</TR>
diff --git a/httemplate/misc/rate-import.html b/httemplate/misc/rate-import.html
index ae8ee695b..538418d13 100644
--- a/httemplate/misc/rate-import.html
+++ b/httemplate/misc/rate-import.html
@@ -1,14 +1,14 @@
<% include("/elements/header.html",'Import Rate Plan') %>
-<% include( '/elements/form-file_upload.html',
- 'name' => 'RateImportForm',
- 'action ' => 'process/rate-import.html',
- 'num_files' => 1,
- 'fields' => [ 'ratename' ],
- 'message' => 'Rate plan import successful',
-# 'url' => $p."browse/rate_detail.cgi?ratenum=$ratenum", #XXX how?
- )
-%>
+<& /elements/form-file_upload.html,
+ 'name' => 'RateImportForm',
+ 'action ' => 'process/rate-import.html',
+ 'num_files' => 1,
+ 'fields' => [ 'ratename' ],
+ 'message' => 'Rate plan import successful',
+ #'url' => $p."browse/rate_detail.cgi?ratenum=$ratenum", #XXX how?
+ 'onsubmit' => "document.RateImportForm.submitButton.disabled=true;",
+&>
<% &ntable("#cccccc", 2) %>
@@ -28,9 +28,9 @@
<TR>
<TD COLSPAN=2 ALIGN="center" STYLE="padding-top:6px">
<INPUT TYPE = "submit"
- ID = "submit"
+ ID = "submitButton"
+ NAME = "submitButton"
VALUE = "Import rate plan"
- onClick = "document.RateImportForm.submit.disabled=true;"
>
</TD>
</TR>
diff --git a/httemplate/misc/rate_edit_excel.html b/httemplate/misc/rate_edit_excel.html
index 442d83aca..e55c676a8 100644
--- a/httemplate/misc/rate_edit_excel.html
+++ b/httemplate/misc/rate_edit_excel.html
@@ -4,15 +4,15 @@
<FONT COLOR="#FF0000">WARNING: This functionality does not yet preserve connection charges.</FONT><BR><BR>
% }
-<% include( '/elements/form-file_upload.html',
- 'name' => 'RateImportForm',
- 'action' => 'process/rate_edit_excel.html',
- 'num_files' => 1,
- 'fields' => [ 'format' ],
- 'message' => 'Rate edit successful',
- 'url' => $p."browse/rate_region.html",
- )
-%>
+<& /elements/form-file_upload.html,
+ 'name' => 'RateImportForm',
+ 'action' => 'process/rate_edit_excel.html',
+ 'num_files' => 1,
+ 'fields' => [ 'format' ],
+ 'message' => 'Rate edit successful',
+ 'url' => $p."browse/rate_region.html",
+ 'onsubmit' => "document.RateImportForm.submitButton.disabled=true;"
+&>
<% &ntable("#cccccc", 2) %>
@@ -46,9 +46,9 @@
<TR>
<TD COLSPAN=2 ALIGN="center" STYLE="padding-top:6px">
<INPUT TYPE = "submit"
- ID = "submit"
+ ID = "submitButton"
+ NAME = "submitButton"
VALUE = "Upload"
- onClick = "document.RateImportForm.submit.disabled=true;"
>
</TD>
</TR>
diff --git a/httemplate/misc/tax-import.cgi b/httemplate/misc/tax-import.cgi
index ceb74645c..25414b20d 100644
--- a/httemplate/misc/tax-import.cgi
+++ b/httemplate/misc/tax-import.cgi
@@ -3,14 +3,14 @@
Import a CSV file set containing tax rate records.
<BR><BR>
-<% include( '/elements/form-file_upload.html',
- 'name' => 'TaxRateUpload',
- 'action' => 'process/tax-import.cgi',
- 'num_files' => 6,
- 'fields' => [ 'format', 'reload' ],
- 'message' => 'Tax rates imported',
- )
-%>
+<& /elements/form-file_upload.html,
+ 'name' => 'TaxRateUpload',
+ 'action' => 'process/tax-import.cgi',
+ 'num_files' => 6,
+ 'fields' => [ 'format', 'reload' ],
+ 'message' => 'Tax rates imported',
+ 'onsubmit' => "document.TaxRateUpload.submitButton.disabled=true;",
+&>
<% &ntable("#cccccc", 2) %>
@@ -54,9 +54,10 @@ Import a CSV file set containing tax rate records.
<TR>
<TD COLSPAN=2 ALIGN="center" STYLE="padding-top:6px">
- <INPUT TYPE = "submit"
- VALUE = "Import CSV files"
- onClick = "document.TaxRateUpload.submit.disabled=true;"
+ <INPUT TYPE = "submit"
+ NAME = "submitButton"
+ ID = "submitButton"
+ VALUE = "Import CSV files"
>
</TD>
</TR>