Forgot a last one: Allow to change queue from AgentNote.

Regards.

Lic. Fernando Schapachnik
Proyecto de Inform�tica
Ministerio de Econom�a

En un mensaje anterior, Fernando Schapachnik escribi�:
> Hello:
>       I'm attaching some patches that I'm using on OTRS 1.1.3-01, which might
> be of general interest:

--- /home/fpscha/otrs/Kernel/Output/HTML/Agent.pm       Sun Jul 13 16:02:08 2003
+++ /usr/local/otrs/Kernel/Output/HTML/Agent.pm Wed Sep 17 16:31:18 2003
@@ -925,6 +933,13 @@
         Data => $Param{NextStates},
         Name => 'NewStateID',
     );
+    # get MoveQueuesStrg
+    $Param{MoveQueuesStrg} = $Self->OptionStrgHashRef(
+        Name => 'DestQueueID',
+        SelectedID => $Param{SelectedMoveQueue},
+        Data => $Param{MoveQueues},
+        OnChangeSubmit => 0,
+    );
     # get output back
     return $Self->Output(TemplateFile => 'AgentNote', Data => \%Param);
 }
--- /home/fpscha/otrs/Kernel/Output/HTML/Standard/AgentNote.dtl Fri Apr 11 15:14:08 
2003
+++ /usr/local/otrs/Kernel/Output/HTML/MECON/AgentNote.dtl      Wed Sep 17 16:29:10 
2003
@@ -97,6 +97,9 @@
     <td>$Text{"Time units"}$Text{"$Config{"TimeUnits"}"}:</td>
     <td><input type="text" name="TimeUnits" value="" size="3"></td>
   </tr>
+  <tr>
+    <td>$Text{"Next Queue"}:</td><td>$Data{"MoveQueuesStrg"}</td>
+  </tr>
 # --
 # is ticket state used?
 # --
--- /home/fpscha/otrs/Kernel/Modules/AgentNote.pm       Thu Jun 26 16:08:57 2003
+++ /usr/local/otrs/Kernel/Modules/AgentNote.pm Wed Sep 17 16:34:36 2003
@@ -100,6 +100,20 @@
             Result => 'HASH',
         );
         $NextStates{''} = '-';
+        # move queues
+        my $SelectedMoveQueue = $Self->{TicketObject}->GetQueueIDOfTicketID(
+            TicketID => $Self->{TicketID},
+        );
+        my %MoveQueues = ();
+        if ($Self->{ConfigObject}->Get('MoveInToAllQueues')) {
+            %MoveQueues = $Self->{QueueObject}->GetAllQueues();
+        }
+        else {
+            %MoveQueues = $Self->{QueueObject}->GetAllQueues(
+                UserID => $Self->{UserID},
+                Type => 'rw',
+            );
+        }
         $Output .= $Self->{LayoutObject}->AgentNote(
             TicketID => $Self->{TicketID},
             QueueID => $Self->{QueueID},
@@ -107,6 +121,8 @@
             NoteSubject => $Self->{ConfigObject}->Get('DefaultNoteSubject'),
             NoteTypes => \%NoteTypes,
             NextStates => \%NextStates,
+            MoveQueues => \%MoveQueues,
+            SelectedMoveQueue => $SelectedMoveQueue,
         );
         $Output .= $Self->{LayoutObject}->Footer();
         return $Output;
@@ -117,6 +133,7 @@
             $Self->{ParamObject}->GetParam(Param => 'Body');
         my $ArticleTypeID = $Self->{ParamObject}->GetParam(Param => 'NoteID');
         my $TimeUnits = $Self->{ParamObject}->GetParam(Param => 'TimeUnits') || 0; 
+        my $DestQueueID = $Self->{ParamObject}->GetParam(Param => 'DestQueueID') || 
'';
         if (my $ArticleID = $Self->{TicketObject}->CreateArticle(
             TicketID => $Self->{TicketID},
             ArticleTypeID => $ArticleTypeID,
@@ -165,6 +182,16 @@
                   UserID => $Self->{UserID},
               );
           } 
+          # --
+          # set queue
+          # --
+          if ($DestQueueID) {
+            $Self->{TicketObject}->MoveByTicketID(
+              TicketID => => $Self->{TicketID},
+              UserID => $Self->{UserID},
+              QueueID => $DestQueueID,
+            );
+          }
           # --
           # redirect
           # --
_______________________________________________
OTRS mailing list: dev - Webpage: http://otrs.org/
Archive: http://lists.otrs.org/pipermail/dev
To unsubscribe: http://lists.otrs.org/cgi-bin/listinfo/dev

Reply via email to