jcm55

Views2 / CiviCRM event check-in

Sep 19th, 2014
159
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. $view = new view;
  2. $view->name = 'eventreport';
  3. $view->description = 'Event Report';
  4. $view->tag = '';
  5. $view->base_table = 'civicrm_participant';
  6. $view->core = 6;
  7. $view->api_version = '2';
  8. $view->disabled = FALSE; /* Edit this to true to make a default view disabled initially */
  9. $handler = $view->new_display('default', 'Defaults', 'default');
  10. $handler->override_option('fields', array(
  11.   'id' => array(
  12.     'label' => 'Participant ID',
  13.     'alter' => array(
  14.       'alter_text' => 0,
  15.       'text' => '',
  16.       'make_link' => 0,
  17.       'path' => '',
  18.       'absolute' => 0,
  19.       'link_class' => '',
  20.       'alt' => '',
  21.       'rel' => '',
  22.       'prefix' => '',
  23.       'suffix' => '',
  24.       'target' => '',
  25.       'help' => '',
  26.       'trim' => 0,
  27.       'max_length' => '',
  28.       'word_boundary' => 1,
  29.       'ellipsis' => 1,
  30.       'html' => 0,
  31.       'strip_tags' => 0,
  32.     ),
  33.     'empty' => '',
  34.     'hide_empty' => 0,
  35.     'empty_zero' => 0,
  36.     'hide_alter_empty' => 1,
  37.     'set_precision' => FALSE,
  38.     'precision' => 0,
  39.     'decimal' => '.',
  40.     'separator' => '',
  41.     'format_plural' => 0,
  42.     'format_plural_singular' => '1',
  43.     'format_plural_plural' => '@count',
  44.     'prefix' => '',
  45.     'suffix' => '',
  46.     'exclude' => 1,
  47.     'id' => 'id',
  48.     'table' => 'civicrm_participant',
  49.     'field' => 'id',
  50.     'relationship' => 'none',
  51.   ),
  52.   'id_1' => array(
  53.     'label' => 'Event ID',
  54.     'alter' => array(
  55.       'alter_text' => 0,
  56.       'text' => '',
  57.       'make_link' => 0,
  58.       'path' => '',
  59.       'absolute' => 0,
  60.       'link_class' => '',
  61.       'alt' => '',
  62.       'rel' => '',
  63.       'prefix' => '',
  64.       'suffix' => '',
  65.       'target' => '',
  66.       'help' => '',
  67.       'trim' => 0,
  68.       'max_length' => '',
  69.       'word_boundary' => 1,
  70.       'ellipsis' => 1,
  71.       'html' => 0,
  72.       'strip_tags' => 0,
  73.     ),
  74.     'empty' => '',
  75.     'hide_empty' => 0,
  76.     'empty_zero' => 0,
  77.     'hide_alter_empty' => 1,
  78.     'set_precision' => FALSE,
  79.     'precision' => 0,
  80.     'decimal' => '.',
  81.     'separator' => '',
  82.     'format_plural' => 0,
  83.     'format_plural_singular' => '1',
  84.     'format_plural_plural' => '@count',
  85.     'prefix' => '',
  86.     'suffix' => '',
  87.     'exclude' => 1,
  88.     'id' => 'id_1',
  89.     'table' => 'civicrm_event',
  90.     'field' => 'id',
  91.     'relationship' => 'none',
  92.   ),
  93.   'id_2' => array(
  94.     'label' => 'Contact ID',
  95.     'alter' => array(
  96.       'alter_text' => 0,
  97.       'text' => '',
  98.       'make_link' => 0,
  99.       'path' => '',
  100.       'absolute' => 0,
  101.       'link_class' => '',
  102.       'alt' => '',
  103.       'rel' => '',
  104.       'prefix' => '',
  105.       'suffix' => '',
  106.       'target' => '',
  107.       'help' => '',
  108.       'trim' => 0,
  109.       'max_length' => '',
  110.       'word_boundary' => 1,
  111.       'ellipsis' => 1,
  112.       'html' => 0,
  113.       'strip_tags' => 0,
  114.     ),
  115.     'empty' => '',
  116.     'hide_empty' => 0,
  117.     'empty_zero' => 0,
  118.     'hide_alter_empty' => 1,
  119.     'set_precision' => FALSE,
  120.     'precision' => 0,
  121.     'decimal' => '.',
  122.     'separator' => '',
  123.     'format_plural' => 0,
  124.     'format_plural_singular' => '1',
  125.     'format_plural_plural' => '@count',
  126.     'prefix' => '',
  127.     'suffix' => '',
  128.     'exclude' => 1,
  129.     'id' => 'id_2',
  130.     'table' => 'civicrm_contact',
  131.     'field' => 'id',
  132.     'relationship' => 'none',
  133.   ),
  134.   'source' => array(
  135.     'label' => 'Source',
  136.     'alter' => array(
  137.       'alter_text' => 0,
  138.       'text' => '',
  139.       'make_link' => 0,
  140.       'path' => '',
  141.       'absolute' => 0,
  142.       'link_class' => '',
  143.       'alt' => '',
  144.       'rel' => '',
  145.       'prefix' => '',
  146.       'suffix' => '',
  147.       'target' => '',
  148.       'help' => '',
  149.       'trim' => 0,
  150.       'max_length' => '',
  151.       'word_boundary' => 1,
  152.       'ellipsis' => 1,
  153.       'html' => 0,
  154.       'strip_tags' => 0,
  155.     ),
  156.     'empty' => '',
  157.     'hide_empty' => 0,
  158.     'empty_zero' => 0,
  159.     'hide_alter_empty' => 1,
  160.     'exclude' => 1,
  161.     'id' => 'source',
  162.     'table' => 'civicrm_participant',
  163.     'field' => 'source',
  164.     'relationship' => 'none',
  165.   ),
  166.   'status' => array(
  167.     'id' => 'status',
  168.     'table' => 'civicrm_participant',
  169.     'field' => 'status',
  170.     'exclude' => 1,
  171.     'relationship' => 'none',
  172.     'label' => 'Status',
  173.     'alter' => array(
  174.       'alter_text' => 0,
  175.       'text' => '',
  176.       'make_link' => 0,
  177.       'path' => '',
  178.       'absolute' => 0,
  179.       'link_class' => '',
  180.       'alt' => '',
  181.       'rel' => '',
  182.       'prefix' => '',
  183.       'suffix' => '',
  184.       'target' => '',
  185.       'help' => '',
  186.       'trim' => 0,
  187.       'max_length' => '',
  188.       'word_boundary' => 0,
  189.       'ellipsis' => 0,
  190.       'html' => 0,
  191.       'strip_tags' => 0,
  192.     ),
  193.     'empty' => '',
  194.     'empty_zero' => 0,
  195.     'hide_empty' => 0,
  196.     'hide_alter_empty' => 0,
  197.   ),
  198.   'last_name' => array(
  199.     'id' => 'last_name',
  200.     'table' => 'civicrm_contact',
  201.     'field' => 'last_name',
  202.   ),
  203.   'first_name' => array(
  204.     'id' => 'first_name',
  205.     'table' => 'civicrm_contact',
  206.     'field' => 'first_name',
  207.   ),
  208.   'php' => array(
  209.     'label' => 'Total Tickets',
  210.     'alter' => array(
  211.       'alter_text' => 0,
  212.       'text' => '',
  213.       'make_link' => 0,
  214.       'path' => '',
  215.       'absolute' => 0,
  216.       'link_class' => '',
  217.       'alt' => '',
  218.       'rel' => '',
  219.       'prefix' => '',
  220.       'suffix' => '',
  221.       'target' => '',
  222.       'help' => '',
  223.       'trim' => 0,
  224.       'max_length' => '',
  225.       'word_boundary' => 1,
  226.       'ellipsis' => 1,
  227.       'html' => 0,
  228.       'strip_tags' => 0,
  229.     ),
  230.     'empty' => '',
  231.     'hide_empty' => 0,
  232.     'empty_zero' => 0,
  233.     'hide_alter_empty' => 1,
  234.     'use_php_setup' => 1,
  235.     'php_setup' => 'if (module_exists(\'civicrm\')) {
  236.   civicrm_initialize(TRUE);
  237.   require_once \'CRM/Event/BAO/Event.php\';
  238. }
  239.  
  240. define(\'ft_check\', \'civicrm\');
  241. require_once(\'fusionticket/includes/classes/class.router.php\');
  242. require_once(\'fusionticket/includes/classes/model.seat.php\');',
  243.     'php_value' => 'if (module_exists(\'civicrm\')) {
  244.   $participantSeats = CRM_Event_BAO_Event::eventTotalSeats($row->id_1, \'participant.id = \' . $row->id);
  245.   return $participantSeats;
  246. }',
  247.     'php_output' => '<?php
  248. $seats = Seat::loadAllOrder($row->id);
  249. $seattable = \'\';
  250. if ($seats) {
  251.    $seattable = \'<table>\';
  252.    foreach ($seats as $seatid => $seat) {
  253.      if ($seat->seat_nr && $seat->seat_row_nr) {
  254.        $seattable .= \'<tr><td>\' . $seat->pmz_name . \'</td>\';
  255.        $seattable .= \'<td>\' . $seat->seat_row_nr . \'</td>\';
  256.        $seattable .= \'<td>\' . $seat->seat_nr . \'</td></tr>\';
  257.      }
  258.    }
  259.    $seattable .= \'</table>\';
  260. }
  261.  
  262.        $seatarr[] = Array(\'seat_nr\' => $seat->seat_nr,
  263.          \'seat_row_nr\' => $seat->seat_row_nr,
  264.          \'pmz_name\' => $seat->pmz_name);
  265.      }
  266.    }
  267. print $seattable . $value;',
  268.     'use_php_click_sortable' => '0',
  269.     'php_click_sortable' => '',
  270.     'exclude' => 0,
  271.     'id' => 'php',
  272.     'table' => 'views',
  273.     'field' => 'php',
  274.     'relationship' => 'none',
  275.   ),
  276.   'php_1' => array(
  277.     'label' => 'Source',
  278.     'alter' => array(
  279.       'alter_text' => 0,
  280.       'text' => '',
  281.       'make_link' => 0,
  282.       'path' => '',
  283.       'absolute' => 0,
  284.       'link_class' => '',
  285.       'alt' => '',
  286.       'rel' => '',
  287.       'prefix' => '',
  288.       'suffix' => '',
  289.       'target' => '',
  290.       'help' => '',
  291.       'trim' => 0,
  292.       'max_length' => '',
  293.       'word_boundary' => 1,
  294.       'ellipsis' => 1,
  295.       'html' => 0,
  296.       'strip_tags' => 0,
  297.     ),
  298.     'empty' => '',
  299.     'hide_empty' => 0,
  300.     'empty_zero' => 0,
  301.     'hide_alter_empty' => 1,
  302.     'use_php_setup' => 0,
  303.     'php_setup' => '',
  304.     'php_value' => 'if (false === strpos($row->source, "Online Event Registration")) return $row->source;
  305. else return "Online Event Registration";',
  306.     'php_output' => '',
  307.     'use_php_click_sortable' => '0',
  308.     'php_click_sortable' => '',
  309.     'exclude' => 0,
  310.     'id' => 'php_1',
  311.     'table' => 'views',
  312.     'field' => 'php',
  313.     'relationship' => 'none',
  314.   ),
  315.   'register_date' => array(
  316.     'label' => 'Purchase Date',
  317.     'alter' => array(
  318.       'alter_text' => 0,
  319.       'text' => '',
  320.       'make_link' => 0,
  321.       'path' => '',
  322.       'absolute' => 0,
  323.       'link_class' => '',
  324.       'alt' => '',
  325.       'rel' => '',
  326.       'prefix' => '',
  327.       'suffix' => '',
  328.       'target' => '',
  329.       'help' => '',
  330.       'trim' => 0,
  331.       'max_length' => '',
  332.       'word_boundary' => 1,
  333.       'ellipsis' => 1,
  334.       'html' => 0,
  335.       'strip_tags' => 0,
  336.     ),
  337.     'empty' => '',
  338.     'hide_empty' => 0,
  339.     'empty_zero' => 0,
  340.     'hide_alter_empty' => 1,
  341.     'date_format' => 'small',
  342.     'custom_date_format' => '',
  343.     'exclude' => 0,
  344.     'id' => 'register_date',
  345.     'table' => 'civicrm_participant',
  346.     'field' => 'register_date',
  347.     'relationship' => 'none',
  348.   ),
  349. ));
  350. $handler->override_option('sorts', array(
  351.   'sort_name' => array(
  352.     'order' => 'ASC',
  353.     'id' => 'sort_name',
  354.     'table' => 'civicrm_contact',
  355.     'field' => 'sort_name',
  356.     'relationship' => 'none',
  357.   ),
  358. ));
  359. $handler->override_option('arguments', array(
  360.   'id' => array(
  361.     'default_action' => 'not found',
  362.     'style_plugin' => 'default_summary',
  363.     'style_options' => array(),
  364.     'wildcard' => 'all',
  365.     'wildcard_substitution' => 'All',
  366.     'title' => '',
  367.     'breadcrumb' => '',
  368.     'default_argument_type' => 'fixed',
  369.     'default_argument' => '',
  370.     'validate_type' => 'none',
  371.     'validate_fail' => 'not found',
  372.     'break_phrase' => 0,
  373.     'not' => 0,
  374.     'id' => 'id',
  375.     'table' => 'civicrm_event',
  376.     'field' => 'id',
  377.     'validate_user_argument_type' => 'uid',
  378.     'validate_user_roles' => array(
  379.       2 => 0,
  380.       3 => 0,
  381.     ),
  382.     'relationship' => 'none',
  383.     'default_options_div_prefix' => '',
  384.     'default_taxonomy_tid_term_page' => 0,
  385.     'default_taxonomy_tid_node' => 0,
  386.     'default_taxonomy_tid_limit' => 0,
  387.     'default_taxonomy_tid_vids' => array(),
  388.     'default_argument_user' => 0,
  389.     'default_argument_fixed' => '132',
  390.     'default_argument_php' => '',
  391.     'validate_argument_node_type' => array(
  392.       'page' => 0,
  393.       'story' => 0,
  394.       'webform' => 0,
  395.     ),
  396.     'validate_argument_node_access' => 0,
  397.     'validate_argument_nid_type' => 'nid',
  398.     'validate_argument_vocabulary' => array(),
  399.     'validate_argument_type' => 'tid',
  400.     'validate_argument_transform' => 0,
  401.     'validate_user_restrict_roles' => 0,
  402.     'validate_argument_php' => '',
  403.   ),
  404. ));
  405. $handler->override_option('filters', array(
  406.   'register_date' => array(
  407.     'operator' => '>=',
  408.     'value' => array(
  409.       'type' => 'date',
  410.       'value' => '2000-01-01 00:00:00',
  411.       'min' => '',
  412.       'max' => '',
  413.     ),
  414.     'group' => '0',
  415.     'exposed' => TRUE,
  416.     'expose' => array(
  417.       'use_operator' => 0,
  418.       'operator' => 'register_date_op',
  419.       'identifier' => 'register_date',
  420.       'label' => 'CiviCRM Participants: Register Date',
  421.       'optional' => 1,
  422.       'remember' => 0,
  423.     ),
  424.     'id' => 'register_date',
  425.     'table' => 'civicrm_participant',
  426.     'field' => 'register_date',
  427.     'relationship' => 'none',
  428.   ),
  429. ));
  430. $handler->override_option('access', array(
  431.   'type' => 'role',
  432.   'role' => array(
  433.     3 => 3,
  434.     2 => 2,
  435.   ),
  436. ));
  437. $handler->override_option('cache', array(
  438.   'type' => 'none',
  439. ));
  440. $handler->override_option('header', '<?php
  441. require_once(\'api/v2/Event.php\');
  442. $view = views_get_current_view();
  443. $params = array ( \'id\' => $view->args[0] );
  444. $event = civicrm_event_get($params);
  445. print "<h2>" . $event["title"] . "</h2>";
  446. ?>');
  447. $handler->override_option('header_format', '2');
  448. $handler->override_option('header_empty', 0);
  449. $handler->override_option('use_ajax', TRUE);
  450. $handler->override_option('items_per_page', 0);
  451. $handler->override_option('row_options', array(
  452.   'inline' => array(
  453.     'last_name' => 'last_name',
  454.     'first_name' => 'first_name',
  455.     'php' => 'php',
  456.     'php_1' => 'php_1',
  457.     'register_date' => 'register_date',
  458.   ),
  459.   'separator' => '',
  460.   'hide_empty' => 0,
  461. ));
  462. $handler = $view->new_display('page', 'Event Report', 'page_1');
  463. $handler->override_option('fields', array(
  464.   'id' => array(
  465.     'label' => 'Participant ID',
  466.     'alter' => array(
  467.       'alter_text' => 0,
  468.       'text' => '',
  469.       'make_link' => 0,
  470.       'path' => '',
  471.       'absolute' => 0,
  472.       'link_class' => '',
  473.       'alt' => '',
  474.       'rel' => '',
  475.       'prefix' => '',
  476.       'suffix' => '',
  477.       'target' => '',
  478.       'help' => '',
  479.       'trim' => 0,
  480.       'max_length' => '',
  481.       'word_boundary' => 1,
  482.       'ellipsis' => 1,
  483.       'html' => 0,
  484.       'strip_tags' => 0,
  485.     ),
  486.     'empty' => '',
  487.     'hide_empty' => 0,
  488.     'empty_zero' => 0,
  489.     'hide_alter_empty' => 1,
  490.     'set_precision' => FALSE,
  491.     'precision' => 0,
  492.     'decimal' => '.',
  493.     'separator' => '',
  494.     'format_plural' => 0,
  495.     'format_plural_singular' => '1',
  496.     'format_plural_plural' => '@count',
  497.     'prefix' => '',
  498.     'suffix' => '',
  499.     'exclude' => 1,
  500.     'id' => 'id',
  501.     'table' => 'civicrm_participant',
  502.     'field' => 'id',
  503.     'relationship' => 'none',
  504.     'override' => array(
  505.       'button' => 'Use default',
  506.     ),
  507.   ),
  508.   'id_1' => array(
  509.     'label' => 'Event ID',
  510.     'alter' => array(
  511.       'alter_text' => 0,
  512.       'text' => '',
  513.       'make_link' => 0,
  514.       'path' => '',
  515.       'absolute' => 0,
  516.       'link_class' => '',
  517.       'alt' => '',
  518.       'rel' => '',
  519.       'prefix' => '',
  520.       'suffix' => '',
  521.       'target' => '',
  522.       'help' => '',
  523.       'trim' => 0,
  524.       'max_length' => '',
  525.       'word_boundary' => 1,
  526.       'ellipsis' => 1,
  527.       'html' => 0,
  528.       'strip_tags' => 0,
  529.     ),
  530.     'empty' => '',
  531.     'hide_empty' => 0,
  532.     'empty_zero' => 0,
  533.     'hide_alter_empty' => 1,
  534.     'set_precision' => FALSE,
  535.     'precision' => 0,
  536.     'decimal' => '.',
  537.     'separator' => '',
  538.     'format_plural' => 0,
  539.     'format_plural_singular' => '1',
  540.     'format_plural_plural' => '@count',
  541.     'prefix' => '',
  542.     'suffix' => '',
  543.     'exclude' => 1,
  544.     'id' => 'id_1',
  545.     'table' => 'civicrm_event',
  546.     'field' => 'id',
  547.     'relationship' => 'none',
  548.     'override' => array(
  549.       'button' => 'Use default',
  550.     ),
  551.   ),
  552.   'id_2' => array(
  553.     'label' => 'Contact ID',
  554.     'alter' => array(
  555.       'alter_text' => 0,
  556.       'text' => '',
  557.       'make_link' => 0,
  558.       'path' => '',
  559.       'absolute' => 0,
  560.       'link_class' => '',
  561.       'alt' => '',
  562.       'rel' => '',
  563.       'prefix' => '',
  564.       'suffix' => '',
  565.       'target' => '',
  566.       'help' => '',
  567.       'trim' => 0,
  568.       'max_length' => '',
  569.       'word_boundary' => 1,
  570.       'ellipsis' => 1,
  571.       'html' => 0,
  572.       'strip_tags' => 0,
  573.     ),
  574.     'empty' => '',
  575.     'hide_empty' => 0,
  576.     'empty_zero' => 0,
  577.     'hide_alter_empty' => 1,
  578.     'set_precision' => FALSE,
  579.     'precision' => 0,
  580.     'decimal' => '.',
  581.     'separator' => '',
  582.     'format_plural' => 0,
  583.     'format_plural_singular' => '1',
  584.     'format_plural_plural' => '@count',
  585.     'prefix' => '',
  586.     'suffix' => '',
  587.     'exclude' => 1,
  588.     'id' => 'id_2',
  589.     'table' => 'civicrm_contact',
  590.     'field' => 'id',
  591.     'override' => array(
  592.       'button' => 'Use default',
  593.     ),
  594.     'relationship' => 'none',
  595.   ),
  596.   'source' => array(
  597.     'label' => 'Source',
  598.     'alter' => array(
  599.       'alter_text' => 0,
  600.       'text' => '',
  601.       'make_link' => 0,
  602.       'path' => '',
  603.       'absolute' => 0,
  604.       'link_class' => '',
  605.       'alt' => '',
  606.       'rel' => '',
  607.       'prefix' => '',
  608.       'suffix' => '',
  609.       'target' => '',
  610.       'help' => '',
  611.       'trim' => 0,
  612.       'max_length' => '',
  613.       'word_boundary' => 1,
  614.       'ellipsis' => 1,
  615.       'html' => 0,
  616.       'strip_tags' => 0,
  617.     ),
  618.     'empty' => '',
  619.     'hide_empty' => 0,
  620.     'empty_zero' => 0,
  621.     'hide_alter_empty' => 1,
  622.     'exclude' => 1,
  623.     'id' => 'source',
  624.     'table' => 'civicrm_participant',
  625.     'field' => 'source',
  626.     'relationship' => 'none',
  627.   ),
  628.   'last_name' => array(
  629.     'label' => 'Last Name',
  630.     'alter' => array(
  631.       'alter_text' => 0,
  632.       'text' => '',
  633.       'make_link' => 0,
  634.       'path' => '',
  635.       'absolute' => 0,
  636.       'link_class' => '',
  637.       'alt' => '',
  638.       'rel' => '',
  639.       'prefix' => '',
  640.       'suffix' => '',
  641.       'target' => '',
  642.       'help' => '',
  643.       'trim' => 0,
  644.       'max_length' => '',
  645.       'word_boundary' => 1,
  646.       'ellipsis' => 1,
  647.       'html' => 0,
  648.       'strip_tags' => 0,
  649.     ),
  650.     'empty' => '',
  651.     'hide_empty' => 0,
  652.     'empty_zero' => 0,
  653.     'hide_alter_empty' => 1,
  654.     'link_to_civicrm_contact' => 0,
  655.     'exclude' => 1,
  656.     'id' => 'last_name',
  657.     'table' => 'civicrm_contact',
  658.     'field' => 'last_name',
  659.     'override' => array(
  660.       'button' => 'Use default',
  661.     ),
  662.     'relationship' => 'none',
  663.   ),
  664.   'php_2' => array(
  665.     'label' => 'Last Name',
  666.     'alter' => array(
  667.       'alter_text' => 0,
  668.       'text' => '',
  669.       'make_link' => 0,
  670.       'path' => '',
  671.       'absolute' => 0,
  672.       'link_class' => '',
  673.       'alt' => '',
  674.       'rel' => '',
  675.       'prefix' => '',
  676.       'suffix' => '',
  677.       'target' => '',
  678.       'help' => '',
  679.       'trim' => 0,
  680.       'max_length' => '',
  681.       'word_boundary' => 1,
  682.       'ellipsis' => 1,
  683.       'html' => 0,
  684.       'strip_tags' => 0,
  685.     ),
  686.     'empty' => '',
  687.     'hide_empty' => 0,
  688.     'empty_zero' => 0,
  689.     'hide_alter_empty' => 1,
  690.     'use_php_setup' => 0,
  691.     'php_setup' => '',
  692.     'php_value' => '',
  693.     'php_output' => '<a href="#" onclick="toggleParticipant(<?php print $row->id; ?>); return false;"><?php print $row->last_name; ?></a>',
  694.     'use_php_click_sortable' => '0',
  695.     'php_click_sortable' => '',
  696.     'exclude' => 0,
  697.     'id' => 'php_2',
  698.     'table' => 'views',
  699.     'field' => 'php',
  700.     'override' => array(
  701.       'button' => 'Use default',
  702.     ),
  703.     'relationship' => 'none',
  704.   ),
  705.   'first_name' => array(
  706.     'label' => 'First Name',
  707.     'alter' => array(
  708.       'alter_text' => 0,
  709.       'text' => '',
  710.       'make_link' => 0,
  711.       'path' => '',
  712.       'absolute' => 0,
  713.       'link_class' => '',
  714.       'alt' => '',
  715.       'rel' => '',
  716.       'prefix' => '',
  717.       'suffix' => '',
  718.       'target' => '',
  719.       'help' => '',
  720.       'trim' => 0,
  721.       'max_length' => '',
  722.       'word_boundary' => 1,
  723.       'ellipsis' => 1,
  724.       'html' => 0,
  725.       'strip_tags' => 0,
  726.     ),
  727.     'empty' => '',
  728.     'hide_empty' => 0,
  729.     'empty_zero' => 0,
  730.     'hide_alter_empty' => 1,
  731.     'link_to_civicrm_contact' => 0,
  732.     'exclude' => 0,
  733.     'id' => 'first_name',
  734.     'table' => 'civicrm_contact',
  735.     'field' => 'first_name',
  736.     'override' => array(
  737.       'button' => 'Use default',
  738.     ),
  739.     'relationship' => 'none',
  740.   ),
  741.   'status' => array(
  742.     'id' => 'status',
  743.     'table' => 'civicrm_participant',
  744.     'field' => 'status',
  745.     'exclude' => 1,
  746.     'relationship' => 'none',
  747.     'label' => 'Status',
  748.     'alter' => array(
  749.       'alter_text' => 0,
  750.       'text' => '',
  751.       'make_link' => 0,
  752.       'path' => '',
  753.       'absolute' => 0,
  754.       'link_class' => '',
  755.       'alt' => '',
  756.       'rel' => '',
  757.       'prefix' => '',
  758.       'suffix' => '',
  759.       'target' => '',
  760.       'help' => '',
  761.       'trim' => 0,
  762.       'max_length' => '',
  763.       'word_boundary' => 0,
  764.       'ellipsis' => 0,
  765.       'html' => 0,
  766.       'strip_tags' => 0,
  767.     ),
  768.     'empty' => '',
  769.     'empty_zero' => 0,
  770.     'hide_empty' => 0,
  771.     'hide_alter_empty' => 0,
  772.   ),
  773.   'php' => array(
  774.     'label' => 'Count',
  775.     'alter' => array(
  776.       'alter_text' => 0,
  777.       'text' => '',
  778.       'make_link' => 1,
  779.       'path' => 'civicrm/contact/view/participant?reset=1&id=[id]&cid=[id_2]&action=view&context=participant&selectedChild=event',
  780.       'absolute' => 0,
  781.       'link_class' => '',
  782.       'alt' => '',
  783.       'rel' => '',
  784.       'prefix' => '',
  785.       'suffix' => '',
  786.       'target' => '',
  787.       'help' => '',
  788.       'trim' => 0,
  789.       'max_length' => '',
  790.       'word_boundary' => 1,
  791.       'ellipsis' => 1,
  792.       'html' => 0,
  793.       'strip_tags' => 0,
  794.     ),
  795.     'empty' => '',
  796.     'hide_empty' => 0,
  797.     'empty_zero' => 0,
  798.     'hide_alter_empty' => 1,
  799.     'use_php_setup' => 1,
  800.     'php_setup' => 'if (module_exists(\'civicrm\')) {
  801.  civicrm_initialize(TRUE);
  802.  require_once \'CRM/Event/BAO/Event.php\';
  803. }
  804.  
  805. ',
  806.     'php_value' => 'if (module_exists(\'civicrm\')) {
  807.  $participantSeats = CRM_Event_BAO_Event::eventTotalSeats($row->id_1, \'participant.id = \' . $row->id);
  808.  return $participantSeats;
  809. }',
  810.     'php_output' => '',
  811.     'use_php_click_sortable' => '0',
  812.     'php_click_sortable' => '',
  813.     'exclude' => 0,
  814.     'id' => 'php',
  815.     'table' => 'views',
  816.     'field' => 'php',
  817.     'relationship' => 'none',
  818.     'override' => array(
  819.       'button' => 'Use default',
  820.     ),
  821.   ),
  822.   'php_3' => array(
  823.     'label' => 'Seats',
  824.     'alter' => array(
  825.       'alter_text' => 0,
  826.       'text' => '',
  827.       'make_link' => 0,
  828.       'path' => '',
  829.       'absolute' => 0,
  830.       'link_class' => '',
  831.       'alt' => '',
  832.       'rel' => '',
  833.       'prefix' => '',
  834.       'suffix' => '',
  835.       'target' => '',
  836.       'help' => '',
  837.       'trim' => 0,
  838.       'max_length' => '',
  839.       'word_boundary' => 1,
  840.       'ellipsis' => 1,
  841.       'html' => 0,
  842.       'strip_tags' => 0,
  843.     ),
  844.     'empty' => '',
  845.     'hide_empty' => 0,
  846.     'empty_zero' => 0,
  847.     'hide_alter_empty' => 1,
  848.     'use_php_setup' => 0,
  849.     'php_setup' => 'define(\'ft_check\', \'civicrm\');
  850. require_once(\'fusionticket/includes/classes/class.router.php\');
  851. require_once(\'fusionticket/includes/classes/model.seat.php\');
  852.  
  853. function getRanges($myarr) {
  854.  $ranges = \'\';
  855.  for ($i=0; $i<count($myarr); $i++) {
  856.    $rstart = $myarr[$i];
  857.    $rend = $rstart;
  858.    while ($myarr[$i + 1] - $myarr[$i] == 1) {
  859.      $rend = $myarr[$i + 1];
  860.      $i++;
  861.    }
  862.    if ($rstart == $rend) {
  863.      $ranges .= $rstart;
  864.    }
  865.    else {
  866.      $ranges .= $rstart . \'&mdash;\' . $rend;
  867.    }
  868.    if ($myarr[$i] !== end($myarr)) {
  869.      $ranges .= \', \';
  870.    }
  871.  }
  872.  return $ranges;
  873. }
  874. ',
  875.     'php_value' => '$seats = Seat::loadAllOrder($row->id);
  876. $seatarr = array();
  877. foreach ($seats as $seat) {
  878.  if (empty($seatarr[$seat->pmz_name])) {
  879.    $seatarr[$seat->pmz_name] = array();
  880.  }
  881.  if (empty($seatarr[$seat->pmz_name][$seat->seat_row_nr])) {
  882.    $seatarr[$seat->pmz_name][$seat->seat_row_nr] = array();
  883.  }
  884.  array_push($seatarr[$seat->pmz_name][$seat->seat_row_nr], $seat->seat_nr);
  885. }
  886. return $seatarr;    ',
  887.     'php_output' => '<?php
  888. print \'<span style="white-space: nowrap;">\';
  889. foreach ($value as $zone => $rows) {
  890.  ksort($rows);
  891.  foreach ($rows as $row => $seats) {
  892.    sort($seats);
  893.    print $zone . \' <b>:</b> \' . $row . \' <b>:</b> \' . getRanges($seats) . \'<br>\';
  894.  }
  895. }
  896. print \'</span>\';
  897. ?>',
  898.     'use_php_click_sortable' => '0',
  899.     'php_click_sortable' => '',
  900.     'exclude' => 0,
  901.     'id' => 'php_3',
  902.     'table' => 'views',
  903.     'field' => 'php',
  904.     'override' => array(
  905.       'button' => 'Use default',
  906.     ),
  907.     'relationship' => 'none',
  908.   ),
  909.   'php_1' => array(
  910.     'label' => 'Source',
  911.     'alter' => array(
  912.       'alter_text' => 0,
  913.       'text' => '',
  914.       'make_link' => 0,
  915.       'path' => '',
  916.       'absolute' => 0,
  917.       'link_class' => '',
  918.       'alt' => '',
  919.       'rel' => '',
  920.       'prefix' => '',
  921.       'suffix' => '',
  922.       'target' => '',
  923.       'help' => '',
  924.       'trim' => 0,
  925.       'max_length' => '',
  926.       'word_boundary' => 1,
  927.       'ellipsis' => 1,
  928.       'html' => 0,
  929.       'strip_tags' => 0,
  930.     ),
  931.     'empty' => '',
  932.     'hide_empty' => 0,
  933.     'empty_zero' => 0,
  934.     'hide_alter_empty' => 1,
  935.     'use_php_setup' => 0,
  936.     'php_setup' => '',
  937.     'php_value' => 'preg_match(\'/Flex Pass \\d+|Online Event Registration/\', $row->source, $matches);
  938. if (!empty($matches[0])) return $matches[0];
  939. else return $row->source;
  940. ',
  941.     'php_output' => '',
  942.     'use_php_click_sortable' => '0',
  943.     'php_click_sortable' => '',
  944.     'exclude' => 0,
  945.     'id' => 'php_1',
  946.     'table' => 'views',
  947.     'field' => 'php',
  948.     'relationship' => 'none',
  949.     'override' => array(
  950.       'button' => 'Use default',
  951.     ),
  952.   ),
  953.   'register_date' => array(
  954.     'label' => 'Purchase Date',
  955.     'alter' => array(
  956.       'alter_text' => 0,
  957.       'text' => '',
  958.       'make_link' => 0,
  959.       'path' => '',
  960.       'absolute' => 0,
  961.       'link_class' => '',
  962.       'alt' => '',
  963.       'rel' => '',
  964.       'prefix' => '',
  965.       'suffix' => '',
  966.       'target' => '',
  967.       'help' => '',
  968.       'trim' => 0,
  969.       'max_length' => '',
  970.       'word_boundary' => 1,
  971.       'ellipsis' => 1,
  972.       'html' => 0,
  973.       'strip_tags' => 0,
  974.     ),
  975.     'empty' => '',
  976.     'hide_empty' => 0,
  977.     'empty_zero' => 0,
  978.     'hide_alter_empty' => 1,
  979.     'date_format' => 'small',
  980.     'custom_date_format' => '',
  981.     'exclude' => 0,
  982.     'id' => 'register_date',
  983.     'table' => 'civicrm_participant',
  984.     'field' => 'register_date',
  985.     'relationship' => 'none',
  986.   ),
  987. ));
  988. $handler->override_option('header', '<?php
  989. if (module_exists(\'civicrm\')) {
  990.  civicrm_initialize(TRUE);
  991.  require_once \'CRM/Event/BAO/Event.php\';
  992.  require_once(\'api/v2/Event.php\');
  993.  $view = views_get_current_view();
  994.  $eventID = $view->args[0];
  995.  $params = array ( \'id\' => $eventID );
  996.  $event = civicrm_event_get($params);
  997.  print "<h2>" . $event["title"] . "</h2>";
  998.  $totalSeats = CRM_Event_BAO_Event::eventTotalSeats($eventID);
  999.  $checkedInSeats = CRM_Event_BAO_Event::eventTotalSeats($eventID, \'participant.status_id = 2\');
  1000.  print \'<table class="headertable"><tr><td><span id="actionstatus"></span></td><td>&nbsp;</td></tr>\';
  1001.  print \'<tr><td><span id="totalseats">Total seats sold: \' . $totalSeats . \'<br>\';
  1002.  print \'Seats checked in: \' . $checkedInSeats . \'</span></td>\';
  1003.  print \'<td><form name="scanform" onkeypress="return handleScan(document.scanform.scan.value, event)"><input type="text" id="scan" name="scan"></form></td></tr></table>\';
  1004. }
  1005. ?>');
  1006. $handler->override_option('style_plugin', 'table_highlighter');
  1007. $handler->override_option('style_options', array(
  1008.   'grouping' => '',
  1009.   'override' => 1,
  1010.   'sticky' => 0,
  1011.   'order' => 'asc',
  1012.   'summary' => '',
  1013.   'columns' => array(
  1014.     'id' => 'id',
  1015.     'id_1' => 'id_1',
  1016.     'source' => 'source',
  1017.     'last_name' => 'last_name',
  1018.     'php_2' => 'php_2',
  1019.     'first_name' => 'first_name',
  1020.     'status' => 'status',
  1021.     'php' => 'php',
  1022.     'php_1' => 'php_1',
  1023.     'register_date' => 'register_date',
  1024.   ),
  1025.   'info' => array(
  1026.     'id' => array(
  1027.       'sortable' => 0,
  1028.       'separator' => '',
  1029.     ),
  1030.     'id_1' => array(
  1031.       'sortable' => 0,
  1032.       'separator' => '',
  1033.     ),
  1034.     'source' => array(
  1035.       'sortable' => 0,
  1036.       'separator' => '',
  1037.     ),
  1038.     'last_name' => array(
  1039.       'sortable' => 0,
  1040.       'separator' => '',
  1041.     ),
  1042.     'php_2' => array(
  1043.       'separator' => '',
  1044.     ),
  1045.     'first_name' => array(
  1046.       'sortable' => 0,
  1047.       'separator' => '',
  1048.     ),
  1049.     'status' => array(
  1050.       'sortable' => 0,
  1051.       'separator' => '',
  1052.     ),
  1053.     'php' => array(
  1054.       'separator' => '',
  1055.     ),
  1056.     'php_1' => array(
  1057.       'separator' => '',
  1058.     ),
  1059.     'register_date' => array(
  1060.       'sortable' => 0,
  1061.       'separator' => '',
  1062.     ),
  1063.   ),
  1064.   'default' => '-1',
  1065.   'views_table_highlighter' => array(
  1066.     'code' => 'if ($civicrm_participant_status_id == "1") return $id;
  1067. else return $id . \'-strike\';',
  1068.   ),
  1069. ));
  1070. $handler->override_option('row_options', array(
  1071.   'inline' => array(
  1072.     'last_name' => 'last_name',
  1073.     'first_name' => 'first_name',
  1074.     'php' => 'php',
  1075.     'source' => 'source',
  1076.   ),
  1077.   'separator' => '',
  1078.   'hide_empty' => 0,
  1079. ));
  1080. $handler->override_option('path', 'eventreport/%');
  1081. $handler->override_option('menu', array(
  1082.   'type' => 'none',
  1083.   'title' => '',
  1084.   'description' => '',
  1085.   'weight' => 0,
  1086.   'name' => 'navigation',
  1087. ));
  1088. $handler->override_option('tab_options', array(
  1089.   'type' => 'none',
  1090.   'title' => '',
  1091.   'description' => '',
  1092.   'weight' => 0,
  1093.   'name' => 'navigation',
  1094. ));
RAW Paste Data