[rt-users] Put custom field objects into a hash

2007-03-25 Thread Mathew Snyder
I'm creating an object comprised of a customfield using my $customfield =
$ticket-FirstCustomFieldValue('CustomField');

What I would like to do is iterate through the contents of that object and place
each one in a hash initializing its value to 0.  I've tried to set the object
reference to a hash and then iterate through it setting the value to 0 but later
on, I try to use the hash and it gives me an error telling me Can't use string
(0) as a HASH ref while strict refs in use at ./user_timesheet_3.pl line 
62.

This is my script:

#!/usr/bin/perl

use warnings;
use strict;
use lib '/usr/local/rt-3.6.3/lib';
use lib '/usr/local/rt-3.6.3/local/lib';
use RT;
use RT::Tickets;
use RT::Users;

RT::LoadConfig();
RT::Init();

# Declare our global variables
my (@days, @months, @years, @date);
my $time = time();

for (1 .. 7) {
  $time -= 24*60*60;
  @date = (localtime($time))[3 .. 5];
  push @days, (sprintf '%02d', $date[0]);
  push @months,(sprintf '%02d',$date[1] + 1);
  push @years, $date[2] + 1900;
}
my $endDate = join -, $years[0], $months[0], $days[0];
my $startDate   = join -, $years[$#years], $months[$#months], $years[$#years];

my $tix = new RT::Tickets(RT::SystemUser);
$tix-FromSQL('Queue = CustomerCare AND Status = open AND Created 
2007-03-03');
#$tix-FromSQL('Queue = CustomerCare AND (Status = resolved OR Status =
open) AND (LastUpdated =' .  $startDate . ' AND LastUpdated  ' .
$endDate. ')');

my @environment;
my %environment;
my %timeworked;
my $users = new RT::Users(RT::SystemUser);
$users-LimitToPrivileged;

while (my $ticket = $tix-Next) {
my $environment = $ticket-FirstCustomFieldValue('Environment');
my $user;
my $transaction;
%environment = ${environment};
unless ($environment) {
warn warning . $ticket-id. no environment;
next
}

foreach my $key (keys %environment) {
print $key . \n;
}

my $transactions = $ticket-Transactions;
   foreach my $enviro (keys %environment) {
   while ($transaction = $transactions-Next) {
   next unless (($transaction-TimeTaken)  ($enviro ==
$ticket-FirstCustomFieldValue('Environment'))) ;
   print Working on  . $ticket .  for  . $enviro . \n;
   $timeworked{$transaction-Creator} +=
$transaction-TimeTaken;
   }
   }

   foreach my $user (keys %timeworked) {
   foreach my $cust (keys %environment) {
   $environment{$cust}{$user} = $timeworked{$user};
   }
   }
}


foreach my $user (sort $users-Next) {
print \n . $user . \n;
print \n;
   foreach my $env (sort keys %environment) {
   print $env .  -  . $environment{$env}{$user} . \n;
   }
}


The error is occurring at the end where the print $env .  -  .
$environment{$env}{$user} . \n; line is.

Can anyone help me by explaining how to populate a hash using each custom field
object as a key?

Mathew
___
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Community help: http://wiki.bestpractical.com
Commercial support: [EMAIL PROTECTED]


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


[rt-users] Yet another Summer of Code idea (if it's not too late)

2007-03-25 Thread Brian Gallew

Hierarchical ticket views.

Let's say I have a Project, with a number of Tasks under it.  It would
be nice to be able to group the Tasks under the Project, potentially
with the ability to hide/reveal the child tasks.  Trying to do this in
raw SQL would be truly hideous, though I'm sure there is some bright
girl (all the best SQL coders I know are female) out there who could
figure out a way to do it.



___
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Community help: http://wiki.bestpractical.com
Commercial support: [EMAIL PROTECTED]


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


AW: [rt-users] Yet another Summer of Code idea (if it's not too late)

2007-03-25 Thread Ham MI-ID, Torsten Brumm
Have a look into the bps svn, there is a unfinished project management add on, 
its doing the things you are looking for.

Torsten

-Original Message-
From: [EMAIL PROTECTED] [EMAIL PROTECTED]
To: rt-Users Users rt-users@lists.bestpractical.com
Sent: Sun Mar 25 14:19:29 2007
Subject: [rt-users] Yet another Summer of Code idea (if it's not too late)

Hierarchical ticket views.

Let's say I have a Project, with a number of Tasks under it.  It would
be nice to be able to group the Tasks under the Project, potentially
with the ability to hide/reveal the child tasks.  Trying to do this in
raw SQL would be truly hideous, though I'm sure there is some bright
girl (all the best SQL coders I know are female) out there who could
figure out a way to do it.



___
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Community help: http://wiki.bestpractical.com
Commercial support: [EMAIL PROTECTED]


Discover RT's hidden secrets with RT Essentials from O'Reilly Media. 
Buy a copy at http://rtbook.bestpractical.com
___
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Community help: http://wiki.bestpractical.com
Commercial support: [EMAIL PROTECTED]


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

RE: [rt-users] You're almost there!

2007-03-25 Thread Sasha Gerrand
 From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of ayish
alomari
 Sent: Sunday, 25 March 2007 2:19 AM
 To: rt-users@lists.bestpractical.com
 Subject: [rt-users] You're almost there!
 
 Someone please give me a hint on what I am missing . 
 
 I installed  rt3-3.6.3 with httpd 2.2.3 , and mod_perl 2.02, and mysql
5.027
 
 fallowed the install instruction on Best Practical 's webcite. 
 but still getting this error when trying to view rt
 
 You're almost there!
 
 You haven't yet configured your webserver to run RT.
 
 You appear to have installed RT's web interface correctly, but haven't
yet configured your web server to run the RT server which powers the
web interface.
 
 The next step is to edit your webserver's configuration file to
instruct it to use RT's mod_perl, fastcgi or speedycgi handler.
 
 here is a copy of my rt3.conf file
 -
 Alias /rt3 /usr/share/rt3/html

PerlModule Apache::DBI
PerlModule Apache2::compat

 PerlRequire /usr/sbin/webmux.pl
 Directory /usr/share/rt3/html
   AllowOverride All
   Options ExecCGI FollowSymLinks
   RewriteEngine On
   RedirectMatch permanent (.*)/$ $1/index.html
   AddDefaultCharset UTF-8
   SetHandler perl-script
   PerlHandler RT::Mason
 /Directory
  -
 
 Any suggestion would be greatly apreciated. ..
 
 thank you in advance.

You might want to use the extra two CPAN module directives (included
above) in your configuration file for Apache. 

Also, have you checked that your $WebPath variable is set correctly in
RT_SiteConfig.pm?

HTH

Regards,
Sasha

Sasha Gerrand
Web  Database Developer
 
Austbrokers Holdings Limited
Level 21, 111 Pacific Highway
North Sydney NSW 2060
PO Box 1813 North Sydney NSW 2060
 
Ph:   02 9935 2230
Mobile:  0431 895 718
Email:   [EMAIL PROTECTED]
Web:http://www.austbrokers.com.au
 
NOTICE
If you are not an authorised recipient of this email, please contact
Austbrokers Holdings immediately by return e-mail or by telephone on
+61-2-4920-6117. In this case, you should not read, print, re-transmit,
store or act on this e-mail or any attachments. Please destroy the
message and attachments. This e-mail and any attachments are
confidential and may contain legally privileged information and/or
copyright material of Austbrokers Holdings or third parties. You should
only re-transmit, distribute or commercialise the material if you are
authorised to do so. Internet e-mails are not necessarily secure,
Austbrokers Holdings does not accept responsibility for changes made to
this message after it was sent. This Notice should not be removed.
___
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Community help: http://wiki.bestpractical.com
Commercial support: [EMAIL PROTECTED]


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


[rt-users] Send bounces to ticket owner, not site owner

2007-03-25 Thread Kelly Jones

Joe Miller takes a ticket and adds [EMAIL PROTECTED] (a typo) to
the requestor/cc field. Joe's reply then bounces, but the bounce comes
to me, the site admin, not to Joe.

How do I tweak RT to send the bounce to the ticket owner, not to me?

--
We're just a Bunch Of Regular Guys, a collective group that's trying
to understand and assimilate technology. We feel that resistance to
new ideas and technology is unwise and ultimately futile.
___
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Community help: http://wiki.bestpractical.com
Commercial support: [EMAIL PROTECTED]


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


Re: [rt-users] Inconsistent dates

2007-03-25 Thread Taan Lindemans
After looking through all related threads I think RT adds entries to the 
Log file and the Ticket history in GMT.


I think there is one small problem with GMT and reminders.
When you first create a reminder with the date picker it does so in 
local time eg 2007-3-31 and the actual reminder Ticket is given a due 
date of Sat Mar 31 00:00:00 2007)


However when you click on the reminders link to view all reminders, the 
time must be displayed in GMT because the date now shows 2007-3-30. And 
if I change that date to 2007-3-31 the actual reminder Ticket due date 
gets changed to Sat Mar 31 10:00:00 2007. 10 hours being the 
difference between localtime and GMT.


It can cause a small amount of confusion for end users.

Taan


Taan Lindemans wrote:

Hi,

I'm running RT-3.6.3 and am having minor problems with dates.

In the Ticket display, Dates section I see:
Last Contact Wed Mar 21 14:56:50 2007

but in the history at the bottom of the Ticket I see:
Told/Told changed from '2007-03-21 03:45:35' to '2007-03-21 03:56:50'

There is an hour difference in time, the Last Contact time being correct.

The dates in my log file are also 1 hour out.

My local machine time is set to Australia/Melbourne.
I have entered this into my RT_SiteConfig.pm timezone, and have also 
tried localtime and EST, but none seem to make a difference.


I am noticing another problem which I'm hoping is related: when I add a 
Reminder, I choose a date with the date picker, but when I view the 
Reminders the date is one day earlier than I selected.


I'm assuming there is some sort of daylight saving issue, however I'm 
not sure where the problem lies.


thanks for any help
Taan

___
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

Community help: http://wiki.bestpractical.com
Commercial support: [EMAIL PROTECTED]


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