From c1bb4ddb71147d0571bd301a6d8c452fdf0e1bc9 Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 31 Jan 2006 04:26:54 +0000 Subject: move header() to include(/elements/header.html) so it can be changed in one place, thanks to Scott Edwards --- httemplate/edit/REAL_cust_pkg.cgi | 2 +- httemplate/edit/agent.cgi | 2 +- httemplate/edit/agent_payment_gateway.html | 2 +- httemplate/edit/agent_type.cgi | 2 +- httemplate/edit/bulk-cust_svc.html | 2 +- httemplate/edit/cust_pay.cgi | 2 +- httemplate/edit/part_export.cgi | 2 +- httemplate/edit/part_pkg.cgi | 2 +- httemplate/edit/part_svc.cgi | 2 +- httemplate/edit/payment_gateway.html | 2 +- httemplate/edit/prepay_credit.cgi | 2 +- httemplate/edit/process/prepay_credit.cgi | 2 +- httemplate/edit/process/reg_code.cgi | 2 +- httemplate/edit/rate.cgi | 2 +- httemplate/edit/rate_region.cgi | 2 +- httemplate/edit/reg_code.cgi | 2 +- httemplate/edit/svc_acct.cgi | 2 +- httemplate/edit/svc_broadband.cgi | 2 +- httemplate/edit/svc_forward.cgi | 2 +- 19 files changed, 19 insertions(+), 19 deletions(-) (limited to 'httemplate/edit') diff --git a/httemplate/edit/REAL_cust_pkg.cgi b/httemplate/edit/REAL_cust_pkg.cgi index 78dd0fafa..1eefcfea0 100755 --- a/httemplate/edit/REAL_cust_pkg.cgi +++ b/httemplate/edit/REAL_cust_pkg.cgi @@ -33,7 +33,7 @@ if ( $error ) { #my $custnum = $cust_pkg->getfield('custnum'); %> -<%= header('Customer package - Edit dates') %> +<%= include("/elements/header.html",'Customer package - Edit dates') %> <% #, menubar( # "View this customer (#$custnum)" => popurl(2). "view/cust_main.cgi?$custnum", diff --git a/httemplate/edit/agent.cgi b/httemplate/edit/agent.cgi index cb64ad8cd..40115a932 100755 --- a/httemplate/edit/agent.cgi +++ b/httemplate/edit/agent.cgi @@ -19,7 +19,7 @@ my $conf = new FS::Conf; %> -<%= header("$action Agent", menubar( +<%= include("/elements/header.html","$action Agent", menubar( 'Main Menu' => $p, 'View all agents' => $p. 'browse/agent.cgi', )) %> diff --git a/httemplate/edit/agent_payment_gateway.html b/httemplate/edit/agent_payment_gateway.html index 61d29e0e9..db4331b84 100644 --- a/httemplate/edit/agent_payment_gateway.html +++ b/httemplate/edit/agent_payment_gateway.html @@ -12,7 +12,7 @@ my $action = 'Add'; %> -<%= header("$action payment gateway override for ". $agent->agent, menubar( +<%= include("/elements/header.html","$action payment gateway override for ". $agent->agent, menubar( 'Main Menu' => $p, #'View all payment gateways' => $p. 'browse/payment_gateway.html', 'View all agents' => $p. 'browse/agent.html', diff --git a/httemplate/edit/agent_type.cgi b/httemplate/edit/agent_type.cgi index 5addbbd4c..944ddd0d0 100755 --- a/httemplate/edit/agent_type.cgi +++ b/httemplate/edit/agent_type.cgi @@ -16,7 +16,7 @@ my $action = $agent_type->typenum ? 'Edit' : 'Add'; %> -<%= header("$action Agent Type", menubar( +<%= include("/elements/header.html","$action Agent Type", menubar( 'Main Menu' => "$p", 'View all agent types' => "${p}browse/agent_type.cgi", )) diff --git a/httemplate/edit/bulk-cust_svc.html b/httemplate/edit/bulk-cust_svc.html index 332b5b67c..be247ba4e 100644 --- a/httemplate/edit/bulk-cust_svc.html +++ b/httemplate/edit/bulk-cust_svc.html @@ -1,4 +1,4 @@ -<%= header( 'Bulk customer service change', +<%= include("/elements/header.html", 'Bulk customer service change', menubar( 'Main Menu' => $p, ), diff --git a/httemplate/edit/cust_pay.cgi b/httemplate/edit/cust_pay.cgi index 0370ab726..94fd06ca5 100755 --- a/httemplate/edit/cust_pay.cgi +++ b/httemplate/edit/cust_pay.cgi @@ -45,7 +45,7 @@ $title .= " against Invoice #$linknum" if $link eq 'invnum'; %> -<%= header($title, '') %> +<%= include("/elements/header.html",$title, '') %> <% if ( $cgi->param('error') ) { %> Error: <%= $cgi->param('error') %> diff --git a/httemplate/edit/part_export.cgi b/httemplate/edit/part_export.cgi index b3d42bd96..6a8a0deb6 100644 --- a/httemplate/edit/part_export.cgi +++ b/httemplate/edit/part_export.cgi @@ -100,7 +100,7 @@ my $widget = new HTML::Widgets::SelectLayers( ); %> -<%= header("$action Export", menubar( +<%= include("/elements/header.html","$action Export", menubar( 'Main Menu' => popurl(2), ), ' onLoad="visualize()"') %> diff --git a/httemplate/edit/part_pkg.cgi b/httemplate/edit/part_pkg.cgi index 60365f628..61e4086be 100755 --- a/httemplate/edit/part_pkg.cgi +++ b/httemplate/edit/part_pkg.cgi @@ -48,7 +48,7 @@ my $hashref = $part_pkg->hashref; %> -<%= header("$action Package Definition", menubar( +<%= include("/elements/header.html","$action Package Definition", menubar( 'Main Menu' => popurl(2), 'View all packages' => popurl(2). 'browse/part_pkg.cgi', )) %> diff --git a/httemplate/edit/part_svc.cgi b/httemplate/edit/part_svc.cgi index 9749fc12d..c5fff25e0 100755 --- a/httemplate/edit/part_svc.cgi +++ b/httemplate/edit/part_svc.cgi @@ -23,7 +23,7 @@ my $hashref = $part_svc->hashref; #" onLoad=\"visualize()\"" %> -<%= header("$action Service Definition", +<%= include("/elements/header.html","$action Service Definition", menubar( 'Main Menu' => $p, 'View all service definitions' => "${p}browse/part_svc.cgi" ), diff --git a/httemplate/edit/payment_gateway.html b/httemplate/edit/payment_gateway.html index 33cc236d0..cf825df00 100644 --- a/httemplate/edit/payment_gateway.html +++ b/httemplate/edit/payment_gateway.html @@ -17,7 +17,7 @@ my $action = $payment_gateway->gatewaynum ? 'Edit' : 'Add'; %> -<%= header("$action Payment gateway", menubar( +<%= include("/elements/header.html","$action Payment gateway", menubar( 'Main Menu' => $p, 'View all payment gateways' => $p. 'browse/payment_gateway.html', )) %> diff --git a/httemplate/edit/prepay_credit.cgi b/httemplate/edit/prepay_credit.cgi index 9cf0fc6e1..253edb94b 100644 --- a/httemplate/edit/prepay_credit.cgi +++ b/httemplate/edit/prepay_credit.cgi @@ -15,7 +15,7 @@ $cgi->param('multiplier', '60') unless $cgi->param('multiplier'); %> -<%= header('Generate prepaid cards'. ($agent ? ' for '. $agent->agent : ''), +<%= include("/elements/header.html",'Generate prepaid cards'. ($agent ? ' for '. $agent->agent : ''), menubar( 'Main Menu' => $p, )) %> diff --git a/httemplate/edit/process/prepay_credit.cgi b/httemplate/edit/process/prepay_credit.cgi index 25ecbe079..ca7472432 100644 --- a/httemplate/edit/process/prepay_credit.cgi +++ b/httemplate/edit/process/prepay_credit.cgi @@ -29,7 +29,7 @@ unless ( ref($error) ) { $cgi->redirect(popurl(3). "edit/prepay_credit.cgi?". $cgi->query_string ) %><% } else { %> -<%= header( "$num prepaid cards generated". +<%= include("/elements/header.html", "$num prepaid cards generated". ( $agent ? ' for '.$agent->agent : '' ), menubar( 'Main menu' => popurl(3) ) ) diff --git a/httemplate/edit/process/reg_code.cgi b/httemplate/edit/process/reg_code.cgi index 4658257f3..a86c7383a 100644 --- a/httemplate/edit/process/reg_code.cgi +++ b/httemplate/edit/process/reg_code.cgi @@ -28,7 +28,7 @@ unless ( ref($error) ) { $cgi->redirect(popurl(3). "edit/reg_code.cgi?". $cgi->query_string ) %><% } else { %> -<%= header("$num registration codes generated for ". $agent->agent, menubar( +<%= include("/elements/header.html","$num registration codes generated for ". $agent->agent, menubar( 'Main menu' => popurl(3), 'View all agents' => popurl(3). 'browse/agent.cgi', ) ) %> diff --git a/httemplate/edit/rate.cgi b/httemplate/edit/rate.cgi index 1771f0105..f8f67f6c4 100644 --- a/httemplate/edit/rate.cgi +++ b/httemplate/edit/rate.cgi @@ -26,7 +26,7 @@ my %granularity = ( %> -<%= header("$action Rate plan", menubar( +<%= include("/elements/header.html","$action Rate plan", menubar( 'Main Menu' => $p, 'View all rate plans' => "${p}browse/rate.cgi", )) diff --git a/httemplate/edit/rate_region.cgi b/httemplate/edit/rate_region.cgi index cc14dd37d..934fe8035 100644 --- a/httemplate/edit/rate_region.cgi +++ b/httemplate/edit/rate_region.cgi @@ -34,7 +34,7 @@ if ( @rate_prefix ) { %> -<%= header("$action Region", menubar( +<%= include("/elements/header.html","$action Region", menubar( 'Main Menu' => $p, #'View all regions' => "${p}browse/rate_region.cgi", )) diff --git a/httemplate/edit/reg_code.cgi b/httemplate/edit/reg_code.cgi index 899d1ec45..2fba39e00 100644 --- a/httemplate/edit/reg_code.cgi +++ b/httemplate/edit/reg_code.cgi @@ -6,7 +6,7 @@ my $agent = qsearchs('agent', { 'agentnum' => $agentnum } ); %> -<%= header('Generate registration codes for '. $agent->agent, menubar( +<%= include("/elements/header.html",'Generate registration codes for '. $agent->agent, menubar( 'Main Menu' => $p, )) %> diff --git a/httemplate/edit/svc_acct.cgi b/httemplate/edit/svc_acct.cgi index e74d84d53..1e87c67ad 100755 --- a/httemplate/edit/svc_acct.cgi +++ b/httemplate/edit/svc_acct.cgi @@ -119,7 +119,7 @@ my $p1 = popurl(1); %> -<%= header("$action $svc account") %> +<%= include("/elements/header.html","$action $svc account") %> <% if ( $cgi->param('error') ) { %> Error: <%= $cgi->param('error') %> diff --git a/httemplate/edit/svc_broadband.cgi b/httemplate/edit/svc_broadband.cgi index 9e064c5c8..cbd0c2c3a 100644 --- a/httemplate/edit/svc_broadband.cgi +++ b/httemplate/edit/svc_broadband.cgi @@ -82,7 +82,7 @@ my ($ip_addr, $speed_up, $speed_down, $blocknum) = %> -<%=header("Broadband Service $action", '')%> +<%=include("/elements/header.html","Broadband Service $action", '')%> <% if ($cgi->param('error')) { %> Error: <%=$cgi->param('error')%>
diff --git a/httemplate/edit/svc_forward.cgi b/httemplate/edit/svc_forward.cgi index 2b9d35ad1..c1b90a9bd 100755 --- a/httemplate/edit/svc_forward.cgi +++ b/httemplate/edit/svc_forward.cgi @@ -110,7 +110,7 @@ my $src = $svc_forward->dbdef_table->column('src') ? $svc_forward->src : ''; %> -<%= header("Mail Forward $action") %> +<%= include("/elements/header.html","Mail Forward $action") %> <% if ( $cgi->param('error') ) { %> Error: <%= $cgi->param('error') %> -- cgit v1.2.1 From a5a4afbb77bbdffc25ae94d10b645b0bcc76e859 Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 31 Jan 2006 11:02:54 +0000 Subject: *** empty log message *** --- httemplate/edit/part_bill_event.cgi | 126 ++++++++++++++++++++++++------------ 1 file changed, 86 insertions(+), 40 deletions(-) (limited to 'httemplate/edit') diff --git a/httemplate/edit/part_bill_event.cgi b/httemplate/edit/part_bill_event.cgi index 32ca47af4..57eedbc71 100755 --- a/httemplate/edit/part_bill_event.cgi +++ b/httemplate/edit/part_bill_event.cgi @@ -1,4 +1,4 @@ - + <% if ( $cgi->param('eventpart') && $cgi->param('eventpart') =~ /^(\d+)$/ ) { @@ -23,48 +23,86 @@ if ( $query && $query =~ /^(\d+)$/ ) { $action ||= $part_bill_event->eventpart ? 'Edit' : 'Add'; my $hashref = $part_bill_event->hashref; -print header("$action Invoice Event Definition", menubar( - 'Main Menu' => popurl(2), - 'View all invoice events' => popurl(2). 'browse/part_bill_event.cgi', -)); +%> -print qq!Error: !, $cgi->param('error'), - "" - if $cgi->param('error'); +<%= include('/elements/header.html', + "$action Invoice Event Definition", + menubar( + 'Main Menu' => popurl(2), + 'View all invoice events' => popurl(2). 'browse/part_bill_event.cgi', + ) + ) +%> -print '
'. - ''; -print "Invoice Event #", $hashref->{eventpart} ? $hashref->{eventpart} : "(NEW)"; +<% if ( $cgi->param('error') ) { %> + Error: <%= $cgi->param('error') %> +<% } %> -print ntable("#cccccc",2), <Payby +Invoice Event #<%= $hashref->{eventpart} ? $hashref->{eventpart} : "(NEW)" %> -for (qw(CARD DCRD CHEK DCHK LECB BILL COMP)) { - print qq!"; - } else { - print ">$_"; - } -} +<%= ntable("#cccccc",2) %> -my $days = $hashref->{seconds}/86400; + + Event name + + -print < -Event -After days -END + + For + + customers + + + + <% my $days = $hashref->{seconds}/86400; %> -print 'Disabled'; -print '{disabled} eq "Y"; -print '>'; -print ''; + + After + days + -print 'Action'; + + Test event + + + + + + + + Disabled + + {disabled} eq 'Y' ? ' CHECKED' : '' %>> + + + + + Action + + +<% #print ntable(); @@ -113,7 +151,7 @@ tie my %events, 'Tie::IxHash', 'code' => '$cust_main->suspend();', 'weight' => 10, }, - 'suspend' => { + 'suspend-if-balance' => { 'name' => 'Suspend if balance (this invoice and previous) over', 'code' => '$cust_bill->cust_suspend_if_balance_over( %%%balanceover%%% );', 'html' => " $money_char ". '', @@ -174,13 +212,13 @@ tie my %events, 'Tie::IxHash', }, 'send' => { - 'name' => 'Send invoice (email/print)', + 'name' => 'Send invoice (email/print/fax)', 'code' => '$cust_bill->send();', 'weight' => 50, }, 'send_alternate' => { - 'name' => 'Send invoice (email/print) with alternate template', + 'name' => 'Send invoice (email/print/fax) with alternate template', 'code' => '$cust_bill->send(\'%%%templatename%%%\');', 'html' => '', @@ -188,7 +226,7 @@ tie my %events, 'Tie::IxHash', }, 'send_if_newest' => { - 'name' => 'Send invoice (email/print) with alternate template, if it is still the newest invoice (useful for late notices - set to 31 days or later)', + 'name' => 'Send invoice (email/print/fax) with alternate template, if it is still the newest invoice (useful for late notices - set to 31 days or later)', 'code' => '$cust_bill->send_if_newest(\'%%%if_newest_templatename%%%\');', 'html' => '', @@ -196,7 +234,7 @@ tie my %events, 'Tie::IxHash', }, 'send_agent' => { - 'name' => 'Send invoice (email/print) ', + 'name' => 'Send invoice (email/print/fax) ', 'code' => '$cust_bill->send(\'%%%agent_templatename%%%\', [ %%%agentnum%%% ], \'%%%agent_invoice_from%%%\');', 'html' => sub { ' @@ -263,6 +301,7 @@ tie my %events, 'Tie::IxHash', 'code' => '$cust_bill->spool_csv( \'format\' => \'%%%spoolformat%%%\', \'dest\' => \'%%%spooldest%%%\', + \'balanceover\' => \'%%%spoolbalanceover%%%\', \'agent_spools\' => \'%%%spoolagent_spools%%%\', );', 'html' => sub { @@ -303,6 +342,13 @@ tie my %events, 'Tie::IxHash', $html .= ''. ''. + + ''. + ''. + ''. ''. ' - - + - + - +
if balance (this invoice and previous) over '. + "$money_char ". + ''. + '
Individual per-agent spools? {'spoolagent_spools'} ? 'CHECKED' : '' ). -- cgit v1.2.1 From 860e628d3d0d2ba432d401de5c9d4784c918be54 Mon Sep 17 00:00:00 2001 From: ivan Date: Sun, 5 Feb 2006 12:27:20 +0000 Subject: payment gateway editing --- httemplate/edit/payment_gateway.html | 103 ++++++++++++++++----------- httemplate/edit/process/payment_gateway.html | 2 +- 2 files changed, 62 insertions(+), 43 deletions(-) (limited to 'httemplate/edit') diff --git a/httemplate/edit/payment_gateway.html b/httemplate/edit/payment_gateway.html index cf825df00..1eda11249 100644 --- a/httemplate/edit/payment_gateway.html +++ b/httemplate/edit/payment_gateway.html @@ -34,70 +34,89 @@ Gateway #<%= $payment_gateway->gatewaynum || "(NEW)" %>
Gateway: + + <% if ( $payment_gateway->gatewaynum ) { %> + + <%= $payment_gateway->gateway_module %> + + + <% } else { %> + + + <% } %> - +
Username:
Password:
Action:
Options: + +
diff --git a/httemplate/edit/process/payment_gateway.html b/httemplate/edit/process/payment_gateway.html index b9e4d47da..42205a02d 100644 --- a/httemplate/edit/process/payment_gateway.html +++ b/httemplate/edit/process/payment_gateway.html @@ -17,7 +17,7 @@ my %options = @options; my $error; if ( $gatewaynum ) { - $error=$new->replace($old); + $error=$new->replace($old, \%options); } else { $error=$new->insert(\%options); $gatewaynum=$new->getfield('gatewaynum'); -- cgit v1.2.1 From 1acbcf55d8cd4675408f8ad3406f431623918c8d Mon Sep 17 00:00:00 2001 From: ivan Date: Tue, 7 Feb 2006 11:12:29 +0000 Subject: remove inadvertant extra table statement preventing page from showing up in konq --- httemplate/edit/cust_pay.cgi | 2 -- 1 file changed, 2 deletions(-) (limited to 'httemplate/edit') diff --git a/httemplate/edit/cust_pay.cgi b/httemplate/edit/cust_pay.cgi index 94fd06ca5..a03a245eb 100755 --- a/httemplate/edit/cust_pay.cgi +++ b/httemplate/edit/cust_pay.cgi @@ -52,8 +52,6 @@ $title .= " against Invoice #$linknum" if $link eq 'invnum';

<% } %> -<%= ntable("#cccccc",2) %> - -- cgit v1.2.1 From 600a0939e7e7e589dae4f4f5bfef3650728940b7 Mon Sep 17 00:00:00 2001 From: ivan Date: Wed, 8 Mar 2006 10:05:01 +0000 Subject: Add a new table for inventory with for DIDs/serials/etc., and an additional new table for inventory category (i.e. to distinguish DIDs, serials, MACs, etc.) --- httemplate/edit/elements/edit.html | 118 ++++++++++++++++++++++++++ httemplate/edit/inventory_class.html | 9 ++ httemplate/edit/process/elements/process.html | 46 ++++++++++ httemplate/edit/process/inventory_class.html | 4 + 4 files changed, 177 insertions(+) create mode 100644 httemplate/edit/elements/edit.html create mode 100644 httemplate/edit/inventory_class.html create mode 100644 httemplate/edit/process/elements/process.html create mode 100644 httemplate/edit/process/inventory_class.html (limited to 'httemplate/edit') diff --git a/httemplate/edit/elements/edit.html b/httemplate/edit/elements/edit.html new file mode 100644 index 000000000..ce6e2dbb1 --- /dev/null +++ b/httemplate/edit/elements/edit.html @@ -0,0 +1,118 @@ +<% + + # options example... + # + # 'name' => + # 'table' => + # #? 'primary_key' => #required when the dbdef doesn't know...??? + # 'labels' => { + # 'column' => 'Label', + # } + # + # listref - each item is a literal column name (or method) or (notyet) coderef + # if not specified all columns (except for the primary key) will be editable + # 'fields' => [ + # ] + # + # 'menubar' => '', #menubar arrayref + + my(%opt) = @_; + + #false laziness w/process.html + my $table = $opt{'table'}; + my $class = "FS::$table"; + my $pkey = dbdef->table($table)->primary_key; #? $opt{'primary_key'} || + my $fields = $opt{'fields'} + #|| [ grep { $_ ne $pkey } dbdef->table($table)->columns ]; + || [ grep { $_ ne $pkey } fields($table) ]; + + my $object; + if ( $cgi->param('error') ) { + + $object = $class->new( { + map { $_ => scalar($cgi->param($_)) } fields($table) + }); + + } elsif ( $cgi->keywords ) { #editing + + my( $query ) = $cgi->keywords; + $query =~ /^(\d+)$/; + $object = qsearchs( $table, { $pkey => $1 } ); + + } else { #adding + + $object = $class->new( {} ); + + } + + my $action = $object->$pkey() ? 'Edit' : 'Add'; + + my $title = "$action $opt{'name'}"; + + my @menubar = (); + if ( $opt{'menubar'} ) { + @menubar = @{ $opt{'menubar'} }; + } else { + @menubar = ( + 'Main menu' => $p, #eventually get rid of this when the ACL/UI update is done + "View all $opt{'name'}s" => "${p}search/$table.html", #eventually use Lingua::bs to pluralize + ); + } + +%> + + +<%= include("/elements/header.html", $title, + include( '/elements/menubar.html', @menubar ) + ) +%> + +<% if ( $cgi->param('error') ) { %> + Error: <%= $cgi->param('error') %> +

+<% } %> + + + +<%= ( $opt{labels} && exists $opt{labels}->{$pkey} ) + ? $opt{labels}->{$pkey} + : $pkey +%> +#<%= $object->$pkey() || "(NEW)" %> + +<%= ntable("#cccccc",2) %> + +<% foreach my $field ( @$fields ) { %> + + + + + <%= ( $opt{labels} && exists $opt{labels}->{$field} ) + ? $opt{labels}->{$field} + : $field + %> + + + <% + #just text in one size for now... eventually more options for + # uneditable, hidden, + + + + +<% } %> + + + +
+ +"> + + + +<%= include("/elements/footer.html") %> + diff --git a/httemplate/edit/inventory_class.html b/httemplate/edit/inventory_class.html new file mode 100644 index 000000000..5dde2e595 --- /dev/null +++ b/httemplate/edit/inventory_class.html @@ -0,0 +1,9 @@ +<%= include( 'elements/edit.html', + 'name' => 'Inventory Class', + 'table' => 'inventory_class', + 'labels' => { + 'classnum' => 'Class number', + 'classname' => 'Class name', + }, + ) +%> diff --git a/httemplate/edit/process/elements/process.html b/httemplate/edit/process/elements/process.html new file mode 100644 index 000000000..52c876720 --- /dev/null +++ b/httemplate/edit/process/elements/process.html @@ -0,0 +1,46 @@ +<% + + # options example... + # + # 'table' => + # #? 'primary_key' => #required when the dbdef doesn't know...??? + # #? 'fields' => [] + + my(%opt) = @_; + + #false laziness w/edit.html + my $table = $opt{'table'}; + my $class = "FS::$table"; + my $pkey = dbdef->table($table)->primary_key; #? $opt{'primary_key'} || + my $fields = $opt{'fields'} + #|| [ grep { $_ ne $pkey } dbdef->table($table)->columns ]; + || [ fields($table) ]; + + my $pkeyvalue = $cgi->param($pkey); + + my $old = qsearchs( $table, { $pkey => $pkeyvalue } ) if $pkeyvalue; + + my $new = $class->new( { + map { + $_, scalar($cgi->param($_)); + } @$fields + } ); + + my $error; + if ( $pkeyvalue ) { + $error = $new->replace($old); + } else { + warn $new; + $error = $new->insert; + warn $error; + $pkeyvalue = $new->getfield($pkey); + } + + if ( $error ) { + $cgi->param('error', $error); + print $cgi->redirect(popurl(2). "$table.html?". $cgi->query_string ); + } else { + print $cgi->redirect(popurl(3). "search/$table.html"); + } + +%> diff --git a/httemplate/edit/process/inventory_class.html b/httemplate/edit/process/inventory_class.html new file mode 100644 index 000000000..e30e74e7b --- /dev/null +++ b/httemplate/edit/process/inventory_class.html @@ -0,0 +1,4 @@ +<%= include( 'elements/process.html', + 'table' => 'inventory_class', + ) +%> -- cgit v1.2.1 From ff24bc786a5fd479f2252260e0da580a736f97be Mon Sep 17 00:00:00 2001 From: ivan Date: Mon, 20 Mar 2006 19:13:27 +0000 Subject: add price plan to bill on internal or external CDRs directly, add option to export CDRs to a per-customer downstream file --- httemplate/edit/cust_main/billing.html | 10 ++++++++- httemplate/edit/part_pkg.cgi | 39 +++++++++++++++++++++++++--------- httemplate/edit/rate.cgi | 7 ++++-- 3 files changed, 43 insertions(+), 13 deletions(-) (limited to 'httemplate/edit') diff --git a/httemplate/edit/cust_main/billing.html b/httemplate/edit/cust_main/billing.html index 96f777baa..790f41f00 100644 --- a/httemplate/edit/cust_main/billing.html +++ b/httemplate/edit/cust_main/billing.html @@ -348,7 +348,7 @@ if ( $payby_default eq 'HIDE' ) { ); - + #this should use FS::payby my %allopt = ( 'CARD' => 'Credit card', 'CHEK' => 'Electronic check', @@ -433,6 +433,14 @@ if ( $payby_default eq 'HIDE' ) { + <% if ( $conf->exists('voip-cust_cdr_spools') ) { %> + + spool_cdr eq "Y" ? 'CHECKED' : '' %>> Spool CDRs + + <% } else { %> + + <% } %> + diff --git a/httemplate/edit/part_pkg.cgi b/httemplate/edit/part_pkg.cgi index 61e4086be..158c6e2ff 100755 --- a/httemplate/edit/part_pkg.cgi +++ b/httemplate/edit/part_pkg.cgi @@ -297,16 +297,35 @@ my $widget = new HTML::Widgets::SelectLayers( $html .= ' MULTIPLE' if $href->{$field}{'type'} eq 'select_multiple'; $html .= qq! NAME="$field" onChange="fchanged(this)">!; - foreach my $record ( - qsearch( $href->{$field}{'select_table'}, - $href->{$field}{'select_hash'} ) - ) { - my $value = $record->getfield($href->{$field}{'select_key'}); - $html .= qq!