'attendee', 'plural' => 'attendees', 'ajax' => true ) );
}
/**
* Display the search box.
* We don't want Core's search box, because we implemented our own jQuery based filter,
* so this function overrides the parent's one and returns empty.
*
* @since 3.1.0
* @access public
*
* @param string $text The search button text
* @param string $input_id The search input id
*/
function search_box( $text, $input_id ) {
return;
}
/**
* Display the pagination.
* We are not paginating the attendee list, so it returns empty.
*
* @since 3.1.0
* @access protected
*/
function pagination( $which ) {
return '';
}
/**
* Checks the current user's permissions
*
* @since 3.1.0
* @access public
*/
function ajax_user_can() {
return current_user_can( get_post_type_object( $this->screen->post_type )->cap->edit_posts );
}
/**
* Get a list of columns. The format is:
* 'internal-name' => 'Title'
*
* @return array
*/
function get_columns() {
$columns = array( 'cb' => '',
'order_id' => __( 'Order #', 'tribe-events-calendar' ),
'order_status' => __( 'Order Status', 'tribe-events-calendar' ),
'purchaser_name' => __( 'Purchaser name', 'tribe-events-calendar' ),
'purchaser_email' => __( 'Purchaser email', 'tribe-events-calendar' ),
'ticket' => __( 'Ticket type', 'tribe-events-calendar' ),
'attendee_id' => __( 'Ticket #', 'tribe-events-calendar' ),
'security' => __( 'Security Code', 'tribe-events-calendar' ),
'check_in' => __( 'Check in', 'tribe-events-calendar' ) );
return $columns;
}
/**
* Handler for the columns that don't have a specific column_{name} handler function.
*
* @param $item
* @param $column
*
* @return string
*/
function column_default( $item, $column ) {
if ( empty( $item[$column] ) )
return '';
return $item[$column];
}
/**
* Handler for the checkbox column
*
* @param $item
*
* @return string
*/
function column_cb( $item ) {
return sprintf( '', esc_attr( $this->_args['singular'] ), esc_attr( $item['attendee_id'] . "|" . $item['provider'] ) );
}
/**
* Handler for the order id column
*
* @param $item
*
* @return string
*/
function column_order_id( $item ) {
return sprintf( '%s', esc_url( get_edit_post_link( $item['order_id'], true ) ), esc_html( $item['order_id'] ) );
}
/**
* Handler for the order status column
*
* @param $item
*
* @return string
*/
function column_order_status( $item ) {
$icon = "";
if ( strtolower( $item['order_status'] ) !== 'completed' ) {
$tec = TribeEvents::instance();
$icon = sprintf( " ", trailingslashit( $tec->pluginUrl ) . 'resources/warning.png' );
}
return $icon . ucwords( $item['order_status'] );
}
/**
* Handler for the check in column
*
* @param $item
*
* @return string
*/
function column_check_in( $item ) {
$checkin = sprintf( '%s', esc_attr( $item['attendee_id'] ), esc_attr( $item['provider'] ), __( 'Check in', 'tribe-events-calendar' ) );
$uncheckin = sprintf( '%s', esc_attr( $item['attendee_id'] ), esc_attr( $item['provider'] ), __( 'Undo Check in', 'tribe-events-calendar' ) );
return $checkin . $uncheckin;
}
/**
* Generates content for a single row of the table
*
* @param object $item The current item
*/
function single_row( $item ) {
static $row_class = '';
$row_class = ( $row_class == '' ? ' alternate ' : '' );
$checked = '';
if ( intval( $item["check_in"] ) === 1 )
$checked = ' tickets_checked ';
echo '