| 1 |
<?php
|
| 2 |
// $Id: project_issue_voting.views.inc,v 1.5 2008/08/16 12:34:01 dww Exp $
|
| 3 |
|
| 4 |
|
| 5 |
/**
|
| 6 |
* @file
|
| 7 |
* Views integration for the Project issue voting module.
|
| 8 |
*
|
| 9 |
* At this point, this only provides a default view that is used for
|
| 10 |
* the site-wide issue voting dashboard.
|
| 11 |
*/
|
| 12 |
|
| 13 |
/**
|
| 14 |
* Implementation of hook_views_default_views.
|
| 15 |
*/
|
| 16 |
function _project_issue_voting_views_default_views() {
|
| 17 |
$views = array();
|
| 18 |
|
| 19 |
$view = new stdClass();
|
| 20 |
$view->name = 'project_issue_votes_by_category';
|
| 21 |
$view->description = 'View issue votes for a particular category (bug, feature, etc)';
|
| 22 |
$view->access = array (
|
| 23 |
);
|
| 24 |
$view->page = TRUE;
|
| 25 |
$view->page_title = '';
|
| 26 |
$view->page_header = "<?php print l(t('Site-wide top voted issues'), 'project/issues/votes/top'); ?>";
|
| 27 |
$view->page_header_format = '2';
|
| 28 |
$view->page_footer = '';
|
| 29 |
$view->page_footer_format = '1';
|
| 30 |
$view->page_empty = 'There are currently no issues to display for the criteria selected.';
|
| 31 |
$view->page_empty_format = '1';
|
| 32 |
$view->page_type = 'project_issues';
|
| 33 |
$view->url = 'project/issues/votes/category';
|
| 34 |
$view->use_pager = TRUE;
|
| 35 |
$view->nodes_per_page = '50';
|
| 36 |
$view->menu = TRUE;
|
| 37 |
$view->menu_title = 'Issues by category';
|
| 38 |
$view->menu_tab = FALSE;
|
| 39 |
$view->menu_tab_weight = '0';
|
| 40 |
$view->menu_tab_default = FALSE;
|
| 41 |
$view->menu_tab_default_parent = NULL;
|
| 42 |
$view->menu_tab_default_parent_type = 'tab';
|
| 43 |
$view->menu_parent_tab_weight = '0';
|
| 44 |
$view->menu_parent_title = '';
|
| 45 |
$view->block = TRUE;
|
| 46 |
$view->block_title = '';
|
| 47 |
$view->block_header = '';
|
| 48 |
$view->block_header_format = '1';
|
| 49 |
$view->block_footer = '';
|
| 50 |
$view->block_footer_format = '1';
|
| 51 |
$view->block_empty = '';
|
| 52 |
$view->block_empty_format = '1';
|
| 53 |
$view->block_type = 'project_issues';
|
| 54 |
$view->nodes_per_block = '20';
|
| 55 |
$view->block_more = FALSE;
|
| 56 |
$view->block_use_page_header = FALSE;
|
| 57 |
$view->block_use_page_footer = FALSE;
|
| 58 |
$view->block_use_page_empty = TRUE;
|
| 59 |
$view->sort = array (
|
| 60 |
);
|
| 61 |
$view->argument = array (
|
| 62 |
array (
|
| 63 |
'type' => 'project_issue_category',
|
| 64 |
'argdefault' => '4',
|
| 65 |
'title' => 'Top voted %1',
|
| 66 |
'options' => '',
|
| 67 |
'wildcard' => '',
|
| 68 |
'wildcard_substitution' => '',
|
| 69 |
),
|
| 70 |
);
|
| 71 |
$view->field = array (
|
| 72 |
array (
|
| 73 |
'tablename' => 'votingapi_cache_issue_points_sum',
|
| 74 |
'field' => 'value',
|
| 75 |
'label' => 'Votes',
|
| 76 |
'handler' => 'votingapi_views_formatter_raw',
|
| 77 |
'sortable' => '1',
|
| 78 |
'defaultsort' => 'DESC',
|
| 79 |
),
|
| 80 |
array (
|
| 81 |
'tablename' => 'project_issue_project_node',
|
| 82 |
'field' => 'title',
|
| 83 |
'label' => 'Project',
|
| 84 |
'handler' => 'views_handler_field_project_issue_project_nodelink',
|
| 85 |
'sortable' => '1',
|
| 86 |
'options' => 'link',
|
| 87 |
),
|
| 88 |
array (
|
| 89 |
'tablename' => 'node',
|
| 90 |
'field' => 'title',
|
| 91 |
'label' => 'Summary',
|
| 92 |
'handler' => 'views_handler_field_nodelink_with_mark',
|
| 93 |
'sortable' => '1',
|
| 94 |
'options' => 'link',
|
| 95 |
),
|
| 96 |
array (
|
| 97 |
'tablename' => 'project_issues',
|
| 98 |
'field' => 'sid',
|
| 99 |
'label' => 'Status',
|
| 100 |
'sortable' => '1',
|
| 101 |
),
|
| 102 |
array (
|
| 103 |
'tablename' => 'project_issues',
|
| 104 |
'field' => 'priority',
|
| 105 |
'label' => 'Priority',
|
| 106 |
'sortable' => '1',
|
| 107 |
),
|
| 108 |
array (
|
| 109 |
'tablename' => 'project_issues',
|
| 110 |
'field' => 'rid',
|
| 111 |
'label' => 'Version',
|
| 112 |
'sortable' => '1',
|
| 113 |
'options' => 'project_issue_rid_allow_hide',
|
| 114 |
),
|
| 115 |
array (
|
| 116 |
'tablename' => 'node',
|
| 117 |
'field' => 'changed',
|
| 118 |
'label' => 'Last updated',
|
| 119 |
'handler' => 'views_handler_field_since',
|
| 120 |
'sortable' => '1',
|
| 121 |
),
|
| 122 |
array (
|
| 123 |
'tablename' => 'pi_users',
|
| 124 |
'field' => 'name',
|
| 125 |
'label' => 'Assigned to',
|
| 126 |
'sortable' => '1',
|
| 127 |
),
|
| 128 |
array (
|
| 129 |
'tablename' => 'project_issue_project_projects',
|
| 130 |
'field' => 'uri',
|
| 131 |
'label' => 'Short name',
|
| 132 |
'options' => 'project_issue_nodisplay',
|
| 133 |
),
|
| 134 |
);
|
| 135 |
$view->filter = array (
|
| 136 |
array (
|
| 137 |
'tablename' => 'node',
|
| 138 |
'field' => 'status',
|
| 139 |
'operator' => '=',
|
| 140 |
'options' => '',
|
| 141 |
'value' => '1',
|
| 142 |
),
|
| 143 |
array (
|
| 144 |
'tablename' => 'project_issues',
|
| 145 |
'field' => 'sid',
|
| 146 |
'operator' => 'OR',
|
| 147 |
'options' => '',
|
| 148 |
'value' => array (
|
| 149 |
0 => 'defaults',
|
| 150 |
),
|
| 151 |
),
|
| 152 |
array (
|
| 153 |
'tablename' => 'project_issue_project_node',
|
| 154 |
'field' => 'nid',
|
| 155 |
'operator' => 'OR',
|
| 156 |
'options' => '',
|
| 157 |
'value' => array (
|
| 158 |
),
|
| 159 |
),
|
| 160 |
array (
|
| 161 |
'tablename' => 'project_issues',
|
| 162 |
'field' => 'priority',
|
| 163 |
'operator' => 'OR',
|
| 164 |
'options' => '',
|
| 165 |
'value' => array (
|
| 166 |
),
|
| 167 |
),
|
| 168 |
array (
|
| 169 |
'tablename' => 'votingapi_cache_issue_points_sum',
|
| 170 |
'field' => 'value',
|
| 171 |
'operator' => '>',
|
| 172 |
'options' => '',
|
| 173 |
'value' => '0',
|
| 174 |
),
|
| 175 |
);
|
| 176 |
$view->exposed_filter = array (
|
| 177 |
array (
|
| 178 |
'tablename' => 'project_issue_project_node',
|
| 179 |
'field' => 'nid',
|
| 180 |
'label' => 'Project',
|
| 181 |
'optional' => '1',
|
| 182 |
'is_default' => '0',
|
| 183 |
'operator' => '1',
|
| 184 |
'single' => '1',
|
| 185 |
),
|
| 186 |
array (
|
| 187 |
'tablename' => 'project_issues',
|
| 188 |
'field' => 'sid',
|
| 189 |
'label' => 'Status',
|
| 190 |
'optional' => '1',
|
| 191 |
'is_default' => '1',
|
| 192 |
'operator' => '1',
|
| 193 |
'single' => '1',
|
| 194 |
),
|
| 195 |
array (
|
| 196 |
'tablename' => 'project_issues',
|
| 197 |
'field' => 'priority',
|
| 198 |
'label' => 'Priority',
|
| 199 |
'optional' => '1',
|
| 200 |
'is_default' => '0',
|
| 201 |
'operator' => '1',
|
| 202 |
'single' => '1',
|
| 203 |
),
|
| 204 |
);
|
| 205 |
$view->requires = array(votingapi_cache_issue_points_sum, project_issue_project_node, node, project_issues, pi_users, project_issue_project_projects);
|
| 206 |
$views[$view->name] = $view;
|
| 207 |
|
| 208 |
return $views;
|
| 209 |
}
|
| 210 |
|