Ejemplo n.º 1
0
 /**
  * Generates a list of attendees taking into account the Screen Options.
  * It's used both for the Email functionality, as for the CSV export.
  *
  * @param $event_id
  *
  * @return array
  */
 private function _generate_filtered_attendees_list($event_id)
 {
     if (empty($this->attendees_page)) {
         $this->attendees_page = 'tribe_events_page_tickets-attendees';
     }
     $columns = $this->attendees_table->get_columns();
     $hidden = get_hidden_columns($this->attendees_page);
     // We dont want to export html inputs or private data
     $hidden[] = 'cb';
     $hidden[] = 'provider';
     // remove the hidden fields from the final list of columns
     $hidden = array_filter($hidden);
     $hidden = array_flip($hidden);
     $export_columns = array_diff_key($columns, $hidden);
     $columns_names = array_filter(array_values($export_columns));
     $export_columns = array_filter(array_keys($export_columns));
     // Get the data
     $items = TribeEventsTickets::get_event_attendees($event_id);
     $rows = array($columns_names);
     //And echo the data
     foreach ($items as $item) {
         $row = array();
         foreach ($item as $key => $data) {
             if (in_array($key, $export_columns)) {
                 if ($key == 'check_in' && $data == 1) {
                     $data = __('Yes', 'tribe-events-calendar');
                 }
                 $row[$key] = $data;
             }
         }
         $rows[] = array_values($row);
     }
     return array_filter($rows);
 }
Ejemplo n.º 2
0
 public function attendees_page_inside()
 {
     require_once 'tribe-tickets-attendees.php';
     $attendees_table = new TribeEventsTicketsAttendeesTable();
     $attendees_table->prepare_items();
     include $this->parentPath . 'admin-views/tickets-attendees.php';
 }