[Rt-commit] rt branch, 4.0/cf-date-keep-input-value, created. rt-4.0.5-112-g169d749

? sunnavy sunnavy at bestpractical.com
Wed Mar 28 01:03:43 EDT 2012


The branch, 4.0/cf-date-keep-input-value has been created
        at  169d74918c7060081ade97381bb2cb4f0324a8b2 (commit)

- Log -----------------------------------------------------------------
commit 169d74918c7060081ade97381bb2cb4f0324a8b2
Author: sunnavy <sunnavy at bestpractical.com>
Date:   Wed Mar 28 12:58:58 2012 +0800

    we should keep the input value for cf date/datetime
    
    without that, we may lose its value if first "submit" fails.
    see #19660

diff --git a/share/html/Elements/EditCustomFieldDate b/share/html/Elements/EditCustomFieldDate
index c66640f..a1f6679 100644
--- a/share/html/Elements/EditCustomFieldDate
+++ b/share/html/Elements/EditCustomFieldDate
@@ -46,7 +46,7 @@
 %#
 %# END BPS TAGGED BLOCK }}}
 % my $name = $NamePrefix.$CustomField->Id.'-Values';
-<& /Elements/SelectDate, Name => "$name", current => 0, ShowTime => 0 &> (<%$DateObj->AsString(Time => 0)%>)
+<& /Elements/SelectDate, Name => "$name", Default => $Default, current => 0, ShowTime => 0 &> (<%$DateObj->AsString(Time => 0)%>)
 
 <%INIT>
 my $DateObj = RT::Date->new ( $session{'CurrentUser'} );
diff --git a/share/html/Elements/EditCustomFieldDateTime b/share/html/Elements/EditCustomFieldDateTime
index a558884..e64b612 100644
--- a/share/html/Elements/EditCustomFieldDateTime
+++ b/share/html/Elements/EditCustomFieldDateTime
@@ -46,7 +46,7 @@
 %#
 %# END BPS TAGGED BLOCK }}}
 % my $name = $NamePrefix.$CustomField->Id.'-Values';
-<& /Elements/SelectDate, Name => "$name", current => 0 &> (<%$DateObj->AsString%>)
+<& /Elements/SelectDate, Name => "$name", Default => $Default, current => 0 &> (<%$DateObj->AsString%>)
 
 <%INIT>
 my $DateObj = RT::Date->new ( $session{'CurrentUser'} );
diff --git a/share/html/Elements/SelectDate b/share/html/Elements/SelectDate
index 18b42ad..251f58f 100755
--- a/share/html/Elements/SelectDate
+++ b/share/html/Elements/SelectDate
@@ -57,7 +57,7 @@ unless ((defined $Default) or
                            $year+1900,$mon+1,$mday,                            
                            $hour,$min);   
 }
-$Value = $Value || $Default;
+$Value = $Value || $Default || '';
 
 unless ($Name) {
 	$Name = $menu_prefix. "_Date";

-----------------------------------------------------------------------


More information about the Rt-commit mailing list