I could not find a way to control the filter values for a column that has the 'sql' option set. Please let me know if there is one.
In the meantime I have modified the set_values_from_table() to set filter values based on a new column attribute 'fvalues'. See below.
| Code: |
...
}
// lsuardi - use special field attribute 'fvalues' to
// set filter values using a specific query or array of values
else if ( is_array( $this->fdd[$field_num]['fvalues']) )
{ return( $this->fdd[$field_num]['fvalues']);
}
else if ( isset( $this->fdd[$field_num]['fvalues']) )
{ $values = array();
$res = $this->myquery( $this->fdd[$field_num]['fvalues'], __LINE__);
while ($row = $this->sql_fetch($res, 'n'))
$values[$row[0]] = $row[0];
return $values;
}
else { /* simple value extraction */
...
|
Please let me know if this is a good solution and if you are interested in incorporating the code in PME.
Thank you!
|