Example #1
0
 /**
  * Loads the content of the tickets metabox if there's at
  * least one Tribe Tickets module (provider) enabled
  * @static
  *
  * @param $post_id
  */
 public static function do_modules_metaboxes($post_id)
 {
     $modules = apply_filters('tribe_events_tickets_modules', null);
     if (empty($modules)) {
         return;
     }
     Tribe__Tickets__Tickets_Handler::instance()->do_meta_box($post_id);
 }
Example #2
0
 /**
  * Registers the Orders admin page
  */
 public function orders_page_register()
 {
     // the orders table only works with WooCommerce
     if (!class_exists('WooCommerce')) {
         return;
     }
     $this->orders_page = add_submenu_page(null, 'Order list', 'Order list', 'edit_posts', self::$orders_slug, array($this, 'orders_page_inside'));
     add_action('admin_enqueue_scripts', array(Tribe__Tickets__Tickets_Handler::instance(), 'attendees_page_load_css_js'));
     add_action('admin_enqueue_scripts', array(Tribe__Tickets__Tickets_Handler::instance(), 'attendees_page_load_pointers'));
     add_action("load-{$this->orders_page}", array($this, 'orders_page_screen_setup'));
 }
Example #3
0
	</style>
</head>
<body yahoo="fix" alink="#006caa" link="#006caa" text="#000000" bgcolor="#ffffff" style="width:100% !important; -webkit-text-size-adjust:100%; -ms-text-size-adjust:100%; margin:0 auto; padding:20px 0 0 0; background:#ffffff; min-height:1000px;">
	<div style="margin:0; padding:0; width:100% !important; font-family: 'Helvetica Neue', Helvetica, sans-serif; font-size:14px; line-height:145%; text-align:left;">
		<center>
			<?php 
do_action('tribe_tickets_ticket_email_top');
$count = 0;
$break = '';
foreach ($tickets as $ticket) {
    $count++;
    if ($count == 2) {
        $break = 'page-break-before: always !important;';
    }
    $event = get_post($ticket['event_id']);
    $header_id = Tribe__Tickets__Tickets_Handler::instance()->get_header_image_id($ticket['event_id']);
    $header_img = false;
    if (!empty($header_id)) {
        $header_img = wp_get_attachment_image_src($header_id, 'full');
    }
    $venue_label = '';
    $venue_name = null;
    if (function_exists('tribe_get_venue_id')) {
        $venue_id = tribe_get_venue_id($event->ID);
        if (!empty($venue_id)) {
            $venue = get_post($venue_id);
        }
        $venue_label = tribe_get_venue_label_singular();
        $venue_name = $venue_phone = $venue_address = $venue_city = $venue_web = '';
        if (!empty($venue)) {
            $venue_name = $venue->post_title;
 /**
  * Static Singleton Factory Method
  *
  * @return Tribe__Tickets__Tickets_Handler
  */
 public static function instance()
 {
     if (!isset(self::$instance)) {
         $className = __CLASS__;
         self::$instance = new $className();
     }
     return self::$instance;
 }
 /**
  * Tests if the user has the specified capability in relation to whatever post type
  * the attendee object relates to.
  *
  * For example, if the attendee was generated for a ticket set up in relation to a
  * post of the banana type, the generic capability "edit_posts" will be mapped to
  * "edit_bananas" or whatever is appropriate.
  *
  * @internal for internal plugin use only (in spite of having public visibility)
  * @see Tribe__Tickets__Tickets_Handler::user_can()
  *
  * @param  string $generic_cap
  * @param  int    $attendee_id
  * @return boolean
  */
 public function user_can($generic_cap, $attendee_id)
 {
     $event_id = $this->get_event_id_from_attendee_id($attendee_id);
     if (empty($event_id)) {
         return false;
     }
     return Tribe__Tickets__Tickets_Handler::instance()->user_can($generic_cap, $event_id);
 }