Re: [rt-users] How To Change "RT at a Glance" Screen in 3.4.5?

2008-04-30 Thread Mathew
Each user can create Saved Search which then can be displayed via the 
Preferences.

Mathew

Tim Gustafson wrote:
> Hello,
> 
> I was wondering: how would a user change his "RT at a Glance" screen so that
> it showed all his new and open tickets instead of just the "10 highest
> priority tickets I own" box?
> 
> This is for RT 3.4.5 running on CentOS 5.1. 
> 
> Tim Gustafson
> SOE Webmaster
> UC Santa Cruz
> [EMAIL PROTECTED]
> (831) 459-5354
> 
> 
> ___
> 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

-- 
Keep up with my goings on at http://theillien.blogspot.com/feeds/posts/default
___
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] How To Change "RT at a Glance" Screen in 3.4.5?

2008-04-30 Thread Tim Gustafson
Hello,

I was wondering: how would a user change his "RT at a Glance" screen so that
it showed all his new and open tickets instead of just the "10 highest
priority tickets I own" box?

This is for RT 3.4.5 running on CentOS 5.1. 

Tim Gustafson
SOE Webmaster
UC Santa Cruz
[EMAIL PROTECTED]
(831) 459-5354


___
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] RTAT Import?

2008-04-30 Thread Jean-Sebastien Morisset
On Wed, Apr 30, 2008 at 05:51:39PM +, Jean-Sebastien Morisset wrote:
> 
> Aha! Thanks! Ok, so far this seems to work well:
[snip!]

Alright, so I spent a little more time on this script, and added some
validation against the customfield select values. Here's an example:

# bin/import-assets.sh /tmp/js.csv
gessolx1:
uasolx1:
"" value not ok for OS Name customfield
BDM-MTL-FWSM-PROD-1:
"X" value not ok for Client customfield

And here's the script:

---BEGIN---
#!/usr/bin/perl

use lib qw(/opt/rt3/local/lib /opt/rt3/lib);

use RT;
use RTx::AssetTracker::Asset;
use Getopt::Std;
use strict;

our ($opt_h, $opt_f);
getopts('hf:');

RT::LoadConfig();
RT::Init();
my $at = RTx::AssetTracker::Asset->new(RT->SystemUser);
my $line;
my @csv_def = (
'Name',
'Status',
'Type',
'Description',
'Client',
'Location',
'Manufacturer',
'Model',
'Serial Number',
'OS Name',
'Switch Type',
);

if ($opt_h || !$opt_f) {
print "Syntax: $0 [-h] -f {csvfile}\n";
print "CSV Format: ";
for (@csv_def) { print "\"$_\","; }
print "\n";
exit 0;
}

open(CSV, "< $opt_f") or die "$!\n";

# customfield columns in csv file
my (%cf_map, $cf_item);
for (@csv_def) { $cf_map{$_} = $cf_item++; }

while () {
chomp; $line++;
next if ($line == 1);   # Skip CSV Header
s/^"//; s/"$//;
my @csv = split(/"?,"?/);
print $csv[0], ":\n";
unless (my $id = $at->Load($csv[0])) {
my ($id, $t, $msg) = $at->Create (
Name => $csv[0],
Status => $csv[1],
Type => $csv[2],
Description => $csv[3],
);
print "\t$msg\n" if ($msg);
}
my $atcf = $at->CustomFields();
# check each customfield for this asset
while (my $cf = $atcf->Next()) {
# check to see if we have a CSV column for this customfield
if (my $col = $cf_map{$cf->Name}) {
my $accept;
if ($cf->Type eq "Select") {
# read all selectable values for this 
customfield
my $cfvs = $cf->Values;
while (my $value = $cfvs->Next) {
# check to see if new values is defined 
in select
if ($value->Name eq $csv[$col]) {
$accept = 1;
last;
}
}
} elsif ($cf->Type eq "Freeform") {
$accept = 1;
} else {
print "\tneed more code for ".$cf->Type." 
customfield type\n";
}
if ($accept) {
my ($status, $msg) = $at->AddCustomFieldValue(
Field => $cf->Id,
Value => $csv[$col],
RecordTransaction => 1,
);
print "\t$msg\n" if ($msg);
} else {
print "\t\"$csv[$col]\" value not ok for 
".$cf->Name." customfield\n";
}
}
}
}
---END---

-- 
Jean-Sebastien Morisset, Sr. UNIX Administrator <[EMAIL PROTECTED]>
___
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] Programmatically access CurrentUser's organization in saved search?

2008-04-30 Thread Aaron Sallade
Requestor.Id LIKE '__CurrentUser__'

 

Works well, now I need

 

Requestor.Organization LIKE '__CurrentUser__'

 

Ideas?

 

 

Aaron Sallade'
Application Manager
PTSO of Washington
"Shared Technology for Community Health"
(206) 613-8938 Desk
(206) 521-8833 Main
(206) 613-5078 Fax
[EMAIL PROTECTED]

 

___
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] How to programmatically reference the current logged inuser in a view/saved search?

2008-04-30 Thread Aaron Sallade
Requestor.Id = '__CurrentUser__'

 

"LIKE" was matching id 22,122,222 etc and returning multiple users.

 

Now I need to access the current User's organization :-)

 

Aaron Sallade'
Application Manager
PTSO of Washington
"Shared Technology for Community Health"
(206) 613-8938 Desk
(206) 521-8833 Main
(206) 613-5078 Fax
[EMAIL PROTECTED]  



From: Aaron Sallade 
Sent: Wednesday, April 30, 2008 11:54 AM
To: Aaron Sallade; RT Users
Subject: RE: [rt-users] How to programmatically reference the current
logged inuser in a view/saved search?

 

I'm close, I can use

Requestor.Id LIKE '__CurrentUser__'

 

But the Requestor.Id is not the user ID of the requestor, it is
something else. I would like to be able to get the emailaddress of
__CurrentUser__

 

Aaron Sallade'
Application Manager
PTSO of Washington
"Shared Technology for Community Health"
(206) 613-8938 Desk
(206) 521-8833 Main
(206) 613-5078 Fax
[EMAIL PROTECTED]  



From: Aaron Sallade [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, April 30, 2008 10:47 AM
To: RT Users
Subject: [rt-users] How to programmatically reference the current logged
inuser in a view/saved search?

 

I want to set some default views for Rt At a Glance that use "Requestor
LIKE ME" logic. Any ideas?

Aaron Sallade'
Application Manager
PTSO of Washington
"Shared Technology for Community Health"
(206) 613-8938 Desk
(206) 521-8833 Main
(206) 613-5078 Fax
[EMAIL PROTECTED]

 

___
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] How to programmatically reference the current logged inuser in a view/saved search?

2008-04-30 Thread Aaron Sallade
I'm close, I can use

Requestor.Id LIKE '__CurrentUser__'

 

But the Requestor.Id is not the user ID of the requestor, it is
something else. I would like to be able to get the emailaddress of
__CurrentUser__

 

Aaron Sallade'
Application Manager
PTSO of Washington
"Shared Technology for Community Health"
(206) 613-8938 Desk
(206) 521-8833 Main
(206) 613-5078 Fax
[EMAIL PROTECTED]  



From: Aaron Sallade [mailto:[EMAIL PROTECTED] 
Sent: Wednesday, April 30, 2008 10:47 AM
To: RT Users
Subject: [rt-users] How to programmatically reference the current logged
inuser in a view/saved search?

 

I want to set some default views for Rt At a Glance that use "Requestor
LIKE ME" logic. Any ideas?

Aaron Sallade'
Application Manager
PTSO of Washington
"Shared Technology for Community Health"
(206) 613-8938 Desk
(206) 521-8833 Main
(206) 613-5078 Fax
[EMAIL PROTECTED]

 

___
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] RTAT Import?

2008-04-30 Thread Jean-Sebastien Morisset
On Wed, Apr 30, 2008 at 01:06:55PM -0400, Matthew Keller wrote:
> If you look in the API documentation about setting a CF (the
> 'CustomField' object), it will show you where my oversimplification of
> $cf->Value=$thing was in err, and how to do it correctly.

Aha! Thanks! Ok, so far this seems to work well:

---BEGIN---
#!/usr/bin/perl

use lib qw(/opt/rt3/local/lib /opt/rt3/lib);

use RT;
use RTx::AssetTracker::Asset;
RT::LoadConfig();
RT::Init();

use strict;

if (! $ARGV[0] || $ARGV[0] =~ /^--?h/) {
print "Syntax: $0 {csvfile}\n";
exit 0;
}

open(CSV, "< $ARGV[0]") or die "$!\n";

my $at = RTx::AssetTracker::Asset->new(RT->SystemUser);
my $line;

