[Rt-commit] r18872 - rt/3.999/branches/datetime/share/html/Approvals/Elements
sartak at bestpractical.com
sartak at bestpractical.com
Thu Mar 19 17:29:24 EDT 2009
Author: sartak
Date: Thu Mar 19 17:29:24 2009
New Revision: 18872
Modified:
rt/3.999/branches/datetime/share/html/Approvals/Elements/PendingMyApproval
Log:
PendingMyApproval DateTimeification and fixes
Modified: rt/3.999/branches/datetime/share/html/Approvals/Elements/PendingMyApproval
==============================================================================
--- rt/3.999/branches/datetime/share/html/Approvals/Elements/PendingMyApproval (original)
+++ rt/3.999/branches/datetime/share/html/Approvals/Elements/PendingMyApproval Thu Mar 19 17:29:24 2009
@@ -76,31 +76,32 @@
my $group_tickets = RT::Model::TicketCollection->new( current_user => Jifty->web->current_user );
$group_tickets->limit_watcher( value => Jifty->web->current_user->user_object->email, type => 'admin_cc' );
-my $Created_before = RT::Date->new();
-my $Created_after = RT::Date->new();
+my $created_before = RT::DateTime->new_from_string($ARGS{'created_before'});
+my $created_after = RT::DateTime->new_from_string($ARGS{'created_after'});
foreach ($tickets, $group_tickets) {
- $_->limit( column => 'type', value => 'approval' );
+ $_->limit( column => 'type', value => 'approval' );
if ( $ARGS{'show_resolved'} ) {
- $_->limit_status( value => 'resolved' );
+ $_->limit_status( value => 'resolved' );
}
+
if ( $ARGS{'show_rejected'} ) {
- $_->limit_status( value => 'rejected' );
+ $_->limit_status( value => 'rejected' );
}
+
if ( $ARGS{'show_pending'} || ( !$ARGS{'show_rejected'} && !$ARGS{'resolved'} ) ) {
- $_->limit_status( value => 'open' );
- $_->limit_status( value => 'new' );
- $_->limit_status( value => 'stalled' );
+ $_->limit_status( value => 'open' );
+ $_->limit_status( value => 'new' );
+ $_->limit_status( value => 'stalled' );
}
- if ( $ARGS{'created_before'} ) {
- $Created_before->set( format => 'unknown', value => $ARGS{'created_before'} );
- $_->limit_created( operator => "<=", value => $Created_before->iso );
+ if ($created_before->is_set) {
+ $_->limit_created( operator => "<=", value => $created_before );
}
- if ( $ARGS{'created_after'} ) {
- $Created_after->set( format => 'unknown', value => $ARGS{'created_after'} );
- $_->limit_created( operator => ">=", value => $Created_after->iso );
+
+ if ($created_after->is_set) {
+ $_->limit_created( operator => ">=", value => $created_after );
}
}
More information about the Rt-commit
mailing list