Treeview of queues and agents

English! place to talk about development, programming and coding
Post Reply
mt75
Znuny newbie
Posts: 3
Joined: 24 Nov 2011, 15:03
Znuny Version: 3.0.11

Treeview of queues and agents

Post by mt75 »

Hi,

I'm new to OTRS and I want to display a tree in the AgentBackoffice showing all queues the agent may see and all Agents that belong to these queues.
(The overall goal is to have a tree with Queues and its Agents at the left, a List of the tickets of a selected agent at the upper right, and a preview of the selected ticket at the lower right - it should look like in a usual mail client)

My question now is: How do I (nested) loop over queues and the agents belonging to a queue?
Is there a way to cascade (nest) $Self->{LayoutObject}->Block(...)?

I have the values (queues and agents) in my module, but I don't know how to get them looped in the .dtl.
I would leike to have the values in that way in the .dtl:

<ul>
<li>
Queue1
<ul>
<li>Agent 1</li>
<li>Agent 2</li>
<li>Agent 3</li>
</ul>
</li>
<li>
Queue2
<ul>
<li>Agent 1</li>
<li>Agent 2</li>
</ul>
</li>
</ul>

Or, are there completely different/better ways to do it (loop)?

Thanks
MT75
OTRS (local eval system): 3.0.11 on Windows XP
Andre Bauer
Znuny guru
Posts: 2189
Joined: 08 Dec 2005, 17:01
Znuny Version: 5.0.x
Real Name: André Bauer
Company: Magix Software GmbH
Location: Dresden
Contact:

Re: Treeview of queues and agents

Post by Andre Bauer »

The OTRS addon Kix4OTRS can show a Queue tree...

http://www.cape-it.de/product-kix4otrs.html
Prod: Ubuntu Server 16.04 / Zammad 1.2

DO NOT PM ME WITH OTRS RELATED QUESTIONS! ASK IN THE FORUMS!

OtterHub.org
mt75
Znuny newbie
Posts: 3
Joined: 24 Nov 2011, 15:03
Znuny Version: 3.0.11

Re: Treeview of queues and agents

Post by mt75 »

Hi monotek,

Thanks for your answer.
Yes, I have seen that, but I don't know where to find it in the code. Can someone help me with that?
Or, maybe can help me with my fist post?

Regards
MT75
OTRS (local eval system): 3.0.11 on Windows XP
crythias
Moderator
Posts: 10169
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Treeview of queues and agents

Post by crythias »

Pseudo code follows
http://dev.otrs.org/
my %Queues = $QueueObject->GetAllQueues();
Loop through %Queues (it has id, name)
then use
my $GroupID = $QueueObject->GetQueueGroupID( QueueID => $QueueID );
my @Groups = $GroupObject->GroupMemberList(
GroupID => $GroupID,
Type => 'move_into', #or ro
Result => 'Name',
);
Loop through that for names.
As you're looping, store in a variable that you'll return.

For hints, check out the Modules/AdminUserGroup.pm
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
mt75
Znuny newbie
Posts: 3
Joined: 24 Nov 2011, 15:03
Znuny Version: 3.0.11

Re: Treeview of queues and agents

Post by mt75 »

Thank you for the hints.
I had also alook at the mentioned module and the AdminUserGroup.dtl.
Here both list (users and groups) are beside each other.

Is there a way to nest the users into the group/queue they belong to? My question is about how to do it in the dtl template when I have all necessary information about groups and users (in the module). How do I display them in that kind (or similar):

Code: Select all

<ul>
  <li>
  Queue1
  <ul>
    <li>Agent 1</li>
    <li>Agent 2</li>
    <li>Agent 3</li>
  </ul>
  </li>
  <li>
   Queue2
   <ul>
    <li>Agent 1</li>
    <li>Agent 2</li>
   </ul>
  </li>
</ul>
OTRS (local eval system): 3.0.11 on Windows XP
ChanduCK
Znuny newbie
Posts: 2
Joined: 22 Jun 2016, 15:10
Znuny Version: Otrs 5
Real Name: Ck
Company: CSL

Re: Treeview of queues and agents

Post by ChanduCK »

Am learning OTRS Now,

Am trying to create TreeView of Agents,Groups,Queues ....,the below code is ok in general,But how do i do in OTRS,

Or can we organise theses agents/groups/Queues using Sysconfig,

Can any one advise pls

<ul>
<li>
Queue1
<ul>
<li>Agent 1</li>
<li>Agent 2</li>
<li>Agent 3</li>
</ul>
</li>
<li>
Queue2
<ul>
<li>Agent 1</li>
<li>Agent 2</li>
</ul>
</li>
</ul>


B/regards

Chandu
Post Reply