Zhiming;
Its better you mail the list than just me .. someone else maybe able to help quicker .. Regard your query, I think it does not work because there is nothing related to anything happening ..(a change in the transaction table) .. I think you should be looking at http://wiki.bestpractical.com/index.cgi?EditCustomFieldsOnUpdate or similar ..
Regards;
Roy

Zhiming Liu wrote:
Hi Roy, Please take a look of my codes and see why
they don't work. This is the scrip of custom condition
(In a ticket if CustomField 'Release to US Cert?' is
'Yes', return 1).

my $CFName = 'Release to US Cert?';
my $QueueObj = $self->TicketObj->QueueObj;
my $CFObj = RT::CustomField->new(
$QueueObj->CurrentUser );
  $CFObj->LoadByNameAndQueue( Name => $CFName, Queue
=> $QueueObj->id );
if ( $CFObj->SelectCustomFieldValue(Name => $CFName)
eq 'Yes') {
    return 1;
} else {
    return undef;
}


Thanks, Zhiming.

--- Roy El-Hames <[EMAIL PROTECTED]> wrote:

Query builder is based on a ticket object .. ie you
only search for tickets ..not people ..
You may want to add an interface within the admin
pages to query login and out times ..
for now I am sticking to query mysql when needed ..
I have few other requirements pending
Regards;
Roy

Zhiming Liu wrote:
Hi Roy, I got it works too. Thanks. Are you going
to
add this into Query Builder to query tickets?
Zhiming.
--- Roy El-Hames <[EMAIL PROTECTED]> wrote:

Yes I got it all working ..
the attached is a scripts that I run every 12
hours
to clear the session table and also trap any logins that have not
exited
using the logout button and updates the LogoffTime..
Good luck.
Roy


Zhiming Liu wrote:
Hi Roy, Yes, I will redesign my table. I can't
update
the LogoutTime from mysql. How about you? Do you
get
update logofftime? Thanks, Zhiming.

--- Roy El-Hames <[EMAIL PROTECTED]> wrote:

Ahh .. I would suggest you redesign your table
similar to mine .. or you'll need to modify your code as per your
table
..
can you update the LogoutTime from mysql??
Roy
Zhiming Liu wrote:
Hi Roy, I understood what you said. 1. Since I have only id (same as your userid)
as
primary key, so I didn't see second logintime
created
in my system.
2. LogoutTime is the same as your logofftime.
No
error
created, just the LogoutTime field didn't
update.
I will modify table and test again. Talk to
you
later,
Zhiming.
--- Roy El-Hames <[EMAIL PROTECTED]> wrote:

Zhiming Liu wrote:
Hi Roy, I have tested the codes. Create
LoginTime
working, but we need update  LoginTime too.
Update
LogoutTime codes don't work in both
autohandler
and
Logout.html. What do you think? Zhiming.
I don't update the logintime.. if user 1005
login
at
10 am and then again at 12 am , I'll have 2 rows . id sessionid userid logintime
logofftime
1 fsdfsdf 1005 10.01 2 rtetre 1005 12.01
there are 2 reasons for this:
1- I can always track if a user logged in
last
week
2- The sessionid changes for every login, so
a
separate row is more consistent ..

I am not quite sure I understand what you
mean
about
logouttime .. you should only reference this from logout.html
and
your
session cleaner script ..what errors are you getting ??
Roy
--- Roy El-Hames <[EMAIL PROTECTED]> wrote:

Hi Zhiming;
Just to let you know I have implemented
this
functionality as follow:
CREATE TABLE UserLogin (id INTEGER NOT NULL
auto_increment,sessionid varchar(32),UserId INTEGER NOT
NULL,LoginTime
datetime default CURRENT_TIMESTAMP, LogOffTime datetime,
PRIMARY
KEY
=== message truncated ===


__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around http://mail.yahoo.com

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

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


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


We're hiring! Come hack Perl for Best Practical: 
http://bestpractical.com/about/jobs.html

Reply via email to