Searching for solutions.. Offering suggestions

Please excuse the cross-posting, this is almost the exact same message I
placed in rt-users:

I’ve been trolling the rt-user list for awhile now, and for the most part,
everything I could want and even things I didn’t know I needed, have been
offered up by people on the list. That’s fantastic and everyone deserves a
pat on the back.

Lately I have been getting a bit too anxious and I have started tweaking and
fiddling in hopes of learning enough to make changes on my own. duck

I keep hearing of people who have solutions I need to implement, but they
haven’t contirbuted it to the fsck guys because they are worried about
scrutiny and mockery. Some of these people have contributed code to me
directly and for the most part, it’s excelent code and these guys really
should be sharing this stuff with everyone. Since that isn’t going to happen
overnight, and may never happen, I decided to post a few things I’m working
on that might encourage some development or assistance.

  • Making single-click “Resolve” and “Delete” links available everywhere
    (headers/search index/MyQueues/etc) so that we can deal with spam and
    rhetorical requests. This should be stupid-easy and yet I cannot find the
    code for invoking that action.

  • Making a list of who is logged into the RT web pages and perhaps how long
    they have been idle. This would be really handy when collaborating with
    multiple people on a specific task. I could also use it to tell me when it’s
    safe to restart the server.

  • It has already been suggested that this could easilly be done by creating
    or touching a file in an “online” directory that has the same name as the
    current use. This file would be created/touched each time any action is done
    in RT with the exception of auto-refresh actions. A cron script could remove
    stale user files to prevent problems created by people who just remain idle
    or simply close the browser without logging out. The final step would be
    setting up a script in RT that shows the user names in the dir and uses the
    date of the files to display an ‘idle’ value.
  • A simple list-box style ‘Stock Answers’ that avoids the java popup window
    that the original version uses. Using a list-box should be simple but, like
    most things that are easier said than done, I get mason errors when I change
    anything.

I know I’m forgetting a few things but it’s Valentines day over here and I’m
easilly distracted… My main problem is that I can theorize things but I
don’t have the Mason knowledge to implement my ideas. :frowning:

  • Making a list of who is logged into the RT web pages and perhaps how long
    they have been idle. This would be really handy when collaborating with
    multiple people on a specific task. I could also use it to tell me when it’s
    safe to restart the server.
  • It has already been suggested that this could easilly be done by creating
    or touching a file in an “online” directory that has the same name as the
    current use. This file would be created/touched each time any action is done
    in RT with the exception of auto-refresh actions. A cron script could remove
    stale user files to prevent problems created by people who just remain idle
    or simply close the browser without logging out. The final step would be
    setting up a script in RT that shows the user names in the dir and uses the
    date of the files to display an ‘idle’ value.

Hrm. Using a seperate file sounds painful actually, as you’re depending
on external scripts to cleanup. Use the Force Luke, or in this case,
the appropriately named Watchers table.

id Type Scope Value Email Quiet Owner Creator Created
LastUpdatedBy LastUpdated.

Watcher.pm mentions that the only Scopes in use are ‘Ticket’ and ‘Queue’.
Ergo, using a Scope of ‘WebUI’ would not conflict with anything, and a
check of code applying limits to Watcher objects bears this out.

Next, we have the problem of how to update this table. As pretty much
everything includes (WebRT/html)/Elements/Header, having this file include
(patch-Header) something else (UpdateWho) to update the table is pretty
easy

Note that lib/RT/Watcher.pm needs to be patched to allow a Type of
‘Viewer’, otherwise we can’t create our Watcher (patch-Watcher).

Once we’ve done that, the only thing remaining is to retrieve the
information in a nice fashion, and make it visible (ShowWho). In my setup
I’ve added it to WebRT/html/Elements/Tabs (patch-Tabs).

Finally, we want to know when people logout, so we patch
WebRT/html/NoAuth/Logout.html (patch-Logout) to call UpdateWho with a -1
value.

There is a future thing in UpdateWho which will give the ability to force
a log out of WebUI users, but something which does that has not been
implemented.

Use at your own risk, as always :wink:

Regards,

                         Bruce Campbell                            RIPE
               Systems/Network Engineer                             NCC
             www.ripe.net - PGP562C8B1B                      Operations

ShowWho (1.06 KB)

UpdateWho (2.17 KB)

patch-Header (36 Bytes)

patch-Watcher (278 Bytes)

patch-Tabs (311 Bytes)

patch-Logout (48 Bytes)

There is a future thing in UpdateWho which will give the ability to force
a log out of WebUI users, but something which does that has not been
implemented.

Use at your own risk, as always :wink:

Bruce,

Thank you for the code!

