| [ Index ] |
PHP Cross Reference of Drupal 6 (gatewave) |
[Summary view] [Print] [Text view]
1 <?php 2 // $Id: project_issue.views.inc,v 1.9 2009/06/18 03:48:53 dww Exp $ 3 4 /** 5 * @file 6 * Provides support for Views integration. 7 */ 8 9 /** 10 * Implementation of hook_views_data(). 11 */ 12 function project_issue_views_data() { 13 $data = array(); 14 15 $data['project_issues']['table']['group'] = t('Project issue'); 16 17 $data['project_issues']['table']['join'] = array( 18 'node' => array( 19 'type' => 'INNER', 20 'left_field' => 'nid', 21 'field' => 'nid', 22 ), 23 'project_projects' => array( 24 'type' => 'INNER', 25 'left_table' => 'project_projects', 26 'left_field' => 'nid', 27 'field' => 'pid', 28 ), 29 'project_release_nodes' => array( 30 'type' => 'INNER', 31 'left_table' => 'project_release_nodes', 32 'left_field' => 'nid', 33 'field' => 'rid', 34 ), 35 ); 36 37 $data['project_issues']['pid'] = array( 38 'title' => t('Project'), 39 'help' => t('The project an issue is tied to.'), 40 'field' => array( 41 'handler' => 'views_handler_field_node', 42 'click sortable' => TRUE, 43 ), 44 // Information for accepting a pid as an argument 45 'argument' => array( 46 'handler' => 'views_handler_argument_node_nid', 47 'name field' => 'title', 48 'numeric' => TRUE, 49 'validate type' => 'nid', 50 ), 51 // Information for accepting a pid as a filter 52 'filter' => array( 53 'handler' => 'project_issue_handler_filter_issue_project', 54 ), 55 'relationship' => array( 56 'base' => 'node', 57 'handler' => 'views_handler_relationship', 58 'label' => t('Project node'), 59 ), 60 ); 61 62 $data['node']['project_issue_queue'] = array( 63 'title' => t('Project issue queue'), 64 'help' => t("Displays a link to the issue queue for the project this issue is assigned to."), 65 'field' => array( 66 'field' => 'title', 67 'group' => t('Project issue'), 68 'handler' => 'project_issue_handler_field_issue_queue_link', 69 'click sortable' => TRUE, 70 ), 71 ); 72 73 $data['project_issues']['category'] = array( 74 'title' => t('Category'), 75 'help' => t("The issue's category (bug, task, feature, etc)."), 76 'field' => array( 77 'handler' => 'project_issue_handler_field_issue_category', 78 'click sortable' => TRUE, 79 ), 80 'sort' => array( 81 'handler' => 'views_handler_sort', 82 ), 83 'filter' => array( 84 'handler' => 'project_issue_handler_filter_issue_category', 85 ), 86 'argument' => array( 87 'handler' => 'views_handler_argument_string', 88 ), 89 ); 90 91 $data['project_issues']['component'] = array( 92 'title' => t('Component'), 93 'help' => t("The issue's component (the options are controlled per-project)."), 94 'field' => array( 95 'handler' => 'views_handler_field_node', 96 'click sortable' => TRUE, 97 ), 98 'sort' => array( 99 'handler' => 'views_handler_sort', 100 ), 101 'filter' => array( 102 'handler' => 'project_issue_handler_filter_issue_component', 103 ), 104 'argument' => array( 105 'handler' => 'views_handler_argument_string', 106 ), 107 ); 108 109 $data['project_issues']['priority'] = array( 110 'title' => t('Priority'), 111 'help' => t("The issue's priority (critical, normal, minor)."), 112 'field' => array( 113 'handler' => 'project_issue_handler_field_issue_priority', 114 'click sortable' => TRUE, 115 ), 116 'sort' => array( 117 'handler' => 'views_handler_sort', 118 'help' => t("Sort by the issue's priority."), 119 ), 120 'filter' => array( 121 'handler' => 'project_issue_handler_filter_issue_priority', 122 'help' => t("Filter on each issue's status."), 123 ), 124 'argument' => array( 125 'handler' => 'views_handler_argument_numeric', 126 ), 127 ); 128 129 $data['project_issues']['rid'] = array( 130 'title' => t('Version'), 131 'help' => t('The version associated with the issue (depends on project_release.module).'), 132 'field' => array( 133 'handler' => 'views_handler_field_node', 134 'click sortable' => TRUE, 135 ), 136 'argument' => array( 137 'handler' => 'views_handler_argument_node_nid', 138 'name field' => 'title', 139 'numeric' => TRUE, 140 'validate type' => 'nid', 141 ), 142 'filter' => array( 143 'handler' => 'project_issue_handler_filter_issue_version', 144 ), 145 'relationship' => array( 146 'base' => 'node', 147 'handler' => 'views_handler_relationship', 148 'label' => t('Project release node'), 149 ), 150 ); 151 152 $data['project_issues']['assigned'] = array( 153 'title' => t('Assigned'), 154 'help' => t('The user the issue is assigned to.'), 155 'relationship' => array( 156 'base' => 'users', 157 'handler' => 'views_handler_relationship', 158 'label' => t('Assigned user'), 159 ), 160 ); 161 162 $data['project_issues']['sid'] = array( 163 'title' => t('Status'), 164 'help' => t('The status of each issue'), 165 'field' => array( 166 'handler' => 'project_issue_handler_field_issue_status', 167 'click sortable' => TRUE, 168 ), 169 'sort' => array( 170 'handler' => 'views_handler_sort', 171 'help' => t("Sort by the issue's status."), 172 ), 173 'filter' => array( 174 'handler' => 'project_issue_handler_filter_issue_status', 175 'help' => t("Filter on each issue's status."), 176 ), 177 'argument' => array( 178 'handler' => 'views_handler_argument_numeric', 179 ), 180 ); 181 return $data; 182 } 183 184 /** 185 * Implementation of hook_views_handlers(). 186 */ 187 function project_issue_views_handlers() { 188 return array( 189 'info' => array( 190 'path' => drupal_get_path('module', 'project_issue') .'/views/handlers', 191 ), 192 'handlers' => array( 193 'project_issue_handler_field_issue_category' => array( 194 'parent' => 'views_handler_field', 195 ), 196 'project_issue_handler_field_issue_priority' => array( 197 'parent' => 'views_handler_field', 198 ), 199 'project_issue_handler_field_issue_queue_link' => array( 200 'parent' => 'views_handler_field', 201 ), 202 'project_issue_handler_field_issue_status' => array( 203 'parent' => 'views_handler_field', 204 ), 205 'project_issue_handler_filter_issue_category' => array( 206 'parent' => 'views_handler_filter_in_operator', 207 ), 208 'project_issue_handler_filter_issue_component' => array( 209 'parent' => 'views_handler_filter_in_operator', 210 ), 211 'project_issue_handler_filter_issue_priority' => array( 212 'parent' => 'views_handler_filter_in_operator', 213 ), 214 'project_issue_handler_filter_issue_project' => array( 215 'parent' => 'views_handler_filter_in_operator', 216 ), 217 'project_issue_handler_filter_issue_status' => array( 218 'parent' => 'views_handler_filter_in_operator', 219 ), 220 'project_issue_handler_filter_issue_version' => array( 221 'parent' => 'views_handler_filter_in_operator', 222 ), 223 ), 224 ); 225 } 226 227 function project_issue_views_plugins() { 228 $path = drupal_get_path('module', 'project_issue') . '/views/plugins'; 229 $views_path = drupal_get_path('module', 'views'); 230 return array( 231 'style' => array( 232 'project_issue_table' => array( 233 'title' => t('Project issue table'), 234 'help' => t('Table with colored rows depending on issue status.'), 235 'handler' => 'project_issue_table_plugin_style', 236 'parent' => 'table', 237 'path' => $path, 238 'theme' => 'views_view_table', 239 'theme file' => 'theme.inc', 240 'theme path' => "$views_path/theme", 241 'uses row plugin' => FALSE, 242 'uses fields' => TRUE, 243 'uses options' => TRUE, 244 'type' => 'normal', 245 ), 246 ), 247 'access' => array( 248 'project_issue_access_per_user_queue' => array( 249 'title' => t('View per-user issue queues'), 250 'help' => t('Access will be granted if the user is requested in the URL or for users viewing their own per-user issue queues.'), 251 'handler' => 'project_issue_plugin_access_per_user_queue', 252 'uses options' => TRUE, 253 'path' => $path, 254 ), 255 ), 256 ); 257 } 258
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
| Generated: Thu Mar 24 11:18:33 2011 | Cross-referenced by PHPXref 0.7 |