function views_gantt_plugin_style_gantt::get_project in Views Gantt 7
Same name and namespace in other branches
- 7.2 views_gantt_plugin_style_gantt.inc \views_gantt_plugin_style_gantt::get_project()
1 call to views_gantt_plugin_style_gantt::get_project()
- views_gantt_plugin_style_gantt::render in ./
views_gantt_plugin_style_gantt.inc - Render the given style.
File
- ./
views_gantt_plugin_style_gantt.inc, line 505 - Contains the list style plugin.
Class
- views_gantt_plugin_style_gantt
- Style plugin to render Gantt charts.
Code
function get_project() {
$project_id = $this
->views_gantt_get_field_value($this->view->result[0], 'project_id_field');
$node = node_load($project_id);
if (!$node) {
$this->project = NULL;
}
else {
$project_date = $this
->views_gantt_get_field_value($this->view->result[0], 'project_date_field');
$this->project = array(
'name' => $node->title,
'id' => $node->nid,
'startdate' => $project_date,
);
if (!$project_date) {
$this->project['startdate'] = $this
->project_date();
if (!$this->project['startdate']) {
drupal_set_message(t('Gantt Chart requires filled project date.'), 'warning');
$this->project = NULL;
}
}
}
return $this->project;
}