Creating your own dashlet

Dont create your support topics here! No new topics with questions allowed!

Moderator: crythias

Forum rules
Dont create your support topics here! No new topics with questions allowed!
Post Reply
crythias
Moderator
Posts: 10169
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Creating your own dashlet

Post by crythias »

You probably never thought about this or you did, but, is it really that hard to make your own dashlet?
Actually, it's not. Just create a file such as otrs/Kernel/Config/Files/myDashlet.xml and add params. Then go to SysConfig and make sure it's enabled.

For open tickets with multiple ServiceIDs:

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<otrs_config version="1.0" init="Application">
    <ConfigItem Name="DashboardBackend###0600-MyTitle" Required="0" Valid="1">
        <Description Translatable="1">Some relevant description. Explain the parameters as this is shown in SysConfig</Description>
        <Group>Ticket</Group>
        <SubGroup>Frontend::Agent::Dashboard</SubGroup>
        <Setting>
            <Hash>
                <Item Key="Module">Kernel::Output::HTML::DashboardTicketGeneric</Item>
                <Item Key="Title">The title that shows for the Dashlet</Item>
                <Item Key="Description">Another description line</Item>
                <Item Key="Attributes">StateType=open;ServiceIDs=37;ServiceIDs=38;</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>
            </Hash>
        </Setting>
    </ConfigItem>
</otrs_config>
Available Parameters to Attributes are most of what you'd expect (State, SLA, Service,Queue) but those that may be available to use multiple entries must be specified multiple times, as in the above example.

Code: Select all

        TypeIDs CreatedTypeIDs StateIDs CreatedStateIDs StateTypeIDs LockIDs OwnerIDs ResponsibleIDs CreatedUserIDs
        QueueIDs CreatedQueueIDs PriorityIDs CreatedPriorityIDs ServiceIDs SLAIDs WatchUserIDs
Other multiples:

Code: Select all

        Types TypeIDs CreatedTypes CreatedTypeIDs States StateIDs CreatedStates CreatedStateIDs StateTypeIDs
        Locks LockIDs OwnerIDs ResponsibleIDs CreatedUserIDs Queues QueueIDs CreatedQueues CreatedQueueIDs
        Priorities PriorityIDs CreatedPriorities CreatedPriorityIDs Services ServiceIDs SLAs SLAIDs WatchUserIDs
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
dbouvet
Znuny newbie
Posts: 11
Joined: 06 Aug 2014, 16:44
Znuny Version: 3.3.8
Location: Lyon, France

Re: Creating your own dashlet

Post by dbouvet »

Dear Crythias,

Which are the possible values for "Permission" key?

Thanks,
David
crythias
Moderator
Posts: 10169
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Creating your own dashlet

Post by crythias »

dbouvet wrote:Which are the possible values for "Permission" key?
These would be the permissions that exist in sysconfig, Ticket -> Core::Ticket, System::Permission

They are assigned in Admin, Agent<->Group
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
dbouvet
Znuny newbie
Posts: 11
Joined: 06 Aug 2014, 16:44
Znuny Version: 3.3.8
Location: Lyon, France

Re: Creating your own dashlet

Post by dbouvet »

Is it possible to put

Code: Select all

<Item Key="Permission">rw;owner</Item>
?
crythias
Moderator
Posts: 10169
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Creating your own dashlet

Post by crythias »

No and unnecessary.
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
dbouvet
Znuny newbie
Posts: 11
Joined: 06 Aug 2014, 16:44
Znuny Version: 3.3.8
Location: Lyon, France

Re: Creating your own dashlet

Post by dbouvet »

You are right it is unnecessary. Values chosen for the example were not relevant.

OK only one value for the key.
Thanks a lot.
McGinkel
Znuny newbie
Posts: 4
Joined: 05 Oct 2010, 09:28
Znuny Version: 3.0b?

Re: Creating your own dashlet

Post by McGinkel »

How can I set a filter that shows tickets only assigned to me ?
I understand state etc, but how do you enter the current username as each user would have a different selection.
crythias
Moderator
Posts: 10169
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Creating your own dashlet

Post by crythias »

McGinkel wrote:How can I set a filter that shows tickets only assigned to me ?
I understand state etc, but how do you enter the current username as each user would have a different selection.
"My Tickets" for each dashlet shows tickets *locked* to you.
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
McGinkel
Znuny newbie
Posts: 4
Joined: 05 Oct 2010, 09:28
Znuny Version: 3.0b?

Re: Creating your own dashlet

Post by McGinkel »

Can I change that so I can see all tickets assigned to me even if they are no longer locked ?
McGinkel
Znuny newbie
Posts: 4
Joined: 05 Oct 2010, 09:28
Znuny Version: 3.0b?

Re: Creating your own dashlet

Post by McGinkel »

Or can I add my tickets so i have a choice in each dashlet between my locked, my tickets, tickets in my queue and all tickets ?
(if this is not possible, can I create a new dashlet ?)
Braincrawler
Znuny newbie
Posts: 1
Joined: 12 Apr 2019, 09:31
Znuny Version: 7.0.6
Real Name: Heiko Stroech
Company: xxx

Re: Creating your own dashlet

Post by Braincrawler »

Hey folks!

Please be aware that the following line must be changed since OTRS 6:
<Item Key="Module">Kernel::Output::HTML::DashboardTicketGeneric</Item>
must be
<Item Key="Module">Kernel::Output::HTML::Dashboard::TicketGeneric</Item>

otherwise the dashlets are not showing up and you get error messages in the otrs.log.

greetinx

Braincrawler
Post Reply