X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Fprocess%2Fdeploy_zone-fixed.html;h=b22e63066f83b3243e3c45bc1f0d04a10e808359;hb=b71b1576c68bc40ad26592b354feace37a029f0e;hp=eae3a746d82e0fecc35811e077caefe6c858d847;hpb=46ba9270a226ef01d0c29635373aef09ae42d372;p=freeside.git diff --git a/httemplate/edit/process/deploy_zone-fixed.html b/httemplate/edit/process/deploy_zone-fixed.html index eae3a746d..b22e63066 100644 --- a/httemplate/edit/process/deploy_zone-fixed.html +++ b/httemplate/edit/process/deploy_zone-fixed.html @@ -3,12 +3,35 @@ error_redirect => popurl(2).'deploy_zone-fixed.html', table => 'deploy_zone', viewall_dir => 'browse', - process_o2m => { - 'table' => 'deploy_zone_block', - 'fields' => [qw( censusblock censusyear )] - }, - process_upload => { - 'process' => 'misc/process/deploy_zone-import.html', - 'fields' => [qw( censusyear format )], - }, + precheck_callback => $precheck_callback, + process_o2m => + { 'table' => 'deploy_zone_vertex', + 'fields' => [qw( latitude longitude )] + }, + progress_init => [ + 'PostForm', + [ 'zonenum' ], + $fsurl.'misc/process/deploy_zone-block_lookup.cgi', + $fsurl.'browse/deploy_zone.html', + ], &> +<%init> +my $precheck_callback = sub { + # convert the vertex list into a process_o2m-style parameter list + if ( $cgi->param('vertices') ) { + my $vertices = decode_json($cgi->param('vertices')); + my $i = 0; + foreach (@$vertices) { + $cgi->param("vertexnum${i}", ''); + $cgi->param("vertexnum${i}_latitude", $_->[0]); + $cgi->param("vertexnum${i}_longitude", $_->[1]); + $i++; + } + } + if ( length $cgi->param('active_date') ) { + my $date = parse_datetime( $cgi->param('active_date') ); + $cgi->param('active_date', $date); + } + ''; +}; +