Redirect to Queue View after Prioritize

Moderator: crythias

Locked
pakirby
Znuny newbie
Posts: 32
Joined: 10 Nov 2011, 23:21
Znuny Version: 3.2.1
Real Name: Patrick
Company: MAM

Redirect to Queue View after Prioritize

Post by pakirby »

As part of our incoming email ticket procedure, and individual prioritizes each ticket within the queue in order of importance and then another agent will later take and process the ticket. Current functionality dictates that if you use the prioritize action from the queue view, it then takes you into the ticket. We want the view to remain at the queue view.

I have found a few pieces of code that seems to manage this functionality, but I am unsure what nomenclature to use and if adding it may cause unforeseen issues in other area.


Kernel::Modules::AgentTicketActionCommon.pm

Code: Select all

684  # set priority 
685         if ( $Self->{Config}->{Priority} && $GetParam{NewPriorityID} ) { 
686             $Self->{TicketObject}->TicketPrioritySet( 
687                 TicketID   => $Self->{TicketID}, 
688                 PriorityID => $GetParam{NewPriorityID}, 
689                 UserID     => $Self->{UserID},
690             ); 
691         } 
This appears to be where the redirect code needs to be inserted to get the behavior we are after.

I found two examples in OTRS where you select an action from the queue view and it will redirect you back to the queue view:
1. Close Ticket

Code: Select all

726   # redirect parent window to last screen overview on closed tickets 
727             if ( $StateData{TypeName} =~ /^close/i ) { 
728                 return $Self->{LayoutObject}->PopupClose( 
729                     URL => ( $Self->{LastScreenOverview} || 'Action=AgentDashboard' ), 
730                 );
731             }
2. Bulk Action

Code: Select all

646     # redirect 
647     if ($ActionFlag) { 
648         return $Self->{LayoutObject}->PopupClose(
 649             URL => ( $Self->{LastScreenOverview} || 'Action=AgentDashboard' ), 
650         ); 
651     }
So it would seem to add the redirect function to the action of setting priority, I could add something to the effect of the above. Our filters are set up to automatically set the priority of all incoming email tickets as '7 Not Prioritized'. I want the script to run whenever the priority is changed from that default. Would something like this work if inserted under the above Action, Set Priority code?

Code: Select all

if ( $Param{NewPriorityID} !=~ /^Not/i ) {
     return $Self->{LayoutObject}->PopupClose( 
            URL => ( $Self->{LastScreenOverview} || 'Action=AgentDashboard'

Thanks!
OTRS 3.2.1
CentOs 5.7
MySQL
pakirby
Znuny newbie
Posts: 32
Joined: 10 Nov 2011, 23:21
Znuny Version: 3.2.1
Real Name: Patrick
Company: MAM

Re: Redirect to Queue View after Prioritize

Post by pakirby »

No luck on this yet. I tried entering the following code below the Set Priority code found within AgentTicketActionCommon.pm

Code: Select all

if ( $NewPriorityID =! /^Not/i ) {
     return $Self->{LayoutObject}->PopupClose( 
            URL => ( $Self->{LastScreenOverview} || 'Action=AgentDashboard'
Each time I try the code I get an internal server error 500. I'm not really sure why it would give me an internal server error when this is the same redirect code found on other actions.
OTRS 3.2.1
CentOs 5.7
MySQL
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Redirect to Queue View after Prioritize

Post by crythias »

version?
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Redirect to Queue View after Prioritize

Post by crythias »

A little bit further down ..

Code: Select all

        # load new URL in parent window and close popup
        return $Self->{LayoutObject}->PopupClose(
            URL => "Action=AgentTicketZoom;TicketID=$Self->{TicketID};ArticleID=$ArticleID",
        );
OTRS 6.0.x (private/testing/public) on Linux with MySQL database.
Please edit your signature to include your OTRS version, Operating System, and database type.
Click Subscribe Topic below to get notifications. Consider amending your topic title to include [SOLVED] if it is so.
Need help? Before you ask
pakirby
Znuny newbie
Posts: 32
Joined: 10 Nov 2011, 23:21
Znuny Version: 3.2.1
Real Name: Patrick
Company: MAM

Re: Redirect to Queue View after Prioritize

Post by pakirby »

Thanks Crythias!

I was trying to avoid changing that line so that the remaining actions would still go into the ticket, but it really isn't necessary now that I look at it. Lock still locks the ticket, you just don't get directed into it. Users can open the ticket first and then Lock it. History is its own popup, and Zoom still goes into the ticket. I updated the line to read as follows:

Code: Select all

# load new URL in parent window and close popup
   return $Self->{LayoutObject}->PopupClose(
         URL => ( $Self->{LastScreenOverview} || 'Action=AgentTicketQueue' ),
        );
OTRS 3.2.1
CentOs 5.7
MySQL
Locked