Time Worked Report

I’ve written a sql query to pull out the time worked for all tickets
resolved in the last week among other things. The problem with this is that
it doesn’t give a complete picture of time worked for any given week since a
ticket could have had time worked put in as part of a transaction but the
ticket might still be open. I could query the Transactions table for the
TimeTaken field, but that could lead to double-counting if any of those
transactions are part of a resolved ticket.

I know I could work through the db/sql and find the right query to pull out
the time worked in the last week, but I’m wondering if someone else has
already done it so I can save myself the trouble.

Thanks,
Steve

I had a bit of a go at doing this myself. It needs some more work as it
doesnt take into account if time has been removed from a ticket. It
happens sometimes because of typos etc.

If you get anywhere with this please share it, as I havent had the time
to work on it further.

PRNumber is an internal reference number that we book client work too,
so you wont need that, or you can change it for something else.

SELECT distinct SUM(Transactions.TimeTaken) AS ‘Time Taken (Mins)’,
Transactions.Created, Users.RealName, Tickets.Subject, Queues.Name AS
‘Queue Name’, Transactions.ObjectId AS ‘Ticket ID’,

(select ObjectCustomFieldValues.Content from ObjectCustomFieldValues
where ObjectCustomFieldValues.CustomField = ‘11’ and
Transactions.ObjectId = ObjectCustomFieldValues.ObjectId order by
ObjectCustomFieldValues.id desc LIMIT 1) AS PRNumber

FROM Transactions

LEFT JOIN Users

ON Transactions.Creator = Users.Id

LEFT JOIN Tickets

ON Transactions.ObjectId = Tickets.id

LEFT JOIN Queues

ON Tickets.Queue = Queues.Id

WHERE Transactions.TimeTaken !=0

AND DATE_SUB(CURDATE(),INTERVAL 15 DAY) <= Transactions.Created

GROUP BY Subject;From: rt-users-bounces@lists.bestpractical.com
[mailto:rt-users-bounces@lists.bestpractical.com] On Behalf Of Stephen
Cochran
Sent: 03 March 2009 05:01
To: rt Users
Subject: [rt-users] Time Worked Report

I’ve written a sql query to pull out the time worked for all tickets
resolved in the last week among other things. The problem with this is
that it doesn’t give a complete picture of time worked for any given
week since a ticket could have had time worked put in as part of a
transaction but the ticket might still be open. I could query the
Transactions table for the TimeTaken field, but that could lead to
double-counting if any of those transactions are part of a resolved
ticket.

I know I could work through the db/sql and find the right query to pull
out the time worked in the last week, but I’m wondering if someone else
has already done it so I can save myself the trouble.

Thanks,
Steve

Just thought of another situation where it gets tricky…if the “Time
Worked” is input in the Basics of the ticket itself, it doesn’t log in a
transaction either. So only looking in the Transactions would potentially be
missing something.On Tue, Mar 3, 2009 at 12:01 AM, Stephen Cochran < stephen.a.cochran.lists@cahir.net> wrote:

I’ve written a sql query to pull out the time worked for all tickets
resolved in the last week among other things. The problem with this is that
it doesn’t give a complete picture of time worked for any given week since a
ticket could have had time worked put in as part of a transaction but the
ticket might still be open. I could query the Transactions table for the
TimeTaken field, but that could lead to double-counting if any of those
transactions are part of a resolved ticket.

I know I could work through the db/sql and find the right query to pull out
the time worked in the last week, but I’m wondering if someone else has
already done it so I can save myself the trouble.

Thanks,
Steve

Looks like that would work to me. Though I would need to get the time
taken no matter what the status is as I was aiming at pulling the info
out for time sheets for the developers and support department so the
accounts department can invoice clients. At the moment RT users are
putting all their work in RT, and then putting their time in a separate
timesheet, which management then compile and give to accounts.

It would be very useful to have a time sheet extension for this purpose,
and most of the code and info must already be available in RT to do
this.From: Stephen Cochran [mailto:stephen.a.cochran.lists@cahir.net]
Sent: 03 March 2009 14:27
To: Alex Young
Subject: Re: [rt-users] Time Worked Report

Thinking through this, the only way to be completely accurate list of
time spend in some given time_window would be the following (in psudo
sql):

total time worked in time_window from transactions

select SUM(Transactions.TimeTaken) from …
where (Tickets.status = open or stalled or new) and
Transactions.Created is within time_window

get total time worked from tickets resolved in time_window

select Tickets.TimeWorked from …
where (Tickets.status = resolved) and
Tickets.Resolved is within time_window

subtract time from all transactions from tickets resolved in

time_window
select SUM(Transactions.TimeTaken) from …
where (Tickets.status = resolved) and
Tickets.Resolved is within time_window and
Transactions.ObjectId = Tickets.id

This will capture all times entered directly into the TimeWorked field
of the ticket as occurring during the time_window when the ticket was
resolved. Probably fairly accurate, and would never be double counted.

Anyone see a flaw in this? Still think this is harder than it should be.
Explains why RT hasn’t had these reports already :wink:

Its been suggested to make the Ticket.TimeWorked field uneditable by
users. That would stop anyone from editing the field directly, and it
would only change when adding or subtracted time worked in a
transaction. Besides, if youre removing time from a ticket you should be
saying why youre removing time. Same for adding time.

Stephen, dont forget to reply to all if you want the list to see your
replies. (Which I think you do)From: Stephen Cochran [mailto:stephen.a.cochran.lists@cahir.net]
Sent: 03 March 2009 15:33
To: Alex Young
Subject: Re: [rt-users] Time Worked Report

You could use the same logic and not restrict on resolved, but not sure
how you’d know not to double-count any time put in by adjusting the
Tickets.TimeWorked directly. It could also be adjusted downwards as
well, which raises all sorts of other questions about where that would
get subtracted from. Adjustments made to TimeWorked do cause a
transaction to be created, it just doesn’t populate the TimeTaken field
of the transaction.

Now that I think about it, that might be the simplest solution, beacuse
most of the complexity comes from trying to accurately deal with direct
adjustments made to the Tickets.TimeWorked field.

Anyone from BestP that could weigh in on the consequences of having a
change to TimeWorked also record the different in
Transactions.TimeTaken?

You could use the same logic and not restrict on resolved, but not sure how
you’d know not to double-count any time put in by adjusting the
Tickets.TimeWorked directly. It could also be adjusted downwards as well,
which raises all sorts of other questions about where that would get
subtracted from. Adjustments made to TimeWorked do cause a transaction to be
created, it just doesn’t populate the TimeTaken field of the transaction.

Now that I think about it, that might be the simplest solution, beacuse most
of the complexity comes from trying to accurately deal with direct
adjustments made to the Tickets.TimeWorked field.

Anyone from BestP that could weigh in on the consequences of having a change
to TimeWorked also record the different in Transactions.TimeTaken?On Tue, Mar 3, 2009 at 9:52 AM, Alex Young alexyoung@scoutsolutions.co.ukwrote:

Looks like that would work to me. Though I would need to get the time
taken no matter what the status is as I was aiming at pulling the info out
for time sheets for the developers and support department so the accounts
department can invoice clients. At the moment RT users are putting all their
work in RT, and then putting their time in a separate timesheet, which
management then compile and give to accounts.

It would be very useful to have a time sheet extension for this purpose,
and most of the code and info must already be available in RT to do this.

From: Stephen Cochran [mailto:stephen.a.cochran.lists@cahir.net]
Sent: 03 March 2009 14:27
To: Alex Young
Subject: Re: [rt-users] Time Worked Report

Thinking through this, the only way to be completely accurate list of time
spend in some given time_window would be the following (in psudo sql):

total time worked in time_window from transactions

select SUM(Transactions.TimeTaken) from …
where (Tickets.status = open or stalled or new) and
Transactions.Created is within time_window

get total time worked from tickets resolved in time_window

select Tickets.TimeWorked from …
where (Tickets.status = resolved) and
Tickets.Resolved is within time_window

subtract time from all transactions from tickets resolved in time_window

select SUM(Transactions.TimeTaken) from …
where (Tickets.status = resolved) and
Tickets.Resolved is within time_window and
Transactions.ObjectId = Tickets.id

