X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Fprocess%2Felements%2Fprocess.html;h=d2b0370537ec0a425399e8d8854c82360a5339cb;hb=6edc36f4ffe2d2a53d4c8cea4318f3a95eda54b4;hp=76722c960f29e17f7ee2446bfd2d513aabe8d0a8;hpb=76b22e66bf8e615def0a24cd8cda23c3949eae70;p=freeside.git diff --git a/httemplate/edit/process/elements/process.html b/httemplate/edit/process/elements/process.html index 76722c960..d2b037053 100644 --- a/httemplate/edit/process/elements/process.html +++ b/httemplate/edit/process/elements/process.html @@ -80,8 +80,12 @@ Example: 'precheck_callback' => sub { my( $cgi ) = @_; }, #after the new object is created + #return an error string or empty for no error 'post_new_object_callback' => sub { my( $cgi, $object ) = @_; }, + #run right before replacing (not run for inserts) + 'edit_callback' => sub { my( $new, $old ) = @_; }, + #after everything's inserted 'noerror_callback' => sub { my( $cgi, $object ) = @_; }, @@ -89,6 +93,9 @@ Example: # for use with tables that are FS::option_Common (among other things) 'args_callback' => sub { my( $cgi, $object ) = @_; }, + # if no errors after package insert or replace will update services attached to package. + 'update_svc' => sub { my( $cgi, $object ) = @_; }, + 'debug' => 1, #turns on debugging output #agent virtualization @@ -273,7 +280,7 @@ foreach my $value ( @values ) { } if ( $opt{'post_new_object_callback'} ) { - &{ $opt{'post_new_object_callback'} }( $cgi, $new ); + $error ||= &{ $opt{'post_new_object_callback'} }( $cgi, $new ); } if ( $opt{'agent_virt'} ) { @@ -438,6 +445,12 @@ foreach my $value ( @values ) { } } + if ( !$error and $opt{'update_svc'} ) { + my @args = (); + @args = &{ $opt{'args_callback'} }( $cgi, $new ) if $opt{'args_callback'}; + $error = &{ $opt{'update_svc'} }( $cgi, $new, @args ); + } + if ( $error ) { $cgi->param('error', $error); @@ -459,6 +472,14 @@ foreach my $value ( @values ) { } +if ($class eq "FS::tower") { + foreach my $part_svc_broadband_export ( FS::tower_sector->part_export_svc_broadband ) { + if ($part_svc_broadband_export and $part_svc_broadband_export->can('export_tower_sector')) { + $error = $part_svc_broadband_export->export_tower_sector($new); + } + } +} + # set up redirect URLs my $redirect;