[Rt-commit] rt branch, no-prototype, updated. rt-3.8.8-219-g0dae88e

Alex Vandiver alexmv at bestpractical.com
Wed Aug 11 13:22:36 EDT 2010


The branch, no-prototype has been updated
       via  0dae88e930dbd6cd36eb8a79e9246b87515572e5 (commit)
       via  88bd8b0c9fd484451dcce27a0fa543f36323ab69 (commit)
       via  fe0ee7915be9eb9d35dcceb6521724ab8b6e460f (commit)
       via  6633f23ca23ab371e48cd4b2994ec6a9be228c45 (commit)
       via  c49fa80cb29c1ac64c75291c9db16414d7824e9c (commit)
       via  2c88d50aefe3ec7fe3fa094da553c091a7b38819 (commit)
       via  66271b1b9374082a291971b92f5b17c507a87121 (commit)
       via  c05542d69e9e8ceb0f3146806cb61313c8fbe56c (commit)
       via  ddc5a1fdd46494a28c0fd9bd0072df62016571aa (commit)
       via  312ee7b4f8bced27ae606cb00f5cb67b160a3589 (commit)
       via  4c2b63334aba6b3986c72192df1f82c723f3cf4b (commit)
       via  ee1b9a2a0e1156de21876a7ce3b8f84a8a84392f (commit)
       via  3f8e512c4bbda28958261541f88fc77042f3f7ea (commit)
       via  91bf43b6eb397e8ef321614c2377f724ba881e48 (commit)
       via  d1f00feb27cd256d65b140a2068b2b2369b7dee2 (commit)
       via  3f3eb8908b1790a1ed46af41e7b22b7cbdf5642f (commit)
       via  3cf583c6c1614053f105f80492b8e00ea63d300a (commit)
       via  e48fe729291aa1fd2c45627e72ee4ed352bdcd4d (commit)
       via  5149fbb17546a414cb103b2c458851eb040d9a4f (commit)
      from  5954df6614a1af462a2fcaadd7b7c19632968133 (commit)

Summary of changes:
 share/html/Elements/SelectDate |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)

- Log -----------------------------------------------------------------
commit 88bd8b0c9fd484451dcce27a0fa543f36323ab69
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Wed Aug 11 13:11:23 2010 -0400

    Revert "merge cf-date to get cf seperate date/datetime", which wasn't actually a merge
    
    This reverts commit 5954df6614a1af462a2fcaadd7b7c19632968133.

diff --git a/lib/RT/CustomField_Overlay.pm b/lib/RT/CustomField_Overlay.pm
index 28114d8..e156227 100755
--- a/lib/RT/CustomField_Overlay.pm
+++ b/lib/RT/CustomField_Overlay.pm
@@ -97,16 +97,6 @@ our %FieldTypes = (
         'Enter one value with autocompletion',            # loc
         'Enter up to [_1] values with autocompletion',    # loc
     ],
-    Date => [
-        'Select multiple dates',	# loc
-        'Select date',			# loc
-        'Select up to [_1] dates',	# loc
-    ],
-    DateTime => [
-        'Select multiple datetimes',	# loc
-        'Select datetime',			# loc
-        'Select up to [_1] datetimes',	# loc
-    ],
 );
 
 
@@ -840,7 +830,7 @@ Returns an array of all possible composite values for custom fields.
 
 sub TypeComposites {
     my $self = shift;
-    return grep !/(?:[Tt]ext|Combobox|Date|DateTime)-0/, map { ("$_-1", "$_-0") } $self->Types;
+    return grep !/(?:[Tt]ext|Combobox)-0/, map { ("$_-1", "$_-0") } $self->Types;
 }
 
 =head2 SetLookupType
@@ -1171,28 +1161,6 @@ sub AddValueForObject {
             $extra_values--;
         }
     }
-    # For date, we need to store Content as ISO date
-    if ( $self->Type eq 'DateTime' ) {
-        my $DateObj = new RT::Date( $self->CurrentUser );
-        $DateObj->Set(
-            Format => 'unknown',
-            Value  => $args{'Content'},
-        );
-        $args{'Content'} = $DateObj->ISO;
-    }
-    elsif ( $self->Type eq 'Date' ) {
-
-        # in case user input date with time, let's omit it by setting timezone
-        # to utc so "hour" won't affect "day"
-        my $DateObj = new RT::Date( $self->CurrentUser );
-        $DateObj->Set(
-            Format   => 'unknown',
-            Value    => $args{'Content'},
-            Timezone => 'UTC',
-        );
-        $args{'Content'} = $DateObj->Date( Timezone => 'UTC' );
-    }
-
     my $newval = RT::ObjectCustomFieldValue->new( $self->CurrentUser );
     my $val    = $newval->Create(
         ObjectType   => ref($obj),
diff --git a/lib/RT/Interface/Web.pm b/lib/RT/Interface/Web.pm
index be73cbe..7e5f975 100755
--- a/lib/RT/Interface/Web.pm
+++ b/lib/RT/Interface/Web.pm
@@ -1737,9 +1737,6 @@ sub _ProcessObjectCustomFieldUpdates {
                 $values_hash{$val} = 1 if $val;
             }
 
-            # For Date Cfs, @values is empty when there is no changes (no datas in form input)
-            return @results if ( $cf->Type =~ /^Date(?:Time)?$/ && ! @values );
-
             $cf_values->RedoSearch;
             while ( my $cf_value = $cf_values->Next ) {
                 next if $values_hash{ $cf_value->id };
diff --git a/lib/RT/Record.pm b/lib/RT/Record.pm
index 90854b5..9ecad76 100755
--- a/lib/RT/Record.pm
+++ b/lib/RT/Record.pm
@@ -1713,26 +1713,6 @@ sub _AddCustomFieldValue {
         }
 
         my $new_content = $new_value->Content;
-
-        # For datetime, we need to display them in "human" format in result message
-        #XXX TODO how about date without time?
-        if ($cf->Type eq 'DateTime') {
-            my $DateObj = new RT::Date( $self->CurrentUser );
-            $DateObj->Set(
-                Format => 'ISO',
-                Value  => $new_content,
-            );
-            $new_content = $DateObj->AsString;
-
-            if ( defined $old_content && length $old_content ) {
-                $DateObj->Set(
-                    Format => 'ISO',
-                    Value  => $old_content,
-                );
-                $old_content = $DateObj->AsString;
-            }
-        }
-
         unless ( defined $old_content && length $old_content ) {
             return ( $new_value_id, $self->loc( "[_1] [_2] added", $cf->Name, $new_content ));
         }
@@ -1821,21 +1801,11 @@ sub DeleteCustomFieldValue {
         return ( 0, $self->loc( "Couldn't create a transaction: [_1]", $Msg ) );
     }
 
-    my $old_value = $TransactionObj->OldValue;
-    # For datetime, we need to display them in "human" format in result message
-    if ( $cf->Type eq 'DateTime' ) {
-        my $DateObj = new RT::Date( $self->CurrentUser );
-        $DateObj->Set(
-            Format => 'ISO',
-            Value  => $old_value,
-        );
-        $old_value = $DateObj->AsString;
-    }
     return (
         $TransactionId,
         $self->loc(
             "[_1] is no longer a value for custom field [_2]",
-            $old_value, $cf->Name
+            $TransactionObj->OldValue, $cf->Name
         )
     );
 }
diff --git a/lib/RT/Tickets_Overlay.pm b/lib/RT/Tickets_Overlay.pm
index 31d612f..e8d350d 100755
--- a/lib/RT/Tickets_Overlay.pm
+++ b/lib/RT/Tickets_Overlay.pm
@@ -1423,164 +1423,111 @@ sub _CustomFieldLimit {
                 %rest
             );
         }