This will capture all times entered directly into the TimeWorked field of
the ticket as occurring during the time_window when the ticket was resolved.
Probably fairly accurate, and would never be double counted.

Anyone see a flaw in this? Still think this is harder than it should be.
Explains why RT hasn’t had these reports already :wink:

On Tue, Mar 3, 2009 at 4:28 AM, Alex Young < alexyoung@scoutsolutions.co.uk> wrote:

I had a bit of a go at doing this myself. It needs some more work as it
doesnt take into account if time has been removed from a ticket. It happens
sometimes because of typos etc.

If you get anywhere with this please share it, as I havent had the time to
work on it further.

PRNumber is an internal reference number that we book client work too, so
you wont need that, or you can change it for something else.

SELECT distinct SUM(Transactions.TimeTaken) AS ‘Time Taken (Mins)’,
Transactions.Created, Users.RealName, Tickets.Subject, Queues.Name AS ‘Queue
Name’, Transactions.ObjectId AS ‘Ticket ID’,

(select ObjectCustomFieldValues.Content from ObjectCustomFieldValues where
ObjectCustomFieldValues.CustomField = ‘11’ and Transactions.ObjectId =
ObjectCustomFieldValues.ObjectId order by ObjectCustomFieldValues.id desc
LIMIT 1) AS PRNumber

FROM Transactions

LEFT JOIN Users

ON Transactions.Creator = Users.Id

LEFT JOIN Tickets

ON Transactions.ObjectId = Tickets.id

LEFT JOIN Queues

ON Tickets.Queue = Queues.Id

WHERE Transactions.TimeTaken !=0

AND DATE_SUB(CURDATE(),INTERVAL 15 DAY) <= Transactions.Created

GROUP BY Subject;

From: rt-users-bounces@lists.bestpractical.com [mailto:
rt-users-bounces@lists.bestpractical.com] *On Behalf Of *Stephen Cochran
Sent: 03 March 2009 05:01
To: rt Users
Subject: [rt-users] Time Worked Report

I’ve written a sql query to pull out the time worked for all tickets
resolved in the last week among other things. The problem with this is that
it doesn’t give a complete picture of time worked for any given week since a
ticket could have had time worked put in as part of a transaction but the
ticket might still be open. I could query the Transactions table for the
TimeTaken field, but that could lead to double-counting if any of those
transactions are part of a resolved ticket.

I know I could work through the db/sql and find the right query to pull out
the time worked in the last week, but I’m wondering if someone else has
already done it so I can save myself the trouble.

Thanks,
Steve

Alex,

We have many group managers that want a time report by cycle (week or 

month). I figured we would just create a new Table (Called Time_Cycle).
Then, write a cron job to run every month that would put put the time
worked for the month in the appropriate cycle bucket. If the amount was
the same as last month, it would put in the difference, otherwise, it
would enter 0. That way, an SQL report could look at the table and see
the actual time worked per month on a ticket.
I haven’t seen or heard anything about an enhancement to basic RT to do
this, so it would have to be at your own risk.

Kenn
LBNLOn 3/3/2009 6:52 AM, Alex Young wrote:

Looks like that would work to me. Though I would need to get the time
taken no matter what the status is as I was aiming at pulling the info
out for time sheets for the developers and support department so the
accounts department can invoice clients. At the moment RT users are
putting all their work in RT, and then putting their time in a separate
timesheet, which management then compile and give to accounts.

It would be very useful to have a time sheet extension for this purpose,
and most of the code and info must already be available in RT to do this.

From: Stephen Cochran [mailto:stephen.a.cochran.lists@cahir.net]
Sent: 03 March 2009 14:27
To: Alex Young
Subject: Re: [rt-users] Time Worked Report

Thinking through this, the only way to be completely accurate list of
time spend in some given time_window would be the following (in psudo sql):

total time worked in time_window from transactions

select SUM(Transactions.TimeTaken) from …
where (Tickets.status = open or stalled or new) and
Transactions.Created is within time_window

get total time worked from tickets resolved in time_window

select Tickets.TimeWorked from …
where (Tickets.status = resolved) and
Tickets.Resolved is within time_window

subtract time from all transactions from tickets resolved in time_window

select SUM(Transactions.TimeTaken) from …
where (Tickets.status = resolved) and
Tickets.Resolved is within time_window and
Transactions.ObjectId = Tickets.id

This will capture all times entered directly into the TimeWorked field
of the ticket as occurring during the time_window when the ticket was
resolved. Probably fairly accurate, and would never be double counted.

Anyone see a flaw in this? Still think this is harder than it should be.
Explains why RT hasn’t had these reports already :wink:

On Tue, Mar 3, 2009 at 4:28 AM, Alex Young <alexyoung@scoutsolutions.co.uk mailto:alexyoung@scoutsolutions.co.uk> wrote:

I had a bit of a go at doing this myself. It needs some more work as it
doesnt take into account if time has been removed from a ticket. It
happens sometimes because of typos etc.

If you get anywhere with this please share it, as I havent had the time
to work on it further.

PRNumber is an internal reference number that we book client work too,
so you wont need that, or you can change it for something else.

SELECT distinct SUM(Transactions.TimeTaken) AS ‘Time Taken (Mins)’,
Transactions.Created, Users.RealName, Tickets.Subject, Queues.Name AS
‘Queue Name’, Transactions.ObjectId AS ‘Ticket ID’,

(select ObjectCustomFieldValues.Content from ObjectCustomFieldValues
where ObjectCustomFieldValues.CustomField = ‘11’ and
Transactions.ObjectId = ObjectCustomFieldValues.ObjectId order by
ObjectCustomFieldValues.id desc LIMIT 1) AS PRNumber

FROM Transactions

LEFT JOIN Users

ON Transactions.Creator = Users.Id

LEFT JOIN Tickets

ON Transactions.ObjectId = Tickets.id

LEFT JOIN Queues

ON Tickets.Queue = Queues.Id

WHERE Transactions.TimeTaken !=0

AND DATE_SUB(CURDATE(),INTERVAL 15 DAY) <= Transactions.Created

GROUP BY Subject;

From: rt-users-bounces@lists.bestpractical.com
mailto:rt-users-bounces@lists.bestpractical.com
[mailto:rt-users-bounces@lists.bestpractical.com
mailto:rt-users-bounces@lists.bestpractical.com] *On Behalf Of
*Stephen Cochran
Sent: 03 March 2009 05:01
To: rt Users
Subject: [rt-users] Time Worked Report

I’ve written a sql query to pull out the time worked for all tickets
resolved in the last week among other things. The problem with this is
that it doesn’t give a complete picture of time worked for any given
week since a ticket could have had time worked put in as part of a
transaction but the ticket might still be open. I could query the
Transactions table for the TimeTaken field, but that could lead to
double-counting if any of those transactions are part of a resolved ticket.

I know I could work through the db/sql and find the right query to pull
out the time worked in the last week, but I’m wondering if someone else
has already done it so I can save myself the trouble.

Thanks,
Steve



The rt-users Archives

Community help: http://wiki.bestpractical.com
Commercial support: sales@bestpractical.com

Discover RT’s hidden secrets with RT Essentials from O’Reilly Media.
Buy a copy at http://rtbook.bestpractical.com

I just took a quick look to see if I could see where the Transaction is
created for editing the TimeWorked field in the Ticket Basics.Traced it as
follows Ticket/Modify.html → Web.pm::ProcessTicketBasics() →
Web.pm::UpdateRecordObject() → Record.pm::Update(), but that seems to be
it. I don’t see what triggers a transaction in any of those functions.

Probably easier to disable the TimeWorked field in the
Ticket/Elements/EditBasics file so it can’t be used by accident and train
users to put in a comment/reply.

Would be clean to simply have a transcation generated from modifying the
basic info update the TimeTaken field in the transaction to be the different
of old - new TimeWorked. Then all time info could be pulled from the
transaction table easily.

SteveOn Tue, Mar 3, 2009 at 10:38 AM, Alex Young alexyoung@scoutsolutions.co.ukwrote:

Its been suggested to make the Ticket.TimeWorked field uneditable by
users. That would stop anyone from editing the field directly, and it would
only change when adding or subtracted time worked in a transaction. Besides,
if youre removing time from a ticket you should be saying why youre removing
time. Same for adding time.

