RT# 77200 - Changed fixed active date to a user input date
authorChristopher Burger <burgerc@freeside.biz>
Mon, 28 Aug 2017 15:50:25 +0000 (11:50 -0400)
committerChristopher Burger <burgerc@freeside.biz>
Tue, 29 Aug 2017 12:52:58 +0000 (08:52 -0400)
httemplate/edit/deploy_zone-fixed.html
httemplate/edit/deploy_zone-mobile.html
httemplate/edit/process/deploy_zone-fixed.html
httemplate/edit/process/deploy_zone-mobile.html

index b8d9f8b..24e03b0 100644 (file)
@@ -19,6 +19,7 @@
         'file'            => 'Import blocks from text file',
         'censusyear'      => 'as census year',
     },
+
     'fields'        => [
         { field         => 'zonetype',
           type          => 'hidden',
         },
         'description',
         { field         => 'active_date',
-          type          => 'fixed-date',
-          value         => time,
+          type          => 'input-date-field',
+          curr_value_callback => sub {
+            my ($cgi, $object) = @_;
+            $cgi->param('active_date') || $object->active_date || time;
+          },
         },
         { field         => 'agentnum',
           type          => 'select-agent',
index 8cec298..e7f534c 100644 (file)
         },
         'description',
         { field         => 'active_date',
-          type          => 'fixed-date',
-          value         => time,
+          type          => 'input-date-field',
+          curr_value_callback => sub {
+            my ($cgi, $object) = @_;
+            $cgi->param('active_date') || $object->active_date || time;
+          },
         },
         { field         => 'agentnum',
           type          => 'select-agent',
index 0033bbe..b22e630 100644 (file)
@@ -28,6 +28,10 @@ my $precheck_callback = sub {
       $i++;
     }
   }
+  if ( length $cgi->param('active_date') ) {
+    my $date = parse_datetime( $cgi->param('active_date') );
+    $cgi->param('active_date', $date);
+  }
   '';
 };
 </%init>
index d36d5d4..9b205ab 100644 (file)
@@ -21,6 +21,10 @@ my $precheck_callback = sub {
       $i++;
     }
   }
+  if ( length $cgi->param('active_date') ) {
+    my $date = parse_datetime( $cgi->param('active_date') );
+    $cgi->param('active_date', $date);
+  }
   '';
 };
 </%init>