default to a session cookie instead of setting an explicit timeout, weird timezone...
[freeside.git] / httemplate / edit / process / deploy_zone-fixed.html
1 <& elements/process.html, 
2     debug => 1,
3     error_redirect => popurl(2).'deploy_zone-fixed.html',
4     table       => 'deploy_zone',
5     viewall_dir => 'browse',
6     precheck_callback => $precheck_callback,
7     process_o2m =>
8       { 'table'  => 'deploy_zone_vertex',
9                      'fields' => [qw( latitude longitude )]
10       },
11     progress_init => [
12       'PostForm',
13       [ 'zonenum' ],
14       $fsurl.'misc/process/deploy_zone-block_lookup.cgi',
15       $fsurl.'browse/deploy_zone.html',
16     ],
17 &>
18 <%init>
19 my $precheck_callback = sub {
20   # convert the vertex list into a process_o2m-style parameter list
21   if ( $cgi->param('vertices') ) {
22     my $vertices = decode_json($cgi->param('vertices'));
23     my $i = 0;
24     foreach (@$vertices) {
25       $cgi->param("vertexnum${i}", '');
26       $cgi->param("vertexnum${i}_latitude", $_->[0]);
27       $cgi->param("vertexnum${i}_longitude", $_->[1]);
28       $i++;
29     }
30   }
31   if ( length $cgi->param('active_date') ) {
32     my $date = parse_datetime( $cgi->param('active_date') );
33     $cgi->param('active_date', $date);
34   }
35   '';
36 };
37 </%init>