[rt-devel] Listing.html's $Status "On" Parameter

Bruce Campbell bruce_campbell at ripe.net
Wed Feb 20 16:37:17 EST 2002


On Wed, 20 Feb 2002, Jesse Vincent wrote:

> On _should_ select a 24 hour range.  Anything else is a bug. I don't
> exactly have time to look just now. if the current cvs is still doing
> that, send mail to rt-2.0-bugs.

My install does it.  I consider it a bug.  Heres a fix.  (patch is against
my version of Web.pm, as per #1246, might apply on cvs 1.6).  Even got the
entryaggregator right this time ;)

> On Wed, Feb 20, 2002 at 02:15:57PM -0600, Matt Disney wrote:
> > When the search query is processed, the date you put in to the form
> > for that gets transformed into a time, specifically midnight localtime
> > of the date you put in.


-- 
                             Bruce Campbell                            RIPE
                   Systems/Network Engineer                             NCC
                 www.ripe.net - PGP562C8B1B                      Operations
-------------- next part --------------
--- Web.pm	2002/02/20 11:33:28	1.5
+++ Web.pm	2002/02/20 21:31:40	1.7
@@ -1,4 +1,4 @@
-## $Header: /home/rt2/lib/RT/Interface/RCS/Web.pm,v 1.5 2002/02/20 11:33:28 rt2 Exp $
+## $Header: /home/rt2/lib/RT/Interface/RCS/Web.pm,v 1.7 2002/02/20 21:31:40 rt2 Exp $
 ## Copyright 2000 Jesse Vincent <jesse at fsck.com> & Tobias Brox <tobix at fsck.com>
 ## Request Tracker is Copyright 1996-2000 Jesse Vincent <jesse at fsck.com>
 
@@ -555,13 +555,37 @@
     if ( $args{ARGS}->{'ValueOfDate'} ne '' ) {
 
         my $date = ParseDateToISO( $args{ARGS}->{'ValueOfDate'} );
+
         $args{ARGS}->{'DateType'} =~ s/_Date$//;
 
+        my $use_op = $args{ARGS}->{'DateOp'};
+        my $use_op2 = undef;
+        my $entry_agg = 'OR';	# Default in DBIx::SearchBuilder
+        if( $use_op =~ /^\s*\=\s*$/ ){
+            $use_op = '>=';
+            $use_op2 = '<=';
+            $entry_agg = 'AND';
+        }
         $session{'tickets'}->LimitDate(
             FIELD    => $args{ARGS}->{'DateType'},
             VALUE    => $date,
-            OPERATOR => $args{ARGS}->{'DateOp'},
+            OPERATOR => $use_op,
+            ENTRYAGGREGATOR => $entry_agg,
         );
+        if( defined( $use_op2 ) ){
+            my $tmp_date_obj = new RT::Date($CurrentUser);
+            $tmp_date_obj->Set(
+                Format => 'ISO',
+                Value  => $date,
+            );
+            $tmp_date_obj->AddDays(1);
+            $session{'tickets'}->LimitDate(
+                FIELD    => $args{ARGS}->{'DateType'},
+                VALUE    => $tmp_date_obj->ISO,
+                OPERATOR => $use_op2,
+                ENTRYAGGREGATOR => $entry_agg,
+            );
+        }
     }
 
     # }}}    


More information about the Rt-devel mailing list