Proper Variable Passing

Moderator: crythias

Locked
Tobosaku
Znuny newbie
Posts: 7
Joined: 03 Mar 2014, 11:25
Znuny Version: 3.2.1.3

Proper Variable Passing

Post by Tobosaku »

I'm new to the OTRS System and am working on this issue since yesterday. Unfortunately I'm not use to the perl language, but have (supposedly) sufficient general knowledege from other languages. Therefore it would be very kind of you if you could give me a hint or maybe the link to a similar question. I really did use the search function many times and also looked into the developer documentation...

First what I'm trying to do: I would like to have a new variable in TicketOverviewSmall containing the ticket age based on working hours.

What I found and tried:
I thought that doing this in the Ticket.pm file would be the proper way. The proper use accordingly to what I've found already would be something like this:

my $RealTicketAge = $TimeObject->WorkingTime(
StartTime => $Self->{TimeObject}->SystemTime() - $Ticket{CreateTimeUnix},
StopTime => $TimeObject->SystemTime(),
);

Sadly I don't know yet if this would be working. I already needed quite some time to learn what files are working together and therefore thought that it would be a good idea to extend the TicketGet() method. What I didn't get obviously is which and how the variables for the $Data arrays are filled. I tried to fill variables with $Self->{LayoutObject} as described here in the forum, but wasn't able to call them in the dtl file.

It would be very kind of you if you could provide me some help, if it is a too basic question be assured that I'm sorry. I really tried :)
crythias
Moderator
Posts: 10170
Joined: 04 May 2010, 18:38
Znuny Version: 5.0.x
Location: SouthWest Florida, USA
Contact:

Re: Proper Variable Passing

Post by crythias »

You did well for the process of asking the question. :) (Mostly).

Your title should be reflective of the goal: Ticket age based on working hours.

I *think* you want to say something like:

StartTime => $Ticket{CreateTimeUnix},
StopTime => $Self->{TimeObject}->SystemTime(),
Calendar => $Escalation{Calendar},

But I'm not sure if you want to replace this value with a "fixed" Calendar "number" or if it actually works.
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
Locked