X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Fpart_pkg.cgi;h=8d33ba6473ab4b5e673c4eddb70af5dad6939144;hb=f76241e0d0252e50170706d8bfa9b79cdbae59b4;hp=0f597b214a4f923b0182ef6c245977b8181c5514;hpb=8eaca892209d0dd716f42390b7c41cdf12914aab;p=freeside.git diff --git a/httemplate/edit/part_pkg.cgi b/httemplate/edit/part_pkg.cgi index 0f597b214..8d33ba647 100755 --- a/httemplate/edit/part_pkg.cgi +++ b/httemplate/edit/part_pkg.cgi @@ -54,6 +54,7 @@ 'report_option' => 'Report classes', 'fcc_ds0s' => 'Voice-grade equivalents', 'fcc_voip_class' => 'Category', + 'delay_start' => 'Default delay (days)', }, 'fields' => [ @@ -170,6 +171,16 @@ { field=>'setup_cost', type=>'money', }, { field=>'recur_cost', type=>'money', }, + ( $conf->exists('part_pkg-delay_start') + ? ( { type => 'tablebreak-tr-title', + value => 'Delayed start', + }, + { field => 'delay_start', + type => 'text', size => 6 }, + ) + : () + ), + { type => 'columnnext' }, { field => 'agent_type', @@ -201,7 +212,6 @@ : () ), - { type => 'columnend' }, { 'type' => $report_option ? 'tablebreak-tr-title' @@ -405,20 +415,8 @@ my $new_object_callback = sub { }; -my $edit_callback = sub { - my( $cgi, $object, $fields, $opt ) = @_; - - $setup_show_zero_disabled = ($object->option('setup_fee') > 0) ? 1 : 0; - - $recur_disabled = $object->freq ? 0 : 1; - - $recur_show_zero_disabled = - $object->freq - ? $object->option('recur_fee') > 0 ? 1 : 0 - : 1; - - (@agent_type) = - map {$_->typenum} qsearch('type_pkgs', { 'pkgpart' => $object->pkgpart } ); +sub set_report_option { + my($cgi, $object, $fields ) = @_; #, $opt my @report_option = (); foreach ($object->options) { @@ -441,6 +439,25 @@ my $edit_callback = sub { $field->{value} = join(',', @report_option); } +} + +my $edit_callback = sub { + my( $cgi, $object, $fields, $opt ) = @_; + + $setup_show_zero_disabled = ($object->option('setup_fee') > 0) ? 1 : 0; + + $recur_disabled = $object->freq ? 0 : 1; + + $recur_show_zero_disabled = + $object->freq + ? $object->option('recur_fee') > 0 ? 1 : 0 + : 1; + + (@agent_type) = + map {$_->typenum} qsearch('type_pkgs', { 'pkgpart' => $object->pkgpart } ); + + set_report_option( $cgi, $object, $fields); + %options = $object->options; $object->set($_ => $object->option($_, 1)) @@ -480,13 +497,15 @@ my $clone_callback = sub { $object->disabled('Y'); - } else { #not when cloning... + } else { #when explicitly cloning, not customizing (@agent_type) = map {$_->typenum} qsearch('type_pkgs',{ 'pkgpart' => $object->pkgpart } ); } + set_report_option( $cgi, $object, $fields); + %options = $object->options; $object->set($_ => $options{$_})