[Rt-commit] r12560 - in rt/branches/3.8-TESTING: lib/RT/Interface share/html/Ticket

alexmv at bestpractical.com alexmv at bestpractical.com
Tue May 20 14:11:43 EDT 2008


Author: alexmv
Date: Tue May 20 14:11:43 2008
New Revision: 12560

Modified:
   rt/branches/3.8-TESTING/   (props changed)
   rt/branches/3.8-TESTING/lib/RT/Interface/Web.pm
   rt/branches/3.8-TESTING/share/html/Ticket/Create.html

Log:
 r31992 at kohr-ah:  chmrr | 2008-05-20 14:11:11 -0400
  * Avoid double timezone-offset by moving default due code to one place
  * Make default due date work if there is no Due field submitted, like
    quick create


Modified: rt/branches/3.8-TESTING/lib/RT/Interface/Web.pm
==============================================================================
--- rt/branches/3.8-TESTING/lib/RT/Interface/Web.pm	(original)
+++ rt/branches/3.8-TESTING/lib/RT/Interface/Web.pm	Tue May 20 14:11:43 2008
@@ -321,10 +321,16 @@
         Abort('You have no permission to create tickets in that queue.');
     }
 
-    my $due = new RT::Date( $session{'CurrentUser'} );
-    $due->Set( Format => 'unknown', Value => $ARGS{'Due'} );
-    my $starts = new RT::Date( $session{'CurrentUser'} );
-    $starts->Set( Format => 'unknown', Value => $ARGS{'Starts'} );
+    my $due;
+    if (defined $ARGS{'Due'} and $ARGS{'Due'} =~ /\S/) {
+        $due = new RT::Date( $session{'CurrentUser'} );
+        $due->Set( Format => 'unknown', Value => $ARGS{'Due'} );
+    }
+    my $starts;
+    if (defined $ARGS{'Starts'} and $ARGS{'Starts'} =~ /\S/) {
+        $starts = new RT::Date( $session{'CurrentUser'} );
+        $starts->Set( Format => 'unknown', Value => $ARGS{'Starts'} );
+    }
 
     my $MIMEObj = MakeMIMEEntity(
         Subject             => $ARGS{'Subject'},
@@ -369,8 +375,8 @@
         TimeWorked      => $ARGS{'TimeWorked'},
         Subject         => $ARGS{'Subject'},
         Status          => $ARGS{'Status'},
-        Due             => $due->ISO,
-        Starts          => $starts->ISO,
+        Due             => $due ? $due->ISO : undef,
+        Starts          => $starts ? starts->ISO : undef,
         MIMEObj         => $MIMEObj
     );
 

Modified: rt/branches/3.8-TESTING/share/html/Ticket/Create.html
==============================================================================
--- rt/branches/3.8-TESTING/share/html/Ticket/Create.html	(original)
+++ rt/branches/3.8-TESTING/share/html/Ticket/Create.html	Tue May 20 14:11:43 2008
@@ -330,15 +330,6 @@
     ARGSRef => \%ARGS
 );
 
-# if no due date has been set explicitly, then use the
-# queue's default if it exists
-if ($QueueObj->DefaultDueIn && !$ARGS{'Due'}) {
-    my $default_due = RT::Date->new($session{'CurrentUser'});
-    $default_due->SetToNow();
-    $default_due->AddDays($QueueObj->DefaultDueIn);
-    $ARGS{'Due'} = $default_due->ISO(Timezone => 'user');
-}
-
 # {{{ deal with deleting uploaded attachments
 foreach my $key (keys %ARGS) {
     if ($key =~ m/^DeleteAttach-(.+)$/) {


More information about the Rt-commit mailing list