I am trying your patches against my 2.0.11. The first problem I had was the
patch-Header was applied in the middle of <%ARGS> </%ARGS>, which caused
mason errors. I moved it to within the <%INIT> </%INIT> block, where it
doesn’t cause mason errors any more. Was that the correct place to put it?
It does show up in the header, but doesn’t seem to ever show me as active.

I stopped and started the apache and apache-ssl servers, but still not active.

I am using the REMOTE_USER variable via apache authentication, and I thought
that might be the problem. I turned that off, logged out and logged back in,
and it still didn’t work.

I always get a 0 for number of active users, and the list box is always empty.
It should have 1 for me, and my name, right?

rob

mason errors. I moved it to within the <%INIT> </%INIT> block, where it
doesn’t cause mason errors any more. Was that the correct place to put it?

And I put it in the code block above the <%ARGS>, and it works now. This is
great! I hope it makes 2.0.12, with a config option to turn it on and off.

rob

ps. would a different option to diff have put it in the right place on my
system?

mason errors. I moved it to within the <%INIT> </%INIT> block, where it
doesn’t cause mason errors any more. Was that the correct place to put
it?

And I put it in the code block above the <%ARGS>, and it works now. This is
great! I hope it makes 2.0.12, with a config option to turn it on and off.

Spoke too soon. It is displaying the time in GMT, which is counter-intuitive
without a TZ string such as “GMT”. RT does honor the TZ settings, however,
and shows my updates in PST.

Adding code to RT which would have each user in a separate TZ would be cool,
though. Time to submit a wishlist. :slight_smile:

rob

Adding code to RT which would have each user in a separate TZ would be cool,
though. Time to submit a wishlist. :slight_smile:

The code is designed to allow us to do it. the biggest thing we’re waiting
on is per-user preferences.

http://www.bestpractical.com/products/rt – Trouble Ticketing. Free.

Use at your own risk, as always :wink:

Bruce,

Thank you for the code!

I am trying your patches against my 2.0.11. The first problem I had was the

Bugger, I testing applying some of them against HEAD, but the code was
developed under 2.0.9. I’ll update my installation next week :wink:

patch-Header was applied in the middle of <%ARGS> </%ARGS>, which caused
mason errors. I moved it to within the <%INIT> </%INIT> block, where it
doesn’t cause mason errors any more. Was that the correct place to put it?
It does show up in the header, but doesn’t seem to ever show me as active.

You want it after the closing tag (ie, after the signed in
as…logout)

I always get a 0 for number of active users, and the list box is always empty.
It should have 1 for me, and my name, right?

Yes. UpdateWho isn’t being included due to me not specifying the version
that the patch was generated for.

ShowWho of course has no data.

                         Bruce Campbell                            RIPE
               Systems/Network Engineer                             NCC
             www.ripe.net - PGP562C8B1B                      Operations

Spoke too soon. It is displaying the time in GMT, which is counter-intuitive
without a TZ string such as “GMT”. RT does honor the TZ settings, however,
and shows my updates in PST.

Hrm. I’m GMT+0100, and generally don’t notice a mere 1 hour difference :wink:

In ShowWho, replace ‘->ISO’ with ‘->AsString’ as a quick fix for local
time zone. (ISO does the Brit GMT, and coincidentally, the French UTC :wink: )

Regards,

                         Bruce Campbell                            RIPE
               Systems/Network Engineer                             NCC
             www.ripe.net - PGP562C8B1B                      Operations

Beautiful! … Nicely done and in record time too! I had to stumble a bit
finding the right directory structure for everything, but it’s all working
now.

Thanks Bruce!On February 15, 2002 09:28 am, you wrote:

On Fri, 15 Feb 2002, Rob Walker wrote:

Spoke too soon. It is displaying the time in GMT, which is
counter-intuitive without a TZ string such as “GMT”. RT does honor the
TZ settings, however, and shows my updates in PST.

Hrm. I’m GMT+0100, and generally don’t notice a mere 1 hour difference :wink:

In ShowWho, replace ‘->ISO’ with ‘->AsString’ as a quick fix for local
time zone. (ISO does the Brit GMT, and coincidentally, the French UTC :wink: )

Regards,

Beautiful! … Nicely done and in record time too! I had to stumble a bit
finding the right directory structure for everything, but it’s all working
now.

Heh. If I see something that I can implement and is useful to my
environment, it might get done. I’ve got other work to keep me busy
during the day.

<cue Jesse shameless plug :wink: >

PS - if you’re in Chicago, you should have gone and seen Boom this week.
2nd City (source of many SNL stars) in Amsterdam was a hoot!

                         Bruce Campbell                            RIPE
               Systems/Network Engineer                             NCC
             www.ripe.net - PGP562C8B1B                      Operations