Some changes to .dtl and .pm files.

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

Moderator: crythias

Post Reply
User avatar
crythias
Moderator
Posts: 10080
Joined: 04 May 2010, 18:38
OTRS Version?: 5.0.x
Location: SouthWest Florida, USA
Contact:

Some changes to .dtl and .pm files.

Post by crythias » 24 Jun 2010, 21:48

UPDATE: for 3.3+ you have new customization options. Please look there instead of directly editing the DTL.

This post will do a lot of different things. It's best if you try them out in your own theme update: 3.0 version of theme link: http://doc.otrs.org/3.0/en/html/themes.html .

Add columns to dashboard:

Edit AgentDashboardTicketGeneric.dtl
about line 53: (Edit: In 3.0, try about line 110)

Code: Select all

          <td width="60%">
            <div title="$QData{"Title"}">$QData{"Title","70"}</div>
          </td>
          <td>$QData{"Queue"}</td> <!-- add if you want to see the Queue -->
          <td>$QData{"CustomerUserID", "15"}</td> <!-- add if you want to see the user login account -->
          <td>$QData{"CustomerID","15"}</td> <!-- add if you want to see the Company -->
          <td>$QData{"Owner"}</td> <!-- add this line for the owner-->
          <td>$QData{"Responsible"}</td> <!-- add this line for the responsible -->
          <td>$QData{"Time"}</td>
Add the exact pending reminder time to AgentTicketZoom
Edit Kernel/Language.pm around line 342:

Code: Select all

    my $ReturnString = $Self->{$Config} || "$Config needs to be translated!";
    if ( $String =~ /\d\d\d\d\d\d\d\d\d\d/ ) {
        $String = $Self->{TimeObject}->SystemTime2TimeStamp(
                SystemTime => $String,
        )
        }
What does it do? the pending time (until_time, or RealTillTimeNotUsed) is stored in unix epoch, not in a timestamp format. This is a "fix" to allow TimeLong to accept epoch numbers, by converting it to a time stamp for FormatTimeString to work. It's a nasty fix, because it assumes that all epoch numbers are (at least?) 10 digits. It is a bad thing (IMO) to consider using epoch time this close to 2038, though until it breaks, it does make for easy math calculations.

Why do you need it?
In line 356 of AgentTicketZoom.dtl:

Code: Select all

<dtl if ($Data{"PendingUntil"} ne "") { $Data{"PendingUntilString"} = "<tr valign="top"><td><b>$Text{"Pending till"}:</b></td><td>$Data{"PendingUntil"} $Data{"PendingTime"} $TimeLong{"$Data{"RealTillTimeNotUsed"}"})</td></tr>"; }>
See how $TimeLong is called on RealTillTimeNotUsed? if you don't make the Language.pm change, you'll simply get an epoch number.
This puts a date/time after the "remaining time" so you get the best of both worlds.

I also made a change to AgentTicketZoom.pm around line 352:

Code: Select all

        if ( $Param{UntilTime} < -1 && $Self->{HighlightColor2} ) {
            $Param{PendingUntil} .= " OVERDUE</font>";
        }
This merely adds the word OVERDUE, as in Pending Till: -30 days OVERDUE.
OTRS 5.0.x (private/testing/public) on Linux with MySQL database. Also on github.
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

ftmova
OTRS newbie
Posts: 7
Joined: 30 Nov 2010, 15:39
OTRS Version?: 2.4

Re: Some changes to .dtl and .pm files.

Post by ftmova » 09 Dec 2010, 11:21

Hello, thanks for your explanations but I want to see a general overview. E 'can create a new item in the dashboard where it displays only the users with their workload (in management, processing, closed)?

User avatar
crythias
Moderator
Posts: 10080
Joined: 04 May 2010, 18:38
OTRS Version?: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Some changes to .dtl and .pm files.

Post by crythias » 09 Dec 2010, 13:42

That's "My Queues", I believe.
OTRS 5.0.x (private/testing/public) on Linux with MySQL database. Also on github.
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

ftmova
OTRS newbie
Posts: 7
Joined: 30 Nov 2010, 15:39
OTRS Version?: 2.4

Re: Some changes to .dtl and .pm files.

Post by ftmova » 10 Dec 2010, 12:37

My Queues show only tickets that I have under management. I would rather get the ticket management at all. A general overview, but not list each individual ticket, but more a general overview. es. Operator 1 -> closed = 5, = 3 management

