Ejemplo n.º 1
0
/**
 * bp_em_screen_two()
 *
 * Sets up and displays the screen output for the sub nav item "em/screen-two"
 */
function bp_em_my_bookings()
{
    global $bp, $EM_Event;
    //assume any notifications here are considered viewed via this page
    bp_core_delete_notifications_by_type(get_current_user_id(), 'events', 'pending_booking');
    bp_core_delete_notifications_by_type(get_current_user_id(), 'events', 'confirmed_booking');
    bp_core_delete_notifications_by_type(get_current_user_id(), 'events', 'cancelled_booking');
    em_load_event();
    /**
     * If the user has not Accepted or Rejected anything, then the code above will not run,
     * we can continue and load the template.
     */
    do_action('bp_em_my_bookings');
    add_action('bp_template_title', 'bp_em_my_bookings_title');
    add_action('bp_template_content', 'bp_em_my_bookings_content');
    /* Finally load the plugin template file. */
    bp_core_load_template(apply_filters('bp_core_template_plugin', 'members/single/plugins'));
}
 function ajax()
 {
     if (wp_verify_nonce($_REQUEST['_wpnonce'], 'em_transactions_table')) {
         //Get the context
         global $EM_Event, $EM_Booking, $EM_Ticket, $EM_Person;
         em_load_event();
         $context = false;
         if (!empty($_REQUEST['booking_id']) && is_object($EM_Booking) && $EM_Booking->can_manage('manage_bookings', 'manage_others_bookings')) {
             $context = $EM_Booking;
         } elseif (!empty($_REQUEST['event_id']) && is_object($EM_Event) && $EM_Event->can_manage('manage_bookings', 'manage_others_bookings')) {
             $context = $EM_Event;
         } elseif (!empty($_REQUEST['person_id']) && is_object($EM_Person) && current_user_can('manage_bookings')) {
             $context = $EM_Person;
         } elseif (!empty($_REQUEST['ticket_id']) && is_object($EM_Ticket) && $EM_Ticket->can_manage('manage_bookings', 'manage_others_bookings')) {
             $context = $EM_Ticket;
         }
         echo $this->mytransactions($context);
         exit;
     }
 }