X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fedit%2Fprocess%2Fdeploy_zone-mobile.html;h=d36d5d448303756972d6916e92beb89ea5a30464;hb=6e638a436bee0c28fbb702374659d75b928a9a3a;hp=c913c5cd6da0c719c4beb9151348728e005976c4;hpb=7c370a4579d1ed8b81dba2fb5fae9978b283b49e;p=freeside.git diff --git a/httemplate/edit/process/deploy_zone-mobile.html b/httemplate/edit/process/deploy_zone-mobile.html index c913c5cd6..d36d5d448 100644 --- a/httemplate/edit/process/deploy_zone-mobile.html +++ b/httemplate/edit/process/deploy_zone-mobile.html @@ -1,9 +1,26 @@ <& elements/process.html, - error_redirect => popurl(2).'deploy_zone-mobile.html?', + error_redirect => popurl(2).'deploy_zone-mobile.html', table => 'deploy_zone', viewall_dir => 'browse', - process_o2m => + precheck_callback => $precheck_callback, + process_o2m => { 'table' => 'deploy_zone_vertex', 'fields' => [qw( latitude longitude )] }, &> +<%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++; + } + } + ''; +}; +