User avatar
crythias
Moderator
Posts: 10080
Joined: 04 May 2010, 18:38
OTRS Version?: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Some changes to .dtl and .pm files.

Post by crythias » 10 Dec 2010, 15:41

You probably want a stats report.
OTRS 5.0.x (private/testing/public) on Linux with MySQL database. Also on github.
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

ftmova
OTRS newbie
Posts: 7
Joined: 30 Nov 2010, 15:39
OTRS Version?: 2.4

Re: Some changes to .dtl and .pm files.

Post by ftmova » 13 Dec 2010, 15:36

Stat report users and their work

cbravo
OTRS wizard
Posts: 113
Joined: 18 Nov 2010, 00:33
OTRS Version?: 3.0

Re: Some changes to .dtl and .pm files.

Post by cbravo » 14 Dec 2010, 00:08

wow, you are awesome.
OTRS: 3.08
OS: Ubuntu
Apache2/MySQL 5

cbravo
OTRS wizard
Posts: 113
Joined: 18 Nov 2010, 00:33
OTRS Version?: 3.0

Re: Some changes to .dtl and .pm files.

Post by cbravo » 20 Dec 2010, 21:09

I tried your solution for the ticket owner and it works like a charm. I have one more question though, when the ticket has no owner, it shows root@localhost (since it's the first user created by the system). Is there any way I could show Not assigned instead? what file runs the query to get the ticket owners?
OTRS: 3.08
OS: Ubuntu
Apache2/MySQL 5

jojo
Moderator
Posts: 14521
Joined: 26 Jan 2007, 14:50
OTRS Version?: Git Master
Contact:

Re: Some changes to .dtl and .pm files.

Post by jojo » 20 Dec 2010, 23:47

just rename this user to "not assigned" thats it
"Production": OTRS™ 6, STORM powered by OTRS
"Testing": ((OTRS Community Edition)) git Master

Never change Defaults.pm! :: Blog
Professional Services:: http://www.otrs.com :: enjoy@otrs.com :: Share your ideas

cbravo
OTRS wizard
Posts: 113
Joined: 18 Nov 2010, 00:33
OTRS Version?: 3.0

Re: Some changes to .dtl and .pm files.

Post by cbravo » 21 Dec 2010, 00:23

yeah, I realized that after a few tries.
OTRS: 3.08
OS: Ubuntu
Apache2/MySQL 5

rpmariano
OTRS newbie
Posts: 1
Joined: 23 Feb 2011, 17:50
OTRS Version?: 3.0.4

Re: Some changes to .dtl and .pm files.

Post by rpmariano » 23 Feb 2011, 17:54

I allready found the reason, my Perl editor wasn't working well.

Notepad did the trick!

Thanks for the post.

Thanks ,
Rui



Hi,

I tryed to make the changes on AgentDashboardTicketGeneric.dtl , but I can't see any changes in the browser!

I even erase this all block:

<!-- dtl:block:ContentLargeTicketGenericRowMeta -->
<td width="60%">
<div title="$QData{"Title"}">$QData{"Title","70"}</div>
</td>
<td>$QData{"Queue"}</td> <!-- add if you want to see the Queue -->
<td>$QData{"CustomerID","15"}</td> <!-- add if you want to see the Company -->
<td>$QData{"Owner"}</td> <!-- add this line for the owner-->
<td>$QData{"Responsible"}</td> <!-- add this line for the responsible -->
<td>$QData{"Time"}</td>
</tr>

And the appearence in the browser is the same!

Ther's any kind off refresh to do?

Thanks,
Rui
OTRS 3.0 on Windows Server with MySQL database for Agents and Customers

meukmans
OTRS newbie
Posts: 47
Joined: 04 May 2011, 21:03
OTRS Version?: 3

Re: Some changes to .dtl and .pm files.

Post by meukmans » 19 May 2011, 15:05

The first part of the post about the dashboard. It works great but the rows aren't correct now anymore because some items, like time or queue, take 2 lines instead of 1. What file do i edit to adjust this to my needs ?

Thanks!
OTRS 3.0.7 On Windows Server 2008 R2

User avatar
crythias
Moderator
Posts: 10080
Joined: 04 May 2010, 18:38
OTRS Version?: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Some changes to .dtl and .pm files.

Post by crythias » 21 May 2011, 23:30

add NOWRAP in the <td> entry:
<td NOWRAP>...
OTRS 5.0.x (private/testing/public) on Linux with MySQL database. Also on github.
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

gambit23
OTRS newbie
Posts: 3
Joined: 12 May 2011, 18:09
OTRS Version?: 3.0.6

Re: Some changes to .dtl and .pm files.

Post by gambit23 » 01 Jun 2011, 21:05

Sorry, I need to add a column titles in the Dashboard views... it is possible ??


Thanks a lot !

dnw_jasper
OTRS newbie
Posts: 8
Joined: 09 Jun 2011, 15:20
OTRS Version?: 3.0.8
Company: Die Netz-Werker AG

Re: Some changes to .dtl and .pm files.

Post by dnw_jasper » 28 Jun 2011, 11:10

Same here. I would like to have some collumn titles in there ... but how?

User avatar
crythias
Moderator
Posts: 10080
Joined: 04 May 2010, 18:38
OTRS Version?: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Some changes to .dtl and .pm files.

Post by crythias » 29 Jun 2011, 15:52

It's a table, just add the column titles above the list.
<tr><th>column title1</th><th>column title2</th> ...</tr>
OTRS 5.0.x (private/testing/public) on Linux with MySQL database. Also on github.
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

dnw_jasper
OTRS newbie
Posts: 8
Joined: 09 Jun 2011, 15:20
OTRS Version?: 3.0.8
Company: Die Netz-Werker AG

Re: Some changes to .dtl and .pm files.

Post by dnw_jasper » 29 Jun 2011, 17:01

Hello Crythias,

Thanks for your Answer. Thats not bad for a start ... but: I was more looking for those active head-rows, as in the queue-view or in my-tickets. With the ability to sort column-wise. Is that possible?

Mike_B
Moderator
Posts: 266
Joined: 12 Jan 2010, 18:16
OTRS Version?: CVS HEAD

Re: Some changes to .dtl and .pm files.

Post by Mike_B » 29 Jun 2011, 21:49

dnw_jasper wrote:Thanks for your Answer. Thats not bad for a start ... but: I was more looking for those active head-rows, as in the queue-view or in my-tickets. With the ability to sort column-wise. Is that possible?
That would be possible, but it would need (much) more extensions in the supporting code, because you also need to support the sorting in the back end.
Probably future versions of OTRS will have this feature, we'll be looking into implementing the upcoming JQuery UI grid for this. It will have functionality for sorting, but also for dynamically adding columns, both for the administrator as on a per-user base.

If anyone is interested in helping out implementing this, it'd be awesome!
--
Mike
huntingbears.nl - @michielbeijen on Twitter

User avatar
crythias
Moderator
Posts: 10080
Joined: 04 May 2010, 18:38
OTRS Version?: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Some changes to .dtl and .pm files.

Post by crythias » 29 Jun 2011, 22:44

OTRS 5.0.x (private/testing/public) on Linux with MySQL database. Also on github.
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

yuri0001
OTRS ninja
Posts: 631
Joined: 17 Mar 2011, 14:40
OTRS Version?: 5.0.6
Real Name: Yuri Kolesnikov
Location: Russia

Re: Some changes to .dtl and .pm files.

Post by yuri0001 » 29 Aug 2011, 13:51

Thanks for the post? it very usefull!
But how can I display the Company name instead or additional to CustomerID in TicketZoom screen in Ticket Overview or Customer Overview block?
Is it possible?
What rows i need to add in AgentTicketZoom.dtl or another .dtl or .pm files to realyze my idea? :?
Best regards Yuri Kolesnikov
OTRS 5.0.14, ITSM 5.0.14
SUSE 13.2, MariaDB 10.0.22(productive)
OTRS 5.0.14, ITSM 5.0.14(test)

User avatar
crythias
Moderator
Posts: 10080
Joined: 04 May 2010, 18:38
OTRS Version?: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Some changes to .dtl and .pm files.

Post by crythias » 30 Aug 2011, 16:54

Anything in the Map of Config.pm can be added to the dtl.
OTRS 5.0.x (private/testing/public) on Linux with MySQL database. Also on github.
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

yuri0001
OTRS ninja
Posts: 631
Joined: 17 Mar 2011, 14:40
OTRS Version?: 5.0.6
Real Name: Yuri Kolesnikov
Location: Russia

Re: Some changes to .dtl and .pm files.

Post by yuri0001 » 07 Sep 2011, 14:02

crythias wrote:It's a table, just add the column titles above the list.
<tr><th>column title1</th><th>column title2</th> ...</tr>
And how to align the column headings to the center column and make the font bold?
Best regards Yuri Kolesnikov
OTRS 5.0.14, ITSM 5.0.14
SUSE 13.2, MariaDB 10.0.22(productive)
OTRS 5.0.14, ITSM 5.0.14(test)

User avatar
crythias
Moderator
Posts: 10080
Joined: 04 May 2010, 18:38
OTRS Version?: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Some changes to .dtl and .pm files.

Post by crythias » 08 Sep 2011, 13:39

yuri0001 wrote:And how to align the column headings to the center column and make the font bold?
I suggest looking up basic HTML at w3schools.com. This HowTo is not intended to teach HTML. If you want to ask this question in help, general, feel free.

<b> is bold, for instance.
OTRS 5.0.x (private/testing/public) on Linux with MySQL database. Also on github.
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

gbecker
OTRS newbie
Posts: 4
Joined: 30 Nov 2011, 23:10
OTRS Version?: 3.0.11
Real Name: German Becker

Re: Some changes to .dtl and .pm files.

Post by gbecker » 10 Jan 2012, 16:54

Hi, Is it possible to add information such as Customer "UserFirstname", etc on the Agent Dashboard?

Where is this QData "function" defined?

Romaing
OTRS expert
Posts: 60
Joined: 30 Mar 2012, 15:20
OTRS Version?: 3.1.5

Re: Some changes to .dtl and .pm files.

Post by Romaing » 25 Apr 2012, 18:03

Your post was very helpful crythias, thanks. Agent Dashboard has filled up with a lot of useful info ! :D

If i may just ask a tiny question :lol: do you know if there is another method to cut the value for the customer ID ? (as described here for QData: http://doc.otrs.org/developer/2.0/en/html/c494.html)

Since my users are imported from an active directory, they get an ID like : mister.nice@company.com
A really nice thing would be to cut at the value '@' without any character limit, so it would always display the full person name. e.g. 'mister.nice'

Thanks and have a nice day :)
OTRS 3.1.5 on Ubuntu 12.04
Database: MySQL
Module: FAQ

User avatar
crythias
Moderator
Posts: 10080
Joined: 04 May 2010, 18:38
OTRS Version?: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Some changes to .dtl and .pm files.

Post by crythias » 26 Apr 2012, 14:25

Romaing wrote:Since my users are imported from an active directory
Then grab alias or login, perhaps?
OTRS 5.0.x (private/testing/public) on Linux with MySQL database. Also on github.
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

Romaing
OTRS expert
Posts: 60
Joined: 30 Mar 2012, 15:20
OTRS Version?: 3.1.5

Re: Some changes to .dtl and .pm files.

Post by Romaing » 27 Apr 2012, 13:41

crythias wrote:
Romaing wrote:Since my users are imported from an active directory
Then grab alias or login, perhaps?
Actually i tried that already, that's why i asked.
Tried just everything i could think of: (manner of speach)
Login
UserLogin
Alias
MemberUid
UID
member

Only one that works is CustomerID, all above just give an empty column.
OTRS 3.1.5 on Ubuntu 12.04
Database: MySQL
Module: FAQ

User avatar
crythias
Moderator
Posts: 10080
Joined: 04 May 2010, 18:38
OTRS Version?: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Some changes to .dtl and .pm files.

Post by crythias » 27 Apr 2012, 20:05

Romaing wrote:Actually i tried that already, that's why i asked.
Did you happen to change Config.pm to grab the fields you tried? :) :)
OTRS 5.0.x (private/testing/public) on Linux with MySQL database. Also on github.
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

