? 369262_views_support.patch ? versioncontrol-views-0.patch Index: includes/versioncontrol.views.inc =================================================================== RCS file: includes/versioncontrol.views.inc diff -N includes/versioncontrol.views.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ includes/versioncontrol.views.inc 18 Nov 2009 23:46:50 -0000 @@ -0,0 +1,177 @@ + 'vc_op_id', + 'title' => t('Version Control Operations'), + 'help' => t("Commits to all active repositories"), + ); + + $data['versioncontrol_operations']['message'] = array( + 'title' => t('Message'), + 'help' => t('The commit log message.'), + 'field' => array( + 'handler' => 'views_handler_field', + ), + 'filter' => array( + 'handler' => 'views_handler_filter_string', + ), + 'argument' => array( + 'handler' => 'views_handler_argument_string', + ), + ); + $data['versioncontrol_operations']['username'] = array( + 'title' => t('VCS Username'), + 'help' => t('The VCS username responsible for this commit.'), + 'field' => array( + 'handler' => 'views_handler_field', + 'click sortable' => TRUE, + ), + 'filter' => array( + 'handler' => 'views_handler_filter_string', + ), + 'sort' => array( + 'handler' => 'views_handler_sort', + ), + 'argument' => array( + 'handler' => 'views_handler_argument_string', + ), + ); + $data['versioncontrol_operations']['date'] = array( + 'title' => t('Date'), + 'help' => t('The date this commit occurred.'), + 'field' => array( + 'handler' => 'views_handler_field_date', + 'click sortable' => TRUE, + ), + 'sort' => array( + 'handler' => 'views_handler_sort_date', + ), + 'filter' => array( + 'handler' => 'views_handler_filter_date', + ), + ); + $data['versioncontrol_operations']['revision'] = array( + 'title' => t('Revision'), + 'help' => t('The revision identifier of this commit.'), + 'field' => array( + 'handler' => 'versioncontrol_views_handler_field_revision', + ), + 'filter' => array( + 'handler' => 'views_handler_filter_string', + ), + 'argument' => array( + 'handler' => 'views_handler_argument_string', + ), + ); + + // ========================================================================= + // versioncontrol_repositories + + $data['versioncontrol_repositories']['table']['group'] = t('Version Control'); + + $data['versioncontrol_repositories']['table']['join'] = array( + 'versioncontrol_operations' => array( + 'left_field' => 'repo_id', + 'field' => 'repo_id', + ), + ); + + $data['versioncontrol_repositories']['name'] = array( + 'title' => t('Repository'), + 'help' => t('The name of the Version Control Repository in which this commit happened.'), + 'field' => array( + 'handler' => 'views_handler_field', + 'click sortable' => TRUE, + ), + 'filter' => array( + 'handler' => 'views_handler_filter_string', + ), + 'sort' => array( + 'handler' => 'views_handler_sort', + ), + 'argument' => array( + 'handler' => 'views_handler_argument_string', + ), + ); + + $data['versioncontrol_repositories']['vcs'] = array( + 'title' => t('VCS'), + 'help' => t('The name of the Version Control System used by the repository in which this commit happened.'), + 'field' => array( + 'handler' => 'views_handler_field', + 'click sortable' => TRUE, + ), + 'filter' => array( + 'handler' => 'views_handler_filter_string', + ), + 'argument' => array( + 'handler' => 'views_handler_argument_string', + ), + ); + + // ========================================================================= + // versioncontrol_accounts + + $data['versioncontrol_accounts']['table']['group'] = t('Version Control'); + + $data['versioncontrol_accounts']['table']['join'] = array( + 'versioncontrol_operations' => array( + 'left_field' => 'username', + 'field' => 'username', + 'extra' => 'versioncontrol_operations.repo_id = versioncontrol_accounts.repo_id', + ), + ); + + $data['versioncontrol_accounts']['uid'] = array( + 'title' => t('User'), + 'help' => t("The User matching the commit's author."), + 'relationship' => array( + 'base' => 'users', + 'field' => 'uid', + 'handler' => 'views_handler_relationship', + 'label' => t('User'), + ), + ); + + // ========================================================================= + // versioncontrol_item_revisions + + $data['versioncontrol_item_revisions']['table']['group'] = t('Version Control'); + + $data['versioncontrol_item_revisions']['table']['join'] = array( + 'versioncontrol_operations' => array( + 'left_field' => 'revision', + 'field' => 'revision', + 'extra' => 'versioncontrol_operations.repo_id = versioncontrol_item_revisions.repo_id', + ), + ); + + return $data; +} + + +function versioncontrol_views_handlers() { + return array( + 'info' => array( + 'path' => drupal_get_path('module', 'versioncontrol') .'/includes', + ), + 'handlers' => array( + 'versioncontrol_views_handler_field_revision' => array( + 'parent' => 'views_handler_field_numeric', + ), + ), + ); +} Index: includes/versioncontrol_views_handler_field_revision.inc =================================================================== RCS file: includes/versioncontrol_views_handler_field_revision.inc diff -N includes/versioncontrol_views_handler_field_revision.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ includes/versioncontrol_views_handler_field_revision.inc 18 Nov 2009 23:46:50 -0000 @@ -0,0 +1,21 @@ + array('id' => $values->vc_op_id))); + } + return $title; + } + + function render($values) { + return $this->render_link(check_plain($values->{$this->field_alias}), $values); + } +}