[rt-users] Due date bug in /Ticket/Display.html for rt-2-0-8

Travis Campbell travis.campbell at amd.com
Tue Nov 6 14:12:23 EST 2001


RT version:  2.0.8 through 2.0.8_02

/Ticket/Display.html is misbehaving with regards to setting the Due date
when creating a new ticket using data from /Ticket/Create.html.  

When I create a ticket with:

  No default due date (ie, I leave the Due date blank)

or

  Set a specific due date (11/30/2001)

Display.html appears to blindly override and use the same time as the
creation date.

Here's a small diff of what I did to fix it.  Hope you can take unified
diffs.

--- /opt/rt2/WebRT/html/Ticket/Display.html     Tue Nov  6 12:54:45 2001
+++ Display.html        Tue Nov  6 13:09:07 2001
@@ -47,7 +47,13 @@
     }
    
     my $due = new RT::Date($session{'CurrentUser'});
-    $due->Set(value => $ARGS{'Due'});
+    if (defined $ARGS{'Due'} and $ARGS{'Due'} ne "") {
+        $due->Set(value => $ARGS{'Due'});
+    } elsif (defined ($Queue->DefaultDueIn)) {
+        $due->SetToNow;
+        $due->AddDays($Queue->DefaultDueIn);
+    }
+
     my $starts = new RT::Date($session{'CurrentUser'});
     $starts->Set(value => $ARGS{'Starts'});

As always, YMMV.  This appears to work for me.

Travis
-- 
 Travis Campbell  -  Unix Systems Administrator =      travis at beast.amd.com
    5900 E. Ben White Blvd, Austin, TX 78741    =   travis.campbell at amd.com
    TEL: (512) 602-1888  PAG: (512) 604-0341    =   webmaster at beast.amd.com 
============================================================================
      "Does anything work as expected?"  Yes.  An axe through the CPU.





More information about the rt-users mailing list