[Rt-commit] [svn] r1457 - in rt/branches/3.3-TESTING: . html/Tools

jesse at pallas.eruditorum.org jesse at pallas.eruditorum.org
Wed Sep 8 16:31:26 EDT 2004


Author: jesse
Date: Wed Sep  8 16:31:26 2004
New Revision: 1457

Modified:
   rt/branches/3.3-TESTING/   (props changed)
   rt/branches/3.3-TESTING/html/Tools/Offline.html
Log:
 
 ----------------------------------------------------------------------
 r10212 at tinbook:  jesse | 2004-09-08T20:30:48.849107Z
 merging 3.2's Offline.html page forward to 3.3
 ----------------------------------------------------------------------


Modified: rt/branches/3.3-TESTING/html/Tools/Offline.html
==============================================================================
--- rt/branches/3.3-TESTING/html/Tools/Offline.html	(original)
+++ rt/branches/3.3-TESTING/html/Tools/Offline.html	Wed Sep  8 16:31:26 2004
@@ -95,19 +95,19 @@
 <& /Elements/Submit, Name => 'UpdateTickets', Label => loc('Upload'), Caption => loc("Upload your changes"), color => "#993333" &>
 
 </FORM>
-
+<%args>
+$requestoraddress => undef
+$qname => undef
+$string => undef
+</%args>
 <%INIT>
 
 my @results;
 use RT::Action::CreateTickets;
-my $action = new RT::Action::CreateTickets;
-my $string;
-
-my $requestoraddress = $ARGS{'requestoraddress'};
-my $qname = $ARGS{'qname'};
-
+my $action = RT::Action::CreateTickets->new(CurrentUser => $session{'CurrentUser'});
+;
 if ($ARGS{'Parse'} && $ARGS{'Template'}) {
-    $ARGS{'string'} = "";
+    $string = "";
     my $cgi_object = $m->cgi_object;
     my $fh = $cgi_object->upload('Template');
     my $filename = "$fh";
@@ -116,20 +116,26 @@
     while ( my $bytesread = read( $fh, $buffer, 4096 ) ) {
 	    $template .= $buffer;
     }
+    $template =~ s/\r\n/\n/gs;
     $action->Parse(Content => $template, Queue => $qname, Requestor => $requestoraddress);
-    foreach (@{ $action->{'create_tickets'} }) {
-	my $id = $_;
-	$id =~ s/^create\-//;
-	$string .= "===Create-Ticket: $id\n";
-	$string .= $action->{'templates'}->{$_} . "\n";
+    foreach ( @{ $action->{'create_tickets'} } ) {
+        my $id = $_;
+        $id =~ s/^create\-//;
+        $string .= "===Create-Ticket: $id\n";
+        $string .= $action->{'templates'}->{$_} . "\n";
     }
+    foreach ( @{ $action->{'update_tickets'} } ) {
+        my $id = $_;
+        $id =~ s/^update\-//;
+        $string .= "===Update-Ticket: $id\n";
+        $string .= $action->{'templates'}->{$_} . "\n";
+    }
+
 
-    $ARGS{'string'} = $string;
 } elsif ($ARGS{'UpdateTickets'}) {
     $action->Parse(Content => $ARGS{string}, Queue => $qname, Requestor=> $requestoraddress);
     push @results, $action->CreateByTemplate();
     push @results, $action->UpdateByTemplate();
-    $string = $ARGS{string};
 } else {
     if ($ARGS{'Query'}) {
 	my $Tickets = RT::Tickets->new($session{'CurrentUser'});


More information about the Rt-commit mailing list