summaryrefslogtreecommitdiff
path: root/httemplate/edit/process/deploy_zone-mobile.html
diff options
context:
space:
mode:
authorMark Wells <mark@freeside.biz>2015-09-30 22:49:38 -0700
committerMark Wells <mark@freeside.biz>2015-09-30 22:50:00 -0700
commitf485dcdf05ee107645299197a9ab9d9dd3f22be3 (patch)
tree541d64f13a8ebd4a2d448295a68182a58de63fb2 /httemplate/edit/process/deploy_zone-mobile.html
parent9e99a610a2c69db3ab9f42728ab6dbf492a5496a (diff)
graphical selection of deployment zones and automatic block lookup, #30260
Diffstat (limited to 'httemplate/edit/process/deploy_zone-mobile.html')
-rw-r--r--httemplate/edit/process/deploy_zone-mobile.html19
1 files changed, 18 insertions, 1 deletions
diff --git a/httemplate/edit/process/deploy_zone-mobile.html b/httemplate/edit/process/deploy_zone-mobile.html
index 7b8f911ec..d36d5d448 100644
--- a/httemplate/edit/process/deploy_zone-mobile.html
+++ b/httemplate/edit/process/deploy_zone-mobile.html
@@ -2,8 +2,25 @@
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++;
+ }
+ }
+ '';
+};
+</%init>