Re: [rt-users] Question about moving between queues

2012-01-26 Thread Allen
 in the log for the user is “Queue changed from General to”

That blank instead of Queue name probably means you have no rights to
see that queue, not even it's printed name. use the root RT user to
check that queue, group rights and see.

Allen

RT Training Sessions (http://bestpractical.com/services/training.html)
* Boston  March 5  6, 2012


Re: [rt-users] rt-mailgate

2012-01-23 Thread Allen
I tried several things to get the cert path into the environment for LWP,
none worked:

1. Adding this to /etc/fetchmailrc

   mda env PERL_LWP_SSL_CA_PATH=/etc/ssl/certs /usr/bin/rt-mailgate-4 ...

does NOT work to get the right cert to LWP through the environment:

root@web0:/etc# service fetchmail start
* Starting mail retriever agent:
  fetchmail:
starting fetchmail 6.3.19 daemon

  [ OK ]
root@web0:/etc# fetchmail: 1 message for [email address] at
[imapmailserver] (folder Support).
An Error Occurred
=

500 Can't connect to [RT webserver]:443
(certificate verify failed)


2. Adding this to fetchmailrc does not work either:

mda export PERL_LWP_SSL_CA_PATH=/etc/ssl/certs; /usr/bin/rt-mailgate-4
...


3. Adding this to /etc/default/fetchmail on Ubuntu where fetchmail runs
from an init script as a daemin does not work either:

export PERL_LWP_SSL_CA_PATH=/etc/ssl/certs


I am stuck with having to edit the rt-mailgate-4 on line 151 file like this:

#my $ua   = LWP::UserAgent-new();
my $ua   = LWP::UserAgent-new(ssl_opts = {SSL_ca_file =
'/etc/ssl/certs/7d3cd826.0'});

which I dont like because I will forget about it during upgrade.

A



On Mon, Jan 23, 2012 at 11:06 AM, Thomas Sibley t...@bestpractical.com
wrote:
 On 01/20/2012 02:38 PM, Robert Nesius wrote:
 I figured out a work around for this issue.  I was suspicious that
 LWP::UserAgent could not reach the cert for the CA that signed the cert
 being presented by the web server.  I learned there are some environment
 variables that I can leverage to influence where LWP::UserAgent looks
 even though it's being invoked down inside a program I don't want to
 touch.   Adding my /etc/ssl/certs directory to the list of directories
 examined for certs solved the problem.

 For what it's worth, the next release of RT will include a --ca-file
 option you can use to specify the specific cert.  It's equivalent to
 setting PERL_LWP_SSL_CA_FILE.

 *root@linux:/opt/rt4/bin# *export PERL_LWP_SSL_CA_PATH=/etc/ssl/certs

 If you'd like to submit a simple patch to rt-mailgate that also adds
 support for --ca-path, I'm sure we'd apply it.

 I do wonder why the OpenSSL library underlying the Perl library isn't
 finding your cert in /etc/ssl/certs like I'd expect it to.

 Thomas
 
 RT Training Sessions (http://bestpractical.com/services/training.html)
 * Boston  March 5  6, 2012

RT Training Sessions (http://bestpractical.com/services/training.html)
* Boston — March 5  6, 2012

Re: [rt-users] rt-mailgate

2012-01-23 Thread Allen
 We simply use mod_rewrite to redirect everyone *except* the server itself
 to https.  This way when rt-mailgate calls http://rt.ourdomain/com it is
 not forced to use https while everyone else is.


Thanks. That is an easy, maintainable solution until the next version of
rt-mailgate that will let us specify the cert path, or until OpenSSL 1.x
gets it's act together with LWP.

But doesn't work for me. I solved some kind of mod-perl/apache
redeclaration or some such problem (either spamming the logs or making
apache not start -- cant remember which) that I solved by removing all RT
apache configuration under regular http and just having the redirect to
SSL. The SSL virtualhost container has the RT configs in it.

A

RT Training Sessions (http://bestpractical.com/services/training.html)
* Boston — March 5  6, 2012

Re: [rt-users] rt-mailgate

2012-01-12 Thread Allen
pc  request-tracker3.6   3.6.7-5+lenny6 Extensible trouble-ticket
tracking system
pc  rt3.6-db-postgresql  3.6.7-5+lenny6 PostgreSQL database backend
for request-trac

p in first column means already marked for purging.
c in second column means configuration files from those are still present

try: dpkg --purge



 rt3.6-db-postgresql but it failed ...?
 www:/etc/ssl/certs# apt-get  remove  rt3.6-db-postgresql
 Reading package lists... Done
 Building dependency tree
 Reading state information... Done
 Package rt3.6-db-postgresql is not installed, so not removed
 0 upgraded, 0 newly installed, 0 to remove and 48 not upgraded.

 www:/etc/ssl/certs# apt-get  remove  request-tracker3.6
 Reading package lists... Done
 Building dependency tree
 Reading state information... Done
 Package request-tracker3.6 is not installed, so not removed
 0 upgraded, 0 newly installed, 0 to remove and 48 not upgraded.


 --Mark


RT Training Sessions (http://bestpractical.com/services/training.html)
* Boston  March 5  6, 2012


Re: [rt-users] rt-mailgate

2012-01-11 Thread Allen
On Tue, Jan 10, 2012 at 1:05 PM, Robert Nesius nes...@gmail.com wrote:
 500 Can't connect to
 request.domain.com:443 (certificate
 verify failed)

 /opt/rt4/bin/rt-mailgate: undefined server error

Yes, I got the same problem Monday after installing an Extended
Validation SSL certificate on the same Apache2 server as RT. RT is
accessible only over SSL using a wildcard cert, and some other
virtualhosts use the same wildcard cert. All the virtualhosts, RT
included, have the same IP address, which means the client needs to
understand TLS in order to get Apache to present to correct
certificate for the correct hostname.

When all the Virtualhosts used the same wildcard SSL cert, mailgate
worked fine. As soon as one of the Virtualhosts used a different cert,
mailgate fails with the above error to connect to RT to stuff the
message in.

This is on Ubuntu 11.10 Oneiric running reqest-tracker4 pinned with
apt preferences to Precise packages for version 4.0.4-1:

root@web0:/etc/logrotate.d# dpkg --list | grep reques
ii  request-tracker4                    4.0.4-1
        extensible trouble-ticket tracking system
ii  rt4-apache2                         4.0.4-1
        Apache 2 specific files for request-tracker4
ii  rt4-clients                         4.0.4-1
        mail gateway and command-line interface to request-tracker4
ii  rt4-db-sqlite                       4.0.4-1
        SQLite database backend for request-tracker4

I think something is wrong in the rt-mailgate-4 script that doesn't
understand TLS or when something happens and it gets a certificate
whose hostname does not match with the host that it is connecting to.

A

RT Training Sessions (http://bestpractical.com/services/training.html)
* Boston  March 5  6, 2012


Re: [rt-users] rt-mailgate

2012-01-11 Thread Allen
On Wed, Jan 11, 2012 at 11:22 AM, Izz Abdullah izz.abdul...@hibbett.com wrote:
 root@xxx:/var/www/servers# openssl verify -CApath /etc/ssl/certs/ 
 /usr/share/ca-certificates/mozilla/DST_ACES_CA_X6.crt
 /usr/share/ca-certificates/mozilla/DST_ACES_CA_X6.crt: OK


Yes, that is the same output I get when running the command.

The problem is that only rt-mailgate is having a problem figuring out
how to validate the SSL certificate that RT instance is using. All
browser clients validate it fine.

This thread from October 2011
http://www.gossamer-threads.com/lists/rt/users/106073 talks about
editting rt-mailgate to specifically name a root ca as an ssl_option
argument, but I really don't want to mess with the RT distribution and
feel I shouldn;t have to because it worked fine with the old wildcard
SSL cert, and browsers were able to figure out the new SSL cert
without trouble as well.

A

RT Training Sessions (http://bestpractical.com/services/training.html)
* Boston  March 5  6, 2012


[rt-users] RTx::BecomeUser for 4.x available

2011-11-16 Thread Allen
I posted a link to the updated BecomeUser extension on the wiki, but
here is a direct download:

http://cpan.perl.org/authors/id/C/CF/CFALLEN/RTx-BecomeUser-1.2_1.tar.gz

The old extension for for 3.8 and wouldn't work at all in 4.x. This
one is for 4.x only and will not work in 3.x.

Allen

RT Training Sessions (http://bestpractical.com/services/training.html)
*  Barcelona, Spain  November 28  29, 2011


[rt-users] RTx::BecomeUser extension working in RT4?

2011-11-10 Thread Allen
Anyone have the RTx::BecomeUser extension working under 4.0.0 or higher?

http://search.cpan.org/~abcdefgh/RTx-BecomeUser-1.0/lib/RTx/BecomeUser.pm

I see right away the page and navigation menu code in the extension is
not going to work with the new RT menu system. When I comment it out,
I can get the Becomeuser.html page to load, but choosing a user and
submitting just results in it saying Congratulations, you are now so
and so but the next RT page you visit, you are logged out.

I was going to take a blind stab at trying to fix it, but wanted to
know if anyone else did already.

Allen

RT Training Sessions (http://bestpractical.com/services/training.html)
*  Barcelona, Spain  November 28  29, 2011


Re: [rt-users] RTx::BecomeUser extension working in RT4?

2011-11-10 Thread Allen Lee
 Would be interested to know if you make any progress with this one -
 BecomeUser was a useful debugging tool in 3.xx

I got it working today and submitted it back to the CPAN maintainer. I
will give the code to anyone who asks but maybe you want to wait first
to see if he packages it up for us properly.

What I did was install the latest 1.10_2 version of the extension that
worked fine for RT3.8, and then just hacked the files under the local
plugin directory in a running instance of RT4 until it was working
again.

Allen

RT Training Sessions (http://bestpractical.com/services/training.html)
*  Barcelona, Spain  November 28  29, 2011


[rt-users] which template is this in error log?

2011-11-01 Thread Allen
I can't tell which Template has the perl code that threw an error in
my logfile.

Does [template:12] below refer to the template with a database id of
#12, like

http://rt/Admin/Global/Template.html?Queue=0Template=12

Do I have to hunt through all my templates looking at line 12? Where
do the lines in templates start? The first line including mail
headers? Or the first line of perl code?

Here is the log, how do I tell which template has the error?

:::

[Tue Nov  1 05:49:08 2011] [error]: Template parsing error: Can't call
method Id on an undefined value at template line 12.
Stack:  [template:12]
[/usr/share/request-tracker4/lib/RT/Template.pm:454]
[/usr/share/request-tracker4/lib/RT/Template.pm:410]
[/usr/share/request-tracker4/lib/RT/Template.pm:339]
[/usr/share/request-tracker4/lib/RT/Template.pm:319]
[/usr/share/request-tracker4/lib/RT/Action/SendEmail.pm:154]
[/usr/share/request-tracker4/lib/RT/Action/Autoreply.pm:66]
[/usr/share/request-tracker4/lib/RT/ScripAction.pm:226]
[/usr/share/request-tracker4/lib/RT/Scrip.pm:448]
[/usr/share/request-tracker4/lib/RT/Scrips.pm:234]
[/usr/share/request-tracker4/lib/RT/Transaction.pm:179]
[/usr/share/request-tracker4/lib/RT/Record.pm:1447]
[/usr/share/request-tracker4/lib/RT/Ticket.pm:669]
[/usr/share/request-tracker4/lib/RT/Interface/Email.pm:1496]
[/usr/share/request-tracker4/html/REST/1.0/NoAuth/mail-gateway:61]
(/usr/share/request-tracker4/lib/RT/Template.pm:449)

RT Training Sessions (http://bestpractical.com/services/training.html)
*  Barcelona, Spain  November 28  29, 2011


[rt-users] RT4 for ubuntu 11.10 will be out of date, how to get latest stable?

2011-10-12 Thread Allen
http://packages.ubuntu.com/oneiric/request-tracker4 shows they are
going to release Ubuntu 11.10 Oneiric with RT 4.0.1 instead of 4.0.2.

I want to upgrade our RT3.8.7 which runs on 10.04LTS but want to get
to the latest stable RT, not a version already months out of date. I
also prefer not to upgrade the OS off LTS right now if I don't have
to.

What is the best option for getting to the latest RT that will be the
least system administration?

1. Use apt preferences to pin request tracker to the stable
request-tracker4 package (v4.0.1) offered with Oneiric and suffer that
it is out of date ?

2. Add Debian Squeeze Backports source repository and install the
request-tracker4 package (v4.0.2) ?

Are there any problems / gotchas with installing a Debian backport on
an Ubuntu system?
http://packages.debian.org/en/squeeze-backports/request-tracker4

3. Manually install latest RT4 from source, configure, cpan, make
deps, fix deps ?

I am concerned that installing manually could end up putting some
software in one place, but that same software may already be installed
through the package system in some other place, creating conflicts or
errors when they get out of sync. Also, installing manually seems to
put much more burden on me personally for system maintenance and
updates when that work should just be done as a feature of the OS's
package system (apt-get update). Then later if the packages catch up
and I want to switch to them, I have all this duplicate manually
installed, untracked (and abandoned) software on the server.

With the first 2 options trying to install the latest RT on an OS that
is a year and a half old, am I just going to run into problems not
being able to install or update to newer software packages because
they are not going to be packaged for such an old OS? To get to the
newest RT by package, should I be upgrading the whole OS as well?

What are you other Ubuntu users planning to do to upgrade to or
install RT4 and why?

Allen

RT Training Sessions (http://bestpractical.com/services/training.html)
*  San Francisco, CA, USA  October 18  19, 2011
*  Washington DC, USA  October 31  November 1, 2011
*  Barcelona, Spain  November 28  29, 2011


Re: [rt-users] Survey Implementation for RT

2011-10-06 Thread Allen
 I think it will be nice to make an survey for a ticket or sth like that
 is sth planned for this or are there any extensions for it ?

Last recent list conversation I remember about this:

http://www.gossamer-threads.com/lists/rt/users/92599


A

RT Training Sessions (http://bestpractical.com/services/training.html)
*  San Francisco, CA, USA  October 18  19, 2011
*  Washington DC, USA  October 31  November 1, 2011
*  Barcelona, Spain  November 28  29, 2011


[rt-users] SelfService add more files in RT4 still doesn't work. Anyone have a patch?

2011-09-22 Thread Allen
When customers Reply on /SelfService/Update.html and try to attach
more than 1 file using the Add More Files button, clicking that
button submits the reply instead. It doesn;t do anything to allow
choosing more than 1 file to upload with the reply.

Similarly, when customers create a new ticket at
/SelfService/Create.html there is no option to attach multiple files
at all.

However, on the staff  side, (/Ticket/Update.html and
/Ticket/Create.html) uploading multiple files works fine.

Anyone have a patch for 4.0.2 to allow customers to upload multiple
attachments with their correspondence?

Allen

RT Training Sessions (http://bestpractical.com/services/training.html)
*  Chicago, IL, USA  September 26  27, 2011
*  San Francisco, CA, USA  October 18  19, 2011
*  Washington DC, USA  October 31  November 1, 2011
*  Melbourne VIC, Australia  November 28  29, 2011
*  Barcelona, Spain  November 28  29, 2011


Re: [rt-users] Updating RT_SiteConfig in RT4.0.2

2011-09-19 Thread Allen
 Probably filing a bug against request-tracker4 in launchpad would be a
 good way to start.

Anyone want to join in:

https://bugs.launchpad.net/ubuntu/+source/request-tracker4/+bug/854041

Allen

RT Training Sessions (http://bestpractical.com/services/training.html)
*  Chicago, IL, USA  September 26  27, 2011
*  San Francisco, CA, USA  October 18  19, 2011
*  Washington DC, USA  October 31  November 1, 2011
*  Melbourne VIC, Australia  November 28  29, 2011
*  Barcelona, Spain  November 28  29, 2011


Re: [rt-users] RT3.8 - RT4 Callback changes - Elements/Tabs/Default

2011-09-19 Thread Allen
Thank you, everyone.

Looks like the correct file location for me to make new global top
menu items is:

/opt/rt4/local/html/Callbacks/Default/Elements/Tabs/Privileged

I added one to the Tickets menu by substituting 'search' for 'tools'
in Mark's example code.

Allen

RT Training Sessions (http://bestpractical.com/services/training.html)
*  Chicago, IL, USA  September 26  27, 2011
*  San Francisco, CA, USA  October 18  19, 2011
*  Washington DC, USA  October 31  November 1, 2011
*  Melbourne VIC, Australia  November 28  29, 2011
*  Barcelona, Spain  November 28  29, 2011


Re: [rt-users] Updating RT_SiteConfig in RT4.0.2

2011-09-15 Thread Allen
 if any Ubuntu users would prefer 4.0.2 in 11.10, now would be a good time to 
 find an Ubuntu developer to sync this for you

I certainly would prefer that RT4.0.2 come with Ubuntu 11.10. What
does find an Ubuntu developer mean? Does it mean vote and make noise
in some issue tracking system? Or hire someone to fix the 4.0.1
packages?


Allen

RT Training Sessions (http://bestpractical.com/services/training.html)
*  Chicago, IL, USA  September 26  27, 2011
*  San Francisco, CA, USA  October 18  19, 2011
*  Washington DC, USA  October 31  November 1, 2011
*  Melbourne VIC, Australia  November 28  29, 2011
*  Barcelona, Spain  November 28  29, 2011


Re: [rt-users] RT3.8 - RT4 Callback changes - Elements/Tabs/Default

2011-09-15 Thread Allen
So is the answer to this question to continue to use Callback but with
the filename Privileged instead of Default ?

What is the code to make a new Menu item at the top of every page?


/opt/rt4/local/html/Callbacks/Default/Ticket/Elements/Tabs/Privileged

with

%INIT

Menu-child( new = title = b = path = /lalala?lala=1
);

/%INIT

does nothing.


The suggestion to look at JsGant extension is not that helpful because
they are just operating on what used to be the top tab menu items in
3.x. I want to add an item to the Tickets global menu item (what
used to be the left side nav in 3.x).

is PageMenu for the toptabs and Menu for the global menu?

The only other info I could find on this topic is
http://www.gossamer-threads.com/lists/rt/users/104918 and that isn;t
much to go on.

Could I have a code example of how someone has added something to the
global menu in 4.x?


Allen

RT Training Sessions (http://bestpractical.com/services/training.html)
*  Chicago, IL, USA  September 26  27, 2011
*  San Francisco, CA, USA  October 18  19, 2011
*  Washington DC, USA  October 31  November 1, 2011
*  Melbourne VIC, Australia  November 28  29, 2011
*  Barcelona, Spain  November 28  29, 2011


Re: [rt-users] MakeClicky does not handle html anchors correctly

2010-11-24 Thread Allen
 If you have set  Set(@Active_MakeClicky, qw(httpurl_overwrite));
 ...
 and the link location is http://en.wikipedia.org/wiki/HTML_anchor; ( the 
 anchor #Anchor is missing)

I put this in the local ./html/Elements/MakeClicky callback file:

name   = httpurl_overwrite,
#regex  = qr/$RE{URI}{HTTP}{-keep}{-scheme = 'https?'}/,
# negative lookbehind to allow unmodified img tag markup in combo with
ScrubHTML rules
regex  = qr@(?!
src=['])https?:([\w\/\...@\-~%#?=;,.:+\[\]\(\)]|\|\[\])+[\w\/]@,
action = url_overwrite,


Re: [rt-users] Searching with no case sensitivity?

2010-05-18 Thread Allen
 Is there an easy way to turn off case sensitivity for the search feature
 in RT 3.8.x?  I am using MySql as the database


Terrible, awful hack of DBIx::SearchBuilder.pm
(/usr/share/perl5/DBIx/SearchBuilder.pm) to transform the case
sensitive BLOB column to a case-INsensitive during WHERE clause
comparison:

line 991
+ $subclause =~ s/Attachments_[0-9]\.Content/CONVERT\($ Using latin1\)/;

If you use SearchBuilder for anything other than RT with MySQL, this
hack will break your stuff. But it will fix the RT searches to be case
insensitive. You will find tHisORThat when you search for
thisorthat

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


Re: [rt-users] RT Survey plugin

2010-04-01 Thread Allen
 On 29-03-2010 19:00, Todd Chapman wrote:
 You could just have the resolved template include a link to a survey
 monkey. http://www.surveymonkey.com/

In our organization, we don't include Transaction Content in the email
templates. So for us, a link to a survey in that email (which does not
include our actual reply to the ticket, just a notice to come see the
ticket in web SelfService) would not make sense.

Therefore, we have a local mod to SelfService/Display.html that will
offer unprivileged users a link to a survey when the ticket is in
resolved or autoclose status, and a customfield (applied to whichever
queues you want, and with Group perm SeeCustomField for Everyone)
flag is unset.

We chose to use a survey created in Google Docs instead of
surveymonkey because we already use Google Apps in our org. But Google
Surveys redirect people at the end to a dead-end Google page instead
of a configurable page, so we needed to alter the html supplied by the
Google Survey. We also needed a place to flip a switch on the RT
CustomField that flags whether the user has visited the survey, so we
know when to stop offering a link to it.

So, we wrapped the Google Survey in a PHP script. The link to that
script from the ticket carries the ticket ID in the querystring. So
the PHP script knows the Ticket ID. The survey asks for the ticket
number in the 3rd question, so appending entry_2=N to the url to the
google survey generates the form with N already filled in as the
answer to question #3.

We used file_get_contents() to get the html from Google and then
DOMxml functions to alter it, adding some code that you can find on
the web that targets the form to a hidden iframe in the page (to bury
google's dead-end thank you page) and javascript to then redirect
the user in the main window to the thank you page you want, which
for us is back to the ticket. We make sure that if the user was in RT
over SSL, they are redirected back to RT over SSL so they get back in
with the same session.

After the PHP wrapper fixes the html for the survey form, and before
displaying it to the user, it exec()'s the rt cli to set the
MySurvey customfield flag, signaling not to show the survey link on
that ticket anymore:

rt edit ticket/12345 set CF-MySurvey=1

In order to use the cli, we had to create another privileged user for
that purpose with Global perms to ShowTicket,ModifyTicket and local
perm SeeCustomField,ModifyCustomField for the MySurvey CF.

Having to make a new user and keep its password in the PHP wrapper is
kind of messy. It probably would have been better to add an AJAX call
in the wrapped survey form upon submit that would contact RT with the
user's existing session to flip that CF flag. I just didn't know where
to begin to make (or recycle) an RT page that would process such a
request to set a value for that customfield.


A

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


Re: [rt-users] Reports based on duration between open and update/closed

2010-03-24 Thread Allen
 Is there a way to get reports on how much time a ticket has been open?

I know this is not the sanctioned way to do things because it is not
using RT APIs, but it works for now:

# How many days have tickets been open:
SELECT id, EffectiveId, Created, Resolved, WEEK(Created) as week, Status,
   TO_DAYS(IF(Resolved != '-00-00 00:00:00' AND
Resolved != '1970-01-01 00:00:00',
  DATE(Resolved), CURDATE())) -
TO_DAYS(DATE(Created)) as days_open
FROM Tickets WHERE Queue = 5
 AND Type = 'ticket'
 AND
 (
 Status IN ('open','stalled','new','autoclose')
 OR
 (
 Status = 'resolved'
 AND Resolved  DATE_SUB(CURDATE(), INTERVAL 30 DAY)
 )
 )
ORDER BY id


# how many resolved per month
$sql = SELECT COUNT(id) as ct, LPAD(MONTH(Resolved), 2, '0') as mon,
YEAR(Resolved) as yr
FROM Tickets
WHERE Queue = 5
  AND Status = 'resolved'
  AND Resolved  DATE_SUB(CURDATE(), INTERVAL 180 DAY)
  AND Type = 'ticket'
GROUP BY yr,mon;

# how many created per month
$sql = SELECT COUNT(id) as ct, LPAD(MONTH(Created), 2, '0') as mon,
YEAR(Created) as yr
FROM Tickets
WHERE Queue = 5
AND Status NOT IN ('rejected', 'deleted')
AND Created  DATE_SUB(CURDATE(), INTERVAL 180 DAY)
AND Type = 'ticket'
GROUP BY yr,mon;


# how many resolved per day, per queue
$sql = SELECT COUNT(T.id) as ct, Q.Name as QueueName,
LPAD(DAYOFYEAR(T.Resolved), 3, '0') as dayresolved, YEAR(T.Resolved)
as year
FROM Tickets T
LEFT JOIN Queues Q on Q.id = T.Queue
WHERE T.Status = 'resolved'
AND T.Resolved  DATE_SUB(CURDATE(), INTERVAL 30 DAY)
AND T.Type = 'ticket'
GROUP BY dayresolved, T.Queue;

# how many created per day, per queue
$sql = SELECT COUNT(T.id) as ct, Q.Name as QueueName,
LPAD(DAYOFYEAR(T.Created), 3, '0') as daycreated, YEAR(T.Created) as
year
FROM Tickets T
LEFT JOIN Queues Q on Q.id = T.Queue
WHERE T.Created  DATE_SUB(CURDATE(), INTERVAL 30 DAY)
AND T.Status NOT IN ('rejected', 'deleted')
AND T.Type = 'ticket'
GROUP BY daycreated, T.Queue;

# status for unresolved tickets
$sql = SELECT COUNT(T.id) as ct, T.Status
FROM Tickets T
LEFT JOIN Queues Q on Q.id = T.Queue
WHERE Status NOT IN ('deleted', 'rejected', 'resolved')
AND T.Type = 'ticket'
GROUP BY T.Status;

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


[rt-users] patch for SelfService upload multiple files. any better?

2010-02-15 Thread Allen
I've noticed that the Reply form at /SelfService/Update.html does
not allow customers to submit multiple file attachments in a single
post like privileged users can do in /Ticket/Update.html

I have tried to patch the feature from Ticket/Update.html back into a
local SelfService/Update.html
A local SelfService/Display.html also needed patching because
Update.html now redirects there, like on the privileged side.

It seems to work, but I don't really know what I am doing.
Is it right? Does anyone do this better?


$ diff -u /usr/share/request-tracker3.8/html/SelfService/Update.html
Update.html
--- /usr/share/request-tracker3.8/html/SelfService/Update.html
2009-06-16 14:57:46.0 -0700
+++ Update.html 2010-02-11 17:41:08.0 -0800
@@ -51,7 +51,7 @@

 % $m-callback(CallbackName = 'BeforeForm', %ARGS, ARGSRef =
\%ARGS, Ticket = $Ticket );

-form action=Display.html method=post enctype=multipart/form-data
+form action=Update.html method=post enctype=multipart/form-data
 input type=hidden class=hidden name=UpdateType value=response /
 input type=hidden class=hidden name=id value=%$Ticket-Id% /
 table
@@ -91,28 +91,48 @@
 /td
 td class=value
 input name=Attach type=file /
+input type=submit class=button name=AddMoreAttach
value=|/lAdd More Files/ /
 input type=hidden class=hidden name=UpdateAttach
value=1 /
 /td
   /tr
 /table
  /Ticket/Elements/EditCustomFields,  TicketObj = $Ticket 
- /Elements/MessageBox,
-Name = UpdateContent,
-QuoteTransaction = $ARGS{QuoteTransaction}
-
+
+% if (exists $ARGS{UpdateContent}) {
+% my $temp = $ARGS{'QuoteTransaction'};
+% delete $ARGS{'QuoteTransaction'};
+ /Elements/MessageBox, Name=UpdateContent,
Default=$ARGS{UpdateContent}, IncludeSignature = 0, %ARGS
+% $ARGS{'QuoteTransaction'} = $temp;
+% } else {
+ /Elements/MessageBox, Name=UpdateContent, %ARGS 
+% }
 br /


- /Elements/Submit 
+ /Elements/Submit, Label = loc('Update Ticket'), Name = 'SubmitTicket' 
   /form

-
+!--  add this to get Hiztory on Reply screen --
+ /Ticket/Elements/ShowHistory,
+  Ticket = $Ticket,
+  URIFile = Display.html,
+  ShowHeaders = $ARGS{'ShowHeaders'},
+  DownloadableHeaders = 0,
+  AttachPath = Attachment,
+  Attachments = $attachments,
+  UpdatePath = Update.html
+

 %INIT

 my $Ticket = LoadTicket($id);

-$m-callback( Ticket = $Ticket, ARGSRef = \%ARGS, CallbackName =
'Initial' );
+# my @results;
+# $m-callback( Ticket = $Ticket, ARGSRef = \%ARGS, results =
\...@results, CallbackName = 'Initial' );
+
+# add this to get Hiztory on Reply screen
+my $attachments = $m-comp( '/Ticket/Elements/FindAttachments',
Ticket = $Ticket );
+

 my $title = loc( Update ticket #[_1], $Ticket-id );

@@ -123,7 +143,53 @@
   unless ( $Ticket-CurrentUserHasRight('ReplyToTicket')
 or $Ticket-CurrentUserHasRight('ModifyTicket') );

-$m-callback(CallbackName = 'BeforeDisplay', Ticket = \$Ticket,
ARGSRef = \%ARGS);
+
+# stolen from /Ticket/Update.html to process multiple attachments for 1 post
+# {{{ deal with deleting uploaded attachments
+foreach my $key (keys %ARGS) {
+if ($key =~ m/^DeleteAttach-(.+)$/) {
+delete $session{'Attachments'}{$1};
+}
+$session{'Attachments'} = { %{$session{'Attachments'} || {}} };
+}
+# }}}
+
+# {{{ store the uploaded attachment in session
+if ($ARGS{'Attach'}) {# attachment?
+my $attachment = MakeMIMEEntity(
+AttachmentFieldName = 'Attach'
+);
+
+my $file_path = Encode::decode_utf8($ARGS{'Attach'});
+$session{'Attachments'} = {
+%{$session{'Attachments'} || {}},
+$file_path = $attachment,
+};
+}
+# }}}
+
+# delete temporary storage entry to make WebUI clean
+unless (keys %{$session{'Attachments'}} and $ARGS{'UpdateAttach'}) {
+delete $session{'Attachments'};
+}
+# }}}
+
+$m-callback( TicketObj = $Ticket, ARGSRef = \%ARGS );
+my @results;
+
+#unless ( $ARGS{'AddMoreAttach'} ) {
+## Add session attachments if any to be processed by ProcessUpdateMessage
+#$ARGS{'UpdateAttachments'} = $session{'Attachments'} if (
$session{'Attachments'} );
+#
+## my @results, ProcessUpdateMessage(TicketObj = $Ticket,
ARGSRef   = \%ARGS  );
+## Cleanup WebUI
+#delete $session{'Attachments'};
+#}
+
+if ( exists $ARGS{'SubmitTicket'} ) {
+$m-callback(CallbackName = 'BeforeDisplay', Ticket = \$Ticket,
ARGSRef = \%ARGS);
+return $m-comp('Display.html', TicketObj = $Ticket, %ARGS);
+}
 /%INIT

 %ARGS


diff -u /usr/share/request-tracker3.8/html/SelfService/Display.html
Display.html
--- /usr/share/request-tracker3.8/html/SelfService/Display.html
2009-06-16 14:57:46.0 -0700
+++ Display.html2010-02-11 18:28:46.0 -0800
@@ -48,29 +48,11 @@
  /SelfService/Elements/Header, Title = loc('#[_1]: [_2]',
$Ticket-id, $Ticket-Subject) 

 % $m-callback(CallbackName = 'BeforeActionList', %ARGS, Actions =
\...@results, ARGSRef = \%ARGS, Ticket = $Ticket );
-
  /Elements/ListActions, actions 

[rt-users] how to customize Tools index.html with Callback

2010-02-02 Thread Allen
v3.8.5 on Ubuntu.

I am trying to customize the Tools/index.html page to add the same
item to both the Tab top horizontal navigation menu and to the
ListMenu of items in the body of the page.

By creating this local callback file, I was able to get an item into
the top nav tab:
/usr/local/share/request-tracker3.8/html/Callbacks/Default/Tools/Elements/Tabs/Default

%init
$tabs-{e} = { title   = 'Reset Customer Password',
   path= Tools/resetpasswdform.html,
   description = Form to email customer a new password };
/%init
%args
 $tabs =undef
/%args


The items list on the index page is basically an iteration through
the title/description of $tabs elements, but it does not show the new
item that I added through the callback.

Does anyone know why not? What else do I need to do?

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

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

2010 RT Training Sessions!
San Francisco, CA, USA - Feb 22  23
Dublin, Ireland - Mar 15  16
Boston, MA, USA - April 5  6
Washington DC, USA - Oct 25  26

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


Re: [rt-users] Make requester field blank on opening a ticket

2010-01-28 Thread Allen
 With a tiny hack in share/html/Create.html, grep for Requestors. I
 think it's abvious what you should delete there.

Copy share/html/Create.html to your local share/html/Create.html and
then edit the file there. If you don't know what I mean by local
directory, search the wiki to find out.

Change the script like this universal diff says:

 |/lRequestors/:
 /td
 td class=value colspan=5
- /Elements/EmailInput, Name = 'Requestors', Size = '40', Default
= $ARGS{Requestors} || $session{CurrentUser}-EmailAddress 
+ /Elements/EmailInput, Name = 'Requestors', Size = '40', Default
= $ARGS{Requestors} || '' 
 /td
 /tr

Save the file and restart the webserver.

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

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

2010 RT Training Sessions!
San Francisco, CA, USA - Feb 22  23
Dublin, Ireland - Mar 15  16
Boston, MA, USA - April 5  6
Washington DC, USA - Oct 25  26

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


[rt-users] How make Attachments sorted in ticket metadata

2010-01-21 Thread Allen
In the ticket metadata that can be rolled up or down on Display.html
is a section for listing File Attachments that have been put in the
ticket. To me, it seems that these files are not sorted in
alphabetical, date, transactionId or attachmentID order. Seems to be
in random order.

I am looking at Elements/ShowAttachments and Elements/FindAttachments
to see how I could force them to be sorted by creation date but can;t
figure it out. FindAttachments seems to send them up the chain in
order of AttachmentId, but as soon as they get into ShowAttachments'
%documents array, they are all jumbled up.

Does anyone know how to get the file Attachments listed in some kind of order?


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

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

2010 RT Training Sessions!
San Francisco, CA, USA - Feb 22  23
Dublin, Ireland - Mar 15  16
Boston, MA, USA - April 5  6
Washington DC, USA - Oct 25  26

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


Re: [rt-users] How to Search Resolved Tickets How to Backup RT DB?

2010-01-20 Thread Allen
  1.  How can I modify RT so that when I search in the ?quick search? box at 
 the top right of the page it searches all tickets, including resolved tickets?

The answer to that is in the wiki

  2.  What is the best way to backup the entire RT database, including 
 attachments, etc. Currently I am doing an export from phpMyAdmin but I don?t 
 believe that includes ticket attachments.

Assuming you use MySQL database with innodb tables, from a bash shell:

mysqldump --max_allowed_packet=64M --single-transaction rtdb  rtdb.sql

where rtdb is the name of your rt database.

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

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

2010 RT Training Sessions!
San Francisco, CA, USA - Feb 22  23
Dublin, Ireland - Mar 15  16
Boston, MA, USA - April 5  6
Washington DC, USA - Oct 25  26

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


Re: [rt-users] unprivileged users need to log in twice

2009-12-28 Thread Allen
The double login prompt for unprivileged users was originally reported
by on RT3.6.

However, I just experienced it on 3.8.4 (installed from Ubuntu Karmic
package) after applying the RT patch for 3.8.0 - 3.8.5.

I tested that I definitely had the bug, only with unprivileged users
(1st login resulted in same blank login form but at the /SelfService/
url instead of the original $WebPath url), and only had it after
applying the security patch.

I fixed it by removing a partial condition from a section of the patch:

+unless ($session{'CurrentUser'}  $session{CurrentUser}-id) {

became:

+unless ($session{'CurrentUser'}
+ #  $session{CurrentUser}-id
+ ) {

and now it works again.

Not sure what the consequence of this is, or if it is significant that
CurrentUser is enclosed in single quotes in one part of the condition
and none in the other.

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

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


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


Re: [rt-users] rtUnifiedreminder on 3.6

2009-12-04 Thread Allen
 Working on RT 3.6? It fails because it can't find the Config Class Method

I posted that script on the wiki and can vouch that it works on 3.8.4.
I wouldn't know what has to change to make work on 3.6. Probably just
some of the boilerplate lines of code.

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

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


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


Re: [rt-users] webkit browser lose session only when viewing Attachment

2009-12-03 Thread Allen
I found the reason for this problem. But don't know the correct solution.

The reason is that RT's runs from the /rt subdirectory on this server.
That subdirectory is where the authenticated session cookie applies.
When Webkit browser asks for /favicon.ico that is above the /rt
directory, therefore the login cookie is inapplicable there. So, RT
sends back a response with a new cookie.

The reason this happens on 1 of my servers and not the other is
because RT on the broken server is one of many NameBasedVirtualHosts.
So if the visitor is at this hostname, it hits RT, even if /rt was not
part of the REQUEST_URI. On my other server, it uses mod_vhost_alias
for all the domains, and RT is installed just as an Alias /rt. So on
that server when /favicon.ico is requested, the answer does not come
back from RT, but from one of the other mod_vhost_alias domains
because the Alias does not apply.

It seems I need some kind of rewrite rule in the Apache config to
handle people asking for /file instead of /rt/file

Or maybe just remove the Alias /rt
/usr/share/request-tracker3.8/html and other references to /rt in the
Apache configs and just let RT run at DocumentRoot instead of in a
subdirectory?

Anyone else running RT in a subdirectory of a NameBasedVirtualhost
with a suggestion?

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

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


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


Re: [rt-users] webkit browser lose session only when viewing Attachment

2009-12-03 Thread Allen
For future readers, to make it so that requests for objects above the
$WebPath directory (like /favicon.ico, when WebPath is /rt) do not
trash the current session, I changed the RT installation so that it
runs from the root directory of a subdiomain (rt.example.com) instead
of a subdirectory (example.com/rt).


Changes to Apache config files:

/etc/apache2/sites-available/rt.example.com:
insecure vhost container:
+ backwards compat for anyone with old links to subdir:
+ RewriteEngine on
+ RewriteCond %{REQUEST_URI} ^/rt(.*)
+ RewriteRule .* http://rt.example.com%1 [R]
- Alias /rt /usr/share/request-tracker3.8/html
- Location /rt/REST/1.0/NoAuth
+ Location /REST/1.0/NoAuth
same changes to secure vhost container except rewrite redirects to httpS

/etc/request-tracker3.8/apache2-modperl2.conf:
-RewriteRule ^/rt$ /rt/
-RewriteRule ^/rt/(.*)$ /usr/share/request-tracker3.8/html/$1
-Location /rt/REST/1.0/NoAuth
+Location /REST/1.0/NoAuth

/etc/request-tracker3.8/RT_SiteConfig.d/50-debconf
Set($WebPath , /rt);
Set($WebPath , );
___
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

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


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


[rt-users] webkit browser lose session only when viewing Attachment

2009-12-02 Thread Allen
Hello,

I have noticed that my Ubuntu install of RT 3.8.4 (but not my Debian
install of same) gives Chrome and Safari browsers a new session cookie
whenever they click an Attachment
(/rt/Attachment/[transactionId]/[attachmentId]/filename). So after a
logged-in user views an attachment, the cookie they have no longer
matches up with the one they were using to be considered logged-in.
Then any subsequent action results in a login prompt.

The logout problem does not happen when clicking any other links in
RT. Only the links to attachments kill the session.

I checked the MySQL session table to see what happened to the old
session and it is still there. I don;t know why RT issues a new one.
The a_session field is a longblob. I truncated the sessions table and
started again, but still the same. The same behavior occurs both
whether session is stored in MySQL or in 'Apache::Session::File' (with
RT Config for WebSessionClass).

I have watched my network with Wireshark and see that when Safari and
Chrome ask for the Attachment, the GET request includes the Cookie
header with the correct (logged in) cookie. The server response
returns the attachment without any cookie header, and then webkit
immediately asks to GET /favicon.ico, without any cookie header.
That's when the server replies back with a new cookie in a response
that contains the login page.

Firefox and Opera browsers don't have any problem at all with losing
their session after clicking an attachment.

Here's a little screencast that shows consistent session loss for
Safari and Chrome, only when clicking into an Attachment:

http://www.youtube.com/watch?v=JgKrL680xI8fmt=18

Any ideas on why this would happen? I have another Debian install of
3.8.4 that is almost identical to this Ubuntu one and don't get this
problem.

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

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


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


Re: [rt-users] Pruning email responses

2009-11-30 Thread Allen
There is a blog post about extending MakeClicky to go a Gmail-like
collapse/expand of things that look like inline quotes of previous
messages. It is here:

http://tylerlesmann.com/2008/nov/21/collapsible-quotes-request-tracker/

The thing that I didn't like about it is that it seemed to require
top posting in order to work,since everything after what looks like
the quote boundary becomes collapsed.

Even though you can control how your staff use RT (to trim out useless
quoted text), you can't really control your customers to do so. In my
organization, we changed the On Correspond scrip not to include the
transaction content, which forces the customer to login to the
SelfService Web UI in order to see what happened. There, the Reply
link that would normally quote a transaction has a local customization
not to do so. This way, we eliminated repetitive useless quoting.

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

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


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


[rt-users] Request for RT briefing/demo slide deck

2009-10-06 Thread Allen
 Has anybody briefed their employer about what/how RT works and why it is a 
 good option to move to this particular product?  I'm going to be giving a 
 briefing about RT tomorrow and am currently coming up with some slides 
 however if there is someone out there who wouldn't mind sending along what 
 they've already done it may help speed up the process.

 Thank you,
 Drew

Drew,

If your organization is handling issues for customers than you have to
have a management system that helps you accomplish all that work in an
organized manner. You could write it on paper, but software is better,
multiuser and more updateable. There are more expensive software that
you an buy, like Track It but RT is widely used by thousands of
orgs, many of them somewhat famous in their own right )MIT, NASA,
Merril Lynch, etc). And RT is open source, which means if you want to
change how it looks or works, it is not too hard to do.

If you are not using a tracking system now, then you are probably
wasting resources having multiple people work on the same issue at the
same time without knowing what each other is doing, answering people
for the same questions and maybe giving them different or
contradictory answers, wasting time waiting for some dealer person
to assign tasks to people instead of people being able to go see where
tasks are created and take them right away.

The first chapter of the RT Essentials O'Reilly book has a much more
in depth explanation of why any ticketing system is necessary when
more than a few people are trying to handle issues for more than a few
customers. Some of it can even be read online for free, just search
google. I asked my company to buy me one and they did.

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

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


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


Re: [rt-users] timeworked.pl requires every extension lib to be added?

2009-09-28 Thread Allen

 My original line pointed only to the root install of RT: /u/rtweb/rt38/
 lib in this case.


I also have a lot of plugins and this is the use lib line that was
needed to cover them all:

use lib qw(/usr/local/share/request-tracker3.8/lib
/usr/share/request-tracker3.8/lib);


That is for Ubuntu Server, where RT is installed by apt-get in
/usr/share/request-tracker3.8/ and the local customizations,
including plugins, are under /usr/local/share/request-tracker3.8

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

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


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


[rt-users] contrib HTML email reminder based on LastUpdated and status

2009-09-24 Thread Allen
Hello all,

I just contributed another reminder type script on the wiki:
http://wiki.bestpractical.com/view/rtUnifiedreminder

It is different from the other reminder scripts currently up there in
that the others all rely on either StartDate, DueDate or Priority in
order to work, and not all organizations make use of those fields.
Also, the existing ones only email the ticket owner and do so in
plaintext email.

This script notifies whoever you specify with HTML email about any
ticket where it has been too long since LastUpdated. Too long is
configurable and based on new/open/stalled status. It can be
configured to include or exclude specific queues.

The HTML email report is suitable for managers who want to know about
any ticket, and don;t care who owns it or what queue it's in. And
because it's HTML mail, they can click on the tickets and links to RT
searches right from the message.

Thanks to everyone on the list that has helped me in the past.

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

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


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


Re: [rt-users] Patched statdump/statcron scripts

2009-09-21 Thread Allen
 Does anyone still have a copy of this?

Dunno if you ever found it, but here's a tarball from 2006:

http://www.nabble.com/Patched-statdump-statcron-scripts-td2264154.html

BP wiki updated.

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

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


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


Re: [rt-users] list unprivileged users

2009-09-18 Thread Allen
 Has someone a config option, or AddOn for RT 3.8.2 that would allow to
 list ALL existing (including unprivileged) users via the gui,

The BecomeUser plugin will list all users, though it takes a while for
the page to load
http://search.cpan.org/~jpierce/RTx-BecomeUser/lib/RTx/BecomeUser.pm

After install, you get there by going to: Configuration, Tools, Become User
You need to the ShowConfigtab right to get there, I think.
___
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

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


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


[rt-users] contrib Censorware delete-transaction script errors

2009-08-27 Thread Allen
I am on 3.8.4 trying to use Jesse's delete-transaction script written
in 2001 from
http://download.bestpractical.com/pub/rt/contrib/3.0/Other/Censorware/delete-transaction

the purpose of the script is to edit a transaction to redact all info
from it (whether file Attachment, Comment, or Reply) for cases where
there was something posted that should not be in the ticket system.

After editting the 2 use lib statements at the beginning of the
script to reflect my actual paths to RT, and running the script, I got
an error like: Can't locate [some plugin] in @INC I fixed that
by adding a 3rd use lib line listing the local RTlib.

Now the script sort of runs - it wipes a transaction and creates a new
System Message transaction that says  Transaction 137302 purged, but
also pours out a pile of errors.

Afterward, the transaction Content is replaced with the text The
original content has been purged for the following reason, but the
$reason given as CLI argument is not included. Since the script does
alter at least 3 db rows, the first error message Mysql server has
gone away makes no sense to me.

Here are all the errors when the script runs. Does anyone know what
they mean or how to fix them?

r...@localhost# rt-delete-transaction 11260/137302 because was bad
Now deleting content and headers for attachment #82692
Now deleting content and headers for attachment #82693
Now deleting content and headers for attachment #82694
[Thu Aug 27 18:19:46 2009] [warning]: DBD::mysql::st execute failed:
MySQL server has gone away at
/usr/share/perl5/DBIx/SearchBuilder/Handle.pm line 505.
(/usr/share/perl5/DBIx/SearchBuilder/Handle.pm:505)
[Thu Aug 27 18:19:46 2009] [warning]: RT::Handle=HASH(0xb022c28)
couldn't execute the query 'SELECT  * FROM Tickets WHERE id = ?' at
/usr/share/perl5/DBIx/SearchBuilder/Handle.pm line 518
DBIx::SearchBuilder::Handle::SimpleQuery('RT::Handle=HASH(0xb022c28)',
'SELECT  * FROM Tickets WHERE id = ?', 11260) called at
/usr/share/perl5/DBIx/SearchBuilder/Record.pm line 1207
DBIx::SearchBuilder::Record::_LoadFromSQL('RT::Ticket=HASH(0xc2a1038)',
'SELECT  * FROM Tickets WHERE id = ?', 11260) called at
/usr/share/perl5/DBIx/SearchBuilder/Record.pm line 1126
DBIx::SearchBuilder::Record::LoadByCols('RT::Ticket=HASH(0xc2a1038)',
'id', 11260) called at
/usr/share/perl5/DBIx/SearchBuilder/Record/Cachable.pm line 119

DBIx::SearchBuilder::Record::Cachable::LoadByCols('RT::Ticket=HASH(0xc2a1038)',
'id', 11260) called at /usr/share/request-tracker3.8/lib/RT/Record.pm
line 350
RT::Record::LoadByCols('RT::Ticket=HASH(0xc2a1038)', 'id',
11260) called at /usr/share/perl5/DBIx/SearchBuilder/Record.pm line
1141
DBIx::SearchBuilder::Record::LoadById('RT::Ticket=HASH(0xc2a1038)',
11260) called at
/usr/share/request-tracker3.8/lib/RT/Ticket_Overlay.pm line 169
RT::Ticket::Load('RT::Ticket=HASH(0xc2a1038)', 11260) called
at /usr/share/request-tracker3.8/lib/RT/Transaction_Overlay.pm line
1039
RT::Transaction::Object('RT::Transaction=HASH(0xc2a6de0)')
called at /usr/share/request-tracker3.8/lib/RT/Transaction_Overlay.pm
line 942
RT::Transaction::CurrentUserHasRight('RT::Transaction=HASH(0xc2a6de0)',
'ShowTicket') called at
/usr/share/request-tracker3.8/lib/RT/Transaction_Overlay.pm line 963
RT::Transaction::CurrentUserCanSee('RT::Transaction=HASH(0xc2a6de0)')
called at /usr/share/request-tracker3.8/lib/RT/Transaction_Overlay.pm
line 921
RT::Transaction::_Value('RT::Transaction=HASH(0xc2a6de0)',
'Type') called at /usr/share/perl5/DBIx/SearchBuilder/Record.pm line
424
DBIx::SearchBuilder::Record::__ANON__('RT::Transaction=HASH(0xc2a6de0)')
called at /usr/share/request-tracker3.8/lib/RT/Ticket_Overlay.pm line
3186
RT::Ticket::DESTROY('RT::Ticket=HASH(0xc227f88)') called at
/usr/sbin/rt-delete-transaction line 0
eval {...} called at /usr/sbin/rt-delete-transaction line 0
(/usr/share/perl/5.10/Carp.pm:47)
[Thu Aug 27 18:19:46 2009] [crit]: HasRight called with no valid
object (/usr/share/request-tracker3.8/lib/RT/Principal_Overlay.pm:322)
[Thu Aug 27 18:19:46 2009] [warning]: DBD::mysql::st execute failed:
MySQL server has gone away at
/usr/share/perl5/DBIx/SearchBuilder/Handle.pm line 505.
(/usr/share/perl5/DBIx/SearchBuilder/Handle.pm:505)
[Thu Aug 27 18:19:46 2009] [warning]: RT::Handle=HASH(0xb022c28)
couldn't execute the query 'SELECT DISTINCT main.* FROM Scrips main
JOIN ScripConditions ScripConditions_1  ON ( ScripConditions_1.id =
main.ScripCondition )  WHERE (main.Queue = '1' OR main.Queue = '0')
AND (ScripConditions_1.ApplicableTransTypes LIKE '%Any%') AND
(main.Stage = 'TransactionBatch')  ORDER BY main.Description ASC ' at
/usr/share/perl5/DBIx/SearchBuilder/Handle.pm line 518
DBIx::SearchBuilder::Handle::SimpleQuery('RT::Handle=HASH(0xb022c28)',
'SELECT DISTINCT main.* FROM Scrips main JOIN ScripConditions ...')
called at /usr/share/perl5/DBIx/SearchBuilder.pm line 238

Re: [rt-users] Reporting: List of new/open tickets?

2009-08-27 Thread Allen
 anyone had written a reporting script that did something such as listing the 
 numbers and subjects of all open
 and new tickets Our PMs would like to have this info automated and emailed

Why not use the Dashboards that are already built into RT?

Click Tickets do create a search for new and open tickets (and
whatever other criteria). Save the search with Group permissions so
all the PMs can access it too. Then create a Dashboard using that
saved search, which all the PMs can subscribe to. Once a person is
subscribed to that Dashboard, they will get an email about it
regularly.

Before creating the saved search, you need the right perms to save for
a group. Use the RT root user if you're unsure. The PMs will each need
the SubscribeDashboard right too.

See http://blog.bestpractical.com/2009/02/rt-38-tutorial-dashboards.html


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

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


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


Re: [rt-users] Editing Comments or Replies

2009-08-26 Thread Allen
 We have a tool floating around on the website or the wiki that allows
 a systems administrator to censor a single transaction

Looks like that is here, but is old. Would it work in 3.8?

http://download.bestpractical.com/pub//rt/contrib/3.0/Other/Censorware/


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

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


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


Re: [rt-users] Contributed script: A time worked reporting tool

2009-08-21 Thread Allen
 I've attached a script I've developed over the summer to help me produce
 time worked reports for my staff.

Thanks for this. It's very nice.

It did put out a warning on my system, though:
[Fri Aug 21 18:30:08 2009] [warning]: Use of uninitialized value in
string eq at ./rt-timeworked.pl line 273. (./rt-timeworked.pl:273)

Looks like this line:  if (($tr-TimeTaken != 0) || ($tr-Field eq
'TimeWorked')) {

Thank you!

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

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


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


Re: [rt-users] Contributed script: A time worked reporting tool

2009-08-21 Thread Allen Lee
$ perl -e 'use lib /usr/share/request-tracker3.8/lib; use
RT::Transaction; print $RT::VERSION'
3.8.4

I think you are right that the warning is due to comparing string
against what is in the DB as NULL.

This fixed it for me:

Line 273:

- if (($tr-TimeTaken != 0) || ($tr-Field eq 'TimeWorked')) {
+ if (($tr-TimeTaken != 0) || ($tr-Field  $tr-Field eq 'TimeWorked')) {


Thank you again!


Allen Lee
Crystalfontz America, Incorporated
12412 East Saltese Avenue
Spokane Valley, WA 99216-0357
Twitter @Crystalfontz al...@crystalfontz.com http://www.crystalfontz.com
voice (509) 892-1200 fax (509) 892-1203 US toll-free (888) 206-9720



On Fri, Aug 21, 2009 at 1:09 PM, Fran Fabriziof...@cis.uab.edu wrote:

 Ok so it is complaining about an uninitialized value in the eq comparison
 $tr-Field eq TimeWorked.  Some transactions have NULL in the Field field
 in the database.  The question is when there is NULL in the database, what
 does RT::Transaction object return?  Maybe it's trying undef eq TimeWorked
 and throwing the warning.  The question is, why don't I see those?  What
 version of RT.pm are you using?

 What does:

  perl -e 'use lib /usr/local/rt/lib; use RT::Transaction; print
 $RT::VERSION'

 show?  (Of course, updating the /usr/local/rt/lib path).

 Maybe (off the wall, but) an older version of the RT::Transaction
 returns undef when NULL is read from the database, but the one I am using
 (3.8.2) returns '' or something?

 Allen Lee wrote:

 Hi,

 The script still worked fine.

 It looked like it was throwing that warning for every iteration of the
 loop. Below, it finds 1 tickets with Time Worked filled in, but more
 than 24 warnings are thrown:

 # rt-timeworked.pl --startdate 2009-08-15 --enddate 2009-08-22 --queues
 testy
 [Fri Aug 21 19:54:28 2009] [warning]: Use of uninitialized value in
 string eq at /usr/sbin/rt-timeworked.pl line 273.
 (/usr/sbin/rt-timeworked.pl:273)
 [Fri Aug 21 19:54:28 2009] [warning]: Use of uninitialized value in
 string eq at /usr/sbin/rt-timeworked.pl line 273.
 (/usr/sbin/rt-timeworked.pl:273)
 [Fri Aug 21 19:54:28 2009] [warning]: Use of uninitialized value in
 string eq at /usr/sbin/rt-timeworked.pl line 273.
 (/usr/sbin/rt-timeworked.pl:273)
 [Fri Aug 21 19:54:28 2009] [warning]: Use of uninitialized value in
 string eq at /usr/sbin/rt-timeworked.pl line 273.
 (/usr/sbin/rt-timeworked.pl:273)
 [Fri Aug 21 19:54:28 2009] [warning]: Use of uninitialized value in
 string eq at /usr/sbin/rt-timeworked.pl line 273.
 (/usr/sbin/rt-timeworked.pl:273)
 [Fri Aug 21 19:54:28 2009] [warning]: Use of uninitialized value in
 string eq at /usr/sbin/rt-timeworked.pl line 273.
 (/usr/sbin/rt-timeworked.pl:273)
 [Fri Aug 21 19:54:28 2009] [warning]: Use of uninitialized value in
 string eq at /usr/sbin/rt-timeworked.pl line 273.
 (/usr/sbin/rt-timeworked.pl:273)
 [Fri Aug 21 19:54:28 2009] [warning]: Use of uninitialized value in
 string eq at /usr/sbin/rt-timeworked.pl line 273.
 (/usr/sbin/rt-timeworked.pl:273)
 [Fri Aug 21 19:54:28 2009] [warning]: Use of uninitialized value in
 string eq at /usr/sbin/rt-timeworked.pl line 273.
 (/usr/sbin/rt-timeworked.pl:273)
 [Fri Aug 21 19:54:28 2009] [warning]: Use of uninitialized value in
 string eq at /usr/sbin/rt-timeworked.pl line 273.
 (/usr/sbin/rt-timeworked.pl:273)
 [Fri Aug 21 19:54:28 2009] [warning]: Use of uninitialized value in
 string eq at /usr/sbin/rt-timeworked.pl line 273.
 (/usr/sbin/rt-timeworked.pl:273)
 [Fri Aug 21 19:54:28 2009] [warning]: Use of uninitialized value in
 string eq at /usr/sbin/rt-timeworked.pl line 273.
 (/usr/sbin/rt-timeworked.pl:273)
 [Fri Aug 21 19:54:28 2009] [warning]: Use of uninitialized value in
 string eq at /usr/sbin/rt-timeworked.pl line 273.
 (/usr/sbin/rt-timeworked.pl:273)
 [Fri Aug 21 19:54:28 2009] [warning]: Use of uninitialized value in
 string eq at /usr/sbin/rt-timeworked.pl line 273.
 (/usr/sbin/rt-timeworked.pl:273)
 [Fri Aug 21 19:54:28 2009] [warning]: Use of uninitialized value in
 string eq at /usr/sbin/rt-timeworked.pl line 273.
 (/usr/sbin/rt-timeworked.pl:273)
 [Fri Aug 21 19:54:28 2009] [warning]: Use of uninitialized value in
 string eq at /usr/sbin/rt-timeworked.pl line 273.
 (/usr/sbin/rt-timeworked.pl:273)
 [Fri Aug 21 19:54:28 2009] [warning]: Use of uninitialized value in
 string eq at /usr/sbin/rt-timeworked.pl line 273.
 (/usr/sbin/rt-timeworked.pl:273)
 [Fri Aug 21 19:54:28 2009] [warning]: Use of uninitialized value in
 string eq at /usr/sbin/rt-timeworked.pl line 273.
 (/usr/sbin/rt-timeworked.pl:273)
 [Fri Aug 21 19:54:28 2009] [warning]: Use of uninitialized value in
 string eq at /usr/sbin/rt-timeworked.pl line 273.
 (/usr/sbin/rt-timeworked.pl:273)
 [Fri Aug 21 19:54:28 2009] [warning]: Use of uninitialized value in
 string eq at /usr/sbin/rt-timeworked.pl line 273.
 (/usr/sbin/rt-timeworked.pl:273)
 [Fri Aug 21 19:54:28 2009] [warning]: Use of uninitialized value in
 string eq at /usr/sbin/rt-timeworked.pl line 273.
 (/usr/sbin/rt-timeworked.pl:273

Re: [rt-users] RFC: Full ticket view when replying?

2009-08-18 Thread Allen
-- Jesse Vincent wrote:
  1) Add the ticket below the normal text box, sprip  recipient options
  2) Put the text box in-line as, for example, GMail does
 
  I find myself opening the ticket in another tab to cross-reference

 RT-AjaxyReplyPage in bps svn may be what you want

We also end up opening the Reply link in a new tab in order to refer
to the entire Correspondence history when composing a new Reply or
Comment, so we wanted the composition box on the same screen as the
rest of the History.

I installed the RT-AjaxyReplyPage plugin but honestly could not see
how in the world that plugin relates to this request. As far as I
could tell, that plugin only uses ahah to try to activate some form
choices immediately, without leaving the current page. In no way that
I could see does it show you all the Correspondence on the ticket on
the same screen as the compose box for a new message.

So, in order to show all History while composing in RT 3.8.4, I
copied html/Ticket/Update.html to a local file, and then around
line 161, after the /form tag that closes the PreviewScrips template
inclusion, I added:

 /Ticket/Elements/ShowHistory ,
  Ticket = $TicketObj,
  ShowHeaders = $ARGS{'ShowHeaders'},
  URIFile = 'History.html',
  Attachments = $attachments,
  AttachmentContent = $attachment_content


% $m-callback( %ARGS,
  CallbackName = 'AfterShowHistory',
  Ticket = $TicketObj,
  current_tab = 'Ticket/History.html?id=' .
$TicketObj-id );

and then inside the %INIT section, add these lines:

  my $attachments = $m-comp('Elements/FindAttachments', Ticket = $TicketObj);
  my $attachment_content = $m-comp('Elements/LoadTextAttachments',
Ticket = $TicketObj);

Then it will work for privileged users. If you want the same effect
for nonprivileged users in the /SelfService/ area, then you need to
copy html/SelfService/Update.html to a local file and add this in
between the closing /form tag and the opening %INIT tag:

 /Ticket/Elements/ShowHistory,
  Ticket = $Ticket,
  URIFile = Display.html,
  ShowHeaders = $ARGS{'ShowHeaders'},
  DownloadableHeaders = 0,
  AttachPath = Attachment,
  Attachments = $attachments,
  UpdatePath = Update.html


then add this line inside the %INIT section:

my $attachments = $m-comp( '/Ticket/Elements/FindAttachments',
Ticket = $Ticket );

now SelfService users will see History on same screen while replying.
___
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

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


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


Re: [rt-users] QueryBuilder: find where LastUpdatedBy 'unprivileged'

2009-08-13 Thread Allen
 (from Jerrad)
 It's not exactly the same, but what about where Last Updated  Told?

This looks like it would have done what I want, but Advanced screen
of QueryBuilder won't accept it. Upon Apply, I get the error:

Wrong query, expecting a VALUE in 'LastUpdated  Told--here'

 (from Ruslan)
 Try LastUpdatedBy.EmailAddress not like '@...'.

In version 3.8.4, QueryBuilder accepts this input, but it has no
effect on the search results. The search seems to execute but ignore
this clause. It does throw an error in the log for sub _EnumLimit:

[error]: Invalid Operation: LIKE for LastUpdatedBy at
/usr/share/request-tracker3.8/lib/RT/Tickets_Overlay.pm line 339.

 (from Raed)
 when we are waiting on a customer response we set a ticket status to stalled

Thanks for this, but I think we want to reserve the stalled status for
more atypical conditions that delay a ticket as opposed to normal
delay between correspondence. I see how you do use it though to find
the items where the ball is or is not in your court.

Any other ideas on how to employ the EmailAddress of the LastUpdatedBy
person, or how to compare LastUpdated to Told (QueryBuilder seems to
want a literal value for the comparison)?

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

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


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


[rt-users] QueryBuilder: find where LastUpdatedBy 'unprivileged'

2009-08-11 Thread Allen
We would like to make a Saved Search that will show us all tickets
where LastUpdatedBy was a client as opposed to one of our support
staff.

What would the correct TicketSQL be to get something like:

(Status = 'open' OR Status = 'new' ) AND (  Owner = '__CurrentUser__' ) AND
(
  LastUpdatedBy IS AN UNPRIVILEGED USER
  OR
  LastUpdatedBy.User.Email Not like '@ourdomain.com'
)

Is such a query possible in TicketSQL?

I searched the web and could only find an announcement of release
3.6.7 where one of the change notes was:

* add id to the list of users' properties you can search by [ruz]

but I don't know how one actually searches on a user's property in the
QueryBuilder.
___
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

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


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


[rt-users] thumb Preview PDF as PNG in ticket history?

2009-07-27 Thread Allen
Instead of a text link in ticket history for attached PDFs to
Download somefile.pdf, I would like to show these as thumbnail
images that preview the first page of the document, similar to how
regular attached images are shown in history.

Converting a PDF document into a PNG image seems easy with ImageMagick

convert -density 600x600 -resize 800x560 -quality 90 $file `echo
$file|cut -f1 -d'.'`.png

Does anyone know what code RT would need to make this change? I think
it might be another elseif at the end of
html/Tickets/Elements/ShowTransactionAttachments but don't have a clue
how to invoke the conversion and output the result.

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

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


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


Re: [rt-users] Signature for Reply only

2009-07-24 Thread Allen
 I'm looking for possibility to disable signature for comments and leave it
 enabled for replies only.

This way is working for me in 3.8.4.

Copy the distribution html/Elements/MessageBox from to the local
html/Elements directory. On Debian and Ubuntu, the local directory
(as installed by apt-get) is:

/usr/local/share/request-tracker3.8/html/Elements

In that file, you just add another condition to the spot where it
decides whether to insert a signature. The extra condition is and
$ARGS{'Action'} ne 'Comment'

Here is the patch:

 my $signature = '';
-if ( $IncludeSignature and my $text =
$session{'CurrentUser'}-UserObj-Signature and
- $ARGS{'Action'} ne 'Comment'
-) {
-
-# unnecessary to have sig in comment since it's internal only and the
name of the user is attached to the transaction
-
+if ( $IncludeSignature and my $text =
$session{'CurrentUser'}-UserObj-Signature ) {
$signature = -- \n. $text;
 }



From that old thread that you referenced

 http://www.gossamer-threads.com/lists/rt/users/42269#42269

I think his way would also work -- copying the distribution version of
Ticket/Update.html to the local Ticket/ directory and then changing
line 143 from

 /Elements/MessageBox, Name=UpdateContent, %ARGS 

to

 /Elements/MessageBox, Name=UpdateContent, IncludeSignature = 0, %ARGS 


You will need to restart webserver for either method to take effect.


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

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


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


[rt-users] where does local fckconfig.js go?

2009-07-15 Thread Allen
In January, a question was asked about where to put the local
version of fckconfig.js file (myFCKconfig.js with just your own local
changes so that you don't have to modify the distribution's
NoAuth/RichText/FCKeditor/fckconfig.js except for 1 line where you say
where the local file is).

http://www.nabble.com/UI-Patch---Add-whitespace-at-top-of-MessageBox-if-it%27s-a-reply-comment-td21720319.html

That thread never produced an answer for this issue, but the original
poster mentioned that putting it in
local/html/NoAuth/RichText/FCKeditor/fckconfig.js didn't work.

Should it go in local/html/NoAuth/js/ ?

Should the Distribution copy of fckconfig.js specify local config like this?:

FCKConfig.CustomConfigurationsPath = '/js/myFCKconfig.js'

Thanks,

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

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


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


[rt-users] Can Simple.html search Email OR Content (not AND) ?

2009-05-21 Thread allen+rtlist
Hi,

I would like to make it so that the Simple Search (3.8.2) will always
search Content, Requestor and Subject fields using LIKE comparisons so
that users won't need  to prepend fulltext: and email: (the latter
won't find partial email addresses) on search terms.

I have created a local overlay for html/Search/Simple.html which loads
a local lib/RT/Search/Googleish.pm and that has an altered QueryToSQL
function which bakes the search term into the pseudo-SQL:

( Content LIKE 'munchy' ) OR ( Requestor LIKE 'munchy' ) OR (
Subject LIKE 'munchy' )

The above gets fed deeper into RT SearchBuilder guts, until it comes
out in the mysql query log as this:

1WHERE (Transactions_1.ObjectType = 'RT::Ticket')
2AND (main.Status != 'deleted')
3AND (Users_5.EmailAddress LIKE '%munchy%')
4AND (
5(  ( Attachments_2.Content LIKE '%munchy%' )  )
6OR
7(  ( CachedGroupMembers_4.id IS NOT NULL )  )
8OR
9( main.Subject LIKE '%munchy%' )
10  )
11  AND (main.Type = 'ticket')
12  AND (main.EffectiveId = main.id)

So the final actual query is not what I asked for because there will
be zero results if the EmailAddress does not match. I want all results
where the Email OR Content OR Subject is LIKE the search term. If Line
3 above could be moved down after Line 4 and connected by OR then it
would work and find tickets.

I dug around and found something about EnteryAggregator in
lib/RT/Tickets_Overlay.pm but I don't know what to do next or how to
modify Googleish.pm to get the results I am looking for.

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

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


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


Re: [rt-users] Can Simple.html search Email OR Content (not AND) ?

2009-05-21 Thread allen+rtlist
 I would like to make it so that the Simple Search (3.8.2) will always
 search Content, Requestor and Subject fields using LIKE comparisons so
  and email: (won't find partial email addresses)

 Is email: some newfangled 3.8.2 thing?

Oops. Mixed up one of my attempted mods with how the stock install
works. No, you are right. There is no email: modifier for simple
search. I was trying to get it to search email addresses where the
user doesn't remember the full address -- like just searching for
'email:foo' when they can't remember 'f...@foo.com'

 To solve your latter problem of partial matches, you might try RTx::From
 http://search.cpan.org/~jpierce/RTx-From-0.02/lib/RTx/From.pm

Looking at the synopsis of that, cannot be meaningfully combined with
other search terms seems to mean that a person could not search for
from:foo bar and expect to find tickets that were from User foo
and/or had the word bar in them. Is that right? If so, I don't think
that is going to help me since my users are going to try to use other
terms as well.

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

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


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


Re: [rt-users] Can Simple.html search Email OR Content (not AND) ?

2009-05-21 Thread allen+rtlist
 This known issue that if email is not in the db then result would be
 empty even if condition is ORed with another, but believe me correct
 query will kick breath out of your DB server.


Are you saying that this known issue is a bug or is it intentional?

I know that with a ton of tickets, this kind of search everything is
not practical. But this will be a new RT deployment and I need to ease
the support staff (and the boss) into getting used to this new system.
Eventually I know they will find the QueryBuilder screen to be very
precise and great, but right now everything is new and different and
that screen scares them. They think it's too complicated.

That's why I'd like to get the WHERE EmailAddress like '%foo%' OR
'Content like '%foo%' OR'd together instead of having the EmailAddress
separated from the rest of the query by an AND.

Thanks,

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

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


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


Re: [rt-users] RT-Users Digest, Vol 62, Issue 43

2009-05-18 Thread allen+rtlist
 Date: Mon, 18 May 2009 01:36:03 -0700 (PDT)
 From: tommy0660
 Subject: [rt-users]  Notify new users about their login information

 Another thing I would want to implement is, that when a new user has been
 created, immediately after the creation the user should be informed via
 email to his email-address about his login information like:

There's a post that expands on that autogenerate password wiki article here:

http://lists.bestpractical.com/pipermail/rt-users/2009-May/058999.html

It talks about making autogenerated password notifications when new
tickets are created in the web interface (for instance, by your
support staff) as opposed to just by user emails. The wiki article
autogeneration only works when users create tickets by email.

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

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


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


Re: [rt-users] Autogenerating a password for requestors

2009-05-07 Thread allen+rtlist
 My bigger goal is to set up RT so that requestors get an email
 notifying them of their ticket id etc aftre creation. If they are new
 users, they should get a autocreated password.

 There is a page in the wiki on this
 http://wiki.bestpractical.com/view/AutogeneratedPassword

 This works when I submit a ticket via email.

 But I wasn't able to get template from AutogeneratedPassword
 to work. I guess, some of the values used in there do not apply to this
 later stage.

I noticed that the Autogeneratepassword template scrip offered in the
wiki works fine at creating and emailing a password to a new user who
just created a ticket by email, but it did not seem to do the same
when a privileged user manually created a ticket in the RT web
interface.

The reason it didn;t is because in that case, the Transaction
CreatorObj is the privileged user, not the new user. Therefore, the
scripted tests that determine whether to set a password fail and the
whole set password script is skipped.

I (think) I fixed this by changing the Autoreply Templat script to be like so:

--- begin Autoreply template ---

Greetings,

Your support ticket [{$Ticket-QueueObj-SubjectTag || $rtname}
#{$Ticket-id()}] regarding:

{$Ticket-Subject()}

has been created, and a summary appears below.

Please check the history and progress of all your tickets and
communicate with our staff about your issue by logging in to the
web-based ticket system at:

{
*RT::User::GenerateRandomNextChar = \RT::User::_GenerateRandomNextChar;

# CHANGED NEXT 3 LINES TO TEST REQUESTOR INSTEAD OF CREATOR
# SO THAT WILL EMAIL REQUESTOR A PASSWORD WHEN STAFF CREATES
# THE TICKET IN WEB INTERFACE

#if (($Transaction-CreatorObj-id != $RT::Nobody-id) 
#   (!$Transaction-CreatorObj-Privileged) 
#($Transaction-CreatorObj-__Value('Password') eq '*NO-PASSWORD*')

if (($Ticket-Requestors-UserMembersObj-First-Id() != $RT::Nobody-id) 
(!$Ticket-Requestors-UserMembersObj-First-Privileged) 
($Ticket-Requestors-UserMembersObj-First-__Value('Password')
eq '*NO-PASSWORD*')
)
{
my $user = RT::User-new($RT::SystemUser);
#   $user-Load($Transaction-CreatorObj-Id);
$user-Load($Ticket-Requestors-UserMembersObj-First-Id());
my ($stat, $pass) = $user-SetRandomPassword();

if (!$stat)
{
$OUT .=

An internal error has occurred. RT was not able to set a password for you.
Please contact your local RT administrator for assistance.;

}

use URI::Escape;

$OUT .= . $RT::WebURL.SelfService/?user=.
uri_escape($user-Name).pass=. uri_escape($pass).

Your username and password for the ticket system are:

Username: .$user-Name.
Password: .$pass.

You may change the password after you login if you wish.;
}
else
{
$OUT .= . $RT::WebURL .Ticket/Display.html?id=. $Ticket-id();
}
}

This is an automated message. Please do not reply.

Thank you,
{$Ticket-QueueObj-CorrespondAddress()}

-

{$Transaction-Content()}

--- end Autoreply template ---


I don;t know if that is right or proper, but it seems to work.

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

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


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


[rt-users] stop strangers from emailing other people's tickets

2009-05-04 Thread allen+rtlist
Running into a problem where a bad person (unprivileged and unknown
by RT) can send an email to the RT system with someone else's ticket
ID in the subject. RT will recognize the (guessed) ticket ID, and
permanently append the message (which may contain spam or nastiness)
to somebody's ticket, even though the sender is not a valid party
listed on the ticket.

So some troublemaker can send 1 email with a random ticket ID, or
100,000 emails with all possible ticket ids and attack users' tickets.

We want to allow people to create tickets by email and we do want RT
users to be automatically created if they don't already exist. Is
there a way, though, to deny permission for unprivileged users to
reply to a ticket unless they are the Requestor or Cc?

I have set Group Rights this way:

   Everyone: CreateTicket, ModifySelf
   Unprivileged: none
   Privileged: [many, including ReplyToTicket]
   Requestor: ReplyToTicket, SeeQueue, ShowTicket

but the above permissions do not seem to make any difference in the
ability of strangers being able to pollute random tickets with
messages.

It also seems that if an attacker forged his From address to appear to
come from one of our privileged email addresses (like
supp...@yourdomain), a permissions-only approach would not really make
much of a barrier.

Should some combination of permissions be able to work, or does
preventing this abuse require a Scrip?

Do any of you with RT installations ever run into situations where
someone mail bombs or attacks your users' tickets by email in this
way?

What advice can you give?

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

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


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


Re: [rt-users] RT Email config for Google Apps

2009-05-01 Thread Allen Lee
   1. RT Email config for Google Apps (Vincent Beau)

You could use Google Apps to create a mailbox (like rt) on Google's
servers. Then the RT's email address would be r...@yourdomain. Then
login to that mailbox on G-Apps and create some filters so that mail
sent to different queues would be labelled differently. If you have a
support queue, for example, set a filter at Google so that all mail
sent to rt+supp...@yourdomain will have the actions Skip Inbox and
Label : Support. Mail sent to rt+support-comm...@yourdomain will
have the actions Skip Inbox and Label : Support-Comment.

Then go into the Settings of the rt user's G-Apps account and enable
IMAP service.

Then run fetchmail as a daemon on your linux server where RT is
installed. Your /etc/fetchmailrc file might look like this:

set daemon 60
set invisible
set no bouncemail
set no syslog
set logfile /var/log/fetchmail

poll imap.gmail.com
proto IMAP service 993 user r...@yourdomain pass YOURPASSWORD
folder Support ssl
mda /usr/bin/rt-mailgate --url http://YOUR-RT-URL/rt --queue
Support --action correspond

poll imap.gmail.com
proto IMAP service 993 user r...@youdomain pass YOURPASSWORD
folder Support-Comment ssl
mda /usr/bin/rt-mailgate --url http://YOUR-RT-URL/rt --queue
Support --action comment

You would have a pair of poll config lines like that above for each
Queue. Those lines would be for your Support queue and you replace
the things in ALLCAPS with your appropriate things.

Doing this way lets all the mail pile up at Google, then your RT just
goes and sucks down the appropriate unread messages into each queue
every minute, creating a ticket for each one and leaving the read
messages on the G-Apps servers.
___
http://lists.bestpractical.com/cgi-bin/mailman/listinfo/rt-users

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


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


[rt-users] Request Tracker with sSMTP

2008-12-09 Thread Allen Chen
Hi, I am trying to configure rt with sSMTP. I couldn't find any
documentation on this anywhere...Is this possible? If so, how?

Thanks

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

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


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


[rt-users] RT Password

2008-11-14 Thread Allen Chen
Hi,

Sorry if this is a newbie question. I just got rt installed on my
system. I was able to log in through apache and play around with it.
Then I changed something and now I can't log back in. It says that my
root password is incorrect. I've tried every password I could think of
putting in, including the default 'password' but it didn't recognize
anything. I've removed and reinstalled rt3 and mysql but that didnt
change anything. Where can I find where the password is set or stored?

Thanks,
Allen

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

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


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


[rt-users] New to rt, sendmail

2008-11-13 Thread Allen Chen
Hi,

I seem to be having a lot of trouble setting up the email configuration.
I actually don't really seem to know what's going on... Does the server
which rt is set up on have to be a webserver w/ a domain name? I looked
into some webservers and it seemed that they wouldn't let me install rt
on it. I set up rt on a local server, and was able to get apache to
work. When I started a new ticket i received an email to myself from
The default queue via RT [EMAIL PROTECTED]. How do I send email
back to rt? Where do I change example.org?

Thanks,
Allen

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

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


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


[rt-users] Intermittent slow logins on RT 3.6.3

2008-06-30 Thread Allen Chen

Hi everyone,

We're running RT 3.6.3 on PostgreSQL 8.0.12 and while we've always had 
some intermittent performance issues, it has gotten especially bad in 
the past few weeks.  There are a number of actions that are very slow 
for us, but particularly bad is the amount of time it takes to log in.  
It just took me 136 seconds to log in and display the Home page.  
However, if I refresh the Home page while logged in, it only takes 
about 18 seconds.


Here's a mini time line to illustrate a typical login:

   0. Enter username and password and click submit

   1. Immediately afterwards, I see the following in rt.log:
  [Mon Jun 30 21:11:53 2008] [info]: Successful login for allen
   from ... (/var/www/localhost/htdocs/rt/autohandler:256)

   2. 95 seconds later, the login page disappears and the home page
   starts to display

   3. At 136 seconds, the home page is complete

I have set logging in RT to 'debug' so I can see the timing on all the 
queries being executed.  The slowest query generated during that last 
login attempt took 2.50 seconds.  Watching top and iostat on the 
Apache+mod_perl running RT shows a load average around 0.01, CPU 
utilization between 0 and 5%, and disk I/O at 1%.  Watching top and 
iostat on the DB server also shows that it is nowhere near maxed out.


This problem is intermittent (sometimes it will only take an acceptable 
20 seconds to log in); however, it seems to be slow more often than 
not.  There also seems to be a lot of variance in how slow it gets.  
Sometimes it takes 40 seconds, sometimes over two minutes.


It seems like RT is doing something after authentication and before 
building the home page that makes logins slow.  I have a feeling it 
might be database related, but I cannot find any evidence of any slow 
queries in rt.log.  Could there be any queries that RT executes that 
would not show up in rt.log for some reason?  Also, I have checked 
pg_locks when this is happening but do not see any exclusive locks that 
would cause any queries to wait.  (Note that I /have/ found slow RT 
queries, but not ones associated with logging in.)


Are there any bugs in 3.6.3 that would cause this?  Can anyone suggest 
anything else I should look at or try?


Thanks much,
-Allen

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

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


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

[rt-users] Error when trying to use custom field in a ticket transaction in RT 3.6

2008-06-09 Thread Allen Rapini
I have a test install of RT, and I am attempting to resolve a repeatable
error with custom field behavior. System is running 3.6, on ubuntu
6.0.6, apache2, php5.1.2. Overall behaviour seems fine, but the custom
field is my only real hangup so far

The custom field I have created is a type select one value with no
validation, link values or include page values. There are 6 entries,
with no sort order or category. This custom field applies to ticket
transactions, which is assigned to all the queues. I then open an
exisitng ticket in the jumbo view, and attempt to choose one of the
entries in the list and save the ticket. I then get a system error, with
the text below:

error:  Can't locate object method Id via package No object mapping
for field (perhaps you forgot to load No object mapping for field?)
at /usr/share/request-tracker3.6/lib/RT/Record.pm line 1538.
 
context:  ...   
1534:  my $method = ${class}Obj; 
1535:  $object = $object-$method; 
1536:  } 
1537:   
1538:  return $object-Id; 
1539:  } 
1540:   
1541:   
1542:  =head2 CustomFieldLookupType  
...   
 
code stack:  /usr/share/request-tracker3.6/lib/RT/Record.pm:1538
/usr/share/request-tracker3.6/lib/RT/Record.pm:1519
/usr/share/request-tracker3.6/lib/RT/Record.pm:1597
/usr/share/request-tracker3.6/lib/RT/Record.pm:1579
/usr/share/request-tracker3.6/lib/RT/Interface/Web.pm:1300
/usr/share/request-tracker3.6/html/Ticket/ModifyAll.html:163
/usr/share/request-tracker3.6/html/autohandler:279 





raw error



Can't locate object method Id via package No object mapping for
field (perhaps you forgot to load No object mapping for field?) at
/usr/share/request-tracker3.6/lib/RT/Record.pm line 1538.


Trace begun at /usr/share/perl5/HTML/Mason/Exceptions.pm line 129
HTML::Mason::Exceptions::rethrow_exception('Can\'t locate object method
Id via package No object mapping for field (perhaps you forgot to
load No object mapping for field?) at
/usr/share/request-tracker3.6/lib/RT/Record.pm line 1538.^J') called at
/usr/share/request-tracker3.6/lib/RT/Record.pm line 1538
RT::Record::_LookupId('RT::Transaction=HASH(0xa5a0160)',
'RT::Queue-RT::Ticket-RT::Transaction') called at
/usr/share/request-tracker3.6/lib/RT/Record.pm line 1519
RT::Record::CustomFields('RT::Transaction=HASH(0xa5a0160)') called at
/usr/share/request-tracker3.6/lib/RT/Record.pm line 1597
RT::Record::_AddCustomFieldValue('RT::Transaction=HASH(0xa5a0160)',
'Field', 1, 'Value', 'ttt Systems') called at
/usr/share/request-tracker3.6/lib/RT/Record.pm line 1579
RT::Record::AddCustomFieldValue('RT::Transaction=HASH(0xa5a0160)',
'Field', 1, 'Value', 'ttt Systems') called at
/usr/share/request-tracker3.6/lib/RT/Interface/Web.pm line 1300
HTML::Mason::Commands::ProcessObjectCustomFieldUpdates('Object',
'RT::Ticket=HASH(0xa6597c8)', 'ARGSRef', 'HASH(0xa5522c0)') called at
/usr/share/request-tracker3.6/html/Ticket/ModifyAll.html line 163
HTML::Mason::Commands::__ANON__('Starts_Date', '', 'TimeEstimated', 0,
'UserOp', 'LIKE', 'Status', '', 'UpdateAttachment', '', 'Started_Date',
'', 'UpdateType', 'private', 'WatcherTypeEmail2', '', 'TimeWorked', 0,
'Object-RT::Transaction--CustomField-1-Values', 'ttt Systems', 'id', 12,
'TimeEstimated-TimeUnits', 'minutes', 'Subject', 'custom field test',
'RefersTo-12', '', 'WatcherTypeEmail3', '', 'GroupString', '',
'GroupOp', 'LIKE', 'Owner', 'ARRAY(0xa4b8f00)', 'WatcherTypeEmail1', '',
'Priority', 0, 'WatcherAddressEmail3', '',
'Object-RT::Transaction--CustomField-1-Values-Magic', 1, 'Queue', 3,
'Due_Date', '', 'WatcherAddressEmail1', '', 'Told_Date', '',
'UserString', '', 'UserField', 'Name', 'GroupField', 'Name',
'12-MergeInto', '', 'UpdateSubject', 'custom field test',
'FinalPriority', 0, '12-DependsOn', '', '12-MemberOf', '',
'TimeLeft-TimeUnits', 'minutes', 'TimeLeft', 0, '12-RefersTo', '',
'MemberOf-12', '', 'UpdateContent', '', 'DependsOn-12', '',
'TimeWorked-TimeUnits', 'minutes', 'WatcherAddressEmail2', '',
'Starts_Date', '', 'TimeEstimated', 0, 'UserOp', 'LIKE', 'Status', '',
'UpdateAttachment', '', 'Started_Date', '', 'UpdateType', 'private',
'WatcherTypeEmail2', '', 'TimeWorked', 0,
'Object-RT::Transaction--CustomField-1-Values', 'ttt Systems', 'id', 12,
'TimeEstimated-TimeUnits', 'minutes', 'Subject', 'custom field test',
'RefersTo-12', '', 'WatcherTypeEmail3', '', 'GroupString', '',
'GroupOp', 'LIKE', 'Owner', 'ARRAY(0xa66217c)', 'WatcherTypeEmail1', '',
'Priority', 0, 'WatcherAddressEmail3', '',
'Object-RT::Transaction--CustomField-1-Values-Magic', 1, 'Queue', 3,
'Due_Date', '', 'WatcherAddressEmail1', '', 'Told_Date', '',
'UserString', '', 'UserField', 'Name', 'GroupField', 'Name',
'12-MergeInto', '', 'UpdateSubject', 'custom field test',
'FinalPriority', 0, '12-DependsOn', '', '12-MemberOf', '',
'TimeLeft-TimeUnits', 'minutes', 'TimeLeft', 0, '12-RefersTo', '',
'MemberOf-12', '', 'UpdateContent', '', 'DependsOn-12', '',
'TimeWorked-TimeUnits', 'minutes', 'WatcherAddressEmail2', '') called at
/usr/share/perl5/HTML/Mason/Component.pm line 135