Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $view = new view;
- $view->name = 'eventreport';
- $view->description = 'Event Report';
- $view->tag = '';
- $view->base_table = 'civicrm_participant';
- $view->core = 6;
- $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('fields', array(
- 'id' => array(
- 'label' => 'Participant ID',
- 'alter' => array(
- 'alter_text' => 0,
- 'text' => '',
- 'make_link' => 0,
- 'path' => '',
- 'absolute' => 0,
- 'link_class' => '',
- 'alt' => '',
- 'rel' => '',
- '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,
- 'hide_alter_empty' => 1,
- 'set_precision' => FALSE,
- 'precision' => 0,
- 'decimal' => '.',
- 'separator' => '',
- 'format_plural' => 0,
- 'format_plural_singular' => '1',
- 'format_plural_plural' => '@count',
- 'prefix' => '',
- 'suffix' => '',
- 'exclude' => 1,
- 'id' => 'id',
- 'table' => 'civicrm_participant',
- 'field' => 'id',
- 'relationship' => 'none',
- ),
- 'id_1' => array(
- 'label' => 'Event ID',
- 'alter' => array(
- 'alter_text' => 0,
- 'text' => '',
- 'make_link' => 0,
- 'path' => '',
- 'absolute' => 0,
- 'link_class' => '',
- 'alt' => '',
- 'rel' => '',
- '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,
- 'hide_alter_empty' => 1,
- 'set_precision' => FALSE,
- 'precision' => 0,
- 'decimal' => '.',
- 'separator' => '',
- 'format_plural' => 0,
- 'format_plural_singular' => '1',
- 'format_plural_plural' => '@count',
- 'prefix' => '',
- 'suffix' => '',
- 'exclude' => 1,
- 'id' => 'id_1',
- 'table' => 'civicrm_event',
- 'field' => 'id',
- 'relationship' => 'none',
- ),
- 'id_2' => array(
- 'label' => 'Contact ID',
- 'alter' => array(
- 'alter_text' => 0,
- 'text' => '',
- 'make_link' => 0,
- 'path' => '',
- 'absolute' => 0,
- 'link_class' => '',
- 'alt' => '',
- 'rel' => '',
- '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,
- 'hide_alter_empty' => 1,
- 'set_precision' => FALSE,
- 'precision' => 0,
- 'decimal' => '.',
- 'separator' => '',
- 'format_plural' => 0,
- 'format_plural_singular' => '1',
- 'format_plural_plural' => '@count',
- 'prefix' => '',
- 'suffix' => '',
- 'exclude' => 1,
- 'id' => 'id_2',
- 'table' => 'civicrm_contact',
- 'field' => 'id',
- 'relationship' => 'none',
- ),
- 'source' => array(
- 'label' => 'Source',
- 'alter' => array(
- 'alter_text' => 0,
- 'text' => '',
- 'make_link' => 0,
- 'path' => '',
- 'absolute' => 0,
- 'link_class' => '',
- 'alt' => '',
- 'rel' => '',
- '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,
- 'hide_alter_empty' => 1,
- 'exclude' => 1,
- 'id' => 'source',
- 'table' => 'civicrm_participant',
- 'field' => 'source',
- 'relationship' => 'none',
- ),
- 'status' => array(
- 'id' => 'status',
- 'table' => 'civicrm_participant',
- 'field' => 'status',
- 'exclude' => 1,
- 'relationship' => 'none',
- 'label' => 'Status',
- 'alter' => array(
- 'alter_text' => 0,
- 'text' => '',
- 'make_link' => 0,
- 'path' => '',
- 'absolute' => 0,
- 'link_class' => '',
- 'alt' => '',
- 'rel' => '',
- 'prefix' => '',
- 'suffix' => '',
- 'target' => '',
- 'help' => '',
- 'trim' => 0,
- 'max_length' => '',
- 'word_boundary' => 0,
- 'ellipsis' => 0,
- 'html' => 0,
- 'strip_tags' => 0,
- ),
- 'empty' => '',
- 'empty_zero' => 0,
- 'hide_empty' => 0,
- 'hide_alter_empty' => 0,
- ),
- 'last_name' => array(
- 'id' => 'last_name',
- 'table' => 'civicrm_contact',
- 'field' => 'last_name',
- ),
- 'first_name' => array(
- 'id' => 'first_name',
- 'table' => 'civicrm_contact',
- 'field' => 'first_name',
- ),
- 'php' => array(
- 'label' => 'Total Tickets',
- 'alter' => array(
- 'alter_text' => 0,
- 'text' => '',
- 'make_link' => 0,
- 'path' => '',
- 'absolute' => 0,
- 'link_class' => '',
- 'alt' => '',
- 'rel' => '',
- '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,
- 'hide_alter_empty' => 1,
- 'use_php_setup' => 1,
- 'php_setup' => 'if (module_exists(\'civicrm\')) {
- civicrm_initialize(TRUE);
- require_once \'CRM/Event/BAO/Event.php\';
- }
- define(\'ft_check\', \'civicrm\');
- require_once(\'fusionticket/includes/classes/class.router.php\');
- require_once(\'fusionticket/includes/classes/model.seat.php\');',
- 'php_value' => 'if (module_exists(\'civicrm\')) {
- $participantSeats = CRM_Event_BAO_Event::eventTotalSeats($row->id_1, \'participant.id = \' . $row->id);
- return $participantSeats;
- }',
- 'php_output' => '<?php
- $seats = Seat::loadAllOrder($row->id);
- $seattable = \'\';
- if ($seats) {
- $seattable = \'<table>\';
- foreach ($seats as $seatid => $seat) {
- if ($seat->seat_nr && $seat->seat_row_nr) {
- $seattable .= \'<tr><td>\' . $seat->pmz_name . \'</td>\';
- $seattable .= \'<td>\' . $seat->seat_row_nr . \'</td>\';
- $seattable .= \'<td>\' . $seat->seat_nr . \'</td></tr>\';
- }
- }
- $seattable .= \'</table>\';
- }
- $seatarr[] = Array(\'seat_nr\' => $seat->seat_nr,
- \'seat_row_nr\' => $seat->seat_row_nr,
- \'pmz_name\' => $seat->pmz_name);
- }
- }
- print $seattable . $value;',
- 'use_php_click_sortable' => '0',
- 'php_click_sortable' => '',
- 'exclude' => 0,
- 'id' => 'php',
- 'table' => 'views',
- 'field' => 'php',
- 'relationship' => 'none',
- ),
- 'php_1' => array(
- 'label' => 'Source',
- 'alter' => array(
- 'alter_text' => 0,
- 'text' => '',
- 'make_link' => 0,
- 'path' => '',
- 'absolute' => 0,
- 'link_class' => '',
- 'alt' => '',
- 'rel' => '',
- '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,
- 'hide_alter_empty' => 1,
- 'use_php_setup' => 0,
- 'php_setup' => '',
- 'php_value' => 'if (false === strpos($row->source, "Online Event Registration")) return $row->source;
- else return "Online Event Registration";',
- 'php_output' => '',
- 'use_php_click_sortable' => '0',
- 'php_click_sortable' => '',
- 'exclude' => 0,
- 'id' => 'php_1',
- 'table' => 'views',
- 'field' => 'php',
- 'relationship' => 'none',
- ),
- 'register_date' => array(
- 'label' => 'Purchase Date',
- 'alter' => array(
- 'alter_text' => 0,
- 'text' => '',
- 'make_link' => 0,
- 'path' => '',
- 'absolute' => 0,
- 'link_class' => '',
- 'alt' => '',
- 'rel' => '',
- '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,
- 'hide_alter_empty' => 1,
- 'date_format' => 'small',
- 'custom_date_format' => '',
- 'exclude' => 0,
- 'id' => 'register_date',
- 'table' => 'civicrm_participant',
- 'field' => 'register_date',
- 'relationship' => 'none',
- ),
- ));
- $handler->override_option('sorts', array(
- 'sort_name' => array(
- 'order' => 'ASC',
- 'id' => 'sort_name',
- 'table' => 'civicrm_contact',
- 'field' => 'sort_name',
- 'relationship' => 'none',
- ),
- ));
- $handler->override_option('arguments', array(
- 'id' => array(
- 'default_action' => 'not found',
- 'style_plugin' => 'default_summary',
- 'style_options' => array(),
- 'wildcard' => 'all',
- 'wildcard_substitution' => 'All',
- 'title' => '',
- 'breadcrumb' => '',
- 'default_argument_type' => 'fixed',
- 'default_argument' => '',
- 'validate_type' => 'none',
- 'validate_fail' => 'not found',
- 'break_phrase' => 0,
- 'not' => 0,
- 'id' => 'id',
- 'table' => 'civicrm_event',
- 'field' => 'id',
- 'validate_user_argument_type' => 'uid',
- 'validate_user_roles' => array(
- 2 => 0,
- 3 => 0,
- ),
- 'relationship' => 'none',
- 'default_options_div_prefix' => '',
- 'default_taxonomy_tid_term_page' => 0,
- 'default_taxonomy_tid_node' => 0,
- 'default_taxonomy_tid_limit' => 0,
- 'default_taxonomy_tid_vids' => array(),
- 'default_argument_user' => 0,
- 'default_argument_fixed' => '132',
- 'default_argument_php' => '',
- 'validate_argument_node_type' => array(
- 'page' => 0,
- 'story' => 0,
- 'webform' => 0,
- ),
- 'validate_argument_node_access' => 0,
- 'validate_argument_nid_type' => 'nid',
- 'validate_argument_vocabulary' => array(),
- 'validate_argument_type' => 'tid',
- 'validate_argument_transform' => 0,
- 'validate_user_restrict_roles' => 0,
- 'validate_argument_php' => '',
- ),
- ));
- $handler->override_option('filters', array(
- 'register_date' => array(
- 'operator' => '>=',
- 'value' => array(
- 'type' => 'date',
- 'value' => '2000-01-01 00:00:00',
- 'min' => '',
- 'max' => '',
- ),
- 'group' => '0',
- 'exposed' => TRUE,
- 'expose' => array(
- 'use_operator' => 0,
- 'operator' => 'register_date_op',
- 'identifier' => 'register_date',
- 'label' => 'CiviCRM Participants: Register Date',
- 'optional' => 1,
- 'remember' => 0,
- ),
- 'id' => 'register_date',
- 'table' => 'civicrm_participant',
- 'field' => 'register_date',
- 'relationship' => 'none',
- ),
- ));
- $handler->override_option('access', array(
- 'type' => 'role',
- 'role' => array(
- 3 => 3,
- 2 => 2,
- ),
- ));
- $handler->override_option('cache', array(
- 'type' => 'none',
- ));
- $handler->override_option('header', '<?php
- require_once(\'api/v2/Event.php\');
- $view = views_get_current_view();
- $params = array ( \'id\' => $view->args[0] );
- $event = civicrm_event_get($params);
- print "<h2>" . $event["title"] . "</h2>";
- ?>');
- $handler->override_option('header_format', '2');
- $handler->override_option('header_empty', 0);
- $handler->override_option('use_ajax', TRUE);
- $handler->override_option('items_per_page', 0);
- $handler->override_option('row_options', array(
- 'inline' => array(
- 'last_name' => 'last_name',
- 'first_name' => 'first_name',
- 'php' => 'php',
- 'php_1' => 'php_1',
- 'register_date' => 'register_date',
- ),
- 'separator' => '',
- 'hide_empty' => 0,
- ));
- $handler = $view->new_display('page', 'Event Report', 'page_1');
- $handler->override_option('fields', array(
- 'id' => array(
- 'label' => 'Participant ID',
- 'alter' => array(
- 'alter_text' => 0,
- 'text' => '',
- 'make_link' => 0,
- 'path' => '',
- 'absolute' => 0,
- 'link_class' => '',
- 'alt' => '',
- 'rel' => '',
- '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,
- 'hide_alter_empty' => 1,
- 'set_precision' => FALSE,
- 'precision' => 0,
- 'decimal' => '.',
- 'separator' => '',
- 'format_plural' => 0,
- 'format_plural_singular' => '1',
- 'format_plural_plural' => '@count',
- 'prefix' => '',
- 'suffix' => '',
- 'exclude' => 1,
- 'id' => 'id',
- 'table' => 'civicrm_participant',
- 'field' => 'id',
- 'relationship' => 'none',
- 'override' => array(
- 'button' => 'Use default',
- ),
- ),
- 'id_1' => array(
- 'label' => 'Event ID',
- 'alter' => array(
- 'alter_text' => 0,
- 'text' => '',
- 'make_link' => 0,
- 'path' => '',
- 'absolute' => 0,
- 'link_class' => '',
- 'alt' => '',
- 'rel' => '',
- '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,
- 'hide_alter_empty' => 1,
- 'set_precision' => FALSE,
- 'precision' => 0,
- 'decimal' => '.',
- 'separator' => '',
- 'format_plural' => 0,
- 'format_plural_singular' => '1',
- 'format_plural_plural' => '@count',
- 'prefix' => '',
- 'suffix' => '',
- 'exclude' => 1,
- 'id' => 'id_1',
- 'table' => 'civicrm_event',
- 'field' => 'id',
- 'relationship' => 'none',
- 'override' => array(
- 'button' => 'Use default',
- ),
- ),
- 'id_2' => array(
- 'label' => 'Contact ID',
- 'alter' => array(
- 'alter_text' => 0,
- 'text' => '',
- 'make_link' => 0,
- 'path' => '',
- 'absolute' => 0,
- 'link_class' => '',
- 'alt' => '',
- 'rel' => '',
- '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,
- 'hide_alter_empty' => 1,
- 'set_precision' => FALSE,
- 'precision' => 0,
- 'decimal' => '.',
- 'separator' => '',
- 'format_plural' => 0,
- 'format_plural_singular' => '1',
- 'format_plural_plural' => '@count',
- 'prefix' => '',
- 'suffix' => '',
- 'exclude' => 1,
- 'id' => 'id_2',
- 'table' => 'civicrm_contact',
- 'field' => 'id',
- 'override' => array(
- 'button' => 'Use default',
- ),
- 'relationship' => 'none',
- ),
- 'source' => array(
- 'label' => 'Source',
- 'alter' => array(
- 'alter_text' => 0,
- 'text' => '',
- 'make_link' => 0,
- 'path' => '',
- 'absolute' => 0,
- 'link_class' => '',
- 'alt' => '',
- 'rel' => '',
- '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,
- 'hide_alter_empty' => 1,
- 'exclude' => 1,
- 'id' => 'source',
- 'table' => 'civicrm_participant',
- 'field' => 'source',
- 'relationship' => 'none',
- ),
- 'last_name' => array(
- 'label' => 'Last Name',
- 'alter' => array(
- 'alter_text' => 0,
- 'text' => '',
- 'make_link' => 0,
- 'path' => '',
- 'absolute' => 0,
- 'link_class' => '',
- 'alt' => '',
- 'rel' => '',
- '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,
- 'hide_alter_empty' => 1,
- 'link_to_civicrm_contact' => 0,
- 'exclude' => 1,
- 'id' => 'last_name',
- 'table' => 'civicrm_contact',
- 'field' => 'last_name',
- 'override' => array(
- 'button' => 'Use default',
- ),
- 'relationship' => 'none',
- ),
- 'php_2' => array(
- 'label' => 'Last Name',
- 'alter' => array(
- 'alter_text' => 0,
- 'text' => '',
- 'make_link' => 0,
- 'path' => '',
- 'absolute' => 0,
- 'link_class' => '',
- 'alt' => '',
- 'rel' => '',
- '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,
- 'hide_alter_empty' => 1,
- 'use_php_setup' => 0,
- 'php_setup' => '',
- 'php_value' => '',
- 'php_output' => '<a href="#" onclick="toggleParticipant(<?php print $row->id; ?>); return false;"><?php print $row->last_name; ?></a>',
- 'use_php_click_sortable' => '0',
- 'php_click_sortable' => '',
- 'exclude' => 0,
- 'id' => 'php_2',
- 'table' => 'views',
- 'field' => 'php',
- 'override' => array(
- 'button' => 'Use default',
- ),
- 'relationship' => 'none',
- ),
- 'first_name' => array(
- 'label' => 'First Name',
- 'alter' => array(
- 'alter_text' => 0,
- 'text' => '',
- 'make_link' => 0,
- 'path' => '',
- 'absolute' => 0,
- 'link_class' => '',
- 'alt' => '',
- 'rel' => '',
- '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,
- 'hide_alter_empty' => 1,
- 'link_to_civicrm_contact' => 0,
- 'exclude' => 0,
- 'id' => 'first_name',
- 'table' => 'civicrm_contact',
- 'field' => 'first_name',
- 'override' => array(
- 'button' => 'Use default',
- ),
- 'relationship' => 'none',
- ),
- 'status' => array(
- 'id' => 'status',
- 'table' => 'civicrm_participant',
- 'field' => 'status',
- 'exclude' => 1,
- 'relationship' => 'none',
- 'label' => 'Status',
- 'alter' => array(
- 'alter_text' => 0,
- 'text' => '',
- 'make_link' => 0,
- 'path' => '',
- 'absolute' => 0,
- 'link_class' => '',
- 'alt' => '',
- 'rel' => '',
- 'prefix' => '',
- 'suffix' => '',
- 'target' => '',
- 'help' => '',
- 'trim' => 0,
- 'max_length' => '',
- 'word_boundary' => 0,
- 'ellipsis' => 0,
- 'html' => 0,
- 'strip_tags' => 0,
- ),
- 'empty' => '',
- 'empty_zero' => 0,
- 'hide_empty' => 0,
- 'hide_alter_empty' => 0,
- ),
- 'php' => array(
- 'label' => 'Count',
- 'alter' => array(
- 'alter_text' => 0,
- 'text' => '',
- 'make_link' => 1,
- 'path' => 'civicrm/contact/view/participant?reset=1&id=[id]&cid=[id_2]&action=view&context=participant&selectedChild=event',
- 'absolute' => 0,
- 'link_class' => '',
- 'alt' => '',
- 'rel' => '',
- '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,
- 'hide_alter_empty' => 1,
- 'use_php_setup' => 1,
- 'php_setup' => 'if (module_exists(\'civicrm\')) {
- civicrm_initialize(TRUE);
- require_once \'CRM/Event/BAO/Event.php\';
- }
- ',
- 'php_value' => 'if (module_exists(\'civicrm\')) {
- $participantSeats = CRM_Event_BAO_Event::eventTotalSeats($row->id_1, \'participant.id = \' . $row->id);
- return $participantSeats;
- }',
- 'php_output' => '',
- 'use_php_click_sortable' => '0',
- 'php_click_sortable' => '',
- 'exclude' => 0,
- 'id' => 'php',
- 'table' => 'views',
- 'field' => 'php',
- 'relationship' => 'none',
- 'override' => array(
- 'button' => 'Use default',
- ),
- ),
- 'php_3' => array(
- 'label' => 'Seats',
- 'alter' => array(
- 'alter_text' => 0,
- 'text' => '',
- 'make_link' => 0,
- 'path' => '',
- 'absolute' => 0,
- 'link_class' => '',
- 'alt' => '',
- 'rel' => '',
- '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,
- 'hide_alter_empty' => 1,
- 'use_php_setup' => 0,
- 'php_setup' => 'define(\'ft_check\', \'civicrm\');
- require_once(\'fusionticket/includes/classes/class.router.php\');
- require_once(\'fusionticket/includes/classes/model.seat.php\');
- function getRanges($myarr) {
- $ranges = \'\';
- for ($i=0; $i<count($myarr); $i++) {
- $rstart = $myarr[$i];
- $rend = $rstart;
- while ($myarr[$i + 1] - $myarr[$i] == 1) {
- $rend = $myarr[$i + 1];
- $i++;
- }
- if ($rstart == $rend) {
- $ranges .= $rstart;
- }
- else {
- $ranges .= $rstart . \'—\' . $rend;
- }
- if ($myarr[$i] !== end($myarr)) {
- $ranges .= \', \';
- }
- }
- return $ranges;
- }
- ',
- 'php_value' => '$seats = Seat::loadAllOrder($row->id);
- $seatarr = array();
- foreach ($seats as $seat) {
- if (empty($seatarr[$seat->pmz_name])) {
- $seatarr[$seat->pmz_name] = array();
- }
- if (empty($seatarr[$seat->pmz_name][$seat->seat_row_nr])) {
- $seatarr[$seat->pmz_name][$seat->seat_row_nr] = array();
- }
- array_push($seatarr[$seat->pmz_name][$seat->seat_row_nr], $seat->seat_nr);
- }
- return $seatarr; ',
- 'php_output' => '<?php
- print \'<span style="white-space: nowrap;">\';
- foreach ($value as $zone => $rows) {
- ksort($rows);
- foreach ($rows as $row => $seats) {
- sort($seats);
- print $zone . \' <b>:</b> \' . $row . \' <b>:</b> \' . getRanges($seats) . \'<br>\';
- }
- }
- print \'</span>\';
- ?>',
- 'use_php_click_sortable' => '0',
- 'php_click_sortable' => '',
- 'exclude' => 0,
- 'id' => 'php_3',
- 'table' => 'views',
- 'field' => 'php',
- 'override' => array(
- 'button' => 'Use default',
- ),
- 'relationship' => 'none',
- ),
- 'php_1' => array(
- 'label' => 'Source',
- 'alter' => array(
- 'alter_text' => 0,
- 'text' => '',
- 'make_link' => 0,
- 'path' => '',
- 'absolute' => 0,
- 'link_class' => '',
- 'alt' => '',
- 'rel' => '',
- '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,
- 'hide_alter_empty' => 1,
- 'use_php_setup' => 0,
- 'php_setup' => '',
- 'php_value' => 'preg_match(\'/Flex Pass \\d+|Online Event Registration/\', $row->source, $matches);
- if (!empty($matches[0])) return $matches[0];
- else return $row->source;
- ',
- 'php_output' => '',
- 'use_php_click_sortable' => '0',
- 'php_click_sortable' => '',
- 'exclude' => 0,
- 'id' => 'php_1',
- 'table' => 'views',
- 'field' => 'php',
- 'relationship' => 'none',
- 'override' => array(
- 'button' => 'Use default',
- ),
- ),
- 'register_date' => array(
- 'label' => 'Purchase Date',
- 'alter' => array(
- 'alter_text' => 0,
- 'text' => '',
- 'make_link' => 0,
- 'path' => '',
- 'absolute' => 0,
- 'link_class' => '',
- 'alt' => '',
- 'rel' => '',
- '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,
- 'hide_alter_empty' => 1,
- 'date_format' => 'small',
- 'custom_date_format' => '',
- 'exclude' => 0,
- 'id' => 'register_date',
- 'table' => 'civicrm_participant',
- 'field' => 'register_date',
- 'relationship' => 'none',
- ),
- ));
- $handler->override_option('header', '<?php
- if (module_exists(\'civicrm\')) {
- civicrm_initialize(TRUE);
- require_once \'CRM/Event/BAO/Event.php\';
- require_once(\'api/v2/Event.php\');
- $view = views_get_current_view();
- $eventID = $view->args[0];
- $params = array ( \'id\' => $eventID );
- $event = civicrm_event_get($params);
- print "<h2>" . $event["title"] . "</h2>";
- $totalSeats = CRM_Event_BAO_Event::eventTotalSeats($eventID);
- $checkedInSeats = CRM_Event_BAO_Event::eventTotalSeats($eventID, \'participant.status_id = 2\');
- print \'<table class="headertable"><tr><td><span id="actionstatus"></span></td><td> </td></tr>\';
- print \'<tr><td><span id="totalseats">Total seats sold: \' . $totalSeats . \'<br>\';
- print \'Seats checked in: \' . $checkedInSeats . \'</span></td>\';
- print \'<td><form name="scanform" onkeypress="return handleScan(document.scanform.scan.value, event)"><input type="text" id="scan" name="scan"></form></td></tr></table>\';
- }
- ?>');
- $handler->override_option('style_plugin', 'table_highlighter');
- $handler->override_option('style_options', array(
- 'grouping' => '',
- 'override' => 1,
- 'sticky' => 0,
- 'order' => 'asc',
- 'summary' => '',
- 'columns' => array(
- 'id' => 'id',
- 'id_1' => 'id_1',
- 'source' => 'source',
- 'last_name' => 'last_name',
- 'php_2' => 'php_2',
- 'first_name' => 'first_name',
- 'status' => 'status',
- 'php' => 'php',
- 'php_1' => 'php_1',
- 'register_date' => 'register_date',
- ),
- 'info' => array(
- 'id' => array(
- 'sortable' => 0,
- 'separator' => '',
- ),
- 'id_1' => array(
- 'sortable' => 0,
- 'separator' => '',
- ),
- 'source' => array(
- 'sortable' => 0,
- 'separator' => '',
- ),
- 'last_name' => array(
- 'sortable' => 0,
- 'separator' => '',
- ),
- 'php_2' => array(
- 'separator' => '',
- ),
- 'first_name' => array(
- 'sortable' => 0,
- 'separator' => '',
- ),
- 'status' => array(
- 'sortable' => 0,
- 'separator' => '',
- ),
- 'php' => array(
- 'separator' => '',
- ),
- 'php_1' => array(
- 'separator' => '',
- ),
- 'register_date' => array(
- 'sortable' => 0,
- 'separator' => '',
- ),
- ),
- 'default' => '-1',
- 'views_table_highlighter' => array(
- 'code' => 'if ($civicrm_participant_status_id == "1") return $id;
- else return $id . \'-strike\';',
- ),
- ));
- $handler->override_option('row_options', array(
- 'inline' => array(
- 'last_name' => 'last_name',
- 'first_name' => 'first_name',
- 'php' => 'php',
- 'source' => 'source',
- ),
- 'separator' => '',
- 'hide_empty' => 0,
- ));
- $handler->override_option('path', 'eventreport/%');
- $handler->override_option('menu', array(
- 'type' => 'none',
- 'title' => '',
- 'description' => '',
- 'weight' => 0,
- 'name' => 'navigation',
- ));
- $handler->override_option('tab_options', array(
- 'type' => 'none',
- 'title' => '',
- 'description' => '',
- 'weight' => 0,
- 'name' => 'navigation',
- ));
Advertisement
Add Comment
Please, Sign In to add comment