function casetracker_views_handler_filter_project::query in Case Tracker 7
Same name and namespace in other branches
- 6 includes/casetracker_views_handler_filter_project.inc \casetracker_views_handler_filter_project::query()
Add this filter to the query.
Due to the nature of fapi, the value and the operator have an unintended level of indirection. You will find them in $this->operator and $this->value respectively.
Overrides views_handler_filter::query
File
- includes/
casetracker_views_handler_filter_project.inc, line 6
Class
- casetracker_views_handler_filter_project
- Filter to only show casetracker cases.
Code
function query() {
if ($project_types = variable_get('casetracker_project_node_types', array(
'casetracker_basic_project',
))) {
// Weed out disabled types
foreach ($project_types as $type => $enabled) {
if (empty($enabled)) {
unset($project_types[$type]);
}
}
//$placeholders = db_placeholders($project_types, 'varchar');
$placeholders = $this
->placeholder();
$table = $this->query
->ensure_table('node');
$this->query
->add_where_expression($this->options['group'], "{$table}.type IN ({$placeholders})", array(
$placeholders => $project_types,
));
//$this->query->add_where($this->options['group'], "$table.type IN ($placeholders)", $project_types);
//dpm($this->query);
}
else {
$this->query
->add_where($this->options['group'], "FALSE");
drupal_set_message(t('You have no node types which are acting as projects.', 'error'));
}
}