How to create a "AgentTicketOwnerView" item?

Moderator: crythias

Locked
NormanPSI
Znuny newbie
Posts: 23
Joined: 19 Oct 2015, 13:33
Znuny Version: 4.0.11
Real Name: Norman
Company: pharma solutions international GmbH

How to create a "AgentTicketOwnerView" item?

Post by NormanPSI »

Hello,

we use OTRS 4.0.16 and would like to add another button top left next to the responsible (AgentTicketResponsibleView) and locked (AgentTicketLockedView) tickets. It should show all tickets owned by the agent (AgentTicketOwnerView?).

Could someone give me a hint how to do this? I assume there are only a couple of files that need to be edited or created, but I have no idea which ones.

Thanks in advance
-Norman
OTRS 4.0.16 on Oracle Linux 7.2 64bit with MySQL
reneeb
Znuny guru
Posts: 5018
Joined: 13 Mar 2011, 09:54
Znuny Version: 6.0.x
Real Name: Renée Bäcker
Company: Perl-Services.de
Contact:

Re: How to create a "AgentTicketOwnerView" item?

Post by reneeb »

You need a SysConfig option like https://github.com/OTRS/otrs/blob/rel-5 ... .xml#L5872 to get the icon. Some more SysConfig options to define some defaults (https://github.com/OTRS/otrs/blob/rel-5 ... .xml#L2652 ff).

One SysConfig option to activate the frontend module (https://github.com/OTRS/otrs/blob/rel-5 ... .xml#L8437).

Then you need the toolbar module: https://github.com/OTRS/otrs/blob/rel-5 ... onsible.pm

and the frontend module https://github.com/OTRS/otrs/blob/rel-5 ... bleView.pm

That list might be incomplete, but it's definitely a good start ;-)
Perl / Znuny development: http://perl-services.de
Free Znuny add ons from the community: http://opar.perl-services.de
Commercial add ons: http://feature-addons.de
NormanPSI
Znuny newbie
Posts: 23
Joined: 19 Oct 2015, 13:33
Znuny Version: 4.0.11
Real Name: Norman
Company: pharma solutions international GmbH

Re: How to create a "AgentTicketOwnerView" item?

Post by NormanPSI »

Thanks for this. I did the following, but the icon is not showing up.

1) Add these lines in Ticket.xml:

Code: Select all

+<ConfigItem Name="Ticket::Frontend::AgentTicketOwnerView###SortBy::Default" Required="1" Valid="1">
+        <Description Translatable="1">Defines the default ticket attribute for ticket sorting in the owner view of the agent interface.</Description>
+        <Group>Ticket</Group>
+        <SubGroup>Frontend::Agent::Ticket::ViewOwner</SubGroup>
+        <Setting>
+            <Option SelectedID="Age">
+                <Item Key="Age" Translatable="1">Age</Item>
+                <Item Key="TicketNumber" Translatable="1">TicketNumber</Item>
+                <Item Key="Title" Translatable="1">Title</Item>
+                <Item Key="Queue" Translatable="1">Queue</Item>
+                <Item Key="Priority" Translatable="1">Priority</Item>
+                <Item Key="EscalationTime" Translatable="1">EscalationTime</Item>
+            </Option>
+        </Setting>
+    </ConfigItem>
+    <ConfigItem Name="Ticket::Frontend::AgentTicketOwnerView###Order::Default" Required="1" Valid="1">
+        <Description Translatable="1">Defines the default ticket order in the owner view of the agent interface. Up: oldest on top. Down: latest on top.</Description>
+        <Group>Ticket</Group>
+        <SubGroup>Frontend::Agent::Ticket::ViewOwner</SubGroup>
+        <Setting>
+            <Option SelectedID="Up">
+                <Item Key="Down" Translatable="1">Down</Item>
+                <Item Key="Up" Translatable="1">Up</Item>
+            </Option>
+        </Setting>
+</ConfigItem>

Code: Select all

+    <ConfigItem Name="Frontend::ToolBarModule###6a-Ticket::TicketOwner" Required="0" Valid="1">
+        <Description Translatable="1">Agent interface notification module to see the tickets an agent is the owner of. Added by Norman</Description>
+        <Group>Ticket</Group>
+        <SubGroup>Frontend::Agent::ToolBarModule</SubGroup>
+        <Setting>
+            <Hash>
+                <Item Key="Module">Kernel::Output::HTML::ToolBarTicketOwner</Item>
+                <Item Key="CssClass">Owner</Item>
+                <Item Key="CssClassNew">Owner New</Item>
+                <Item Key="CssClassReached">Owner Reached</Item>
+                <Item Key="Icon">fa fa-arrow-circle-o-right</Item>
+                <Item Key="IconNew">fa fa-arrow-circle-o-right</Item>
+                <Item Key="IconReached">fa fa-arrow-circle-o-right</Item>
+                <Item Key="AccessKey">o</Item>
+                <Item Key="AccessKeyNew"></Item>
+                <Item Key="AccessKeyReached"></Item>
+                <Item Key="Priority">1030009</Item>
+            </Hash>
+        </Setting>
+    </ConfigItem>

Code: Select all

+<ConfigItem Name="Frontend::Module###AgentTicketOwnerView" Required="0" Valid="1">
+        <Description Translatable="1">Frontend module registration for the agent interface.</Description>
+        <Group>Ticket</Group>
+        <SubGroup>Frontend::Agent::ModuleRegistration</SubGroup>
+        <Setting>
+            <FrontendModuleReg>
+                <Description Translatable="1">Owner Tickets.</Description>
+                <Title Translatable="1">Owner Tickets</Title>
+                <NavBarName>Ticket</NavBarName>
+                <Loader>
+                    <CSS>Core.AllocationList.css</CSS>
+                    <JavaScript>Core.UI.AllocationList.js</JavaScript>
+                    <JavaScript>Core.Agent.TableFilters.js</JavaScript>
+                </Loader>
+            </FrontendModuleReg>
+        </Setting>
+</ConfigItem>
2) Created a new file Kernel/Modules/AgentTicketOwnerView.pm
-> Used AgentTicketResponsibleView.pm as template and just replaced "Responsible" with "Owner", both in the file name and in the contents of the file.

3) Created a new file Kernel/Output/HTML/ToolBarTicketOwner.pm
-> Used ToolBarTicketResponsible.pm as template and just replaced "Responsible" with "Owner", both in the file name and in the contents of the file.


The new option showed up in the SysConfig and was activated. But the icon I chose (fa-arrow-circle-o-right; I checked which icons fontawesome offers) does not show up next to the others top left.

Anyone else that can help what's missing? Can't be much, I think.
OTRS 4.0.16 on Oracle Linux 7.2 64bit with MySQL
NormanPSI
Znuny newbie
Posts: 23
Joined: 19 Oct 2015, 13:33
Znuny Version: 4.0.11
Real Name: Norman
Company: pharma solutions international GmbH

Re: How to create a "AgentTicketOwnerView" item?

Post by NormanPSI »

No one?
OTRS 4.0.16 on Oracle Linux 7.2 64bit with MySQL
reneeb
Znuny guru
Posts: 5018
Joined: 13 Mar 2011, 09:54
Znuny Version: 6.0.x
Real Name: Renée Bäcker
Company: Perl-Services.de
Contact:

Re: How to create a "AgentTicketOwnerView" item?

Post by reneeb »

Perl / Znuny development: http://perl-services.de
Free Znuny add ons from the community: http://opar.perl-services.de
Commercial add ons: http://feature-addons.de
Locked