cloning a dashlet, what am I missing?

English! place to talk about development, programming and coding
Post Reply
Alexander Halle
Znuny expert
Posts: 296
Joined: 04 Jul 2010, 17:49
Znuny Version: 3.1.x
Real Name: Alexander Halle
Company: radprax MVZ GmbH
Location: Wuppertal
Contact:

cloning a dashlet, what am I missing?

Post by Alexander Halle »

I have cloned the "Upcoming Events" dashlet to get a second dashlet which shows more tickets.

The second dashlet works fine, but when I activate both dashlets at the same time then the orginal dashlet suddenly shows the same tickets as the cloned one. Obviously I made a mistake in the cloned "/otrs/Kernel/Output/HTML/DashboardCalendar.pm" so that both dashlets share the same ticket list.

This is the orignal file:
http://source.otrs.org/viewvc.cgi/otrs/ ... iew=markup

I have copied DashboardCalendar.pm, renamed it (DashboardCalendarXXX.pm), adjusted the package name (line 12) and replaced the template file reference (line 184) with the name of the copied and renamed dtl file. Of course I also created a xml file for the dashlet and let its module parameter point to my cloned DashboardCalendarXXX.pm.

Can someone please give me a hint how to correct the ticket list behaviour, so that I get two independent dashlets with independent ticket lists? I'm still at the very beginning of learning Perl and OTRS code.
Alexander Halle System: OTRS 3.1.x, Ubuntu 10.04.x LTS, MySQL 5.1.x, Apache 2.2.x
OTRS Community Links: User Meetings, Projects
artjoms15
Znuny advanced
Posts: 121
Joined: 30 Aug 2011, 10:48
Znuny Version: 3.3.8 && 4.0.9
Real Name: Artjoms Petrovs
Location: Latvia

Re: cloning a dashlet, what am I missing?

Post by artjoms15 »

You should change the name of the data block as well (Line 169 and maybe Line 177)

Code: Select all

Name => 'ContentSmallCalendarOverviewRow',
to some other name. Do not forget to change it in according DTL file as well.
Ar cieņu / Kind regards,
----------------------------------------
Artjoms Petrovs
Sistēmu analītiķis/Programmētājs /
Systems Analyst/Programmer
Post Reply