From 5ead832579f92d08a6ed31b967925a980f99c249 Mon Sep 17 00:00:00 2001 From: Christopher Burger Date: Mon, 28 Aug 2017 11:50:25 -0400 Subject: [PATCH] RT# 77200 - Changed fixed active date to a user input date --- httemplate/edit/deploy_zone-fixed.html | 8 ++++++-- httemplate/edit/deploy_zone-mobile.html | 7 +++++-- httemplate/edit/process/deploy_zone-fixed.html | 4 ++++ httemplate/edit/process/deploy_zone-mobile.html | 4 ++++ 4 files changed, 19 insertions(+), 4 deletions(-) diff --git a/httemplate/edit/deploy_zone-fixed.html b/httemplate/edit/deploy_zone-fixed.html index b8d9f8bbc..24e03b01a 100644 --- a/httemplate/edit/deploy_zone-fixed.html +++ b/httemplate/edit/deploy_zone-fixed.html @@ -19,6 +19,7 @@ 'file' => 'Import blocks from text file', 'censusyear' => 'as census year', }, + 'fields' => [ { field => 'zonetype', type => 'hidden', @@ -30,8 +31,11 @@ }, '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', diff --git a/httemplate/edit/deploy_zone-mobile.html b/httemplate/edit/deploy_zone-mobile.html index 8cec298bf..e7f534cb8 100644 --- a/httemplate/edit/deploy_zone-mobile.html +++ b/httemplate/edit/deploy_zone-mobile.html @@ -23,8 +23,11 @@ }, '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', diff --git a/httemplate/edit/process/deploy_zone-fixed.html b/httemplate/edit/process/deploy_zone-fixed.html index 0033bbe52..b22e63066 100644 --- a/httemplate/edit/process/deploy_zone-fixed.html +++ b/httemplate/edit/process/deploy_zone-fixed.html @@ -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); + } ''; }; diff --git a/httemplate/edit/process/deploy_zone-mobile.html b/httemplate/edit/process/deploy_zone-mobile.html index d36d5d448..9b205ab6e 100644 --- a/httemplate/edit/process/deploy_zone-mobile.html +++ b/httemplate/edit/process/deploy_zone-mobile.html @@ -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); + } ''; }; -- 2.11.0