Colors in Event Ticket Calendar

Moderator: crythias

Locked
tomtom76
Znuny newbie
Posts: 9
Joined: 05 Feb 2015, 16:50
Znuny Version: OTRS4

Colors in Event Ticket Calendar

Post by tomtom76 »

Hi,

in the DashboardEventsTicketCalendar.pm is set the color by

Code: Select all

$Data{Color} = $Self->{TicketColors}->
Where are the TicketColors are set or configured?
I will setup colors for each different Owner.

Cheers
Thomas
RStraub
Znuny guru
Posts: 2210
Joined: 13 Mar 2014, 09:16
Znuny Version: 6.0.14
Real Name: Rolf Straub

Re: Colors in Event Ticket Calendar

Post by RStraub »

What a coincidence. I just tried to figure that out.

I did a full grep on the otrs folder and it returns exactly one hit for "TicketColors". Seems they aren't set anywhere and this assignment is undefined.
Currently using: OTRS 6.0.14 -- MariaDB -- Ubuntu 16 LTS
tomtom76
Znuny newbie
Posts: 9
Joined: 05 Feb 2015, 16:50
Znuny Version: OTRS4

Re: Colors in Event Ticket Calendar

Post by tomtom76 »

Question: Is it possible to change or setup the colors for event ticket calendar items?

Cheers
Thomas
jojo
Znuny guru
Posts: 15020
Joined: 26 Jan 2007, 14:50
Znuny Version: Git Master
Contact:

Re: Colors in Event Ticket Calendar

Post by jojo »

This is a "hook" used for a custom development we did to color the tickets based on the computed risk....
"Production": OTRS™ 8, OTRS™ 7, STORM powered by OTRS
"Testing": ((OTRS Community Edition)) and git Master

Never change Defaults.pm! :: Blog
Professional Services:: http://www.otrs.com :: enjoy@otrs.com
tomtom76
Znuny newbie
Posts: 9
Joined: 05 Feb 2015, 16:50
Znuny Version: OTRS4

Re: Colors in Event Ticket Calendar

Post by tomtom76 »

In which part or file are the Dashboard0280-DashboardEventsTicketCalendar created?

I have only found the JS EventsTicketCalandarInit() function.

Cheers
Thomas
RStraub
Znuny guru
Posts: 2210
Joined: 13 Mar 2014, 09:16
Znuny Version: 6.0.14
Real Name: Rolf Straub

Re: Colors in Event Ticket Calendar

Post by RStraub »

Kernel/Output/HTML/DashboardEventsTicketCalendar.pm

There's a loop over a ticketlist. The "CalendarEvent" is created with this block:

Code: Select all

                $LayoutObject->Block(
                    Name => 'CalendarEvent',
                    Data => \%Data,
                );

Currently using: OTRS 6.0.14 -- MariaDB -- Ubuntu 16 LTS
RStraub
Znuny guru
Posts: 2210
Joined: 13 Mar 2014, 09:16
Znuny Version: 6.0.14
Real Name: Rolf Straub

Re: Colors in Event Ticket Calendar

Post by RStraub »

Stumbled upon this post again after I had to change colors. How to do it, is modify the DashboardEventsTicketCalendar.pm, where the %Data hash is defined:

Code: Select all

                $Data{EYear}     = $1;
                $Data{EMonth}    = $2 - 1;
                $Data{EDay}      = $3;
                $Data{EHour}     = $4;
                $Data{EMinute}   = $5;
                $Data{ESecond}   = $6;
                $Data{Color}     = "#09C";
                $Data{AllDay}    = 'false';
                $Data{Url}       = "index.pl?Action=AgentTicketZoom;TicketID=$TicketID
                $Data{QueueName} = $QueuesAll{ $TicketDetail{QueueID} };
To something like this:

Code: Select all

                $Data{EYear}     = $1;
                $Data{EMonth}    = $2 - 1;
                $Data{EDay}      = $3;
                $Data{EHour}     = $4;
                $Data{EMinute}   = $5;
                $Data{ESecond}   = $6;

                if ($TicketDetail{Type} eq 'MyTicketType') {
                    $Data{Color} = "#930";
                } else {
                    $Data{Color}     = "#09C";
                }

                $Data{AllDay}    = 'false';
                $Data{Url}       = "index.pl?Action=AgentTicketZoom;TicketID=$TicketID;
                $Data{QueueName} = $QueuesAll{ $TicketDetail{QueueID} };
Currently using: OTRS 6.0.14 -- MariaDB -- Ubuntu 16 LTS
Locked