[Astpp-commit] SF.net SVN: astpp: [2180] trunk
Brought to you by:
darrenkw
From: <dar...@us...> - 2008-05-21 22:52:56
|
Revision: 2180 http://astpp.svn.sourceforge.net/astpp/?rev=2180&view=rev Author: darrenkw Date: 2008-05-21 15:52:55 -0700 (Wed, 21 May 2008) Log Message: ----------- Moved "Calculate Call Charge" output to an HTML Template. Adjusted code posting cdrs to OSCommerce so that callerid information is posted also. Modified Paths: -------------- trunk/astpp-admin.cgi trunk/astpp-common.pl Modified: trunk/astpp-admin.cgi =================================================================== --- trunk/astpp-admin.cgi 2008-05-21 22:50:10 UTC (rev 2179) +++ trunk/astpp-admin.cgi 2008-05-21 22:52:55 UTC (rev 2180) @@ -9103,8 +9103,17 @@ sub build_calc_charge() { my ( $status, $body, $cost, $length, $increment ); + $template = + HTML::Template->new( + filename => '/var/lib/astpp/templates/calc-charge.tpl', die_on_bad_params => $config->{template_die_on_bad_params} ); return gettext("Database is NOT configured!") . "\n" unless $astpp_db; - @pricelists = $ASTPP->list_pricelists(reseller => $params->{logged_in_reseller}); + @pricelists = $ASTPP->list_pricelists(reseller => $params->{logged_in_reseller}); + $template->param( + pricelists => popup_menu( + -name => "pricelist", + -values => \@pricelists + ) + ); if ( $params->{action} eq gettext("Price Call...") ) { my $branddata = &get_pricelist( $astpp_db, $params->{pricelist} ); my $numdata = &get_route( $astpp_db, $config, $params->{phonenumber}, @@ -9143,41 +9152,10 @@ . gettext(" for a call lasting ") . $params->{length} . gettext(" minutes."); + $template->param( + status => $status); } - $body = start_form - . "<table class=\"default\">" - . "<tr class=\"header\"><td>" - . hidden( -name => 'mode', -default => gettext("Calc Charge") ) - . gettext("Phone Number") - . "</td><td>" - . gettext("Length (Minutes)") - . "</td><td>" - . gettext("Pricelist") - . "</td><td>" - . gettext("Action") - . "</td></tr> -<tr class=\"rowone\"><td>" - . textfield( - -name => 'phonenumber', - -size => 20 - ) - . "</td><td>" - . textfield( - -name => 'length', - -size => 4 - ) - . "</td><td>" - . popup_menu( - -name => 'pricelist', - -values => \@pricelists, - -default => $config->{default_brand} - ) - . "</td><td>" - . submit( -name => 'action', -value => gettext("Price Call...") ) - . "</td></tr><tr><td colspan=4>" - . $status - . "</td></tr></table>"; - return $body; + return $template->output; } sub build_configuration() { Modified: trunk/astpp-common.pl =================================================================== --- trunk/astpp-common.pl 2008-05-21 22:50:10 UTC (rev 2179) +++ trunk/astpp-common.pl 2008-05-21 22:52:55 UTC (rev 2180) @@ -4454,7 +4454,7 @@ sub osc_post_charge() { my ($osc_db, $config, $invoice_id, $row ) = @_; my ( $sql, $desc, $tmp, $price ); - $desc = "$row->{callstart} $row->{callednum} SEC:$row->{billseconds}"; + $desc = "$row->{callstart} SRC: $row->{callerid} DST: $row->{callednum} SEC:$row->{billseconds} $row->{notes}"; $price = $row->{debit} / 10000; $tmp = "INSERT INTO `orders_products` (`orders_products_id`,`orders_id`,`products_id`,`products_name`,`products_price`," This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |