Re: [rt-users] Help with RT

2013-04-05 Thread Paul Tomblin
Sorry, you also need to modify your RT_SiteConfig.pm:
Set($WebPath, "");



On Fri, Apr 5, 2013 at 1:54 PM, Sergio Mesquita
wrote:

> Hi Paul!
>
> I make those changes, but without any sucess.
> Stil have this message.
>
> 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* or *FastCGI* handler. If you need
> commercial support, please contact us at sa...@bestpractical.com.
>
>
> 2013/4/5 Paul Tomblin 
>
>> In your rt.conf, change the "Alias" and "ScriptAlias" lines to
>> Alias  /NoAuth/images /usr/local/rt/share/html/NoAuth/images/
>> ScriptAlias / /usr/local/rt/sbin/rt-server.fcgi/
>>
>> I don't believe any other changes are required.  Restart Apache.
>>
>>
>>
>> On Fri, Apr 5, 2013 at 1:11 PM, Sergio Mesquita <
>> sergio.mesqui...@gmail.com> wrote:
>>
>>> Helo Paul!
>>>
>>> Just upload the two files.
>>> Httpd.conf and Rt.conf
>>>
>>> Thanks for your help
>>>
>>>
>>> 2013/4/5 Paul Tomblin 
>>>
>>>> Show us your apache config for this site.
>>>>
>>>>
>>>> On Friday, April 5, 2013, Sergio Mesquita wrote:
>>>>
>>>>> Hello All!
>>>>>
>>>>> Need your help, to make one change.
>>>>> I have my RT working using this access http://IP/rt.
>>>>> How can I change apahce settings so this works on http://IP.
>>>>>
>>>>> I try a lot f settings, but witouht any sucess.
>>>>>
>>>>> --
>>>>> Cumprimentos/Mit freundlichen Gruss/Best Regards
>>>>>
>>>>> Sergio Mesquita
>>>>> Phone:
>>>>> e-mail:sergio.mesqui...@gmail.com
>>>>> www.gmail.com
>>>>> --
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> http://www.linkedin.com/in/paultomblin
>>>> http://careers.stackoverflow.com/ptomblin
>>>>
>>>>
>>>
>>>
>>> --
>>> Cumprimentos/Mit freundlichen Gruss/Best Regards
>>>
>>> Sergio Mesquita
>>> Phone:
>>> e-mail:sergio.mesqui...@gmail.com
>>> www.gmail.com
>>> --
>>>
>>>
>>
>>
>>
>> --
>> http://www.linkedin.com/in/paultomblin
>> http://careers.stackoverflow.com/ptomblin
>>
>
>
>
> --
> Cumprimentos/Mit freundlichen Gruss/Best Regards
>
> Sergio Mesquita
> Phone:
> e-mail:sergio.mesqui...@gmail.com
> www.gmail.com
> --
>
>



-- 
http://www.linkedin.com/in/paultomblin
http://careers.stackoverflow.com/ptomblin


Re: [rt-users] Help with RT

2013-04-05 Thread Paul Tomblin
In your rt.conf, change the "Alias" and "ScriptAlias" lines to
Alias  /NoAuth/images /usr/local/rt/share/html/NoAuth/images/
ScriptAlias / /usr/local/rt/sbin/rt-server.fcgi/

I don't believe any other changes are required.  Restart Apache.



On Fri, Apr 5, 2013 at 1:11 PM, Sergio Mesquita
wrote:

> Helo Paul!
>
> Just upload the two files.
> Httpd.conf and Rt.conf
>
> Thanks for your help
>
>
> 2013/4/5 Paul Tomblin 
>
>> Show us your apache config for this site.
>>
>>
>> On Friday, April 5, 2013, Sergio Mesquita wrote:
>>
>>> Hello All!
>>>
>>> Need your help, to make one change.
>>> I have my RT working using this access http://IP/rt.
>>> How can I change apahce settings so this works on http://IP.
>>>
>>> I try a lot f settings, but witouht any sucess.
>>>
>>> --
>>> Cumprimentos/Mit freundlichen Gruss/Best Regards
>>>
>>> Sergio Mesquita
>>> Phone:
>>> e-mail:sergio.mesqui...@gmail.com
>>> www.gmail.com
>>> --
>>>
>>>
>>
>>
>> --
>> http://www.linkedin.com/in/paultomblin
>> http://careers.stackoverflow.com/ptomblin
>>
>>
>
>
> --
> Cumprimentos/Mit freundlichen Gruss/Best Regards
>
> Sergio Mesquita
> Phone:
> e-mail:sergio.mesqui...@gmail.com
> www.gmail.com
> --
>
>



-- 
http://www.linkedin.com/in/paultomblin
http://careers.stackoverflow.com/ptomblin


Re: [rt-users] Help with RT

2013-04-05 Thread Paul Tomblin
Show us your apache config for this site.

On Friday, April 5, 2013, Sergio Mesquita wrote:

> Hello All!
>
> Need your help, to make one change.
> I have my RT working using this access http://IP/rt.
> How can I change apahce settings so this works on http://IP.
>
> I try a lot f settings, but witouht any sucess.
>
> --
> Cumprimentos/Mit freundlichen Gruss/Best Regards
>
> Sergio Mesquita
> Phone:
> e-mail:sergio.mesqui...@gmail.com  'e-mail%3asergio.mesqui...@gmail.com');>
> www.gmail.com
> --
>
>


-- 
http://www.linkedin.com/in/paultomblin
http://careers.stackoverflow.com/ptomblin


Re: [rt-users] Accessing a Specific CustomField

2013-04-01 Thread Paul Tomblin
Do you want the custom field value on a specific ticket?

my $st = $ticket->FirstCustomFieldValue("Show Tag");

Do you want the CustomField object for a specific field name on a specific
queue?

my $cf = $QueueObj->CustomField("Show Tag");




On Mon, Apr 1, 2013 at 11:45 AM, Raymond Corbett <
raymond.corb...@arcproductions.com> wrote:

>  This line is working fine:
>
> ** **
>
> my $CFs = $QueueObj->TicketCustomFields();
>
> ** **
>
> I am assuming it is pulling all Ticket Custom Fields
>
> ** **
>
> What if only want to pull the Custom Field with the name of ‘Show Tag’
>
> ** **
>
> ** **
>



-- 
http://www.linkedin.com/in/paultomblin
http://careers.stackoverflow.com/ptomblin


Re: [rt-users] Code error following http://requesttracker.wikia.com/wiki/QuickTicket

2013-03-31 Thread Paul Tomblin
I've updated the Wiki to fix some or all of the problems on that page.  It
seems to be working for me.


On Fri, Mar 15, 2013 at 3:56 PM, Raymond Corbett <
raymond.corb...@arcproductions.com> wrote:

>  The link to the wiki is:
>
> ** **
>
>
> http://requesttracker.wikia.com/wiki/QuickTicket#Add_custom_fields_to_portlet
> 
>
> ** **
>
> *From:* rt-users-boun...@lists.bestpractical.com [mailto:
> rt-users-boun...@lists.bestpractical.com] *On Behalf Of *Raymond Corbett
> *Sent:* Friday, March 15, 2013 3:01 PM
> *To:* rt-users@lists.bestpractical.com
> *Subject:* [rt-users] Code error following
> http://requesttracker.wikia.com/wiki/QuickTicket
>
> ** **
>
> Found this link to help me put custom fields into the QuickCreate portlet.
> 
>
> ** **
>
> Followed all along well.  
>
> ** **
>
> Get the following error on compile. Anyone have any idea what I might
> be doing wrong. 
>
> ** **
>
> Line in question  line  86  which  reads   var defaultQueue = '<%
> $defaultQueue %>';
>
> ** **
>
> });
>
> var defaultQueue = '<% $defaultQueue %>';
>
> if(defaultQueue == "") {
>
> defaultQueue =
> jQuery('#quick-ticket').find('.select-queue[name=Queue]').children().first().text();
> 
>
> }
>
> updateCustomFields(defaultQueue);
>
> ** **
>
>  });
>
> ** **
>
> ** **
>
> Error log is:
>
> ** **
>
> torrepo:/opt/rt4/var # [Fri Mar 15 18:11:56 2013] [error]: Error during
> compilation of
>
> /n/software/linux/servers/rt4/local/html/Elements/QuickTicket:
>
> Global symbol "$defaultQueue" requires explicit package name at
>
> /n/software/linux/servers/rt4/local/html/Elements/QuickTicket line 86.
>
> ** **
>
> Stack:
>
>   [/usr/lib/perl5/site_perl/5.10.0/HTML/Mason/Interp.pm:450]
>
>   [/usr/lib/perl5/site_perl/5.10.0/HTML/Mason/Request.pm:1127]
>
>   [/usr/lib/perl5/site_perl/5.10.0/HTML/Mason/Request.pm:1060]
>
>   [/usr/lib/perl5/site_perl/5.10.0/HTML/Mason/Request.pm:1239]
>
>   [/n/software/linux/servers/rt4/share/html/Elements/MyRT:95]
>
>   [/n/software/linux/servers/rt4/local/html/index.html:78]
>
>   [/opt/rt4/sbin/../lib/RT/Interface/Web.pm:634]
>
>   [/opt/rt4/sbin/../lib/RT/Interface/Web.pm:335]
>
>   [/n/software/linux/servers/rt4/share/html/autohandler:53]
> (/opt/rt4/sbin/../lib/RT/Interface/Web/Handler.pm:208)
>
> ** **
>
> ** **
>
> [image: ARC] 
>
> *Ray Corbett  Technology Projects Manager**
>
> p:** **416.682.5200 x5232  | f: 416.682.5209
> Arc Productions Ltd. | 230 Richmond Street East | Toronto, ON M5A 1P4
> www.arcproductions.com* 
>
>  
>
> ** **
>
>
>
> --
> RT training in Amsterdam, March 20-21:
> http://bestpractical.com/services/training.html
>
> Help improve RT by taking our user survey:
> https://www.surveymonkey.com/s/N23JW9T
>



-- 
http://www.linkedin.com/in/paultomblin
http://careers.stackoverflow.com/ptomblin
<>

Re: [rt-users] Problem with RT 4.0.10 install

2013-03-31 Thread Paul Tomblin
On Saturday, March 30, 2013, Ray Corbett wrote:

>
> How do I tell RT that I am using Perl 5.12 and not Perl 5.8.8
>
>
>
Is the new Perl in your PATH?  Type "which perl" and "perl -v" to
check.  If so, do you have an environment variable "PERL5LIB" and if so
what is it set to?



-- 
http://www.linkedin.com/in/paultomblin
http://careers.stackoverflow.com/ptomblin


Re: [rt-users] Where are customfields stored

2013-03-26 Thread Paul Tomblin
On Tue, Mar 26, 2013 at 11:44 AM, Raymond Corbett <
raymond.corb...@arcproductions.com> wrote:

> Assuming I want to load a customfield, how would I identify it by name?
> For example the one I called “Dev Code”


If you want the value of a custom field in a ticket, the easiest way is
$ticket->FirstCustomFieldValue("Dev Code");

If you want to do something like write a query that takes into account the
value of a custom field, then you end up doing a join with
ObjectCustomFieldValues and CustomFields




-- 
http://www.linkedin.com/in/paultomblin
http://careers.stackoverflow.com/ptomblin


[rt-users] RT::Tickets->LimitWatcher based on RT::Principal->id?

2013-03-22 Thread Paul Tomblin
My client created a bunch of RT ids without email addresses.  Is there any
way to do a query to find that person's tickets (ie where they are the
requestor)?  RT::Tickets->LimitWatcher is based on email address, and I'd
like to limit based on their RT::Principal->id instead.  Is there a call to
do that?


-- 
http://www.linkedin.com/in/paultomblin
http://careers.stackoverflow.com/ptomblin


Re: [rt-users] Code change causing load error Help!

2013-02-26 Thread Paul Tomblin
On Tue, Feb 26, 2013 at 10:39 AM, Raymond Corbett <
raymond.corb...@arcproductions.com> wrote:

> That fixed things up except now I have the owner field but no selections
> in the list, the Me and Nobody. 
>
> ** **
>
> 
>
> option value="<%$session{'CurrentUser'}->id%>"><&|/l&>Me
>
> option value="<%RT->Nobody->id%>"
> selected="selected"><%loc('Nobody')%>
>
> 
>

Those "option value..." should be "http://www.linkedin.com/in/paultomblin
http://careers.stackoverflow.com/ptomblin


-- 
RT training in Amsterdam, March 20-21: 
http://bestpractical.com/services/training.html

Help improve RT by taking our user survey: 
https://www.surveymonkey.com/s/N23JW9T

Re: [rt-users] RT4 without local mail server

2013-01-22 Thread Paul Tomblin
On Tue, Jan 22, 2013 at 11:37 AM, mrbeeye  wrote:

> Description of environment and setup (see diagram here:
> http://img262.imagevenue.com/img.php?image=867879360_rt_122_150lo.jpg
>
> ):


I went to that link and got multiple popups, several of which were flagged
as spam or phishing attempts.  I would not recommend doing that.



-- 
http://www.linkedin.com/in/paultomblin
http://careers.stackoverflow.com/ptomblin


Re: [rt-users] Terminating rt-server.fcgi gracefully

2012-11-26 Thread Paul Tomblin
On Mon, Nov 26, 2012 at 8:52 AM, Sebastian Flothow  wrote:

> Is there a way to have rt-server.fcgi terminate gracefully, i.e. such that
> any currently running request is completed before exiting?
>

I'm pretty sure "/etc/init.d/apache2 reload" will do that.

-- 
http://www.linkedin.com/in/paultomblin
http://careers.stackoverflow.com/ptomblin

We're hiring! http://bestpractical.com/jobs


[rt-users] Fwd: force standard compliance

2012-11-19 Thread Paul Tomblin
Is there any way to add the x-ua-compatible header to RT?  We're accessing
it through an intranet, and evidently IE defaults to quirks mode in the
intranet without it, in spite of the doctype HTML tag.









-- 
http://www.linkedin.com/in/paultomblin
http://careers.stackoverflow.com/ptomblin

We're hiring! http://bestpractical.com/jobs


Re: [rt-users] can't find /etc/request-tracker4/apache2-modperl2.conf

2012-11-08 Thread Paul Tomblin
On Thu, Nov 8, 2012 at 12:37 PM, testwreq wreq  wrote:

> Actually now this is my host file. When I restart apache, I get the
> following error:
> PerlResponseHandler', perhaps misspelled or defined by a module not
> included in the server configuration...
>
>

Do you have your mod_perl handler included in Apache?  If you look in
/etc/apache2/mods-enabled, you should see a "perl.load" which should be a
symlink to a file of the same name in ../mods-available.



-- 
http://www.linkedin.com/in/paultomblin
http://careers.stackoverflow.com/ptomblin

We're hiring! http://bestpractical.com/jobs


Re: [rt-users] Where are comments and correspondence held?

2012-11-06 Thread Paul Tomblin
On Tue, Nov 6, 2012 at 4:58 AM, Tim Cutts  wrote:

> But generally you don't want to do that, and instead you want to use the
> perl API to get at them:
>
> my $attachments = RT::Attachments->new(RT->SystemUser);
> $attachments->LimitByTicket(294774);
> $attachments->LimitNotEmpty;
>

And if you *just* want Comments, say, you can do

my $attachments = RT::Attachments->new(RT->SystemUser);
$attachments->LimitByTicket(294774);
$attachments->Limit(
  ALIAS   => $attachments->TransactionAlias,
  FIELD   => 'Type',
  OPERATOR=> '=',
  VALUE   => 'Comment',
  ENTRYAGGREGATOR => 'OR',
  CASESENSITIVE   => 1
);

while (my $attachment = $attachments->Next)
{

(If there's an easier way to do that, please let me know)

-- 
http://www.linkedin.com/in/paultomblin
http://careers.stackoverflow.com/ptomblin

We're hiring! http://bestpractical.com/jobs


[rt-users] Doing scrips in the background?

2012-11-05 Thread Paul Tomblin
I have a custom workflow which uses a custom web interface.  When the user
clicks the "Submit" button, the interface creates a "Master" ticket, and
then a bunch of sub-tickets, the number of which varies depending what
services they are requesting.  The users are complaining that the process
of submitting is taking too long.  If I were to move the sub-ticket
creation into an "On Create" scrip to run in TransactionBatch, would that
help the "Master" ticket creation return faster, or would the
Ticket->Create not return until the scrip ran and finished?


-- 
http://www.linkedin.com/in/paultomblin
http://careers.stackoverflow.com/ptomblin

We're hiring! http://bestpractical.com/jobs


Re: [rt-users] Write a Custom Action in rt4 as a Module/package ERROR

2012-10-26 Thread Paul Tomblin
Did you restart RT after making the change?  Unless you're in development
mode, it won't pick up the changes. You probably need to flush your mason
cache as well, just to be safe.

On Fri, Oct 26, 2012 at 9:40 AM, Red Pantyhose wrote:

> Dear Christian
>
> Thank you I applied some changes and I get still an error:
>
> Oct 26 13:56:15 rt RT: Scrip Prepare 14 died. - Can't locate object method
> "new" via package "RT::Action::OpenSystemCustomFields" at
> /usr/share/request-tracker4/lib/RT/ScripAction.pm line
> 175.#012#012Stack:#012
> [/usr/share/request-tracker4/lib/RT/ScripAction.pm:175]#012
> [/usr/share/request-tracker4/lib/RT/Scrip.pm:443]#012
> [/usr/share/request-tracker4/lib/RT/Scrips.pm:252]#012
> [/usr/share/request-tracker4/lib/RT/Transaction.pm:179]#012
> [/usr/share/request-tracker4/lib/RT/Record.pm:1459]#012
> [/usr/share/request-tracker4/lib/RT/Ticket.pm:676]#012
> [/usr/share/request-tracker4/lib/RT/Interface/Web.pm:1711]#012
> [/usr/share/request-tracker4/html/Ticket/Display.html:128]#012
> [/usr/share/request-tracker4/html/Ticket/Create.html:444]#012
> [/usr/share/request-tracker4/html/Ticket/autohandler:19]#012
> [/usr/share/request-tracker4/lib/RT/Interface/Web.pm:568]#012
> [/usr/share/request-tracker4/lib/RT/Interface/Web.pm:318]#012
> [/usr/share/request-tracker4/html/autohandler:53]
> (/usr/share/request-tracker4/lib/RT/Scrip.pm:451)
>
>
> What am I doing wrong ?
>
> Do I really need a  sub new() ???
>
> Thanks sincerely,
>
> Denis
>
>
> #-OpenSystemCustomFields-#
>
> package RT::Action::OpenSystemCustomFields;
>
> use strict;
> use warnings;
> use base qw(RT::Action);
> our $VERSION = '0.01';
>
> sub Describe {
> my $self = shift;
> my $class = ref($self) || $self;
> return "$class will retrive values from the OS database and create
> dynamic CustomFields.";
>
> }
>
> sub Prepare {
>   my $self = shift;
>   my $class = ref($self) || $self;
>
>   return 1;
> }
>
> sub Commit {
>   my $self = shift;
>   my $class = ref($self) || $self;
>   return 1;
> }
>
> RT::Base->_ImportOverlays();
>
> # ;)
> 1;
>
>
>
>
>   --
> *From:* Christian Loos 
> *To:* Red Pantyhose 
> *Cc:* "rt-users@lists.bestpractical.com" 
>
> *Sent:* Friday, October 26, 2012 3:17 PM
> *Subject:* Re: Write a Custom Action in rt4 as a Module/package ERROR
>
> uncomment this line:
> #use base qw(RT::Action);
>
> Chris
>
> Am 26.10.2012 15:02, schrieb Red Pantyhose:
> > Dear rt-users
> >
> > I created the following ActionScrip Module below -  the Module is
> > registered.
> >
> > But i get the following Error:
> >
> > Oct 26 14:42:49 rt RT: Scrip Prepare 14 died. - Can't locate object
> > method "new" via package "RT::Action::OpenSystemCustomFields" at
> > /usr/share/request-tracker4/lib/RT/ScripAction.pm line
> > 175.#012#012Stack:#012
> > [/usr/share/request-tracker4/lib/RT/ScripAction.pm:175]#012
> > [/usr/share/request-tracker4/lib/RT/Scrip.pm:443]#012
> > [/usr/share/request-tracker4/lib/RT/Scrips.pm:252]#012
> > [/usr/share/request-tracker4/lib/RT/Transaction.pm:179]#012
> > [/usr/share/request-tracker4/lib/RT/Record.pm:1459]#012
> > [/usr/share/request-tracker4/lib/RT/Ticket.pm:676]#012
> > [/usr/share/request-tracker4/lib/RT/Interface/Web.pm:1711]#012
> > [/usr/share/request-tracker4/html/Ticket/Display.html:128]#012
> > [/usr/share/request-tracker4/html/Ticket/Create.html:444]#012
> > [/usr/share/request-tracker4/html/Ticket/autohandler:19]#012
> > [/usr/share/request-tracker4/lib/RT/Interface/Web.pm:568]#012
> > [/usr/share/request-tracker4/lib/RT/Interface/Web.pm:318]#012
> > [/usr/share/request-tracker4/html/autohandler:53]
> > (/usr/share/request-tracker4/lib/RT/Scrip.pm:451)
> >
> > I'm using rt-4.0.5.
> >
> > What am I doing wrong ?
> >
> > Thanks Sincerely
> >
> > Denis
> >
> >
> >
> #-OpenSystemCustomFields.init---#
> >
> > # To initialize the OpenSystemCustomFields ActionScrip:
> > # rt-setup-database-4 --action insert --datafile
> OpenSystemCustomFields.init
> >
> > @ScripActions = (
> > {
> >Name=> 'OpenSystemCustomFields',
> >Description => 'Create CustomFields from data retrieved out of the
> > OpenSystem DB',
> >ExecModule  => 'OpenSystemCustomFields',
> >Argument=> ''
> >  },
> > );
> >
> >
> >
> >
> >
> #-OpenSystemCustomFields.pm---#
> > use strict;
> > use warnings;
> >
> > package RT::Action::OpenSystemCustomFields;
> >
> > #use base qw(RT::Action);
> >
> > #use base qw(RT::Action::Generic);
> >
> > sub Prepare {
> >  my $self = shift;
> >  return 1;
> > }
> >
> > sub Commit {
> >  my $self = shift;
> >  return 1;
> > }
> >
> > # ;)
> > 1;
> >
> >
> >
> >
> >
> >
> >
> > 
> > We're hiring! http://bestpractical.com/jobs
> >
>
>
>
>
> 
> We're hiring! http://bestpractical.com/jobs
>
>


-- 
http://www.linkedin.com/in/p

Re: [rt-users] postgres 9.2.1, RT 4.0.5 - RT couldn't connect to database

2012-10-16 Thread Paul Tomblin
On Tue, Oct 16, 2012 at 5:56 PM, Mike James  wrote:

>
> [root@tracker ~]# su -l rt_user
> [rt_user@tracker ~]$ psql -d rt4 -U rt_user
> psql (9.2.1)
> Type "help" for help.
>

How about if you try

psql -H localhost -U rt_user rt4

That will tell you if you've configured postgres to accept tcp/ip
connections (as well as the default unix domain sockets).

-- 
http://www.linkedin.com/in/paultomblin
http://careers.stackoverflow.com/ptomblin


Final RT training for 2012 in Atlanta, GA - October 23 & 24
  http://bestpractical.com/training

We're hiring! http://bestpractical.com/jobs


Re: [rt-users] Chrome missing images, and missing ticket body in RT 4.0.7

2012-09-26 Thread Paul Tomblin
On Wed, Sep 26, 2012 at 1:49 PM, Ben Brown  wrote:

> A second problem - in Chrome for Windows, widget icons (the arrows next to
> menus Home, Tickets, Tools, etc) as well as the menu rollup icons, are
> missing. It works in Firefox and IE. It also works on Chrome for Mac. I can
> see in the Apache logs that those images are being requested and served OK
> - I can even navigate to the image URL and see it fine in Chrome.


Can you right click and choose "Inspect Element" on the spot where the icon
is supposed to be?  You should see something under styles like
sf-sub-indicator {
background-image: url(/NoAuth/css/images/arrows-grey.png);
}
and when you hover over the url, it should show you a "sprite" image (in
this case, 20x110 pixel).  You should also be able to see it under the
Resources tab under Images.


-- 
http://www.linkedin.com/in/paultomblin
http://careers.stackoverflow.com/ptomblin


Final RT training for 2012 in Atlanta, GA - October 23 & 24
  http://bestpractical.com/training

We're hiring! http://bestpractical.com/jobs


Re: [rt-users] .wav files no longer play in browser

2012-09-20 Thread Paul Tomblin
Apache probably isn't returning the correct content type for them.

On Thursday, September 20, 2012, Aaron Bendickson wrote:

> Just recently updated from v3.8.8 to v4.0.7 and one thing I can't seem
> to figure out is why .wav file attachments no longer play in the
> browser. If I download the attachment to disk it plays fine but not
> when opened in the browser window. This is making my telephone support
> users quite upset.
>
> Using Safari 6 on Mac OS X.
>
> Any advice here? Thanks!
>
> 
> Final RT training for 2012 in Atlanta, GA - October 23 & 24
>   http://bestpractical.com/training
>
> We're hiring! http://bestpractical.com/jobs
>


-- 
http://www.linkedin.com/in/paultomblin
http://careers.stackoverflow.com/ptomblin


Final RT training for 2012 in Atlanta, GA - October 23 & 24
  http://bestpractical.com/training

We're hiring! http://bestpractical.com/jobs


Re: [rt-users] Re-assign tickets

2012-09-19 Thread Paul Tomblin
On Wed, Sep 19, 2012 at 2:25 PM, Matt Brennan  wrote:

> 2924 through 2935. I do notice that there's something about "Force" in
> that if statement, but it seems force is an internal thing to allow
> automated processes to override the check.
>

Oh, it looks like I can do it programmatically using
$ticket->SetOwner('other_guy', 'Force').  Now I just have to figure out how
to expose that on the UI.  And it looks like that's the reason you can't
Steal from the Basic screen - because they want to enforce the difference
between Take and Steal using that argument.


-- 
http://www.linkedin.com/in/paultomblin
http://careers.stackoverflow.com/ptomblin


Final RT training for 2012 in Atlanta, GA - October 23 & 24
  http://bestpractical.com/training

We're hiring! http://bestpractical.com/jobs


[rt-users] Re-assign tickets

2012-09-19 Thread Paul Tomblin
I've noticed that I can "steal" a ticket using the "Actions"->"Steal"
dropdown on the ticket display, however I can't steal if by changing the
"Owner" dropdown on the Basics page.  When I attempt to, I get a message
"You can only take tickets that are unowned".  Is this intentional, or an
oversight?

Also, is there some privilege that would allow me to re-assign a ticket
from one person to another?  As a work-around, I can steal it and assign
it, but I'd like to do it in one step.

-- 
http://www.linkedin.com/in/paultomblin
http://careers.stackoverflow.com/ptomblin


Final RT training for 2012 in Atlanta, GA - October 23 & 24
  http://bestpractical.com/training

We're hiring! http://bestpractical.com/jobs


Re: [rt-users] Cross site request forgery

2012-09-17 Thread Paul Tomblin
On Monday, September 17, 2012, Chris O'Kelly wrote:

>
> Hi Paul,
>
> ** **
>
> Firstly, I'll just point out this isn't my fix, it's stolen from the top
> answer of
> http://stackoverflow.com/questions/4762254/javascript-window-location-does-not-set-referer-in-the-request-header,
> but it is elegant and works, so there you go. Define the function
> navigateToUrl(url), either in an external file that you include in each
> page (I forget what the name of the configuration option is, but you'll
> find it if you grep etc/RT_Config.pm for javascript) or inline in all the
> pages you might use it (I would suggest the former of these).
>
>
> Thanks Chris. That page is extremely helpful.


-- 
http://www.linkedin.com/in/paultomblin
http://careers.stackoverflow.com/ptomblin


Final RT training for 2012 in Atlanta, GA - October 23 & 24
  http://bestpractical.com/training

We're hiring! http://bestpractical.com/jobs


[rt-users] Cross site request forgery

2012-09-17 Thread Paul Tomblin
I have three custom pages, call them "d.html", "a.html" and "c.html".
 "d.html" is the dashboard for the plugin, and from that one to either of
the others and back to "d.html".  I transition between them using
'window.location = "d.html";' which works fine for all of the transitions,
except one.  When I'm on d.html and I want to go to a.html with an
argument, I do 'window.location = "a.html?upid=123";'.  That one works just
fine on Chrome and Firefox (on Linux and Mac) and IE9 (On Windows 7), but
on IE8 I get the dreaded "Cross site request forgery".  Clicking the "click
here to resume your request" of course gets me to the page as requested.

In the log, the message is
Possible CSRF: your browser did not supply a Referrer header
(/opt/rt4/sbin/../lib/RT/Interface/Web.pm:1369

Looking at the source code, it appears that the problem is that
IsCompCSRFWhitelisted is complaining about the fact that there is an
argument.  But why isn't IE8 sending a referrer header when the other
browsers do?

This is RT 4.0.6, running in standalone development mode.

-- 
http://www.linkedin.com/in/paultomblin
http://careers.stackoverflow.com/ptomblin


Final RT training for 2012 in Atlanta, GA - October 23 & 24
  http://bestpractical.com/training

We're hiring! http://bestpractical.com/jobs


Re: [rt-users] sendmail error (exited with code 75) - RHEL6

2012-09-05 Thread Paul Tomblin
On Wed, Sep 5, 2012 at 8:49 AM, Raphaël Berlamont
 wrote:
> 2012/9/4 Paul Tomblin 
>>
>> What happens if you just try to send an email to one of those
>> addresses from the command line on that server?  I.e.
>> Mail -s "test message" corp_admin_...@myfirm.fr
>> test me
>> .
>
>
> Hello Paul,
>
> It works and open me a new ticket (no reply though, because root is not
> correctly aliased).

Wait a minute - are you saying that RT is sending outgoing mail to
addresses that RT will receive and create a ticket for?  Won't that
lead to a cascade of tickets?


-- 
http://www.linkedin.com/in/paultomblin
http://careers.stackoverflow.com/ptomblin


Re: [rt-users] OnCreate insert a comment IN the ticket?

2012-09-04 Thread Paul Tomblin
On Tue, Sep 4, 2012 at 3:05 PM, Jeff Blaine  wrote:
> my $ticket = $self->TicketObj;
> $ticket->Comment(content => "blah!");

  my $mimeObj = MIME::Entity->build(
Type => 'multipart/mixed',
'Message-Id' => RT::Interface::Email::GenMessageId,
Subject  => $subject,
  );
  $mimeObj->attach(
Type=> "text/plain",
Charset => 'UTF-8',
Data=> $summary
  );
  $mimeObj->make_singlepart;
  $ticketObj->Comment(MIMEObj => $mimeObj);


-- 
http://www.linkedin.com/in/paultomblin
http://careers.stackoverflow.com/ptomblin


Re: [rt-users] sendmail error (exited with code 75) - RHEL6

2012-09-04 Thread Paul Tomblin
On Tue, Sep 4, 2012 at 1:14 PM, Raphaël Berlamont
 wrote:
>
> Here you can fin a pastebin of ll those messages :
> http://pastebin.com/GemuDHSw
>
> .

What happens if you just try to send an email to one of those
addresses from the command line on that server?  I.e.
Mail -s "test message" corp_admin_...@myfirm.fr
test me
.


-- 
http://www.linkedin.com/in/paultomblin
http://careers.stackoverflow.com/ptomblin


Re: [rt-users] sendmail error (exited with code 75) - RHEL6

2012-09-04 Thread Paul Tomblin
On Tue, Sep 4, 2012 at 11:56 AM, Raphaël Berlamont
 wrote:
> 2012/9/4 Paul Tomblin 
>>
>> I can't think of any reason why sendmail thinks it needs to tell the
>> mail user agent (MUA) this.  Mail Transfer Agents (MTA) like sendmail
>> should do queuing and retrying automatically.  If anybody needs to be
>> told that it's temporary failing, it's the sysadmin, not the mail
>> sender
>
>
> I agree with your conclusion, but that doesn't explain why a restart of
> apache make the thing working again... A limit somewhere ? Are there any
> tunning to do for heavy load installation ? (even if I don't really think
> that our system is under real heavy load).

What's your load average?  I seem to recall that by default sendmail
would stop delivery if the load average is above 4.0.

You can probably find more information in the mail logs.


-- 
http://www.linkedin.com/in/paultomblin
http://careers.stackoverflow.com/ptomblin


Re: [rt-users] sendmail error (exited with code 75) - RHEL6

2012-09-04 Thread Paul Tomblin
On Tue, Sep 4, 2012 at 9:57 AM, Raphaël Berlamont
 wrote:

> OK for this first error, but the second one disappears as soon as I restart
> apache, and RT work flawlessly for minutes/hours (depending on load maybe) :
> 
> "[Tue Sep  4 09:34:43 2012] [error]:
> : `/usr/sbin/sendmail -oi
> -t -f e...@myfirm.com` exited with code 75

Error code 75 is "EX_TEMPFAIL", which is sendmail telling you that a
temporary error occurred.  The message is queued, but it can't be
delivered immediately, but it will retry when it can.

http://www.diablotin.com/librairie/networking/sendmail/ch36_05.htm

I can't think of any reason why sendmail thinks it needs to tell the
mail user agent (MUA) this.  Mail Transfer Agents (MTA) like sendmail
should do queuing and retrying automatically.  If anybody needs to be
told that it's temporary failing, it's the sysadmin, not the mail
sender.

-- 
http://www.linkedin.com/in/paultomblin
http://careers.stackoverflow.com/ptomblin


Re: [rt-users] sendmail error (exited with code 75) - RHEL6

2012-09-04 Thread Paul Tomblin
On Tue, Sep 4, 2012 at 8:52 AM, Raphaël Berlamont
 wrote:
> [Tue Sep  4 09:34:43 2012] [info]:
>  #7324/120687 - Scrip 10
> On Resolve Notify Requestors
> (/opt/rt4/sbin/../lib/RT/Action/SendEmail.pm:301)
> sendmail: fatal: e...@myfirm.com(48): No recipient addresses found in
> message header

This isn't an RT error, it's sendmail telling you that it thinks it's
the local handler for myfirm.com, but can't

-- 
http://www.linkedin.com/in/paultomblin
http://careers.stackoverflow.com/ptomblin


Re: [rt-users] Users Autocomplete not working 4.0.7?

2012-08-31 Thread Paul Tomblin
On Fri, Aug 31, 2012 at 10:10 AM, Shawn Plummer  wrote:

> Anyone with Oracle will probably need to do this:

Correct me if I'm wrong, but isn't Oracle violating the SQL spec by
treating empty strings as equivalent to null?  I expect that kind of
behavior from MySQL, but from Oracle?  That's unbelievable.

-- 
http://www.linkedin.com/in/paultomblin
http://careers.stackoverflow.com/ptomblin


Re: [rt-users] Problem with callbacks in RT 4.0.6

2012-08-30 Thread Paul Tomblin
On Thu, Aug 30, 2012 at 2:52 PM, Kevin Falcone
 wrote:
> This should be easy to fix.  Don't specify <%ARGS> and just
> do a return if ref $ARGS{URL} to skip the first variant of the
> callback.

Yes, that worked.

Is there a 4.2 git repo up in the usual places?


-- 
http://www.linkedin.com/in/paultomblin
http://careers.stackoverflow.com/ptomblin


[rt-users] Problem with callbacks in RT 4.0.6

2012-08-28 Thread Paul Tomblin
I'm trying to make it so when a user logs out of RT, they get taken
back to my page when they log back in.  But I'm having problems with
the callback in /NoAuth/Logout.html, because it seems like the
"Default" callback is called twice, once in <%init> and once in the
main, but with different arguments:

In the <%init> section, at line 74, we find:
$m->callback( %ARGS, URL => \$URL );
and in the main section, at line 62, we find:
% $m->callback( %ARGS );

So if I make a Default callback, the first time it gets called, $URL
is a reference to the scalar, but the second time it is just the
scalar.

<%INIT>
$$URL = "/myapp/change_request.html";

<%ARGS>
$URL


I feel like one or both of these callbacks should probably be given a
name so we can distinguish them.

-- 
http://www.linkedin.com/in/paultomblin
http://careers.stackoverflow.com/ptomblin


[rt-users] Just in case this helps somebody

2012-08-23 Thread Paul Tomblin
I've had this weird situation where when I call an AJAX function, even
though the Mason handler file calls $m->abort, I was still getting
HTML from the autohandler in the directory above the directory where
the handler lived, and RT autohandler stuff after that.  This was only
happening on my Mac, not on my Linux computer (there were slight
version differences of some of the perl modules, including
HTML::Mason, so I don't know if that was the problem).  The solution I
adopted was to rename all the ajax functions I use to have a .ajx
extension, and then in the top level autohandler, call $m->call_next,
and then, if it was named .ajx, also call $m->abort.  I know, this
shouldn't be required, but evidently it was in at least one case.  And
if it's not required, it doesn't do any harm that I can see.  Here is
my top level autohandler now:


<%init>
my $file = $m->base_comp->source_file;
$m->call_next();
if ($file =~ m{\.ajx$}) {
$m->abort;
}


-- 
http://www.linkedin.com/in/paultomblin
http://careers.stackoverflow.com/ptomblin


[rt-users] Same code, different results

2012-08-22 Thread Paul Tomblin
My code makes an ajax call to a mason file that emits some json.  That
mason file uses the exact same techniques that RT's own ajax mason
files use to make sure it isn't polluted with html - it calls
$m->abort after emitting the json.  On my Linux box (Ubuntu 12.04,
some dependencies installed with apt-get, but most through CPAN), that
works fine - I get the results I want.  On my Mac (Mountain Lion, all
dependencies installed with CPAN), the JSON is polluted with html from
my autohandler and from the default RT autohandler.  Can somebody tell
me what is going on, and how do I stop it?  I had some luck with using
<%flags>
inherit => undef

but I'm told that's a massive security hole, so I took it out.

Here is the top bit of my ajax handler file:

% $r->content_type('application/json');
% $m->clear_buffer;
<% JSON::to_json( \@suggestions, { utf8 => 1, allow_blessed => 1,
convert_blessed => 1, } ) |n %>
% $m->abort;
<%ARGS>
@field => undef
@value => undef
$current => undef
$term => undef

<%INIT>


-- 
http://www.linkedin.com/in/paultomblin
http://careers.stackoverflow.com/ptomblin


Re: [rt-users] Set up problems

2012-08-21 Thread Paul Tomblin
On Mon, Aug 20, 2012 at 8:11 PM, Paul Tomblin  wrote:
> I send a copy of my latest code to my client.  He followed my installation
> instructions (added the plugin name to RT_SiteConfig.pm @Plugins, do a "perl
> Makefile.pm; make; make initdb; make install", restart the server), but when
> he tries to go to the first page of my code
> http://hisdomain.com/rt/cf/change_request.html
>
> , it redirects him to https://hisdomain.com/rt/SelfService/
>

I think I figured out the problem - somehow he's made all the users
unprivileged.  Either that or he changed the SelfServiceRegex.



-- 
http://www.linkedin.com/in/paultomblin
http://careers.stackoverflow.com/ptomblin


[rt-users] Set up problems

2012-08-20 Thread Paul Tomblin
I send a copy of my latest code to my client.  He followed my installation
instructions (added the plugin name to RT_SiteConfig.pm @Plugins, do a
"perl Makefile.pm; make; make initdb; make install", restart the server),
but when he tries to go to the first page of my code
http://hisdomain.com/rt/cf/change_request.html, it redirects him to
https://hisdomain.com/rt/SelfService/

Unfortunately he isn't allowed to give me a look at their config file or
their web server configuration or anything.  So what do I tell him to look
for?  He did verify that my web page does appear to be in
/opt/rt4/local/plugins/cf/html/cf.  In spite of the fact that the won't let
me poke around, saying "It works for me on two of my computers" isn't going
to be good enough for them.  So how do I help them figure out what's going
wrong?


-- 
http://www.linkedin.com/in/paultomblin
http://careers.stackoverflow.com/ptomblin


Re: [rt-users] Using Ajax with Mason in RT

2012-08-17 Thread Paul Tomblin
On Fri, Aug 17, 2012 at 3:26 AM, Martin Drasar  wrote:

>
> Still, I wonder how come that Paul could successfully run my scripts...
>
>
Because I didn't put it in Elements, I put it in the directory with the
code I was working on, and because I didn't try it with <%flags>.

If there is one thing that's annoyed me about my whole experience with RT
it's the way errors either get eaten up or mis-reported.  I don't know if
that's the fault of Perl, Mason or RT, but I frequently find myself having
to put RT::Logger->debug statements every other line just so I can figure
out where it's silently failing, and then minutely examining the line to
discover that (as happened yesterday) I had an extra $ in front of a
variable name.



-- 
http://www.linkedin.com/in/paultomblin
http://careers.stackoverflow.com/ptomblin


Re: [rt-users] MinPasswordLength Not Working

2012-08-16 Thread Paul Tomblin
On Thu, Aug 16, 2012 at 1:04 PM, Kevin Falcone wrote:

> The config option is called MinimumPasswordLength, not
> MinPasswordLength.  It works fine for me.
>

And just as an aside, if you force your users to use 10 character
passwords, I can *guarantee* that most of them will have them written down
on a post-it note, either right on their screen, or under their desk
drawer.  Hackers know this.  Heck, even janitors know this.


-- 
http://www.linkedin.com/in/paultomblin
http://careers.stackoverflow.com/ptomblin


Re: [rt-users] Using Ajax with Mason in RT

2012-08-16 Thread Paul Tomblin
On Thu, Aug 16, 2012 at 9:21 AM, Martin Drasar  wrote:

>
> My question is - how can I diagnose, whether there is a problem with
> (auto|d)handlers? I haven't touched any of them since the installation.


Ok, this is a real desperation measure, but I modified /opt/rt4/lib/RT.pm
and added a call to Carp::cluck in both the $SIG{__WARN__} and
$SIG{__DIE__} handlers.  It adds a tiny bit more information in a few cases
that normally go unremarked by RT.  Also, make sure and restart your server
after making changes, because the code that is supposed to pick up changes
doesn't always do so.


-- 
http://www.linkedin.com/in/paultomblin
http://careers.stackoverflow.com/ptomblin


Re: [rt-users] Using Ajax with Mason in RT

2012-08-16 Thread Paul Tomblin
On Thu, Aug 16, 2012 at 8:00 AM, Martin Drasar  wrote:

> Ajax request on this component fails with this error:
> Error during compilation of
> /home/RT/RT-4.0.6/local/html/Ticket/Elements/TestComponent:syntax
> error at (eval 1164) line 12, at EOF
>

I copied your code into my web app, and it worked fine.  Firebug shows me
that the ajax call returned ["something"]

I'd go with Joe's suggestion, or maybe something in an autohandler or
dhandler that is screwing things up.

-- 
http://www.linkedin.com/in/paultomblin
http://careers.stackoverflow.com/ptomblin


Re: [rt-users] Using Ajax with Mason in RT

2012-08-16 Thread Paul Tomblin
On Thu, Aug 16, 2012 at 7:24 AM, Martin Drasar  wrote:

> On 16.8.2012 13:15, Paul Tomblin wrote:
> >
> >
> > On Thu, Aug 16, 2012 at 5:22 AM, Martin Drasar  > <mailto:dra...@ics.muni.cz>> wrote:
> >
> >
> > The problem is, when I remove the flags section, the ajax call fails
> > with 403. If I keep it, I get back following error: "syntax error at
> > /home/RT/RT-4.0.6/local/html/Ticket/Elements/TestComponent line 15,
> > at EOF"
> >
> >
> > Do you see anything in the logs?
>
> Nope...
>
> rt.log is empty, apache error log as well and the only thing I see in
> access log is '"POST /Ticket/Elements/TestComponent HTTP/1.1" 200 1322'
>
> I can post the code stack, but I am afraid that there is not much that
> can help...
>
> Martin
>

Unfortunately somewhere between RT and Mason and perl a lot of the errors
go unreported - you just have to narrow down where the problem is with a
lot of calls to $RT::Logger->debug.  But first things first, you need to
turn up the logging in /opt/rt4/etc/RT_SiteConfig.pm
Set( $LogToScreen, "debug");
Set( $LogToSyslog, "debug");
You also need to have a look at line 15 and before in your component.


-- 
http://www.linkedin.com/in/paultomblin
http://careers.stackoverflow.com/ptomblin


Re: [rt-users] Using Ajax with Mason in RT

2012-08-16 Thread Paul Tomblin
On Thu, Aug 16, 2012 at 5:22 AM, Martin Drasar  wrote:

>
> The problem is, when I remove the flags section, the ajax call fails
> with 403. If I keep it, I get back following error: "syntax error at
> /home/RT/RT-4.0.6/local/html/Ticket/Elements/TestComponent line 15, at EOF"
>

Do you see anything in the logs?

-- 
http://www.linkedin.com/in/paultomblin
http://careers.stackoverflow.com/ptomblin


Re: [rt-users] Using Ajax with Mason in RT

2012-08-15 Thread Paul Tomblin
I don't know why I had the problem before with my ajax files when I didn't
have the inherit => undef before, but I took them all out and all my ajax
calls appear to still be working.  So I guess you don't need that <%flags>
section.



-- 
http://www.linkedin.com/in/paultomblin
http://careers.stackoverflow.com/ptomblin


Re: [rt-users] Using Ajax with Mason in RT

2012-08-15 Thread Paul Tomblin
On Wed, Aug 15, 2012 at 11:37 AM, Martin Drasar  wrote:

> I have used MakeClicky actions to extend the RT UI and now I would like
> my extensions to do some ajax stuff on click. I would like to know, how
> I can create new Mason component and set it as a valid target for the
> ajax request.
>
> Any help is really appreciated.
>

If you want your AJAX to return JSON, you need to do the following:

1. Do all the work of building the return component in the <%init>.  I make
it a hashref called $ret.
2. In the "web" section of the file (the part that isn't enclosed in
<%init> or other Mason tags:
% $r->content_type('application/json');
% $m->clear_buffer;
<% JSON::to_json( $ret, { utf8 => 1, allow_blessed => 1,
convert_blessed => 1, } ) |n %>
% $m->abort;
3. Declare as <%args> all the parameters you pass it
4. Turn off any inheritance with
<%flags>
inherit => undef

5. Call it in your Javascript like so:
  jQuery.ajax({
type:   'POST',
url:'assign_ticket.mas',
data:   {
'ticketid': ticketId,
'assignTo':   rt_user_id,
'reason':   reason,
'currentUserId':<% $session{'CurrentUser'}->id %>
},
dataType:   'json',
traditional:true,
success:changeStatusSuccessCallback,
error:  changeStatusErrorCallback
  });

function changeStatusSuccessCallback(json)
{
  if (json.status == 'error')
  {
alert('Error: ' + json.error_msg);
  }
  else
  {
document.location.reload(true);
  }
}
function changeStatusErrorCallback(jqXHR, textStatus, errorThrown)
{
  alert(textStatus + ": " + errorThrown);
}

I'll leave it to you to figure out something better to do with the return
callbacks.




-- 
http://www.linkedin.com/in/paultomblin
http://careers.stackoverflow.com/ptomblin


Re: [rt-users] CustomFieldValues

2012-08-14 Thread Paul Tomblin
On Tue, Aug 14, 2012 at 3:27 AM, Gergely Buday  wrote:

> Hi there,
>
> I was able to log a custom field value in a scrip:
>
> my $user=$self->TransactionObj->CreatorObj;
>
> my $cfvs = $user->CustomFieldValues('107');
> while(my $cfv = $cfvs->Next)  {
>   $RT::Logger->info("cfv->Content=" . $cfv->Content) if length
> $cfv->Content;
> }
>
> return 1;
>
> Beside ->Content, is there a field that gives back the number I set in
> the custom field definition? It would be more robust to handle.
>
>
I just use $value = $ticket->FirstCustomFieldValue("field_name");


-- 
http://www.linkedin.com/in/paultomblin
http://careers.stackoverflow.com/ptomblin


Re: [rt-users] testing perl script in RT

2012-08-09 Thread Paul Tomblin
On Thu, Aug 9, 2012 at 12:45 PM, Thomas Sibley wrote:

> and
>
> RT->Init;
> RT->LoadConfig;
>

Looking at my unit test scripts, I seem to have

RT::Init;
RT::LoadConfig;

There shouldn't be a difference, should there?



-- 
http://www.linkedin.com/in/paultomblin
http://careers.stackoverflow.com/ptomblin


Re: [rt-users] testing perl script in RT

2012-08-09 Thread Paul Tomblin
On Thu, Aug 9, 2012 at 12:01 PM, Gergely Buday  wrote:

> Hi there,
>
> how can I run a perl script through the RT environment so that I can
> use the database and all the modules, but see the compiler output on
> my faulty experiments?
>
> - Gergely
>

use lib "/opt/rt4/lib";
use RT;

That should be enough.

-- 
http://www.linkedin.com/in/paultomblin
http://careers.stackoverflow.com/ptomblin


Re: [rt-users] EXTERNAL: Re: Group not found

2012-07-25 Thread Paul Tomblin
That's just a consequence of the other error:
%if ($Members->Count == 0 ) {

$Members->Count returns an undef because of the error, which leads to the
second error.

On Wed, Jul 25, 2012 at 1:13 PM, Betz, Gregory wrote:

>  Also, I noticed the following message after the aforementioned warning
> message in the log.
>
> ** **
>
> Use of uninitialized value in numeric eq (==) at
> /opt/rt4/local/html/Admin/Elements/EditQueueWatchers line 3.
> (/opt/rt4/local/html/Admin/Elements/EditQueueWatchers:3) 
>
> ** **
>
> Thanks,
>
> Greg
>
> ** **
>
> *From:* rt-users-boun...@lists.bestpractical.com [mailto:
> rt-users-boun...@lists.bestpractical.com] *On Behalf Of *Betz, Gregory
> *Sent:* Wednesday, July 25, 2012 10:29 AM
> *To:* Paul Tomblin
> *Cc:* rt-users@lists.bestpractical.com
> *Subject:* Re: [rt-users] EXTERNAL: Re: Group not found
>
> ** **
>
> Hey Paul, 
>
> ** **
>
> Thanks for the quick response. 
>
> ** **
>
> I use the root account when attempting to put watchers on the queues, so I
> don’t think this is the issue
>
> ** **
>
> Thanks,
>
> Greg
>
> ** **
>
> *From:* ptomb...@gmail.com [mailto:ptomb...@gmail.com] *On Behalf Of *Paul
> Tomblin
> *Sent:* Wednesday, July 25, 2012 10:25 AM
> *To:* Betz, Gregory
> *Cc:* rt-users@lists.bestpractical.com
> *Subject:* EXTERNAL: Re: [rt-users] Group not found
>
> ** **
>
> I've seen this exact thing happen when the person trying to add the
> watchers didn't have permissions to the queues in question.  Rather than
> handling it properly, RT sticks a null queue name into the query, which the
> query doesn't like much.
>
> On Wed, Jul 25, 2012 at 10:18 AM, Betz, Gregory 
> wrote:
>
> Hello all,
>
>  
>
> I am having issues trying to add watchers to most of my queues.  When I
> try to add a user or group I receive the error message “Group not found”.
> 
>
>  
>
> I can set watchers for 2 queues (one is the General queue) out of 9 total
> queues. 
>
>  
>
> Also, I noticed that the 2 queues that I can set watchers has items under
> Roles in Group Rights while the queues that I cannot set the watchers does
> not. 
>
>  
>
> The following error message is displayed in /var/log/httpd/error_log
>
>  
>
>
> ==
> 
>
> [Wed Jul 25 12:05:06 2012] [warning]: DBD::Pg::st execute failed: ERROR:
> syntax error at or near ")"
>
> LINE 1: ...nt(main.id) FROM GroupMembers main  WHERE (main.GroupId = )
>
>  ^ at
> /usr/local/share/perl5/DBIx/SearchBuilder/Handle.pm line 587.
> (/usr/local/share/perl5/DBIx/SearchBuilder/Handle.pm:587)
>
>  
>
>  
>
> [Wed Jul 25 12:05:06 2012] [warning]: RT::Handle=HASH(0x7fbc4de27b10)
> couldn't execute the query 'SELECT count(main.id) FROM GroupMembers main
> WHERE (main.GroupId = ) ' at
> /usr/local/share/perl5/DBIx/SearchBuilder/Handle.pm line 600.
>
>
> DBIx::SearchBuilder::Handle::SimpleQuery('RT::Handle=HASH(0x7fbc4de27b10)',
> 'SELECT count(main.id) FROM GroupMembers main  WHERE (main.Gro...')
> called at /usr/local/share/perl5/DBIx/SearchBuilder.pm line 291
>
>
> DBIx::SearchBuilder::_DoCount('RT::GroupMembers=HASH(0x7fbc4febdfb8)')
> called at /opt/rt4/sbin/../lib/RT/SearchBuilder.pm line 331
>
>
> RT::SearchBuilder::_DoCount('RT::GroupMembers=HASH(0x7fbc4febdfb8)') called
> at /usr/local/share/perl5/DBIx/SearchBuilder.pm line 1407
>
>
> DBIx::SearchBuilder::Count('RT::GroupMembers=HASH(0x7fbc4febdfb8)') called
> at /opt/rt4/local/html/Admin/Elements/EditQueueWatchers line 48
>
> HTML::Mason::Commands::__ANON__('QueueObj',
> 'RT::Queue=HASH(0x7fbc4feb6a28)', 'Watchers',
> 'RT::Group=HASH(0x7fbc5000f3f0)') called at
> /usr/local/share/perl5/HTML/Mason/Component.pm line 135
>
>
> HTML::Mason::Component::run('HTML::Mason::Component::FileBased=HASH(0x7fbc4febff68)',
> 'QueueObj', 'RT::Queue=HASH(0x7fbc4feb6a28)', 'Watchers',
> 'RT::Group=HASH(0x7fbc5000f3f0)') called at
> /usr/local/share/perl5/HTML/Mason/Request.pm line 1302
>
> eval {...} called at /usr/local/share/perl5/HTML/Mason/Request.pm
> line 1292
>
> HTML::Mason::Request::comp(undef, undef, 'Que

Re: [rt-users] Group not found

2012-07-25 Thread Paul Tomblin
I've seen this exact thing happen when the person trying to add the
watchers didn't have permissions to the queues in question.  Rather than
handling it properly, RT sticks a null queue name into the query, which the
query doesn't like much.

On Wed, Jul 25, 2012 at 10:18 AM, Betz, Gregory
wrote:

>  Hello all,
>
> ** **
>
> I am having issues trying to add watchers to most of my queues.  When I
> try to add a user or group I receive the error message “Group not found”.
> 
>
> ** **
>
> I can set watchers for 2 queues (one is the General queue) out of 9 total
> queues. 
>
> ** **
>
> Also, I noticed that the 2 queues that I can set watchers has items under
> Roles in Group Rights while the queues that I cannot set the watchers does
> not. 
>
> ** **
>
> The following error message is displayed in /var/log/httpd/error_log
>
> ** **
>
>
> ==
> 
>
> [Wed Jul 25 12:05:06 2012] [warning]: DBD::Pg::st execute failed: ERROR:
> syntax error at or near ")"
>
> LINE 1: ...nt(main.id) FROM GroupMembers main  WHERE (main.GroupId = )
>
>  ^ at
> /usr/local/share/perl5/DBIx/SearchBuilder/Handle.pm line 587.
> (/usr/local/share/perl5/DBIx/SearchBuilder/Handle.pm:587)
>
> ** **
>
> ** **
>
> [Wed Jul 25 12:05:06 2012] [warning]: RT::Handle=HASH(0x7fbc4de27b10)
> couldn't execute the query 'SELECT count(main.id) FROM GroupMembers main
> WHERE (main.GroupId = ) ' at
> /usr/local/share/perl5/DBIx/SearchBuilder/Handle.pm line 600.
>
>
> DBIx::SearchBuilder::Handle::SimpleQuery('RT::Handle=HASH(0x7fbc4de27b10)',
> 'SELECT count(main.id) FROM GroupMembers main  WHERE (main.Gro...')
> called at /usr/local/share/perl5/DBIx/SearchBuilder.pm line 291
>
>
> DBIx::SearchBuilder::_DoCount('RT::GroupMembers=HASH(0x7fbc4febdfb8)')
> called at /opt/rt4/sbin/../lib/RT/SearchBuilder.pm line 331
>
>
> RT::SearchBuilder::_DoCount('RT::GroupMembers=HASH(0x7fbc4febdfb8)') called
> at /usr/local/share/perl5/DBIx/SearchBuilder.pm line 1407
>
>
> DBIx::SearchBuilder::Count('RT::GroupMembers=HASH(0x7fbc4febdfb8)') called
> at /opt/rt4/local/html/Admin/Elements/EditQueueWatchers line 48
>
> HTML::Mason::Commands::__ANON__('QueueObj',
> 'RT::Queue=HASH(0x7fbc4feb6a28)', 'Watchers',
> 'RT::Group=HASH(0x7fbc5000f3f0)') called at
> /usr/local/share/perl5/HTML/Mason/Component.pm line 135
>
>
> HTML::Mason::Component::run('HTML::Mason::Component::FileBased=HASH(0x7fbc4febff68)',
> 'QueueObj', 'RT::Queue=HASH(0x7fbc4feb6a28)', 'Watchers',
> 'RT::Group=HASH(0x7fbc5000f3f0)') called at
> /usr/local/share/perl5/HTML/Mason/Request.pm line 1302
>
> eval {...} called at /usr/local/share/perl5/HTML/Mason/Request.pm
> line 1292
>
> HTML::Mason::Request::comp(undef, undef, 'QueueObj',
> 'RT::Queue=HASH(0x7fbc4feb6a28)', 'Watchers',
> 'RT::Group=HASH(0x7fbc5000f3f0)') called at
> /opt/rt4/local/html/Admin/Elements/EditQueueWatcherGroup line 55
>
> HTML::Mason::Commands::__ANON__('Label', 'AdminCc', 'QueueObj',
> 'RT::Queue=HASH(0x7fbc4feb6a28)', 'Watchers',
> 'RT::Group=HASH(0x7fbc5000f3f0)') called at
> /usr/local/share/perl5/HTML/Mason/Component.pm line 135
>
>
> HTML::Mason::Component::run('HTML::Mason::Component::FileBased=HASH(0x7fbc4febca88)',
> 'Label', 'AdminCc', 'QueueObj', 'RT::Queue=HASH(0x7fbc4feb6a28)',
> 'Watchers', 'RT::Group=HASH(0x7fbc5000f3f0)') called at
> /usr/local/share/perl5/HTML/Mason/Request.pm line 1302
>
> eval {...} called at /usr/local/share/perl5/HTML/Mason/Request.pm
> line 1292
>
> HTML::Mason::Request::comp(undef, undef, 'Label', 'AdminCc',
> 'QueueObj', 'RT::Queue=HASH(0x7fbc4feb6a28)', 'Watchers',
> 'RT::Group=HASH(0x7fbc5000f3f0)') called at
> /opt/rt4/local/html/Admin/Queues/People.html line 65
>
> HTML::Mason::Commands::__ANON__('GroupField', 'Name', 'UserOp',
> 'LIKE', 'GroupOp', 'LIKE', 'GroupString', '',
> 'Queue-AddWatcher-Principal-30', ...) called at
> /usr/local/share/perl5/HTML/Mason/Component.pm line 135
>
>
> HTML::Mason::Component::run('HTML::Mason::Component::FileBased=HASH(0x7fbc4feaff30)',
> 'GroupField', 'Name', 'UserOp', 'LIKE', 'GroupOp', 'LIKE', 'GroupString',
> '', ...) called at /usr/local/share/perl5/HTML/Mason/Request.pm line 1302*
> ***
>
> eval {...} called at /usr/local/share/perl5/HTML/Mason/Request.pm
> line 1292
>
> HTML::Mason::Request::comp(undef, undef, undef, 'GroupField',
> 'Name', 'UserOp', 'LIKE', 'GroupOp', 'LIKE', ...) called at
> /usr/local/share/perl5/HTML/Mason/Request.pm line 955
>
>
> HTML::Mason::Request::call_next('RT::Interface::Web::Request=HASH(0x7fbc4fa53370)',
> 'UserOp', 'LIKE', 'Queue-AddWatcher-Principal-30', 'AdminCc', 'id', 5,
> 'UserString', '', ...) called at /opt/rt4/local/html/Admin/autohan

[rt-users] Saving stuff in the session?

2012-07-20 Thread Paul Tomblin
I have a couple of web pages that are being installed as an extension
(along with Scrips and Actions etc).  I want to pass information from one
part of the web interface to another part of the web interface.  I thought
of using the session, having the mason code setting $session{'Clients'} =
"testing" and retrieving it in another mason file using
$RT::Logger->debug($session{'Clients'});, but it always giving me the error
"Use of uninitialized value $HTML::Mason::Commands::session{"Clients"}" in
my log file.  Is there another way of storing things in the session?

-- 
http://www.linkedin.com/in/paultomblin
http://careers.stackoverflow.com/ptomblin


Re: [rt-users] RT on Ubuntu 12

2012-06-21 Thread Paul Tomblin
On Thu, Jun 21, 2012 at 11:33 AM, Borngunners  wrote:
> Can't locate JSON.pm in @INC (@INC contains: /opt/rt4/sbin/../local/lib
> /opt/rt4/local/plugins/RT-Authen-ExternalAuth/lib /opt/rt4/sbin/../lib
> /etc/perl /usr/local/lib/perl/5.14.2 /usr/local/share/perl/5.14.2
> /usr/lib/perl5 /us

If you're missing JSON.pm, then you never ran "make testdeps" and
"make fixdeps" when you installed.

Go back and install it properly, following *all* the instructions.

-- 
http://www.linkedin.com/in/paultomblin
http://careers.stackoverflow.com/ptomblin


Re: [rt-users] RT on Ubuntu 12

2012-06-21 Thread Paul Tomblin
sudo apt-get install libplack-perl


On Thu, Jun 21, 2012 at 10:46 AM, Borngunners  wrote:
> This is the error log from apache2
>
> [Wed Jun 20 06:46:44 2012] [notice] Apache/2.2.22 (Ubuntu)
> PHP/5.3.10-1ubuntu3.2 with Suhosin-Patch mod_perl/2.0.5 Perl/v5.14.2 $
> [Wed Jun 20 17:18:25 2012] [error] [client 128.8.222.95] failed to resolve
> handler `Plack::Handler::Apache2': Can't locate Plack$
> [Wed Jun 20 17:20:56 2012] [notice] caught SIGTERM, shutting down
> [Wed Jun 20 17:21:18 2012] [notice] Apache/2.2.22 (Ubuntu)
> PHP/5.3.10-1ubuntu3.2 with Suhosin-Patch mod_perl/2.0.5 Perl/v5.14.2 $
> [Thu Jun 21 10:43:08 2012] [notice] caught SIGTERM, shutting down
> [Thu Jun 21 10:43:45 2012] [notice] Apache/2.2.22 (Ubuntu)
> PHP/5.3.10-1ubuntu3.2 with Suhosin-Patch mod_perl/2.0.5 Perl/v5.14.2 $
> [Thu Jun 21 10:43:57 2012] [error] [client 128.8.222.95] failed to resolve
> handler `Plack::Handler::Apache2': Can't locate Plack$
> [Thu Jun 21 10:44:00 2012] [error] [client 128.8.222.95] failed to resolve
> handler `Plack::Handler::Apache2': Can't locate Plack$
>
>
>
>
> -Original Message-
> From: 20/20 Lab 
> To: rt-users 
> Sent: Wed, Jun 20, 2012 6:20 pm
> Subject: Re: [rt-users] RT on Ubuntu 12
>
> --snip--
>   SetHandler perl-script is *not* recommended. SetHandler modperl is the
> documented configuration and is correct -kevin
> --snip--
>
> That's good to know.  I remember that from when I set it up, but
> couldn't get it to work.  It works now (since upgrading to 12 I
> assume).  Thanks.



-- 
http://www.linkedin.com/in/paultomblin
http://careers.stackoverflow.com/ptomblin


Re: [rt-users] Odd behavior, RT automatically reverts changes to Custom Fields

2012-06-14 Thread Paul Tomblin
On Thu, Jun 14, 2012 at 9:48 AM, Matthew W.  wrote:
> Here's some psuedocode (code not tested and may contain typos, but my
> code works just fine as I can see the transactions in the ticket
> history):
>
> my $Value = 'some value';
>
> my $CFName = 'customCF';
> my $CF->LoadByName( Name => $CFName);
>
> #Delete the old value:
> $self->TicketObj>DeleteCustomFieldValue(
>     Field => $CFName,
>     Value => $self->TicketObj->FirstCustomFieldValue($CFName)
> );
>
> #Set the new value:
> $self->TicketObj->AddCustomFieldValue( Field => $CF, Value => $Value);

When I call AddCustomFieldValue, I use the field *name* in Field,
rather than an actual CustomField class.  So I do things like
   $parent->AddCustomFieldValue("Field" => "custom_status", "Value" =>
$newStatus);
and that seems to work fine.


-- 
http://www.linkedin.com/in/paultomblin
http://careers.stackoverflow.com/ptomblin


Re: [rt-users] Callbacks not working

2012-06-13 Thread Paul Tomblin
On Wed, Jun 13, 2012 at 9:41 AM, Mark Collins  wrote:
> Yes - even after the mason cache has been cleared the callback isn't running.

If the callback has an error, it exits silently.  I found a couple of
problems like this by going into /opt/rt4/lib/RT.pm and adding
"Carp::click;" just before the "die $_[0];" in the $SIG{__DIE__}
handler.  (Obviously you don't want to leave that there permanently.)


-- 
http://www.linkedin.com/in/paultomblin
http://careers.stackoverflow.com/ptomblin


[rt-users] Slightly off-topic

2012-06-12 Thread Paul Tomblin
I have a need to access information in another database simultaneously
to the , so I cloned RT::Handle.pm into my own RTx::FooBar::Handle
that access the other database.  Now I'm testing this on my Linux box
and everything is running fine, but I copied it over to my MacBook Pro
in order to demo it to a client, but Postgres is complaining that it's
running out of database handles.  So I added a DESTROY method to my
RTx::FooBar::Handle that does a $self->dbh->disconnect.  I stuck a
call to $RT::Logger->debug in that DESTROY method just to make sure.
On the Linux box, it's definitely getting called and the debug is
printing out, but I wasn't running out of handles there so I don't
know if that's helping matters.  On the Mac, either it's not getting
called or the logger isn't working, and it's running out of handles
still.  Any suggestions?

-- 
http://www.linkedin.com/in/paultomblin
http://careers.stackoverflow.com/ptomblin


Re: [rt-users] Problem with interpretation of images

2012-06-06 Thread Paul Tomblin
On Wed, Jun 6, 2012 at 12:02 PM, Thomas Sibley  wrote:
> Make your plugin's images directory something that's not in core RT.
> You're running into an annoying Mason quirk involving autohandlers and
> multiple component roots, I believe.
>
> html/NoAuth/RT-Extension-Foo/images/autohandler
> html/NoAuth/RT-Extension-Foo/images/brushed-steel.jpg

I've encountered the same problem even if I put my image in
/opt/rt4/share/html/NoAuth/images, at least with the standalone
server.


-- 
http://www.linkedin.com/in/paultomblin
http://careers.stackoverflow.com/ptomblin


Re: [rt-users] Problem with interpretation of images

2012-06-06 Thread Paul Tomblin
On Mon, Jun 4, 2012 at 12:58 PM, Alexander Reintzsch
 wrote:
> Well, thanks for the idea. But autohandler doesn't work at all. Neither
> in share/html/NoAuth/images nor anywhere else. It's beeing ignored.
> I copied the picture, see attachment, into share/html/NoAuth/images and
> got the Mason-compiling error

It doesn't work because Mason attempts to compile the image as a Mason
file *before* it sees the autohandler. I think the only solution is to
take all the images outside the Mason environment.  Would adding a
`Alias /NoAuth/images/ /opt/rt4/share/html/NoAuth/images/` before the
DocumentRoot line do that?  I'm not really good with Apache
configuration.


-- 
http://www.linkedin.com/in/paultomblin
http://careers.stackoverflow.com/ptomblin


Re: [rt-users] Can't get images to load

2012-06-04 Thread Paul Tomblin
The mystery deepens.  I put some debugging into the autohandler in
/opt/rt4/share/html/NoAuth/images/autohandler:

<%INIT>
# This autohandler will spit out RT's images if the user hasn't
# properly configured their webserver to stop RT from passing
# images through the mason handler.
my $file = $m->base_comp->source_file;
my $relfile = $m->base_comp->path;
$RT::Logger->debug("autohandler file = $file, relfile = $relfile");
RT::Interface::Web->SendStaticFile( File => $file, RelativeFile => $relfile );


And when I try to load
http://localhost:8080/NoAuth/images/favicon.png, I see the following
come out in my log:
[Tue Jun  5 01:24:59 2012] [debug]: autohandler file =
/opt/rt4/share/html/NoAuth/images/favicon.png, relfile =
/NoAuth/images/favicon.png
(/opt/rt4/share/html/NoAuth/images/autohandler:7)
and the image shows up correctly.  But if I put my own image into that
directory and try to access it using the similar url
http://localhost:8080/NoAuth/images/foo.gif
I don't get any debug to indicate that the autohandler has been
called, and I get the following error

error:  Error during compilation of 
/opt/rt4/share/html/NoAuth/images/foo.gif:
Unrecognized character \x80; marked by <-- HERE after foo.gif"
6<-- HERE near column 1425 at /opt/rt4/share/html/NoAuth/images/foo.gif line 18.

Stack:
[/opt/rt4/share/html/NoAuth/images/foo.gif:18]
[/usr/share/perl5/HTML/Mason/Interp.pm:817]
[/usr/share/perl5/HTML/Mason/Interp.pm:458]
[/usr/share/perl5/HTML/Mason/Request.pm:249]
[/usr/share/perl5/HTML/Mason/Request.pm:212]
[/opt/rt4/sbin/../lib/RT/Interface/Web/Request.pm:62]
[/usr/share/perl5/Class/Container.pm:275]
[/usr/share/perl5/Class/Container.pm:353]
[/usr/share/perl5/HTML/Mason/Interp.pm:348]
[/usr/share/perl5/HTML/Mason/Interp.pm:342]
[/usr/share/perl5/HTML/Mason/PSGIHandler.pm:48]
[/usr/share/perl5/HTML/Mason/PSGIHandler/Streamy.pm:52]
[/opt/rt4/sbin/../lib/RT/Interface/Web/Handler.pm:263]
[/usr/share/perl5/Plack/Util.pm:315]
[/usr/share/perl5/Plack/Util.pm:315]
[/usr/share/perl5/HTTP/Server/PSGI.pm:185]
[/usr/share/perl5/HTTP/Server/PSGI.pm:134]
[/usr/share/perl5/HTTP/Server/PSGI.pm:62]
[/usr/share/perl5/Plack/Handler/HTTP/Server/PSGI.pm:14]
[/usr/share/perl5/Plack/Loader.pm:87]
[/usr/share/perl5/Plack/Runner.pm:263]
[/opt/rt4/sbin/rt-server:232]

It's a very great mystery to me.


-- 
http://www.linkedin.com/in/paultomblin
http://careers.stackoverflow.com/ptomblin


[rt-users] Can't get images to load

2012-06-04 Thread Paul Tomblin
I'm writing my code as an extension to make it easier to load on my
customer's development, test and production servers.  I'm trying to
add an ajax spinner, so I added it in my source directory
html/NoAuth/images/foo/ajax-spinner.gif, and it gets installed in
/opt/rt4/local/plugins/foo/html/NoAuth/images/foo/ajax-spinner.gif,
however when I try to load that file, I get the problem where Mason is
trying to interpret the file as source.  Now I just read something
about that yesterday or today, either here on the list or on IRC, but
I can't find the actual message.  But based on what I remembered, I
copied the autohandler from /opt/rt4/share/html/NoAuth/images/ into my
image directory, hoping that would make the gif load as a gif instead
of as a Mason file.  But it doesn't seem to be happening.  I even put
a $RT::Logger->debug line in the autohandler and it doesn't seem to be
executed.

I'm running the server in stand-alone mode, built using
./configure --enable-devel-mode --with-my-user-group --with-db-type=Pg
--with-web-handler=standalone,fastcgi
and started up with
/opt/rt4/sbin/rt-server --server Standalone --port 8080


-- 
http://www.linkedin.com/in/paultomblin
http://careers.stackoverflow.com/ptomblin


Re: [rt-users] Cross site request forgery?

2012-06-02 Thread Paul Tomblin
On Sat, Jun 2, 2012 at 4:04 PM, Paul Tomblin  wrote:
> But when I try to access this file as the source in my .autocomplete,
> it gets a 404.  I've tried it with a relative path and an absolute
> path, same results.

It would help, I suppose, if I were actually able to distinguish
between using upper case or lower case when comparing the name as I
wrote it in the javascript and as I wrote it in when I created the
file.  I feel like such an idiot now.


-- 
http://www.linkedin.com/in/paultomblin
http://careers.stackoverflow.com/ptomblin


[rt-users] Cross site request forgery?

2012-06-02 Thread Paul Tomblin
I'm trying to do a jquery autocomplete, but using my "other" database
rather than the RT database.  I created a web form in my extension's
own html/cf directory, which I can access.  I also put a autocomplete
file in html/cf/AutoComplete called "People", which looks a lot like
your Helpers/Autocomplete/Users:

% $r->content_type('application/json');
<% JSON( \@suggestions ) |n %>
% $m->abort;
<%ARGS>
$field => undef
$term => undef

<%INIT>
use RTx::FooBar::Records::Peoples;

$RT::Logger->debug("called AutoComplete/People");

my $people = RTx::FooBar::Records::Peoples->new(Handle => CFHandle());
$people->Limit(
FIELD   =>  $field,
OPERATOR=>  'LIKE',
VALUE   =>  '%'.$term.'%',
ENTRYAGGREGATOR =>  'AND');

my @suggestions
while (my $person = $people->Next)
{
  my $suggestion = { label => $person->$field, value => $person };
  push @suggestions, $suggestion;
}


I've already tested that my autohandler provides the correct CFHandle
to my database, and that RTx::FooBar::Records::Peoples returns the
correct rows when accessed like this.

But when I try to access this file as the source in my .autocomplete,
it gets a 404.  I've tried it with a relative path and an absolute
path, same results.
And if I try to access the url directly, I get this RT page that says
it's a possible cross-site request forgery.

What can I do to make this work?

-- 
http://www.linkedin.com/in/paultomblin
http://careers.stackoverflow.com/ptomblin


Re: [rt-users] emails on ticket updates not being sent in 4.0.6

2012-05-23 Thread Paul Tomblin
On Wed, May 23, 2012 at 11:09 AM, Thomas Sibley  wrote:
>> : `/usr/sbin/sendmail
>> -oi -t` exited with code 1 at
>> /opt/rt4/sbin/../lib/RT/Interface/Email.pm line 466.
>
> Exit code 1 isn't very useful, unfortunately.  Does this happen with
> every single mail RT tries to send?  Are there ever any other exit codes
> or errors?

Is it possible to change that command from "/usr/sbin/sendmail -oi -t"
to "/usr/sbin/sendmail -oi -t -v"?  Because that will cause postfix
(at least) to email some extra information to postmaster.

-- 
http://www.linkedin.com/in/paultomblin
http://careers.stackoverflow.com/ptomblin


Re: [rt-users] How do I override a default scrip?

2012-05-18 Thread Paul Tomblin
On Fri, May 18, 2012 at 11:51 PM, Bill Cole
 wrote:
> On 18 May 2012, at 17:40, Paul Tomblin wrote:
>
>> On Fri, May 18, 2012 at 3:47 PM, Bill Cole
>>  wrote:
>>>
>>> Another option is to modify the Global Scrip with a User Defined
>>> Condition
>>> that returns 0 if the Queue is one that you want to exempt.
>>
>>
>> How do I programmatically add one of these User Defined Conditions to
>> an existing RT Global Scrip?  (Preferably something that I can do in
>> my etc/initialdata)
>
>
> Ewww. Why???

Because I want to provide an extension that my client can install on
their RT installation, and when they type "make initdb" in the source
directory for my extension it adds all the things that are particular
to that extension to the RT system.  Just like the way literally
dozens of other extensions that I've looked at do it.


>
> With a running RT (i.e. a system where etc/initialdata has seen its single
> lifetime access) just go into the Scrip's definition
> (Configuration->Global->Scrips->$WhicheverOneYouAreChanging) and switch the
> "Condition" from whatever it is (e.g. "On Comment") to "User Defined" and
> put some suitable perl in the "Custom condition" text area. See

I don't want to have to log into their RT systems and configure them
for them.  I want them to be able to install it on as many or as few
RT systems as they want just by typing "make; make initdb; make
install" just like every other RT extension.


> With that caveat, I think it's not true that the way Scrips relate to Queues
> is inconsistent with Templates. Templates also are either Queue-specific or
> Global and point to their Queue by ID, rather than the Queue pointing to
> them by name. This is pretty much orthodox data structuring.

That is simply not true.  If I want to override the system provided
"Resolved" template for a particular queue, then all I have to do is
make a new template called "Resolved" on that queue.  It's referenced
by name, and only my new Resolved template will be used for that
queue.  If I want to override the behavior of the default "On Resolve
Notify Requestors" for a particular queue I can't just create a new
Scrip with the same name, because then it will run both Scrips.  There
is no definition of the word "consistent" which that fits the
definition of.


-- 
http://www.linkedin.com/in/paultomblin
http://careers.stackoverflow.com/ptomblin


Re: [rt-users] How do I override a default scrip?

2012-05-18 Thread Paul Tomblin
On Fri, May 18, 2012 at 5:40 PM, Paul Tomblin  wrote:
>  wrote:
>> Another option is to modify the Global Scrip with a User Defined Condition
>> that returns 0 if the Queue is one that you want to exempt.
>
> How do I programmatically add one of these User Defined Conditions to
> an existing RT Global Scrip?  (Preferably something that I can do in
> my etc/initialdata)

Oh wait, I could do that with an overlay, couldn't I?


-- 
http://www.linkedin.com/in/paultomblin
http://careers.stackoverflow.com/ptomblin


Re: [rt-users] How do I override a default scrip?

2012-05-18 Thread Paul Tomblin
On Fri, May 18, 2012 at 3:47 PM, Bill Cole
 wrote:
> Another option is to modify the Global Scrip with a User Defined Condition
> that returns 0 if the Queue is one that you want to exempt.

How do I programmatically add one of these User Defined Conditions to
an existing RT Global Scrip?  (Preferably something that I can do in
my etc/initialdata)


>
>
>> If I define a new
>> scrip with the same name as an existing one, it runs both of them.
>
>
> Yes, it does. Scrips are objects that point to Queues by ID, Queues are not
> objects that point to Scrips by name.

I'd just like to point out that's completely inconsistent with the way
Templates are done.


-- 
http://www.linkedin.com/in/paultomblin
http://careers.stackoverflow.com/ptomblin


[rt-users] How do I override a default scrip?

2012-05-18 Thread Paul Tomblin
How can I override a default scrip for a queue?  If I define a new
scrip with the same name as an existing one, it runs both of them.


-- 
http://www.linkedin.com/in/paultomblin
http://careers.stackoverflow.com/ptomblin


Re: [rt-users] Is there a shortcut to get the ticket creation comments in a template?

2012-05-17 Thread Paul Tomblin
On Thu, May 17, 2012 at 4:15 PM, Paul Tomblin  wrote:
> I'm currently using this:
>
> {
>        my $attachments = RT::Attachments->new(RT->SystemUser);
>        $attachments->LimitByTicket($ticket->id);
>        $attachments->Limit( ALIAS    => $attachments->TransactionAlias,
>                                                 FIELD    => 'Type',
>                                                 OPERATOR => '=',
>                                                 VALUE    => 'Create',
>                                                 ENTRYAGGREGATOR => 'OR',
>                                                 CASESENSITIVE   => 1
>                                           );
>
>        my $subject;
>        my $summary;
>        while (my $att = $attachments->Next) {
>          $subject = $att->Subject;
>          $summary = $att->Content;
>        }
>
>       $summary;
> }
>
> This is for intermediate reminders, not for the creation, so I can't
> use $Transaction->Content()


It looks like
{
$Ticket->Transactions->First->Content;
}

Does the same thing.  Cool.


-- 
http://www.linkedin.com/in/paultomblin
http://careers.stackoverflow.com/ptomblin


[rt-users] Is there a shortcut to get the ticket creation comments in a template?

2012-05-17 Thread Paul Tomblin
I'm currently using this:

{
my $attachments = RT::Attachments->new(RT->SystemUser);
$attachments->LimitByTicket($ticket->id);
$attachments->Limit( ALIAS=> $attachments->TransactionAlias,
 FIELD=> 'Type',
 OPERATOR => '=',
 VALUE=> 'Create',
 ENTRYAGGREGATOR => 'OR',
 CASESENSITIVE   => 1
   );

my $subject;
my $summary;
while (my $att = $attachments->Next) {
  $subject = $att->Subject;
  $summary = $att->Content;
}

   $summary;
}

This is for intermediate reminders, not for the creation, so I can't
use $Transaction->Content()

-- 
http://www.linkedin.com/in/paultomblin
http://careers.stackoverflow.com/ptomblin


[rt-users] Don't do default actions?

2012-05-16 Thread Paul Tomblin
If I don't want a default Scrip to run on a particular queue, is there
a way to stop it?  The only way I've found so far is to make a Overlay
that checks the queue, and either returns 0 or calls
SUPER::IsApplicable.  Is that the best way?


-- 
http://www.linkedin.com/in/paultomblin
http://careers.stackoverflow.com/ptomblin


Re: [rt-users] Getting Request Tracker to stick to HTTPS

2012-05-16 Thread Paul Tomblin
Further reading in RT_Config suggests you may need to look at this:

=item C<$CanonicalizeRedirectURLs>

Set C<$CanonicalizeRedirectURLs> to 1 to use C<$WebURL> when
redirecting rather than the one we get from C<%ENV>.

Apache's UseCanonicalName directive changes the hostname that RT
finds in C<%ENV>.  You can read more about what turning it On or Off
means in the documentation for your version of Apache.

If you use RT behind a reverse proxy, you almost certainly want to
enable this option.

=cut

Set($CanonicalizeRedirectURLs, 0);



On Wed, May 16, 2012 at 11:24 AM, Paul Tomblin  wrote:
> In RT_Config, it looks like you shouldn't even have to specify
> WebBaseURL - it appears to look to see if WebPort is 443 and changes
> it to https accordingly.
>
>
> On Wed, May 16, 2012 at 11:20 AM, Giles Coochey  wrote:
>> I have the following set up:
>>
>> Clients --> Squid SSL Offload / Caching Reverse Proxy (HTTPS--->HTTP) -->
>> Apache Routing Proxy (HTTP) --> RT (HTTP)
>>
>> RT (v4.0.5) itself is configured for HTTPS:
>>
>> Set($WebDomain, 'www.domain.net');
>> Set($WebPath, '/ticket');
>> Set($WebPort, 443);
>>
>> On going to Tools --> Configuration --> System Config I see that
>>
>> WebBaseURL is correctly listed as https://www.domain.net
>>
>> So if I navigate to https://www.domain.net/ticket/
>>
>> and Login then next page reverts to http...
>>
>> What do you think I might be missing??
>>
>> How can I force RT to HTTPS?
>>
>
>
>
> --
> http://www.linkedin.com/in/paultomblin
> http://careers.stackoverflow.com/ptomblin



-- 
http://www.linkedin.com/in/paultomblin
http://careers.stackoverflow.com/ptomblin


Re: [rt-users] Getting Request Tracker to stick to HTTPS

2012-05-16 Thread Paul Tomblin
In RT_Config, it looks like you shouldn't even have to specify
WebBaseURL - it appears to look to see if WebPort is 443 and changes
it to https accordingly.


On Wed, May 16, 2012 at 11:20 AM, Giles Coochey  wrote:
> I have the following set up:
>
> Clients --> Squid SSL Offload / Caching Reverse Proxy (HTTPS--->HTTP) -->
> Apache Routing Proxy (HTTP) --> RT (HTTP)
>
> RT (v4.0.5) itself is configured for HTTPS:
>
> Set($WebDomain, 'www.domain.net');
> Set($WebPath, '/ticket');
> Set($WebPort, 443);
>
> On going to Tools --> Configuration --> System Config I see that
>
> WebBaseURL is correctly listed as https://www.domain.net
>
> So if I navigate to https://www.domain.net/ticket/
>
> and Login then next page reverts to http...
>
> What do you think I might be missing??
>
> How can I force RT to HTTPS?
>



-- 
http://www.linkedin.com/in/paultomblin
http://careers.stackoverflow.com/ptomblin


[rt-users] Actions + Templates

2012-05-16 Thread Paul Tomblin
Can I build a string in an Action and access it somehow in the
template?  Can the template call a sub or access a variable from the
Action?


-- 
http://www.linkedin.com/in/paultomblin
http://careers.stackoverflow.com/ptomblin


[rt-users] Can't use html in ticket Create/Comment/Reply?

2012-05-15 Thread Paul Tomblin
I wanted to arrange some text in the Create data on a ticket I'm
creating programmatically into a nice neat table, and so I created it
as
my $mimeObj = MIME::Entity->build(
  Type => 'text/html',
  Charset => 'UTF-8',
  'Message-Id' => RT::Interface::Email::GenMessageId,
  Subject => "Change Request",
  Data => q?A Change Request has been submitted by RT Client1 (
ptomblin+rtclie...@xcski.com) for the following users
RT Client1 ( ptomblin+rtclie...@xcski.com)
RT Client2 ( ptomblin+rtclie...@xcski.com)
To make the following changes:
Add:Application 1 : Application
OneAdd:Application 2 : Application
TwoAdd:Application 3 : Application
ThreeAdd:Mobile 1?);

and when I dump it using $mimeObj->stringify it still has the html in
it, and I use that $mimeObj in the Ticket->Create, but when it shows
up on the basic ticket display the html appears to have been stripped.
 I've also tried putting  tags around it, and it doesn't help.

-- 
http://www.linkedin.com/in/paultomblin
http://careers.stackoverflow.com/ptomblin


[rt-users] Users.id and Groups.id

2012-05-07 Thread Paul Tomblin
I noticed that the database schema specifies different sequences for
the id fields in the users and groups tables.  However, it appears
that RT doesn't actually use those sequences - "select
currval('user_id_seq')" returns 1 even though I have a bunch of users
created.  The other thing I noticed is that the users.id and groups.id
don't have any common numbers - i.e. I've got users with ids 26, 28
and 32, and groups with ids of 27, 29 and 31.  Can I rely on that
being true, or is it just a coincidence?

-- 
http://www.linkedin.com/in/paultomblin
http://careers.stackoverflow.com/ptomblin


Re: [rt-users] ExtractCustomFieldValues, insert fixed value when match

2012-05-04 Thread Paul Tomblin
On Fri, May 4, 2012 at 6:11 AM, Joshua Laroff  wrote:

> my $cf = RT::CustomField->new($RT::SystemUser);
> $cf->LoadByName(Name => 'Customer');
>
> ...

>
> $self->TicketObj->AddCustomFieldValue(Field => $cf, Value => $result);
> return 1;
>

Actually, I think you can just pass the field name into AddCustomFieldValue
and cut out looking up the name yourself.  At least that's what I've been
doing and it appears to work.

-- 
http://www.linkedin.com/in/paultomblin
http://careers.stackoverflow.com/ptomblin


[rt-users] Wait, what?

2012-05-03 Thread Paul Tomblin
I'm seeing this on my console

[Thu May  3 23:06:29 2012] [warning]: DBD::Pg::st execute failed: ERROR:
 relation "tickets" does not exist
LINE 1: SELECT main.* FROM Tickets main  WHERE (main.Status != 'dele...
   ^ at
/usr/share/perl5/DBIx/SearchBuilder/Handle.pm line 509.
(/usr/share/perl5/DBIx/SearchBuilder/Handle.pm:509)
[Thu May  3 23:06:29 2012] [warning]: RT::Handle=HASH(0x848de00) couldn't
execute the query 'SELECT main.* FROM Tickets main  WHERE (main.Status !=
'deleted') AND (main.Queue = '4' AND  ( main.Status = 'new' OR main.Status
= 'open' OR main.Status = 'stalled' ) ) AND (main.EffectiveId = main.id)
AND (main.Type = 'ticket')  ORDER BY main.id ASC  LIMIT 1000' at
/usr/share/perl5/DBIx/SearchBuilder/Handle.pm line 522
DBIx::SearchBuilder::Handle::SimpleQuery('RT::Handle=HASH(0x848de00)',
'SELECT main.* FROM Tickets main  WHERE (main.Status != \'dele...') called
at /usr/share/perl5/DBIx/SearchBuilder.pm line 235
DBIx::SearchBuilder::_DoSearch('RT::Tickets=HASH(0x84808b0)') called at
/opt/rt4/sbin/../lib/RT/SearchBuilder.pm line 320
RT::SearchBuilder::_DoSearch('RT::Tickets=HASH(0x84808b0)') called at
/opt/rt4/sbin/../lib/RT/Tickets.pm line 2955
RT::Tickets::_DoSearch('RT::Tickets=HASH(0x84808b0)') called at
/usr/share/perl5/DBIx/SearchBuilder.pm line 503
DBIx::SearchBuilder::Next('RT::Tickets=HASH(0x84808b0)') called at
/opt/rt4/sbin/../lib/RT/Tickets.pm line 2927
RT::Tickets::Next('RT::Tickets=HASH(0x84808b0)') called at
/opt/rt4/sbin/../lib/RT/Tickets.pm line 2910
RT::Tickets::ItemsArrayRefWindow('RT::Tickets=HASH(0x84808b0)', 1000)
called at /opt/rt4/sbin/../lib/RT/Tickets.pm line 3441
RT::Tickets::_BuildItemMap('RT::Tickets=HASH(0x84808b0)') called at
/opt/rt4/sbin/../lib/RT/Tickets.pm line 3482
RT::Tickets::ItemMap('RT::Tickets=HASH(0x84808b0)') called at
/opt/rt4/share/html/Ticket/Display.html line 223
HTML::Mason::Commands::__ANON__('id', 19) called at
/usr/share/perl5/HTML/Mason/Component.pm line 135
HTML::Mason::Component::run('HTML::Mason::Component::FileBased=HASH(0x73ccba8)',
'id', 19) called at /usr/share/perl5/HTML/Mason/Request.pm line 1302
eval {...} called at /usr/share/perl5/HTML/Mason/Request.pm line 1292
HTML::Mason::Request::comp(undef, undef, undef, 'id', 19) called at
/usr/share/perl5/HTML/Mason/Request.pm line 955
HTML::Mason::Request::call_next('RT::Interface::Web::Request=HASH(0x7a0f408)')
called at /opt/rt4/share/html/Ticket/autohandler line 19
HTML::Mason::Commands::__ANON__('id', 19) called at
/usr/share/perl5/HTML/Mason/Component.pm line 135
HTML::Mason::Component::run('HTML::Mason::Component::FileBased=HASH(0x7724e60)',
'id', 19) called at /usr/share/perl5/HTML/Mason/Request.pm line 1302
eval {...} called at /usr/share/perl5/HTML/Mason/Request.pm line 1292
HTML::Mason::Request::comp(undef, undef, undef, 'id', 19) called at
/opt/rt4/sbin/../lib/RT/Interface/Web.pm line 548
RT::Interface::Web::ShowRequestedPage('HASH(0x7b76c60)') called at
/opt/rt4/sbin/../lib/RT/Interface/Web.pm line 295
RT::Interface::Web::HandleRequest('HASH(0x7b76c60)') called at
/opt/rt4/share/html/autohandler line 53
HTML::Mason::Commands::__ANON__('id', 19) called at
/usr/share/perl5/HTML/Mason/Component.pm line 135
HTML::Mason::Component::run('HTML::Mason::Component::FileBased=HASH(0x717e1c8)',
'id', 19) called at /usr/share/perl5/HTML/Mason/Request.pm line 1297
eval {...} called at /usr/share/perl5/HTML/Mason/Request.pm line 1292
HTML::Mason::Request::comp(undef, undef, undef, 'id', 19) called at
/usr/share/perl5/HTML/Mason/Request.pm line 481
eval {...} called at /usr/share/perl5/HTML/Mason/Request.pm line 481
eval {...} called at /usr/share/perl5/HTML/Mason/Request.pm line 433
HTML::Mason::Request::exec('RT::Interface::Web::Request=HASH(0x7a0f408)')
called at /usr/share/perl5/HTML/Mason/PSGIHandler.pm line 85
eval {...} called at /usr/share/perl5/HTML/Mason/PSGIHandler.pm line 85
HTML::Mason::Request::PSGI::exec('RT::Interface::Web::Request=HASH(0x7a0f408)')
called at /usr/share/perl5/HTML/Mason/Interp.pm line 342
HTML::Mason::Interp::exec(undef, undef, 'id', 19) called at
/usr/share/perl5/HTML/Mason/PSGIHandler.pm line 48
eval {...} called at /usr/share/perl5/HTML/Mason/PSGIHandler.pm line 48
HTML::Mason::PSGIHandler::invoke_mason('HTML::Mason::PSGIHandler::Streamy=HASH(0x3ab53f0)',
'HTML::Mason::FakeApache=HASH(0x7b34bd8)', 'HASH(0x84b04e8)') called at
/usr/share/perl5/HTML/Mason/PSGIHandler/Streamy.pm line 52
HTML::Mason::PSGIHandler::Streamy::__ANON__('CODE(0x84922a8)') called at
/opt/rt4/sbin/../lib/RT/Interface/Web/Handler.pm line 255
RT::Interface::Web::Handler::__ANON__('CODE(0x84922a8)') called at
/usr/share/perl5/Plack/Util.pm line 315
Plack::Util::__ANON__('CODE(0x84d5b38)') called at
/usr/share/perl5/Plack/Util.pm line 315
Plack::Util::__ANON__('CODE(0x84923b0)') called at
/usr/share/perl5/HTTP/Server/PSGI.pm line 185
HTTP::Server::PSGI::handle_connection('HTTP::Server::PSGI=HASH(0x3abc398)',
'HASH(0x7b5b450)', 'IO::Socket::INET=GLOB(0x8491ff0)', 'COD

Re: [rt-users] Deleting tickets recursively

2012-05-01 Thread Paul Tomblin
On Tue, May 1, 2012 at 9:45 AM, Paul Tomblin  wrote:

> recursiveDelete($child->id);
>

Never mind, figured it out.  That should be
"recursiveDelete($child->BaseObj->id);"

-- 
http://www.linkedin.com/in/paultomblin
http://careers.stackoverflow.com/ptomblin


[rt-users] Deleting tickets recursively

2012-05-01 Thread Paul Tomblin
I have a script that creates a ticket, then one or more child tickets of
that ticket in a different queue, and then one or more child tickets of
them in yet another queue.  I also wrote a test to call that script and
then verify that the expected tickets exist, etc.  However, when I try to
clean up at the end of the test, I have a sub that takes the top level
ticket and recurses down through the children trying to delete them, but
unfortunately only the top level one gets deleted.  Here's the code:


sub recursiveDelete {
my $ticketId = shift;

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

my $children = $ticket->Members;
while (my $child = $children->Next)
{
recursiveDelete($child->id);
}

$ticket->Delete;
}

I traced through it in the perl debugger, and the problem appears to be in
Ticket::SetStatus('deleted') where it calls $self->__Value('status') and it
returns 'deleted'.  So it thinks it's already deleted and doesn't change
the status.  Any suggestions why this is happening?

-- 
http://www.linkedin.com/in/paultomblin
http://careers.stackoverflow.com/ptomblin


Re: [rt-users] Creating a ticket with RT::Ticket->Create

2012-04-25 Thread Paul Tomblin
Thanks.  Found the code in RT/Interface/Web and adapted it like so:

# Get the Master Ticket's creation text
my $attachments = RT::Attachments->new(RT->SystemUser);
$attachments->LimitByTicket($ticket->id);
$attachments->Limit( ALIAS=> $attachments->TransactionAlias,
 FIELD=> 'Type',
 OPERATOR => '=',
 VALUE=> 'Create',
 ENTRYAGGREGATOR => 'OR',
 CASESENSITIVE   => 1
   );

my $mimeObj;

while (my $att = $attachments->Next) {
$mimeObj = MIME::Entity->build(
Type => 'multipart/mixed',
'Message-Id' => RT::Interface::Email::GenMessageId,
Subject => $att->Subject
);
$mimeObj->attach(
Type => $att->ContentType,
Charset => 'UTF-8',
Data => $att->Content);
$mimeObj->make_singlepart;
}

Thanks.

On Wed, Apr 25, 2012 at 1:45 AM, Ruslan Zakirov wrote:

> Create takes content as MIME::Entity object. Steal examples from Comment
> and/or MakeMimeEntity functions.
>
> Ruslan from phone.
> 24.04.2012 22:42 пользователь "Paul Tomblin"  написал:
>
> When I'm creating a ticket with RT::Ticket api, how do I set the text that
>> goes into the box that says ""Describe the Issue below"?  It appears to end
>> up as an attachment, and I can retrieve it from an existing ticket using
>>
>> my $attachments = RT::Attachments->new(RT->SystemUser);
>> $attachments->LimitByTicket($tik->id);
>>
>> foreach my $type (qw(Create Comment Correspond)) {
>>  $attachments->Limit( ALIAS=> $attachments->TransactionAlias,
>>  FIELD=> 'Type',
>>  OPERATOR => '=',
>>  VALUE=> $type,
>>  ENTRYAGGREGATOR => 'OR',
>>  CASESENSITIVE   => 1
>>);
>> }
>>
>> I tried adding it with $ticket->_CreateNote, but then I end up with two
>> "The RT System itself - Ticket created" records.
>>
>> --
>> http://www.linkedin.com/in/paultomblin
>> http://careers.stackoverflow.com/ptomblin
>>
>>


-- 
http://www.linkedin.com/in/paultomblin
http://careers.stackoverflow.com/ptomblin


[rt-users] Creating a ticket with RT::Ticket->Create

2012-04-24 Thread Paul Tomblin
When I'm creating a ticket with RT::Ticket api, how do I set the text that
goes into the box that says ""Describe the Issue below"?  It appears to end
up as an attachment, and I can retrieve it from an existing ticket using

my $attachments = RT::Attachments->new(RT->SystemUser);
$attachments->LimitByTicket($tik->id);

foreach my $type (qw(Create Comment Correspond)) {
$attachments->Limit( ALIAS=> $attachments->TransactionAlias,
 FIELD=> 'Type',
 OPERATOR => '=',
 VALUE=> $type,
 ENTRYAGGREGATOR => 'OR',
 CASESENSITIVE   => 1
   );
}

I tried adding it with $ticket->_CreateNote, but then I end up with two
"The RT System itself - Ticket created" records.

-- 
http://www.linkedin.com/in/paultomblin
http://careers.stackoverflow.com/ptomblin


Re: [rt-users] CustomFields in Scrip

2012-04-10 Thread Paul Tomblin
On Tue, Apr 10, 2012 at 12:12 PM, Ruslan Zakirov wrote:

> >> # Find the custom field "myCustom"
> >> my $myCustom =  $ticket->FirstCustomFieldValue("myCustom");
> >> $RT::Logger->debug("custom field = ". $myCustom);
> >>
> >> but it never gets the value.  Is there somewhere else I need to look for
> >> that custom field?  Is it in the TransactionObj instead?  Am I going to
> have
> >> to use TransactionBatch for this?
> >>
> > If anybody cares about this, yes, I had to use TransactionBatch.
>
> Status is set before custom field. Transaction batch delays scrip
> execution to the point where both changes are seen on the ticket.


What surprised me about this is that I didn't have to change the
RT::Condition or the RT::Action subclasses I used, I only had to enable
TransactionBatch in the config, and in initialdata (for this testing phase,
I clean the database and do another make initdb each time) add "Stage =>
'TransactionBatch'" to the @Scrips definition.


-- 
http://www.linkedin.com/in/paultomblin
http://careers.stackoverflow.com/ptomblin


Re: [rt-users] CustomFields in Scrip

2012-04-10 Thread Paul Tomblin
On Mon, Apr 9, 2012 at 3:35 PM, Paul Tomblin  wrote:

> I have a ScripAction that activates when a ticket is resovled.  If I set a
> custom field and resolve the ticket on the web site (
> http://localhost:8080/Ticket/Modify.html?id=1), I'm trying to pull out
> the new custom field value in the Scrip using
>
> # Find the custom field "myCustom"
> my $myCustom =  $ticket->FirstCustomFieldValue("myCustom");
>  $RT::Logger->debug("custom field = ". $myCustom);
>
> but it never gets the value.  Is there somewhere else I need to look for
> that custom field?  Is it in the TransactionObj instead?  Am I going to
> have to use TransactionBatch for this?
>
> If anybody cares about this, yes, I had to use TransactionBatch.

-- 
http://www.linkedin.com/in/paultomblin
http://careers.stackoverflow.com/ptomblin


[rt-users] CustomFields in Scrip

2012-04-09 Thread Paul Tomblin
I have a ScripAction that activates when a ticket is resovled.  If I set a
custom field and resolve the ticket on the web site (
http://localhost:8080/Ticket/Modify.html?id=1), I'm trying to pull out the
new custom field value in the Scrip using

# Find the custom field "myCustom"
my $myCustom =  $ticket->FirstCustomFieldValue("myCustom");
$RT::Logger->debug("custom field = ". $myCustom);

but it never gets the value.  Is there somewhere else I need to look for
that custom field?  Is it in the TransactionObj instead?  Am I going to
have to use TransactionBatch for this?
-- 
http://www.linkedin.com/in/paultomblin
http://careers.stackoverflow.com/ptomblin


[rt-users] Documentation for @CustomFields?

2012-04-01 Thread Paul Tomblin
I can't find any documentation for the @CustomFields initialization as used
in some extensions in etc/initialdata (or any of the others you can set
there, like @Queues).  I can't even find where that code is processed.  Any
hints?

-- 
http://www.linkedin.com/in/paultomblin
http://careers.stackoverflow.com/ptomblin


Re: [rt-users] Tests

2012-03-29 Thread Paul Tomblin
On Thu, Mar 29, 2012 at 4:54 AM, Tim Cutts  wrote:

> > Insecure dependency in require while running with -T switch at
> /opt/rt4/lib/RT/Config.pm line 904.
>
> That's the key line.  It looks like a conflict between using taint mode
> and the Config.pm file.  Try the test without taint mode on?  It doesn't
> really matter for a unit test, and RT is known not to work under taint mode
> anyway.


Ah yes, that cracked it.  I'm also going to try switching from Test:More to
RT:Test after I recover from my surgery.  Thanks.



-- 
http://www.linkedin.com/in/paultomblin
http://careers.stackoverflow.com/ptomblin


Re: [rt-users] Tests

2012-03-28 Thread Paul Tomblin
On Wed, Mar 28, 2012 at 6:52 PM, Joe Harris  wrote:

> In your script add:
>
> use libs /opt/rt4/lib/
>
> To see if for some reason your env vars  aren't seeing the RT path.
>
>
Turns out it's 'use lib qw{/opt/rt4/lib};', but it didn't seem to help.
 Thanks anyway.


-- 
http://www.linkedin.com/in/paultomblin
http://careers.stackoverflow.com/ptomblin


[rt-users] Tests

2012-03-28 Thread Paul Tomblin
Is it possible to do a perl unit test that uses the RT config file?  I
tried this is my test:

#!perl -T

use Test::More tests => 1;

use RT;

BEGIN {
RT::LoadConfig();
use_ok( 'RTx:FooBar' );
};

And I get some errors about being unable to use RT_SiteConfig.pm:
t/01-db.t . Couldn't load RT config file RT_SiteConfig.pm:

Insecure dependency in require while running with -T switch at
/opt/rt4/lib/RT/Config.pm line 904.
BEGIN failed--compilation aborted at t/01-db.t line 11.
# Looks like your test exited with 2 before it could output anything.
t/01-db.t . Dubious, test returned 2 (wstat 512, 0x200)

I've got RTHOME and PERL5LIB set so that it can find the RT installation
and libs.

-- 
http://www.linkedin.com/in/paultomblin
http://careers.stackoverflow.com/ptomblin


Re: [rt-users] Extensions

2012-03-28 Thread Paul Tomblin
On Wed, Mar 28, 2012 at 11:03 AM, Kevin Falcone
wrote:

> On Wed, Mar 28, 2012 at 10:58:03AM -0400, Paul Tomblin wrote:
> >Is there any documentation somewhere on how to package up the
> extensions - not how to write
> >them, but how to do the other stuff like the Makefile.PL and META.yml
> so that it installs. I
> >tried just copying the Makefile.PL and MANIFEST and META.yml from
> another project, but my html
> >files didn't copy over. (I'm just starting the project, so all I have
> to install is some html
> >mock-ups.)
>
> Several of us use Dist-Zilla-MintingProfile-RTx which will generate
> a Makefile.PL and some other boring parts of RT extensions. You also
> need Module-Install-RTx on your development box so that the pieces
> of the extension that know where to put files for RT are included in
> the tarball.
>
>
Ok, I installed Dist-Zilla-MintingProfile-RTx using "perl -MCPAN -e shell",
and it dragged in about a zillion required modules.  Now the dzil.org page
says that I use "dzil new" to create a new directory to get started, and I
just need to do "dzil  new RTx::FooBar", but I get a bunch of warnings:
dzil new   RTx::CareFirst
[DZ] making target dir
/home/ptomblin/src/rt-extension-carefirst/RTx-CareFirst
[DZ] writing files to
/home/ptomblin/src/rt-extension-carefirst/RTx-CareFirst
[DZ] guessing dist's main_module is lib/RTx/CareFirst.pm
[DZ] no license data in config, no %Rights stash, couldn't make a good
guess at license from Pod; giving up
[DZ] no license data in config, no %Rights stash, couldn't make a good
guess at license from Pod; giving up at
/usr/local/lib/perl/5.12.4/Moose/Meta/Method/Delegation.pm line 110

and then it creates a directory RTx-FooBar, and in that an empty dist.ini
file and skeleton lib/RTx/FooBar.pm.  I couldn't find any documentation on
how to generate this "%Rights stash" or config.

So instead I tried following the manual page on
http://search.cpan.org/~falcone/Dist-Zilla-MintingProfile-RTx-0.05/lib/Dist/Zilla/MintingProfile/RTx.pmand
so I tried
"dzil new -P RTx RTx::FooBar" and instead I got even more errors and
warnings:
[DZ] making target dir /home/ptomblin/src/rt-extension-carefirst/RTx-FooBar
[DZ] Unable to find main_module in the distribution
[DZ] We tried to guess 'lib/RTx/FooBar.pm' but no file like that existed
[DZ] Upon further inspection we didn't find any files in your dist, did you
add any?
[DZ] Cannot continue without a main_module
[DZ] No %User stash and no copyright holder; can't determine dist author;
configure author or a %User section
[DZ] No %User stash and no copyright holder; can't determine dist author;
configure author or a %User section at
/usr/local/lib/perl/5.12.4/Moose/Meta/Method/Delegation.pm line 110

and this time the RTx-FooBar directory is empty.  I feel like I'm trying to
learn how to swim, and I keep getting thrown into the shark tank.  Can
somebody please point me towards the shallow (non shark infested) end?



-- 
http://www.linkedin.com/in/paultomblin
http://careers.stackoverflow.com/ptomblin


[rt-users] Extensions

2012-03-28 Thread Paul Tomblin
Is there any documentation somewhere on how to package up the extensions -
not how to write them, but how to do the other stuff like the Makefile.PL
and META.yml so that it installs.  I tried just copying the Makefile.PL and
MANIFEST and META.yml from another  project, but my html files didn't copy
over.  (I'm just starting the project, so all I have to install is some
html mock-ups.)


-- 
http://www.linkedin.com/in/paultomblin
http://careers.stackoverflow.com/ptomblin


[rt-users] Is it possible to do a table join in a query?

2012-03-26 Thread Paul Tomblin
I would like to put a group name into a custom field, and then see only the
tickets in a certain queue where that group is a group that I belong to.  I
know how to do this from pgsql:

select t.*
from tickets t
join queues q on t.queue = q.id
join objectcustomfieldvalues ocfv on objecttype = 'RT::Ticket' and objectid
= t.id
join customfields on customfields.id = ocfv.customfield
join groups on groups.name = ocfv.content
join groupmembers on groupmembers.groupid = groups.id
where q.name = 'rtqueue1' and
customfields.name = 'group_assigned' and
groupmembers.memberid = 24 and
t.disabled = 0 and q.disabled = 0 and ocfv.disabled = 0;


but is it possible to do this sort of thing in a custom query?

-- 
http://www.linkedin.com/in/paultomblin
http://careers.stackoverflow.com/ptomblin