ONTEC Are you ready Uhr

((OTRS)) Community Edition – ein eigenes Dashlet anlegen

OTRS – EIN EIGENES DASHLET ANLEGEN

Inhaltsverzeichnis

((OTRS)) Community Edition bietet eine Reihe von Dashlets an. Doch wie es der Teufel will, ist genau jenes, welches den eigenen Wünschen entspricht, nicht dabei. Doch dies lässt sich relativ leicht ändern.

Man nehme ein leeres .xml File und füge folgende Zeilen ein und speichert diese z.B. als MyConfig.xml

<?xml version="1.0" encoding="utf-8"?>
<otrs_config version="1.0" init="Application">

</otrs_config>

Im nächsten Schritt lassen wir un sein wenig inspirieren und werfen einen Blick in Kernel/Config/Fi­les/Ticket.xml und suchen nach „Dashboard“. Hier finden wir die Config zu allen Dashlets. Nun können wir uns z.B. jenen Teil kopieren, welcher das Dashlet für neue Tickets erzeugt.

<ConfigItem Name="DashboardBackend###0120-TicketNew" Required="0" Valid="1">
        <Description Translatable="1">Parameters for the dashboard backend of the new tickets overview of the agent interface. "Limit" is the number of entries shown by default. "Group" is used to restrict the access to the plugin (e. g. Group: admin;group1;group2;). "Default" determines if the plugin is enabled by default or if the user needs to enable it manually. "CacheTTLLocal" is the cache time in minutes for the plugin. Note: Only Ticket attributes and Dynamic Fields (DynamicField_NameX) are allowed for DefaultColumns. Possible settings: 0 = Disabled, 1 = Available, 2 = Enabled by default.</Description>
        <Group>Ticket</Group>
        <SubGroup>Frontend::Agent::Dashboard</SubGroup>
        <Setting>
            <Hash>
                <Item Key="Module">Kernel::Output::HTML::Dashboard::TicketGeneric</Item>
                <Item Key="Title" Translatable="1">New Tickets</Item>
                <Item Key="Description" Translatable="1">All new tickets, these tickets have not been worked on yet</Item>
                <Item Key="Attributes">StateType=new;</Item>
                <Item Key="Filter">All</Item>
                <Item Key="Time">Age</Item>
                <Item Key="Limit">10</Item>
                <Item Key="Permission">rw</Item>
                <Item Key="Block">ContentLarge</Item>
                <Item Key="Group"></Item>
                <Item Key="Default">1</Item>
                <Item Key="CacheTTLLocal">0.5</Item>
                <Item Key="DefaultColumns">
                    <Hash>
                        <Item Key="Age">2</Item>
                        <Item Key="Changed">1</Item>
                        <Item Key="CustomerID">1</Item>
                        <Item Key="CustomerName">1</Item>
                        <Item Key="CustomerUserID">1</Item>
                        <Item Key="EscalationResponseTime">1</Item>
                        <Item Key="EscalationSolutionTime">1</Item>
                        <Item Key="EscalationTime">1</Item>
                        <Item Key="EscalationUpdateTime">1</Item>
                        <Item Key="TicketNumber">2</Item>
                        <Item Key="Lock">1</Item>
                        <Item Key="Owner">1</Item>
                        <Item Key="PendingTime">1</Item>
                        <Item Key="Queue">1</Item>
                        <Item Key="Responsible">1</Item>
                        <Item Key="Priority">1</Item>
                        <Item Key="Service">1</Item>
                        <Item Key="State">1</Item>
                        <Item Key="SLA">1</Item>
                        <Item Key="Title">2</Item>
                        <Item Key="Type">1</Item>
                    </Hash>
                </Item>
            </Hash>
        </Setting>
    </ConfigItem>

Nun können wir problemlos den Namen des Dashlets und dessen Attribute ändern. Ich hab hier jetzt mal ein Dashlet gebastelt, welche mir alle Tickets zum Kunden mit der CustomerID „XYZ“ mit dem Statustyp „new“, „open“ und „pending auto“ zeigt.

<ConfigItem Name="DashboardBackend###0900-TicketCustomerXYZ" Required="0" Valid="1">
  <Description Lang="en">Parameters  for the dashboard backend. ...</Description>
  <Description Lang="de">Parameter  für das Dashboard Backend. ...</Description>
  <Group>Ticket</Group>
  <SubGroup>Frontend::Agent::Dashboard</SubGroup>
  <Setting>
   <Hash>
    <Item Key="Module">Kernel::Output::HTML::Dashboard::TicketGeneric</Item>
    <Item Key="Title">Ticket Overview XYZ</Item>
    <Item Key="Description">All Tickets for XYZ</Item>
    <Item Key="Attributes">CustomerID=XYZ;StateType=open;StateType=new;StateType=pending auto;SortBy=TicketNumber;OrderBy=Down;</Item>
    <Item Key="Filter">All</Item>
    <Item Key="Time">Age</Item>
    <Item Key="Limit">25</Item>
    <Item Key="Permission">rw</Item>
    <Item Key="Block">ContentLarge</Item>
    <Item Key="Group"></Item>
    <Item Key="Default">1</Item>
    <Item Key="CacheTTLLocal">0.5</Item>
        <Item Key="DefaultColumns">
        <Hash>
            <Item Key="Age">2</Item>
                        <Item Key="Changed">1</Item>
                        <Item Key="CustomerID">1</Item>
                        <Item Key="CustomerName">1</Item>
                        <Item Key="CustomerUserID">1</Item>
                        <Item Key="EscalationResponseTime">1</Item>
                        <Item Key="EscalationSolutionTime">1</Item>
                        <Item Key="EscalationTime">1</Item>
                        <Item Key="EscalationUpdateTime">1</Item>
                        <Item Key="TicketNumber">2</Item>
                        <Item Key="Lock">1</Item>
                        <Item Key="Owner">2</Item>
                        <Item Key="PendingTime">1</Item>
                        <Item Key="Queue">2</Item>
                        <Item Key="Responsible">1</Item>
                        <Item Key="Priority">2</Item>
                        <Item Key="Service">1</Item>
                        <Item Key="State">2</Item>
                        <Item Key="SLA">1</Item>
                        <Item Key="Title">2</Item>
                        <Item Key="Type">1</Item>
        </Hash>
    </Item>
   </Hash>
  </Setting>
 </ConfigItem>

Eurer Phantasie sind keine Grenzen gesetzt. Wenn ihr eure Änderungen vorgenommen habt, kopiert ihr euer File auch in den Ordner Kernel/Config/Fi­les. Leider ist es damit noch nicht getan und die Config muss neu gebaut werden. Dafür gebt folgende Befehle als ((OTRS)) Community Edition-User ein:

cd /opt/otrs/bin
./otrs.Console.pl Maint::Config::Rebuild

Und fertig ist euer Dashlet.

Diesen Beitrag teilen

LinkedIn
Reddit
Telegram
WhatsApp
Email
Print
WordPress Cookie Hinweis von Real Cookie Banner