My Solution might be a bit of an overkill but i think it should work.... mind you i havent tested it myself, but have used this for other reasons
in your cases.php overwrite the create_new_list_query function
PHP Code:
function create_new_list_query($order_by, $where,$filter=array(),$params=array(), $show_deleted = 0,$join_type='', $return_array = false, $parentbean = null, $singleSelect = false){
$ret_array = parent::create_new_list_query($order_by, $where, $filter, $params, $show_deleted, $join_type, true, $parentbean, $singleSelect);
global $db;
$ret_array['select'] .= " meetings.id as meeting_id";
$ret_array['from'] .= " LEFT JOIN meetings ON (cases.id = meetings.parent_id and meetings.deleted = 0) ";
$ret_array['where'] .= $this->get_search_filters_query();
if ( !$return_array )
return $ret_array['select'] . $ret_array['from'] . $ret_array['where']. $ret_array['order_by'];
return $ret_array;
}
and add the following field definition in vardefs:
PHP Code:
'meeting_id' =>
array (
'name' => 'meeting_id',
'vname' => 'LBL_MEETING_ID',
'type' => 'id', // or can be varchar...
'source' => 'non-db',
'comment' => 'dummy field for meeting id, doesnt store real data',
),
However this will return multiple rows per case if a case has more than one meeting which is possible in theory.
this would basically give you access to a field meeting_id in listviewdwfs.php here you can access it same way as any other field in the module so in custom code area in between {php}{/php} you can do pretty much anything...
There is also a possibility to get an id of a meeting using just the vardefs, and using the link type of field... but that was never relieble for me especially when the relationship is one to many
Bookmarks