Sort by crypted field

Hi Steve,
I need to sort by an encrypted field in the list mode (when click on field name). By default it sorts by encrypted value of field!
I have add this code for decrypt field:
gcrypt and gdecrypt are my personal methods.
I need to sort by an encrypted field in the list mode (when click on field name). By default it sorts by encrypted value of field!
I have add this code for decrypt field:
- Code: Select all
function cognome__display(&$record)
{
return $this->gdecrypt($record->Value('cognome'));
}
function cognome__pushValue(&$record, &$element)
{
return $this->gcrypt($element->getValue());
}
function cognome__pullValue(&$record, &$element)
{
return $this->gdecrypt($record->Value('cognome'));
}
function cognome__serialize($value)
{
if ($_REQUEST['-action']=="edit" || $_REQUEST['-action']=="new")
return $value;
else
return $this->gcrypt($value);
}
gcrypt and gdecrypt are my personal methods.