From 6cf964d0dc008621fb30fd2da28e2c44f29c6364 Mon Sep 17 00:00:00 2001
From: ivan
Date: Thu, 27 Jan 2005 10:21:18 +0000
Subject: DHTML progress bar for glacial rate adding and editing, closes:
Bug#1100
---
httemplate/docs/install.html | 1 +
httemplate/edit/process/rate.cgi | 4 +
httemplate/edit/rate.cgi | 97 ++++-----
httemplate/elements/jsrsClient.js | 356 ++++++++++++++++++++++++++++++++
httemplate/elements/qlib/box.js | 29 +++
httemplate/elements/qlib/boxctrl.js | 48 +++++
httemplate/elements/qlib/boxres.js | 42 ++++
httemplate/elements/qlib/button.js | 74 +++++++
httemplate/elements/qlib/buttonres.js | 23 +++
httemplate/elements/qlib/control.js | 51 +++++
httemplate/elements/qlib/counter.js | 81 ++++++++
httemplate/elements/qlib/imagelist.js | 25 +++
httemplate/elements/qlib/label.js | 72 +++++++
httemplate/elements/qlib/messagebox.js | 57 +++++
httemplate/elements/qlib/progress.js | 73 +++++++
httemplate/elements/qlib/sound.js | 47 +++++
httemplate/elements/qlib/sprite.js | 125 +++++++++++
httemplate/elements/qlib/window.js | 25 +++
httemplate/elements/qlib/wndctrl.js | 322 +++++++++++++++++++++++++++++
httemplate/images/progressbar-empty.png | Bin 0 -> 90 bytes
httemplate/images/progressbar-full.png | Bin 0 -> 79 bytes
httemplate/misc/progress.html | 88 ++++++++
22 files changed, 1584 insertions(+), 56 deletions(-)
create mode 100755 httemplate/edit/process/rate.cgi
create mode 100644 httemplate/elements/jsrsClient.js
create mode 100644 httemplate/elements/qlib/box.js
create mode 100644 httemplate/elements/qlib/boxctrl.js
create mode 100644 httemplate/elements/qlib/boxres.js
create mode 100644 httemplate/elements/qlib/button.js
create mode 100644 httemplate/elements/qlib/buttonres.js
create mode 100644 httemplate/elements/qlib/control.js
create mode 100644 httemplate/elements/qlib/counter.js
create mode 100644 httemplate/elements/qlib/imagelist.js
create mode 100644 httemplate/elements/qlib/label.js
create mode 100644 httemplate/elements/qlib/messagebox.js
create mode 100644 httemplate/elements/qlib/progress.js
create mode 100644 httemplate/elements/qlib/sound.js
create mode 100644 httemplate/elements/qlib/sprite.js
create mode 100644 httemplate/elements/qlib/window.js
create mode 100644 httemplate/elements/qlib/wndctrl.js
create mode 100644 httemplate/images/progressbar-empty.png
create mode 100644 httemplate/images/progressbar-full.png
create mode 100644 httemplate/misc/progress.html
(limited to 'httemplate')
diff --git a/httemplate/docs/install.html b/httemplate/docs/install.html
index 86e2a6b8c..898eb9ef8 100644
--- a/httemplate/docs/install.html
+++ b/httemplate/docs/install.html
@@ -58,6 +58,7 @@ Before installing, you need:
NetAddr-IP
Chart
Crypt::PasswdMD5
+ JavaScript::RPC (JavaScript::RPC::Server::CGI)
Apache::DBI (optional but recommended for better webinterface performance)
diff --git a/httemplate/edit/process/rate.cgi b/httemplate/edit/process/rate.cgi
new file mode 100755
index 000000000..df7c4672e
--- /dev/null
+++ b/httemplate/edit/process/rate.cgi
@@ -0,0 +1,4 @@
+<%
+my $server = new FS::rate::JSRPC;
+$server->process;
+%>
diff --git a/httemplate/edit/rate.cgi b/httemplate/edit/rate.cgi
index 4a4b70ea3..3443f81d4 100644
--- a/httemplate/edit/rate.cgi
+++ b/httemplate/edit/rate.cgi
@@ -1,52 +1,7 @@
<%
-my($rate, $error);
-
-if ( $cgi->param('magic') eq 'process' ) {
-
- my $ratenum = $cgi->param('ratenum');
-
- my $old = qsearchs('rate', { 'ratenum' => $ratenum } ) if $ratenum;
-
- my @rate_detail = map {
- my $regionnum = $_->regionnum;
- if ( $cgi->param("sec_granularity$regionnum") ) {
- new FS::rate_detail {
- 'dest_regionnum' => $regionnum,
- map { $_ => scalar($cgi->param("$_$regionnum")) }
- qw( min_included min_charge sec_granularity )
- };
- } else {
- new FS::rate_detail {
- 'dest_regionnum' => $regionnum,
- 'min_included' => 0,
- 'min_charge' => 0,
- 'sec_granularity' => '60'
- };
- }
- } qsearch('rate_region', {} );
-
- $rate = new FS::rate ( {
- map {
- $_, scalar($cgi->param($_));
- } fields('rate')
- } );
-
- if ( $ratenum ) {
- warn "$rate replacing $old ($ratenum)\n";
- $error = $rate->replace($old, 'rate_detail' => \@rate_detail );
- } else {
- warn "inserting $rate\n";
- $error = $rate->insert( 'rate_detail' => \@rate_detail );
- $ratenum = $rate->getfield('ratenum');
- }
-
- unless ( $error ) {
- print $cgi->redirect("${p}browse/rate.cgi");
- myexit;
- }
-
-} elsif ( $cgi->keywords ) {
+my $rate;
+if ( $cgi->keywords ) {
my($query) = $cgi->keywords;
$query =~ /^(\d+)$/;
$rate = qsearchs( 'rate', { 'ratenum' => $1 } );
@@ -77,12 +32,41 @@ END
))
%>
-<% if ( $error ) { %>
-Error: <%= $error %>
-<% } %>
+
+
+
+
-
');
+ doc.write('