public function column_name(EE_Promotion $item) { $edit_link = EEH_URL::add_query_args_and_nonce(array('action' => 'edit', 'PRO_ID' => $item->ID()), EE_PROMOTIONS_ADMIN_URL); $content = EE_Registry::instance()->CAP->current_user_can('ee_edit_promotion', 'espresso_promotions_edit_promotion', $item->ID()) ? '<a href="' . $edit_link . '" title="' . __('Edit Promotion', 'event_espresso') . '">' . $item->name() . '</a>' : $item->name(); $content .= '<br><span class="ee-status-text-small">' . EEH_Template::pretty_status($item->status(), false, 'sentence') . '</span>'; return $content; }
function column_ATT_name(EE_Registration $item) { $attendee = $item->attendee(); if (!$attendee instanceof EE_Attendee) { return __('No contact record for this registration.', 'event_espresso'); } // edit attendee link $edit_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'view_registration', '_REG_ID' => $item->ID()), REG_ADMIN_URL); $name_link = EE_Registry::instance()->CAP->current_user_can('ee_edit_contacts', 'espresso_registrations_edit_attendee') ? '<a href="' . $edit_lnk_url . '" title="' . esc_attr__('Edit Contact', 'event_espresso') . '">' . $item->attendee()->full_name() . '</a>' : $item->attendee()->full_name(); $name_link .= $item->count() == 1 ? ' <sup><div class="dashicons dashicons-star-filled lt-blue-icon ee-icon-size-8"></div></sup> ' : ''; //add group details $name_link .= ' ' . sprintf(__('(%s of %s)', 'event_espresso'), $item->count(), $item->group_size()); //add regcode $link = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'view_registration', '_REG_ID' => $item->ID()), REG_ADMIN_URL); $name_link .= '<br>'; $name_link .= EE_Registry::instance()->instance()->CAP->current_user_can('ee_read_registration', 'view_registration', $item->ID()) ? '<a href="' . $link . '" title="' . esc_attr__('View Registration Details', 'event_espresso') . '">' . $item->reg_code() . '</a>' : $item->reg_code(); //status $name_link .= '<br><span class="ee-status-text-small">' . EEH_Template::pretty_status($item->status_ID(), false, 'sentence') . '</span>'; $actions = array(); $DTT_ID = !empty($this->_req_data['DTT_ID']) ? $this->_req_data['DTT_ID'] : NULL; $DTT_ID = empty($DTT_ID) && !empty($this->_req_data['event_id']) ? EEM_Event::instance()->get_one_by_ID($this->_req_data['event_id'])->primary_datetime()->ID() : $DTT_ID; if (!empty($DTT_ID) && EE_Registry::instance()->CAP->current_user_can('ee_read_checkins', 'espresso_registrations_registration_checkins')) { $checkin_list_url = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'registration_checkins', '_REGID' => $item->ID(), 'DTT_ID' => $DTT_ID)); $actions['checkin'] = '<a href="' . $checkin_list_url . '" title="' . esc_attr__('View all the check-ins/checkouts for this registrant', 'event_espresso') . '">' . __('View', 'event_espresso') . '</a>'; } return !empty($DTT_ID) ? sprintf('%1$s %2$s', $name_link, $this->row_actions($actions)) : $name_link; }
/** * Set the $_transaction_details property if not set yet. * * @param EE_Registration $registration */ protected function _set_related_details(EE_Registration $registration) { $transaction = $registration->get_first_related('Transaction'); $status = $transaction instanceof EE_Transaction ? $transaction->status_ID() : EEM_Transaction::failed_status_code; $this->_transaction_details = array('transaction' => $transaction, 'status' => $status, 'id' => $transaction instanceof EE_Transaction ? $transaction->ID() : 0, 'title_attr' => sprintf(__('View Transaction Details (%s)', 'event_espresso'), EEH_Template::pretty_status($status, false, 'sentence'))); $event = $registration->event(); $status = $event instanceof EE_Event ? $event->get_active_status() : EE_Datetime::inactive; $this->_event_details = array('event' => $event, 'status' => $status, 'id' => $event instanceof EE_Event ? $event->ID() : 0, 'title_attr' => sprintf(__('Edit Event (%s)', 'event_espresso'), EEH_Template::pretty_status($status, false, 'sentence'))); }
/** * @param EE_Event $item * * @return string */ public function column_name(EE_Event $item) { $edit_query_args = array('action' => 'edit', 'post' => $item->ID()); $edit_link = EE_Admin_Page::add_query_args_and_nonce($edit_query_args, EVENTS_ADMIN_URL); $actions = $this->_column_name_action_setup($item); $status = ''; //$item->status() !== 'publish' ? ' (' . $item->status() . ')' : ''; $content = '<strong><a class="row-title" href="' . $edit_link . '">' . $item->name() . '</a></strong>' . $status; $content .= '<br><span class="ee-status-text-small">' . EEH_Template::pretty_status($item->get_active_status(), false, 'sentence') . '</span>'; $content .= $this->row_actions($actions); return $content; }
/** * _transaction_legend_items * * @access protected * @return array */ protected function _transaction_legend_items() { EE_Registry::instance()->load_helper('MSG_Template'); $items = array(); if (EE_Registry::instance()->CAP->current_user_can('ee_read_global_messages', 'view_filtered_messages')) { $related_for_icon = EEH_MSG_Template::get_message_action_icon('see_notifications_for'); if (isset($related_for_icon['css_class']) && isset($related_for_icon['label'])) { $items['view_related_messages'] = array('class' => $related_for_icon['css_class'], 'desc' => $related_for_icon['label']); } } $items = apply_filters('FHEE__Transactions_Admin_Page___transaction_legend_items__items', array_merge($items, array('view_details' => array('class' => 'dashicons dashicons-cart', 'desc' => __('View Transaction Details', 'event_espresso')), 'view_invoice' => array('class' => 'dashicons dashicons-media-spreadsheet', 'desc' => __('View Transaction Invoice', 'event_espresso')), 'view_receipt' => array('class' => 'dashicons dashicons-media-default', 'desc' => __('View Transaction Receipt', 'event_espresso')), 'view_registration' => array('class' => 'dashicons dashicons-clipboard', 'desc' => __('View Registration Details', 'event_espresso'))))); if (EE_Registry::instance()->CAP->current_user_can('ee_send_message', 'espresso_transactions_send_payment_reminder')) { if (EEH_MSG_Template::is_mt_active('payment_reminder')) { $items['send_payment_reminder'] = array('class' => 'dashicons dashicons-email-alt', 'desc' => __('Send Payment Reminder', 'event_espresso')); } else { $items['blank*'] = array('class' => '', 'desc' => ''); } } else { $items['blank*'] = array('class' => '', 'desc' => ''); } $more_items = apply_filters('FHEE__Transactions_Admin_Page___transaction_legend_items__more_items', array('overpaid' => array('class' => 'ee-status-legend ee-status-legend-' . EEM_Transaction::overpaid_status_code, 'desc' => EEH_Template::pretty_status(EEM_Transaction::overpaid_status_code, FALSE, 'sentence')), 'complete' => array('class' => 'ee-status-legend ee-status-legend-' . EEM_Transaction::complete_status_code, 'desc' => EEH_Template::pretty_status(EEM_Transaction::complete_status_code, FALSE, 'sentence')), 'incomplete' => array('class' => 'ee-status-legend ee-status-legend-' . EEM_Transaction::incomplete_status_code, 'desc' => EEH_Template::pretty_status(EEM_Transaction::incomplete_status_code, FALSE, 'sentence')), 'abandoned' => array('class' => 'ee-status-legend ee-status-legend-' . EEM_Transaction::abandoned_status_code, 'desc' => EEH_Template::pretty_status(EEM_Transaction::abandoned_status_code, FALSE, 'sentence')), 'failed' => array('class' => 'ee-status-legend ee-status-legend-' . EEM_Transaction::failed_status_code, 'desc' => EEH_Template::pretty_status(EEM_Transaction::failed_status_code, FALSE, 'sentence')))); return array_merge($items, $more_items); }
/** * incoming reg status change from reg details page. * @return void */ protected function _change_reg_status() { $this->_req_data['return'] = 'view_registration'; //set notify based on whether the send notifications toggle is set or not $notify = !empty($this->_req_data['txn_reg_status_change']['send_notifications']); $this->_req_data['_reg_status_id'] = isset($this->_req_data['_reg_status_id']) ? $this->_req_data['_reg_status_id'] : ''; switch ($this->_req_data['_reg_status_id']) { case EEH_Template::pretty_status(EEM_Registration::status_id_approved, false, 'sentence'): $this->approve_registration($notify); break; case EEH_Template::pretty_status(EEM_Registration::status_id_pending_payment, false, 'sentence'): $this->pending_registration($notify); break; case EEH_Template::pretty_status(EEM_Registration::status_id_not_approved, false, 'sentence'): $this->not_approve_registration($notify); break; case EEH_Template::pretty_status(EEM_Registration::status_id_declined, false, 'sentence'): $this->decline_registration($notify); break; case EEH_Template::pretty_status(EEM_Registration::status_id_cancelled, false, 'sentence'): $this->cancel_registration($notify); break; default: $result['success'] = false; unset($this->_req_data['return']); $this->_reg_status_change_return('', false); break; } }
/** * Using the start date and end date this method calculates whether the ticket is On Sale, Pending, or Expired * @param bool $display true = we'll return a localized string, otherwise we just return the value of the relevant status const * @return mixed(int|string) status int if the display string isn't requested */ public function ticket_status($display = FALSE) { if (!$this->is_remaining()) { return $display ? EEH_Template::pretty_status(EE_Ticket::sold_out, FALSE, 'sentence') : EE_Ticket::sold_out; } if ($this->get('TKT_deleted')) { return $display ? EEH_Template::pretty_status(EE_Ticket::archived, FALSE, 'sentence') : EE_Ticket::archived; } if ($this->is_expired()) { return $display ? EEH_Template::pretty_status(EE_Ticket::expired, FALSE, 'sentence') : EE_Ticket::expired; } if ($this->is_pending()) { return $display ? EEH_Template::pretty_status(EE_Ticket::pending, FALSE, 'sentence') : EE_Ticket::pending; } if ($this->is_on_sale()) { return $display ? EEH_Template::pretty_status(EE_Ticket::onsale, FALSE, 'sentence') : EE_Ticket::onsale; } return ''; }
<?php printf(__('%s Registrations', 'event_espresso'), EEH_Template::pretty_status(EEM_Registration::status_id_pending_payment, FALSE, 'sentence')); ?> </a>: <?php echo $pending_payment_regs; ?> </div> <div class="misc-pub-section"> <span class="dashicons dashicons-groups ee-icon-color-ee-orange ee-icon-size-20"></span> <a href="<?php echo $view_not_approved_reg_url; ?> "> <?php printf(__('%s Registrations', 'event_espresso'), EEH_Template::pretty_status(EEM_Registration::status_id_not_approved, FALSE, 'sentence')); ?> </a>: <?php echo $not_approved_regs; ?> </div> <?php /* //todo .. hook in newsletter message type trigger in later versions. <div class="misc-pub-section <?php echo $misc_pub_section_class; ?>" id="visibility2"> <a href="<?php echo $email_attendees_url;?>" title="<?php _e('Email Event Attendees', 'event_espresso'); ?>"> <div class="ee-icon ee-icon-email-send"></div> <?php _e('Email Event Attendees', 'event_espresso'); ?> </a> </div> /**/
/** * generates HTML for the Event Registrations List Table * @access protected * @return void */ protected function _event_registrations_list_table() { do_action('AHEE_log', __FILE__, __FUNCTION__, ''); $this->_admin_page_title .= isset($this->_req_data['event_id']) ? $this->get_action_link_or_button('new_registration', 'add-registrant', array('event_id' => $this->_req_data['event_id']), 'add-new-h2') : ''; $legend_items = array('star-icon' => array('class' => 'dashicons dashicons-star-filled lt-blue-icon ee-icon-size-8', 'desc' => __('This Registrant is the Primary Registrant', 'event_espresso')), 'checkin' => array('class' => 'ee-icon ee-icon-check-in', 'desc' => __('This Registrant has been Checked In', 'event_espresso')), 'checkout' => array('class' => 'ee-icon ee-icon-check-out', 'desc' => __('This Registrant has been Checked Out', 'event_espresso')), 'nocheckinrecord' => array('class' => 'dashicons dashicons-no', 'desc' => __('No Check-in Record has been Created for this Registrant', 'event_espresso')), 'view_details' => array('class' => 'dashicons dashicons-search', 'desc' => __('View All Check-in Records for this Registrant', 'event_espresso')), 'approved_status' => array('class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_approved, 'desc' => EEH_Template::pretty_status(EEM_Registration::status_id_approved, FALSE, 'sentence')), 'cancelled_status' => array('class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_cancelled, 'desc' => EEH_Template::pretty_status(EEM_Registration::status_id_cancelled, FALSE, 'sentence')), 'declined_status' => array('class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_declined, 'desc' => EEH_Template::pretty_status(EEM_Registration::status_id_declined, FALSE, 'sentence')), 'not_approved' => array('class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_not_approved, 'desc' => EEH_Template::pretty_status(EEM_Registration::status_id_not_approved, FALSE, 'sentence')), 'pending_status' => array('class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_pending_payment, 'desc' => EEH_Template::pretty_status(EEM_Registration::status_id_pending_payment, FALSE, 'sentence'))); $this->_template_args['after_list_table'] = $this->_display_legend($legend_items); $event_id = isset($this->_req_data['event_id']) ? $this->_req_data['event_id'] : null; $this->_template_args['before_list_table'] = !empty($event_id) ? '<h2>' . sprintf(__('Viewing Registrations for Event: %s', 'event_espresso'), EEM_Event::instance()->get_one_by_ID($event_id)->get('EVT_name')) . '</h2>' : ''; $this->_template_args['list_table_hidden_fields'] = !empty($event_id) ? '<input type="hidden" name="event_id" value="' . $event_id . '">' : ''; $this->display_admin_list_table_page_with_no_sidebar(); }
/** * column_ATT_fname * * @access public * @param \EE_Registration $item * @return string */ function column_ATT_fname(EE_Registration $item) { $attendee = $item->attendee(); $edit_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'view_registration', '_REG_ID' => $item->ID()), REG_ADMIN_URL); $attendee_name = $attendee instanceof EE_Attendee ? $attendee->full_name() : ''; $link = EE_Registry::instance()->CAP->current_user_can('ee_read_registration', 'espresso_registrations_view_registration', $item->ID()) ? '<a href="' . $edit_lnk_url . '" title="' . esc_attr__('View Registration Details', 'event_espresso') . '">' . $attendee_name . '</a>' : $attendee_name; $link .= $item->count() == 1 ? ' <sup><div class="dashicons dashicons-star-filled lt-blue-icon ee-icon-size-8"></div></sup>' : ''; $t = $item->get_first_related('Transaction'); $payment_count = $t instanceof EE_Transaction ? $t->count_related('Payment') : 0; //append group count to name $link .= ' ' . sprintf(__('(%1$s / %2$s)', 'event_espresso'), $item->count(), $item->group_size()); //append reg_code $link .= '<br>' . sprintf(__('Reg Code: %s', 'event_espresso'), $item->get('REG_code')); //reg status text for accessibility $link .= '<br><span class="ee-status-text-small">' . EEH_Template::pretty_status($item->status_ID(), false, 'sentence') . '</span>'; //trash/restore/delete actions $actions = array(); if ($this->_view != 'trash' && $payment_count === 0 && EE_Registry::instance()->CAP->current_user_can('ee_delete_registration', 'espresso_registrations_trash_registrations', $item->ID())) { $trash_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'trash_registrations', '_REG_ID' => $item->ID()), REG_ADMIN_URL); $actions['trash'] = '<a href="' . $trash_lnk_url . '" title="' . esc_attr__('Trash Registration', 'event_espresso') . '">' . __('Trash', 'event_espresso') . '</a>'; } elseif ($this->_view == 'trash') { // restore registration link if (EE_Registry::instance()->CAP->current_user_can('ee_delete_registration', 'espresso_registrations_restore_registrations', $item->ID())) { $restore_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'restore_registrations', '_REG_ID' => $item->ID()), REG_ADMIN_URL); $actions['restore'] = '<a href="' . $restore_lnk_url . '" title="' . esc_attr__('Restore Registration', 'event_espresso') . '">' . __('Restore', 'event_espresso') . '</a>'; } if (EE_Registry::instance()->CAP->current_user_can('ee_delete_registration', 'espresso_registrations_ee_delete_registrations', $item->ID())) { $delete_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'delete_registrations', '_REG_ID' => $item->ID()), REG_ADMIN_URL); $actions['delete'] = '<a href="' . $delete_lnk_url . '" title="' . esc_attr__('Delete Registration Permanently', 'event_espresso') . '">' . __('Delete', 'event_espresso') . '</a>'; } } return sprintf('%1$s %2$s', $link, $this->row_actions($actions)); }
protected function _message_legend_items() { $action_css_classes = EEH_MSG_Template::get_message_action_icons(); $action_items = array(); foreach ($action_css_classes as $action_item => $action_details) { if ($action_item === 'see_notifications_for') { continue; } $action_items[$action_item] = array('class' => $action_details['css_class'], 'desc' => $action_details['label']); } /** @type array $status_items status legend setup*/ $status_items = array('sent_status' => array('class' => 'ee-status-legend ee-status-legend-' . EEM_Message::status_sent, 'desc' => EEH_Template::pretty_status(EEM_Message::status_sent, false, 'sentence')), 'idle_status' => array('class' => 'ee-status-legend ee-status-legend-' . EEM_Message::status_idle, 'desc' => EEH_Template::pretty_status(EEM_Message::status_idle, false, 'sentence')), 'failed_status' => array('class' => 'ee-status-legend ee-status-legend-' . EEM_Message::status_failed, 'desc' => EEH_Template::pretty_status(EEM_Message::status_failed, false, 'sentence')), 'resend_status' => array('class' => 'ee-status-legend ee-status-legend-' . EEM_Message::status_resend, 'desc' => EEH_Template::pretty_status(EEM_Message::status_resend, false, 'sentence')), 'incomplete_status' => array('class' => 'ee-status-legend ee-status-legend-' . EEM_Message::status_incomplete, 'desc' => EEH_Template::pretty_status(EEM_Message::status_incomplete, false, 'sentence')), 'retry_status' => array('class' => 'ee-status-legend ee-status-legend-' . EEM_Message::status_retry, 'desc' => EEH_Template::pretty_status(EEM_Message::status_retry, false, 'sentence'))); if (EEM_Message::debug()) { $status_items['debug_only_status'] = array('class' => 'ee-status-legend ee-status-legend-' . EEM_Message::status_debug_only, 'desc' => EEH_Template::pretty_status(EEM_Message::status_debug_only, false, 'sentence')); } return array_merge($action_items, $status_items); }
protected function _stop_two() { return '<p>' . sprintf(__('Specify whether the default registration status be set to Approved, Not Approved, or Pending Payment.', 'event_espresso'), EEH_Template::pretty_status(EEM_Registration::status_id_not_approved, 'lowercase'), EEH_Template::pretty_status(EEM_Registration::status_id_pending_payment, 'lowercase'), EEH_Template::pretty_status(EEM_Registration::status_id_approved, 'lowercase')) . '</p>'; }
/** * column_TXN_timestamp * @param \EE_Transaction $item * @return string */ function column_TXN_timestamp(EE_Transaction $item) { $view_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'view_transaction', 'TXN_ID' => $item->ID()), TXN_ADMIN_URL); $txn_date = '<a href="' . $view_lnk_url . '" title="' . esc_attr__('View Transaction Details for TXN #', 'event_espresso') . $item->ID() . '">' . $this->_get_txn_timestamp($item) . '</a>'; //status $txn_date .= '<br><span class="ee-status-text-small">' . EEH_Template::pretty_status($item->status_ID(), false, 'sentence') . '</span>'; return $txn_date; }
protected function _event_legend_items() { $items = array('view_details' => array('class' => 'dashicons dashicons-search', 'desc' => __('View Event', 'event_espresso')), 'edit_event' => array('class' => 'ee-icon ee-icon-calendar-edit', 'desc' => __('Edit Event Details', 'event_espresso')), 'view_attendees' => array('class' => 'dashicons dashicons-groups', 'desc' => __('View Registrations for Event', 'event_espresso'))); $items = apply_filters('FHEE__Events_Admin_Page___event_legend_items__items', $items); $statuses = array('sold_out_status' => array('class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::sold_out, 'desc' => EEH_Template::pretty_status(EE_Datetime::sold_out, FALSE, 'sentence')), 'active_status' => array('class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::active, 'desc' => EEH_Template::pretty_status(EE_Datetime::active, FALSE, 'sentence')), 'upcoming_status' => array('class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::upcoming, 'desc' => EEH_Template::pretty_status(EE_Datetime::upcoming, FALSE, 'sentence')), 'postponed_status' => array('class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::postponed, 'desc' => EEH_Template::pretty_status(EE_Datetime::postponed, FALSE, 'sentence')), 'cancelled_status' => array('class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::cancelled, 'desc' => EEH_Template::pretty_status(EE_Datetime::cancelled, FALSE, 'sentence')), 'expired_status' => array('class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::expired, 'desc' => EEH_Template::pretty_status(EE_Datetime::expired, FALSE, 'sentence')), 'inactive_status' => array('class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::inactive, 'desc' => EEH_Template::pretty_status(EE_Datetime::inactive, FALSE, 'sentence'))); $statuses = apply_filters('FHEE__Events_Admin_Page__event_legend_items__statuses', $statuses); return array_merge($items, $statuses); }
/** * incoming reg status change from reg details page. * @return void */ protected function _change_reg_status() { $success = FALSE; $this->_req_data['return'] = 'view_registration'; if (!isset($this->_req_data['_reg_status_id'])) { $result['success'] = FALSE; $this->_reg_status_change_return('', $result); } switch ($this->_req_data['_reg_status_id']) { case EEH_Template::pretty_status(EEM_Registration::status_id_approved, FALSE, 'sentence'): $this->approve_registration(); break; case EEH_Template::pretty_status(EEM_Registration::status_id_pending_payment, FALSE, 'sentence'): $this->pending_registration(); break; case EEH_Template::pretty_status(EEM_Registration::status_id_not_approved, FALSE, 'sentence'): $this->not_approve_registration(); break; case EEH_Template::pretty_status(EEM_Registration::status_id_declined, FALSE, 'sentence'): $this->decline_registration(); break; case EEH_Template::pretty_status(EEM_Registration::status_id_cancelled, FALSE, 'sentence'): $this->cancel_registration(); break; default: $result['success'] = FALSE; $this->_reg_status_change_return('', $result); break; } }
protected function _set_tips_array() { $this->_qtipsa = array(0 => array('content_id' => 'attendee-column-tip', 'target' => '.column-attendees .dashicons-groups', 'content' => sprintf(__('%s Registrations', 'event_espresso'), EEH_Template::pretty_status(EEM_Registration::status_id_approved, FALSE, 'sentence')), 'options' => array('position' => array('my' => 'bottom left', 'at' => 'top right', 'adjust' => array('x' => 0, 'y' => 0)))), 1 => array('content_id' => 'ee-event-status-' . EE_Datetime::active, 'target' => '.event-status-' . EE_Datetime::active, 'content' => $this->_event_status_legend(EE_Datetime::active), 'options' => array('position' => array('target' => 'mouse'))), 2 => array('content_id' => 'ee-event-status-' . EE_Datetime::upcoming, 'target' => '.event-status-' . EE_Datetime::upcoming, 'content' => $this->_event_status_legend(EE_Datetime::upcoming), 'options' => array('position' => array('target' => 'mouse'))), 3 => array('content_id' => 'ee-event-status-' . EE_Datetime::postponed, 'target' => '.event-status-' . EE_Datetime::postponed, 'content' => $this->_event_status_legend(EE_Datetime::postponed), 'options' => array('position' => array('target' => 'mouse'))), 4 => array('content_id' => 'ee-event-status-' . EE_Datetime::sold_out, 'target' => '.event-status-' . EE_Datetime::sold_out, 'content' => $this->_event_status_legend(EE_Datetime::sold_out), 'options' => array('position' => array('target' => 'mouse'))), 5 => array('content_id' => 'ee-event-status-' . EE_Datetime::cancelled, 'target' => '.event-status-' . EE_Datetime::cancelled, 'content' => $this->_event_status_legend(EE_Datetime::cancelled), 'options' => array('position' => array('target' => 'mouse'))), 6 => array('content_id' => 'ee-event-status-' . EE_Datetime::expired, 'target' => '.event-status-' . EE_Datetime::expired, 'content' => $this->_event_status_legend(EE_Datetime::expired), 'options' => array('position' => array('target' => 'mouse'))), 7 => array('content_id' => 'ee-event-status-' . EE_Datetime::inactive, 'target' => '.event-status-' . EE_Datetime::inactive, 'content' => $this->_event_status_legend(EE_Datetime::inactive), 'options' => array('position' => array('target' => 'mouse')))); }
/** * This is a helper method to generate a status legend for a given status array. * Note this will only work if the incoming statuses have a key in the EEM_Status->localized_status() methods status_array. * * @param array $status_array array of statuses that will make up the legend. In format: * array( * 'status_item' => 'status_name' * ) * @param string $active_status This is used to indicate what the active status is IF that is to be highlighted in the legend. * @throws EE_Error * @return string html structure for status. */ public static function status_legend($status_array, $active_status = '') { if (!is_array($status_array)) { throw new EE_Error(__('The EEH_Template::status_legend helper required the incoming status_array argument to be an array!', 'event_espresso')); } $setup_array = array(); foreach ($status_array as $item => $status) { $setup_array[$item] = array('class' => 'ee-status-legend ee-status-legend-' . $status, 'desc' => EEH_Template::pretty_status($status, FALSE, 'sentence'), 'status' => $status); } $content = '<div class="ee-list-table-legend-container">' . "\n"; $content .= '<h4>' . __('Status Legend', 'event_espresso') . '</h4>' . "\n"; $content .= '<dl class="ee-list-table-legend">' . "\n\t"; foreach ($setup_array as $item => $details) { $active_class = $active_status == $details['status'] ? ' class="ee-is-active-status"' : ''; $content .= '<dt id="ee-legend-item-tooltip-' . $item . '"' . $active_class . '>' . "\n\t\t"; $content .= '<span class="' . $details['class'] . '"></span>' . "\n\t\t"; $content .= '<span class="ee-legend-description">' . $details['desc'] . '</span>' . "\n\t"; $content .= '</dt>' . "\n"; } $content .= '</dl>' . "\n"; $content .= '</div>' . "\n"; return $content; }
/** * _transaction_legend_items * * @access protected * @return array */ protected function _transaction_legend_items() { $items = array('view_details' => array('class' => 'dashicons dashicons-cart', 'desc' => __('View Transaction Details', 'event_espresso')), 'view_invoice' => array('class' => 'dashicons dashicons-media-spreadsheet', 'desc' => __('View Transaction Invoice', 'event_espresso')), 'view_receipt' => array('class' => 'dashicons dashicons-media-default', 'desc' => __('View Transaction Receipt', 'event_espresso')), 'view_registration' => array('class' => 'dashicons dashicons-clipboard', 'desc' => __('View Registration Details', 'event_espresso'))); if (EE_Registry::instance()->CAP->current_user_can('ee_send_message', 'espresso_transactions_send_payment_reminder')) { EE_Registry::instance()->load_helper('MSG_Template'); if (EEH_MSG_Template::is_mt_active('payment_reminder')) { $items['send_payment_reminder'] = array('class' => 'dashicons dashicons-email-alt', 'desc' => __('Send Payment Reminder', 'event_espresso')); } else { $items['blank*'] = array('class' => '', 'desc' => ''); } } else { $items['blank*'] = array('class' => '', 'desc' => ''); } $more_items = array('overpaid' => array('class' => 'ee-status-legend ee-status-legend-' . EEM_Transaction::overpaid_status_code, 'desc' => EEH_Template::pretty_status(EEM_Transaction::overpaid_status_code, FALSE, 'sentence')), 'complete' => array('class' => 'ee-status-legend ee-status-legend-' . EEM_Transaction::complete_status_code, 'desc' => EEH_Template::pretty_status(EEM_Transaction::complete_status_code, FALSE, 'sentence')), 'incomplete' => array('class' => 'ee-status-legend ee-status-legend-' . EEM_Transaction::incomplete_status_code, 'desc' => EEH_Template::pretty_status(EEM_Transaction::incomplete_status_code, FALSE, 'sentence')), 'abandoned' => array('class' => 'ee-status-legend ee-status-legend-' . EEM_Transaction::abandoned_status_code, 'desc' => EEH_Template::pretty_status(EEM_Transaction::abandoned_status_code, FALSE, 'sentence')), 'failed' => array('class' => 'ee-status-legend ee-status-legend-' . EEM_Transaction::failed_status_code, 'desc' => EEH_Template::pretty_status(EEM_Transaction::failed_status_code, FALSE, 'sentence'))); return array_merge($items, $more_items); }
protected function _transaction_legend_items() { $items = array('view_details' => array('class' => 'dashicons dashicons-cart', 'desc' => __('View Transaction Details', 'event_espresso')), 'download_invoice' => array('class' => 'ee-icon ee-icon-PDF-file-type', 'desc' => __('Download Transaction Invoice as a PDF', 'event_espresso')), 'view_registration' => array('class' => 'dashicons dashicons-clipboard', 'desc' => __('View Registration Details', 'event_espresso'))); EE_Registry::instance()->load_helper('MSG_Template'); if (EEH_MSG_Template::is_mt_active('payment_reminder')) { $items['send_payment_reminder'] = array('class' => 'dashicons dashicons-email-alt', 'desc' => __('Send Payment Reminder', 'event_espresso')); } else { $items['blank*'] = array('class' => '', 'desc' => ''); } $more_items = array('blank' => array('class' => '', 'desc' => ''), 'overpaid' => array('class' => 'ee-status-legend ee-status-legend-' . EEM_Transaction::overpaid_status_code, 'desc' => EEH_Template::pretty_status(EEM_Transaction::overpaid_status_code, FALSE, 'sentence')), 'complete' => array('class' => 'ee-status-legend ee-status-legend-' . EEM_Transaction::complete_status_code, 'desc' => EEH_Template::pretty_status(EEM_Transaction::complete_status_code, FALSE, 'sentence')), 'incomplete' => array('class' => 'ee-status-legend ee-status-legend-' . EEM_Transaction::incomplete_status_code, 'desc' => EEH_Template::pretty_status(EEM_Transaction::incomplete_status_code, FALSE, 'sentence')), 'failed' => array('class' => 'ee-status-legend ee-status-legend-' . EEM_Transaction::failed_status_code, 'desc' => EEH_Template::pretty_status(EEM_Transaction::failed_status_code, FALSE, 'sentence'))); return array_merge($items, $more_items); }
/** * This generates the ticket row for tickets. * This same method is used to generate both the actual rows and the js skeleton row (when default == * true) * * @param int $tktrow Represents the row number being generated. * @param mixed null|EE_Ticket $ticket If default then this will be null. * @param EE_Datetime[] $ticket_datetimes Either an array of all datetimes on all tickets indexed by * each ticket or empty for default * @param EE_Datetime[] $all_dtts All Datetimes on the event or empty for default. * @param bool $default Whether default row being generated or not. * @param EE_Ticket[] $all_tickets This is an array of all tickets attached to the event (or empty in the * case of defaults) * * @return [type] [description] */ protected function _get_ticket_row($tktrow, $ticket, $ticket_datetimes, $all_dtts, $default = FALSE, $all_tickets = array()) { //if $ticket is not an instance of EE_Ticket then force default to true. $default = !$ticket instanceof EE_Ticket ? true : false; $prices = !empty($ticket) && !$default ? $ticket->get_many_related('Price', array('default_where_conditions' => 'none', 'order_by' => array('PRC_order' => 'ASC'))) : array(); //if there is only one price (which would be the base price) or NO prices and this ticket is a default ticket, let's just make sure there are no cached default prices on //the object. This is done by not including any query_params. if ($ticket instanceof EE_Ticket && $ticket->is_default() && (count($prices) === 1 || empty($prices))) { $prices = $ticket->get_many_related('Price'); } // check if we're dealing with a default ticket in which case we don't want any starting_ticket_datetime_row values set (otherwise there won't be any new relationships created for tickets based off of the default ticket). This will future proof in case there is ever any behaviour change between what the primary_key defaults to. $default_dtt = $default || $ticket instanceof EE_Ticket && $ticket->get('TKT_is_default') ? TRUE : FALSE; $tkt_dtts = $ticket instanceof EE_Ticket && isset($ticket_datetimes[$ticket->ID()]) ? $ticket_datetimes[$ticket->ID()] : array(); $ticket_subtotal = $default ? 0 : $ticket->get_ticket_subtotal(); $base_price = $default ? NULL : $ticket->base_price(); $count_price_mods = EEM_Price::instance()->get_all_default_prices(TRUE); //breaking out complicated condition for ticket_status if ($default) { $ticket_status_class = ' tkt-status-' . EE_Ticket::onsale; } else { $ticket_status_class = $ticket->is_default() ? ' tkt-status-' . EE_Ticket::onsale : ' tkt-status-' . $ticket->ticket_status(); } //breaking out complicated condition for TKT_taxable if ($default) { $TKT_taxable = ''; } else { $TKT_taxable = $ticket->get('TKT_taxable') ? ' checked="checked"' : ''; } $template_args = array('tkt_row' => $default ? 'TICKETNUM' : $tktrow, 'TKT_order' => $default ? 'TICKETNUM' : $tktrow, 'tkt_status_class' => $ticket_status_class, 'display_edit_tkt_row' => ' style="display:none;"', 'edit_tkt_expanded' => '', 'edit_tickets_name' => $default ? 'TICKETNAMEATTR' : 'edit_tickets', 'TKT_name' => $default ? '' : $ticket->get('TKT_name'), 'TKT_start_date' => $default ? '' : $ticket->get_date('TKT_start_date', $this->_date_format_strings['date'] . ' ' . $this->_date_format_strings['time']), 'TKT_end_date' => $default ? '' : $ticket->get_date('TKT_end_date', $this->_date_format_strings['date'] . ' ' . $this->_date_format_strings['time']), 'TKT_status' => $default ? EEH_Template::pretty_status(EE_Ticket::onsale, FALSE, 'sentence') : $ticket->is_default() ? EEH_Template::pretty_status(EE_Ticket::onsale, FALSE, 'sentence') : $ticket->ticket_status(TRUE), 'TKT_price' => $default ? '' : EEH_Template::format_currency($ticket->get_ticket_total_with_taxes(), FALSE, FALSE), 'TKT_price_code' => EE_Registry::instance()->CFG->currency->code, 'TKT_price_amount' => $default ? 0 : $ticket_subtotal, 'TKT_qty' => $default ? '' : $ticket->get_pretty('TKT_qty', 'symbol'), 'TKT_qty_for_input' => $default ? '' : $ticket->get_pretty('TKT_qty', 'input'), 'TKT_uses' => $default ? '' : $ticket->get_pretty('TKT_uses', 'input'), 'TKT_min' => $default ? '' : ($ticket->get('TKT_min') === -1 || $ticket->get('TKT_min') === 0 ? '' : $ticket->get('TKT_min')), 'TKT_max' => $default ? '' : $ticket->get_pretty('TKT_max', 'input'), 'TKT_sold' => $default ? 0 : $ticket->tickets_sold('ticket'), 'TKT_registrations' => $default ? 0 : $ticket->count_registrations(array(array('STS_ID' => array('!=', EEM_Registration::status_id_incomplete)))), 'TKT_ID' => $default ? 0 : $ticket->get('TKT_ID'), 'TKT_description' => $default ? '' : $ticket->get('TKT_description'), 'TKT_is_default' => $default ? 0 : $ticket->get('TKT_is_default'), 'TKT_required' => $default ? 0 : $ticket->required(), 'TKT_is_default_selector' => '', 'ticket_price_rows' => '', 'TKT_base_price' => $default || !$base_price instanceof EE_Price ? '' : $base_price->get_pretty('PRC_amount', 'localized_float'), 'TKT_base_price_ID' => $default || !$base_price instanceof EE_Price ? 0 : $base_price->ID(), 'show_price_modifier' => count($prices) > 1 || $default && $count_price_mods > 0 ? '' : ' style="display:none;"', 'show_price_mod_button' => count($prices) > 1 || $default && $count_price_mods > 0 || !$default && $ticket->get('TKT_deleted') ? ' style="display:none;"' : '', 'total_price_rows' => count($prices) > 1 ? count($prices) : 1, 'ticket_datetimes_list' => $default ? '<li class="hidden"></li>' : '', 'starting_ticket_datetime_rows' => $default || $default_dtt ? '' : implode(',', $tkt_dtts), 'ticket_datetime_rows' => $default ? '' : implode(',', $tkt_dtts), 'existing_ticket_price_ids' => $default, '', implode(',', array_keys($prices)), 'ticket_template_id' => $default ? 0 : $ticket->get('TTM_ID'), 'TKT_taxable' => $TKT_taxable, 'display_subtotal' => $ticket instanceof EE_Ticket && $ticket->get('TKT_taxable') ? '' : ' style="display:none"', 'price_currency_symbol' => EE_Registry::instance()->CFG->currency->sign, 'TKT_subtotal_amount_display' => EEH_Template::format_currency($ticket_subtotal, FALSE, FALSE), 'TKT_subtotal_amount' => $ticket_subtotal, 'tax_rows' => $this->_get_tax_rows($tktrow, $ticket), 'disabled' => $ticket instanceof EE_Ticket && $ticket->get('TKT_deleted') ? TRUE : FALSE, 'ticket_archive_class' => $ticket instanceof EE_Ticket && $ticket->get('TKT_deleted') ? ' ticket-archived' : '', 'trash_icon' => $ticket instanceof EE_Ticket && $ticket->get('TKT_deleted') ? 'ee-lock-icon ' : 'trash-icon dashicons dashicons-post-trash clickable', 'clone_icon' => $ticket instanceof EE_Ticket && $ticket->get('TKT_deleted') ? '' : 'clone-icon ee-icon ee-icon-clone clickable'); $template_args['trash_hidden'] = count($all_tickets) === 1 && $template_args['trash_icon'] != 'ee-lock-icon' ? ' style="display:none"' : ''; //handle rows that should NOT be empty if (empty($template_args['TKT_start_date'])) { //if empty then the start date will be now. $template_args['TKT_start_date'] = date($this->_date_format_strings['date'] . ' ' . $this->_date_format_strings['time'], current_time('timestamp')); $template_args['tkt_status_class'] = ' tkt-status-' . EE_Ticket::onsale; } if (empty($template_args['TKT_end_date'])) { //get the earliest datetime (if present); $earliest_dtt = $this->_adminpage_obj->get_cpt_model_obj()->ID() > 0 ? $this->_adminpage_obj->get_cpt_model_obj()->get_first_related('Datetime', array('order_by' => array('DTT_EVT_start' => 'ASC'))) : NULL; if (!empty($earliest_dtt)) { $template_args['TKT_end_date'] = $earliest_dtt->get_datetime('DTT_EVT_start', $this->_date_format_strings['date'] . ' ' . $this->_date_format_strings['time']); } else { //default so let's just use what's been set for the default date-time which is 30 days from now. $template_args['TKT_end_date'] = date($this->_date_format_strings['date'] . ' ' . $this->_date_format_strings['time'], mktime(24, 0, 0, date("m"), date("d") + 29, date("Y"))); } $template_args['tkt_status_class'] = ' tkt-status-' . EE_Ticket::onsale; } //generate ticket_datetime items if (!$default) { $dttrow = 1; foreach ($all_dtts as $dtt) { $template_args['ticket_datetimes_list'] .= $this->_get_ticket_datetime_list_item($dttrow, $tktrow, $dtt, $ticket, $ticket_datetimes, $default); $dttrow++; } } $prcrow = 1; foreach ($prices as $price) { if ($price->is_base_price()) { $prcrow++; continue; } $show_trash = count($prices) > 1 && $prcrow === 1 || count($prices) === 1 ? FALSE : TRUE; $show_create = count($prices) > 1 && count($prices) !== $prcrow ? FALSE : TRUE; $template_args['ticket_price_rows'] .= $this->_get_ticket_price_row($tktrow, $prcrow, $price, $default, $ticket, $show_trash, $show_create); $prcrow++; } //filter $template_args $template_args = apply_filters('FHEE__espresso_events_Pricing_Hooks___get_ticket_row__template_args', $template_args, $tktrow, $ticket, $ticket_datetimes, $all_dtts, $default, $all_tickets, $this->_is_creating_event); $template = PRICING_TEMPLATE_PATH . 'event_tickets_datetime_ticket_row.template.php'; return EEH_Template::display_template($template, $template_args, TRUE); }
protected function _set_tips_array() { $this->_qtipsa = array(0 => array('content_id' => 'attendee-column-tip', 'target' => '.column-attendees .dashicons-groups', 'content' => sprintf(__('%s Registrations', 'event_espresso'), EEH_Template::pretty_status(EEM_Registration::status_id_approved, FALSE, 'sentence')), 'options' => array('position' => array('my' => 'bottom left', 'at' => 'top right', 'adjust' => array('x' => 0, 'y' => 0))))); }
/** * pretty_active_status * * @access public * @param boolean $echo whether to return (FALSE), or echo out the result (TRUE) * @return mixed void|string */ public function pretty_active_status($echo = TRUE) { $active_status = $this->get_active_status(); $status = '<span class="ee-status event-active-status-' . $active_status . '">' . EEH_Template::pretty_status($active_status, FALSE, 'sentence') . '</span>'; if ($echo) { echo $status; return ''; } return $status; }
<h3><?php _e('Default Registration Status', 'event_espresso'); ?> </h3> <p> <strong><?php echo EEH_Template::pretty_status(EEM_Registration::status_id_approved, FALSE, 'sentence'); ?> </strong><br /> <?php printf(__('A status of %s means that a registration has been accepted as complete. The registration will count towards the registration limit, remaining tickets, and calculations for available seats. Payments (if necessary) can also be made by primary registrants with this status.', 'event_espresso'), EEH_Template::pretty_status(EEM_Registration::status_id_approved, FALSE, 'sentence')); ?> </p> <p> <strong><?php echo EEH_Template::pretty_status(EEM_Registration::status_id_pending_payment, FALSE, 'sentence'); ?> </strong><br /> <?php printf(__('A status of %1$s means that a registration has not paid but they ARE able to make payments (if necessary). %2$s registrations do NOT count towards registration limits, remaining tickets, and calculations for available seats. If registration for a free event occurs, then registrations are automatically set to %3$s. For paid tickets, %1$s registrations are set to %3$s when full payment is recorded.', 'event_espresso'), EEH_Template::pretty_status(EEM_Registration::status_id_pending_payment, FALSE, 'sentence'), EEH_Template::pretty_status(EEM_Registration::status_id_pending_payment, FALSE, 'sentence'), EEH_Template::pretty_status(EEM_Registration::status_id_approved, FALSE, 'sentence')); ?> </p> <p> <strong><?php echo EEH_Template::pretty_status(EEM_Registration::status_id_not_approved, FALSE, 'sentence'); ?> </strong><br /> <?php printf(__('A status of %1$s means that a registration has not paid and they cannot make payments for towards an event. Un-approved registrations do NOT count towards registration limits, remaining tickets, and calculations for available seats. This setting differs from the "%2$s" default in that free ticket registrations and paid in full ticket registrations do NOT automatically switch the Registration to %3$s. Instead, the event admin must manually set the registration to either "%2$s" for registrations requiring payments, or "%3$s" for free events.', 'event_espresso'), EEH_Template::pretty_status(EEM_Registration::status_id_not_approved, FALSE, 'sentence'), EEH_Template::pretty_status(EEM_Registration::status_id_pending_payment, FALSE, 'upper'), EEH_Template::pretty_status(EEM_Registration::status_id_approved, FALSE, 'upper')); ?> </p>