# customfield columns in csv file
my %cf_map = (
'Client' => 4,
'Location' => 5,
'Manufacturer' => 6,
'Model' => 7,
'Serial Number' => 8,
'OS Name' => 9,
);

while () {
chomp; $line++;
next if ($line == 1);   # Skip CSV Header
s/^"//; s/"$//;
my @csv = split(/"?,"?/);

print $csv[0], ":\n";
unless (my $id = $at->Load($csv[0])) {
my ($id, $t, $msg) = $at->Create (
Name => $csv[0],
Status => $csv[1],
Type => $csv[2],
Description => $csv[3],
);
print "\t$msg\n" if ($msg);
}

my $atcf = $at->CustomFields();
while (my $cf = $atcf->Next()) {
# check to see if we have a CSV column for this customfield
if (my $col = $cf_map{$cf->Name}) {
my ($status, $msg) = $at->AddCustomFieldValue(
Field => $cf->Id, Value => $csv[$col]);
print "\t$msg\n" if ($msg);
}
}
}
---END---

And for reference, here's the CSV file I'm using:

"NAME","STATUS","TYPE","DESCRIPTION","CLIENT","LOCATION","MANUFACTURER","MODEL","SERIAL
 NUMBER","OS NAME"

Column 5 (CLIENT) and up are all custom fields and must be defined in
the %cf_map hash. If anyone wants to make this a little more elegant,
feel free. :-)

js.
-- 
Jean-Sebastien Morisset, Sr. UNIX Administrator <[EMAIL PROTECTED]>
___
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] How to programmatically reference the current logged in user in a view/saved search?

2008-04-30 Thread Aaron Sallade
I want to set some default views for Rt At a Glance that use "Requestor
LIKE ME" logic. Any ideas?

Aaron Sallade'
Application Manager
PTSO of Washington
"Shared Technology for Community Health"
(206) 613-8938 Desk
(206) 521-8833 Main
(206) 613-5078 Fax
[EMAIL PROTECTED]

 

___
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] RTAT Import?

2008-04-30 Thread Matthew Keller
If you look in the API documentation about setting a CF (the
'CustomField' object), it will show you where my oversimplification of
$cf->Value=$thing was in err, and how to do it correctly.

On Tue, 2008-04-29 at 21:01 +, Jean-Sebastien Morisset wrote:
> On Tue, Apr 29, 2008 at 04:32:43PM -0400, Matthew Keller wrote:
> > Ah yes... The way I usually do things like that is by grabbing the asset
> > CF info, ala: 
> > 
> > my $AssCFs=$AssObj->CustomFields();
> > 
> > and then setting the appropriate values ala:
> > 
> > while(my $AssCF = $AssCFs->Next()) {
> > $AssCF->Value = whatever
> > }
> > 
> > The above is pseudocode from memory, but is +/- 96% correct. :)
> 
> Hmmm... Here's what I get:
> 
> # /opt/rt3/bin/import-assets.sh /tmp/js.csv
> gessolx1:
> Loaded gessolx1 as asset #85.
> Setting Client to STI
> [Tue Apr 29 21:00:16 2008] [crit]: Can't modify non-lvalue subroutine
> call at /opt/rt3/bin/import-assets.sh line 56,  line 2.
> (/opt/rt3/lib/RT.pm:361)
> Can't modify non-lvalue subroutine call at /opt/rt3/bin/import-assets.sh
> line 56,  line 2.
> 
> And here's the code I'm using...
> 
> #!/usr/bin/perl
> 
> use lib qw(/opt/rt3/local/lib /opt/rt3/lib);
> 
> use RT;
> use RTx::AssetTracker::Asset;
> RT::LoadConfig();
> RT::Init();
> 
> use strict;
> 
> if (! $ARGV[0] || $ARGV[0] =~ /^--?h/) {
> print "Syntax: $0 {csvfile}\n";
> exit 0;
> }
> 
> open(CSV, "< $ARGV[0]") or die "$!\n";
> 
> my $at = RTx::AssetTracker::Asset->new(RT->SystemUser);
> my $line;
> 
> # customfield columns in csv file
> my %cf_map = (
> 'Client' => 4,
> 'Location' => 5,
> 'Manufacturer' => 6,
> 'Model' => 7,
> 'Serial Number' => 8,
> 'OS Name' => 9,
> );
> 
> while () {
> chomp; $line++;
> next if ($line == 1);   # Skip CSV Header
> s/^"//; s/"$//;
> my @csv = split(/"?,"?/);
> 
> print $csv[0], ":\n";
> if (my $id = $at->Load($csv[0])) {
> print "\tLoaded $csv[0] as asset #$id.\n";
> } else {
> my ($id, $t, $msg) = $at->Create (
> Name => $csv[0],
> Status => $csv[1],
> Type => $csv[2],
> Description => $csv[3],
> );
> print "\t$msg\n";
> }
> 
> my $atcf = $at->CustomFields();
> while (my $cf = $atcf->Next()) {
> # check to see if we have a column number for this customfield
> if (my $col = $cf_map{$cf->Name}) {
> print "\tSetting ".$cf->Name." to ".$csv[$col]."\n";
> $cf->Value = $csv[$col];
> }
> }
> }
> 

___
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] Using the RT Codebase in a stand alone program (perl)

2008-04-30 Thread Kevin Falcone


On Apr 30, 2008, at 11:29 AM, Morten Guldager wrote:


Right above the two use statements I had to add:
use lib '/usr/share/request-tracker3.6/lib';

But when running the program it complains:
[Wed Apr 30 15:24:54 2008] [crit]: Can't call method "new" on an  
undefined value at ./test5 line 12. (/usr/share/request-tracker3.6/ 
lib/RT.pm:317)

Can't call method "new" on an undefined value at ./test5 line 12.

Is my RT installation broken?
It's an out of the box Debian-4.0 install,  request-tracker3.6  
(3.6.1-4)


Try
my $ticket = RT::Ticket->new( $RT::SystemUser );





/Morten %-)

On Wed, Apr 30, 2008 at 4:08 PM, Todd Chapman <[EMAIL PROTECTED]> wrote:
use RT;
use RT::Ticket;

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

$ticket = $RT::Ticket->new( $RT::SystemUser );
$ticket->Load( 123 );

print $ticket->Subject;

On Wed, Apr 30, 2008 at 9:50 AM, Morten Guldager <[EMAIL PROTECTED] 
> wrote:

'Aloha!

Below you see the text book example (from RT Essentials) using  
DBIx::SearchBuilder to accessing the Tickets table from a stand  
alone perl program.
Since I need restricting access to what a specific user would be  
allowed to do, I think I have to transform this code into something  
using RT::Record (or should it be RT::Ticket?)


Simply replacing DBIx::SearchBuilder with RT did not work. (well I  
sorta did not expect that either..)

 - and where do I feed it the username/password?

This must have been done a million times before, but google refuses  
to help me :-(


Anyone?

--
/Morten %-)


#!/usr/bin/perl
use strict;
use warnings;

my $X = tkt->new;
$X->Load(123);
printf STDERR "%s: %s (%s)\n",  $X->id,  $X->Subject,  $X->Status;

package tkt;
use strict;
use warnings;
use DBIx::SearchBuilder::Handle;
use base qw(DBIx::SearchBuilder::Record);

sub _Init
{
  my $self = shift;
  my $handle= DBIx::SearchBuilder::Handle->new;
  $handle->Connect(Driver   => 'mysql',
   Database => 'rtdb',
   User => 'rtuser',
   Password => $ENV{RTDBPW});
  $self->_Handle($handle);
  $self->Table('Tickets');
}

sub _ClassAccessible
{
  return { Id  => {read => 1},
   Status  => {read => 1},
   Subject => {read => 1}
 };
}


___
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


___
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] Poll: How much physical RAM on your RT server?

2008-04-30 Thread Ondre Sembera
I am collecting data for planning purposes.

* How much physical RAM does your RT server have? (Or how much is
  allocated to your virtual machine?)
* How many users does your RT instance support?


Thanks,
Ondre
___
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] A newbie install question - FormatText/font metrics

2008-04-30 Thread Etienne-Mougeolle

Hi.
Too late, sure, but perhaps useful however.
I encounter the same problem yesterday.
The only way I found is the pre-installation of these annoying modules
before beginning RT3 install :
___

wget http://search.cpan.org/CPAN/authors/id/G/GA/GAAS/Font-AFM-1.19.tar.gz
tar xzf Font-AFM-1.19.tar.gz
( cd Font-AFM-1.19; perl Makefile.PL; make config; make; make install )
rm -r Font-AFM-1.19*

wget
http://search.cpan.org/CPAN/authors/id/G/GA/GAAS/HTML-Format-1.23.tar.gz
tar xzf HTML-Format-1.23.tar.gz
( cd Font-AFM-1.19; perl Makefile.PL; make config; make; make install )
rm -r HTML-Format-1.23*
___

Hope this helps.
Courage.


Jay R. Ashworth wrote:
> 
> Yes... I'm a newbie for the third or fourth time, now.  :-)
> 
> 3.6.6; slack 12
> 
> testdeps is failing HTML::FormatText; the tests there are failing
> because:
> 
> (snip)
> 
> 
-- 
View this message in context: 
http://www.nabble.com/A-newbie-install-question---FormatText-font-metrics-tp16330493p16981406.html
Sent from the Request Tracker - User mailing list archive at Nabble.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] Using the RT Codebase in a stand alone program (perl)

2008-04-30 Thread Morten Guldager
Right above the two use statements I had to add:
use lib '/usr/share/request-tracker3.6/lib';

But when running the program it complains:
[Wed Apr 30 15:24:54 2008] [crit]: Can't call method "new" on an undefined
value at ./test5 line 12. (/usr/share/request-tracker3.6/lib/RT.pm:317)
Can't call method "new" on an undefined value at ./test5 line 12.

Is my RT installation broken?
It's an out of the box Debian-4.0 install,  request-tracker3.6 (3.6.1-4)


/Morten %-)

On Wed, Apr 30, 2008 at 4:08 PM, Todd Chapman <[EMAIL PROTECTED]> wrote:

> use RT;
> use RT::Ticket;
>
> RT::LoadConfig();
> RT::Init();
>
> $ticket = $RT::Ticket->new( $RT::SystemUser );
> $ticket->Load( 123 );
>
> print $ticket->Subject;
>
> On Wed, Apr 30, 2008 at 9:50 AM, Morten Guldager <
> [EMAIL PROTECTED]> wrote:
>
> > 'Aloha!
> >
> > Below you see the text book example (from RT Essentials) using
> > DBIx::SearchBuilder to accessing the Tickets table from a stand alone perl
> > program.
> > Since I need restricting access to what a specific user would be allowed
> > to do, I think I have to transform this code into something using RT::Record
> > (or should it be RT::Ticket?)
> >
> > Simply replacing DBIx::SearchBuilder with RT did not work. (well I sorta
> > did not expect that either..)
> >  - and where do I feed it the username/password?
> >
> > This must have been done a million times before, but google refuses to
> > help me :-(
> >
> > Anyone?
> >
> > --
> > /Morten %-)
> >
> >
> > #!/usr/bin/perl
> > use strict;
> > use warnings;
> >
> > my $X = tkt->new;
> > $X->Load(123);
> > printf STDERR "%s: %s (%s)\n",  $X->id,  $X->Subject,  $X->Status;
> >
> > package tkt;
> > use strict;
> > use warnings;
> > use DBIx::SearchBuilder::Handle;
> > use base qw(DBIx::SearchBuilder::Record);
> >
> > sub _Init
> > {
> >   my $self = shift;
> >   my $handle= DBIx::SearchBuilder::Handle->new;
> >   $handle->Connect(Driver   => 'mysql',
> >Database => 'rtdb',
> >User => 'rtuser',
> >Password => $ENV{RTDBPW});
> >   $self->_Handle($handle);
> >   $self->Table('Tickets');
> > }
> >
> > sub _ClassAccessible
> > {
> >   return { Id  => {read => 1},
> >Status  => {read => 1},
> >Subject => {read => 1}
> >  };
> > }
> >
> >
> > ___
> > 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] Using the RT Codebase in a stand alone program (perl)

2008-04-30 Thread Todd Chapman
use RT;
use RT::Ticket;

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

$ticket = $RT::Ticket->new( $RT::SystemUser );
$ticket->Load( 123 );

print $ticket->Subject;

On Wed, Apr 30, 2008 at 9:50 AM, Morten Guldager <[EMAIL PROTECTED]>
wrote:

> 'Aloha!
>
> Below you see the text book example (from RT Essentials) using
> DBIx::SearchBuilder to accessing the Tickets table from a stand alone perl
> program.
> Since I need restricting access to what a specific user would be allowed
> to do, I think I have to transform this code into something using RT::Record
> (or should it be RT::Ticket?)
>
> Simply replacing DBIx::SearchBuilder with RT did not work. (well I sorta
> did not expect that either..)
>  - and where do I feed it the username/password?
>
> This must have been done a million times before, but google refuses to
> help me :-(
>
> Anyone?
>
> --
> /Morten %-)
>
>
> #!/usr/bin/perl
> use strict;
> use warnings;
>
> my $X = tkt->new;
> $X->Load(123);
> printf STDERR "%s: %s (%s)\n",  $X->id,  $X->Subject,  $X->Status;
>
> package tkt;
> use strict;
> use warnings;
> use DBIx::SearchBuilder::Handle;
> use base qw(DBIx::SearchBuilder::Record);
>
> sub _Init
> {
>   my $self = shift;
>   my $handle= DBIx::SearchBuilder::Handle->new;
>   $handle->Connect(Driver   => 'mysql',
>Database => 'rtdb',
>User => 'rtuser',
>Password => $ENV{RTDBPW});
>   $self->_Handle($handle);
>   $self->Table('Tickets');
> }
>
> sub _ClassAccessible
> {
>   return { Id  => {read => 1},
>Status  => {read => 1},
>Subject => {read => 1}
>  };
> }
>
>
> ___
> 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

[rt-users] Using the RT Codebase in a stand alone program (perl)

2008-04-30 Thread Morten Guldager
'Aloha!

Below you see the text book example (from RT Essentials) using
DBIx::SearchBuilder to accessing the Tickets table from a stand alone perl
program.
Since I need restricting access to what a specific user would be allowed to
do, I think I have to transform this code into something using RT::Record
(or should it be RT::Ticket?)

Simply replacing DBIx::SearchBuilder with RT did not work. (well I sorta did
not expect that either..)
 - and where do I feed it the username/password?

This must have been done a million times before, but google refuses to help
me :-(

Anyone?

-- 
/Morten %-)


#!/usr/bin/perl
use strict;
use warnings;

my $X = tkt->new;
$X->Load(123);
printf STDERR "%s: %s (%s)\n",  $X->id,  $X->Subject,  $X->Status;

package tkt;
use strict;
use warnings;
use DBIx::SearchBuilder::Handle;
use base qw(DBIx::SearchBuilder::Record);

sub _Init
{
  my $self = shift;
  my $handle= DBIx::SearchBuilder::Handle->new;
  $handle->Connect(Driver   => 'mysql',
   Database => 'rtdb',
   User => 'rtuser',
   Password => $ENV{RTDBPW});
  $self->_Handle($handle);
  $self->Table('Tickets');
}

sub _ClassAccessible
{
  return { Id  => {read => 1},
   Status  => {read => 1},
   Subject => {read => 1}
 };
}
___
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] redirect RT login page - where does that happen?

2008-04-30 Thread Barry Byrne
 

> -Original Message-
> From: [EMAIL PROTECTED] 
> [mailto:[EMAIL PROTECTED] On Behalf 
> Of Judy Illeman Gaukel
> Sent: 29 April 2008 23:03

> Hi RT-experts,
> 
> I've have RT 3.6.6 on a Solaris 9 machine and all is well -- 
> but I need 
> to redirect my old
> machine (another solaris 9, but with RT 3.6.3 not sending emails any 
> more) -- so that the users are using RT on the
> new machine.I've been looking at share/html/index.html   
>

Judy:

I think it would be best just to use a redirect on the old apache server,
forcing all requests to go to the new server. Something like the following -
assuming this is the config on your old server.


ServerAdmin [EMAIL PROTECTED]
DocumentRoot "/opt/csw/apache/htdocs"
ServerName haruspex.ucsd.edu
ErrorLog logs/error_log_haruspex
CustomLog logs/access_log_haruspex combined

RedirectMatch permanent ^(.*)$ http://newserver.ucsd.edu$1


 - barry

___
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] Create Tickets template: how to read and create attachments ?

2008-04-30 Thread Francesco C
Ciao, 
I have a ticket with several customfields and an attachment (jpg) in the queue 
"X".

I need to create a new ticket with some customfield values and the attachment 
coming from first ticket.
I need to use a scrip with an "Create Tickets" Action and a Global template 
"===Create-Ticket: identifier ..."

In this template I'm able to read customfields coming from first ticket:

-- CustomField-1: {$Tickets{"TOP"}->FirstCustomFieldValue('name')}  --

but I don't know how to create the attachment with same content of first ticket.

Does anybody have a solution ?

Thanks

Francesco

___
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