mojorianer
OTRS newbie
Posts: 22
Joined: 30 Nov 2010, 01:03
OTRS Version?: 3.1.6
Location: Berlin, Germany

Re: Some changes to .dtl and .pm files.

Post by mojorianer » 28 Apr 2012, 00:56

Hy everyone,

is there a way to output the ticket creator in Agent Dashboard?

I tried the following code in AgentDashboardTicketGeneric.dtl
<td>$QData{"CreatedByUser"}</td>
but it doesn`t work. Thanks
OTRS 3.1.10 on CentOS 6

User avatar
crythias
Moderator
Posts: 10080
Joined: 04 May 2010, 18:38
OTRS Version?: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Some changes to .dtl and .pm files.

Post by crythias » 28 Apr 2012, 22:01

You may try anything that's available in Kernel::System::Ticket::TicketGet

Code: Select all

 %Ticket = (
        TicketNumber       => '20101027000001',
        TicketID           => 123,
        State              => 'some state',
        StateID            => 123,
        StateType          => 'some state type',
        Priority           => 'some priority',
        PriorityID         => 123,
        Lock               => 'lock',
        LockID             => 123,
        Queue              => 'some queue',
        QueueID            => 123,
        CustomerID         => 'customer_id_123',
        CustomerUserID     => 'customer_user_id_123',
        Owner              => 'some_owner_login',
        OwnerID            => 123,
        Type               => 'some ticket type',
        TypeID             => 123,
        SLA                => 'some sla',
        SLAID              => 123,
        Service            => 'some service',
        ServiceID          => 123,
        Responsible        => 'some_responsible_login',
        ResponsibleID      => 123,
        Age                => 3456,
        Created            => '2010-10-27 20:15:00'
        CreateTimeUnix     => '1231414141',
        Changed            => '2010-10-27 20:15:15',
        ArchiveFlag        => 'y',
        TicketFreeKey1-16
        TicketFreeText1-16
        TicketFreeTime1-6
        # (time stampes of expected escalations)
        EscalationResponseTime           (unix time stamp of response time escalation)
        EscalationUpdateTime             (unix time stamp of update time escalation)
        EscalationSolutionTime           (unix time stamp of solution time escalation)
        # (general escalation info of nearest escalation type)
        EscalationDestinationIn          (escalation in e. g. 1h 4m)
        EscalationDestinationTime        (date of escalation in unix time, e. g. 72193292)
        EscalationDestinationDate        (date of escalation, e. g. "2009-02-14 18:00:00")
        EscalationTimeWorkingTime        (seconds of working/service time till escalation, e. g. "1800")
        EscalationTime                   (seconds total till escalation of nearest escalation time type - response, update or solution time, e. g. "3600")
        # (detail escalation info about first response, update and solution time)
        FirstResponseTimeEscalation      (if true, ticket is escalated)
        FirstResponseTimeNotification    (if true, notify - x% of escalation has reached)
        FirstResponseTimeDestinationTime (date of escalation in unix time, e. g. 72193292)
        FirstResponseTimeDestinationDate (date of escalation, e. g. "2009-02-14 18:00:00")
        FirstResponseTimeWorkingTime     (seconds of working/service time till escalation, e. g. "1800")
        FirstResponseTime                (seconds total till escalation, e. g. "3600")
        UpdateTimeEscalation             (if true, ticket is escalated)
        UpdateTimeNotification           (if true, notify - x% of escalation has reached)
        UpdateTimeDestinationTime        (date of escalation in unix time, e. g. 72193292)
        UpdateTimeDestinationDate        (date of escalation, e. g. "2009-02-14 18:00:00")
        UpdateTimeWorkingTime            (seconds of working/service time till escalation, e. g. "1800")
        UpdateTime                       (seconds total till escalation, e. g. "3600")
        SolutionTimeEscalation           (if true, ticket is escalated)
        SolutionTimeNotification         (if true, notify - x% of escalation has reached)
        SolutionTimeDestinationTime      (date of escalation in unix time, e. g. 72193292)
        SolutionTimeDestinationDate      (date of escalation, e. g. "2009-02-14 18:00:00")
        SolutionTimeWorkingTime          (seconds of working/service time till escalation, e. g. "1800")
        SolutionTime                     (seconds total till escalation, e. g. "3600")
    ); 
Since the *creator* of the ticket is captured in Article History, you may be unsuccessful in your quest.
OTRS 5.0.x (private/testing/public) on Linux with MySQL database. Also on github.
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

Romaing
OTRS expert
Posts: 60
Joined: 30 Mar 2012, 15:20
OTRS Version?: 3.1.5

Re: Some changes to .dtl and .pm files.

Post by Romaing » 02 May 2012, 09:09

Thanks crythias, using CustomerUserId works great instead of CustomerId ;)
OTRS 3.1.5 on Ubuntu 12.04
Database: MySQL
Module: FAQ

Cheesypuffs
OTRS newbie
Posts: 27
Joined: 20 Jun 2012, 10:50
OTRS Version?: 3.1.6

Re: Some changes to .dtl and .pm files.

Post by Cheesypuffs » 20 Jun 2012, 10:57

Just jumping on the bandwagon here....

In AgentDashboardTicketGeneric.dtl, I have added the following to add a Owner column to the Dashboard Ticket view:

<div title="$QData{"Owner"}">$QData{"Owner","20"}</div>

However, I am seeing the Owner Id (e.g. BloggsJ) whereas I would like to see the owner firstname and lastname (e.g Joe Bloggs)

Is this possible?

User avatar
crythias
Moderator
Posts: 10080
Joined: 04 May 2010, 18:38
OTRS Version?: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Some changes to .dtl and .pm files.

Post by crythias » 20 Jun 2012, 16:21

Cheesypuffs wrote: I would like to see the owner firstname and lastname (e.g Joe Bloggs)

Is this possible?
Not without coding.
What I posted above is all that you'll get.
OTRS 5.0.x (private/testing/public) on Linux with MySQL database. Also on github.
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

Cheesypuffs
OTRS newbie
Posts: 27
Joined: 20 Jun 2012, 10:50
OTRS Version?: 3.1.6

Re: Some changes to .dtl and .pm files.

Post by Cheesypuffs » 12 Nov 2012, 16:36

Thanks I managed to do that

Now I have a similar issue for the dashboard in that I have created 2 dynamic fields (one called "ThirdParty", the other "ThirdPartyTicketNumber")

I want to see them both on the dashboard in 2 separate columns after the Ticket ID. Can this be done and how as I am having trouble doing this? I have managed to modify the dtl to include 2 more columns but obviously neither know where to get the data from. Can you help?

Thanks!

User avatar
crythias
Moderator
Posts: 10080
Joined: 04 May 2010, 18:38
OTRS Version?: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Some changes to .dtl and .pm files.

Post by crythias » 27 Nov 2012, 15:19

Please post questions like this in the forum, as we don't have to deal with moderation. HowTos are not intended for discussion on the questions.
OTRS 5.0.x (private/testing/public) on Linux with MySQL database. Also on github.
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

Cheesypuffs
OTRS newbie
Posts: 27
Joined: 20 Jun 2012, 10:50
OTRS Version?: 3.1.6

Re: Some changes to .dtl and .pm files.

Post by Cheesypuffs » 27 Nov 2012, 17:42

Sorry about that. I have managed to sort it out anyways.

Tata

risker
OTRS expert
Posts: 91
Joined: 21 Jan 2008, 08:16
OTRS Version?: Kein OTRS
Real Name: Oliver Skibbe
Company: MDKN
Location: Hannover
Contact:

Re: Some changes to .dtl and .pm files.

Post by risker » 28 Nov 2012, 11:39

crythias wrote:
Cheesypuffs wrote: I would like to see the owner firstname and lastname (e.g Joe Bloggs)

Is this possible?
Not without coding.
What I posted above is all that you'll get.
Code:
File: Kernel/Output/HTML/DashboardTicketGeneric.pm
# get needed objects
for (
qw(Config Name ConfigObject LogObject DBObject LayoutObject ParamObject TicketObject UserID)
)
{
die "Got no $_!" if ( !$Self->{$_} );
}
+ # create an agent user object, drop this at line 35/36 (OTRS 3.0/3.1)
+ $Self->{AgentUserObject} = Kernel::System::User->new(%Param);

...

This code block goes into Ticket data generation, same file: for my $TicketID ( @{$TicketIDs} ) {

+ # create ticket owner name, drop this at line 349/364 (OTRS 3.0/3.1)
+ my %Owner = $Self->{AgentUserObject}->GetUserData(
+ User => $Ticket{Owner},
+ );
+
+ $Ticket{OwnerName} = $Owner{UserFirstname}.' '.$Owner{UserLastname};

Template:
File: Kernel/Output/HTML/Standard/AgentDashboardTicketGeneric.dtl
# line 111, in dtl block <!-- dtl:block:ContentLargeTicketGenericRowMeta -->
+ <td>$QData{"OwnerName"}</td>


I hope this is understandable.


Greetings
1. OTRS Version: 3.0.12
Module: FAQ, extended TimeAccounting (supports Projects), SystemMonitoring, ITSM, Support
Server: Apache/2.0.55 (Ubuntu 10.04) PHP/5.2.6 mod_ssl/2.2.9 OpenSSL/0.9.8a mod_perl/2.0.4 Perl/v5.8.7.

ImageCIPHRON Security, Communications & Engineering
ImageCIPHRON OTRS Unterstützung & Dienstleistungen

Post Reply