-        else {
-            my $cf = RT::CustomField->new( $self->CurrentUser );
-            $cf->Load($field);
-
-            # need special treatment for Date
-            if ( $cf->Type =~ /^Date(Time)?$/ ) {
-                my $is_datetime = $1 ? 1 : 0;
-                if ( $is_datetime && $op eq '=' ) {
-
-               # if we're specifying =, that means we want everything on a
-               # particular single day.  in the database, we need to check for >
-               # and < the edges of that day.
-
-                    my $date = RT::Date->new( $self->CurrentUser );
-                    $date->Set( Format => 'unknown', Value => $value );
-                    $date->SetToMidnight( Timezone => 'server' );
-                    my $daystart = $date->ISO;
-                    $date->AddDay;
-                    my $dayend = $date->ISO;
-
-                    $self->_OpenParen;
-
-                    $self->_SQLLimit(
-                        ALIAS    => $TicketCFs,
-                        FIELD    => 'Content',
-                        OPERATOR => ">=",
-                        VALUE    => $daystart,
-                        %rest,
-                    );
-
-                    $self->_SQLLimit(
-                        ALIAS    => $TicketCFs,
-                        FIELD    => 'Content',
-                        OPERATOR => "<=",
-                        VALUE    => $dayend,
-                        %rest,
-                        ENTRYAGGREGATOR => 'AND',
-                    );
-
-                    $self->_CloseParen;
-                }
-                else {
-                    $self->_SQLLimit(
-                        ALIAS    => $TicketCFs,
-                        FIELD    => 'Content',
-                        OPERATOR => $op,
-                        VALUE    => $value,
-                        %rest,
-                    );
-                }
-            }
-            elsif ( $op eq '=' || $op eq '!=' || $op eq '<>' ) {
-                unless ( length( Encode::encode_utf8($value) ) > 255 ) {
-                    $self->_SQLLimit(
-                        ALIAS    => $TicketCFs,
-                        FIELD    => 'Content',
-                        OPERATOR => $op,
-                        VALUE    => $value,
-                        %rest
-                    );
-                }
-                else {
-                    $self->_OpenParen;
-                    $self->_SQLLimit(
-                        ALIAS           => $TicketCFs,
-                        FIELD           => 'Content',
-                        OPERATOR        => '=',
-                        VALUE           => '',
-                        ENTRYAGGREGATOR => 'OR'
-                    );
-                    $self->_SQLLimit(
-                        ALIAS           => $TicketCFs,
-                        FIELD           => 'Content',
-                        OPERATOR        => 'IS',
-                        VALUE           => 'NULL',
-                        ENTRYAGGREGATOR => 'OR'
-                    );
-                    $self->_CloseParen;
-                    $self->_SQLLimit(
-                        ALIAS           => $TicketCFs,
-                        FIELD           => 'LargeContent',
-                        OPERATOR        => $fix_op->($op),
-                        VALUE           => $value,
-                        ENTRYAGGREGATOR => 'AND',
-                    );
-                }
-            }
-            else {
+        elsif ( $op eq '=' || $op eq '!=' || $op eq '<>' ) {
+            unless ( length( Encode::encode_utf8($value) ) > 255 ) {
                 $self->_SQLLimit(
-                    ALIAS    => $TicketCFs,
-                    FIELD    => 'Content',
-                    OPERATOR => $op,
-                    VALUE    => $value,
+                    ALIAS      => $TicketCFs,
+                    FIELD      => 'Content',
+                    OPERATOR   => $op,
+                    VALUE      => $value,
                     %rest
                 );
-
-                $self->_OpenParen;
+            } else {
                 $self->_OpenParen;
                 $self->_SQLLimit(
-                    ALIAS           => $TicketCFs,
-                    FIELD           => 'Content',
-                    OPERATOR        => '=',
-                    VALUE           => '',
+                    ALIAS      => $TicketCFs,
+                    FIELD      => 'Content',
+                    OPERATOR   => '=',
+                    VALUE      => '',
                     ENTRYAGGREGATOR => 'OR'
                 );
                 $self->_SQLLimit(
-                    ALIAS           => $TicketCFs,
-                    FIELD           => 'Content',
-                    OPERATOR        => 'IS',
-                    VALUE           => 'NULL',
+                    ALIAS      => $TicketCFs,
+                    FIELD      => 'Content',
+                    OPERATOR   => 'IS',
+                    VALUE      => 'NULL',
                     ENTRYAGGREGATOR => 'OR'
                 );
                 $self->_CloseParen;
                 $self->_SQLLimit(
-                    ALIAS           => $TicketCFs,
-                    FIELD           => 'LargeContent',
-                    OPERATOR        => $fix_op->($op),
-                    VALUE           => $value,
+                    ALIAS => $TicketCFs,
+                    FIELD => 'LargeContent',
+                    OPERATOR => $fix_op->($op),
+                    VALUE => $value,
                     ENTRYAGGREGATOR => 'AND',
                 );
-                $self->_CloseParen;
             }
-            $self->_CloseParen;
+        }
+        else {
+            $self->_SQLLimit(
+                ALIAS      => $TicketCFs,
+                FIELD      => 'Content',
+                OPERATOR   => $op,
+                VALUE      => $value,
+                %rest
+            );
 
-            # XXX: if we join via CustomFields table then
-            # because of order of left joins we get NULLs in
-            # CF table and then get nulls for those records
-            # in OCFVs table what result in wrong results
-            # as decifer method now tries to load a CF then
-            # we fall into this situation only when there
-            # are more than one CF with the name in the DB.
-            # the same thing applies to order by call.
-            # TODO: reorder joins T <- OCFVs <- CFs <- OCFs if
-            # we want treat IS NULL as (not applies or has
-            # no value)
+            $self->_OpenParen;
+            $self->_OpenParen;
             $self->_SQLLimit(
-                ALIAS           => $CFs,
-                FIELD           => 'Name',
-                OPERATOR        => 'IS NOT',
-                VALUE           => 'NULL',
-                QUOTEVALUE      => 0,
+                ALIAS      => $TicketCFs,
+                FIELD      => 'Content',
+                OPERATOR   => '=',
+                VALUE      => '',
+                ENTRYAGGREGATOR => 'OR'
+            );
+            $self->_SQLLimit(
+                ALIAS      => $TicketCFs,
+                FIELD      => 'Content',
+                OPERATOR   => 'IS',
+                VALUE      => 'NULL',
+                ENTRYAGGREGATOR => 'OR'
+            );
+            $self->_CloseParen;
+            $self->_SQLLimit(
+                ALIAS => $TicketCFs,
+                FIELD => 'LargeContent',
+                OPERATOR => $fix_op->($op),
+                VALUE => $value,
                 ENTRYAGGREGATOR => 'AND',
-            ) if $CFs;
+            );
             $self->_CloseParen;
+        }
+        $self->_CloseParen;
 
-            if ($negative_op) {
-                $self->_SQLLimit(
-                    ALIAS           => $TicketCFs,
-                    FIELD           => $column || 'Content',
-                    OPERATOR        => 'IS',
-                    VALUE           => 'NULL',
-                    QUOTEVALUE      => 0,
-                    ENTRYAGGREGATOR => 'OR',
-                );
-            }
+        # XXX: if we join via CustomFields table then
+        # because of order of left joins we get NULLs in
+        # CF table and then get nulls for those records
+        # in OCFVs table what result in wrong results
+        # as decifer method now tries to load a CF then
+        # we fall into this situation only when there
+        # are more than one CF with the name in the DB.
+        # the same thing applies to order by call.
+        # TODO: reorder joins T <- OCFVs <- CFs <- OCFs if
+        # we want treat IS NULL as (not applies or has
+        # no value)
+        $self->_SQLLimit(
+            ALIAS      => $CFs,
+            FIELD      => 'Name',
+            OPERATOR   => 'IS NOT',
+            VALUE      => 'NULL',
+            QUOTEVALUE => 0,
+            ENTRYAGGREGATOR => 'AND',
+        ) if $CFs;
+        $self->_CloseParen;
 
-            $self->_CloseParen;
+        if ($negative_op) {
+            $self->_SQLLimit(
+                ALIAS           => $TicketCFs,
+                FIELD           => $column || 'Content',
+                OPERATOR        => 'IS',
+                VALUE           => 'NULL',
+                QUOTEVALUE      => 0,
+                ENTRYAGGREGATOR => 'OR',
+            );
         }
+
+        $self->_CloseParen;
     }
     else {
         $cfkey .= '.'. $self->{'_sql_multiple_cfs_index'}++;
diff --git a/share/html/Elements/EditCustomFieldDate b/share/html/Elements/EditCustomFieldDate
deleted file mode 100644
index b6e10a0..0000000
--- a/share/html/Elements/EditCustomFieldDate
+++ /dev/null
@@ -1,62 +0,0 @@
-%# BEGIN BPS TAGGED BLOCK {{{
-%# 
-%# COPYRIGHT:
-%#  
-%# This software is Copyright (c) 1996-2008 Best Practical Solutions, LLC 
-%#                                          <jesse at bestpractical.com>
-%# 
-%# (Except where explicitly superseded by other copyright notices)
-%# 
-%# 
-%# LICENSE:
-%# 
-%# This work is made available to you under the terms of Version 2 of
-%# the GNU General Public License. A copy of that license should have
-%# been provided with this software, but in any event can be snarfed
-%# from www.gnu.org.
-%# 
-%# This work is distributed in the hope that it will be useful, but
-%# WITHOUT ANY WARRANTY; without even the implied warranty of
-%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-%# General Public License for more details.
-%# 
-%# You should have received a copy of the GNU General Public License
-%# along with this program; if not, write to the Free Software
-%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-%# 02110-1301 or visit their web page on the internet at
-%# http://www.gnu.org/copyleft/gpl.html.
-%# 
-%# 
-%# CONTRIBUTION SUBMISSION POLICY:
-%# 
-%# (The following paragraph is not intended to limit the rights granted
-%# to you to modify and distribute this software under the terms of
-%# the GNU General Public License and is only of importance to you if
-%# you choose to contribute your changes and enhancements to the
-%# community by submitting them to Best Practical Solutions, LLC.)
-%# 
-%# By intentionally submitting any modifications, corrections or
-%# derivatives to this work, or any other work intended for use with
-%# Request Tracker, to Best Practical Solutions, LLC, you confirm that
-%# you are the copyright holder for those contributions and you grant
-%# Best Practical Solutions,  LLC a nonexclusive, worldwide, irrevocable,
-%# royalty-free, perpetual, license to use, copy, create derivative
-%# works based on those contributions, and sublicense and distribute
-%# those contributions and any derivatives thereof.
-%# 
-%# END BPS TAGGED BLOCK }}}
-% my $name = $NamePrefix.$CustomField->Id.'-Values';
-<& /Elements/SelectDate, Name => "$name", current => 0, ShowTime => 0 &> (<%$DateObj->AsString(Time => 0)%>)
-
-<%INIT>
-my $DateObj = new RT::Date ( $session{'CurrentUser'} );
-$DateObj->Set( Format => 'unknown', Value => $Default );
-</%INIT>
-<%ARGS>
-$Object => undef
-$CustomField => undef
-$NamePrefix => undef
-$Default => undef
-$Values => undef
-$MaxValues => 1
-</%ARGS>
diff --git a/share/html/Elements/EditCustomFieldDateTime b/share/html/Elements/EditCustomFieldDateTime
deleted file mode 100644
index 9df469f..0000000
--- a/share/html/Elements/EditCustomFieldDateTime
+++ /dev/null
@@ -1,62 +0,0 @@
-%# BEGIN BPS TAGGED BLOCK {{{
-%# 
-%# COPYRIGHT:
-%#  
-%# This software is Copyright (c) 1996-2008 Best Practical Solutions, LLC 
-%#                                          <jesse at bestpractical.com>
-%# 
-%# (Except where explicitly superseded by other copyright notices)
-%# 
-%# 
-%# LICENSE:
-%# 
-%# This work is made available to you under the terms of Version 2 of
-%# the GNU General Public License. A copy of that license should have
-%# been provided with this software, but in any event can be snarfed
-%# from www.gnu.org.
-%# 
-%# This work is distributed in the hope that it will be useful, but
-%# WITHOUT ANY WARRANTY; without even the implied warranty of
-%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-%# General Public License for more details.
-%# 
-%# You should have received a copy of the GNU General Public License
-%# along with this program; if not, write to the Free Software
-%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-%# 02110-1301 or visit their web page on the internet at
-%# http://www.gnu.org/copyleft/gpl.html.
-%# 
-%# 
-%# CONTRIBUTION SUBMISSION POLICY:
-%# 
-%# (The following paragraph is not intended to limit the rights granted
-%# to you to modify and distribute this software under the terms of
-%# the GNU General Public License and is only of importance to you if
-%# you choose to contribute your changes and enhancements to the
-%# community by submitting them to Best Practical Solutions, LLC.)
-%# 
-%# By intentionally submitting any modifications, corrections or
-%# derivatives to this work, or any other work intended for use with
-%# Request Tracker, to Best Practical Solutions, LLC, you confirm that
-%# you are the copyright holder for those contributions and you grant
-%# Best Practical Solutions,  LLC a nonexclusive, worldwide, irrevocable,
-%# royalty-free, perpetual, license to use, copy, create derivative
-%# works based on those contributions, and sublicense and distribute
-%# those contributions and any derivatives thereof.
-%# 
-%# END BPS TAGGED BLOCK }}}
-% my $name = $NamePrefix.$CustomField->Id.'-Values';
-<& /Elements/SelectDate, Name => "$name", current => 0 &> (<%$DateObj->AsString%>)
-
-<%INIT>
-my $DateObj = new RT::Date ( $session{'CurrentUser'} );
-$DateObj->Set( Format => 'ISO', Value => $Default );
-</%INIT>
-<%ARGS>
-$Object => undef
-$CustomField => undef
-$NamePrefix => undef
-$Default => undef
-$Values => undef
-$MaxValues => 1
-</%ARGS>
diff --git a/share/html/Elements/SelectDate b/share/html/Elements/SelectDate
index 32c3e57..c37c23f 100755
--- a/share/html/Elements/SelectDate
+++ b/share/html/Elements/SelectDate
@@ -60,9 +60,6 @@ $Value = $Value || $Default;
 unless ($Name) {
 	$Name = $menu_prefix. "_Date";
 }
-
-my $escaped_name = $Name;
-$escaped_name =~ s/'/\\'/g;
 </%init>
 
 <%args>
diff --git a/share/html/Elements/ShowCustomFieldDate b/share/html/Elements/ShowCustomFieldDate
deleted file mode 100644
index 3a80c0a..0000000
--- a/share/html/Elements/ShowCustomFieldDate
+++ /dev/null
@@ -1,57 +0,0 @@
-%# BEGIN BPS TAGGED BLOCK {{{
-%# 
-%# COPYRIGHT:
-%#  
-%# This software is Copyright (c) 1996-2008 Best Practical Solutions, LLC 
-%#                                          <jesse at bestpractical.com>
-%# 
-%# (Except where explicitly superseded by other copyright notices)
-%# 
-%# 
-%# LICENSE:
-%# 
-%# This work is made available to you under the terms of Version 2 of
-%# the GNU General Public License. A copy of that license should have
-%# been provided with this software, but in any event can be snarfed
-%# from www.gnu.org.
-%# 
-%# This work is distributed in the hope that it will be useful, but
-%# WITHOUT ANY WARRANTY; without even the implied warranty of
-%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-%# General Public License for more details.
-%# 
-%# You should have received a copy of the GNU General Public License
-%# along with this program; if not, write to the Free Software
-%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-%# 02110-1301 or visit their web page on the internet at
-%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html.
-%# 
-%# 
-%# CONTRIBUTION SUBMISSION POLICY:
-%# 
-%# (The following paragraph is not intended to limit the rights granted
-%# to you to modify and distribute this software under the terms of
-%# the GNU General Public License and is only of importance to you if
-%# you choose to contribute your changes and enhancements to the
-%# community by submitting them to Best Practical Solutions, LLC.)
-%# 
-%# By intentionally submitting any modifications, corrections or
-%# derivatives to this work, or any other work intended for use with
-%# Request Tracker, to Best Practical Solutions, LLC, you confirm that
-%# you are the copyright holder for those contributions and you grant
-%# Best Practical Solutions,  LLC a nonexclusive, worldwide, irrevocable,
-%# royalty-free, perpetual, license to use, copy, create derivative
-%# works based on those contributions, and sublicense and distribute
-%# those contributions and any derivatives thereof.
-%# 
-%# END BPS TAGGED BLOCK }}}
-<%INIT>
- my $content = $Object->Content;
- my $DateObj = new RT::Date ( $session{'CurrentUser'} );
- $DateObj->Set( Format => 'unknown', Value => $content );
- $content = $DateObj->AsString(Time => 0);
-</%INIT>
-<%$content|n%>
-<%ARGS>
-$Object
-</%ARGS>
diff --git a/share/html/Elements/ShowCustomFieldDateTime b/share/html/Elements/ShowCustomFieldDateTime
deleted file mode 100644
index 4e8ad67..0000000
--- a/share/html/Elements/ShowCustomFieldDateTime
+++ /dev/null
@@ -1,57 +0,0 @@
-%# BEGIN BPS TAGGED BLOCK {{{
-%# 
-%# COPYRIGHT:
-%#  
-%# This software is Copyright (c) 1996-2008 Best Practical Solutions, LLC 
-%#                                          <jesse at bestpractical.com>
-%# 
-%# (Except where explicitly superseded by other copyright notices)
-%# 
-%# 
-%# LICENSE:
-%# 
-%# This work is made available to you under the terms of Version 2 of
-%# the GNU General Public License. A copy of that license should have
-%# been provided with this software, but in any event can be snarfed
-%# from www.gnu.org.
-%# 
-%# This work is distributed in the hope that it will be useful, but
-%# WITHOUT ANY WARRANTY; without even the implied warranty of
-%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-%# General Public License for more details.
-%# 
-%# You should have received a copy of the GNU General Public License
-%# along with this program; if not, write to the Free Software
-%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
-%# 02110-1301 or visit their web page on the internet at
-%# http://www.gnu.org/licenses/old-licenses/gpl-2.0.html.
-%# 
-%# 
-%# CONTRIBUTION SUBMISSION POLICY:
-%# 
-%# (The following paragraph is not intended to limit the rights granted
-%# to you to modify and distribute this software under the terms of
-%# the GNU General Public License and is only of importance to you if
-%# you choose to contribute your changes and enhancements to the
-%# community by submitting them to Best Practical Solutions, LLC.)
-%# 
-%# By intentionally submitting any modifications, corrections or
-%# derivatives to this work, or any other work intended for use with
-%# Request Tracker, to Best Practical Solutions, LLC, you confirm that
-%# you are the copyright holder for those contributions and you grant
-%# Best Practical Solutions,  LLC a nonexclusive, worldwide, irrevocable,
-%# royalty-free, perpetual, license to use, copy, create derivative
-%# works based on those contributions, and sublicense and distribute
-%# those contributions and any derivatives thereof.
-%# 
-%# END BPS TAGGED BLOCK }}}
-<%INIT>
- my $content = $Object->Content;
- my $DateObj = new RT::Date ( $session{'CurrentUser'} );
- $DateObj->Set( Format => 'ISO', Value => $content );
- $content = $DateObj->AsString;
-</%INIT>
-<%$content|n%>
-<%ARGS>
-$Object
-</%ARGS>
diff --git a/share/html/Search/Elements/PickCFs b/share/html/Search/Elements/PickCFs
index 65d58f3..ba25cde 100644
--- a/share/html/Search/Elements/PickCFs
+++ b/share/html/Search/Elements/PickCFs
@@ -78,42 +78,20 @@ while ( my $CustomField = $CustomFields->Next ) {
     my %line;
     $line{'Name'} = "'CF.{" . $CustomField->Name . "}'";
     $line{'Field'} = $CustomField->Name;
-
-    # Op
-    if ($CustomField->Type =~ /^Date(Time)?$/ ) {
-        $line{'Op'} = {
-            Type => 'component',
-            Path => '/Elements/SelectDateRelation',
-            Arguments => {},
-        };
-    } else {
-        $line{'Op'} = {
-            Type => 'component',
-            Path => '/Elements/SelectCustomFieldOperator',
-            Arguments => { True => loc("is"),
-                           False => loc("isn't"),
-                           TrueVal=> '=',
-                           FalseVal => '!=',
-                         },
-        };
-    }
-
-    # Value
-    if ($CustomField->Type =~ /^Date(Time)?$/) {
-        my $is_datetime = $1 ? 1 : 0;
-        $line{'Value'} = {
-            Type => 'component',
-            Path => '/Elements/SelectDate',
-            Arguments => { $is_datetime ? ( ShowTime => 0 ) : (), },
-        };
-    } else {
-        $line{'Value'} = {
-            Type => 'component',
-            Path => '/Elements/SelectCustomFieldValue',
-            Arguments => { CustomField => $CustomField },
-        };
-    }
-
+    $line{'Op'} = {
+        Type => 'component',
+        Path => '/Elements/SelectCustomFieldOperator',
+        Arguments => { True => loc("is"),
+                       False => loc("isn't"),
+                       TrueVal=> '=',
+                       FalseVal => '!=',
+                     },
+    };
+    $line{'Value'} = {
+        Type => 'component',
+        Path => '/Elements/SelectCustomFieldValue',
+        Arguments => { CustomField => $CustomField },
+    };
     push @lines, \%line;
 }
 
diff --git a/t/api/cf_date_search.t b/t/api/cf_date_search.t
deleted file mode 100644
index 15abd70..0000000
--- a/t/api/cf_date_search.t
+++ /dev/null
@@ -1,119 +0,0 @@
-#!/usr/bin/perl
-
-use warnings;
-use strict;
-
-use RT::Test tests => 13;
-
-my $q = RT::Queue->new($RT::SystemUser);
-ok( $q->Create( Name => 'DateCFTest' . $$ ), 'create queue' );
-
-my $cf = RT::CustomField->new($RT::SystemUser);
-ok(
-    $cf->Create(
-        Name       => 'date-' . $$,
-        Type       => 'Date',
-        MaxValues  => 1,
-        LookupType => RT::Ticket->CustomFieldLookupType,
-    ),
-    'create cf date'
-);
-ok( $cf->AddToObject($q), 'date cf apply to queue' );
-
-my $ticket = RT::Ticket->new($RT::SystemUser);
-
-ok(
-    $ticket->Create(
-        Queue                    => $q->id,
-        Subject                  => 'Test',
-        'CustomField-' . $cf->id => '2010-05-04',
-    ),
-    'create ticket with cf set to 2010-05-04'
-);
-
-is( $ticket->CustomFieldValues->First->Content, '2010-05-04', 'date in db is' );
-
-{
-
-    my $tickets = RT::Tickets->new($RT::SystemUser);
-    $tickets->LimitCustomField(
-        CUSTOMFIELD => $cf->id,
-        OPERATOR    => '=',
-        VALUE       => '2010-05-04',
-    );
-    is( $tickets->Count, 1, 'found the ticket with exact date: 2010-05-04' );
-
-}
-
-{
-    my $tickets = RT::Tickets->new($RT::SystemUser);
-    $tickets->LimitCustomField(
-        CUSTOMFIELD => $cf->id,
-        OPERATOR    => '>',
-        VALUE       => '2010-05-03',
-    );
-
-    is( $tickets->Count, 1, 'found ticket with > 2010-05-03' );
-}
-
-{
-    my $tickets = RT::Tickets->new($RT::SystemUser);
-    $tickets->LimitCustomField(
-        CUSTOMFIELD => $cf->id,
-        OPERATOR    => '<',
-        VALUE       => '2010-05-05',
-    );
-
-    is( $tickets->Count, 1, 'found ticket with < 2010-05-05' );
-}
-
-{
-
-    my $tickets = RT::Tickets->new($RT::SystemUser);
-    $tickets->LimitCustomField(
-        CUSTOMFIELD => $cf->id,
-        OPERATOR    => '=',
-        VALUE       => '2010-05-05',
-    );
-
-    is( $tickets->Count, 0, 'did not find the ticket with = 2010-05-05' );
-}
-
-{
-
-    my $tickets = RT::Tickets->new($RT::SystemUser);
-    $tickets->LimitCustomField(
-        CUSTOMFIELD => $cf->id,
-        OPERATOR    => '<',
-        VALUE       => '2010-05-03',
-    );
-
-    is( $tickets->Count, 0, 'did not find the ticket with < 2010-05-03' );
-}
-
-{
-
-    my $tickets = RT::Tickets->new($RT::SystemUser);
-    $tickets->LimitCustomField(
-        CUSTOMFIELD => $cf->id,
-        OPERATOR    => '>',
-        VALUE       => '2010-05-05',
-    );
-
-    is( $tickets->Count, 0, 'did not find the ticket with > 2010-05-05' );
-}
-
-$ticket = RT::Ticket->new($RT::SystemUser);
-
-ok(
-    $ticket->Create(
-        Queue                    => $q->id,
-        Subject                  => 'Test',
-        'CustomField-' . $cf->id => '2010-05-04 12:34:56',
-    ),
-    'create ticket with cf set to 2010-05-04 12:34:56'
-);
-
-is( $ticket->CustomFieldValues->First->Content,
-    '2010-05-04', 'date in db only has date' );
-
diff --git a/t/api/cf_datetime_search.t b/t/api/cf_datetime_search.t
deleted file mode 100644
index d0884f4..0000000
--- a/t/api/cf_datetime_search.t
+++ /dev/null
@@ -1,141 +0,0 @@
-#!/usr/bin/perl
-
-use warnings;
-use strict;
-
-use RT::Test tests => 14;
-RT->Config->Set( 'Timezone' => 'EST5EDT' ); # -04:00
-
-my $q = RT::Queue->new($RT::SystemUser);
-ok( $q->Create( Name => 'DateTimeCFTest' . $$ ), 'create queue' );
-
-my $cf = RT::CustomField->new($RT::SystemUser);
-ok(
-    $cf->Create(
-        Name       => 'datetime-' . $$,
-        Type       => 'DateTime',
-        MaxValues  => 1,
-        LookupType => RT::Ticket->CustomFieldLookupType,
-    ),
-    'create cf datetime'
-);
-ok( $cf->AddToObject($q), 'date cf apply to queue' );
-
-my $ticket = RT::Ticket->new($RT::SystemUser);
-
-ok(
-    $ticket->Create(
-        Queue                    => $q->id,
-        Subject                  => 'Test',
-        'CustomField-' . $cf->id => '2010-05-04 08:00:00',
-    ),
-    'create ticket with cf set to 2010-05-04 08:00:00( 2010-05-04 12:00:00 with UTC )'
-);
-
-is(
-    $ticket->CustomFieldValues->First->Content,
-    '2010-05-04 12:00:00',
-    'date in db is in timezone UTC'
-);
-
-{
-
-    my $tickets = RT::Tickets->new($RT::SystemUser);
-    $tickets->LimitCustomField(
-        CUSTOMFIELD => $cf->id,
-        OPERATOR    => '=',
-        VALUE       => '2010-05-04 12:00:00',    # this timezone is UTC
-    );
-
-    is( $tickets->Count, 1, 'found the ticket with exact date: 2010-05-04 12:00:00' );
-}
-
-{
-
-    # TODO according to the code, if OPERATOR is '=', it means on that day
-    # this will test this behavior
-    my $tickets = RT::Tickets->new($RT::SystemUser);
-    $tickets->LimitCustomField(
-        CUSTOMFIELD => $cf->id,
-        OPERATOR    => '=',
-        VALUE       => '2010-05-04',
-    );
-
-    is( $tickets->Count, 1, 'found the ticket with rough date: 2010-05-04' );
-}
-
-{
-
-    # TODO according to the code, if OPERATOR is '=', it means on that day
-    # this will test this behavior
-    my $tickets = RT::Tickets->new($RT::SystemUser);
-    $tickets->LimitCustomField(
-        CUSTOMFIELD => $cf->id,
-        OPERATOR    => '=',
-        VALUE       => '2010-05-05',
-    );
-
-    is( $tickets->Count, 0, 'did not find the ticket with wrong datetime: 2010-05-05' );
-}
-
-my $tickets = RT::Tickets->new( $RT::SystemUser );
-$tickets->UnLimit;
-while( my $ticket  = $tickets->Next ) {
-    $ticket->Delete();
-}
-
-{
-    ok(
-        $ticket->Create(
-            Queue                    => $q->id,
-            Subject                  => 'Test',
-            'CustomField-' . $cf->id => '2010-06-21 17:00:01',
-        ),
-'create ticket with cf set to 2010-06-21 17:00:01( 2010-06-21 21:00:01 with UTC )'
-    );
-
-    my $shanghai = RT::Test->load_or_create_user(
-        Name     => 'shanghai',
-        Timezone => 'Asia/Shanghai',
-    );
-
-    ok(
-        $shanghai->PrincipalObj->GrantRight(
-            Right  => 'SuperUser',
-            Object => $RT::System,
-        )
-    );
-
-    my $current_user = RT::CurrentUser->new($shanghai);
-    my $tickets      = RT::Tickets->new($current_user);
-    $tickets->LimitCustomField(
-        CUSTOMFIELD => $cf->id,
-        OPERATOR    => '=',
-        VALUE       => '2010-06-22',
-    );
-    is( $tickets->Count, 1, 'found the ticket with rough datetime: 2010-06-22' );
-
-    $tickets->UnLimit;
-    $tickets->LimitCustomField(
-        CUSTOMFIELD => $cf->id,
-        OPERATOR    => '>',
-        VALUE       => '2010-06-21',
-    );
-    is( $tickets->Count, 1, 'found the ticket with > 2010-06-21' );
-
-    $tickets->UnLimit;
-    $tickets->LimitCustomField(
-        CUSTOMFIELD => $cf->id,
-        OPERATOR    => '<',
-        VALUE       => '2010-06-23',
-    );
-    is( $tickets->Count, 1, 'found the ticket with < 2010-06-23' );
-
-    $tickets->UnLimit;
-    $tickets->LimitCustomField(
-        CUSTOMFIELD => $cf->id,
-        OPERATOR    => '=',
-        VALUE       => '2010-06-22 05:00:01',
-    );
-    is( $tickets->Count, 1, 'found the ticket with = 2010-06-22 01:00:01' );
-}
diff --git a/t/web/cf_date.t b/t/web/cf_date.t
deleted file mode 100644
index 7e34107..0000000
--- a/t/web/cf_date.t
+++ /dev/null
@@ -1,192 +0,0 @@
-#!/usr/bin/perl
-
-use strict;
-use warnings;
-
-use RT::Test tests => 35;
-
-my ( $baseurl, $m ) = RT::Test->started_ok;
-ok $m->login, 'logged in as root';
-my $root = RT::User->new($RT::SystemUser);
-ok( $root->Load('root'), 'load root user' );
-
-my $cf_name = 'test cf date';
-
-my $cfid;
-diag "Create a CF" if $ENV{'TEST_VERBOSE'};
-{
-    $m->follow_link( text => 'Configuration' );
-    $m->title_is( q/RT Administration/, 'admin screen' );
-    $m->follow_link( text => 'Custom Fields' );
-    $m->title_is( q/Select a Custom Field/, 'admin-cf screen' );
-    $m->follow_link( text => 'Create' );
-    $m->submit_form(
-        form_name => "ModifyCustomField",
-        fields    => {
-            Name          => $cf_name,
-            TypeComposite => 'Date-1',
-            LookupType    => 'RT::Queue-RT::Ticket',
-        },
-    );
-    $m->content_like( qr/Object created/, 'created CF sucessfully' );
-    $cfid = $m->form_name('ModifyCustomField')->value('id');
-    ok $cfid, "found id of the CF in the form, it's #$cfid";
-}
-
-diag "apply the CF to General queue" if $ENV{'TEST_VERBOSE'};
-my $queue = RT::Test->load_or_create_queue( Name => 'General' );
-ok $queue && $queue->id, 'loaded or created queue';
-
-{
-    $m->follow_link( text => 'Queues' );
-    $m->title_is( q/Admin queues/, 'admin-queues screen' );
-    $m->follow_link( text => 'General' );
-    $m->title_is( q/Editing Configuration for queue General/,
-        'admin-queue: general' );
-    $m->follow_link( text => 'Ticket Custom Fields' );
-    $m->title_is( q/Edit Custom Fields for General/,
-        'admin-queue: general cfid' );
-
-    $m->form_name('EditCustomFields');
-    $m->tick( "AddCustomField" => $cfid );
-    $m->click('UpdateCFs');
-
-    $m->content_like( qr/Object created/, 'TCF added to the queue' );
-}
-
-diag 'check valid inputs with various timezones in ticket create page'
-  if $ENV{'TEST_VERBOSE'};
-{
-    my ( $ticket, $id );
-
-    $m->submit_form(
-        form_name => "CreateTicketInQueue",
-        fields    => { Queue => 'General' },
-    );
-    $m->content_like( qr/Select date/, 'has cf field' );
-
-    $m->submit_form(
-        form_name => "TicketCreate",
-        fields    => {
-            Subject                                       => 'test 2010-05-04',
-            Content                                       => 'test',
-            "Object-RT::Ticket--CustomField-$cfid-Values" => '2010-05-04',
-        },
-    );
-    ok( ($id) = $m->content =~ /Ticket (\d+) created/, "created ticket $id" );
-
-    $ticket = RT::Ticket->new($RT::SystemUser);
-    $ticket->Load($id);
-    is( $ticket->CustomFieldValues($cfid)->First->Content,
-        '2010-05-04', 'date in db' );
-
-    $m->content_like( qr/test cf date:/, 'has no cf date field on the page' );
-    $m->content_like( qr/Tue May 04 2010/,
-        'has cf date value on the page' );
-}
-
-diag 'check search build page' if $ENV{'TEST_VERBOSE'};
-{
-    $m->get_ok( $baseurl . '/Search/Build.html?Query=Queue=1' );
-
-    $m->form_number(3);
-    my ($cf_op) =
-      $m->find_all_inputs( type => 'option', name_regex => qr/test cf date/ );
-    is_deeply(
-        [ $cf_op->possible_values ],
-        [ '<', '=', '>' ],
-        'right oprators'
-    );
-
-    my ($cf_field) =
-      $m->find_all_inputs( type => 'text', name_regex => qr/test cf date/ );
-    $m->submit_form(
-        fields => {
-            $cf_op->name    => '=',
-            $cf_field->name => '2010-05-04'
-        },
-        button => 'DoSearch',
-    );
-
-    $m->content_contains( 'Found 1 ticket', 'Found 1 ticket' );
-    $m->content_contains( '2010-05-04',     'got the right ticket' );
-    $m->content_lacks( '2010-05-06', 'did not get the wrong ticket' );
-
-    $m->get_ok( $baseurl . '/Search/Build.html?Query=Queue=1' );
-    $m->form_number(3);
-    $m->submit_form(
-        fields => {
-            $cf_op->name    => '<',
-            $cf_field->name => '2010-05-05'
-        },
-        button => 'DoSearch',
-    );
-    $m->content_contains( 'Found 1 ticket', 'Found 1 ticket' );
-
-    $m->get_ok( $baseurl . '/Search/Build.html?Query=Queue=1' );
-    $m->form_number(3);
-    $m->submit_form(
-        fields => {
-            $cf_op->name    => '>',
-            $cf_field->name => '2010-05-03',
-        },
-        button => 'DoSearch',
-    );
-    $m->content_contains( 'Found 1 ticket', 'Found 1 ticket' );
-
-    $m->get_ok( $baseurl . '/Search/Build.html?Query=Queue=1' );
-    $m->form_number(3);
-    $m->submit_form(
-        fields => {
-            $cf_op->name    => '=',
-            $cf_field->name => '2010-05-05',
-        },
-        button => 'DoSearch',
-    );
-    $m->content_contains( 'Found 0 tickets', 'Found 0 tickets' );
-
-    $m->get_ok( $baseurl . '/Search/Build.html?Query=Queue=1' );
-    $m->form_number(3);
-    $m->submit_form(
-        fields => {
-            $cf_op->name    => '<',
-            $cf_field->name => '2010-05-03',
-        },
-        button => 'DoSearch',
-    );
-    $m->content_contains( 'Found 0 tickets', 'Found 0 tickets' );
-
-    $m->get_ok( $baseurl . '/Search/Build.html?Query=Queue=1' );
-    $m->form_number(3);
-    $m->submit_form(
-        fields => {
-            $cf_op->name    => '>',
-            $cf_field->name => '2010-05-05',
-        },
-        button => 'DoSearch',
-    );
-    $m->content_contains( 'Found 0 tickets', 'Found 0 tickets' );
-}
-
-diag 'check invalid inputs' if $ENV{'TEST_VERBOSE'};
-{
-    $m->submit_form(
-        form_name => "CreateTicketInQueue",
-        fields    => { Queue => 'General' },
-    );
-    my $form = $m->form_name("TicketCreate");
-
-    $m->submit_form(
-        form_name => "TicketCreate",
-        fields    => {
-            Subject                                       => 'test',
-            Content                                       => 'test',
-            "Object-RT::Ticket--CustomField-$cfid-Values" => 'foodate',
-        },
-    );
-    $m->content_like( qr/Ticket \d+ created/,
-        "a ticket is created succesfully" );
-
-    $m->content_like( qr/test cf date:/, 'has no cf date field on the page' );
-    $m->content_unlike( qr/foodate/, 'invalid dates not set' );
-}
diff --git a/t/web/cf_datetime.t b/t/web/cf_datetime.t
deleted file mode 100644
index 2d11f53..0000000
--- a/t/web/cf_datetime.t
+++ /dev/null
@@ -1,238 +0,0 @@
-#!/usr/bin/perl
-
-use strict;
-use warnings;
-
-use RT::Test tests => 44;
-RT->Config->Set( 'Timezone' => 'EST5EDT' ); # -04:00
-
-my ($baseurl, $m) = RT::Test->started_ok;
-ok $m->login, 'logged in as root';
-my $root = RT::User->new( $RT::SystemUser );
-ok( $root->Load('root'), 'load root user' );
-
-my $cf_name = 'test cf datetime';
-
-my $cfid;
-diag "Create a CF" if $ENV{'TEST_VERBOSE'};
-{
-    $m->follow_link( text => 'Configuration' );
-    $m->title_is(q/RT Administration/, 'admin screen');
-    $m->follow_link( text => 'Custom Fields' );
-    $m->title_is(q/Select a Custom Field/, 'admin-cf screen');
-    $m->follow_link( text => 'Create' );
-    $m->submit_form(
-        form_name => "ModifyCustomField",
-        fields => {
-            Name          => $cf_name,
-            TypeComposite => 'DateTime-1',
-            LookupType    => 'RT::Queue-RT::Ticket',
-        },
-    );
-    $m->content_like( qr/Object created/, 'created CF sucessfully' );
-    $cfid = $m->form_name('ModifyCustomField')->value('id');
-    ok $cfid, "found id of the CF in the form, it's #$cfid";
-}
-
-diag "apply the CF to General queue" if $ENV{'TEST_VERBOSE'};
-my $queue = RT::Test->load_or_create_queue( Name => 'General' );
-ok $queue && $queue->id, 'loaded or created queue';
-
-{
-    $m->follow_link( text => 'Queues' );
-    $m->title_is(q/Admin queues/, 'admin-queues screen');
-    $m->follow_link( text => 'General' );
-    $m->title_is(q/Editing Configuration for queue General/, 'admin-queue: general');
-    $m->follow_link( text => 'Ticket Custom Fields' );
-    $m->title_is(q/Edit Custom Fields for General/, 'admin-queue: general cfid');
-
-    $m->form_name('EditCustomFields');
-    $m->tick( "AddCustomField" => $cfid );
-    $m->click('UpdateCFs');
-
-    $m->content_like( qr/Object created/, 'TCF added to the queue' );
-}
-
-diag 'check valid inputs with various timezones in ticket create page' if $ENV{'TEST_VERBOSE'};
-{
-    my ( $ticket, $id );
-
-    $m->submit_form(
-        form_name => "CreateTicketInQueue",
-        fields => { Queue => 'General' },
-    );
-    $m->content_like(qr/Select datetime/, 'has cf field');
-
-    $m->submit_form(
-        form_name => "TicketCreate",
-        fields    => {
-            Subject                                       => 'test 2010-05-04 13:00:01',
-            Content                                       => 'test',
-            "Object-RT::Ticket--CustomField-$cfid-Values" => '2010-05-04 13:00:01',
-        },
-    );
-    ok( ($id) = $m->content =~ /Ticket (\d+) created/,
-        "created ticket $id" );
-
-    $ticket = RT::Ticket->new( $RT::SystemUser );
-    $ticket->Load($id);
-    is(
-        $ticket->CustomFieldValues($cfid)->First->Content,
-        '2010-05-04 17:00:01',
-        'date in db is in UTC'
-    );
-
-    $m->content_like(qr/test cf datetime:/, 'has no cf datetime field on the page');
-    $m->content_like(qr/Tue May 04 13:00:01 2010/, 'has cf datetime value on the page');
-
-    $root->SetTimezone( 'Asia/Shanghai' );
-    # interesting that $m->reload doesn't work
-    $m->get_ok( $m->uri );
-    $m->content_like(qr/Wed May 05 01:00:01 2010/, 'cf datetime value respects user timezone');
-
-    $m->submit_form(
-        form_name => "CreateTicketInQueue",
-        fields => { Queue => 'General' },
-    );
-    $m->submit_form(
-        form_name => "TicketCreate",
-        fields    => {
-            Subject                                       => 'test 2010-05-06 07:00:01',
-            Content                                       => 'test',
-            "Object-RT::Ticket--CustomField-$cfid-Values" => '2010-05-06 07:00:01',
-        },
-    );
-    ok( ($id) = $m->content =~ /Ticket (\d+) created/,
-        "created ticket $id" );
-    $ticket = RT::Ticket->new( $RT::SystemUser );
-    $ticket->Load($id);
-    is(
-        $ticket->CustomFieldValues($cfid)->First->Content,
-        '2010-05-05 23:00:01',
-        'date in db is in UTC'
-    );
-
-    $m->content_like(qr/test cf datetime:/, 'has no cf datetime field on the page');
-    $m->content_like(qr/Thu May 06 07:00:01 2010/, 'cf datetime input respects user timezone');
-    $root->SetTimezone( 'EST5EDT' ); # back to -04:00
-    $m->get_ok( $m->uri );
-    $m->content_like(qr/Wed May 05 19:00:01 2010/, 'cf datetime value respects user timezone');
-}
-
-
-diag 'check search build page' if $ENV{'TEST_VERBOSE'};
-{
-    $m->get_ok( $baseurl . '/Search/Build.html?Query=Queue=1' );
-
-    $m->form_number(3);
-    my ($cf_op) =
-      $m->find_all_inputs( type => 'option', name_regex => qr/test cf datetime/ );
-    is_deeply(
-        [ $cf_op->possible_values ],
-        [ '<', '=', '>' ],
-        'right oprators'
-    );
-
-    my ($cf_field) =
-      $m->find_all_inputs( type => 'text', name_regex => qr/test cf datetime/ );
-    $m->submit_form(
-        fields => {
-            $cf_op->name    => '=',
-            $cf_field->name => '2010-05-04'
-        },
-        button => 'DoSearch',
-    );
-
-    $m->content_contains( 'Found 1 ticket', 'Found 1 ticket' );
-    $m->content_contains( '2010-05-04',     'got the right ticket' );
-    $m->content_lacks( '2010-05-06', 'did not get the wrong ticket' );
-
-    my $shanghai = RT::Test->load_or_create_user(
-        Name     => 'shanghai',
-        Password => 'password',
-        Timezone => 'Asia/Shanghai',
-    );
-    ok( $shanghai->PrincipalObj->GrantRight(
-        Right  => 'SuperUser',
-        Object => $RT::System,
-    ));
-    $m->login( 'shanghai', 'password' );
-
-    $m->get_ok( $baseurl . '/Search/Build.html?Query=Queue=1' );
-    $m->form_number(3);
-    $m->submit_form(
-        fields => {
-            $cf_op->name    => '=',
-            $cf_field->name => '2010-05-05'
-        },
-        button => 'DoSearch',
-    );
-    $m->content_contains( 'Found 1 ticket', 'Found 1 ticket' );
-
-    $m->get_ok( $baseurl . '/Search/Build.html?Query=Queue=1' );
-    $m->form_number(3);
-    $m->submit_form(
-        fields => {
-            $cf_op->name    => '<',
-            $cf_field->name => '2010-05-06'
-        },
-        button => 'DoSearch',
-    );
-    $m->content_contains( 'Found 2 ticket', 'Found 2 ticket' );
-
-    $m->get_ok( $baseurl . '/Search/Build.html?Query=Queue=1' );
-    $m->form_number(3);
-    $m->submit_form(
-        fields => {
-            $cf_op->name    => '>',
-            $cf_field->name => '2010-05-03',
-        },
-        button => 'DoSearch',
-    );
-    $m->content_contains( 'Found 2 tickets', 'Found 2 tickets' );
-
-    $m->get_ok( $baseurl . '/Search/Build.html?Query=Queue=1' );
-    $m->form_number(3);
-    $m->submit_form(
-        fields => {
-            $cf_op->name    => '=',
-            $cf_field->name => '2010-05-04 16:00:01',
-        },
-        button => 'DoSearch',
-    );
-    $m->content_contains( 'Found 1 ticket', 'Found 1 ticket' );
-
-    $m->get_ok( $baseurl . '/Search/Build.html?Query=Queue=1' );
-    $m->form_number(3);
-    $m->submit_form(
-        fields => {
-            $cf_op->name    => '=',
-            $cf_field->name => '2010-05-05 01:00:01',
-        },
-        button => 'DoSearch',
-    );
-    $m->content_contains( 'Found 1 ticket', 'Found 1 ticket' );
-}
-
-diag 'check invalid inputs' if $ENV{'TEST_VERBOSE'};
-
-{
-    $m->submit_form(
-        form_name => "CreateTicketInQueue",
-        fields => { Queue => 'General' },
-    );
-    my $form = $m->form_name("TicketCreate");
-
-    $m->submit_form(
-        form_name => "TicketCreate",
-        fields    => {
-            Subject                                       => 'test',
-            Content                                       => 'test',
-            "Object-RT::Ticket--CustomField-$cfid-Values" => 'foodate',
-        },
-    );
-    $m->content_like(qr/Ticket \d+ created/, "a ticket is created succesfully");
-
-    $m->content_like(qr/test cf datetime:/, 'has no cf datetime field on the page');
-    $m->content_unlike(qr/foodate/, 'invalid dates not set');
-}

commit 0dae88e930dbd6cd36eb8a79e9246b87515572e5
Merge: 88bd8b0 fe0ee79
Author: Alex Vandiver <alexmv at bestpractical.com>
Date:   Wed Aug 11 13:16:45 2010 -0400

    Merge remote branch 'origin/cf-date' into no-prototype
    
    Conflicts:
    	share/html/Elements/SelectDate
    	share/html/Helpers/CalPopup.html


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


More information about the Rt-commit mailing list