Stephen, dont forget to reply to all if you want the list to see your
replies. (Which I think you do)

From: Stephen Cochran [mailto:stephen.a.cochran.lists@cahir.net]
Sent: 03 March 2009 15:33

To: Alex Young
Subject: Re: [rt-users] Time Worked Report

You could use the same logic and not restrict on resolved, but not sure how
you’d know not to double-count any time put in by adjusting the
Tickets.TimeWorked directly. It could also be adjusted downwards as well,
which raises all sorts of other questions about where that would get
subtracted from. Adjustments made to TimeWorked do cause a transaction to be
created, it just doesn’t populate the TimeTaken field of the transaction.

Now that I think about it, that might be the simplest solution, beacuse
most of the complexity comes from trying to accurately deal with direct
adjustments made to the Tickets.TimeWorked field.

Anyone from BestP that could weigh in on the consequences of having a
change to TimeWorked also record the different in Transactions.TimeTaken?

On Tue, Mar 3, 2009 at 9:52 AM, Alex Young < alexyoung@scoutsolutions.co.uk> wrote:

Looks like that would work to me. Though I would need to get the time taken
no matter what the status is as I was aiming at pulling the info out for
time sheets for the developers and support department so the accounts
department can invoice clients. At the moment RT users are putting all their
work in RT, and then putting their time in a separate timesheet, which
management then compile and give to accounts.

It would be very useful to have a time sheet extension for this purpose,
and most of the code and info must already be available in RT to do this.

From: Stephen Cochran [mailto:stephen.a.cochran.lists@cahir.net]
Sent: 03 March 2009 14:27
To: Alex Young
Subject: Re: [rt-users] Time Worked Report

Thinking through this, the only way to be completely accurate list of time
spend in some given time_window would be the following (in psudo sql):

total time worked in time_window from transactions

select SUM(Transactions.TimeTaken) from …
where (Tickets.status = open or stalled or new) and
Transactions.Created is within time_window

get total time worked from tickets resolved in time_window

select Tickets.TimeWorked from …
where (Tickets.status = resolved) and
Tickets.Resolved is within time_window

subtract time from all transactions from tickets resolved in time_window

select SUM(Transactions.TimeTaken) from …
where (Tickets.status = resolved) and
Tickets.Resolved is within time_window and
Transactions.ObjectId = Tickets.id

This will capture all times entered directly into the TimeWorked field of
the ticket as occurring during the time_window when the ticket was resolved.
Probably fairly accurate, and would never be double counted.

Anyone see a flaw in this? Still think this is harder than it should be.
Explains why RT hasn’t had these reports already :wink:

On Tue, Mar 3, 2009 at 4:28 AM, Alex Young alexyoung@scoutsolutions.co.uk wrote:

I had a bit of a go at doing this myself. It needs some more work as it
doesnt take into account if time has been removed from a ticket. It happens
sometimes because of typos etc.

If you get anywhere with this please share it, as I havent had the time to
work on it further.

PRNumber is an internal reference number that we book client work too, so
you wont need that, or you can change it for something else.

SELECT distinct SUM(Transactions.TimeTaken) AS ‘Time Taken (Mins)’,
Transactions.Created, Users.RealName, Tickets.Subject, Queues.Name AS ‘Queue
Name’, Transactions.ObjectId AS ‘Ticket ID’,

(select ObjectCustomFieldValues.Content from ObjectCustomFieldValues where
ObjectCustomFieldValues.CustomField = ‘11’ and Transactions.ObjectId =
ObjectCustomFieldValues.ObjectId order by ObjectCustomFieldValues.id desc
LIMIT 1) AS PRNumber

FROM Transactions

LEFT JOIN Users

ON Transactions.Creator = Users.Id

LEFT JOIN Tickets

ON Transactions.ObjectId = Tickets.id

LEFT JOIN Queues

ON Tickets.Queue = Queues.Id

WHERE Transactions.TimeTaken !=0

AND DATE_SUB(CURDATE(),INTERVAL 15 DAY) <= Transactions.Created

GROUP BY Subject;

From: rt-users-bounces@lists.bestpractical.com [mailto:
rt-users-bounces@lists.bestpractical.com] *On Behalf Of *Stephen Cochran
Sent: 03 March 2009 05:01
To: rt Users
Subject: [rt-users] Time Worked Report

I’ve written a sql query to pull out the time worked for all tickets
resolved in the last week among other things. The problem with this is that
it doesn’t give a complete picture of time worked for any given week since a
ticket could have had time worked put in as part of a transaction but the
ticket might still be open. I could query the Transactions table for the
TimeTaken field, but that could lead to double-counting if any of those
transactions are part of a resolved ticket.

I know I could work through the db/sql and find the right query to pull out
the time worked in the last week, but I’m wondering if someone else has
already done it so I can save myself the trouble.

Thanks,
Steve

Did the thread on the Time Worked Report ever get resolved?

This is the thread started by Stephen Cochran. back in 3/09 or so’ish…

Joel Hartshorn
Internet Engineer/New Media
The Seattle Times Company
206 464 2323
nwsource.com | seattletimes.com

smime.p7s (3.28 KB)

Fran Fabrizio and I whipped up a script that can take a date range, either
local time or UTC, and output a report on the command line. It¹s trivial to
wrap that to output html to a location in your local tree and have a daily
report with cron.

I believe I put it on the wiki, but will have to look at it.On 8/12/09 5:21 PM, “Joel Hartshorn” jhartshorn@seattletimes.com wrote:

Did the thread on the Time Worked Report ever get resolved?

This is the thread started by Stephen CochranŠ back in 3/09 or so’ish…

Joel Hartshorn
Internet Engineer/New Media
The Seattle Times Company
206 464 2323
nwsource.com | seattletimes.com


The rt-users Archives

Community help: http://wiki.bestpractical.com
Commercial support: sales@bestpractical.com

Discover RT’s hidden secrets with RT Essentials from O’Reilly Media.
Buy a copy at http://rtbook.bestpractical.com


Drew Barnes
Applications Analyst
Network Resources Dept.
Raymond Walters College

yes,

i believe i have seen that. however, the main issue that didn’t appear to
be resolved is that of not all “TimeWorked” transactions being saved as rows
in the Transactions table. EX: A comment shows as a comment transaction
with TimeTaken potentially recorded. However, there is no transaction
recorded w/in this table for the TimeWorked field being changed.

Joel Hartshorn
Internet Engineer/New Media
The Seattle Times Company
206 464 2323
nwsource.com | seattletimes.comFrom: Drew Barnes [mailto:barnesaw@ucrwcu.rwc.uc.edu]
Sent: Thursday, August 13, 2009 7:41 AM
To: Joel Hartshorn; rt-users@lists.bestpractical.com
Subject: Re: [rt-users] Time Worked Report

Fran Fabrizio and I whipped up a script that can take a date range, either
local time or UTC, and output a report on the command line. It’s trivial to
wrap that to output html to a location in your local tree and have a daily
report with cron.

I believe I put it on the wiki, but will have to look at it.

smime.p7s (3.28 KB)

Hi all,

