[Rt-commit] r6207 - in rtir/branches/2.1-EXPERIMENTAL: html/RTIR

ruz at bestpractical.com ruz at bestpractical.com
Sat Oct 14 21:53:23 EDT 2006


Author: ruz
Date: Sat Oct 14 21:53:22 2006
New Revision: 6207

Modified:
   rtir/branches/2.1-EXPERIMENTAL/   (props changed)
   rtir/branches/2.1-EXPERIMENTAL/html/RTIR/Create.html

Log:
 r1711 at cubic-pc:  cubic | 2006-10-15 06:01:28 +0400
 * refactor things a little


Modified: rtir/branches/2.1-EXPERIMENTAL/html/RTIR/Create.html
==============================================================================
--- rtir/branches/2.1-EXPERIMENTAL/html/RTIR/Create.html	(original)
+++ rtir/branches/2.1-EXPERIMENTAL/html/RTIR/Create.html	Sat Oct 14 21:53:22 2006
@@ -345,17 +345,13 @@
     $IncidentObj->Load( $Incident );
     unless ( $IncidentObj->id ) {
         push @results, loc("Couldn't load incident #[_1]", $Incident );
-        $Incident = undef;
-        $checks_failure = 1;
+        ($checks_failure, $IncidentObj, $Incident) = (1, undef, undef);
+    } elsif ( $IncidentObj->QueueObj->Name eq 'Incidents' ) {
+        push @results, loc('Ticket #[_1] is not an Incident', $Incident );
+        ($checks_failure, $IncidentObj, $Incident) = (1, undef, undef);
     } else {
         $Incident = $ARGS{'Incident'} = $IncidentObj->id;
-        unless ( $IncidentObj->QueueObj->Name eq 'Incidents' ) {
-            push @results, loc('Ticket #[_1] is not an Incident', $Incident );
-            ($IncidentObj, $Incident) = (undef, undef);
-            $checks_failure = 1;
-        } else {
-            $Subject ||= $IncidentObj->Subject;
-        }
+        $Subject ||= $IncidentObj->Subject;
     }
 }
 
@@ -385,7 +381,7 @@
 }
 
 if ( $ARGS{'Create'} ) {
-    if ( !$checks_failure ) {
+    unless ( $checks_failure ) {
         $ARGS{'new-MemberOf'} = $parentvalue if $parentvalue;
         return $m->comp( 'Display.html', %ARGS, SkipNotification => \@SkipNotification, results => \@results );
     }


More information about the Rt-commit mailing list