[Rt-commit] r5190 - in RT-Extension-TimeWorked: . lib/RT/Extension
alexmv at bestpractical.com
alexmv at bestpractical.com
Wed May 10 12:31:56 EDT 2006
Author: alexmv
Date: Wed May 10 12:31:55 2006
New Revision: 5190
Modified:
RT-Extension-TimeWorked/ (props changed)
RT-Extension-TimeWorked/html/Reports/TimeWorked/index.html
RT-Extension-TimeWorked/lib/RT/Extension/TimeWorked.pm
Log:
r12943 at zoq-fot-pik: chmrr | 2006-05-10 12:31:33 -0400
* Support RT 3.2
Modified: RT-Extension-TimeWorked/html/Reports/TimeWorked/index.html
==============================================================================
--- RT-Extension-TimeWorked/html/Reports/TimeWorked/index.html (original)
+++ RT-Extension-TimeWorked/html/Reports/TimeWorked/index.html Wed May 10 12:31:55 2006
@@ -157,6 +157,13 @@
# ..and here we start doing hand SQL queries. These walk around ACLs,
# and are scary!
+my $txnjoin;
+if ($RT::VERSION >= 3.4) {
+ $txnjoin = "Tickets.id = Transactions.ObjectId and Transactions.ObjectType = 'RT::Ticket'";
+} else {
+ $txnjoin = "Tickets.id = Transactions.Ticket";
+}
+
my $sth = $RT::Handle->SimpleQuery(<<"EOSQL");
SELECT Tickets.Queue as queue,
COUNT(*) as created
@@ -178,8 +185,7 @@
SUM(TIME_TO_SEC(TIMEDIFF(Transactions.Created,Tickets.Created)) < 24*60*60) as one_day,
SUM(TIME_TO_SEC(TIMEDIFF(Transactions.Created,Tickets.Created)) < 48*60*60) as two_day
FROM Tickets
- JOIN Transactions ON Tickets.id = Transactions.ObjectId
- AND Transactions.ObjectType = 'RT::Ticket'
+ JOIN Transactions ON $txnjoin
JOIN Queues ON Tickets.Queue = Queues.id
WHERE Transactions.Type = 'Status'
AND Transactions.NewValue = 'resolved'
@@ -223,8 +229,7 @@
SUM(TIME_TO_SEC(TIMEDIFF(Transactions.Created,Tickets.Created)) < 24*60*60) as one_day,
SUM(TIME_TO_SEC(TIMEDIFF(Transactions.Created,Tickets.Created)) < 48*60*60) as two_day
FROM Tickets
- JOIN Transactions ON Tickets.id = Transactions.ObjectId
- AND Transactions.ObjectType = 'RT::Ticket'
+ JOIN Transactions ON $txnjoin
JOIN Queues ON Tickets.Queue = Queues.id
WHERE Transactions.Type = 'Status'
AND Transactions.NewValue = 'resolved'
@@ -247,8 +252,7 @@
SELECT Tickets.Queue as queue,
COUNT(DISTINCT Tickets.id) as open
FROM Tickets
- JOIN Transactions ON Tickets.id = Transactions.ObjectId
- AND Transactions.ObjectType = 'RT::Ticket'
+ JOIN Transactions ON $txnjoin
JOIN Queues ON Tickets.Queue = Queues.id
WHERE Transactions.Type = 'Status'
AND Transactions.NewValue = 'resolved'
@@ -271,8 +275,7 @@
COUNT(*) as more,
COUNT(DISTINCT Tickets.id) as tickets
FROM Tickets
- JOIN Transactions ON Tickets.id = Transactions.ObjectId
- AND Transactions.ObjectType = 'RT::Ticket'
+ JOIN Transactions ON $txnjoin
JOIN Users ON Transactions.Creator = Users.id
JOIN Queues ON Tickets.Queue = Queues.id
WHERE Transactions.Type = 'Status'
@@ -297,8 +300,7 @@
Tickets.Queue as queue,
SUM(Transactions.TimeTaken) as worked
FROM Tickets
- JOIN Transactions ON Tickets.id = Transactions.ObjectId
- AND Transactions.ObjectType = 'RT::Ticket'
+ JOIN Transactions ON $txnjoin
JOIN Users ON Transactions.Creator = Users.id
JOIN Queues ON Tickets.Queue = Queues.id
WHERE Transactions.Created >= '$start'
Modified: RT-Extension-TimeWorked/lib/RT/Extension/TimeWorked.pm
==============================================================================
--- RT-Extension-TimeWorked/lib/RT/Extension/TimeWorked.pm (original)
+++ RT-Extension-TimeWorked/lib/RT/Extension/TimeWorked.pm Wed May 10 12:31:55 2006
@@ -1,3 +1,3 @@
package RT::Extension::TimeWorked;
-our $VERSION = '0.2';
+our $VERSION = '0.3';
More information about the Rt-commit
mailing list