i installed the Time Worked Report
(http://requesttracker.wikia.com/wiki/TimeWorkedReport) on our RT 3.8.7
and got Errors by opening the TimeWorkedReport.html from my RT:

Error during compilation of
/usr/share/request-tracker3.8/html/Elements/SelectMultiQueue: Global
symbol “$d” requires explicit package name at
/usr/share/request-tracker3.8/html/Elements/SelectMultiQueue line 51.
Global symbol “$queue” requires explicit package name at
/usr/share/request-tracker3.8/html/Elements/SelectMultiQueue line 69.
Global symbol “$queue” requires explicit package name at
/usr/share/request-tracker3.8/html/Elements/SelectMultiQueue line 69.
Global symbol “$queue” requires explicit package name at
/usr/share/request-tracker3.8/html/Elements/SelectMultiQueue line 77.
Global symbol “$queue” requires explicit package name at
/usr/share/request-tracker3.8/html/Elements/SelectMultiQueue line 80.

it seems to be, that the name of the queue wouldn�t be commited to the
Perldoc!? Sorry, i�m not a specialist at these part. We try to figure
out the Problem for an hour, but we don�t know about these “package
name”… any ideas?

I hope you guys can help us to fix the problem. Thanks!

Greetz,

Alex

Besuchen Sie uns auf der CeBIT in Hannover
vom 1. bis 5. M�rz 2011 in Halle 9, Stand B29

Alexander K�hler
Auszubildender
IT-Administration

the agent factory GmbH
Intershop Tower
Leutragraben 1
D-07743 Jena

Tel.: +49(0) 3641 573 3473
Fax: +49(0) 3641 573 3488

koehler@the-agent-factory.de

Gesch�ftsf�hrer: Dipl.-Math. Michael Selle

Handelsregister Amtsgericht Jena - HRB 209769

Member of TowerByte eG
www.towerbyte.de

Hi,

I am a bit of a newbie with RT, and was wondering if you could help me.

After following the installation your instructions at http://requesttracker.wikia.com/wiki/TimeWorkedReport, I get the following errors when clicking on the Time Worked Report link in RT:

Error during compilation of /usr/share/rt3/html/Elements/SelectMultiQueue: Global symbol “$d” requires explicit package name at /usr/share/rt3/html/Elements/SelectMultiQueue line 51. Global symbol “$queue” requires explicit package name at /usr/share/rt3/html/Elements/SelectMultiQueue line 69. Global symbol “$queue” requires explicit package name at /usr/share/rt3/html/Elements/SelectMultiQueue line 69. Global symbol “$queue” requires explicit package name at /usr/share/rt3/html/Elements/SelectMultiQueue line 77. Global symbol “$queue” requires explicit package name at /usr/share/rt3/html/Elements/SelectMultiQueue line 80.

Although the requirement states RT 3.8.5, I decided to give it a go on 3.8.4. Must I definitely upgrade in order to get this report to work?

I am running RT on the following setup:
Fedora Core 12, Apache 2.2.14, MYSQL 5.1

Thanks in advance.

Regards,
Walid

Walid,

Did you copy the …/share/… directories/files to …/local/…
directories/files and make your modifications there? That a WAY safer way to
make modifications. You may have forgotten one and that is the problem?

Kenn
LBNLOn Thu, Mar 24, 2011 at 9:51 AM, Walid Haider walid.haider@movensis.comwrote:

Hi,

I am a bit of a newbie with RT, and was wondering if you could help me.

After following the installation your instructions at
http://requesttracker.wikia.com/wiki/TimeWorkedReport, I get the following
errors when clicking on the Time Worked Report link in RT:

Error during compilation of /usr/share/rt3/html/Elements/SelectMultiQueue:
Global symbol “$d” requires explicit package name at
/usr/share/rt3/html/Elements/SelectMultiQueue line 51. Global symbol
“$queue” requires explicit package name at
/usr/share/rt3/html/Elements/SelectMultiQueue line 69. Global symbol
“$queue” requires explicit package name at
/usr/share/rt3/html/Elements/SelectMultiQueue line 69. Global symbol
“$queue” requires explicit package name at
/usr/share/rt3/html/Elements/SelectMultiQueue line 77. Global symbol
“$queue” requires explicit package name at
/usr/share/rt3/html/Elements/SelectMultiQueue line 80.

Although the requirement states RT 3.8.5, I decided to give it a go on
3.8.4. Must I definitely upgrade in order to get this report to work?

I am running RT on the following setup:

Fedora Core 12, Apache 2.2.14, MYSQL 5.1

Thanks in advance.

Regards,

Walid

This implies that you have a syntax error in your copy and paste

Error during compilation of /usr/share/rt3/html/Elements/SelectMultiQueue: Global symbol “$d”
requires explicit package name at /usr/share/rt3/html/Elements/SelectMultiQueue line 51.
Global symbol “$queue” requires explicit package name at
/usr/share/rt3/html/Elements/SelectMultiQueue line 69. Global symbol “$queue” requires
explicit package name at /usr/share/rt3/html/Elements/SelectMultiQueue line 69. Global symbol
“$queue” requires explicit package name at /usr/share/rt3/html/Elements/SelectMultiQueue line
77. Global symbol “$queue” requires explicit package name at
/usr/share/rt3/html/Elements/SelectMultiQueue line 80.

I have no idea if 3.8.5 is required but the RT version isn’t related
to your syntax error

Although the requirement states RT 3.8.5, I decided to give it a go on 3.8.4. Must I
definitely upgrade in order to get this report to work?

-kevin

Walid,

What I mean is this; it is highly recommended that any changes you make to
RT code be done in a “local” version. RT will automatically look to $Home/
local/…/…/ (where $home is usually opt/rt3/) for any override
code
that an installation may have developed. In this example
(TimeWorkedReport),
I copied the various /$home*/share/…/… directories & files listed in
the "readme’ for that report into a /$home/local/…/… version/copy of
those directoryies & files. I did NOT make any changes to any /share/
version
of RT code. This is recommended for a couple reasons; the least of
which it is easier to maintain later versions of RT without wiping out
your local code (provided you keep a copy of that code). Also, industry wide
for about the last 40 years, it has been considered a best practice to *
never
mess with original code, but to provide a method that allows you to
use other code instead.

So, my advice is to first; return all /share/ code to it’s original state.
Then create $home*/local/*html/Tools/Reports directories in order to
copy/create the files mentioned in the “TimeWorkedReport” documentation.
That’s what I did:

  1. If it exists,type “/opt/rt3/local/html/Elements/” otherwise,
    create it.
  2. Copy the “delivered” file (from …/share/…) SelectQueue over to
    this directory with a the new name.
    A) Type “cp /opt/rt3/share/html/Elements/SelectQueue SelectMultiQueue”
    .
  3. Replace the code in “SelectMultiQueue” with the code specified for this
    file from the document the “TimeWorkedReport".
  4. If it exists, type “/opt/rt3/local/html/Tools/” , otherwise,
    create it.
  5. Create new directories:
    A) Create “Reports” directory within *“Tools”
    *B) Get into “Reports” directory.
    C) Create “Elements” directory within “Tools/Reports”
  6. Copy the “delivered” files (from …/share/…) (Tabs, index.html)
    over to the new directories:
    A) Copy the “Tabs” file over to “Tools/Reports/Elements”:
    1) Within “Elements”, type “cp
    /opt/rt3/share/html/Tools/Reports/Elements/Tabs .”
    .
    2) Go back 1 directory level to get to “/Tools/Reports”.
    3) Copy the “index.html” file over to “Tools/Reports” twice:
    a) Within “Tools/Reports”, type “cp
    /opt/rt3/share/html/Tools/index.html .”
    .
    b) Within “Tools/Reports”, type “cp
    /opt/rt3/share/html/Tools/index.html TimeWorkedReport.html”
    .
  7. Modify/Replace the code in *“Tabs”, “index.html” & “TimeWorkedReport” *with
    the code specified for these files from the document the “Time Worked
    Report”
    .

Anyway, This is the procedure I followed and I had absolutely no problems
AND I didn’t have to worry about Production being messed up.

Also, I’m in 3.8.7 so I made sure to follow the 3.8 instructions.

Hope this helps.

Kenn
LBNLOn Mon, Mar 28, 2011 at 2:53 AM, Walid Haider walid.haider@movensis.comwrote:

Hi Ken,

Thanks for the swift response.

I am not sure what you mean by “copy the …/share/… directories/files
to …/local/… directories/files”. Below are the steps I followed:

  1. edit /usr/share/rt3/html/Tools/Reports/index.html and add the following
    lines in the my $tabs section after:

C => {

    title       => loc('Created in a date range'),

    path        => '/Tools/Reports/CreatedByDates.html',

    description => loc('Examine tickets created in a queue between two

dates’),

},

++++++++++ ADD THIS SECTION ++++++++++++++++++++++++

D => {

title       => loc('Time Worked Report'),

path        => '/Tools/Reports/TimeWorkedReport.html',

description => loc('A Time Worked Report'),

},

++++++++++++++++++++++++++++++++++++++++++++++++++++

  1. edit /usr/share/rt3/html/Tools/Reports/Elements/Tabs and add the
    following lines in the my $tabs section after:

c => {

    title => loc('Created in a date range'),

    path  => 'Tools/Reports/CreatedByDates.html',

},

++++++++++ ADD THIS SECTION ++++++++++++++++++++++++

d => {

title => loc('Time Worked Report'),

path  => 'Tools/Reports/TimeWorkedReport.html',

},

++++++++++++++++++++++++++++++++++++++++++++++++++++

  1. Create the file /usr/share/rt3/html/Elements/SelectMultiQueue, with the
    following content:

%# BEGIN BPS TAGGED BLOCK {{{

%#

%# COPYRIGHT:

%#

%# This software is Copyright (c) 1996-2009 Best Practical Solutions, LLC

%# jesse@bestpractical.com

%#

%# (Except where explicitly superseded by other copyright notices)

%#

%#

%# LICENSE:

%#

%# This work is made available to you under the terms of Version 2 of

%# the GNU General Public License. A copy of that license should have

%# been provided with this software, but in any event can be snarfed

%# from www.gnu.org.

%#

%# This work is distributed in the hope that it will be useful, but

%# WITHOUT ANY WARRANTY; without even the implied warranty of

%# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU

%# General Public License for more details.

%#

%# You should have received a copy of the GNU General Public License

%# along with this program; if not, write to the Free Software

%# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA

%# 02110-1301 or visit their web page on the internet at

%# GNU General Public License v2.0 - GNU Project - Free Software Foundation.

%#

%#

%# CONTRIBUTION SUBMISSION POLICY:

%#

%# (The following paragraph is not intended to limit the rights granted

%# to you to modify and distribute this software under the terms of

%# the GNU General Public License and is only of importance to you if

%# you choose to contribute your changes and enhancements to the

%# community by submitting them to Best Practical Solutions, LLC.)

%#

%# By intentionally submitting any modifications, corrections or

%# derivatives to this work, or any other work intended for use with

%# Request Tracker, to Best Practical Solutions, LLC, you confirm that

%# you are the copyright holder for those contributions and you grant

%# Best Practical Solutions, LLC a nonexclusive, worldwide, irrevocable,

%# royalty-free, perpetual, license to use, copy, create derivative

%# works based on those contributions, and sublicense and distribute

%# those contributions and any derivatives thereof.

%#

%# END BPS TAGGED BLOCK }}}

% if ($Lite) {

% my $d = new RT::Queue($session{‘CurrentUser’});

% $d->Load($Default);

% }

% else {

% # $Default will be an arrayref if multiple queues are selected, or a

% # scalar if 0-1 queues are selected. Hence, this ugly processing
logic.

% my %selected;

% if (ref $Default) {

% for (@$Default) {

% $selected{$_} = 1;

% }

% } else {

% $selected{$Default} = 1;

% }

<select name=“<%$Name%>” <% ($OnChange) ? ‘onchange="’.$OnChange.‘"’ : ‘’
|n %> class=" <%$Class%>" MULTIPLE>

% if ($ShowNullOption) {

-

% }

% for my $queue (@{$session{$cache_key}}) {

<option value="<% ($NamedValues ? $queue->{Name} : $queue->{Id}) %>"

%# if ($queue->{Id} eq ($Default||‘’) || $queue->{Name} eq ($Default||‘’))
{

% if($selected{$queue->{Id}}) {

selected=“selected”

% }

 <%$queue->{Name}%>

% if ($Verbose and $queue->{Description}) {

 (<%$queue->{Description}%>)

% }

% }

% }

<%args>

$CheckQueueRight => ‘CreateTicket’

$ShowNullOption => 1

$ShowAllQueues => 1

$Name => undef

$Verbose => undef

$NamedValues => 0

$Default => 0

$Lite => 0

$OnChange => undef

$Class => ‘select-queue’

</%args>

<%init>

my $cache_key = “SelectQueue—”

             . $session{'CurrentUser'}->Id

             . "---$CheckQueueRight---$ShowAllQueues";

if (not defined $session{$cache_key} and not $Lite) {

 my $q = new RT::Queues($session{'CurrentUser'});

 $q->UnLimit;



 while (my $queue = $q->Next) {

     if ($ShowAllQueues ||

$queue->CurrentUserHasRight($CheckQueueRight)) {

         push @{$session{$cache_key}}, {

             Id          => $queue->Id,

             Name        => $queue->Name,

             Description => $queue->Description,

         };

     }

 }

}

</%init>

  1. Create the file /usr/share/rt3/html/Tools/Reports/TimeWorkedReport.html,
    with the following content:

<%args>

$startdate => undef

$enddate => undef

$queues => undef

$byticket => undef

</%args>

<& /Elements/Header, Title => $title &>

<& /Tools/Reports/Elements/Tabs, current_tab =>
‘Tools/Reports/TimeWorkedReport.html’, Title => $title &>


<%init>

my ($start_date, $end_date, $effective_end_date, $title);

$title = loc(‘Time worked report’);

$start_date = RT::Date->new($session{‘CurrentUser’});

$end_date = RT::Date->new($session{‘CurrentUser’});

If we have a value for start date, parse it into an RT::Date object

if ($startdate) {

$start_date->Set(Format => ‘unknown’, Value => $startdate);

And then get it back as an ISO string for display purposes, in the

form field and

report header

$startdate = $start_date->AsString(Format => ‘ISO’, Timezone =>
‘server’);

}

Same treatment for end date

if ($enddate) {

$end_date->Set(Format => ‘unknown’, Value => $enddate);

$enddate = $end_date->AsString(Format => ‘ISO’, Timezone => ‘server’);

}

</%init>


<&|/l&>Start date</&>:

<& /Elements/SelectDate, Name => ‘startdate’, Default => ($startdate) ?
$start_date->AsString(Format => ‘ISO’, Timezone => ‘server’) : ‘’&>

(report will start from midnight on this day unless you indicate
otherwise)


<&|/l&>End date</&>:

<& /Elements/SelectDate, Name => ‘enddate’, Default => ($enddate) ?
$end_date->AsString(Format => ‘ISO’, Timezone => ‘server’) : ‘’&>

(report will -not- be inclusive of this day unless you change the time
from midnight)


<&|/l&>Queues</&>:

<& /Elements/SelectMultiQueue, Name => ‘queues’, Default => ($queues) ?
$queues : ‘’&>


<& /Elements/Checkbox, Name => ‘byticket’, Default => ($byticket) ?
‘checked’ : ‘’&>

Organize report by ticket instead of by person

<& /Elements/Submit&>

<%perl>

TimeWorkedReport

Version 0.04 2009-09-28

Fran Fabrizio, UAB CIS, fran@cis.uab.edu

use strict;

if we are just getting here and the form values are empty, we are done

if (!$startdate || !$enddate) {

return;

}

get the queue object(s)

my $queuesobj = new RT::Queues($session{CurrentUser});

my ($queuelist, %queuesofinterest);

The user’s choice of queues will come in from the web form in the

$queues variable, which is

mapped to the SELECT field on the web interface for the report.

Unfortunately, if the user

chooses just one queue, $queues will have a scalar value, but if the

user chooses multiple

queues, it will be an arrayref. So we need to check for each case and

process differently.

What we want to construct is the %queuesofinterest simple lookup hash

which defines a key

that is the queue ID for each queue selected, and the $queuelist string,

which is just for

displaying the list of queues in the report header

if (ref $queues) {

multiple queues selected

for (@$queues) {

 $queuesobj->Limit(FIELD => "Id", OPERATOR => "=", VALUE => $_,

ENTRYAGGREGATOR => “OR”);

 $queuesofinterest{$_} = 1;

}

$queuelist = join ", ", map {$_->Name} @{$queuesobj->ItemsArrayRef};

} else {

my $queue = new RT::Queue;

$queue->Load(Id => $queues);

$queuesofinterest{$queues} = 1;

$queuelist = $queue->Name;

}

hash to hold statistics

%stats will be a multilevel hash - first level keys are the usernames,

second level keys are

the ticket IDs, and for each ticket, we store an anonymous hash with

keys Subject and TimeWorked

(this implies that a single ticket can live under two+ users if they

both worked the ticket)

my %stats;

Get a new transactions object to hold transaction search results for

this ticket

my $trans = new RT::Transactions($session{‘CurrentUser’});

only in the period of interest

$trans->Limit(FIELD => ‘Created’, OPERATOR => ‘>’, VALUE => $startdate);

$trans->Limit(FIELD => ‘Created’, OPERATOR => ‘<’, VALUE => $enddate,
ENTRYAGGREGATOR => ‘AND’);

now start counting all the TimeTaken by examining transactions

associated with this ticket

while (my $tr = $trans->Next) {

did this transaction take any time? RT records this -either- in

TimeTaken column or by

indicating “TimeWorked” in the Field column, depending on how the user

inputted the time.

if (($tr->TimeTaken != 0) || ($tr->Field && $tr->Field eq ‘TimeWorked’))
{

# Got a hot one - what ticket is this?

my $t = new RT::Ticket($session{'CurrentUser'});

$t->Load($tr->ObjectId);



if (!$t) {

  # unable to retrieve a ticket for this transaction

  # hopefully we don't ever reach here!

  next;

} else {

  # Is this ticket in a queue we care about?

  if (!$queuesofinterest{$t->Queue}) {

    next;

  }

}



# If this is time logged by user RT_System, it's the result of a ticket

merge

# In order to avoid double-counting minutes in --byticket mode, or the

less serious

# issue of displaying a report for user RT_System in normal mode, we

skip this entirely

if ($tr->CreatorObj->Name eq 'RT_System') {

  next;

}



# we've got some time to account for



# is this the first time this person is charging time to this ticket?

# if so, add this ticket subject to the data structure

if (!exists($stats{$tr->CreatorObj->Name}{$t->id}{Subject})) {

  $stats{$tr->CreatorObj->Name}{$t->id}{Subject} = $t->Subject;

}



if ($tr->TimeTaken != 0) {

  # this was a comment or correspondence where the user also added some

time worked

  # value of interest appears in Transaction's TimeTaken column

  $stats{$tr->CreatorObj->Name}{$t->id}{TimeWorked} += $tr->TimeTaken;

} else {

  # this was a direct update of the time worked field from the Basics

or Jumbo ticket update page

  # values of interest appear in Transaction's OldValue and NewValue

columns

  # RT does not use the TimeTaken column in this instance.

  $stats{$tr->CreatorObj->Name}{$t->id}{TimeWorked} += $tr->NewValue -

$tr->OldValue;

}

}

}

report output starts here

output:

normal user: their own time worked report, most worked ticket to least

worked ticket

superuser: everyone’s time worked report, in username alpha order,

then by most worked to least worked

superuser+byticket: most worked ticket first, with everyone’s

contribution ranked by biggest contribution to smallest

print "

TIME WORKED REPORT FOR QUEUE(S) " . $queuelist . “

”;

print “

Date Range: $startdate TO $enddate

”;

if ($byticket) {

print “

Organized by Ticket

”;

}

print “


”;

if this person is not a superuser, we should only show them the report

for themselves

which means we should remove all keys from %stats except their own

username

if (!($session{‘CurrentUser’}->HasRight(Right => ‘SuperUser’, Object =>
$RT::System))) {

my %tempstats;

$tempstats{$session{CurrentUser}->Name} =
$stats{$session{CurrentUser}->Name};

%stats = %tempstats;

}

if ($byticket) {

if we’re going to organize this by ticket, we need to transform the

data first

HAVE ENTRIES LIKE: $stats{JoeUser}{12345}{TimeWorked} = 150

$stats{JoeUser}{12345}{Subject} = "Fix the Fubar

Widget"

WANT ENTRIES LIKE: $tstats{12345}{TotalTime} = 250

$tstats{12345}{Subject} = “Fix the Fubar Widget”

$tstats{12345}{People}{JoeUser} = 150

$tstats{12345}{People}{JaneDoe} = 100

my %tstats;

for my $person (keys %stats) {

 for my $tid (keys %{$stats{$person}}) {

   # grab the subject line if you don't have it already

   if (!exists($tstats{$tid}{Subject})) {

     $tstats{$tid}{Subject} = $stats{$person}{$tid}{Subject};

   }

   # now increment total time for this ticket

   $tstats{$tid}{TotalTime} += $stats{$person}{$tid}{TimeWorked};

   # and record this user's contribution to this ticket

   $tstats{$tid}{People}{$person} = $stats{$person}{$tid}{TimeWorked};

 }

}

Now emit the report

for my $tid (sort {$tstats{$b}{TotalTime} <=> $tstats{$a}{TotalTime}}
keys %tstats) {

 my $subject = $tstats{$tid}{Subject};

 print "<H3><A TARGET=\"_TimeWorked\"

HREF="/Ticket/Display.html?id=$tid">$tid: $subject";

 print "<TABLE BORDER=0 CELLSPACING=5>";

 printf("<TR><TH WIDTH=30></TH><TH>%dm</TH><TH>%.1fh</TH><TH>TOTAL

TIME", $tstats{$tid}{TotalTime},($tstats{$tid}{TotalTime} / 60));

 for my $person (sort {$tstats{$tid}{People}{$b} <=>

$tstats{$tid}{People}{$a}} keys %{$tstats{$tid}{People}}) {

   my $minutes = $tstats{$tid}{People}{$person};

printf(“%dm%.1fh%s”,$minutes,($minutes
/60),$person);

 }

 print "</TABLE>";

}

} else {

the existing %stats data structure is perfect for the default report,

no data transform needed

for my $person (sort keys %stats) {

 # get the person object, so we can get the FriendlyName to use as

header

 my $personobj = new RT::User($session{CurrentUser});

 $personobj->Load($person);



 print "<h3>" . $personobj->FriendlyName . "</h3>";

 print "<TABLE BORDER=0 CELLSPACING=5>";

 print "<TR><TH>MINUTES</TH><TH>HOURS</TH><TH>TICKET</TH></TR>";

 my $totalMinutes = 0;

 for my $tid (sort {$stats{$person}{$b}{TimeWorked} <=>

$stats{$person}{$a}{TimeWorked}} keys %{$stats{$person}}) {

   my $minutes = $stats{$person}{$tid}{TimeWorked};

   my $subject = $stats{$person}{$tid}{Subject};

   print "<TR><TD ALIGN=RIGHT>${minutes}m</TD><TD ALIGN=RIGHT>" .

sprintf(“%.1fh”,($minutes/60)) . “” .

             "<TD><A TARGET=\"_TimeWorked\"

HREF="/Ticket/Display.html?id=$tid">$tid: $subject";

   $totalMinutes += $minutes;

 }

 print "<TR><TD ALIGN=RIGHT><B>${totalMinutes}m</B></TD><TD

ALIGN=RIGHT>" . sprintf(“%.1fh”,($totalMinutes/60)) .
TOTALS”;

 print "</TABLE>";

}

}

helper functions below

sub form_date_string {

expects seven input params - year, month, day, hour, minute, second,

offset

my $year = $_[0] - 1900;

my $mon = $_[1] - 1;

my $day = $_[2];

my $hour = $[3] ? $[3] : 0;

my $min = $[4] ? $[4] : 0;

my $sec = $[5] ? $[5] : 0;

my $offset = $[6] ? $[6] : 0;

convert to seconds since epoch, then adjust for the $offset, which is

also in seconds

we do this so we don’t have to do fancy date arithmetic - we can just

subtract one seconds

value from the other seconds value

my $starttime = timelocal($sec,$min,$hour,$day,$mon,$year) - $offset;

convert back to component parts now that we’ve adjusted for offset

this gives us the components which represent the GMT time for the local

time that was entered

on the command line

($sec,$min,$hour,$day,$mon,$year) = localtime($starttime);

format the date string, padding with zeros if needed

return sprintf(“%04d-%02d-%02d %02d:%02d:%02d”, ($year+1900), ($mon+1),
$day, $hour, $min, $sec);

}

</%perl>

  1. Restart the RT Server

Thanking you in anticipation,

Walid

From: rt-users-bounces@lists.bestpractical.com [mailto:
rt-users-bounces@lists.bestpractical.com] *On Behalf Of *Kenneth Crocker
Sent: quinta-feira, 24 de Março de 2011 17:02
To: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] Time Worked Report

Walid,

Did you copy the …/share/… directories/files to …/local/…
directories/files and make your modifications there? That a WAY safer way to
make modifications. You may have forgotten one and that is the problem?

Kenn
LBNL

On Thu, Mar 24, 2011 at 9:51 AM, Walid Haider walid.haider@movensis.com wrote:

Hi,

I am a bit of a newbie with RT, and was wondering if you could help me.

After following the installation your instructions at
http://requesttracker.wikia.com/wiki/TimeWorkedReport, I get the following
errors when clicking on the Time Worked Report link in RT:

Error during compilation of /usr/share/rt3/html/Elements/SelectMultiQueue:
Global symbol “$d” requires explicit package name at
/usr/share/rt3/html/Elements/SelectMultiQueue line 51. Global symbol
“$queue” requires explicit package name at
/usr/share/rt3/html/Elements/SelectMultiQueue line 69. Global symbol
“$queue” requires explicit package name at
/usr/share/rt3/html/Elements/SelectMultiQueue line 69. Global symbol
“$queue” requires explicit package name at
/usr/share/rt3/html/Elements/SelectMultiQueue line 77. Global symbol
“$queue” requires explicit package name at
/usr/share/rt3/html/Elements/SelectMultiQueue line 80.

Although the requirement states RT 3.8.5, I decided to give it a go on
3.8.4. Must I definitely upgrade in order to get this report to work?

I am running RT on the following setup:

Fedora Core 12, Apache 2.2.14, MYSQL 5.1

Thanks in advance.

Regards,

Walid

Kenn,

Again, thanks for the reply. As I ran a packaged install of RT 3.8.4, my $home is /usr/share/rt3. My folder structure is different compared to what you mention below, as I do not have a share directory within my RT $home.

Please advise if I should create the local directory within /usr/share/rt3.

Thanks,
WalidFrom: rt-users-bounces@lists.bestpractical.com [mailto:rt-users-bounces@lists.bestpractical.com] On Behalf Of Kenneth Crocker
Sent: segunda-feira, 28 de Março de 2011 17:33
To: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] Time Worked Report

Walid,

What I mean is this; it is highly recommended that any changes you make to RT code be done in a “local” version. RT will automatically look to $Home/local/…/…/ (where $home is usually opt/rt3/) for any override code that an installation may have developed. In this example (TimeWorkedReport), I copied the various /$home/share/…/… directories & files listed in the "readme’ for that report into a /$home/local/…/… version/copy of those directoryies & files. I did NOT make any changes to any /share/ version of RT code. This is recommended for a couple reasons; the least of which it is easier to maintain later versions of RT without wiping out your local code (provided you keep a copy of that code). Also, industry wide for about the last 40 years, it has been considered a best practice to never mess with original code, but to provide a method that allows you to use other code instead.

So, my advice is to first; return all /share/ code to it’s original state. Then create $home/local/html/Tools/Reports directories in order to copy/create the files mentioned in the “TimeWorkedReport” documentation. That’s what I did:

  1. If it exists,type “/opt/rt3/local/html/Elements/” otherwise, create it.
  2. Copy the “delivered” file (from …/share/…) SelectQueue over to this directory with a the new name.
    A) Type “cp /opt/rt3/share/html/Elements/SelectQueue SelectMultiQueue” .
  3. Replace the code in “SelectMultiQueue” with the code specified for this file from the document the “TimeWorkedReport”.
  4. If it exists, type “/opt/rt3/local/html/Tools/” , otherwise, create it.
  5. Create new directories:
    A) Create “Reports” directory within “Tools”
    B) Get into “Reports” directory.
    C) Create “Elements” directory within “Tools/Reports”
  6. Copy the “delivered” files (from …/share/…) (Tabs, index.html) over to the new directories:
    A) Copy the “Tabs” file over to “Tools/Reports/Elements”:
    1) Within “Elements”, type “cp /opt/rt3/share/html/Tools/Reports/Elements/Tabs .” .
    2) Go back 1 directory level to get to “/Tools/Reports”.
    3) Copy the “index.html” file over to “Tools/Reports” twice:
    a) Within “Tools/Reports”, type “cp /opt/rt3/share/html/Tools/index.html .” .
    b) Within “Tools/Reports”, type “cp /opt/rt3/share/html/Tools/index.html TimeWorkedReport.html” .
  7. Modify/Replace the code in “Tabs”, “index.html” & “TimeWorkedReport” with the code specified for these files from the document the “Time Worked Report”.

Anyway, This is the procedure I followed and I had absolutely no problems AND I didn’t have to worry about Production being messed up.

Also, I’m in 3.8.7 so I made sure to follow the 3.8 instructions.

Hope this helps.

Kenn
LBNL

Do you have a /usr/local/rt3?

/JohanFrom: rt-users-bounces@lists.bestpractical.com [mailto:rt-users-bounces@lists.bestpractical.com] On Behalf Of Walid Haider
Sent: den 29 mars 2011 15:20
To: Kenneth Crocker; rt-users@lists.bestpractical.com
Subject: Re: [rt-users] Time Worked Report

Kenn,

Again, thanks for the reply. As I ran a packaged install of RT 3.8.4, my $home is /usr/share/rt3. My folder structure is different compared to what you mention below, as I do not have a share directory within my RT $home.

Please advise if I should create the local directory within /usr/share/rt3.

Thanks,
Walid

From: rt-users-bounces@lists.bestpractical.com [mailto:rt-users-bounces@lists.bestpractical.com] On Behalf Of Kenneth Crocker
Sent: segunda-feira, 28 de Março de 2011 17:33
To: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] Time Worked Report

Walid,

What I mean is this; it is highly recommended that any changes you make to RT code be done in a “local” version. RT will automatically look to $Home/local/…/…/ (where $home is usually opt/rt3/) for any override code that an installation may have developed. In this example (TimeWorkedReport), I copied the various /$home/share/…/… directories & files listed in the "readme’ for that report into a /$home/local/…/… version/copy of those directoryies & files. I did NOT make any changes to any /share/ version of RT code. This is recommended for a couple reasons; the least of which it is easier to maintain later versions of RT without wiping out your local code (provided you keep a copy of that code). Also, industry wide for about the last 40 years, it has been considered a best practice to never mess with original code, but to provide a method that allows you to use other code instead.

So, my advice is to first; return all /share/ code to it’s original state. Then create $home/local/html/Tools/Reports directories in order to copy/create the files mentioned in the “TimeWorkedReport” documentation. That’s what I did:

  1. If it exists,type “/opt/rt3/local/html/Elements/” otherwise, create it.
  2. Copy the “delivered” file (from …/share/…) SelectQueue over to this directory with a the new name.
    A) Type “cp /opt/rt3/share/html/Elements/SelectQueue SelectMultiQueue” .
  3. Replace the code in “SelectMultiQueue” with the code specified for this file from the document the “TimeWorkedReport”.
  4. If it exists, type “/opt/rt3/local/html/Tools/” , otherwise, create it.
  5. Create new directories:
    A) Create “Reports” directory within “Tools”
    B) Get into “Reports” directory.
    C) Create “Elements” directory within “Tools/Reports”
  6. Copy the “delivered” files (from …/share/…) (Tabs, index.html) over to the new directories:
    A) Copy the “Tabs” file over to “Tools/Reports/Elements”:
    1) Within “Elements”, type “cp /opt/rt3/share/html/Tools/Reports/Elements/Tabs .” .
    2) Go back 1 directory level to get to “/Tools/Reports”.
    3) Copy the “index.html” file over to “Tools/Reports” twice:
    a) Within “Tools/Reports”, type “cp /opt/rt3/share/html/Tools/index.html .” .
    b) Within “Tools/Reports”, type “cp /opt/rt3/share/html/Tools/index.html TimeWorkedReport.html” .
  7. Modify/Replace the code in “Tabs”, “index.html” & “TimeWorkedReport” with the code specified for these files from the document the “Time Worked Report”.

Anyway, This is the procedure I followed and I had absolutely no problems AND I didn’t have to worry about Production being messed up.

Also, I’m in 3.8.7 so I made sure to follow the 3.8 instructions.

Hope this helps.

Kenn
LBNL

Hi Johan,

No, I do not. Should I go ahead and create it and then follow Kenn’s instructions?

Regards,
WalidFrom: rt-users-bounces@lists.bestpractical.com [mailto:rt-users-bounces@lists.bestpractical.com] On Behalf Of Johan Sjöberg
Sent: terça-feira, 29 de Março de 2011 14:56
To: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] Time Worked Report

Do you have a /usr/local/rt3?

/Johan

From: rt-users-bounces@lists.bestpractical.com [mailto:rt-users-bounces@lists.bestpractical.com] On Behalf Of Walid Haider
Sent: den 29 mars 2011 15:20
To: Kenneth Crocker; rt-users@lists.bestpractical.com
Subject: Re: [rt-users] Time Worked Report

Kenn,

Again, thanks for the reply. As I ran a packaged install of RT 3.8.4, my $home is /usr/share/rt3. My folder structure is different compared to what you mention below, as I do not have a share directory within my RT $home.

Please advise if I should create the local directory within /usr/share/rt3.

Thanks,
Walid

From: rt-users-bounces@lists.bestpractical.com [mailto:rt-users-bounces@lists.bestpractical.com] On Behalf Of Kenneth Crocker
Sent: segunda-feira, 28 de Março de 2011 17:33
To: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] Time Worked Report

Walid,

What I mean is this; it is highly recommended that any changes you make to RT code be done in a “local” version. RT will automatically look to $Home/local/…/…/ (where $home is usually opt/rt3/) for any override code that an installation may have developed. In this example (TimeWorkedReport), I copied the various /$home/share/…/… directories & files listed in the "readme’ for that report into a /$home/local/…/… version/copy of those directoryies & files. I did NOT make any changes to any /share/ version of RT code. This is recommended for a couple reasons; the least of which it is easier to maintain later versions of RT without wiping out your local code (provided you keep a copy of that code). Also, industry wide for about the last 40 years, it has been considered a best practice to never mess with original code, but to provide a method that allows you to use other code instead.

So, my advice is to first; return all /share/ code to it’s original state. Then create $home/local/html/Tools/Reports directories in order to copy/create the files mentioned in the “TimeWorkedReport” documentation. That’s what I did:

  1. If it exists,type “/opt/rt3/local/html/Elements/” otherwise, create it.
  2. Copy the “delivered” file (from …/share/…) SelectQueue over to this directory with a the new name.
    A) Type “cp /opt/rt3/share/html/Elements/SelectQueue SelectMultiQueue” .
  3. Replace the code in “SelectMultiQueue” with the code specified for this file from the document the “TimeWorkedReport”.
  4. If it exists, type “/opt/rt3/local/html/Tools/” , otherwise, create it.
  5. Create new directories:
    A) Create “Reports” directory within “Tools”
    B) Get into “Reports” directory.
    C) Create “Elements” directory within “Tools/Reports”
  6. Copy the “delivered” files (from …/share/…) (Tabs, index.html) over to the new directories:
    A) Copy the “Tabs” file over to “Tools/Reports/Elements”:
    1) Within “Elements”, type “cp /opt/rt3/share/html/Tools/Reports/Elements/Tabs .” .
    2) Go back 1 directory level to get to “/Tools/Reports”.
    3) Copy the “index.html” file over to “Tools/Reports” twice:
    a) Within “Tools/Reports”, type “cp /opt/rt3/share/html/Tools/index.html .” .
    b) Within “Tools/Reports”, type “cp /opt/rt3/share/html/Tools/index.html TimeWorkedReport.html” .
  7. Modify/Replace the code in “Tabs”, “index.html” & “TimeWorkedReport” with the code specified for these files from the document the “Time Worked Report”.

Anyway, This is the procedure I followed and I had absolutely no problems AND I didn’t have to worry about Production being messed up.

Also, I’m in 3.8.7 so I made sure to follow the 3.8 instructions.

Hope this helps.

Kenn
LBNL

Walid,

Well, Wherever you have the …/Tools/Report/… you will need a
…/local/Tools/Report/ version to put “TimeWorkedReport”.

Kenn
LBNLOn Tue, Mar 29, 2011 at 7:00 AM, Walid Haider walid.haider@movensis.comwrote:

Hi Johan,

No, I do not. Should I go ahead and create it and then follow Kenn’s
instructions?

Regards,

Walid

From: rt-users-bounces@lists.bestpractical.com [mailto:
rt-users-bounces@lists.bestpractical.com] *On Behalf Of *Johan Sjöberg
Sent: terça-feira, 29 de Março de 2011 14:56

To: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] Time Worked Report

Do you have a /usr/local/rt3?

/Johan

From: rt-users-bounces@lists.bestpractical.com [mailto:
rt-users-bounces@lists.bestpractical.com] *On Behalf Of *Walid Haider
Sent: den 29 mars 2011 15:20
To: Kenneth Crocker; rt-users@lists.bestpractical.com
Subject: Re: [rt-users] Time Worked Report

Kenn,

Again, thanks for the reply. As I ran a packaged install of RT 3.8.4, my
$home is /usr/share/rt3. My folder structure is different compared to what
you mention below, as I do not have a share directory within my RT $home.

Please advise if I should create the local directory within
/usr/share/rt3.

Thanks,

Walid

From: rt-users-bounces@lists.bestpractical.com [mailto:
rt-users-bounces@lists.bestpractical.com] *On Behalf Of *Kenneth Crocker
Sent: segunda-feira, 28 de Março de 2011 17:33
To: rt-users@lists.bestpractical.com
Subject: Re: [rt-users] Time Worked Report

Walid,

What I mean is this; it is highly recommended that any changes you make
to RT code be done in a “local” version. RT will automatically look to
$Home/local/…/…/ (where $home is usually opt/rt3/) for any override
code
that an installation may have developed. In this example
(TimeWorkedReport), I copied the various /$home*/share/…/…
directories & files listed in the "readme’ for that report into a /$home/

local/*…/… version/copy of those directoryies & files. I did NOTmake any changes to any
/share/ version of RT code. This is recommended for a couple reasons;
the least of which it is easier to maintain later versions of RT without
wiping out your local code (provided you keep a copy of that code). Also,
industry wide for about the last 40 years, it has been considered a best
practice
to never mess with original code, but to provide a method that
allows you to use other code instead.

So, my advice is to first; return all /share/ code to it’s original state.
Then create $home*/local/*html/Tools/Reports directories in order to
copy/create the files mentioned in the “TimeWorkedReport” documentation.
That’s what I did:

  1. If it exists,type “/opt/rt3/local/html/Elements/” otherwise,
    create it.
  2. Copy the “delivered” file (from …/share/…) SelectQueue over to
    this directory with a the new name.
    A) Type “cp /opt/rt3/share/html/Elements/SelectQueue
    SelectMultiQueue”
    .
  3. Replace the code in “SelectMultiQueue” with the code specified for
    this file from the document the “TimeWorkedReport".
  4. If it exists, type “/opt/rt3/local/html/Tools/” , otherwise,
    create it.
  5. Create new directories:
    A) Create “Reports” directory within *“Tools”
    *B) Get into “Reports” directory.
    C) Create “Elements” directory within “Tools/Reports”
  6. Copy the “delivered” files (from …/share/…) (Tabs, index.html)
    over to the new directories:
    A) Copy the “Tabs” file over to “Tools/Reports/Elements”:
    1) Within “Elements”, type “cp
    /opt/rt3/share/html/Tools/Reports/Elements/Tabs .”
    .
    2) Go back 1 directory level to get to “/Tools/Reports”.
    3) Copy the “index.html” file over to “Tools/Reports” twice:
    a) Within “Tools/Reports”, type “cp
    /opt/rt3/share/html/Tools/index.html .”
    .
    b) Within “Tools/Reports”, type “cp
    /opt/rt3/share/html/Tools/index.html TimeWorkedReport.html”
    .
  7. Modify/Replace the code in *“Tabs”, “index.html” & “TimeWorkedReport”
    *with the code specified for these files from the document the “Time
    Worked Report”
    .

Anyway, This is the procedure I followed and I had absolutely no problems
AND I didn’t have to worry about Production being messed up.

Also, I’m in 3.8.7 so I made sure to follow the 3.8 instructions.

Hope this helps.

Kenn
LBNL