[rt-users] OrderBy customized column value

Yan Yang yyang at cidc.com
Tue Nov 3 11:24:31 EST 2009


We added an extra customized column in the Admin/Users/index.html. The
column name is called "LastAccessTime". The purpose is to display the
last access time of the user. It is combined with the Config
"AutoLogoff" setting and the customized function to retrieve the
"LastUpdated" value from the "sessions" table.

 

We added the function at the callback:
/local/html/Callbacks/xx/Elements/RT__User/ColumnMap/ColumnMap:

 

sub get_last_access {

    my $User = shift;

    my $lastAccessed;

    my $sessions = $User->get_sessions;

    $lastAccessed = $sessions->{$User->id} || "";

    

    return $lastAccessed;

}

 

$COLUMN_MAP->{'LastAccessTime'}->{value} = \&get_last_access;

$COLUMN_MAP->{'LastAccessTime'}->{title} = "Last Access Time";

 

Everything went well, except that this additional column is not
sortable. Since the value is computed and the "attribute" is not in the
database, we are wondering if it is possible to use the "OrderBy" param.


 

Any idea on how to sort this customized column?

 

Thanks a lot!

Yan

 

  

 

 

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.bestpractical.com/pipermail/rt-users/attachments/20091103/533eeccc/attachment.htm>


More information about the rt-users mailing list