You are here

function pay_views_default_views in Pay 7

Same name and namespace in other branches
  1. 6 includes/views/pay.views_default.inc \pay_views_default_views()

Implementation of hook_views_default_views().

File

includes/views/pay.views_default.inc, line 11
Default Views the Payment API

Code

function pay_views_default_views() {

  /*
   * View 'pay_transactions'
   */
  $view = new view();
  $view->name = 'pay_transactions';
  $view->description = '';
  $view->tag = '';
  $view->view_php = '';
  $view->base_table = 'pay_transaction';
  $view->is_cacheable = FALSE;
  $view->api_version = 2;
  $view->disabled = FALSE;

  /* Edit this to true to make a default view disabled initially */
  $handler = $view
    ->new_display('default', 'Defaults', 'default');
  $handler
    ->override_option('relationships', array(
    'pfid' => array(
      'label' => 'Payment form',
      'required' => 0,
      'id' => 'pfid',
      'table' => 'pay_transaction',
      'field' => 'pfid',
      'relationship' => 'none',
    ),
    'uid' => array(
      'label' => 'user',
      'required' => 0,
      'id' => 'uid',
      'table' => 'pay_transaction',
      'field' => 'uid',
      'override' => array(
        'button' => 'Override',
      ),
      'relationship' => 'none',
    ),
  ));
  $handler
    ->override_option('fields', array(
    'pxid' => array(
      'label' => 'ID',
      'alter' => array(
        'alter_text' => 0,
        'text' => '',
        'make_link' => 0,
        'path' => '',
        'link_class' => '',
        'alt' => '',
        'prefix' => '',
        'suffix' => '',
        'target' => '',
        'help' => '',
        'trim' => 0,
        'max_length' => '',
        'word_boundary' => 1,
        'ellipsis' => 1,
        'html' => 0,
        'strip_tags' => 0,
      ),
      'empty' => '',
      'hide_empty' => 0,
      'empty_zero' => 0,
      'set_precision' => FALSE,
      'precision' => 0,
      'decimal' => '.',
      'separator' => ',',
      'prefix' => '',
      'suffix' => '',
      'exclude' => 0,
      'id' => 'pxid',
      'table' => 'pay_transaction',
      'field' => 'pxid',
      'relationship' => 'none',
    ),
    'name' => array(
      'label' => 'User',
      'alter' => array(
        'alter_text' => 0,
        'text' => '',
        'make_link' => 0,
        'path' => '',
        'link_class' => '',
        'alt' => '',
        'prefix' => '',
        'suffix' => '',
        'target' => '',
        'help' => '',
        'trim' => 0,
        'max_length' => '',
        'word_boundary' => 1,
        'ellipsis' => 1,
        'html' => 0,
        'strip_tags' => 0,
      ),
      'empty' => '',
      'hide_empty' => 0,
      'empty_zero' => 0,
      'link_to_user' => 1,
      'overwrite_anonymous' => 1,
      'anonymous_text' => '-',
      'exclude' => 0,
      'id' => 'name',
      'table' => 'users',
      'field' => 'name',
      'relationship' => 'uid',
      'override' => array(
        'button' => 'Override',
      ),
    ),
    'title' => array(
      'label' => 'Payment form',
      'alter' => array(
        'alter_text' => 0,
        'text' => '',
        'make_link' => 0,
        'path' => '',
        'link_class' => '',
        'alt' => '',
        'prefix' => '',
        'suffix' => '',
        'target' => '',
        'help' => '',
        'trim' => 0,
        'max_length' => '',
        'word_boundary' => 1,
        'ellipsis' => 1,
        'html' => 0,
        'strip_tags' => 0,
      ),
      'empty' => '',
      'hide_empty' => 0,
      'empty_zero' => 0,
      'exclude' => 0,
      'id' => 'title',
      'table' => 'pay_form',
      'field' => 'title',
      'relationship' => 'pfid',
      'override' => array(
        'button' => 'Override',
      ),
    ),
    'created' => array(
      'label' => 'Transaction date',
      'alter' => array(
        'alter_text' => 0,
        'text' => '',
        'make_link' => 0,
        'path' => '',
        'link_class' => '',
        'alt' => '',
        'prefix' => '',
        'suffix' => '',
        'target' => '',
        'help' => '',
        'trim' => 0,
        'max_length' => '',
        'word_boundary' => 1,
        'ellipsis' => 1,
        'html' => 0,
        'strip_tags' => 0,
      ),
      'empty' => '',
      'hide_empty' => 0,
      'empty_zero' => 0,
      'date_format' => 'small',
      'custom_date_format' => '',
      'exclude' => 0,
      'id' => 'created',
      'table' => 'pay_transaction',
      'field' => 'created',
      'relationship' => 'none',
    ),
    'total' => array(
      'label' => 'Total amount',
      'alter' => array(
        'alter_text' => 0,
        'text' => '',
        'make_link' => 0,
        'path' => '',
        'link_class' => '',
        'alt' => '',
        'prefix' => '',
        'suffix' => '',
        'target' => '',
        'help' => '',
        'trim' => 0,
        'max_length' => '',
        'word_boundary' => 1,
        'ellipsis' => 1,
        'html' => 0,
        'strip_tags' => 0,
      ),
      'empty' => '',
      'hide_empty' => 0,
      'empty_zero' => 0,
      'set_precision' => FALSE,
      'precision' => 0,
      'decimal' => '.',
      'separator' => ',',
      'prefix' => '',
      'suffix' => '',
      'exclude' => 0,
      'id' => 'total',
      'table' => 'pay_transaction',
      'field' => 'total',
      'relationship' => 'none',
    ),
    'total_paid' => array(
      'label' => 'Total paid',
      'alter' => array(
        'alter_text' => 0,
        'text' => '',
        'make_link' => 0,
        'path' => '',
        'link_class' => '',
        'alt' => '',
        'prefix' => '',
        'suffix' => '',
        'target' => '',
        'help' => '',
        'trim' => 0,
        'max_length' => '',
        'word_boundary' => 1,
        'ellipsis' => 1,
        'html' => 0,
        'strip_tags' => 0,
      ),
      'empty' => '',
      'hide_empty' => 0,
      'empty_zero' => 0,
      'set_precision' => FALSE,
      'precision' => 0,
      'decimal' => '.',
      'separator' => ',',
      'prefix' => '',
      'suffix' => '',
      'exclude' => 0,
      'id' => 'total_paid',
      'table' => 'pay_transaction',
      'field' => 'total_paid',
      'relationship' => 'none',
    ),
    'view_link' => array(
      'label' => '',
      'alter' => array(
        'alter_text' => 0,
        'text' => '',
        'make_link' => 0,
        'path' => '',
        'link_class' => '',
        'alt' => '',
        'prefix' => '',
        'suffix' => '',
        'target' => '',
        'help' => '',
        'trim' => 0,
        'max_length' => '',
        'word_boundary' => 1,
        'ellipsis' => 1,
        'html' => 0,
        'strip_tags' => 0,
      ),
      'empty' => '',
      'hide_empty' => 0,
      'empty_zero' => 0,
      'text' => '',
      'exclude' => 0,
      'id' => 'view_link',
      'table' => 'pay_transaction',
      'field' => 'view_link',
      'relationship' => 'none',
    ),
  ));
  $handler
    ->override_option('sorts', array(
    'created' => array(
      'order' => 'DESC',
      'granularity' => 'second',
      'id' => 'created',
      'table' => 'pay_transaction',
      'field' => 'created',
      'relationship' => 'none',
    ),
  ));
  $handler
    ->override_option('access', array(
    'type' => 'perm',
    'perm' => 'view reports for any payment form',
  ));
  $handler
    ->override_option('cache', array(
    'type' => 'none',
  ));
  $handler
    ->override_option('title', 'Payment history');
  $handler
    ->override_option('items_per_page', 100);
  $handler
    ->override_option('use_pager', '1');
  $handler
    ->override_option('style_plugin', 'table');
  $handler
    ->override_option('style_options', array(
    'grouping' => '',
    'override' => 1,
    'sticky' => 0,
    'order' => 'asc',
    'columns' => array(
      'pxid' => 'pxid',
      'name' => 'name',
      'title' => 'title',
      'created' => 'created',
      'total' => 'total',
      'total_paid' => 'total_paid',
      'view_link' => 'view_link',
    ),
    'info' => array(
      'pxid' => array(
        'sortable' => 1,
        'separator' => '',
      ),
      'name' => array(
        'sortable' => 1,
        'separator' => '',
      ),
      'title' => array(
        'separator' => '',
      ),
      'created' => array(
        'sortable' => 1,
        'separator' => '',
      ),
      'total' => array(
        'sortable' => 1,
        'separator' => '',
      ),
      'total_paid' => array(
        'sortable' => 1,
        'separator' => '',
      ),
      'view_link' => array(
        'separator' => '',
      ),
    ),
    'default' => 'pxid',
  ));
  $handler = $view
    ->new_display('page', 'Payment overview', 'page_1');
  $handler
    ->override_option('path', 'admin/reports/payments');
  $handler
    ->override_option('menu', array(
    'type' => 'normal',
    'title' => 'Payments',
    'description' => '',
    'weight' => '-20',
    'name' => 'management',
    'description' => 'View payment transactions.',
  ));
  $handler
    ->override_option('tab_options', array(
    'type' => 'none',
    'title' => '',
    'description' => '',
    'weight' => 0,
    'name' => 'navigation',
  ));
  $views[$view->name] = $view;
  return $views;
}