From 1053db7f76169cbbc87840539959a4c362aff242 Mon Sep 17 00:00:00 2001 From: ivan Date: Wed, 12 Jul 2006 00:20:23 +0000 Subject: svc_phone service and CDR billing from imported CDRs --- httemplate/edit/elements/svc_Common.html | 98 ++++++++++++++++++++++++++++++++ 1 file changed, 98 insertions(+) create mode 100644 httemplate/edit/elements/svc_Common.html (limited to 'httemplate/edit/elements/svc_Common.html') diff --git a/httemplate/edit/elements/svc_Common.html b/httemplate/edit/elements/svc_Common.html new file mode 100644 index 000000000..c113ad645 --- /dev/null +++ b/httemplate/edit/elements/svc_Common.html @@ -0,0 +1,98 @@ +<% + + my %opt = @_; + + #my( $svcnum, $pkgnum, $svcpart, $part_svc ); + my( $pkgnum, $svcpart, $part_svc ); + + #get & untaint pkgnum & svcpart + my($query) = $cgi->keywords; #they're not proper cgi params + if ( $query =~ /^pkgnum(\d+)-svcpart(\d+)$/ ) { + $pkgnum = $1; + $svcpart = $2; + $cgi->delete_all(); #so the standard edit.html treats this correctly as new + } + +%><%= include( 'edit.html', + + 'menubar' => [], + + 'error_callback' => sub { + my( $cgi, $svc_x ) = @_; + #$svcnum = $svc_x->svcnum; + $pkgnum = $cgi->param('pkgnum'); + $svcpart = $cgi->param('svcpart'); + + $part_svc = qsearchs( 'part_svc', { svcpart=>$svcpart }); + die "No part_svc entry!" unless $part_svc; + }, + + 'edit_callback' => sub { + my( $cgi, $svc_x ) = @_; + #$svcnum = $svc_x->svcnum; + my $cust_svc = $svc_x->cust_svc + or die "Unknown (cust_svc) svcnum!"; + + $pkgnum = $cust_svc->pkgnum; + $svcpart = $cust_svc->svcpart; + + $part_svc = qsearchs ('part_svc', { svcpart=>$svcpart }); + die "No part_svc entry!" unless $part_svc; + }, + + 'new_hash_callback' => sub { + #my( $cgi, $svc_x ) = @_; + + { svcpart => $svcpart }; + + }, + + 'new_callback' => sub { + my( $cgi, $svc_x ) = @_;; + + $part_svc = qsearchs( 'part_svc', { svcpart=>$svcpart }); + die "No part_svc entry!" unless $part_svc; + + #$svcnum=''; + + $svc_x->set_default_and_fixed; + + }, + + 'field_callback' => sub { + my $f = shift; + my $columndef = $part_svc->part_svc_column($f->{'field'}); + my $flag = $columndef->columnflag; + if ( $flag eq 'F' ) { + $f->{'type'} = 'fixed'; + $f->{'value'} = $columndef->columnvalue; + } + }, + + 'html_table_bottom' => sub { + my $svc_x = shift; + my $html = ''; + foreach my $field ($svc_x->virtual_fields) { + if ($part_svc->part_svc_column($field)->columnflag ne 'F'){ + # If the flag is X, it won't even show up + # in $svc_acct->virtual_fields. + $html .= + $svc_x->pvf($field)->widget( 'HTML', + 'edit', + $svc_x->getfield($field) + ); + } + } + $html; + }, + + 'html_bottom' => sub { + qq!!. + qq!!; + }, + + 'debug' => 1, + + %opt #pass through/override params + ) +%> -- cgit v1.2.1 From 3ce7691203a7737406bf2d4442f7fd84b81f847e Mon Sep 17 00:00:00 2001 From: ivan Date: Wed, 23 Aug 2006 22:25:39 +0000 Subject: Will things ever be the same again? It's the final masonize --- httemplate/edit/elements/svc_Common.html | 33 ++++++++++++++++---------------- 1 file changed, 17 insertions(+), 16 deletions(-) (limited to 'httemplate/edit/elements/svc_Common.html') diff --git a/httemplate/edit/elements/svc_Common.html b/httemplate/edit/elements/svc_Common.html index c113ad645..da59cc9ed 100644 --- a/httemplate/edit/elements/svc_Common.html +++ b/httemplate/edit/elements/svc_Common.html @@ -1,19 +1,20 @@ -<% - - my %opt = @_; - - #my( $svcnum, $pkgnum, $svcpart, $part_svc ); - my( $pkgnum, $svcpart, $part_svc ); - - #get & untaint pkgnum & svcpart - my($query) = $cgi->keywords; #they're not proper cgi params - if ( $query =~ /^pkgnum(\d+)-svcpart(\d+)$/ ) { - $pkgnum = $1; - $svcpart = $2; - $cgi->delete_all(); #so the standard edit.html treats this correctly as new - } - -%><%= include( 'edit.html', +% +% +% my %opt = @_; +% +% #my( $svcnum, $pkgnum, $svcpart, $part_svc ); +% my( $pkgnum, $svcpart, $part_svc ); +% +% #get & untaint pkgnum & svcpart +% my($query) = $cgi->keywords; #they're not proper cgi params +% if ( $query =~ /^pkgnum(\d+)-svcpart(\d+)$/ ) { +% $pkgnum = $1; +% $svcpart = $2; +% $cgi->delete_all(); #so the standard edit.html treats this correctly as new +% } +% +% +<% include( 'edit.html', 'menubar' => [], -- cgit v1.2.1 From 633c48448d9468690b7ad77eb6ff7c660a286658 Mon Sep 17 00:00:00 2001 From: ivan Date: Fri, 29 Dec 2006 08:51:34 +0000 Subject: service refactor! --- httemplate/edit/elements/svc_Common.html | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) (limited to 'httemplate/edit/elements/svc_Common.html') diff --git a/httemplate/edit/elements/svc_Common.html b/httemplate/edit/elements/svc_Common.html index da59cc9ed..1fd66c251 100644 --- a/httemplate/edit/elements/svc_Common.html +++ b/httemplate/edit/elements/svc_Common.html @@ -1,19 +1,21 @@ % -% % my %opt = @_; % % #my( $svcnum, $pkgnum, $svcpart, $part_svc ); % my( $pkgnum, $svcpart, $part_svc ); % % #get & untaint pkgnum & svcpart -% my($query) = $cgi->keywords; #they're not proper cgi params -% if ( $query =~ /^pkgnum(\d+)-svcpart(\d+)$/ ) { -% $pkgnum = $1; -% $svcpart = $2; -% $cgi->delete_all(); #so the standard edit.html treats this correctly as new +% if ( ! $cgi->param('error') +% && $cgi->param('pkgnum') && $cgi->param('svcpart') +% ) +% { +% $cgi->param('pkgnum') =~ /^(\d+)$/ or die 'unparsable pkgnum'; +% $pkgnum = $1; +% $cgi->param('svcpart') =~ /^(\d+)$/ or die 'unparsable svcpart'; +% $svcpart = $1; +% $cgi->delete_all(); #so edit.html treats this correctly as new?? % } % -% <% include( 'edit.html', 'menubar' => [], -- cgit v1.2.1