@@ -13,115 +13,115 @@ |
||
| 13 | 13 | class Extend_EE_Registrations_List_Table extends EE_Registrations_List_Table |
| 14 | 14 | { |
| 15 | 15 | |
| 16 | - /** |
|
| 17 | - * @param EE_Registration $item |
|
| 18 | - * @return string |
|
| 19 | - * @throws EE_Error |
|
| 20 | - * @throws InvalidArgumentException |
|
| 21 | - * @throws ReflectionException |
|
| 22 | - * @throws InvalidDataTypeException |
|
| 23 | - * @throws InvalidInterfaceException |
|
| 24 | - */ |
|
| 25 | - public function column__REG_date(EE_Registration $item) |
|
| 26 | - { |
|
| 27 | - $date_linked = parent::column__REG_date($item); |
|
| 28 | - $actions = array(); |
|
| 29 | - // Build row actions |
|
| 30 | - $check_in_url = EE_Admin_Page::add_query_args_and_nonce(array( |
|
| 31 | - 'action' => 'event_registrations', |
|
| 32 | - 'event_id' => $item->event_ID(), |
|
| 33 | - ), REG_ADMIN_URL); |
|
| 34 | - $actions['check_in'] = EE_Registry::instance()->CAP->current_user_can( |
|
| 35 | - 'ee_read_registration', |
|
| 36 | - 'espresso_registrations_registration_checkins', |
|
| 37 | - $item->ID() |
|
| 38 | - ) && EE_Registry::instance()->CAP->current_user_can( |
|
| 39 | - 'ee_read_checkins', |
|
| 40 | - 'espresso_registrations_registration_checkins' |
|
| 41 | - ) |
|
| 42 | - ? '<a href="' . $check_in_url . '"' |
|
| 43 | - . ' title="' . esc_attr__( |
|
| 44 | - 'The Check-In List allows you to easily toggle check-in status for this event', |
|
| 45 | - 'event_espresso' |
|
| 46 | - ) |
|
| 47 | - . '">' . esc_html__('View Check-ins', 'event_espresso') . '</a>' |
|
| 48 | - : esc_html__('View Check-ins', 'event_espresso'); |
|
| 16 | + /** |
|
| 17 | + * @param EE_Registration $item |
|
| 18 | + * @return string |
|
| 19 | + * @throws EE_Error |
|
| 20 | + * @throws InvalidArgumentException |
|
| 21 | + * @throws ReflectionException |
|
| 22 | + * @throws InvalidDataTypeException |
|
| 23 | + * @throws InvalidInterfaceException |
|
| 24 | + */ |
|
| 25 | + public function column__REG_date(EE_Registration $item) |
|
| 26 | + { |
|
| 27 | + $date_linked = parent::column__REG_date($item); |
|
| 28 | + $actions = array(); |
|
| 29 | + // Build row actions |
|
| 30 | + $check_in_url = EE_Admin_Page::add_query_args_and_nonce(array( |
|
| 31 | + 'action' => 'event_registrations', |
|
| 32 | + 'event_id' => $item->event_ID(), |
|
| 33 | + ), REG_ADMIN_URL); |
|
| 34 | + $actions['check_in'] = EE_Registry::instance()->CAP->current_user_can( |
|
| 35 | + 'ee_read_registration', |
|
| 36 | + 'espresso_registrations_registration_checkins', |
|
| 37 | + $item->ID() |
|
| 38 | + ) && EE_Registry::instance()->CAP->current_user_can( |
|
| 39 | + 'ee_read_checkins', |
|
| 40 | + 'espresso_registrations_registration_checkins' |
|
| 41 | + ) |
|
| 42 | + ? '<a href="' . $check_in_url . '"' |
|
| 43 | + . ' title="' . esc_attr__( |
|
| 44 | + 'The Check-In List allows you to easily toggle check-in status for this event', |
|
| 45 | + 'event_espresso' |
|
| 46 | + ) |
|
| 47 | + . '">' . esc_html__('View Check-ins', 'event_espresso') . '</a>' |
|
| 48 | + : esc_html__('View Check-ins', 'event_espresso'); |
|
| 49 | 49 | |
| 50 | - return sprintf('%1$s %2$s', $date_linked, $this->row_actions($actions)); |
|
| 51 | - } |
|
| 50 | + return sprintf('%1$s %2$s', $date_linked, $this->row_actions($actions)); |
|
| 51 | + } |
|
| 52 | 52 | |
| 53 | 53 | |
| 54 | - /** |
|
| 55 | - * column_default |
|
| 56 | - * |
|
| 57 | - * @param \EE_Registration $item |
|
| 58 | - * @return string |
|
| 59 | - * @throws EE_Error |
|
| 60 | - * @throws InvalidArgumentException |
|
| 61 | - * @throws InvalidDataTypeException |
|
| 62 | - * @throws InvalidInterfaceException |
|
| 63 | - * @throws ReflectionException |
|
| 64 | - */ |
|
| 65 | - public function column_DTT_EVT_start(EE_Registration $item) |
|
| 66 | - { |
|
| 67 | - $remove_defaults = array('default_where_conditions' => 'none'); |
|
| 68 | - $ticket = $item->ticket(); |
|
| 69 | - $datetimes = $ticket instanceof EE_Ticket ? $ticket->datetimes($remove_defaults) : array(); |
|
| 70 | - $EVT_ID = $item->event_ID(); |
|
| 71 | - $datetimes_for_display = array(); |
|
| 72 | - foreach ($datetimes as $datetime) { |
|
| 73 | - $datetime_string = ''; |
|
| 74 | - if (EE_Registry::instance()->CAP->current_user_can( |
|
| 75 | - 'ee_read_checkin', |
|
| 76 | - 'espresso_registrations_registration_checkins', |
|
| 77 | - $item->ID() |
|
| 78 | - )) { |
|
| 79 | - // open "a" tag and "href" |
|
| 80 | - $datetime_string .= '<a href="'; |
|
| 81 | - // checkin URL |
|
| 82 | - $datetime_string .= EE_Admin_Page::add_query_args_and_nonce( |
|
| 83 | - array( |
|
| 84 | - 'action' => 'event_registrations', |
|
| 85 | - 'event_id' => $EVT_ID, |
|
| 86 | - 'DTT_ID' => $datetime->ID(), |
|
| 87 | - ), |
|
| 88 | - REG_ADMIN_URL |
|
| 89 | - ); |
|
| 90 | - // close "href" |
|
| 91 | - $datetime_string .= '"'; |
|
| 92 | - // open "title" tag |
|
| 93 | - $datetime_string .= ' title="'; |
|
| 94 | - // link title text |
|
| 95 | - $datetime_string .= esc_attr__('View Checkins for this Event', 'event_espresso'); |
|
| 96 | - // close "title" tag and end of "a" tag opening |
|
| 97 | - $datetime_string .= '">'; |
|
| 98 | - // link text |
|
| 99 | - $datetime_string .= $datetime->get_i18n_datetime('DTT_EVT_start'); |
|
| 100 | - // close "a" tag |
|
| 101 | - $datetime_string .= '</a>'; |
|
| 102 | - } else { |
|
| 103 | - $datetime_string .= $datetime->get_i18n_datetime('DTT_EVT_start'); |
|
| 104 | - } |
|
| 105 | - // add a "View Registrations" link that filters list by event AND datetime |
|
| 106 | - $datetime_string .= $this->row_actions( |
|
| 107 | - array( |
|
| 108 | - 'event_datetime_filter' => '<a href="' . EE_Admin_Page::add_query_args_and_nonce( |
|
| 109 | - array('event_id' => $EVT_ID, 'datetime_id' => $datetime->ID()), |
|
| 110 | - REG_ADMIN_URL |
|
| 111 | - ) |
|
| 112 | - . '" title="' . sprintf( |
|
| 113 | - esc_attr__( |
|
| 114 | - 'Filter this list to only show registrations for this datetime %s', |
|
| 115 | - 'event_espresso' |
|
| 116 | - ), |
|
| 117 | - $datetime->name() |
|
| 118 | - ) . '">' |
|
| 119 | - . esc_html__('View Registrations', 'event_espresso') |
|
| 120 | - . '</a>', |
|
| 121 | - ) |
|
| 122 | - ); |
|
| 123 | - $datetimes_for_display[] = $datetime_string; |
|
| 124 | - } |
|
| 125 | - return $this->generateDisplayForDateTimes($datetimes_for_display); |
|
| 126 | - } |
|
| 54 | + /** |
|
| 55 | + * column_default |
|
| 56 | + * |
|
| 57 | + * @param \EE_Registration $item |
|
| 58 | + * @return string |
|
| 59 | + * @throws EE_Error |
|
| 60 | + * @throws InvalidArgumentException |
|
| 61 | + * @throws InvalidDataTypeException |
|
| 62 | + * @throws InvalidInterfaceException |
|
| 63 | + * @throws ReflectionException |
|
| 64 | + */ |
|
| 65 | + public function column_DTT_EVT_start(EE_Registration $item) |
|
| 66 | + { |
|
| 67 | + $remove_defaults = array('default_where_conditions' => 'none'); |
|
| 68 | + $ticket = $item->ticket(); |
|
| 69 | + $datetimes = $ticket instanceof EE_Ticket ? $ticket->datetimes($remove_defaults) : array(); |
|
| 70 | + $EVT_ID = $item->event_ID(); |
|
| 71 | + $datetimes_for_display = array(); |
|
| 72 | + foreach ($datetimes as $datetime) { |
|
| 73 | + $datetime_string = ''; |
|
| 74 | + if (EE_Registry::instance()->CAP->current_user_can( |
|
| 75 | + 'ee_read_checkin', |
|
| 76 | + 'espresso_registrations_registration_checkins', |
|
| 77 | + $item->ID() |
|
| 78 | + )) { |
|
| 79 | + // open "a" tag and "href" |
|
| 80 | + $datetime_string .= '<a href="'; |
|
| 81 | + // checkin URL |
|
| 82 | + $datetime_string .= EE_Admin_Page::add_query_args_and_nonce( |
|
| 83 | + array( |
|
| 84 | + 'action' => 'event_registrations', |
|
| 85 | + 'event_id' => $EVT_ID, |
|
| 86 | + 'DTT_ID' => $datetime->ID(), |
|
| 87 | + ), |
|
| 88 | + REG_ADMIN_URL |
|
| 89 | + ); |
|
| 90 | + // close "href" |
|
| 91 | + $datetime_string .= '"'; |
|
| 92 | + // open "title" tag |
|
| 93 | + $datetime_string .= ' title="'; |
|
| 94 | + // link title text |
|
| 95 | + $datetime_string .= esc_attr__('View Checkins for this Event', 'event_espresso'); |
|
| 96 | + // close "title" tag and end of "a" tag opening |
|
| 97 | + $datetime_string .= '">'; |
|
| 98 | + // link text |
|
| 99 | + $datetime_string .= $datetime->get_i18n_datetime('DTT_EVT_start'); |
|
| 100 | + // close "a" tag |
|
| 101 | + $datetime_string .= '</a>'; |
|
| 102 | + } else { |
|
| 103 | + $datetime_string .= $datetime->get_i18n_datetime('DTT_EVT_start'); |
|
| 104 | + } |
|
| 105 | + // add a "View Registrations" link that filters list by event AND datetime |
|
| 106 | + $datetime_string .= $this->row_actions( |
|
| 107 | + array( |
|
| 108 | + 'event_datetime_filter' => '<a href="' . EE_Admin_Page::add_query_args_and_nonce( |
|
| 109 | + array('event_id' => $EVT_ID, 'datetime_id' => $datetime->ID()), |
|
| 110 | + REG_ADMIN_URL |
|
| 111 | + ) |
|
| 112 | + . '" title="' . sprintf( |
|
| 113 | + esc_attr__( |
|
| 114 | + 'Filter this list to only show registrations for this datetime %s', |
|
| 115 | + 'event_espresso' |
|
| 116 | + ), |
|
| 117 | + $datetime->name() |
|
| 118 | + ) . '">' |
|
| 119 | + . esc_html__('View Registrations', 'event_espresso') |
|
| 120 | + . '</a>', |
|
| 121 | + ) |
|
| 122 | + ); |
|
| 123 | + $datetimes_for_display[] = $datetime_string; |
|
| 124 | + } |
|
| 125 | + return $this->generateDisplayForDateTimes($datetimes_for_display); |
|
| 126 | + } |
|
| 127 | 127 | } |
@@ -39,12 +39,12 @@ discard block |
||
| 39 | 39 | 'ee_read_checkins', |
| 40 | 40 | 'espresso_registrations_registration_checkins' |
| 41 | 41 | ) |
| 42 | - ? '<a href="' . $check_in_url . '"' |
|
| 43 | - . ' title="' . esc_attr__( |
|
| 42 | + ? '<a href="'.$check_in_url.'"' |
|
| 43 | + . ' title="'.esc_attr__( |
|
| 44 | 44 | 'The Check-In List allows you to easily toggle check-in status for this event', |
| 45 | 45 | 'event_espresso' |
| 46 | 46 | ) |
| 47 | - . '">' . esc_html__('View Check-ins', 'event_espresso') . '</a>' |
|
| 47 | + . '">'.esc_html__('View Check-ins', 'event_espresso').'</a>' |
|
| 48 | 48 | : esc_html__('View Check-ins', 'event_espresso'); |
| 49 | 49 | |
| 50 | 50 | return sprintf('%1$s %2$s', $date_linked, $this->row_actions($actions)); |
@@ -105,17 +105,17 @@ discard block |
||
| 105 | 105 | // add a "View Registrations" link that filters list by event AND datetime |
| 106 | 106 | $datetime_string .= $this->row_actions( |
| 107 | 107 | array( |
| 108 | - 'event_datetime_filter' => '<a href="' . EE_Admin_Page::add_query_args_and_nonce( |
|
| 108 | + 'event_datetime_filter' => '<a href="'.EE_Admin_Page::add_query_args_and_nonce( |
|
| 109 | 109 | array('event_id' => $EVT_ID, 'datetime_id' => $datetime->ID()), |
| 110 | 110 | REG_ADMIN_URL |
| 111 | 111 | ) |
| 112 | - . '" title="' . sprintf( |
|
| 112 | + . '" title="'.sprintf( |
|
| 113 | 113 | esc_attr__( |
| 114 | 114 | 'Filter this list to only show registrations for this datetime %s', |
| 115 | 115 | 'event_espresso' |
| 116 | 116 | ), |
| 117 | 117 | $datetime->name() |
| 118 | - ) . '">' |
|
| 118 | + ).'">' |
|
| 119 | 119 | . esc_html__('View Registrations', 'event_espresso') |
| 120 | 120 | . '</a>', |
| 121 | 121 | ) |
@@ -12,562 +12,562 @@ |
||
| 12 | 12 | class EE_Event_Registrations_List_Table extends EE_Admin_List_Table |
| 13 | 13 | { |
| 14 | 14 | |
| 15 | - /** |
|
| 16 | - * This property will hold the related Datetimes on an event IF the event id is included in the request. |
|
| 17 | - * |
|
| 18 | - * @var EE_Datetime[] |
|
| 19 | - */ |
|
| 20 | - protected $_dtts_for_event = array(); |
|
| 21 | - |
|
| 22 | - |
|
| 23 | - /** |
|
| 24 | - * The event if one is specified in the request |
|
| 25 | - * |
|
| 26 | - * @var EE_Event |
|
| 27 | - */ |
|
| 28 | - protected $_evt = null; |
|
| 29 | - |
|
| 30 | - |
|
| 31 | - /** |
|
| 32 | - * The DTT_ID if the current view has a specified datetime. |
|
| 33 | - * |
|
| 34 | - * @var int $_cur_dtt_id |
|
| 35 | - */ |
|
| 36 | - protected $_cur_dtt_id = 0; |
|
| 37 | - |
|
| 38 | - |
|
| 39 | - /** |
|
| 40 | - * EE_Event_Registrations_List_Table constructor. |
|
| 41 | - * |
|
| 42 | - * @param \Registrations_Admin_Page $admin_page |
|
| 43 | - */ |
|
| 44 | - public function __construct($admin_page) |
|
| 45 | - { |
|
| 46 | - parent::__construct($admin_page); |
|
| 47 | - $this->_status = $this->_admin_page->get_registration_status_array(); |
|
| 48 | - } |
|
| 49 | - |
|
| 50 | - |
|
| 51 | - protected function _setup_data() |
|
| 52 | - { |
|
| 53 | - $this->_data = $this->_view !== 'trash' ? $this->_admin_page->get_event_attendees($this->_per_page) |
|
| 54 | - : $this->_admin_page->get_event_attendees($this->_per_page, false, true); |
|
| 55 | - $this->_all_data_count = $this->_view !== 'trash' ? $this->_admin_page->get_event_attendees( |
|
| 56 | - $this->_per_page, |
|
| 57 | - true |
|
| 58 | - ) : $this->_admin_page->get_event_attendees($this->_per_page, true, true); |
|
| 59 | - } |
|
| 60 | - |
|
| 61 | - |
|
| 62 | - protected function _set_properties() |
|
| 63 | - { |
|
| 64 | - $evt_id = isset($this->_req_data['event_id']) ? $this->_req_data['event_id'] : null; |
|
| 65 | - $this->_wp_list_args = array( |
|
| 66 | - 'singular' => __('registrant', 'event_espresso'), |
|
| 67 | - 'plural' => __('registrants', 'event_espresso'), |
|
| 68 | - 'ajax' => true, |
|
| 69 | - 'screen' => $this->_admin_page->get_current_screen()->id, |
|
| 70 | - ); |
|
| 71 | - $columns = array(); |
|
| 72 | - // $columns['_Reg_Status'] = ''; |
|
| 73 | - if (! empty($evt_id)) { |
|
| 74 | - $columns['cb'] = '<input type="checkbox" />'; // Render a checkbox instead of text |
|
| 75 | - $this->_has_checkbox_column = true; |
|
| 76 | - } |
|
| 77 | - $this->_columns = array( |
|
| 78 | - '_REG_att_checked_in' => '<span class="dashicons dashicons-yes ee-icon-size-18"></span>', |
|
| 79 | - 'ATT_name' => __('Registrant', 'event_espresso'), |
|
| 80 | - 'ATT_email' => __('Email Address', 'event_espresso'), |
|
| 81 | - 'Event' => __('Event', 'event_espresso'), |
|
| 82 | - 'PRC_name' => __('TKT Option', 'event_espresso'), |
|
| 83 | - '_REG_final_price' => __('Price', 'event_espresso'), |
|
| 84 | - 'TXN_paid' => __('Paid', 'event_espresso'), |
|
| 85 | - 'TXN_total' => __('Total', 'event_espresso'), |
|
| 86 | - ); |
|
| 87 | - $this->_columns = array_merge($columns, $this->_columns); |
|
| 88 | - $this->_primary_column = '_REG_att_checked_in'; |
|
| 89 | - if (! empty($evt_id) |
|
| 90 | - && EE_Registry::instance()->CAP->current_user_can( |
|
| 91 | - 'ee_read_registrations', |
|
| 92 | - 'espresso_registrations_registrations_reports', |
|
| 93 | - $evt_id |
|
| 94 | - ) |
|
| 95 | - ) { |
|
| 96 | - $this->_bottom_buttons = array( |
|
| 97 | - 'report' => array( |
|
| 98 | - 'route' => 'registrations_report', |
|
| 99 | - 'extra_request' => |
|
| 100 | - array( |
|
| 101 | - 'EVT_ID' => $evt_id, |
|
| 102 | - 'return_url' => urlencode("//{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}"), |
|
| 103 | - ), |
|
| 104 | - ), |
|
| 105 | - ); |
|
| 106 | - } |
|
| 107 | - $this->_bottom_buttons['report_filtered'] = array( |
|
| 108 | - 'route' => 'registrations_checkin_report', |
|
| 109 | - 'extra_request' => array( |
|
| 110 | - 'use_filters' => true, |
|
| 111 | - 'filters' => array_merge( |
|
| 112 | - array( |
|
| 113 | - 'EVT_ID' => $evt_id, |
|
| 114 | - ), |
|
| 115 | - array_diff_key( |
|
| 116 | - $this->_req_data, |
|
| 117 | - array_flip( |
|
| 118 | - array( |
|
| 119 | - 'page', |
|
| 120 | - 'action', |
|
| 121 | - 'default_nonce', |
|
| 122 | - ) |
|
| 123 | - ) |
|
| 124 | - ) |
|
| 125 | - ), |
|
| 126 | - 'return_url' => urlencode("//{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}"), |
|
| 127 | - ), |
|
| 128 | - ); |
|
| 129 | - $this->_sortable_columns = array( |
|
| 130 | - /** |
|
| 131 | - * Allows users to change the default sort if they wish. |
|
| 132 | - * Returning a falsey on this filter will result in the default sort to be by firstname rather than last name. |
|
| 133 | - * |
|
| 134 | - * Note: usual naming conventions for filters aren't followed here so that just one filter can be used to |
|
| 135 | - * change the sorts on any list table involving registration contacts. If you want to only change the filter |
|
| 136 | - * for a specific list table you can use the provided reference to this object instance. |
|
| 137 | - */ |
|
| 138 | - 'ATT_name' => array( |
|
| 139 | - 'FHEE__EE_Registrations_List_Table___set_properties__default_sort_by_registration_last_name', |
|
| 140 | - true, |
|
| 141 | - $this, |
|
| 142 | - ) |
|
| 143 | - ? array('ATT_lname' => true) |
|
| 144 | - : array('ATT_fname' => true), |
|
| 145 | - 'Event' => array('Event.EVT.Name' => false), |
|
| 146 | - ); |
|
| 147 | - $this->_hidden_columns = array(); |
|
| 148 | - $this->_evt = EEM_Event::instance()->get_one_by_ID($evt_id); |
|
| 149 | - $this->_dtts_for_event = $this->_evt instanceof EE_Event ? $this->_evt->datetimes_ordered() : array(); |
|
| 150 | - } |
|
| 151 | - |
|
| 152 | - |
|
| 153 | - /** |
|
| 154 | - * @param \EE_Registration $item |
|
| 155 | - * @return string |
|
| 156 | - */ |
|
| 157 | - protected function _get_row_class($item) |
|
| 158 | - { |
|
| 159 | - $class = parent::_get_row_class($item); |
|
| 160 | - // add status class |
|
| 161 | - $class .= ' ee-status-strip reg-status-' . $item->status_ID(); |
|
| 162 | - if ($this->_has_checkbox_column) { |
|
| 163 | - $class .= ' has-checkbox-column'; |
|
| 164 | - } |
|
| 165 | - return $class; |
|
| 166 | - } |
|
| 167 | - |
|
| 168 | - |
|
| 169 | - /** |
|
| 170 | - * @return array |
|
| 171 | - * @throws \EE_Error |
|
| 172 | - */ |
|
| 173 | - protected function _get_table_filters() |
|
| 174 | - { |
|
| 175 | - $filters = $where = array(); |
|
| 176 | - $current_EVT_ID = isset($this->_req_data['event_id']) ? (int) $this->_req_data['event_id'] : 0; |
|
| 177 | - if (empty($this->_dtts_for_event) || count($this->_dtts_for_event) === 1) { |
|
| 178 | - // this means we don't have an event so let's setup a filter dropdown for all the events to select |
|
| 179 | - // note possible capability restrictions |
|
| 180 | - if (! EE_Registry::instance()->CAP->current_user_can('ee_read_private_events', 'get_events')) { |
|
| 181 | - $where['status**'] = array('!=', 'private'); |
|
| 182 | - } |
|
| 183 | - if (! EE_Registry::instance()->CAP->current_user_can('ee_read_others_events', 'get_events')) { |
|
| 184 | - $where['EVT_wp_user'] = get_current_user_id(); |
|
| 185 | - } |
|
| 186 | - $events = EEM_Event::instance()->get_all( |
|
| 187 | - array( |
|
| 188 | - $where, |
|
| 189 | - 'order_by' => array('Datetime.DTT_EVT_start' => 'DESC'), |
|
| 190 | - ) |
|
| 191 | - ); |
|
| 192 | - $evts[] = array( |
|
| 193 | - 'id' => 0, |
|
| 194 | - 'text' => __('To toggle Check-in status, select an event', 'event_espresso'), |
|
| 195 | - ); |
|
| 196 | - $checked = 'checked'; |
|
| 197 | - /** @var EE_Event $evt */ |
|
| 198 | - foreach ($events as $evt) { |
|
| 199 | - // any registrations for this event? |
|
| 200 | - if (! $evt->get_count_of_all_registrations()) { |
|
| 201 | - continue; |
|
| 202 | - } |
|
| 203 | - $evts[] = array( |
|
| 204 | - 'id' => $evt->ID(), |
|
| 205 | - 'text' => apply_filters( |
|
| 206 | - 'FHEE__EE_Event_Registrations___get_table_filters__event_name', |
|
| 207 | - $evt->get('EVT_name'), |
|
| 208 | - $evt |
|
| 209 | - ), |
|
| 210 | - 'class' => $evt->is_expired() ? 'ee-expired-event' : '', |
|
| 211 | - ); |
|
| 212 | - if ($evt->ID() === $current_EVT_ID && $evt->is_expired()) { |
|
| 213 | - $checked = ''; |
|
| 214 | - } |
|
| 215 | - } |
|
| 216 | - $event_filter = '<div class="ee-event-filter">'; |
|
| 217 | - $event_filter .= EEH_Form_Fields::select_input('event_id', $evts, $current_EVT_ID); |
|
| 218 | - $event_filter .= '<span class="ee-event-filter-toggle">'; |
|
| 219 | - $event_filter .= '<input type="checkbox" id="js-ee-hide-expired-events" ' . $checked . '> '; |
|
| 220 | - $event_filter .= __('Hide Expired Events', 'event_espresso'); |
|
| 221 | - $event_filter .= '</span>'; |
|
| 222 | - $event_filter .= '</div>'; |
|
| 223 | - $filters[] = $event_filter; |
|
| 224 | - } |
|
| 225 | - if (! empty($this->_dtts_for_event)) { |
|
| 226 | - // DTT datetimes filter |
|
| 227 | - $this->_cur_dtt_id = isset($this->_req_data['DTT_ID']) ? $this->_req_data['DTT_ID'] : 0; |
|
| 228 | - if (count($this->_dtts_for_event) > 1) { |
|
| 229 | - $dtts[0] = __('To toggle check-in status, select a datetime.', 'event_espresso'); |
|
| 230 | - foreach ($this->_dtts_for_event as $dtt) { |
|
| 231 | - $datetime_string = $dtt->name(); |
|
| 232 | - $datetime_string = ! empty($datetime_string) ? ' (' . $datetime_string . ')' : ''; |
|
| 233 | - $datetime_string = $dtt->start_date_and_time() . ' - ' . $dtt->end_date_and_time() . $datetime_string; |
|
| 234 | - $dtts[ $dtt->ID() ] = $datetime_string; |
|
| 235 | - } |
|
| 236 | - $input = new EE_Select_Input( |
|
| 237 | - $dtts, |
|
| 238 | - array( |
|
| 239 | - 'html_name' => 'DTT_ID', |
|
| 240 | - 'html_id' => 'DTT_ID', |
|
| 241 | - 'default' => $this->_cur_dtt_id, |
|
| 242 | - ) |
|
| 243 | - ); |
|
| 244 | - $filters[] = $input->get_html_for_input(); |
|
| 245 | - $filters[] = '<input type="hidden" name="event_id" value="' . $current_EVT_ID . '">'; |
|
| 246 | - } |
|
| 247 | - } |
|
| 248 | - return $filters; |
|
| 249 | - } |
|
| 250 | - |
|
| 251 | - |
|
| 252 | - protected function _add_view_counts() |
|
| 253 | - { |
|
| 254 | - $this->_views['all']['count'] = $this->_get_total_event_attendees(); |
|
| 255 | - } |
|
| 256 | - |
|
| 257 | - |
|
| 258 | - /** |
|
| 259 | - * @return int |
|
| 260 | - * @throws \EE_Error |
|
| 261 | - */ |
|
| 262 | - protected function _get_total_event_attendees() |
|
| 263 | - { |
|
| 264 | - $EVT_ID = isset($this->_req_data['event_id']) ? absint($this->_req_data['event_id']) : false; |
|
| 265 | - $DTT_ID = $this->_cur_dtt_id; |
|
| 266 | - $query_params = array(); |
|
| 267 | - if ($EVT_ID) { |
|
| 268 | - $query_params[0]['EVT_ID'] = $EVT_ID; |
|
| 269 | - } |
|
| 270 | - // if DTT is included we only show for that datetime. Otherwise we're showing for all datetimes (the event). |
|
| 271 | - if ($DTT_ID) { |
|
| 272 | - $query_params[0]['Ticket.Datetime.DTT_ID'] = $DTT_ID; |
|
| 273 | - } |
|
| 274 | - $status_ids_array = apply_filters( |
|
| 275 | - 'FHEE__Extend_Registrations_Admin_Page__get_event_attendees__status_ids_array', |
|
| 276 | - array(EEM_Registration::status_id_pending_payment, EEM_Registration::status_id_approved) |
|
| 277 | - ); |
|
| 278 | - $query_params[0]['STS_ID'] = array('IN', $status_ids_array); |
|
| 279 | - return EEM_Registration::instance()->count($query_params); |
|
| 280 | - } |
|
| 281 | - |
|
| 282 | - |
|
| 283 | - /** |
|
| 284 | - * @param \EE_Registration $item |
|
| 285 | - * @return string |
|
| 286 | - */ |
|
| 287 | - public function column__Reg_Status(EE_Registration $item) |
|
| 288 | - { |
|
| 289 | - return '<span class="ee-status-strip ee-status-strip-td reg-status-' . $item->status_ID() . '"></span>'; |
|
| 290 | - } |
|
| 291 | - |
|
| 292 | - |
|
| 293 | - /** |
|
| 294 | - * @param \EE_Registration $item |
|
| 295 | - * @return string |
|
| 296 | - * @throws \EE_Error |
|
| 297 | - */ |
|
| 298 | - public function column_cb($item) |
|
| 299 | - { |
|
| 300 | - return sprintf('<input type="checkbox" name="checkbox[%1$s]" value="%1$s" />', $item->ID()); |
|
| 301 | - } |
|
| 302 | - |
|
| 303 | - |
|
| 304 | - /** |
|
| 305 | - * column_REG_att_checked_in |
|
| 306 | - * |
|
| 307 | - * @param EE_Registration $item |
|
| 308 | - * @return string |
|
| 309 | - * @throws EE_Error |
|
| 310 | - * @throws InvalidArgumentException |
|
| 311 | - * @throws InvalidDataTypeException |
|
| 312 | - * @throws InvalidInterfaceException |
|
| 313 | - */ |
|
| 314 | - public function column__REG_att_checked_in(EE_Registration $item) |
|
| 315 | - { |
|
| 316 | - $attendee = $item->attendee(); |
|
| 317 | - $attendee_name = $attendee instanceof EE_Attendee ? $attendee->full_name() : ''; |
|
| 318 | - |
|
| 319 | - if ($this->_cur_dtt_id === 0 && count($this->_dtts_for_event) === 1) { |
|
| 320 | - $latest_related_datetime = $item->get_latest_related_datetime(); |
|
| 321 | - if ($latest_related_datetime instanceof EE_Datetime) { |
|
| 322 | - $this->_cur_dtt_id = $latest_related_datetime->ID(); |
|
| 323 | - } |
|
| 324 | - } |
|
| 325 | - $checkin_status_dashicon = CheckinStatusDashicon::fromRegistrationAndDatetimeId( |
|
| 326 | - $item, |
|
| 327 | - $this->_cur_dtt_id |
|
| 328 | - ); |
|
| 329 | - $nonce = wp_create_nonce('checkin_nonce'); |
|
| 330 | - $toggle_active = ! empty($this->_cur_dtt_id) |
|
| 331 | - && EE_Registry::instance()->CAP->current_user_can( |
|
| 332 | - 'ee_edit_checkin', |
|
| 333 | - 'espresso_registrations_toggle_checkin_status', |
|
| 334 | - $item->ID() |
|
| 335 | - ) |
|
| 336 | - ? ' clickable trigger-checkin' |
|
| 337 | - : ''; |
|
| 338 | - $mobile_view_content = ' <span class="show-on-mobile-view-only">' . $attendee_name . '</span>'; |
|
| 339 | - return '<span class="' . $checkin_status_dashicon->cssClasses() . $toggle_active . '"' |
|
| 340 | - . ' data-_regid="' . $item->ID() . '"' |
|
| 341 | - . ' data-dttid="' . $this->_cur_dtt_id . '"' |
|
| 342 | - . ' data-nonce="' . $nonce . '">' |
|
| 343 | - . '</span>' |
|
| 344 | - . $mobile_view_content; |
|
| 345 | - } |
|
| 346 | - |
|
| 347 | - |
|
| 348 | - /** |
|
| 349 | - * @param \EE_Registration $item |
|
| 350 | - * @return mixed|string|void |
|
| 351 | - * @throws \EE_Error |
|
| 352 | - */ |
|
| 353 | - public function column_ATT_name(EE_Registration $item) |
|
| 354 | - { |
|
| 355 | - $attendee = $item->attendee(); |
|
| 356 | - if (! $attendee instanceof EE_Attendee) { |
|
| 357 | - return __('No contact record for this registration.', 'event_espresso'); |
|
| 358 | - } |
|
| 359 | - // edit attendee link |
|
| 360 | - $edit_lnk_url = EE_Admin_Page::add_query_args_and_nonce( |
|
| 361 | - array('action' => 'view_registration', '_REG_ID' => $item->ID()), |
|
| 362 | - REG_ADMIN_URL |
|
| 363 | - ); |
|
| 364 | - $name_link = EE_Registry::instance()->CAP->current_user_can( |
|
| 365 | - 'ee_edit_contacts', |
|
| 366 | - 'espresso_registrations_edit_attendee' |
|
| 367 | - ) |
|
| 368 | - ? '<a href="' . $edit_lnk_url . '" title="' . esc_attr__('View Registration Details', 'event_espresso') . '">' |
|
| 369 | - . $item->attendee()->full_name() |
|
| 370 | - . '</a>' |
|
| 371 | - : $item->attendee()->full_name(); |
|
| 372 | - $name_link .= $item->count() === 1 |
|
| 373 | - ? ' <sup><div class="dashicons dashicons-star-filled lt-blue-icon ee-icon-size-8"></div></sup> ' |
|
| 374 | - : ''; |
|
| 375 | - // add group details |
|
| 376 | - $name_link .= ' ' . sprintf(__('(%s of %s)', 'event_espresso'), $item->count(), $item->group_size()); |
|
| 377 | - // add regcode |
|
| 378 | - $link = EE_Admin_Page::add_query_args_and_nonce( |
|
| 379 | - array('action' => 'view_registration', '_REG_ID' => $item->ID()), |
|
| 380 | - REG_ADMIN_URL |
|
| 381 | - ); |
|
| 382 | - $name_link .= '<br>'; |
|
| 383 | - $name_link .= EE_Registry::instance()->instance()->CAP->current_user_can( |
|
| 384 | - 'ee_read_registration', |
|
| 385 | - 'view_registration', |
|
| 386 | - $item->ID() |
|
| 387 | - ) |
|
| 388 | - ? '<a href="' . $link . '" title="' . esc_attr__('View Registration Details', 'event_espresso') . '">' |
|
| 389 | - . $item->reg_code() |
|
| 390 | - . '</a>' |
|
| 391 | - : $item->reg_code(); |
|
| 392 | - // status |
|
| 393 | - $name_link .= '<br><span class="ee-status-text-small">'; |
|
| 394 | - $name_link .= EEH_Template::pretty_status($item->status_ID(), false, 'sentence'); |
|
| 395 | - $name_link .= '</span>'; |
|
| 396 | - $actions = array(); |
|
| 397 | - $DTT_ID = $this->_cur_dtt_id; |
|
| 398 | - $latest_related_datetime = empty($DTT_ID) && ! empty($this->_req_data['event_id']) && $item instanceof EE_Registration |
|
| 399 | - ? $item->get_latest_related_datetime() |
|
| 400 | - : null; |
|
| 401 | - $DTT_ID = $latest_related_datetime instanceof EE_Datetime |
|
| 402 | - ? $latest_related_datetime->ID() |
|
| 403 | - : $DTT_ID; |
|
| 404 | - if (! empty($DTT_ID) |
|
| 405 | - && EE_Registry::instance()->CAP->current_user_can( |
|
| 406 | - 'ee_read_checkins', |
|
| 407 | - 'espresso_registrations_registration_checkins' |
|
| 408 | - ) |
|
| 409 | - ) { |
|
| 410 | - $checkin_list_url = EE_Admin_Page::add_query_args_and_nonce( |
|
| 411 | - array('action' => 'registration_checkins', '_REG_ID' => $item->ID(), 'DTT_ID' => $DTT_ID), |
|
| 412 | - REG_ADMIN_URL |
|
| 413 | - ); |
|
| 414 | - // get the timestamps for this registration's checkins, related to the selected datetime |
|
| 415 | - $timestamps = $item->get_many_related('Checkin', array(array('DTT_ID' => $DTT_ID))); |
|
| 416 | - if (! empty($timestamps)) { |
|
| 417 | - // get the last timestamp |
|
| 418 | - $last_timestamp = end($timestamps); |
|
| 419 | - // checked in or checked out? |
|
| 420 | - $checkin_status = $last_timestamp->get('CHK_in') |
|
| 421 | - ? esc_html__('Checked In', 'event_espresso') |
|
| 422 | - : esc_html__('Checked Out', 'event_espresso'); |
|
| 423 | - // get timestamp string |
|
| 424 | - $timestamp_string = $last_timestamp->get_datetime('CHK_timestamp'); |
|
| 425 | - $actions['checkin'] = '<a href="' . $checkin_list_url . '" title="' |
|
| 426 | - . esc_attr__( |
|
| 427 | - 'View this registrant\'s check-ins/checkouts for the datetime', |
|
| 428 | - 'event_espresso' |
|
| 429 | - ) . '">' . $checkin_status . ': ' . $timestamp_string . '</a>'; |
|
| 430 | - } |
|
| 431 | - } |
|
| 432 | - return (! empty($DTT_ID) && ! empty($timestamps)) |
|
| 433 | - ? sprintf('%1$s %2$s', $name_link, $this->row_actions($actions, true)) |
|
| 434 | - : $name_link; |
|
| 435 | - } |
|
| 436 | - |
|
| 437 | - |
|
| 438 | - /** |
|
| 439 | - * @param \EE_Registration $item |
|
| 440 | - * @return string |
|
| 441 | - */ |
|
| 442 | - public function column_ATT_email(EE_Registration $item) |
|
| 443 | - { |
|
| 444 | - $attendee = $item->attendee(); |
|
| 445 | - return $attendee instanceof EE_Attendee ? $attendee->email() : ''; |
|
| 446 | - } |
|
| 447 | - |
|
| 448 | - |
|
| 449 | - /** |
|
| 450 | - * @param \EE_Registration $item |
|
| 451 | - * @return bool|string |
|
| 452 | - * @throws \EE_Error |
|
| 453 | - */ |
|
| 454 | - public function column_Event(EE_Registration $item) |
|
| 455 | - { |
|
| 456 | - try { |
|
| 457 | - $event = $this->_evt instanceof EE_Event ? $this->_evt : $item->event(); |
|
| 458 | - $chkin_lnk_url = EE_Admin_Page::add_query_args_and_nonce( |
|
| 459 | - array('action' => 'event_registrations', 'event_id' => $event->ID()), |
|
| 460 | - REG_ADMIN_URL |
|
| 461 | - ); |
|
| 462 | - $event_label = EE_Registry::instance()->CAP->current_user_can( |
|
| 463 | - 'ee_read_checkins', |
|
| 464 | - 'espresso_registrations_registration_checkins' |
|
| 465 | - ) ? '<a href="' . $chkin_lnk_url . '" title="' |
|
| 466 | - . esc_attr__( |
|
| 467 | - 'View Checkins for this Event', |
|
| 468 | - 'event_espresso' |
|
| 469 | - ) . '">' . $event->name() . '</a>' : $event->name(); |
|
| 470 | - } catch (\EventEspresso\core\exceptions\EntityNotFoundException $e) { |
|
| 471 | - $event_label = esc_html__('Unknown', 'event_espresso'); |
|
| 472 | - } |
|
| 473 | - return $event_label; |
|
| 474 | - } |
|
| 475 | - |
|
| 476 | - |
|
| 477 | - /** |
|
| 478 | - * @param \EE_Registration $item |
|
| 479 | - * @return mixed|string|void |
|
| 480 | - */ |
|
| 481 | - public function column_PRC_name(EE_Registration $item) |
|
| 482 | - { |
|
| 483 | - return $item->ticket() instanceof EE_Ticket ? $item->ticket()->name() : __("Unknown", "event_espresso"); |
|
| 484 | - } |
|
| 485 | - |
|
| 486 | - |
|
| 487 | - /** |
|
| 488 | - * column_REG_final_price |
|
| 489 | - * |
|
| 490 | - * @param \EE_Registration $item |
|
| 491 | - * @return string |
|
| 492 | - */ |
|
| 493 | - public function column__REG_final_price(EE_Registration $item) |
|
| 494 | - { |
|
| 495 | - return '<span class="reg-pad-rght">' . ' ' . $item->pretty_final_price() . '</span>'; |
|
| 496 | - } |
|
| 497 | - |
|
| 498 | - |
|
| 499 | - /** |
|
| 500 | - * column_TXN_paid |
|
| 501 | - * |
|
| 502 | - * @param \EE_Registration $item |
|
| 503 | - * @return string |
|
| 504 | - * @throws \EE_Error |
|
| 505 | - */ |
|
| 506 | - public function column_TXN_paid(EE_Registration $item) |
|
| 507 | - { |
|
| 508 | - if ($item->count() === 1) { |
|
| 509 | - if ($item->transaction()->paid() >= $item->transaction()->total()) { |
|
| 510 | - return '<span class="reg-pad-rght"><div class="dashicons dashicons-yes green-icon"></div></span>'; |
|
| 511 | - } else { |
|
| 512 | - $view_txn_lnk_url = EE_Admin_Page::add_query_args_and_nonce( |
|
| 513 | - array('action' => 'view_transaction', 'TXN_ID' => $item->transaction_ID()), |
|
| 514 | - TXN_ADMIN_URL |
|
| 515 | - ); |
|
| 516 | - return EE_Registry::instance()->CAP->current_user_can( |
|
| 517 | - 'ee_read_transaction', |
|
| 518 | - 'espresso_transactions_view_transaction' |
|
| 519 | - ) ? ' |
|
| 15 | + /** |
|
| 16 | + * This property will hold the related Datetimes on an event IF the event id is included in the request. |
|
| 17 | + * |
|
| 18 | + * @var EE_Datetime[] |
|
| 19 | + */ |
|
| 20 | + protected $_dtts_for_event = array(); |
|
| 21 | + |
|
| 22 | + |
|
| 23 | + /** |
|
| 24 | + * The event if one is specified in the request |
|
| 25 | + * |
|
| 26 | + * @var EE_Event |
|
| 27 | + */ |
|
| 28 | + protected $_evt = null; |
|
| 29 | + |
|
| 30 | + |
|
| 31 | + /** |
|
| 32 | + * The DTT_ID if the current view has a specified datetime. |
|
| 33 | + * |
|
| 34 | + * @var int $_cur_dtt_id |
|
| 35 | + */ |
|
| 36 | + protected $_cur_dtt_id = 0; |
|
| 37 | + |
|
| 38 | + |
|
| 39 | + /** |
|
| 40 | + * EE_Event_Registrations_List_Table constructor. |
|
| 41 | + * |
|
| 42 | + * @param \Registrations_Admin_Page $admin_page |
|
| 43 | + */ |
|
| 44 | + public function __construct($admin_page) |
|
| 45 | + { |
|
| 46 | + parent::__construct($admin_page); |
|
| 47 | + $this->_status = $this->_admin_page->get_registration_status_array(); |
|
| 48 | + } |
|
| 49 | + |
|
| 50 | + |
|
| 51 | + protected function _setup_data() |
|
| 52 | + { |
|
| 53 | + $this->_data = $this->_view !== 'trash' ? $this->_admin_page->get_event_attendees($this->_per_page) |
|
| 54 | + : $this->_admin_page->get_event_attendees($this->_per_page, false, true); |
|
| 55 | + $this->_all_data_count = $this->_view !== 'trash' ? $this->_admin_page->get_event_attendees( |
|
| 56 | + $this->_per_page, |
|
| 57 | + true |
|
| 58 | + ) : $this->_admin_page->get_event_attendees($this->_per_page, true, true); |
|
| 59 | + } |
|
| 60 | + |
|
| 61 | + |
|
| 62 | + protected function _set_properties() |
|
| 63 | + { |
|
| 64 | + $evt_id = isset($this->_req_data['event_id']) ? $this->_req_data['event_id'] : null; |
|
| 65 | + $this->_wp_list_args = array( |
|
| 66 | + 'singular' => __('registrant', 'event_espresso'), |
|
| 67 | + 'plural' => __('registrants', 'event_espresso'), |
|
| 68 | + 'ajax' => true, |
|
| 69 | + 'screen' => $this->_admin_page->get_current_screen()->id, |
|
| 70 | + ); |
|
| 71 | + $columns = array(); |
|
| 72 | + // $columns['_Reg_Status'] = ''; |
|
| 73 | + if (! empty($evt_id)) { |
|
| 74 | + $columns['cb'] = '<input type="checkbox" />'; // Render a checkbox instead of text |
|
| 75 | + $this->_has_checkbox_column = true; |
|
| 76 | + } |
|
| 77 | + $this->_columns = array( |
|
| 78 | + '_REG_att_checked_in' => '<span class="dashicons dashicons-yes ee-icon-size-18"></span>', |
|
| 79 | + 'ATT_name' => __('Registrant', 'event_espresso'), |
|
| 80 | + 'ATT_email' => __('Email Address', 'event_espresso'), |
|
| 81 | + 'Event' => __('Event', 'event_espresso'), |
|
| 82 | + 'PRC_name' => __('TKT Option', 'event_espresso'), |
|
| 83 | + '_REG_final_price' => __('Price', 'event_espresso'), |
|
| 84 | + 'TXN_paid' => __('Paid', 'event_espresso'), |
|
| 85 | + 'TXN_total' => __('Total', 'event_espresso'), |
|
| 86 | + ); |
|
| 87 | + $this->_columns = array_merge($columns, $this->_columns); |
|
| 88 | + $this->_primary_column = '_REG_att_checked_in'; |
|
| 89 | + if (! empty($evt_id) |
|
| 90 | + && EE_Registry::instance()->CAP->current_user_can( |
|
| 91 | + 'ee_read_registrations', |
|
| 92 | + 'espresso_registrations_registrations_reports', |
|
| 93 | + $evt_id |
|
| 94 | + ) |
|
| 95 | + ) { |
|
| 96 | + $this->_bottom_buttons = array( |
|
| 97 | + 'report' => array( |
|
| 98 | + 'route' => 'registrations_report', |
|
| 99 | + 'extra_request' => |
|
| 100 | + array( |
|
| 101 | + 'EVT_ID' => $evt_id, |
|
| 102 | + 'return_url' => urlencode("//{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}"), |
|
| 103 | + ), |
|
| 104 | + ), |
|
| 105 | + ); |
|
| 106 | + } |
|
| 107 | + $this->_bottom_buttons['report_filtered'] = array( |
|
| 108 | + 'route' => 'registrations_checkin_report', |
|
| 109 | + 'extra_request' => array( |
|
| 110 | + 'use_filters' => true, |
|
| 111 | + 'filters' => array_merge( |
|
| 112 | + array( |
|
| 113 | + 'EVT_ID' => $evt_id, |
|
| 114 | + ), |
|
| 115 | + array_diff_key( |
|
| 116 | + $this->_req_data, |
|
| 117 | + array_flip( |
|
| 118 | + array( |
|
| 119 | + 'page', |
|
| 120 | + 'action', |
|
| 121 | + 'default_nonce', |
|
| 122 | + ) |
|
| 123 | + ) |
|
| 124 | + ) |
|
| 125 | + ), |
|
| 126 | + 'return_url' => urlencode("//{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}"), |
|
| 127 | + ), |
|
| 128 | + ); |
|
| 129 | + $this->_sortable_columns = array( |
|
| 130 | + /** |
|
| 131 | + * Allows users to change the default sort if they wish. |
|
| 132 | + * Returning a falsey on this filter will result in the default sort to be by firstname rather than last name. |
|
| 133 | + * |
|
| 134 | + * Note: usual naming conventions for filters aren't followed here so that just one filter can be used to |
|
| 135 | + * change the sorts on any list table involving registration contacts. If you want to only change the filter |
|
| 136 | + * for a specific list table you can use the provided reference to this object instance. |
|
| 137 | + */ |
|
| 138 | + 'ATT_name' => array( |
|
| 139 | + 'FHEE__EE_Registrations_List_Table___set_properties__default_sort_by_registration_last_name', |
|
| 140 | + true, |
|
| 141 | + $this, |
|
| 142 | + ) |
|
| 143 | + ? array('ATT_lname' => true) |
|
| 144 | + : array('ATT_fname' => true), |
|
| 145 | + 'Event' => array('Event.EVT.Name' => false), |
|
| 146 | + ); |
|
| 147 | + $this->_hidden_columns = array(); |
|
| 148 | + $this->_evt = EEM_Event::instance()->get_one_by_ID($evt_id); |
|
| 149 | + $this->_dtts_for_event = $this->_evt instanceof EE_Event ? $this->_evt->datetimes_ordered() : array(); |
|
| 150 | + } |
|
| 151 | + |
|
| 152 | + |
|
| 153 | + /** |
|
| 154 | + * @param \EE_Registration $item |
|
| 155 | + * @return string |
|
| 156 | + */ |
|
| 157 | + protected function _get_row_class($item) |
|
| 158 | + { |
|
| 159 | + $class = parent::_get_row_class($item); |
|
| 160 | + // add status class |
|
| 161 | + $class .= ' ee-status-strip reg-status-' . $item->status_ID(); |
|
| 162 | + if ($this->_has_checkbox_column) { |
|
| 163 | + $class .= ' has-checkbox-column'; |
|
| 164 | + } |
|
| 165 | + return $class; |
|
| 166 | + } |
|
| 167 | + |
|
| 168 | + |
|
| 169 | + /** |
|
| 170 | + * @return array |
|
| 171 | + * @throws \EE_Error |
|
| 172 | + */ |
|
| 173 | + protected function _get_table_filters() |
|
| 174 | + { |
|
| 175 | + $filters = $where = array(); |
|
| 176 | + $current_EVT_ID = isset($this->_req_data['event_id']) ? (int) $this->_req_data['event_id'] : 0; |
|
| 177 | + if (empty($this->_dtts_for_event) || count($this->_dtts_for_event) === 1) { |
|
| 178 | + // this means we don't have an event so let's setup a filter dropdown for all the events to select |
|
| 179 | + // note possible capability restrictions |
|
| 180 | + if (! EE_Registry::instance()->CAP->current_user_can('ee_read_private_events', 'get_events')) { |
|
| 181 | + $where['status**'] = array('!=', 'private'); |
|
| 182 | + } |
|
| 183 | + if (! EE_Registry::instance()->CAP->current_user_can('ee_read_others_events', 'get_events')) { |
|
| 184 | + $where['EVT_wp_user'] = get_current_user_id(); |
|
| 185 | + } |
|
| 186 | + $events = EEM_Event::instance()->get_all( |
|
| 187 | + array( |
|
| 188 | + $where, |
|
| 189 | + 'order_by' => array('Datetime.DTT_EVT_start' => 'DESC'), |
|
| 190 | + ) |
|
| 191 | + ); |
|
| 192 | + $evts[] = array( |
|
| 193 | + 'id' => 0, |
|
| 194 | + 'text' => __('To toggle Check-in status, select an event', 'event_espresso'), |
|
| 195 | + ); |
|
| 196 | + $checked = 'checked'; |
|
| 197 | + /** @var EE_Event $evt */ |
|
| 198 | + foreach ($events as $evt) { |
|
| 199 | + // any registrations for this event? |
|
| 200 | + if (! $evt->get_count_of_all_registrations()) { |
|
| 201 | + continue; |
|
| 202 | + } |
|
| 203 | + $evts[] = array( |
|
| 204 | + 'id' => $evt->ID(), |
|
| 205 | + 'text' => apply_filters( |
|
| 206 | + 'FHEE__EE_Event_Registrations___get_table_filters__event_name', |
|
| 207 | + $evt->get('EVT_name'), |
|
| 208 | + $evt |
|
| 209 | + ), |
|
| 210 | + 'class' => $evt->is_expired() ? 'ee-expired-event' : '', |
|
| 211 | + ); |
|
| 212 | + if ($evt->ID() === $current_EVT_ID && $evt->is_expired()) { |
|
| 213 | + $checked = ''; |
|
| 214 | + } |
|
| 215 | + } |
|
| 216 | + $event_filter = '<div class="ee-event-filter">'; |
|
| 217 | + $event_filter .= EEH_Form_Fields::select_input('event_id', $evts, $current_EVT_ID); |
|
| 218 | + $event_filter .= '<span class="ee-event-filter-toggle">'; |
|
| 219 | + $event_filter .= '<input type="checkbox" id="js-ee-hide-expired-events" ' . $checked . '> '; |
|
| 220 | + $event_filter .= __('Hide Expired Events', 'event_espresso'); |
|
| 221 | + $event_filter .= '</span>'; |
|
| 222 | + $event_filter .= '</div>'; |
|
| 223 | + $filters[] = $event_filter; |
|
| 224 | + } |
|
| 225 | + if (! empty($this->_dtts_for_event)) { |
|
| 226 | + // DTT datetimes filter |
|
| 227 | + $this->_cur_dtt_id = isset($this->_req_data['DTT_ID']) ? $this->_req_data['DTT_ID'] : 0; |
|
| 228 | + if (count($this->_dtts_for_event) > 1) { |
|
| 229 | + $dtts[0] = __('To toggle check-in status, select a datetime.', 'event_espresso'); |
|
| 230 | + foreach ($this->_dtts_for_event as $dtt) { |
|
| 231 | + $datetime_string = $dtt->name(); |
|
| 232 | + $datetime_string = ! empty($datetime_string) ? ' (' . $datetime_string . ')' : ''; |
|
| 233 | + $datetime_string = $dtt->start_date_and_time() . ' - ' . $dtt->end_date_and_time() . $datetime_string; |
|
| 234 | + $dtts[ $dtt->ID() ] = $datetime_string; |
|
| 235 | + } |
|
| 236 | + $input = new EE_Select_Input( |
|
| 237 | + $dtts, |
|
| 238 | + array( |
|
| 239 | + 'html_name' => 'DTT_ID', |
|
| 240 | + 'html_id' => 'DTT_ID', |
|
| 241 | + 'default' => $this->_cur_dtt_id, |
|
| 242 | + ) |
|
| 243 | + ); |
|
| 244 | + $filters[] = $input->get_html_for_input(); |
|
| 245 | + $filters[] = '<input type="hidden" name="event_id" value="' . $current_EVT_ID . '">'; |
|
| 246 | + } |
|
| 247 | + } |
|
| 248 | + return $filters; |
|
| 249 | + } |
|
| 250 | + |
|
| 251 | + |
|
| 252 | + protected function _add_view_counts() |
|
| 253 | + { |
|
| 254 | + $this->_views['all']['count'] = $this->_get_total_event_attendees(); |
|
| 255 | + } |
|
| 256 | + |
|
| 257 | + |
|
| 258 | + /** |
|
| 259 | + * @return int |
|
| 260 | + * @throws \EE_Error |
|
| 261 | + */ |
|
| 262 | + protected function _get_total_event_attendees() |
|
| 263 | + { |
|
| 264 | + $EVT_ID = isset($this->_req_data['event_id']) ? absint($this->_req_data['event_id']) : false; |
|
| 265 | + $DTT_ID = $this->_cur_dtt_id; |
|
| 266 | + $query_params = array(); |
|
| 267 | + if ($EVT_ID) { |
|
| 268 | + $query_params[0]['EVT_ID'] = $EVT_ID; |
|
| 269 | + } |
|
| 270 | + // if DTT is included we only show for that datetime. Otherwise we're showing for all datetimes (the event). |
|
| 271 | + if ($DTT_ID) { |
|
| 272 | + $query_params[0]['Ticket.Datetime.DTT_ID'] = $DTT_ID; |
|
| 273 | + } |
|
| 274 | + $status_ids_array = apply_filters( |
|
| 275 | + 'FHEE__Extend_Registrations_Admin_Page__get_event_attendees__status_ids_array', |
|
| 276 | + array(EEM_Registration::status_id_pending_payment, EEM_Registration::status_id_approved) |
|
| 277 | + ); |
|
| 278 | + $query_params[0]['STS_ID'] = array('IN', $status_ids_array); |
|
| 279 | + return EEM_Registration::instance()->count($query_params); |
|
| 280 | + } |
|
| 281 | + |
|
| 282 | + |
|
| 283 | + /** |
|
| 284 | + * @param \EE_Registration $item |
|
| 285 | + * @return string |
|
| 286 | + */ |
|
| 287 | + public function column__Reg_Status(EE_Registration $item) |
|
| 288 | + { |
|
| 289 | + return '<span class="ee-status-strip ee-status-strip-td reg-status-' . $item->status_ID() . '"></span>'; |
|
| 290 | + } |
|
| 291 | + |
|
| 292 | + |
|
| 293 | + /** |
|
| 294 | + * @param \EE_Registration $item |
|
| 295 | + * @return string |
|
| 296 | + * @throws \EE_Error |
|
| 297 | + */ |
|
| 298 | + public function column_cb($item) |
|
| 299 | + { |
|
| 300 | + return sprintf('<input type="checkbox" name="checkbox[%1$s]" value="%1$s" />', $item->ID()); |
|
| 301 | + } |
|
| 302 | + |
|
| 303 | + |
|
| 304 | + /** |
|
| 305 | + * column_REG_att_checked_in |
|
| 306 | + * |
|
| 307 | + * @param EE_Registration $item |
|
| 308 | + * @return string |
|
| 309 | + * @throws EE_Error |
|
| 310 | + * @throws InvalidArgumentException |
|
| 311 | + * @throws InvalidDataTypeException |
|
| 312 | + * @throws InvalidInterfaceException |
|
| 313 | + */ |
|
| 314 | + public function column__REG_att_checked_in(EE_Registration $item) |
|
| 315 | + { |
|
| 316 | + $attendee = $item->attendee(); |
|
| 317 | + $attendee_name = $attendee instanceof EE_Attendee ? $attendee->full_name() : ''; |
|
| 318 | + |
|
| 319 | + if ($this->_cur_dtt_id === 0 && count($this->_dtts_for_event) === 1) { |
|
| 320 | + $latest_related_datetime = $item->get_latest_related_datetime(); |
|
| 321 | + if ($latest_related_datetime instanceof EE_Datetime) { |
|
| 322 | + $this->_cur_dtt_id = $latest_related_datetime->ID(); |
|
| 323 | + } |
|
| 324 | + } |
|
| 325 | + $checkin_status_dashicon = CheckinStatusDashicon::fromRegistrationAndDatetimeId( |
|
| 326 | + $item, |
|
| 327 | + $this->_cur_dtt_id |
|
| 328 | + ); |
|
| 329 | + $nonce = wp_create_nonce('checkin_nonce'); |
|
| 330 | + $toggle_active = ! empty($this->_cur_dtt_id) |
|
| 331 | + && EE_Registry::instance()->CAP->current_user_can( |
|
| 332 | + 'ee_edit_checkin', |
|
| 333 | + 'espresso_registrations_toggle_checkin_status', |
|
| 334 | + $item->ID() |
|
| 335 | + ) |
|
| 336 | + ? ' clickable trigger-checkin' |
|
| 337 | + : ''; |
|
| 338 | + $mobile_view_content = ' <span class="show-on-mobile-view-only">' . $attendee_name . '</span>'; |
|
| 339 | + return '<span class="' . $checkin_status_dashicon->cssClasses() . $toggle_active . '"' |
|
| 340 | + . ' data-_regid="' . $item->ID() . '"' |
|
| 341 | + . ' data-dttid="' . $this->_cur_dtt_id . '"' |
|
| 342 | + . ' data-nonce="' . $nonce . '">' |
|
| 343 | + . '</span>' |
|
| 344 | + . $mobile_view_content; |
|
| 345 | + } |
|
| 346 | + |
|
| 347 | + |
|
| 348 | + /** |
|
| 349 | + * @param \EE_Registration $item |
|
| 350 | + * @return mixed|string|void |
|
| 351 | + * @throws \EE_Error |
|
| 352 | + */ |
|
| 353 | + public function column_ATT_name(EE_Registration $item) |
|
| 354 | + { |
|
| 355 | + $attendee = $item->attendee(); |
|
| 356 | + if (! $attendee instanceof EE_Attendee) { |
|
| 357 | + return __('No contact record for this registration.', 'event_espresso'); |
|
| 358 | + } |
|
| 359 | + // edit attendee link |
|
| 360 | + $edit_lnk_url = EE_Admin_Page::add_query_args_and_nonce( |
|
| 361 | + array('action' => 'view_registration', '_REG_ID' => $item->ID()), |
|
| 362 | + REG_ADMIN_URL |
|
| 363 | + ); |
|
| 364 | + $name_link = EE_Registry::instance()->CAP->current_user_can( |
|
| 365 | + 'ee_edit_contacts', |
|
| 366 | + 'espresso_registrations_edit_attendee' |
|
| 367 | + ) |
|
| 368 | + ? '<a href="' . $edit_lnk_url . '" title="' . esc_attr__('View Registration Details', 'event_espresso') . '">' |
|
| 369 | + . $item->attendee()->full_name() |
|
| 370 | + . '</a>' |
|
| 371 | + : $item->attendee()->full_name(); |
|
| 372 | + $name_link .= $item->count() === 1 |
|
| 373 | + ? ' <sup><div class="dashicons dashicons-star-filled lt-blue-icon ee-icon-size-8"></div></sup> ' |
|
| 374 | + : ''; |
|
| 375 | + // add group details |
|
| 376 | + $name_link .= ' ' . sprintf(__('(%s of %s)', 'event_espresso'), $item->count(), $item->group_size()); |
|
| 377 | + // add regcode |
|
| 378 | + $link = EE_Admin_Page::add_query_args_and_nonce( |
|
| 379 | + array('action' => 'view_registration', '_REG_ID' => $item->ID()), |
|
| 380 | + REG_ADMIN_URL |
|
| 381 | + ); |
|
| 382 | + $name_link .= '<br>'; |
|
| 383 | + $name_link .= EE_Registry::instance()->instance()->CAP->current_user_can( |
|
| 384 | + 'ee_read_registration', |
|
| 385 | + 'view_registration', |
|
| 386 | + $item->ID() |
|
| 387 | + ) |
|
| 388 | + ? '<a href="' . $link . '" title="' . esc_attr__('View Registration Details', 'event_espresso') . '">' |
|
| 389 | + . $item->reg_code() |
|
| 390 | + . '</a>' |
|
| 391 | + : $item->reg_code(); |
|
| 392 | + // status |
|
| 393 | + $name_link .= '<br><span class="ee-status-text-small">'; |
|
| 394 | + $name_link .= EEH_Template::pretty_status($item->status_ID(), false, 'sentence'); |
|
| 395 | + $name_link .= '</span>'; |
|
| 396 | + $actions = array(); |
|
| 397 | + $DTT_ID = $this->_cur_dtt_id; |
|
| 398 | + $latest_related_datetime = empty($DTT_ID) && ! empty($this->_req_data['event_id']) && $item instanceof EE_Registration |
|
| 399 | + ? $item->get_latest_related_datetime() |
|
| 400 | + : null; |
|
| 401 | + $DTT_ID = $latest_related_datetime instanceof EE_Datetime |
|
| 402 | + ? $latest_related_datetime->ID() |
|
| 403 | + : $DTT_ID; |
|
| 404 | + if (! empty($DTT_ID) |
|
| 405 | + && EE_Registry::instance()->CAP->current_user_can( |
|
| 406 | + 'ee_read_checkins', |
|
| 407 | + 'espresso_registrations_registration_checkins' |
|
| 408 | + ) |
|
| 409 | + ) { |
|
| 410 | + $checkin_list_url = EE_Admin_Page::add_query_args_and_nonce( |
|
| 411 | + array('action' => 'registration_checkins', '_REG_ID' => $item->ID(), 'DTT_ID' => $DTT_ID), |
|
| 412 | + REG_ADMIN_URL |
|
| 413 | + ); |
|
| 414 | + // get the timestamps for this registration's checkins, related to the selected datetime |
|
| 415 | + $timestamps = $item->get_many_related('Checkin', array(array('DTT_ID' => $DTT_ID))); |
|
| 416 | + if (! empty($timestamps)) { |
|
| 417 | + // get the last timestamp |
|
| 418 | + $last_timestamp = end($timestamps); |
|
| 419 | + // checked in or checked out? |
|
| 420 | + $checkin_status = $last_timestamp->get('CHK_in') |
|
| 421 | + ? esc_html__('Checked In', 'event_espresso') |
|
| 422 | + : esc_html__('Checked Out', 'event_espresso'); |
|
| 423 | + // get timestamp string |
|
| 424 | + $timestamp_string = $last_timestamp->get_datetime('CHK_timestamp'); |
|
| 425 | + $actions['checkin'] = '<a href="' . $checkin_list_url . '" title="' |
|
| 426 | + . esc_attr__( |
|
| 427 | + 'View this registrant\'s check-ins/checkouts for the datetime', |
|
| 428 | + 'event_espresso' |
|
| 429 | + ) . '">' . $checkin_status . ': ' . $timestamp_string . '</a>'; |
|
| 430 | + } |
|
| 431 | + } |
|
| 432 | + return (! empty($DTT_ID) && ! empty($timestamps)) |
|
| 433 | + ? sprintf('%1$s %2$s', $name_link, $this->row_actions($actions, true)) |
|
| 434 | + : $name_link; |
|
| 435 | + } |
|
| 436 | + |
|
| 437 | + |
|
| 438 | + /** |
|
| 439 | + * @param \EE_Registration $item |
|
| 440 | + * @return string |
|
| 441 | + */ |
|
| 442 | + public function column_ATT_email(EE_Registration $item) |
|
| 443 | + { |
|
| 444 | + $attendee = $item->attendee(); |
|
| 445 | + return $attendee instanceof EE_Attendee ? $attendee->email() : ''; |
|
| 446 | + } |
|
| 447 | + |
|
| 448 | + |
|
| 449 | + /** |
|
| 450 | + * @param \EE_Registration $item |
|
| 451 | + * @return bool|string |
|
| 452 | + * @throws \EE_Error |
|
| 453 | + */ |
|
| 454 | + public function column_Event(EE_Registration $item) |
|
| 455 | + { |
|
| 456 | + try { |
|
| 457 | + $event = $this->_evt instanceof EE_Event ? $this->_evt : $item->event(); |
|
| 458 | + $chkin_lnk_url = EE_Admin_Page::add_query_args_and_nonce( |
|
| 459 | + array('action' => 'event_registrations', 'event_id' => $event->ID()), |
|
| 460 | + REG_ADMIN_URL |
|
| 461 | + ); |
|
| 462 | + $event_label = EE_Registry::instance()->CAP->current_user_can( |
|
| 463 | + 'ee_read_checkins', |
|
| 464 | + 'espresso_registrations_registration_checkins' |
|
| 465 | + ) ? '<a href="' . $chkin_lnk_url . '" title="' |
|
| 466 | + . esc_attr__( |
|
| 467 | + 'View Checkins for this Event', |
|
| 468 | + 'event_espresso' |
|
| 469 | + ) . '">' . $event->name() . '</a>' : $event->name(); |
|
| 470 | + } catch (\EventEspresso\core\exceptions\EntityNotFoundException $e) { |
|
| 471 | + $event_label = esc_html__('Unknown', 'event_espresso'); |
|
| 472 | + } |
|
| 473 | + return $event_label; |
|
| 474 | + } |
|
| 475 | + |
|
| 476 | + |
|
| 477 | + /** |
|
| 478 | + * @param \EE_Registration $item |
|
| 479 | + * @return mixed|string|void |
|
| 480 | + */ |
|
| 481 | + public function column_PRC_name(EE_Registration $item) |
|
| 482 | + { |
|
| 483 | + return $item->ticket() instanceof EE_Ticket ? $item->ticket()->name() : __("Unknown", "event_espresso"); |
|
| 484 | + } |
|
| 485 | + |
|
| 486 | + |
|
| 487 | + /** |
|
| 488 | + * column_REG_final_price |
|
| 489 | + * |
|
| 490 | + * @param \EE_Registration $item |
|
| 491 | + * @return string |
|
| 492 | + */ |
|
| 493 | + public function column__REG_final_price(EE_Registration $item) |
|
| 494 | + { |
|
| 495 | + return '<span class="reg-pad-rght">' . ' ' . $item->pretty_final_price() . '</span>'; |
|
| 496 | + } |
|
| 497 | + |
|
| 498 | + |
|
| 499 | + /** |
|
| 500 | + * column_TXN_paid |
|
| 501 | + * |
|
| 502 | + * @param \EE_Registration $item |
|
| 503 | + * @return string |
|
| 504 | + * @throws \EE_Error |
|
| 505 | + */ |
|
| 506 | + public function column_TXN_paid(EE_Registration $item) |
|
| 507 | + { |
|
| 508 | + if ($item->count() === 1) { |
|
| 509 | + if ($item->transaction()->paid() >= $item->transaction()->total()) { |
|
| 510 | + return '<span class="reg-pad-rght"><div class="dashicons dashicons-yes green-icon"></div></span>'; |
|
| 511 | + } else { |
|
| 512 | + $view_txn_lnk_url = EE_Admin_Page::add_query_args_and_nonce( |
|
| 513 | + array('action' => 'view_transaction', 'TXN_ID' => $item->transaction_ID()), |
|
| 514 | + TXN_ADMIN_URL |
|
| 515 | + ); |
|
| 516 | + return EE_Registry::instance()->CAP->current_user_can( |
|
| 517 | + 'ee_read_transaction', |
|
| 518 | + 'espresso_transactions_view_transaction' |
|
| 519 | + ) ? ' |
|
| 520 | 520 | <span class="reg-pad-rght"> |
| 521 | 521 | <a class="status-' |
| 522 | - . $item->transaction()->status_ID() |
|
| 523 | - . '" href="' |
|
| 524 | - . $view_txn_lnk_url |
|
| 525 | - . '" title="' |
|
| 526 | - . esc_attr__('View Transaction', 'event_espresso') |
|
| 527 | - . '"> |
|
| 522 | + . $item->transaction()->status_ID() |
|
| 523 | + . '" href="' |
|
| 524 | + . $view_txn_lnk_url |
|
| 525 | + . '" title="' |
|
| 526 | + . esc_attr__('View Transaction', 'event_espresso') |
|
| 527 | + . '"> |
|
| 528 | 528 | ' |
| 529 | - . $item->transaction()->pretty_paid() |
|
| 530 | - . ' |
|
| 529 | + . $item->transaction()->pretty_paid() |
|
| 530 | + . ' |
|
| 531 | 531 | </a> |
| 532 | 532 | <span>' : '<span class="reg-pad-rght">' . $item->transaction()->pretty_paid() . '</span>'; |
| 533 | - } |
|
| 534 | - } else { |
|
| 535 | - return '<span class="reg-pad-rght"></span>'; |
|
| 536 | - } |
|
| 537 | - } |
|
| 538 | - |
|
| 539 | - |
|
| 540 | - /** |
|
| 541 | - * column_TXN_total |
|
| 542 | - * |
|
| 543 | - * @param \EE_Registration $item |
|
| 544 | - * @return string |
|
| 545 | - * @throws \EE_Error |
|
| 546 | - */ |
|
| 547 | - public function column_TXN_total(EE_Registration $item) |
|
| 548 | - { |
|
| 549 | - $txn = $item->transaction(); |
|
| 550 | - $view_txn_url = add_query_arg(array('action' => 'view_transaction', 'TXN_ID' => $txn->ID()), TXN_ADMIN_URL); |
|
| 551 | - if ($item->get('REG_count') === 1) { |
|
| 552 | - $line_total_obj = $txn->total_line_item(); |
|
| 553 | - $txn_total = $line_total_obj instanceof EE_Line_Item |
|
| 554 | - ? $line_total_obj->get_pretty('LIN_total') |
|
| 555 | - : __( |
|
| 556 | - 'View Transaction', |
|
| 557 | - 'event_espresso' |
|
| 558 | - ); |
|
| 559 | - return EE_Registry::instance()->CAP->current_user_can( |
|
| 560 | - 'ee_read_transaction', |
|
| 561 | - 'espresso_transactions_view_transaction' |
|
| 562 | - ) ? '<a href="' |
|
| 563 | - . $view_txn_url |
|
| 564 | - . '" title="' |
|
| 565 | - . esc_attr__('View Transaction', 'event_espresso') |
|
| 566 | - . '"><span class="reg-pad-rght">' |
|
| 567 | - . $txn_total |
|
| 568 | - . '</span></a>' : '<span class="reg-pad-rght">' . $txn_total . '</span>'; |
|
| 569 | - } else { |
|
| 570 | - return '<span class="reg-pad-rght"></span>'; |
|
| 571 | - } |
|
| 572 | - } |
|
| 533 | + } |
|
| 534 | + } else { |
|
| 535 | + return '<span class="reg-pad-rght"></span>'; |
|
| 536 | + } |
|
| 537 | + } |
|
| 538 | + |
|
| 539 | + |
|
| 540 | + /** |
|
| 541 | + * column_TXN_total |
|
| 542 | + * |
|
| 543 | + * @param \EE_Registration $item |
|
| 544 | + * @return string |
|
| 545 | + * @throws \EE_Error |
|
| 546 | + */ |
|
| 547 | + public function column_TXN_total(EE_Registration $item) |
|
| 548 | + { |
|
| 549 | + $txn = $item->transaction(); |
|
| 550 | + $view_txn_url = add_query_arg(array('action' => 'view_transaction', 'TXN_ID' => $txn->ID()), TXN_ADMIN_URL); |
|
| 551 | + if ($item->get('REG_count') === 1) { |
|
| 552 | + $line_total_obj = $txn->total_line_item(); |
|
| 553 | + $txn_total = $line_total_obj instanceof EE_Line_Item |
|
| 554 | + ? $line_total_obj->get_pretty('LIN_total') |
|
| 555 | + : __( |
|
| 556 | + 'View Transaction', |
|
| 557 | + 'event_espresso' |
|
| 558 | + ); |
|
| 559 | + return EE_Registry::instance()->CAP->current_user_can( |
|
| 560 | + 'ee_read_transaction', |
|
| 561 | + 'espresso_transactions_view_transaction' |
|
| 562 | + ) ? '<a href="' |
|
| 563 | + . $view_txn_url |
|
| 564 | + . '" title="' |
|
| 565 | + . esc_attr__('View Transaction', 'event_espresso') |
|
| 566 | + . '"><span class="reg-pad-rght">' |
|
| 567 | + . $txn_total |
|
| 568 | + . '</span></a>' : '<span class="reg-pad-rght">' . $txn_total . '</span>'; |
|
| 569 | + } else { |
|
| 570 | + return '<span class="reg-pad-rght"></span>'; |
|
| 571 | + } |
|
| 572 | + } |
|
| 573 | 573 | } |
@@ -70,7 +70,7 @@ discard block |
||
| 70 | 70 | ); |
| 71 | 71 | $columns = array(); |
| 72 | 72 | // $columns['_Reg_Status'] = ''; |
| 73 | - if (! empty($evt_id)) { |
|
| 73 | + if ( ! empty($evt_id)) { |
|
| 74 | 74 | $columns['cb'] = '<input type="checkbox" />'; // Render a checkbox instead of text |
| 75 | 75 | $this->_has_checkbox_column = true; |
| 76 | 76 | } |
@@ -86,7 +86,7 @@ discard block |
||
| 86 | 86 | ); |
| 87 | 87 | $this->_columns = array_merge($columns, $this->_columns); |
| 88 | 88 | $this->_primary_column = '_REG_att_checked_in'; |
| 89 | - if (! empty($evt_id) |
|
| 89 | + if ( ! empty($evt_id) |
|
| 90 | 90 | && EE_Registry::instance()->CAP->current_user_can( |
| 91 | 91 | 'ee_read_registrations', |
| 92 | 92 | 'espresso_registrations_registrations_reports', |
@@ -158,7 +158,7 @@ discard block |
||
| 158 | 158 | { |
| 159 | 159 | $class = parent::_get_row_class($item); |
| 160 | 160 | // add status class |
| 161 | - $class .= ' ee-status-strip reg-status-' . $item->status_ID(); |
|
| 161 | + $class .= ' ee-status-strip reg-status-'.$item->status_ID(); |
|
| 162 | 162 | if ($this->_has_checkbox_column) { |
| 163 | 163 | $class .= ' has-checkbox-column'; |
| 164 | 164 | } |
@@ -177,10 +177,10 @@ discard block |
||
| 177 | 177 | if (empty($this->_dtts_for_event) || count($this->_dtts_for_event) === 1) { |
| 178 | 178 | // this means we don't have an event so let's setup a filter dropdown for all the events to select |
| 179 | 179 | // note possible capability restrictions |
| 180 | - if (! EE_Registry::instance()->CAP->current_user_can('ee_read_private_events', 'get_events')) { |
|
| 180 | + if ( ! EE_Registry::instance()->CAP->current_user_can('ee_read_private_events', 'get_events')) { |
|
| 181 | 181 | $where['status**'] = array('!=', 'private'); |
| 182 | 182 | } |
| 183 | - if (! EE_Registry::instance()->CAP->current_user_can('ee_read_others_events', 'get_events')) { |
|
| 183 | + if ( ! EE_Registry::instance()->CAP->current_user_can('ee_read_others_events', 'get_events')) { |
|
| 184 | 184 | $where['EVT_wp_user'] = get_current_user_id(); |
| 185 | 185 | } |
| 186 | 186 | $events = EEM_Event::instance()->get_all( |
@@ -197,7 +197,7 @@ discard block |
||
| 197 | 197 | /** @var EE_Event $evt */ |
| 198 | 198 | foreach ($events as $evt) { |
| 199 | 199 | // any registrations for this event? |
| 200 | - if (! $evt->get_count_of_all_registrations()) { |
|
| 200 | + if ( ! $evt->get_count_of_all_registrations()) { |
|
| 201 | 201 | continue; |
| 202 | 202 | } |
| 203 | 203 | $evts[] = array( |
@@ -216,22 +216,22 @@ discard block |
||
| 216 | 216 | $event_filter = '<div class="ee-event-filter">'; |
| 217 | 217 | $event_filter .= EEH_Form_Fields::select_input('event_id', $evts, $current_EVT_ID); |
| 218 | 218 | $event_filter .= '<span class="ee-event-filter-toggle">'; |
| 219 | - $event_filter .= '<input type="checkbox" id="js-ee-hide-expired-events" ' . $checked . '> '; |
|
| 219 | + $event_filter .= '<input type="checkbox" id="js-ee-hide-expired-events" '.$checked.'> '; |
|
| 220 | 220 | $event_filter .= __('Hide Expired Events', 'event_espresso'); |
| 221 | 221 | $event_filter .= '</span>'; |
| 222 | 222 | $event_filter .= '</div>'; |
| 223 | 223 | $filters[] = $event_filter; |
| 224 | 224 | } |
| 225 | - if (! empty($this->_dtts_for_event)) { |
|
| 225 | + if ( ! empty($this->_dtts_for_event)) { |
|
| 226 | 226 | // DTT datetimes filter |
| 227 | 227 | $this->_cur_dtt_id = isset($this->_req_data['DTT_ID']) ? $this->_req_data['DTT_ID'] : 0; |
| 228 | 228 | if (count($this->_dtts_for_event) > 1) { |
| 229 | 229 | $dtts[0] = __('To toggle check-in status, select a datetime.', 'event_espresso'); |
| 230 | 230 | foreach ($this->_dtts_for_event as $dtt) { |
| 231 | 231 | $datetime_string = $dtt->name(); |
| 232 | - $datetime_string = ! empty($datetime_string) ? ' (' . $datetime_string . ')' : ''; |
|
| 233 | - $datetime_string = $dtt->start_date_and_time() . ' - ' . $dtt->end_date_and_time() . $datetime_string; |
|
| 234 | - $dtts[ $dtt->ID() ] = $datetime_string; |
|
| 232 | + $datetime_string = ! empty($datetime_string) ? ' ('.$datetime_string.')' : ''; |
|
| 233 | + $datetime_string = $dtt->start_date_and_time().' - '.$dtt->end_date_and_time().$datetime_string; |
|
| 234 | + $dtts[$dtt->ID()] = $datetime_string; |
|
| 235 | 235 | } |
| 236 | 236 | $input = new EE_Select_Input( |
| 237 | 237 | $dtts, |
@@ -242,7 +242,7 @@ discard block |
||
| 242 | 242 | ) |
| 243 | 243 | ); |
| 244 | 244 | $filters[] = $input->get_html_for_input(); |
| 245 | - $filters[] = '<input type="hidden" name="event_id" value="' . $current_EVT_ID . '">'; |
|
| 245 | + $filters[] = '<input type="hidden" name="event_id" value="'.$current_EVT_ID.'">'; |
|
| 246 | 246 | } |
| 247 | 247 | } |
| 248 | 248 | return $filters; |
@@ -286,7 +286,7 @@ discard block |
||
| 286 | 286 | */ |
| 287 | 287 | public function column__Reg_Status(EE_Registration $item) |
| 288 | 288 | { |
| 289 | - return '<span class="ee-status-strip ee-status-strip-td reg-status-' . $item->status_ID() . '"></span>'; |
|
| 289 | + return '<span class="ee-status-strip ee-status-strip-td reg-status-'.$item->status_ID().'"></span>'; |
|
| 290 | 290 | } |
| 291 | 291 | |
| 292 | 292 | |
@@ -335,11 +335,11 @@ discard block |
||
| 335 | 335 | ) |
| 336 | 336 | ? ' clickable trigger-checkin' |
| 337 | 337 | : ''; |
| 338 | - $mobile_view_content = ' <span class="show-on-mobile-view-only">' . $attendee_name . '</span>'; |
|
| 339 | - return '<span class="' . $checkin_status_dashicon->cssClasses() . $toggle_active . '"' |
|
| 340 | - . ' data-_regid="' . $item->ID() . '"' |
|
| 341 | - . ' data-dttid="' . $this->_cur_dtt_id . '"' |
|
| 342 | - . ' data-nonce="' . $nonce . '">' |
|
| 338 | + $mobile_view_content = ' <span class="show-on-mobile-view-only">'.$attendee_name.'</span>'; |
|
| 339 | + return '<span class="'.$checkin_status_dashicon->cssClasses().$toggle_active.'"' |
|
| 340 | + . ' data-_regid="'.$item->ID().'"' |
|
| 341 | + . ' data-dttid="'.$this->_cur_dtt_id.'"' |
|
| 342 | + . ' data-nonce="'.$nonce.'">' |
|
| 343 | 343 | . '</span>' |
| 344 | 344 | . $mobile_view_content; |
| 345 | 345 | } |
@@ -353,7 +353,7 @@ discard block |
||
| 353 | 353 | public function column_ATT_name(EE_Registration $item) |
| 354 | 354 | { |
| 355 | 355 | $attendee = $item->attendee(); |
| 356 | - if (! $attendee instanceof EE_Attendee) { |
|
| 356 | + if ( ! $attendee instanceof EE_Attendee) { |
|
| 357 | 357 | return __('No contact record for this registration.', 'event_espresso'); |
| 358 | 358 | } |
| 359 | 359 | // edit attendee link |
@@ -365,7 +365,7 @@ discard block |
||
| 365 | 365 | 'ee_edit_contacts', |
| 366 | 366 | 'espresso_registrations_edit_attendee' |
| 367 | 367 | ) |
| 368 | - ? '<a href="' . $edit_lnk_url . '" title="' . esc_attr__('View Registration Details', 'event_espresso') . '">' |
|
| 368 | + ? '<a href="'.$edit_lnk_url.'" title="'.esc_attr__('View Registration Details', 'event_espresso').'">' |
|
| 369 | 369 | . $item->attendee()->full_name() |
| 370 | 370 | . '</a>' |
| 371 | 371 | : $item->attendee()->full_name(); |
@@ -373,7 +373,7 @@ discard block |
||
| 373 | 373 | ? ' <sup><div class="dashicons dashicons-star-filled lt-blue-icon ee-icon-size-8"></div></sup> ' |
| 374 | 374 | : ''; |
| 375 | 375 | // add group details |
| 376 | - $name_link .= ' ' . sprintf(__('(%s of %s)', 'event_espresso'), $item->count(), $item->group_size()); |
|
| 376 | + $name_link .= ' '.sprintf(__('(%s of %s)', 'event_espresso'), $item->count(), $item->group_size()); |
|
| 377 | 377 | // add regcode |
| 378 | 378 | $link = EE_Admin_Page::add_query_args_and_nonce( |
| 379 | 379 | array('action' => 'view_registration', '_REG_ID' => $item->ID()), |
@@ -385,7 +385,7 @@ discard block |
||
| 385 | 385 | 'view_registration', |
| 386 | 386 | $item->ID() |
| 387 | 387 | ) |
| 388 | - ? '<a href="' . $link . '" title="' . esc_attr__('View Registration Details', 'event_espresso') . '">' |
|
| 388 | + ? '<a href="'.$link.'" title="'.esc_attr__('View Registration Details', 'event_espresso').'">' |
|
| 389 | 389 | . $item->reg_code() |
| 390 | 390 | . '</a>' |
| 391 | 391 | : $item->reg_code(); |
@@ -401,7 +401,7 @@ discard block |
||
| 401 | 401 | $DTT_ID = $latest_related_datetime instanceof EE_Datetime |
| 402 | 402 | ? $latest_related_datetime->ID() |
| 403 | 403 | : $DTT_ID; |
| 404 | - if (! empty($DTT_ID) |
|
| 404 | + if ( ! empty($DTT_ID) |
|
| 405 | 405 | && EE_Registry::instance()->CAP->current_user_can( |
| 406 | 406 | 'ee_read_checkins', |
| 407 | 407 | 'espresso_registrations_registration_checkins' |
@@ -413,7 +413,7 @@ discard block |
||
| 413 | 413 | ); |
| 414 | 414 | // get the timestamps for this registration's checkins, related to the selected datetime |
| 415 | 415 | $timestamps = $item->get_many_related('Checkin', array(array('DTT_ID' => $DTT_ID))); |
| 416 | - if (! empty($timestamps)) { |
|
| 416 | + if ( ! empty($timestamps)) { |
|
| 417 | 417 | // get the last timestamp |
| 418 | 418 | $last_timestamp = end($timestamps); |
| 419 | 419 | // checked in or checked out? |
@@ -422,14 +422,14 @@ discard block |
||
| 422 | 422 | : esc_html__('Checked Out', 'event_espresso'); |
| 423 | 423 | // get timestamp string |
| 424 | 424 | $timestamp_string = $last_timestamp->get_datetime('CHK_timestamp'); |
| 425 | - $actions['checkin'] = '<a href="' . $checkin_list_url . '" title="' |
|
| 425 | + $actions['checkin'] = '<a href="'.$checkin_list_url.'" title="' |
|
| 426 | 426 | . esc_attr__( |
| 427 | 427 | 'View this registrant\'s check-ins/checkouts for the datetime', |
| 428 | 428 | 'event_espresso' |
| 429 | - ) . '">' . $checkin_status . ': ' . $timestamp_string . '</a>'; |
|
| 429 | + ).'">'.$checkin_status.': '.$timestamp_string.'</a>'; |
|
| 430 | 430 | } |
| 431 | 431 | } |
| 432 | - return (! empty($DTT_ID) && ! empty($timestamps)) |
|
| 432 | + return ( ! empty($DTT_ID) && ! empty($timestamps)) |
|
| 433 | 433 | ? sprintf('%1$s %2$s', $name_link, $this->row_actions($actions, true)) |
| 434 | 434 | : $name_link; |
| 435 | 435 | } |
@@ -462,11 +462,11 @@ discard block |
||
| 462 | 462 | $event_label = EE_Registry::instance()->CAP->current_user_can( |
| 463 | 463 | 'ee_read_checkins', |
| 464 | 464 | 'espresso_registrations_registration_checkins' |
| 465 | - ) ? '<a href="' . $chkin_lnk_url . '" title="' |
|
| 465 | + ) ? '<a href="'.$chkin_lnk_url.'" title="' |
|
| 466 | 466 | . esc_attr__( |
| 467 | 467 | 'View Checkins for this Event', |
| 468 | 468 | 'event_espresso' |
| 469 | - ) . '">' . $event->name() . '</a>' : $event->name(); |
|
| 469 | + ).'">'.$event->name().'</a>' : $event->name(); |
|
| 470 | 470 | } catch (\EventEspresso\core\exceptions\EntityNotFoundException $e) { |
| 471 | 471 | $event_label = esc_html__('Unknown', 'event_espresso'); |
| 472 | 472 | } |
@@ -492,7 +492,7 @@ discard block |
||
| 492 | 492 | */ |
| 493 | 493 | public function column__REG_final_price(EE_Registration $item) |
| 494 | 494 | { |
| 495 | - return '<span class="reg-pad-rght">' . ' ' . $item->pretty_final_price() . '</span>'; |
|
| 495 | + return '<span class="reg-pad-rght">'.' '.$item->pretty_final_price().'</span>'; |
|
| 496 | 496 | } |
| 497 | 497 | |
| 498 | 498 | |
@@ -529,7 +529,7 @@ discard block |
||
| 529 | 529 | . $item->transaction()->pretty_paid() |
| 530 | 530 | . ' |
| 531 | 531 | </a> |
| 532 | - <span>' : '<span class="reg-pad-rght">' . $item->transaction()->pretty_paid() . '</span>'; |
|
| 532 | + <span>' : '<span class="reg-pad-rght">'.$item->transaction()->pretty_paid().'</span>'; |
|
| 533 | 533 | } |
| 534 | 534 | } else { |
| 535 | 535 | return '<span class="reg-pad-rght"></span>'; |
@@ -565,7 +565,7 @@ discard block |
||
| 565 | 565 | . esc_attr__('View Transaction', 'event_espresso') |
| 566 | 566 | . '"><span class="reg-pad-rght">' |
| 567 | 567 | . $txn_total |
| 568 | - . '</span></a>' : '<span class="reg-pad-rght">' . $txn_total . '</span>'; |
|
| 568 | + . '</span></a>' : '<span class="reg-pad-rght">'.$txn_total.'</span>'; |
|
| 569 | 569 | } else { |
| 570 | 570 | return '<span class="reg-pad-rght"></span>'; |
| 571 | 571 | } |
@@ -12,276 +12,276 @@ |
||
| 12 | 12 | */ |
| 13 | 13 | class espresso_events_Messages_Hooks_Extend extends espresso_events_Messages_Hooks |
| 14 | 14 | { |
| 15 | - /** |
|
| 16 | - * espresso_events_Messages_Hooks_Extend constructor. |
|
| 17 | - * |
|
| 18 | - * @param \EE_Admin_Page $admin_page |
|
| 19 | - */ |
|
| 20 | - public function __construct(EE_Admin_Page $admin_page) |
|
| 21 | - { |
|
| 22 | - /** |
|
| 23 | - * Add cap restriction ... metaboxes should not show if user does not have the ability to edit_custom_messages |
|
| 24 | - */ |
|
| 25 | - if (! EE_Registry::instance()->CAP->current_user_can( |
|
| 26 | - 'ee_edit_messages', |
|
| 27 | - 'messages_events_editor_metabox' |
|
| 28 | - )) { |
|
| 29 | - return; |
|
| 30 | - } |
|
| 31 | - add_filter( |
|
| 32 | - 'FHEE__Events_Admin_Page___insert_update_cpt_item__event_update_callbacks', |
|
| 33 | - array($this, 'caf_updates'), |
|
| 34 | - 10 |
|
| 35 | - ); |
|
| 36 | - add_action( |
|
| 37 | - 'AHEE__Extend_Events_Admin_Page___duplicate_event__after', |
|
| 38 | - array($this, 'duplicate_custom_message_settings'), |
|
| 39 | - 10, |
|
| 40 | - 2 |
|
| 41 | - ); |
|
| 42 | - parent::__construct($admin_page); |
|
| 43 | - } |
|
| 44 | - |
|
| 45 | - |
|
| 46 | - /** |
|
| 47 | - * extending the properties set in espresso_events_Messages_Hooks |
|
| 48 | - * |
|
| 49 | - * @access protected |
|
| 50 | - * @return void |
|
| 51 | - */ |
|
| 52 | - protected function _extend_properties() |
|
| 53 | - { |
|
| 54 | - define('EE_MSGS_EXTEND_ASSETS_URL', EE_CORE_CAF_ADMIN_EXTEND_URL . 'messages/assets/'); |
|
| 55 | - $this->_ajax_func = array( |
|
| 56 | - 'ee_msgs_create_new_custom' => 'create_new_custom', |
|
| 57 | - ); |
|
| 58 | - $this->_metaboxes = array( |
|
| 59 | - 0 => array( |
|
| 60 | - 'page_route' => array('edit', 'create_new'), |
|
| 61 | - 'func' => 'messages_metabox', |
|
| 62 | - 'label' => esc_html__('Notifications', 'event_espresso'), |
|
| 63 | - 'priority' => 'high', |
|
| 64 | - ), |
|
| 65 | - ); |
|
| 66 | - |
|
| 67 | - // see explanation for layout in EE_Admin_Hooks |
|
| 68 | - $this->_scripts_styles = array( |
|
| 69 | - 'registers' => array( |
|
| 70 | - 'events_msg_admin' => array( |
|
| 71 | - 'url' => EE_MSGS_EXTEND_ASSETS_URL . 'events_messages_admin.js', |
|
| 72 | - 'depends' => array('ee-dialog', 'ee-parse-uri', 'ee-serialize-full-array'), |
|
| 73 | - ), |
|
| 74 | - 'events_msg_admin_css' => array( |
|
| 75 | - 'url' => EE_MSGS_EXTEND_ASSETS_URL . 'ee_msg_events_admin.css', |
|
| 76 | - 'type' => 'css', |
|
| 77 | - ), |
|
| 78 | - ), |
|
| 79 | - 'enqueues' => array( |
|
| 80 | - 'events_msg_admin' => array('edit', 'create_new'), |
|
| 81 | - 'events_msg_admin_css' => array('edit', 'create_new'), |
|
| 82 | - ), |
|
| 83 | - ); |
|
| 84 | - } |
|
| 85 | - |
|
| 86 | - |
|
| 87 | - public function caf_updates($update_callbacks) |
|
| 88 | - { |
|
| 89 | - $update_callbacks[] = array($this, 'attach_evt_message_templates'); |
|
| 90 | - return $update_callbacks; |
|
| 91 | - } |
|
| 92 | - |
|
| 93 | - |
|
| 94 | - /** |
|
| 95 | - * Handles attaching Message Templates to the Event on save. |
|
| 96 | - * |
|
| 97 | - * @param EE_Event $event EE event object |
|
| 98 | - * @param array $data The request data from the form |
|
| 99 | - * @return bool success or fail |
|
| 100 | - * @throws EE_Error |
|
| 101 | - */ |
|
| 102 | - public function attach_evt_message_templates($event, $data) |
|
| 103 | - { |
|
| 104 | - // first we remove all existing relations on the Event for message types. |
|
| 105 | - $event->_remove_relations('Message_Template_Group'); |
|
| 106 | - // now let's just loop through the selected templates and add relations! |
|
| 107 | - if (isset($data['event_message_templates_relation'])) { |
|
| 108 | - foreach ($data['event_message_templates_relation'] as $grp_ID) { |
|
| 109 | - $event->_add_relation_to($grp_ID, 'Message_Template_Group'); |
|
| 110 | - } |
|
| 111 | - } |
|
| 112 | - // now save |
|
| 113 | - return $event->save(); |
|
| 114 | - } |
|
| 115 | - |
|
| 116 | - |
|
| 117 | - /** |
|
| 118 | - * @param $event |
|
| 119 | - * @param $callback_args |
|
| 120 | - * @return string |
|
| 121 | - * @throws \EE_Error |
|
| 122 | - */ |
|
| 123 | - public function messages_metabox($event, $callback_args) |
|
| 124 | - { |
|
| 125 | - // let's get the active messengers (b/c messenger objects have the active message templates) |
|
| 126 | - // convert 'evt_id' to 'EVT_ID' |
|
| 127 | - $this->_req_data['EVT_ID'] = isset($this->_req_data['EVT_ID']) ? $this->_req_data['EVT_ID'] : null; |
|
| 128 | - $this->_req_data['EVT_ID'] = isset($this->_req_data['post']) && empty($this->_req_data['EVT_ID']) |
|
| 129 | - ? $this->_req_data['post'] |
|
| 130 | - : $this->_req_data['EVT_ID']; |
|
| 131 | - |
|
| 132 | - $this->_req_data['EVT_ID'] = empty($this->_req_data['EVT_ID']) && isset($this->_req_data['evt_id']) |
|
| 133 | - ? $this->_req_data['evt_id'] |
|
| 134 | - : $this->_req_data['EVT_ID']; |
|
| 135 | - /** @type EE_Message_Resource_Manager $message_resource_manager */ |
|
| 136 | - $message_resource_manager = EE_Registry::instance()->load_lib('Message_Resource_Manager'); |
|
| 137 | - $active_messengers = $message_resource_manager->active_messengers(); |
|
| 138 | - $tabs = array(); |
|
| 139 | - |
|
| 140 | - // empty messengers? |
|
| 141 | - // Note message types will always have at least one available because every messenger has a default message type |
|
| 142 | - // associated with it (payment) if no other message types are selected. |
|
| 143 | - if (empty($active_messengers)) { |
|
| 144 | - $msg_activate_url = EE_Admin_Page::add_query_args_and_nonce( |
|
| 145 | - array('action' => 'settings'), |
|
| 146 | - EE_MSG_ADMIN_URL |
|
| 147 | - ); |
|
| 148 | - $error_msg = sprintf( |
|
| 149 | - esc_html__( |
|
| 150 | - 'There are no active messengers. So no notifications will go out for %1$sany%2$s events. You will want to %3$sActivate a Messenger%4$s.', |
|
| 151 | - 'event_espresso' |
|
| 152 | - ), |
|
| 153 | - '<strong>', |
|
| 154 | - '</strong>', |
|
| 155 | - '<a href="' . $msg_activate_url . '">', |
|
| 156 | - '</a>' |
|
| 157 | - ); |
|
| 158 | - $error_content = '<div class="error"><p>' . $error_msg . '</p></div>'; |
|
| 159 | - $internal_content = '<div id="messages-error"><p>' . $error_msg . '</p></div>'; |
|
| 160 | - |
|
| 161 | - echo $error_content; |
|
| 162 | - echo $internal_content; |
|
| 163 | - return ''; |
|
| 164 | - } |
|
| 165 | - |
|
| 166 | - $event_id = isset($this->_req_data['EVT_ID']) ? $this->_req_data['EVT_ID'] : null; |
|
| 167 | - // get content for active messengers |
|
| 168 | - foreach ($active_messengers as $name => $messenger) { |
|
| 169 | - // first check if there are any active message types for this messenger. |
|
| 170 | - $active_mts = $message_resource_manager->get_active_message_types_for_messenger($name); |
|
| 171 | - if (empty($active_mts)) { |
|
| 172 | - continue; |
|
| 173 | - } |
|
| 174 | - |
|
| 175 | - $tab_content = $messenger->get_messenger_admin_page_content( |
|
| 176 | - 'events', |
|
| 177 | - 'edit', |
|
| 178 | - array('event' => $event_id) |
|
| 179 | - ); |
|
| 180 | - |
|
| 181 | - if (! empty($tab_content)) { |
|
| 182 | - $tabs[ $name ] = $tab_content; |
|
| 183 | - } |
|
| 184 | - } |
|
| 185 | - |
|
| 186 | - |
|
| 187 | - // we want this to be tabbed content so let's use the EEH_Tabbed_Content::display helper. |
|
| 188 | - $tabbed_content = EEH_Tabbed_Content::display($tabs); |
|
| 189 | - if ($tabbed_content instanceof WP_Error) { |
|
| 190 | - $tabbed_content = $tabbed_content->get_error_message(); |
|
| 191 | - } |
|
| 192 | - |
|
| 193 | - $notices = ' |
|
| 15 | + /** |
|
| 16 | + * espresso_events_Messages_Hooks_Extend constructor. |
|
| 17 | + * |
|
| 18 | + * @param \EE_Admin_Page $admin_page |
|
| 19 | + */ |
|
| 20 | + public function __construct(EE_Admin_Page $admin_page) |
|
| 21 | + { |
|
| 22 | + /** |
|
| 23 | + * Add cap restriction ... metaboxes should not show if user does not have the ability to edit_custom_messages |
|
| 24 | + */ |
|
| 25 | + if (! EE_Registry::instance()->CAP->current_user_can( |
|
| 26 | + 'ee_edit_messages', |
|
| 27 | + 'messages_events_editor_metabox' |
|
| 28 | + )) { |
|
| 29 | + return; |
|
| 30 | + } |
|
| 31 | + add_filter( |
|
| 32 | + 'FHEE__Events_Admin_Page___insert_update_cpt_item__event_update_callbacks', |
|
| 33 | + array($this, 'caf_updates'), |
|
| 34 | + 10 |
|
| 35 | + ); |
|
| 36 | + add_action( |
|
| 37 | + 'AHEE__Extend_Events_Admin_Page___duplicate_event__after', |
|
| 38 | + array($this, 'duplicate_custom_message_settings'), |
|
| 39 | + 10, |
|
| 40 | + 2 |
|
| 41 | + ); |
|
| 42 | + parent::__construct($admin_page); |
|
| 43 | + } |
|
| 44 | + |
|
| 45 | + |
|
| 46 | + /** |
|
| 47 | + * extending the properties set in espresso_events_Messages_Hooks |
|
| 48 | + * |
|
| 49 | + * @access protected |
|
| 50 | + * @return void |
|
| 51 | + */ |
|
| 52 | + protected function _extend_properties() |
|
| 53 | + { |
|
| 54 | + define('EE_MSGS_EXTEND_ASSETS_URL', EE_CORE_CAF_ADMIN_EXTEND_URL . 'messages/assets/'); |
|
| 55 | + $this->_ajax_func = array( |
|
| 56 | + 'ee_msgs_create_new_custom' => 'create_new_custom', |
|
| 57 | + ); |
|
| 58 | + $this->_metaboxes = array( |
|
| 59 | + 0 => array( |
|
| 60 | + 'page_route' => array('edit', 'create_new'), |
|
| 61 | + 'func' => 'messages_metabox', |
|
| 62 | + 'label' => esc_html__('Notifications', 'event_espresso'), |
|
| 63 | + 'priority' => 'high', |
|
| 64 | + ), |
|
| 65 | + ); |
|
| 66 | + |
|
| 67 | + // see explanation for layout in EE_Admin_Hooks |
|
| 68 | + $this->_scripts_styles = array( |
|
| 69 | + 'registers' => array( |
|
| 70 | + 'events_msg_admin' => array( |
|
| 71 | + 'url' => EE_MSGS_EXTEND_ASSETS_URL . 'events_messages_admin.js', |
|
| 72 | + 'depends' => array('ee-dialog', 'ee-parse-uri', 'ee-serialize-full-array'), |
|
| 73 | + ), |
|
| 74 | + 'events_msg_admin_css' => array( |
|
| 75 | + 'url' => EE_MSGS_EXTEND_ASSETS_URL . 'ee_msg_events_admin.css', |
|
| 76 | + 'type' => 'css', |
|
| 77 | + ), |
|
| 78 | + ), |
|
| 79 | + 'enqueues' => array( |
|
| 80 | + 'events_msg_admin' => array('edit', 'create_new'), |
|
| 81 | + 'events_msg_admin_css' => array('edit', 'create_new'), |
|
| 82 | + ), |
|
| 83 | + ); |
|
| 84 | + } |
|
| 85 | + |
|
| 86 | + |
|
| 87 | + public function caf_updates($update_callbacks) |
|
| 88 | + { |
|
| 89 | + $update_callbacks[] = array($this, 'attach_evt_message_templates'); |
|
| 90 | + return $update_callbacks; |
|
| 91 | + } |
|
| 92 | + |
|
| 93 | + |
|
| 94 | + /** |
|
| 95 | + * Handles attaching Message Templates to the Event on save. |
|
| 96 | + * |
|
| 97 | + * @param EE_Event $event EE event object |
|
| 98 | + * @param array $data The request data from the form |
|
| 99 | + * @return bool success or fail |
|
| 100 | + * @throws EE_Error |
|
| 101 | + */ |
|
| 102 | + public function attach_evt_message_templates($event, $data) |
|
| 103 | + { |
|
| 104 | + // first we remove all existing relations on the Event for message types. |
|
| 105 | + $event->_remove_relations('Message_Template_Group'); |
|
| 106 | + // now let's just loop through the selected templates and add relations! |
|
| 107 | + if (isset($data['event_message_templates_relation'])) { |
|
| 108 | + foreach ($data['event_message_templates_relation'] as $grp_ID) { |
|
| 109 | + $event->_add_relation_to($grp_ID, 'Message_Template_Group'); |
|
| 110 | + } |
|
| 111 | + } |
|
| 112 | + // now save |
|
| 113 | + return $event->save(); |
|
| 114 | + } |
|
| 115 | + |
|
| 116 | + |
|
| 117 | + /** |
|
| 118 | + * @param $event |
|
| 119 | + * @param $callback_args |
|
| 120 | + * @return string |
|
| 121 | + * @throws \EE_Error |
|
| 122 | + */ |
|
| 123 | + public function messages_metabox($event, $callback_args) |
|
| 124 | + { |
|
| 125 | + // let's get the active messengers (b/c messenger objects have the active message templates) |
|
| 126 | + // convert 'evt_id' to 'EVT_ID' |
|
| 127 | + $this->_req_data['EVT_ID'] = isset($this->_req_data['EVT_ID']) ? $this->_req_data['EVT_ID'] : null; |
|
| 128 | + $this->_req_data['EVT_ID'] = isset($this->_req_data['post']) && empty($this->_req_data['EVT_ID']) |
|
| 129 | + ? $this->_req_data['post'] |
|
| 130 | + : $this->_req_data['EVT_ID']; |
|
| 131 | + |
|
| 132 | + $this->_req_data['EVT_ID'] = empty($this->_req_data['EVT_ID']) && isset($this->_req_data['evt_id']) |
|
| 133 | + ? $this->_req_data['evt_id'] |
|
| 134 | + : $this->_req_data['EVT_ID']; |
|
| 135 | + /** @type EE_Message_Resource_Manager $message_resource_manager */ |
|
| 136 | + $message_resource_manager = EE_Registry::instance()->load_lib('Message_Resource_Manager'); |
|
| 137 | + $active_messengers = $message_resource_manager->active_messengers(); |
|
| 138 | + $tabs = array(); |
|
| 139 | + |
|
| 140 | + // empty messengers? |
|
| 141 | + // Note message types will always have at least one available because every messenger has a default message type |
|
| 142 | + // associated with it (payment) if no other message types are selected. |
|
| 143 | + if (empty($active_messengers)) { |
|
| 144 | + $msg_activate_url = EE_Admin_Page::add_query_args_and_nonce( |
|
| 145 | + array('action' => 'settings'), |
|
| 146 | + EE_MSG_ADMIN_URL |
|
| 147 | + ); |
|
| 148 | + $error_msg = sprintf( |
|
| 149 | + esc_html__( |
|
| 150 | + 'There are no active messengers. So no notifications will go out for %1$sany%2$s events. You will want to %3$sActivate a Messenger%4$s.', |
|
| 151 | + 'event_espresso' |
|
| 152 | + ), |
|
| 153 | + '<strong>', |
|
| 154 | + '</strong>', |
|
| 155 | + '<a href="' . $msg_activate_url . '">', |
|
| 156 | + '</a>' |
|
| 157 | + ); |
|
| 158 | + $error_content = '<div class="error"><p>' . $error_msg . '</p></div>'; |
|
| 159 | + $internal_content = '<div id="messages-error"><p>' . $error_msg . '</p></div>'; |
|
| 160 | + |
|
| 161 | + echo $error_content; |
|
| 162 | + echo $internal_content; |
|
| 163 | + return ''; |
|
| 164 | + } |
|
| 165 | + |
|
| 166 | + $event_id = isset($this->_req_data['EVT_ID']) ? $this->_req_data['EVT_ID'] : null; |
|
| 167 | + // get content for active messengers |
|
| 168 | + foreach ($active_messengers as $name => $messenger) { |
|
| 169 | + // first check if there are any active message types for this messenger. |
|
| 170 | + $active_mts = $message_resource_manager->get_active_message_types_for_messenger($name); |
|
| 171 | + if (empty($active_mts)) { |
|
| 172 | + continue; |
|
| 173 | + } |
|
| 174 | + |
|
| 175 | + $tab_content = $messenger->get_messenger_admin_page_content( |
|
| 176 | + 'events', |
|
| 177 | + 'edit', |
|
| 178 | + array('event' => $event_id) |
|
| 179 | + ); |
|
| 180 | + |
|
| 181 | + if (! empty($tab_content)) { |
|
| 182 | + $tabs[ $name ] = $tab_content; |
|
| 183 | + } |
|
| 184 | + } |
|
| 185 | + |
|
| 186 | + |
|
| 187 | + // we want this to be tabbed content so let's use the EEH_Tabbed_Content::display helper. |
|
| 188 | + $tabbed_content = EEH_Tabbed_Content::display($tabs); |
|
| 189 | + if ($tabbed_content instanceof WP_Error) { |
|
| 190 | + $tabbed_content = $tabbed_content->get_error_message(); |
|
| 191 | + } |
|
| 192 | + |
|
| 193 | + $notices = ' |
|
| 194 | 194 | <div id="espresso-ajax-loading" class="ajax-loader-grey"> |
| 195 | 195 | <span class="ee-spinner ee-spin"></span><span class="hidden">' |
| 196 | - . esc_html__('loading...', 'event_espresso') |
|
| 197 | - . '</span> |
|
| 196 | + . esc_html__('loading...', 'event_espresso') |
|
| 197 | + . '</span> |
|
| 198 | 198 | </div> |
| 199 | 199 | <div class="ee-notices"></div>'; |
| 200 | 200 | |
| 201 | - if (defined('DOING_AJAX')) { |
|
| 202 | - return $tabbed_content; |
|
| 203 | - } |
|
| 204 | - |
|
| 205 | - do_action('AHEE__espresso_events_Messages_Hooks_Extend__messages_metabox__before_content'); |
|
| 206 | - echo $notices . '<div class="messages-tabs-content">' . $tabbed_content . '</div>'; |
|
| 207 | - do_action('AHEE__espresso_events_Messages_Hooks_Extend__messages_metabox__after_content'); |
|
| 208 | - } |
|
| 209 | - |
|
| 210 | - |
|
| 211 | - /** |
|
| 212 | - * Ajax callback for ee_msgs_create_new_custom ajax request. |
|
| 213 | - * Takes incoming GRP_ID and name and description values from ajax request |
|
| 214 | - * to create a new custom template based off of the incoming GRP_ID. |
|
| 215 | - * |
|
| 216 | - * @access public |
|
| 217 | - * @return string either an html string will be returned or a success message |
|
| 218 | - * @throws EE_Error |
|
| 219 | - */ |
|
| 220 | - public function create_new_custom() |
|
| 221 | - { |
|
| 222 | - if (! EE_Registry::instance()->CAP->current_user_can('ee_edit_messages', 'create_new_custom_ajax')) { |
|
| 223 | - wp_die(__('You don\'t have privileges to do this action', 'event_espresso')); |
|
| 224 | - } |
|
| 225 | - |
|
| 226 | - // let's clean up the _POST global a bit for downstream usage of name and description. |
|
| 227 | - $_POST['templateName'] = ! empty($this->_req_data['custom_template_args']['MTP_name']) |
|
| 228 | - ? $this->_req_data['custom_template_args']['MTP_name'] |
|
| 229 | - : ''; |
|
| 230 | - $_POST['templateDescription'] = ! empty($this->_req_data['custom_template_args']['MTP_description']) |
|
| 231 | - ? $this->_req_data['custom_template_args']['MTP_description'] |
|
| 232 | - : ''; |
|
| 233 | - |
|
| 234 | - |
|
| 235 | - // set EE_Admin_Page object (see method details in EE_Admin_Hooks parent |
|
| 236 | - $this->_set_page_object(); |
|
| 237 | - |
|
| 238 | - // is this a template switch if so EE_Admin_Page child needs this object |
|
| 239 | - $this->_page_object->set_hook_object($this); |
|
| 240 | - |
|
| 241 | - $this->_page_object->add_message_template( |
|
| 242 | - $this->_req_data['messageType'], |
|
| 243 | - $this->_req_data['messenger'], |
|
| 244 | - $this->_req_data['group_ID'] |
|
| 245 | - ); |
|
| 246 | - } |
|
| 247 | - |
|
| 248 | - |
|
| 249 | - public function create_new_admin_footer() |
|
| 250 | - { |
|
| 251 | - $this->edit_admin_footer(); |
|
| 252 | - } |
|
| 253 | - |
|
| 254 | - |
|
| 255 | - /** |
|
| 256 | - * This is the dynamic method for this class |
|
| 257 | - * that will end up hooking into the 'admin_footer' hook on the 'edit_event' route in the events page. |
|
| 258 | - * |
|
| 259 | - * @return string |
|
| 260 | - * @throws DomainException |
|
| 261 | - */ |
|
| 262 | - public function edit_admin_footer() |
|
| 263 | - { |
|
| 264 | - EEH_Template::display_template( |
|
| 265 | - EE_CORE_CAF_ADMIN_EXTEND . 'messages/templates/create_custom_template_form.template.php' |
|
| 266 | - ); |
|
| 267 | - } |
|
| 268 | - |
|
| 269 | - |
|
| 270 | - /** |
|
| 271 | - * Callback for AHEE__Extend_Events_Admin_Page___duplicate_event__after hook used to ensure new events duplicate |
|
| 272 | - * the assigned custom message templates. |
|
| 273 | - * |
|
| 274 | - * @param EE_Event $new_event |
|
| 275 | - * @param EE_Event $original_event |
|
| 276 | - * @throws EE_Error |
|
| 277 | - */ |
|
| 278 | - public function duplicate_custom_message_settings(EE_Event $new_event, EE_Event $original_event) |
|
| 279 | - { |
|
| 280 | - $message_template_groups = $original_event->get_many_related('Message_Template_Group'); |
|
| 281 | - foreach ($message_template_groups as $message_template_group) { |
|
| 282 | - $new_event->_add_relation_to($message_template_group, 'Message_Template_Group'); |
|
| 283 | - } |
|
| 284 | - // save new event |
|
| 285 | - $new_event->save(); |
|
| 286 | - } |
|
| 201 | + if (defined('DOING_AJAX')) { |
|
| 202 | + return $tabbed_content; |
|
| 203 | + } |
|
| 204 | + |
|
| 205 | + do_action('AHEE__espresso_events_Messages_Hooks_Extend__messages_metabox__before_content'); |
|
| 206 | + echo $notices . '<div class="messages-tabs-content">' . $tabbed_content . '</div>'; |
|
| 207 | + do_action('AHEE__espresso_events_Messages_Hooks_Extend__messages_metabox__after_content'); |
|
| 208 | + } |
|
| 209 | + |
|
| 210 | + |
|
| 211 | + /** |
|
| 212 | + * Ajax callback for ee_msgs_create_new_custom ajax request. |
|
| 213 | + * Takes incoming GRP_ID and name and description values from ajax request |
|
| 214 | + * to create a new custom template based off of the incoming GRP_ID. |
|
| 215 | + * |
|
| 216 | + * @access public |
|
| 217 | + * @return string either an html string will be returned or a success message |
|
| 218 | + * @throws EE_Error |
|
| 219 | + */ |
|
| 220 | + public function create_new_custom() |
|
| 221 | + { |
|
| 222 | + if (! EE_Registry::instance()->CAP->current_user_can('ee_edit_messages', 'create_new_custom_ajax')) { |
|
| 223 | + wp_die(__('You don\'t have privileges to do this action', 'event_espresso')); |
|
| 224 | + } |
|
| 225 | + |
|
| 226 | + // let's clean up the _POST global a bit for downstream usage of name and description. |
|
| 227 | + $_POST['templateName'] = ! empty($this->_req_data['custom_template_args']['MTP_name']) |
|
| 228 | + ? $this->_req_data['custom_template_args']['MTP_name'] |
|
| 229 | + : ''; |
|
| 230 | + $_POST['templateDescription'] = ! empty($this->_req_data['custom_template_args']['MTP_description']) |
|
| 231 | + ? $this->_req_data['custom_template_args']['MTP_description'] |
|
| 232 | + : ''; |
|
| 233 | + |
|
| 234 | + |
|
| 235 | + // set EE_Admin_Page object (see method details in EE_Admin_Hooks parent |
|
| 236 | + $this->_set_page_object(); |
|
| 237 | + |
|
| 238 | + // is this a template switch if so EE_Admin_Page child needs this object |
|
| 239 | + $this->_page_object->set_hook_object($this); |
|
| 240 | + |
|
| 241 | + $this->_page_object->add_message_template( |
|
| 242 | + $this->_req_data['messageType'], |
|
| 243 | + $this->_req_data['messenger'], |
|
| 244 | + $this->_req_data['group_ID'] |
|
| 245 | + ); |
|
| 246 | + } |
|
| 247 | + |
|
| 248 | + |
|
| 249 | + public function create_new_admin_footer() |
|
| 250 | + { |
|
| 251 | + $this->edit_admin_footer(); |
|
| 252 | + } |
|
| 253 | + |
|
| 254 | + |
|
| 255 | + /** |
|
| 256 | + * This is the dynamic method for this class |
|
| 257 | + * that will end up hooking into the 'admin_footer' hook on the 'edit_event' route in the events page. |
|
| 258 | + * |
|
| 259 | + * @return string |
|
| 260 | + * @throws DomainException |
|
| 261 | + */ |
|
| 262 | + public function edit_admin_footer() |
|
| 263 | + { |
|
| 264 | + EEH_Template::display_template( |
|
| 265 | + EE_CORE_CAF_ADMIN_EXTEND . 'messages/templates/create_custom_template_form.template.php' |
|
| 266 | + ); |
|
| 267 | + } |
|
| 268 | + |
|
| 269 | + |
|
| 270 | + /** |
|
| 271 | + * Callback for AHEE__Extend_Events_Admin_Page___duplicate_event__after hook used to ensure new events duplicate |
|
| 272 | + * the assigned custom message templates. |
|
| 273 | + * |
|
| 274 | + * @param EE_Event $new_event |
|
| 275 | + * @param EE_Event $original_event |
|
| 276 | + * @throws EE_Error |
|
| 277 | + */ |
|
| 278 | + public function duplicate_custom_message_settings(EE_Event $new_event, EE_Event $original_event) |
|
| 279 | + { |
|
| 280 | + $message_template_groups = $original_event->get_many_related('Message_Template_Group'); |
|
| 281 | + foreach ($message_template_groups as $message_template_group) { |
|
| 282 | + $new_event->_add_relation_to($message_template_group, 'Message_Template_Group'); |
|
| 283 | + } |
|
| 284 | + // save new event |
|
| 285 | + $new_event->save(); |
|
| 286 | + } |
|
| 287 | 287 | } |
@@ -22,7 +22,7 @@ discard block |
||
| 22 | 22 | /** |
| 23 | 23 | * Add cap restriction ... metaboxes should not show if user does not have the ability to edit_custom_messages |
| 24 | 24 | */ |
| 25 | - if (! EE_Registry::instance()->CAP->current_user_can( |
|
| 25 | + if ( ! EE_Registry::instance()->CAP->current_user_can( |
|
| 26 | 26 | 'ee_edit_messages', |
| 27 | 27 | 'messages_events_editor_metabox' |
| 28 | 28 | )) { |
@@ -51,7 +51,7 @@ discard block |
||
| 51 | 51 | */ |
| 52 | 52 | protected function _extend_properties() |
| 53 | 53 | { |
| 54 | - define('EE_MSGS_EXTEND_ASSETS_URL', EE_CORE_CAF_ADMIN_EXTEND_URL . 'messages/assets/'); |
|
| 54 | + define('EE_MSGS_EXTEND_ASSETS_URL', EE_CORE_CAF_ADMIN_EXTEND_URL.'messages/assets/'); |
|
| 55 | 55 | $this->_ajax_func = array( |
| 56 | 56 | 'ee_msgs_create_new_custom' => 'create_new_custom', |
| 57 | 57 | ); |
@@ -68,11 +68,11 @@ discard block |
||
| 68 | 68 | $this->_scripts_styles = array( |
| 69 | 69 | 'registers' => array( |
| 70 | 70 | 'events_msg_admin' => array( |
| 71 | - 'url' => EE_MSGS_EXTEND_ASSETS_URL . 'events_messages_admin.js', |
|
| 71 | + 'url' => EE_MSGS_EXTEND_ASSETS_URL.'events_messages_admin.js', |
|
| 72 | 72 | 'depends' => array('ee-dialog', 'ee-parse-uri', 'ee-serialize-full-array'), |
| 73 | 73 | ), |
| 74 | 74 | 'events_msg_admin_css' => array( |
| 75 | - 'url' => EE_MSGS_EXTEND_ASSETS_URL . 'ee_msg_events_admin.css', |
|
| 75 | + 'url' => EE_MSGS_EXTEND_ASSETS_URL.'ee_msg_events_admin.css', |
|
| 76 | 76 | 'type' => 'css', |
| 77 | 77 | ), |
| 78 | 78 | ), |
@@ -152,11 +152,11 @@ discard block |
||
| 152 | 152 | ), |
| 153 | 153 | '<strong>', |
| 154 | 154 | '</strong>', |
| 155 | - '<a href="' . $msg_activate_url . '">', |
|
| 155 | + '<a href="'.$msg_activate_url.'">', |
|
| 156 | 156 | '</a>' |
| 157 | 157 | ); |
| 158 | - $error_content = '<div class="error"><p>' . $error_msg . '</p></div>'; |
|
| 159 | - $internal_content = '<div id="messages-error"><p>' . $error_msg . '</p></div>'; |
|
| 158 | + $error_content = '<div class="error"><p>'.$error_msg.'</p></div>'; |
|
| 159 | + $internal_content = '<div id="messages-error"><p>'.$error_msg.'</p></div>'; |
|
| 160 | 160 | |
| 161 | 161 | echo $error_content; |
| 162 | 162 | echo $internal_content; |
@@ -178,8 +178,8 @@ discard block |
||
| 178 | 178 | array('event' => $event_id) |
| 179 | 179 | ); |
| 180 | 180 | |
| 181 | - if (! empty($tab_content)) { |
|
| 182 | - $tabs[ $name ] = $tab_content; |
|
| 181 | + if ( ! empty($tab_content)) { |
|
| 182 | + $tabs[$name] = $tab_content; |
|
| 183 | 183 | } |
| 184 | 184 | } |
| 185 | 185 | |
@@ -203,7 +203,7 @@ discard block |
||
| 203 | 203 | } |
| 204 | 204 | |
| 205 | 205 | do_action('AHEE__espresso_events_Messages_Hooks_Extend__messages_metabox__before_content'); |
| 206 | - echo $notices . '<div class="messages-tabs-content">' . $tabbed_content . '</div>'; |
|
| 206 | + echo $notices.'<div class="messages-tabs-content">'.$tabbed_content.'</div>'; |
|
| 207 | 207 | do_action('AHEE__espresso_events_Messages_Hooks_Extend__messages_metabox__after_content'); |
| 208 | 208 | } |
| 209 | 209 | |
@@ -219,7 +219,7 @@ discard block |
||
| 219 | 219 | */ |
| 220 | 220 | public function create_new_custom() |
| 221 | 221 | { |
| 222 | - if (! EE_Registry::instance()->CAP->current_user_can('ee_edit_messages', 'create_new_custom_ajax')) { |
|
| 222 | + if ( ! EE_Registry::instance()->CAP->current_user_can('ee_edit_messages', 'create_new_custom_ajax')) { |
|
| 223 | 223 | wp_die(__('You don\'t have privileges to do this action', 'event_espresso')); |
| 224 | 224 | } |
| 225 | 225 | |
@@ -262,7 +262,7 @@ discard block |
||
| 262 | 262 | public function edit_admin_footer() |
| 263 | 263 | { |
| 264 | 264 | EEH_Template::display_template( |
| 265 | - EE_CORE_CAF_ADMIN_EXTEND . 'messages/templates/create_custom_template_form.template.php' |
|
| 265 | + EE_CORE_CAF_ADMIN_EXTEND.'messages/templates/create_custom_template_form.template.php' |
|
| 266 | 266 | ); |
| 267 | 267 | } |
| 268 | 268 | |
@@ -18,153 +18,153 @@ |
||
| 18 | 18 | { |
| 19 | 19 | |
| 20 | 20 | |
| 21 | - protected function _setup_data() |
|
| 22 | - { |
|
| 23 | - $trashed = $this->_admin_page->get_view() == 'trashed' ? true : false; |
|
| 24 | - $this->_data = $this->_admin_page->get_default_tickets($this->_per_page, false, $trashed); |
|
| 25 | - $this->_all_data_count = $this->_admin_page->get_default_tickets($this->_per_page, true, false); |
|
| 26 | - $this->_trashed_count = $this->_admin_page->get_default_tickets($this->_per_page, true, true); |
|
| 27 | - } |
|
| 28 | - |
|
| 29 | - |
|
| 30 | - protected function _set_properties() |
|
| 31 | - { |
|
| 32 | - $this->_wp_list_args = array( |
|
| 33 | - 'singular' => __('ticket', 'event_espresso'), |
|
| 34 | - 'plural' => __('tickets', 'event_espresso'), |
|
| 35 | - 'ajax' => true, |
|
| 36 | - 'screen' => $this->_admin_page->get_current_screen()->id, |
|
| 37 | - ); |
|
| 38 | - |
|
| 39 | - $this->_columns = array( |
|
| 40 | - 'cb' => '<input type="checkbox" />', // Render a checkbox instead of text |
|
| 41 | - 'TKT_name' => __('Name', 'event_espresso'), |
|
| 42 | - 'TKT_description' => __('Description', 'event_espresso'), |
|
| 43 | - 'TKT_qty' => __('Quantity', 'event_espresso'), |
|
| 44 | - 'TKT_uses' => __('Uses', 'event_espresso'), |
|
| 45 | - 'TKT_min' => __('Minimum', 'event_espresso'), |
|
| 46 | - 'TKT_max' => __('Maximum', 'event_espresso'), |
|
| 47 | - 'TKT_price' => __('Price', 'event_espresso'), |
|
| 48 | - 'TKT_taxable' => __('Taxable', 'event_espresso'), |
|
| 49 | - ); |
|
| 50 | - |
|
| 51 | - $this->_sortable_columns = array( |
|
| 52 | - // TRUE means its already sorted |
|
| 53 | - 'TKT_name' => array('TKT_name', true), |
|
| 54 | - 'TKT_description' => array('TKT_description', false), |
|
| 55 | - 'TKT_qty' => array('TKT_qty', false), |
|
| 56 | - 'TKT_uses' => array('TKT_uses', false), |
|
| 57 | - 'TKT_min' => array('TKT_min', false), |
|
| 58 | - 'TKT_max' => array('TKT_max', false), |
|
| 59 | - 'TKT_price' => array('TKT_price', false), |
|
| 60 | - ); |
|
| 61 | - |
|
| 62 | - $this->_hidden_columns = array(); |
|
| 63 | - } |
|
| 64 | - |
|
| 65 | - |
|
| 66 | - protected function _get_table_filters() |
|
| 67 | - { |
|
| 68 | - } |
|
| 69 | - |
|
| 70 | - |
|
| 71 | - protected function _add_view_counts() |
|
| 72 | - { |
|
| 73 | - $this->_views['all']['count'] = $this->_all_data_count; |
|
| 74 | - if (EE_Registry::instance()->CAP->current_user_can('ee_delete_default_tickets', 'trash_ticket')) { |
|
| 75 | - $this->_views['trashed']['count'] = $this->_trashed_count; |
|
| 76 | - } |
|
| 77 | - } |
|
| 78 | - |
|
| 79 | - |
|
| 80 | - public function column_cb($item) |
|
| 81 | - { |
|
| 82 | - return $item->ID() === 1 |
|
| 83 | - ? '<span class="ee-lock-icon"></span>' |
|
| 84 | - : sprintf( |
|
| 85 | - '<input type="checkbox" name="checkbox[%1$s]" value="%1$s" />', |
|
| 86 | - $item->ID() |
|
| 87 | - ); |
|
| 88 | - } |
|
| 89 | - |
|
| 90 | - |
|
| 91 | - public function column_TKT_name($item) |
|
| 92 | - { |
|
| 93 | - // build row actions |
|
| 94 | - $actions = array(); |
|
| 95 | - |
|
| 96 | - // trash links |
|
| 97 | - if ($item->ID() !== 1) { |
|
| 98 | - if ($this->_view == 'all') { |
|
| 99 | - $trash_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array( |
|
| 100 | - 'action' => 'trash_ticket', |
|
| 101 | - 'TKT_ID' => $item->ID(), |
|
| 102 | - ), TICKETS_ADMIN_URL); |
|
| 103 | - $actions['trash'] = '<a href="' . $trash_lnk_url . '" title="' |
|
| 104 | - . esc_attr__('Move Ticket to trash', 'event_espresso') . '">' |
|
| 105 | - . __('Trash', 'event_espresso') . '</a>'; |
|
| 106 | - } else { |
|
| 107 | - // restore price link |
|
| 108 | - $restore_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array( |
|
| 109 | - 'action' => 'restore_ticket', |
|
| 110 | - 'TKT_ID' => $item->ID(), |
|
| 111 | - ), TICKETS_ADMIN_URL); |
|
| 112 | - $actions['restore'] = '<a href="' . $restore_lnk_url . '" title="' |
|
| 113 | - . esc_attr__('Restore Ticket', 'event_espresso') . '">' |
|
| 114 | - . __('Restore', 'event_espresso') . '</a>'; |
|
| 115 | - // delete price link |
|
| 116 | - $delete_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array( |
|
| 117 | - 'action' => 'delete_ticket', |
|
| 118 | - 'TKT_ID' => $item->ID(), |
|
| 119 | - ), TICKETS_ADMIN_URL); |
|
| 120 | - $actions['delete'] = '<a href="' . $delete_lnk_url . '" title="' |
|
| 121 | - . esc_attr__('Delete Ticket Permanently', 'event_espresso') . '">' |
|
| 122 | - . __('Delete Permanently', 'event_espresso') . '</a>'; |
|
| 123 | - } |
|
| 124 | - } |
|
| 125 | - |
|
| 126 | - return $item->get('TKT_name') . $this->row_actions($actions); |
|
| 127 | - } |
|
| 128 | - |
|
| 129 | - |
|
| 130 | - public function column_TKT_description($item) |
|
| 131 | - { |
|
| 132 | - return $item->get('TKT_description'); |
|
| 133 | - } |
|
| 134 | - |
|
| 135 | - |
|
| 136 | - public function column_TKT_qty($item) |
|
| 137 | - { |
|
| 138 | - return $item->get_pretty('TKT_qty', 'text'); |
|
| 139 | - } |
|
| 140 | - |
|
| 141 | - |
|
| 142 | - public function column_TKT_uses($item) |
|
| 143 | - { |
|
| 144 | - return $item->get_pretty('TKT_uses', 'text'); |
|
| 145 | - } |
|
| 146 | - |
|
| 147 | - |
|
| 148 | - public function column_TKT_min($item) |
|
| 149 | - { |
|
| 150 | - return $item->get('TKT_min'); |
|
| 151 | - } |
|
| 152 | - |
|
| 153 | - |
|
| 154 | - public function column_TKT_max($item) |
|
| 155 | - { |
|
| 156 | - return $item->get_pretty('TKT_max', 'text'); |
|
| 157 | - } |
|
| 158 | - |
|
| 159 | - |
|
| 160 | - public function column_TKT_price($item) |
|
| 161 | - { |
|
| 162 | - return EEH_Template::format_currency($item->get('TKT_price')); |
|
| 163 | - } |
|
| 164 | - |
|
| 165 | - |
|
| 166 | - public function column_TKT_taxable($item) |
|
| 167 | - { |
|
| 168 | - return $item->get('TKT_taxable') ? __('Yes', 'event_espresso') : __('No', 'event_espresso'); |
|
| 169 | - } |
|
| 21 | + protected function _setup_data() |
|
| 22 | + { |
|
| 23 | + $trashed = $this->_admin_page->get_view() == 'trashed' ? true : false; |
|
| 24 | + $this->_data = $this->_admin_page->get_default_tickets($this->_per_page, false, $trashed); |
|
| 25 | + $this->_all_data_count = $this->_admin_page->get_default_tickets($this->_per_page, true, false); |
|
| 26 | + $this->_trashed_count = $this->_admin_page->get_default_tickets($this->_per_page, true, true); |
|
| 27 | + } |
|
| 28 | + |
|
| 29 | + |
|
| 30 | + protected function _set_properties() |
|
| 31 | + { |
|
| 32 | + $this->_wp_list_args = array( |
|
| 33 | + 'singular' => __('ticket', 'event_espresso'), |
|
| 34 | + 'plural' => __('tickets', 'event_espresso'), |
|
| 35 | + 'ajax' => true, |
|
| 36 | + 'screen' => $this->_admin_page->get_current_screen()->id, |
|
| 37 | + ); |
|
| 38 | + |
|
| 39 | + $this->_columns = array( |
|
| 40 | + 'cb' => '<input type="checkbox" />', // Render a checkbox instead of text |
|
| 41 | + 'TKT_name' => __('Name', 'event_espresso'), |
|
| 42 | + 'TKT_description' => __('Description', 'event_espresso'), |
|
| 43 | + 'TKT_qty' => __('Quantity', 'event_espresso'), |
|
| 44 | + 'TKT_uses' => __('Uses', 'event_espresso'), |
|
| 45 | + 'TKT_min' => __('Minimum', 'event_espresso'), |
|
| 46 | + 'TKT_max' => __('Maximum', 'event_espresso'), |
|
| 47 | + 'TKT_price' => __('Price', 'event_espresso'), |
|
| 48 | + 'TKT_taxable' => __('Taxable', 'event_espresso'), |
|
| 49 | + ); |
|
| 50 | + |
|
| 51 | + $this->_sortable_columns = array( |
|
| 52 | + // TRUE means its already sorted |
|
| 53 | + 'TKT_name' => array('TKT_name', true), |
|
| 54 | + 'TKT_description' => array('TKT_description', false), |
|
| 55 | + 'TKT_qty' => array('TKT_qty', false), |
|
| 56 | + 'TKT_uses' => array('TKT_uses', false), |
|
| 57 | + 'TKT_min' => array('TKT_min', false), |
|
| 58 | + 'TKT_max' => array('TKT_max', false), |
|
| 59 | + 'TKT_price' => array('TKT_price', false), |
|
| 60 | + ); |
|
| 61 | + |
|
| 62 | + $this->_hidden_columns = array(); |
|
| 63 | + } |
|
| 64 | + |
|
| 65 | + |
|
| 66 | + protected function _get_table_filters() |
|
| 67 | + { |
|
| 68 | + } |
|
| 69 | + |
|
| 70 | + |
|
| 71 | + protected function _add_view_counts() |
|
| 72 | + { |
|
| 73 | + $this->_views['all']['count'] = $this->_all_data_count; |
|
| 74 | + if (EE_Registry::instance()->CAP->current_user_can('ee_delete_default_tickets', 'trash_ticket')) { |
|
| 75 | + $this->_views['trashed']['count'] = $this->_trashed_count; |
|
| 76 | + } |
|
| 77 | + } |
|
| 78 | + |
|
| 79 | + |
|
| 80 | + public function column_cb($item) |
|
| 81 | + { |
|
| 82 | + return $item->ID() === 1 |
|
| 83 | + ? '<span class="ee-lock-icon"></span>' |
|
| 84 | + : sprintf( |
|
| 85 | + '<input type="checkbox" name="checkbox[%1$s]" value="%1$s" />', |
|
| 86 | + $item->ID() |
|
| 87 | + ); |
|
| 88 | + } |
|
| 89 | + |
|
| 90 | + |
|
| 91 | + public function column_TKT_name($item) |
|
| 92 | + { |
|
| 93 | + // build row actions |
|
| 94 | + $actions = array(); |
|
| 95 | + |
|
| 96 | + // trash links |
|
| 97 | + if ($item->ID() !== 1) { |
|
| 98 | + if ($this->_view == 'all') { |
|
| 99 | + $trash_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array( |
|
| 100 | + 'action' => 'trash_ticket', |
|
| 101 | + 'TKT_ID' => $item->ID(), |
|
| 102 | + ), TICKETS_ADMIN_URL); |
|
| 103 | + $actions['trash'] = '<a href="' . $trash_lnk_url . '" title="' |
|
| 104 | + . esc_attr__('Move Ticket to trash', 'event_espresso') . '">' |
|
| 105 | + . __('Trash', 'event_espresso') . '</a>'; |
|
| 106 | + } else { |
|
| 107 | + // restore price link |
|
| 108 | + $restore_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array( |
|
| 109 | + 'action' => 'restore_ticket', |
|
| 110 | + 'TKT_ID' => $item->ID(), |
|
| 111 | + ), TICKETS_ADMIN_URL); |
|
| 112 | + $actions['restore'] = '<a href="' . $restore_lnk_url . '" title="' |
|
| 113 | + . esc_attr__('Restore Ticket', 'event_espresso') . '">' |
|
| 114 | + . __('Restore', 'event_espresso') . '</a>'; |
|
| 115 | + // delete price link |
|
| 116 | + $delete_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array( |
|
| 117 | + 'action' => 'delete_ticket', |
|
| 118 | + 'TKT_ID' => $item->ID(), |
|
| 119 | + ), TICKETS_ADMIN_URL); |
|
| 120 | + $actions['delete'] = '<a href="' . $delete_lnk_url . '" title="' |
|
| 121 | + . esc_attr__('Delete Ticket Permanently', 'event_espresso') . '">' |
|
| 122 | + . __('Delete Permanently', 'event_espresso') . '</a>'; |
|
| 123 | + } |
|
| 124 | + } |
|
| 125 | + |
|
| 126 | + return $item->get('TKT_name') . $this->row_actions($actions); |
|
| 127 | + } |
|
| 128 | + |
|
| 129 | + |
|
| 130 | + public function column_TKT_description($item) |
|
| 131 | + { |
|
| 132 | + return $item->get('TKT_description'); |
|
| 133 | + } |
|
| 134 | + |
|
| 135 | + |
|
| 136 | + public function column_TKT_qty($item) |
|
| 137 | + { |
|
| 138 | + return $item->get_pretty('TKT_qty', 'text'); |
|
| 139 | + } |
|
| 140 | + |
|
| 141 | + |
|
| 142 | + public function column_TKT_uses($item) |
|
| 143 | + { |
|
| 144 | + return $item->get_pretty('TKT_uses', 'text'); |
|
| 145 | + } |
|
| 146 | + |
|
| 147 | + |
|
| 148 | + public function column_TKT_min($item) |
|
| 149 | + { |
|
| 150 | + return $item->get('TKT_min'); |
|
| 151 | + } |
|
| 152 | + |
|
| 153 | + |
|
| 154 | + public function column_TKT_max($item) |
|
| 155 | + { |
|
| 156 | + return $item->get_pretty('TKT_max', 'text'); |
|
| 157 | + } |
|
| 158 | + |
|
| 159 | + |
|
| 160 | + public function column_TKT_price($item) |
|
| 161 | + { |
|
| 162 | + return EEH_Template::format_currency($item->get('TKT_price')); |
|
| 163 | + } |
|
| 164 | + |
|
| 165 | + |
|
| 166 | + public function column_TKT_taxable($item) |
|
| 167 | + { |
|
| 168 | + return $item->get('TKT_taxable') ? __('Yes', 'event_espresso') : __('No', 'event_espresso'); |
|
| 169 | + } |
|
| 170 | 170 | } |
@@ -100,30 +100,30 @@ |
||
| 100 | 100 | 'action' => 'trash_ticket', |
| 101 | 101 | 'TKT_ID' => $item->ID(), |
| 102 | 102 | ), TICKETS_ADMIN_URL); |
| 103 | - $actions['trash'] = '<a href="' . $trash_lnk_url . '" title="' |
|
| 104 | - . esc_attr__('Move Ticket to trash', 'event_espresso') . '">' |
|
| 105 | - . __('Trash', 'event_espresso') . '</a>'; |
|
| 103 | + $actions['trash'] = '<a href="'.$trash_lnk_url.'" title="' |
|
| 104 | + . esc_attr__('Move Ticket to trash', 'event_espresso').'">' |
|
| 105 | + . __('Trash', 'event_espresso').'</a>'; |
|
| 106 | 106 | } else { |
| 107 | 107 | // restore price link |
| 108 | 108 | $restore_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array( |
| 109 | 109 | 'action' => 'restore_ticket', |
| 110 | 110 | 'TKT_ID' => $item->ID(), |
| 111 | 111 | ), TICKETS_ADMIN_URL); |
| 112 | - $actions['restore'] = '<a href="' . $restore_lnk_url . '" title="' |
|
| 113 | - . esc_attr__('Restore Ticket', 'event_espresso') . '">' |
|
| 114 | - . __('Restore', 'event_espresso') . '</a>'; |
|
| 112 | + $actions['restore'] = '<a href="'.$restore_lnk_url.'" title="' |
|
| 113 | + . esc_attr__('Restore Ticket', 'event_espresso').'">' |
|
| 114 | + . __('Restore', 'event_espresso').'</a>'; |
|
| 115 | 115 | // delete price link |
| 116 | 116 | $delete_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array( |
| 117 | 117 | 'action' => 'delete_ticket', |
| 118 | 118 | 'TKT_ID' => $item->ID(), |
| 119 | 119 | ), TICKETS_ADMIN_URL); |
| 120 | - $actions['delete'] = '<a href="' . $delete_lnk_url . '" title="' |
|
| 121 | - . esc_attr__('Delete Ticket Permanently', 'event_espresso') . '">' |
|
| 122 | - . __('Delete Permanently', 'event_espresso') . '</a>'; |
|
| 120 | + $actions['delete'] = '<a href="'.$delete_lnk_url.'" title="' |
|
| 121 | + . esc_attr__('Delete Ticket Permanently', 'event_espresso').'">' |
|
| 122 | + . __('Delete Permanently', 'event_espresso').'</a>'; |
|
| 123 | 123 | } |
| 124 | 124 | } |
| 125 | 125 | |
| 126 | - return $item->get('TKT_name') . $this->row_actions($actions); |
|
| 126 | + return $item->get('TKT_name').$this->row_actions($actions); |
|
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | |
@@ -15,20 +15,20 @@ discard block |
||
| 15 | 15 | class Pricing_Edit_Default_Price_Help_Tour extends EE_Help_Tour |
| 16 | 16 | { |
| 17 | 17 | |
| 18 | - protected function _set_tour_properties() |
|
| 19 | - { |
|
| 20 | - $this->_label = __('Edit Default Price Tour', 'event_espresso'); |
|
| 21 | - $this->_slug = 'edit-default-price-joyride'; |
|
| 22 | - } |
|
| 18 | + protected function _set_tour_properties() |
|
| 19 | + { |
|
| 20 | + $this->_label = __('Edit Default Price Tour', 'event_espresso'); |
|
| 21 | + $this->_slug = 'edit-default-price-joyride'; |
|
| 22 | + } |
|
| 23 | 23 | |
| 24 | 24 | |
| 25 | - protected function _set_tour_stops() |
|
| 26 | - { |
|
| 27 | - $this->_stops = array( |
|
| 28 | - 10 => array( |
|
| 29 | - 'content' => $this->_start(), |
|
| 30 | - ), |
|
| 31 | - /*20 => array( |
|
| 25 | + protected function _set_tour_stops() |
|
| 26 | + { |
|
| 27 | + $this->_stops = array( |
|
| 28 | + 10 => array( |
|
| 29 | + 'content' => $this->_start(), |
|
| 30 | + ), |
|
| 31 | + /*20 => array( |
|
| 32 | 32 | 'id' => 'PRT_ID', |
| 33 | 33 | 'content' => $this->_price_type_stop(), |
| 34 | 34 | 'options' => array( |
@@ -37,74 +37,74 @@ discard block |
||
| 37 | 37 | 'tipAdjustmentX' => -15 |
| 38 | 38 | ) |
| 39 | 39 | ),*/ |
| 40 | - 30 => array( |
|
| 41 | - 'id' => 'PRC_name', |
|
| 42 | - 'content' => $this->_price_name_stop(), |
|
| 43 | - 'options' => array( |
|
| 44 | - 'tipLocation' => 'top', |
|
| 45 | - 'tipAdjustmentY' => -40, |
|
| 46 | - ), |
|
| 47 | - ), |
|
| 48 | - 40 => array( |
|
| 49 | - 'id' => 'PRC_desc', |
|
| 50 | - 'content' => $this->_price_description_stop(), |
|
| 51 | - 'options' => array( |
|
| 52 | - 'tipLocation' => 'top', |
|
| 53 | - 'tipAdjustmentY' => -40, |
|
| 54 | - ), |
|
| 55 | - ), |
|
| 56 | - 50 => array( |
|
| 57 | - 'id' => 'PRC_amount', |
|
| 58 | - 'content' => $this->_price_amount_stop(), |
|
| 59 | - 'options' => array( |
|
| 60 | - 'tipLocation' => 'top', |
|
| 61 | - 'tipAdjustmentY' => -40, |
|
| 62 | - ), |
|
| 63 | - ), |
|
| 64 | - ); |
|
| 65 | - } |
|
| 40 | + 30 => array( |
|
| 41 | + 'id' => 'PRC_name', |
|
| 42 | + 'content' => $this->_price_name_stop(), |
|
| 43 | + 'options' => array( |
|
| 44 | + 'tipLocation' => 'top', |
|
| 45 | + 'tipAdjustmentY' => -40, |
|
| 46 | + ), |
|
| 47 | + ), |
|
| 48 | + 40 => array( |
|
| 49 | + 'id' => 'PRC_desc', |
|
| 50 | + 'content' => $this->_price_description_stop(), |
|
| 51 | + 'options' => array( |
|
| 52 | + 'tipLocation' => 'top', |
|
| 53 | + 'tipAdjustmentY' => -40, |
|
| 54 | + ), |
|
| 55 | + ), |
|
| 56 | + 50 => array( |
|
| 57 | + 'id' => 'PRC_amount', |
|
| 58 | + 'content' => $this->_price_amount_stop(), |
|
| 59 | + 'options' => array( |
|
| 60 | + 'tipLocation' => 'top', |
|
| 61 | + 'tipAdjustmentY' => -40, |
|
| 62 | + ), |
|
| 63 | + ), |
|
| 64 | + ); |
|
| 65 | + } |
|
| 66 | 66 | |
| 67 | 67 | |
| 68 | - protected function _start() |
|
| 69 | - { |
|
| 70 | - $content = '<h3>' . __('Edit Default Price', 'event_espresso') . '</h3>'; |
|
| 71 | - $content .= '<p>' |
|
| 72 | - . __( |
|
| 73 | - 'This tour of the Edit Default Price page will go over different areas of the screen to help you understand what they are used for.', |
|
| 74 | - 'event_espresso' |
|
| 75 | - ) . '</p>'; |
|
| 76 | - return $content; |
|
| 77 | - } |
|
| 68 | + protected function _start() |
|
| 69 | + { |
|
| 70 | + $content = '<h3>' . __('Edit Default Price', 'event_espresso') . '</h3>'; |
|
| 71 | + $content .= '<p>' |
|
| 72 | + . __( |
|
| 73 | + 'This tour of the Edit Default Price page will go over different areas of the screen to help you understand what they are used for.', |
|
| 74 | + 'event_espresso' |
|
| 75 | + ) . '</p>'; |
|
| 76 | + return $content; |
|
| 77 | + } |
|
| 78 | 78 | |
| 79 | - protected function _price_type_stop() |
|
| 80 | - { |
|
| 81 | - return '<p>' |
|
| 82 | - . __( |
|
| 83 | - 'Price Types are a way of categorizing a price, discount, tax, or surcharge and indicating how it gets applied to a running total when a transaction occurs.', |
|
| 84 | - 'event_espresso' |
|
| 85 | - ) . '</p>'; |
|
| 86 | - } |
|
| 79 | + protected function _price_type_stop() |
|
| 80 | + { |
|
| 81 | + return '<p>' |
|
| 82 | + . __( |
|
| 83 | + 'Price Types are a way of categorizing a price, discount, tax, or surcharge and indicating how it gets applied to a running total when a transaction occurs.', |
|
| 84 | + 'event_espresso' |
|
| 85 | + ) . '</p>'; |
|
| 86 | + } |
|
| 87 | 87 | |
| 88 | - protected function _price_name_stop() |
|
| 89 | - { |
|
| 90 | - return '<p>' |
|
| 91 | - . __( |
|
| 92 | - 'The name of the price, discount, tax, or surcharge that will be seen by your customers.', |
|
| 93 | - 'event_espresso' |
|
| 94 | - ) . '</p>'; |
|
| 95 | - } |
|
| 88 | + protected function _price_name_stop() |
|
| 89 | + { |
|
| 90 | + return '<p>' |
|
| 91 | + . __( |
|
| 92 | + 'The name of the price, discount, tax, or surcharge that will be seen by your customers.', |
|
| 93 | + 'event_espresso' |
|
| 94 | + ) . '</p>'; |
|
| 95 | + } |
|
| 96 | 96 | |
| 97 | - protected function _price_description_stop() |
|
| 98 | - { |
|
| 99 | - return '<p>' |
|
| 100 | - . __( |
|
| 101 | - 'View the price type (price, discount, tax or surcharge) description.', |
|
| 102 | - 'event_espresso' |
|
| 103 | - ) . '</p>'; |
|
| 104 | - } |
|
| 97 | + protected function _price_description_stop() |
|
| 98 | + { |
|
| 99 | + return '<p>' |
|
| 100 | + . __( |
|
| 101 | + 'View the price type (price, discount, tax or surcharge) description.', |
|
| 102 | + 'event_espresso' |
|
| 103 | + ) . '</p>'; |
|
| 104 | + } |
|
| 105 | 105 | |
| 106 | - protected function _price_amount_stop() |
|
| 107 | - { |
|
| 108 | - return '<p>' . __('The ticket amount before any deductions.', 'event_espresso') . '</p>'; |
|
| 109 | - } |
|
| 106 | + protected function _price_amount_stop() |
|
| 107 | + { |
|
| 108 | + return '<p>' . __('The ticket amount before any deductions.', 'event_espresso') . '</p>'; |
|
| 109 | + } |
|
| 110 | 110 | } |
@@ -67,12 +67,12 @@ discard block |
||
| 67 | 67 | |
| 68 | 68 | protected function _start() |
| 69 | 69 | { |
| 70 | - $content = '<h3>' . __('Edit Default Price', 'event_espresso') . '</h3>'; |
|
| 70 | + $content = '<h3>'.__('Edit Default Price', 'event_espresso').'</h3>'; |
|
| 71 | 71 | $content .= '<p>' |
| 72 | 72 | . __( |
| 73 | 73 | 'This tour of the Edit Default Price page will go over different areas of the screen to help you understand what they are used for.', |
| 74 | 74 | 'event_espresso' |
| 75 | - ) . '</p>'; |
|
| 75 | + ).'</p>'; |
|
| 76 | 76 | return $content; |
| 77 | 77 | } |
| 78 | 78 | |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | . __( |
| 83 | 83 | 'Price Types are a way of categorizing a price, discount, tax, or surcharge and indicating how it gets applied to a running total when a transaction occurs.', |
| 84 | 84 | 'event_espresso' |
| 85 | - ) . '</p>'; |
|
| 85 | + ).'</p>'; |
|
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | protected function _price_name_stop() |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | . __( |
| 92 | 92 | 'The name of the price, discount, tax, or surcharge that will be seen by your customers.', |
| 93 | 93 | 'event_espresso' |
| 94 | - ) . '</p>'; |
|
| 94 | + ).'</p>'; |
|
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | protected function _price_description_stop() |
@@ -100,11 +100,11 @@ discard block |
||
| 100 | 100 | . __( |
| 101 | 101 | 'View the price type (price, discount, tax or surcharge) description.', |
| 102 | 102 | 'event_espresso' |
| 103 | - ) . '</p>'; |
|
| 103 | + ).'</p>'; |
|
| 104 | 104 | } |
| 105 | 105 | |
| 106 | 106 | protected function _price_amount_stop() |
| 107 | 107 | { |
| 108 | - return '<p>' . __('The ticket amount before any deductions.', 'event_espresso') . '</p>'; |
|
| 108 | + return '<p>'.__('The ticket amount before any deductions.', 'event_espresso').'</p>'; |
|
| 109 | 109 | } |
| 110 | 110 | } |
@@ -15,84 +15,84 @@ |
||
| 15 | 15 | class Pricing_Add_New_Price_Type_Help_Tour extends EE_Help_Tour |
| 16 | 16 | { |
| 17 | 17 | |
| 18 | - protected function _set_tour_properties() |
|
| 19 | - { |
|
| 20 | - $this->_label = __('Add New Price Type Tour', 'event_espresso'); |
|
| 21 | - $this->_slug = 'add-new-price-type-joyride'; |
|
| 22 | - } |
|
| 18 | + protected function _set_tour_properties() |
|
| 19 | + { |
|
| 20 | + $this->_label = __('Add New Price Type Tour', 'event_espresso'); |
|
| 21 | + $this->_slug = 'add-new-price-type-joyride'; |
|
| 22 | + } |
|
| 23 | 23 | |
| 24 | 24 | |
| 25 | - protected function _set_tour_stops() |
|
| 26 | - { |
|
| 27 | - $this->_stops = array( |
|
| 28 | - 10 => array( |
|
| 29 | - 'content' => $this->_start(), |
|
| 30 | - ), |
|
| 31 | - 20 => array( |
|
| 32 | - 'id' => 'base_type', |
|
| 33 | - 'content' => $this->_basic_type_stop(), |
|
| 34 | - 'options' => array( |
|
| 35 | - 'tipLocation' => 'top', |
|
| 36 | - 'tipAdjustmentY' => -50, |
|
| 37 | - 'tipAdjustmentX' => -15, |
|
| 38 | - ), |
|
| 39 | - ), |
|
| 40 | - 30 => array( |
|
| 41 | - 'id' => 'PRT_name', |
|
| 42 | - 'content' => $this->_price_type_name_stop(), |
|
| 43 | - 'options' => array( |
|
| 44 | - 'tipLocation' => 'top', |
|
| 45 | - 'tipAdjustmentY' => -40, |
|
| 46 | - ), |
|
| 47 | - ), |
|
| 48 | - 40 => array( |
|
| 49 | - 'id' => 'PRT_name', |
|
| 50 | - 'content' => $this->_percentage_dollar_amount_stop(), |
|
| 51 | - 'options' => array( |
|
| 52 | - 'tipLocation' => 'top', |
|
| 53 | - 'tipAdjustmentY' => 45, |
|
| 54 | - ), |
|
| 55 | - ), |
|
| 56 | - 50 => array( |
|
| 57 | - 'id' => 'PRT_order', |
|
| 58 | - 'content' => $this->_order_of_application_stop(), |
|
| 59 | - 'options' => array( |
|
| 60 | - 'tipLocation' => 'top', |
|
| 61 | - 'tipAdjustmentY' => -40, |
|
| 62 | - ), |
|
| 63 | - ), |
|
| 64 | - ); |
|
| 65 | - } |
|
| 25 | + protected function _set_tour_stops() |
|
| 26 | + { |
|
| 27 | + $this->_stops = array( |
|
| 28 | + 10 => array( |
|
| 29 | + 'content' => $this->_start(), |
|
| 30 | + ), |
|
| 31 | + 20 => array( |
|
| 32 | + 'id' => 'base_type', |
|
| 33 | + 'content' => $this->_basic_type_stop(), |
|
| 34 | + 'options' => array( |
|
| 35 | + 'tipLocation' => 'top', |
|
| 36 | + 'tipAdjustmentY' => -50, |
|
| 37 | + 'tipAdjustmentX' => -15, |
|
| 38 | + ), |
|
| 39 | + ), |
|
| 40 | + 30 => array( |
|
| 41 | + 'id' => 'PRT_name', |
|
| 42 | + 'content' => $this->_price_type_name_stop(), |
|
| 43 | + 'options' => array( |
|
| 44 | + 'tipLocation' => 'top', |
|
| 45 | + 'tipAdjustmentY' => -40, |
|
| 46 | + ), |
|
| 47 | + ), |
|
| 48 | + 40 => array( |
|
| 49 | + 'id' => 'PRT_name', |
|
| 50 | + 'content' => $this->_percentage_dollar_amount_stop(), |
|
| 51 | + 'options' => array( |
|
| 52 | + 'tipLocation' => 'top', |
|
| 53 | + 'tipAdjustmentY' => 45, |
|
| 54 | + ), |
|
| 55 | + ), |
|
| 56 | + 50 => array( |
|
| 57 | + 'id' => 'PRT_order', |
|
| 58 | + 'content' => $this->_order_of_application_stop(), |
|
| 59 | + 'options' => array( |
|
| 60 | + 'tipLocation' => 'top', |
|
| 61 | + 'tipAdjustmentY' => -40, |
|
| 62 | + ), |
|
| 63 | + ), |
|
| 64 | + ); |
|
| 65 | + } |
|
| 66 | 66 | |
| 67 | 67 | |
| 68 | - protected function _start() |
|
| 69 | - { |
|
| 70 | - $content = '<h3>' . __('Add New Price Type', 'event_espresso') . '</h3>'; |
|
| 71 | - $content .= '<p>' |
|
| 72 | - . __( |
|
| 73 | - 'This tour of the Add New Price Type page will go over different areas of the screen to help you understand what they are used for.', |
|
| 74 | - 'event_espresso' |
|
| 75 | - ) . '</p>'; |
|
| 76 | - return $content; |
|
| 77 | - } |
|
| 68 | + protected function _start() |
|
| 69 | + { |
|
| 70 | + $content = '<h3>' . __('Add New Price Type', 'event_espresso') . '</h3>'; |
|
| 71 | + $content .= '<p>' |
|
| 72 | + . __( |
|
| 73 | + 'This tour of the Add New Price Type page will go over different areas of the screen to help you understand what they are used for.', |
|
| 74 | + 'event_espresso' |
|
| 75 | + ) . '</p>'; |
|
| 76 | + return $content; |
|
| 77 | + } |
|
| 78 | 78 | |
| 79 | - protected function _basic_type_stop() |
|
| 80 | - { |
|
| 81 | - return '<p>' . __('Set a price type to be a discount, surcharge, or tax.', 'event_espresso') . '</p>'; |
|
| 82 | - } |
|
| 79 | + protected function _basic_type_stop() |
|
| 80 | + { |
|
| 81 | + return '<p>' . __('Set a price type to be a discount, surcharge, or tax.', 'event_espresso') . '</p>'; |
|
| 82 | + } |
|
| 83 | 83 | |
| 84 | - protected function _price_type_name_stop() |
|
| 85 | - { |
|
| 86 | - return '<p>' . __('The name of the price type.', 'event_espresso') . '</p>'; |
|
| 87 | - } |
|
| 84 | + protected function _price_type_name_stop() |
|
| 85 | + { |
|
| 86 | + return '<p>' . __('The name of the price type.', 'event_espresso') . '</p>'; |
|
| 87 | + } |
|
| 88 | 88 | |
| 89 | - protected function _percentage_dollar_amount_stop() |
|
| 90 | - { |
|
| 91 | - return '<p>' . __('Set a price type to be percentage-based or a fixed amount.', 'event_espresso') . '</p>'; |
|
| 92 | - } |
|
| 89 | + protected function _percentage_dollar_amount_stop() |
|
| 90 | + { |
|
| 91 | + return '<p>' . __('Set a price type to be percentage-based or a fixed amount.', 'event_espresso') . '</p>'; |
|
| 92 | + } |
|
| 93 | 93 | |
| 94 | - protected function _order_of_application_stop() |
|
| 95 | - { |
|
| 96 | - return '<p>' . __('Set the order of application for a price type.', 'event_espresso') . '</p>'; |
|
| 97 | - } |
|
| 94 | + protected function _order_of_application_stop() |
|
| 95 | + { |
|
| 96 | + return '<p>' . __('Set the order of application for a price type.', 'event_espresso') . '</p>'; |
|
| 97 | + } |
|
| 98 | 98 | } |
@@ -67,32 +67,32 @@ |
||
| 67 | 67 | |
| 68 | 68 | protected function _start() |
| 69 | 69 | { |
| 70 | - $content = '<h3>' . __('Add New Price Type', 'event_espresso') . '</h3>'; |
|
| 70 | + $content = '<h3>'.__('Add New Price Type', 'event_espresso').'</h3>'; |
|
| 71 | 71 | $content .= '<p>' |
| 72 | 72 | . __( |
| 73 | 73 | 'This tour of the Add New Price Type page will go over different areas of the screen to help you understand what they are used for.', |
| 74 | 74 | 'event_espresso' |
| 75 | - ) . '</p>'; |
|
| 75 | + ).'</p>'; |
|
| 76 | 76 | return $content; |
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | protected function _basic_type_stop() |
| 80 | 80 | { |
| 81 | - return '<p>' . __('Set a price type to be a discount, surcharge, or tax.', 'event_espresso') . '</p>'; |
|
| 81 | + return '<p>'.__('Set a price type to be a discount, surcharge, or tax.', 'event_espresso').'</p>'; |
|
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | protected function _price_type_name_stop() |
| 85 | 85 | { |
| 86 | - return '<p>' . __('The name of the price type.', 'event_espresso') . '</p>'; |
|
| 86 | + return '<p>'.__('The name of the price type.', 'event_espresso').'</p>'; |
|
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | protected function _percentage_dollar_amount_stop() |
| 90 | 90 | { |
| 91 | - return '<p>' . __('Set a price type to be percentage-based or a fixed amount.', 'event_espresso') . '</p>'; |
|
| 91 | + return '<p>'.__('Set a price type to be percentage-based or a fixed amount.', 'event_espresso').'</p>'; |
|
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | protected function _order_of_application_stop() |
| 95 | 95 | { |
| 96 | - return '<p>' . __('Set the order of application for a price type.', 'event_espresso') . '</p>'; |
|
| 96 | + return '<p>'.__('Set the order of application for a price type.', 'event_espresso').'</p>'; |
|
| 97 | 97 | } |
| 98 | 98 | } |
@@ -15,96 +15,96 @@ |
||
| 15 | 15 | class Pricing_Add_New_Default_Price_Help_Tour extends EE_Help_Tour |
| 16 | 16 | { |
| 17 | 17 | |
| 18 | - protected function _set_tour_properties() |
|
| 19 | - { |
|
| 20 | - $this->_label = __('Add New Default Price Tour', 'event_espresso'); |
|
| 21 | - $this->_slug = 'add-new-default-price-joyride'; |
|
| 22 | - } |
|
| 18 | + protected function _set_tour_properties() |
|
| 19 | + { |
|
| 20 | + $this->_label = __('Add New Default Price Tour', 'event_espresso'); |
|
| 21 | + $this->_slug = 'add-new-default-price-joyride'; |
|
| 22 | + } |
|
| 23 | 23 | |
| 24 | 24 | |
| 25 | - protected function _set_tour_stops() |
|
| 26 | - { |
|
| 27 | - $this->_stops = array( |
|
| 28 | - 10 => array( |
|
| 29 | - 'content' => $this->_start(), |
|
| 30 | - ), |
|
| 31 | - 20 => array( |
|
| 32 | - 'id' => 'PRT_ID', |
|
| 33 | - 'content' => $this->_price_type_stop(), |
|
| 34 | - 'options' => array( |
|
| 35 | - 'tipLocation' => 'top', |
|
| 36 | - 'tipAdjustmentY' => -50, |
|
| 37 | - 'tipAdjustmentX' => -15, |
|
| 38 | - ), |
|
| 39 | - ), |
|
| 40 | - 30 => array( |
|
| 41 | - 'id' => 'PRC_name', |
|
| 42 | - 'content' => $this->_price_name_stop(), |
|
| 43 | - 'options' => array( |
|
| 44 | - 'tipLocation' => 'top', |
|
| 45 | - 'tipAdjustmentY' => -40, |
|
| 46 | - ), |
|
| 47 | - ), |
|
| 48 | - 40 => array( |
|
| 49 | - 'id' => 'PRC_desc', |
|
| 50 | - 'content' => $this->_price_description_stop(), |
|
| 51 | - 'options' => array( |
|
| 52 | - 'tipLocation' => 'top', |
|
| 53 | - 'tipAdjustmentY' => -40, |
|
| 54 | - ), |
|
| 55 | - ), |
|
| 56 | - 50 => array( |
|
| 57 | - 'id' => 'PRC_amount', |
|
| 58 | - 'content' => $this->_price_amount_stop(), |
|
| 59 | - 'options' => array( |
|
| 60 | - 'tipLocation' => 'top', |
|
| 61 | - 'tipAdjustmentY' => -40, |
|
| 62 | - ), |
|
| 63 | - ), |
|
| 64 | - ); |
|
| 65 | - } |
|
| 25 | + protected function _set_tour_stops() |
|
| 26 | + { |
|
| 27 | + $this->_stops = array( |
|
| 28 | + 10 => array( |
|
| 29 | + 'content' => $this->_start(), |
|
| 30 | + ), |
|
| 31 | + 20 => array( |
|
| 32 | + 'id' => 'PRT_ID', |
|
| 33 | + 'content' => $this->_price_type_stop(), |
|
| 34 | + 'options' => array( |
|
| 35 | + 'tipLocation' => 'top', |
|
| 36 | + 'tipAdjustmentY' => -50, |
|
| 37 | + 'tipAdjustmentX' => -15, |
|
| 38 | + ), |
|
| 39 | + ), |
|
| 40 | + 30 => array( |
|
| 41 | + 'id' => 'PRC_name', |
|
| 42 | + 'content' => $this->_price_name_stop(), |
|
| 43 | + 'options' => array( |
|
| 44 | + 'tipLocation' => 'top', |
|
| 45 | + 'tipAdjustmentY' => -40, |
|
| 46 | + ), |
|
| 47 | + ), |
|
| 48 | + 40 => array( |
|
| 49 | + 'id' => 'PRC_desc', |
|
| 50 | + 'content' => $this->_price_description_stop(), |
|
| 51 | + 'options' => array( |
|
| 52 | + 'tipLocation' => 'top', |
|
| 53 | + 'tipAdjustmentY' => -40, |
|
| 54 | + ), |
|
| 55 | + ), |
|
| 56 | + 50 => array( |
|
| 57 | + 'id' => 'PRC_amount', |
|
| 58 | + 'content' => $this->_price_amount_stop(), |
|
| 59 | + 'options' => array( |
|
| 60 | + 'tipLocation' => 'top', |
|
| 61 | + 'tipAdjustmentY' => -40, |
|
| 62 | + ), |
|
| 63 | + ), |
|
| 64 | + ); |
|
| 65 | + } |
|
| 66 | 66 | |
| 67 | 67 | |
| 68 | - protected function _start() |
|
| 69 | - { |
|
| 70 | - $content = '<h3>' . __('Add New Default Price', 'event_espresso') . '</h3>'; |
|
| 71 | - $content .= '<p>' |
|
| 72 | - . __( |
|
| 73 | - 'This tour of the add new default price page will go over different areas of the screen to help you understand what they are used for.', |
|
| 74 | - 'event_espresso' |
|
| 75 | - ) . '</p>'; |
|
| 76 | - return $content; |
|
| 77 | - } |
|
| 68 | + protected function _start() |
|
| 69 | + { |
|
| 70 | + $content = '<h3>' . __('Add New Default Price', 'event_espresso') . '</h3>'; |
|
| 71 | + $content .= '<p>' |
|
| 72 | + . __( |
|
| 73 | + 'This tour of the add new default price page will go over different areas of the screen to help you understand what they are used for.', |
|
| 74 | + 'event_espresso' |
|
| 75 | + ) . '</p>'; |
|
| 76 | + return $content; |
|
| 77 | + } |
|
| 78 | 78 | |
| 79 | - protected function _price_type_stop() |
|
| 80 | - { |
|
| 81 | - return '<p>' |
|
| 82 | - . __( |
|
| 83 | - 'Price Types are a way of categorizing a price, discount, tax, or surcharge and indicating how it gets applied to a running total when a transaction occurs.', |
|
| 84 | - 'event_espresso' |
|
| 85 | - ) . '</p>'; |
|
| 86 | - } |
|
| 79 | + protected function _price_type_stop() |
|
| 80 | + { |
|
| 81 | + return '<p>' |
|
| 82 | + . __( |
|
| 83 | + 'Price Types are a way of categorizing a price, discount, tax, or surcharge and indicating how it gets applied to a running total when a transaction occurs.', |
|
| 84 | + 'event_espresso' |
|
| 85 | + ) . '</p>'; |
|
| 86 | + } |
|
| 87 | 87 | |
| 88 | - protected function _price_name_stop() |
|
| 89 | - { |
|
| 90 | - return '<p>' |
|
| 91 | - . __( |
|
| 92 | - 'The name of the price, discount, tax, or surcharge that will be seen by your customers.', |
|
| 93 | - 'event_espresso' |
|
| 94 | - ) . '</p>'; |
|
| 95 | - } |
|
| 88 | + protected function _price_name_stop() |
|
| 89 | + { |
|
| 90 | + return '<p>' |
|
| 91 | + . __( |
|
| 92 | + 'The name of the price, discount, tax, or surcharge that will be seen by your customers.', |
|
| 93 | + 'event_espresso' |
|
| 94 | + ) . '</p>'; |
|
| 95 | + } |
|
| 96 | 96 | |
| 97 | - protected function _price_description_stop() |
|
| 98 | - { |
|
| 99 | - return '<p>' |
|
| 100 | - . __( |
|
| 101 | - 'View the price type (price, discount, tax or surcharge) description.', |
|
| 102 | - 'event_espresso' |
|
| 103 | - ) . '</p>'; |
|
| 104 | - } |
|
| 97 | + protected function _price_description_stop() |
|
| 98 | + { |
|
| 99 | + return '<p>' |
|
| 100 | + . __( |
|
| 101 | + 'View the price type (price, discount, tax or surcharge) description.', |
|
| 102 | + 'event_espresso' |
|
| 103 | + ) . '</p>'; |
|
| 104 | + } |
|
| 105 | 105 | |
| 106 | - protected function _price_amount_stop() |
|
| 107 | - { |
|
| 108 | - return '<p>' . __('The ticket amount before any deductions.', 'event_espresso') . '</p>'; |
|
| 109 | - } |
|
| 106 | + protected function _price_amount_stop() |
|
| 107 | + { |
|
| 108 | + return '<p>' . __('The ticket amount before any deductions.', 'event_espresso') . '</p>'; |
|
| 109 | + } |
|
| 110 | 110 | } |
@@ -67,12 +67,12 @@ discard block |
||
| 67 | 67 | |
| 68 | 68 | protected function _start() |
| 69 | 69 | { |
| 70 | - $content = '<h3>' . __('Add New Default Price', 'event_espresso') . '</h3>'; |
|
| 70 | + $content = '<h3>'.__('Add New Default Price', 'event_espresso').'</h3>'; |
|
| 71 | 71 | $content .= '<p>' |
| 72 | 72 | . __( |
| 73 | 73 | 'This tour of the add new default price page will go over different areas of the screen to help you understand what they are used for.', |
| 74 | 74 | 'event_espresso' |
| 75 | - ) . '</p>'; |
|
| 75 | + ).'</p>'; |
|
| 76 | 76 | return $content; |
| 77 | 77 | } |
| 78 | 78 | |
@@ -82,7 +82,7 @@ discard block |
||
| 82 | 82 | . __( |
| 83 | 83 | 'Price Types are a way of categorizing a price, discount, tax, or surcharge and indicating how it gets applied to a running total when a transaction occurs.', |
| 84 | 84 | 'event_espresso' |
| 85 | - ) . '</p>'; |
|
| 85 | + ).'</p>'; |
|
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | protected function _price_name_stop() |
@@ -91,7 +91,7 @@ discard block |
||
| 91 | 91 | . __( |
| 92 | 92 | 'The name of the price, discount, tax, or surcharge that will be seen by your customers.', |
| 93 | 93 | 'event_espresso' |
| 94 | - ) . '</p>'; |
|
| 94 | + ).'</p>'; |
|
| 95 | 95 | } |
| 96 | 96 | |
| 97 | 97 | protected function _price_description_stop() |
@@ -100,11 +100,11 @@ discard block |
||
| 100 | 100 | . __( |
| 101 | 101 | 'View the price type (price, discount, tax or surcharge) description.', |
| 102 | 102 | 'event_espresso' |
| 103 | - ) . '</p>'; |
|
| 103 | + ).'</p>'; |
|
| 104 | 104 | } |
| 105 | 105 | |
| 106 | 106 | protected function _price_amount_stop() |
| 107 | 107 | { |
| 108 | - return '<p>' . __('The ticket amount before any deductions.', 'event_espresso') . '</p>'; |
|
| 108 | + return '<p>'.__('The ticket amount before any deductions.', 'event_espresso').'</p>'; |
|
| 109 | 109 | } |
| 110 | 110 | } |
@@ -15,135 +15,135 @@ |
||
| 15 | 15 | class Pricing_Default_Prices_Help_Tour extends EE_Help_Tour |
| 16 | 16 | { |
| 17 | 17 | |
| 18 | - protected function _set_tour_properties() |
|
| 19 | - { |
|
| 20 | - $this->_label = __('Default Pricing Tour', 'event_espresso'); |
|
| 21 | - $this->_slug = 'default-prices-joyride'; |
|
| 22 | - } |
|
| 18 | + protected function _set_tour_properties() |
|
| 19 | + { |
|
| 20 | + $this->_label = __('Default Pricing Tour', 'event_espresso'); |
|
| 21 | + $this->_slug = 'default-prices-joyride'; |
|
| 22 | + } |
|
| 23 | 23 | |
| 24 | 24 | |
| 25 | - protected function _set_tour_stops() |
|
| 26 | - { |
|
| 27 | - $this->_stops = array( |
|
| 28 | - 10 => array( |
|
| 29 | - 'content' => $this->_start(), |
|
| 30 | - ), |
|
| 31 | - 20 => array( |
|
| 32 | - 'id' => 'name', |
|
| 33 | - 'content' => $this->_name_column_stop(), |
|
| 34 | - 'options' => array( |
|
| 35 | - 'tipLocation' => 'top', |
|
| 36 | - 'tipAdjustmentX' => -5, |
|
| 37 | - 'tipAdjustmentY' => -30, |
|
| 38 | - ), |
|
| 39 | - ), |
|
| 40 | - 30 => array( |
|
| 41 | - 'id' => 'type', |
|
| 42 | - 'content' => $this->_type_column_stop(), |
|
| 43 | - 'options' => array( |
|
| 44 | - 'tipLocation' => 'top', |
|
| 45 | - 'tipAdjustmentX' => 5, |
|
| 46 | - 'tipAdjustmentY' => -30, |
|
| 47 | - ), |
|
| 48 | - ), |
|
| 49 | - 40 => array( |
|
| 50 | - 'id' => 'description', |
|
| 51 | - 'content' => $this->_description_column_stop(), |
|
| 52 | - 'options' => array( |
|
| 53 | - 'tipLocation' => 'top', |
|
| 54 | - 'tipAdjustmentX' => 5, |
|
| 55 | - 'tipAdjustmentY' => -30, |
|
| 56 | - ), |
|
| 57 | - ), |
|
| 58 | - 50 => array( |
|
| 59 | - 'id' => 'amount', |
|
| 60 | - 'content' => $this->_amount_column_stop(), |
|
| 61 | - 'options' => array( |
|
| 62 | - 'tipLocation' => 'left', |
|
| 63 | - 'tipAdjustmentY' => -50, |
|
| 64 | - 'tipAdjustmentX' => 20, |
|
| 65 | - ), |
|
| 66 | - ), |
|
| 67 | - 60 => array( |
|
| 68 | - 'class' => 'bulkactions', |
|
| 69 | - 'content' => $this->_bulk_actions_stop(), |
|
| 70 | - 'options' => array( |
|
| 71 | - 'tipLocation' => 'left', |
|
| 72 | - 'tipAdjustmentY' => -50, |
|
| 73 | - 'tipAdjustmentX' => -75, |
|
| 74 | - ), |
|
| 75 | - ), |
|
| 76 | - 70 => array( |
|
| 77 | - 'id' => 'event-espresso_page_pricing-search-input', |
|
| 78 | - 'content' => $this->_search_stop(), |
|
| 79 | - 'options' => array( |
|
| 80 | - 'tipLocation' => 'left', |
|
| 81 | - 'tipAdjustmentY' => -50, |
|
| 82 | - 'tipAdjustmentX' => -15, |
|
| 83 | - ), |
|
| 84 | - ), |
|
| 85 | - ); |
|
| 86 | - } |
|
| 25 | + protected function _set_tour_stops() |
|
| 26 | + { |
|
| 27 | + $this->_stops = array( |
|
| 28 | + 10 => array( |
|
| 29 | + 'content' => $this->_start(), |
|
| 30 | + ), |
|
| 31 | + 20 => array( |
|
| 32 | + 'id' => 'name', |
|
| 33 | + 'content' => $this->_name_column_stop(), |
|
| 34 | + 'options' => array( |
|
| 35 | + 'tipLocation' => 'top', |
|
| 36 | + 'tipAdjustmentX' => -5, |
|
| 37 | + 'tipAdjustmentY' => -30, |
|
| 38 | + ), |
|
| 39 | + ), |
|
| 40 | + 30 => array( |
|
| 41 | + 'id' => 'type', |
|
| 42 | + 'content' => $this->_type_column_stop(), |
|
| 43 | + 'options' => array( |
|
| 44 | + 'tipLocation' => 'top', |
|
| 45 | + 'tipAdjustmentX' => 5, |
|
| 46 | + 'tipAdjustmentY' => -30, |
|
| 47 | + ), |
|
| 48 | + ), |
|
| 49 | + 40 => array( |
|
| 50 | + 'id' => 'description', |
|
| 51 | + 'content' => $this->_description_column_stop(), |
|
| 52 | + 'options' => array( |
|
| 53 | + 'tipLocation' => 'top', |
|
| 54 | + 'tipAdjustmentX' => 5, |
|
| 55 | + 'tipAdjustmentY' => -30, |
|
| 56 | + ), |
|
| 57 | + ), |
|
| 58 | + 50 => array( |
|
| 59 | + 'id' => 'amount', |
|
| 60 | + 'content' => $this->_amount_column_stop(), |
|
| 61 | + 'options' => array( |
|
| 62 | + 'tipLocation' => 'left', |
|
| 63 | + 'tipAdjustmentY' => -50, |
|
| 64 | + 'tipAdjustmentX' => 20, |
|
| 65 | + ), |
|
| 66 | + ), |
|
| 67 | + 60 => array( |
|
| 68 | + 'class' => 'bulkactions', |
|
| 69 | + 'content' => $this->_bulk_actions_stop(), |
|
| 70 | + 'options' => array( |
|
| 71 | + 'tipLocation' => 'left', |
|
| 72 | + 'tipAdjustmentY' => -50, |
|
| 73 | + 'tipAdjustmentX' => -75, |
|
| 74 | + ), |
|
| 75 | + ), |
|
| 76 | + 70 => array( |
|
| 77 | + 'id' => 'event-espresso_page_pricing-search-input', |
|
| 78 | + 'content' => $this->_search_stop(), |
|
| 79 | + 'options' => array( |
|
| 80 | + 'tipLocation' => 'left', |
|
| 81 | + 'tipAdjustmentY' => -50, |
|
| 82 | + 'tipAdjustmentX' => -15, |
|
| 83 | + ), |
|
| 84 | + ), |
|
| 85 | + ); |
|
| 86 | + } |
|
| 87 | 87 | |
| 88 | 88 | |
| 89 | - protected function _start() |
|
| 90 | - { |
|
| 91 | - $content = '<h3>' . __('Default Pricing', 'event_espresso') . '</h3>'; |
|
| 92 | - $content .= '<p>' |
|
| 93 | - . __( |
|
| 94 | - 'This tour of the Default Pricing page will go over different areas of the screen to help you understand what they are used for.', |
|
| 95 | - 'event_espresso' |
|
| 96 | - ) . '</p>'; |
|
| 97 | - return $content; |
|
| 98 | - } |
|
| 89 | + protected function _start() |
|
| 90 | + { |
|
| 91 | + $content = '<h3>' . __('Default Pricing', 'event_espresso') . '</h3>'; |
|
| 92 | + $content .= '<p>' |
|
| 93 | + . __( |
|
| 94 | + 'This tour of the Default Pricing page will go over different areas of the screen to help you understand what they are used for.', |
|
| 95 | + 'event_espresso' |
|
| 96 | + ) . '</p>'; |
|
| 97 | + return $content; |
|
| 98 | + } |
|
| 99 | 99 | |
| 100 | - protected function _name_column_stop() |
|
| 101 | - { |
|
| 102 | - return '<p>' |
|
| 103 | - . __( |
|
| 104 | - 'The name of the price, discount, tax, or surcharge that will be seen by your customers. Can be sorted in ascending or descending order.', |
|
| 105 | - 'event_espresso' |
|
| 106 | - ) . '</p>'; |
|
| 107 | - } |
|
| 100 | + protected function _name_column_stop() |
|
| 101 | + { |
|
| 102 | + return '<p>' |
|
| 103 | + . __( |
|
| 104 | + 'The name of the price, discount, tax, or surcharge that will be seen by your customers. Can be sorted in ascending or descending order.', |
|
| 105 | + 'event_espresso' |
|
| 106 | + ) . '</p>'; |
|
| 107 | + } |
|
| 108 | 108 | |
| 109 | - protected function _type_column_stop() |
|
| 110 | - { |
|
| 111 | - return '<p>' |
|
| 112 | - . __( |
|
| 113 | - 'Price Types are a way of categorizing a price, discount, tax, or surcharge and indicating how it gets applied to a running total when a transaction occurs. Can be sorted in ascending or descending order.', |
|
| 114 | - 'event_espresso' |
|
| 115 | - ) . '</p>'; |
|
| 116 | - } |
|
| 109 | + protected function _type_column_stop() |
|
| 110 | + { |
|
| 111 | + return '<p>' |
|
| 112 | + . __( |
|
| 113 | + 'Price Types are a way of categorizing a price, discount, tax, or surcharge and indicating how it gets applied to a running total when a transaction occurs. Can be sorted in ascending or descending order.', |
|
| 114 | + 'event_espresso' |
|
| 115 | + ) . '</p>'; |
|
| 116 | + } |
|
| 117 | 117 | |
| 118 | - protected function _description_column_stop() |
|
| 119 | - { |
|
| 120 | - return '<p>' |
|
| 121 | - . __( |
|
| 122 | - 'View the price type (price, discount, tax or surcharge) description.', |
|
| 123 | - 'event_espresso' |
|
| 124 | - ) . '</p>'; |
|
| 125 | - } |
|
| 118 | + protected function _description_column_stop() |
|
| 119 | + { |
|
| 120 | + return '<p>' |
|
| 121 | + . __( |
|
| 122 | + 'View the price type (price, discount, tax or surcharge) description.', |
|
| 123 | + 'event_espresso' |
|
| 124 | + ) . '</p>'; |
|
| 125 | + } |
|
| 126 | 126 | |
| 127 | - protected function _amount_column_stop() |
|
| 128 | - { |
|
| 129 | - return '<p>' |
|
| 130 | - . __( |
|
| 131 | - 'The ticket amount before any deductions. Can be sorted in ascending or descending order.', |
|
| 132 | - 'event_espresso' |
|
| 133 | - ) . '</p>'; |
|
| 134 | - } |
|
| 127 | + protected function _amount_column_stop() |
|
| 128 | + { |
|
| 129 | + return '<p>' |
|
| 130 | + . __( |
|
| 131 | + 'The ticket amount before any deductions. Can be sorted in ascending or descending order.', |
|
| 132 | + 'event_espresso' |
|
| 133 | + ) . '</p>'; |
|
| 134 | + } |
|
| 135 | 135 | |
| 136 | - protected function _bulk_actions_stop() |
|
| 137 | - { |
|
| 138 | - return '<p>' . __('Perform bulk actions to multiple price types.', 'event_espresso') . '</p>'; |
|
| 139 | - } |
|
| 136 | + protected function _bulk_actions_stop() |
|
| 137 | + { |
|
| 138 | + return '<p>' . __('Perform bulk actions to multiple price types.', 'event_espresso') . '</p>'; |
|
| 139 | + } |
|
| 140 | 140 | |
| 141 | - protected function _search_stop() |
|
| 142 | - { |
|
| 143 | - return '<p>' |
|
| 144 | - . __( |
|
| 145 | - 'Search through default pricing. The following sources will be searched: Price Name, Price Type, Price Description, and Price Amount.', |
|
| 146 | - 'event_espresso' |
|
| 147 | - ) . '</p>'; |
|
| 148 | - } |
|
| 141 | + protected function _search_stop() |
|
| 142 | + { |
|
| 143 | + return '<p>' |
|
| 144 | + . __( |
|
| 145 | + 'Search through default pricing. The following sources will be searched: Price Name, Price Type, Price Description, and Price Amount.', |
|
| 146 | + 'event_espresso' |
|
| 147 | + ) . '</p>'; |
|
| 148 | + } |
|
| 149 | 149 | } |
@@ -88,12 +88,12 @@ discard block |
||
| 88 | 88 | |
| 89 | 89 | protected function _start() |
| 90 | 90 | { |
| 91 | - $content = '<h3>' . __('Default Pricing', 'event_espresso') . '</h3>'; |
|
| 91 | + $content = '<h3>'.__('Default Pricing', 'event_espresso').'</h3>'; |
|
| 92 | 92 | $content .= '<p>' |
| 93 | 93 | . __( |
| 94 | 94 | 'This tour of the Default Pricing page will go over different areas of the screen to help you understand what they are used for.', |
| 95 | 95 | 'event_espresso' |
| 96 | - ) . '</p>'; |
|
| 96 | + ).'</p>'; |
|
| 97 | 97 | return $content; |
| 98 | 98 | } |
| 99 | 99 | |
@@ -103,7 +103,7 @@ discard block |
||
| 103 | 103 | . __( |
| 104 | 104 | 'The name of the price, discount, tax, or surcharge that will be seen by your customers. Can be sorted in ascending or descending order.', |
| 105 | 105 | 'event_espresso' |
| 106 | - ) . '</p>'; |
|
| 106 | + ).'</p>'; |
|
| 107 | 107 | } |
| 108 | 108 | |
| 109 | 109 | protected function _type_column_stop() |
@@ -112,7 +112,7 @@ discard block |
||
| 112 | 112 | . __( |
| 113 | 113 | 'Price Types are a way of categorizing a price, discount, tax, or surcharge and indicating how it gets applied to a running total when a transaction occurs. Can be sorted in ascending or descending order.', |
| 114 | 114 | 'event_espresso' |
| 115 | - ) . '</p>'; |
|
| 115 | + ).'</p>'; |
|
| 116 | 116 | } |
| 117 | 117 | |
| 118 | 118 | protected function _description_column_stop() |
@@ -121,7 +121,7 @@ discard block |
||
| 121 | 121 | . __( |
| 122 | 122 | 'View the price type (price, discount, tax or surcharge) description.', |
| 123 | 123 | 'event_espresso' |
| 124 | - ) . '</p>'; |
|
| 124 | + ).'</p>'; |
|
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | protected function _amount_column_stop() |
@@ -130,12 +130,12 @@ discard block |
||
| 130 | 130 | . __( |
| 131 | 131 | 'The ticket amount before any deductions. Can be sorted in ascending or descending order.', |
| 132 | 132 | 'event_espresso' |
| 133 | - ) . '</p>'; |
|
| 133 | + ).'</p>'; |
|
| 134 | 134 | } |
| 135 | 135 | |
| 136 | 136 | protected function _bulk_actions_stop() |
| 137 | 137 | { |
| 138 | - return '<p>' . __('Perform bulk actions to multiple price types.', 'event_espresso') . '</p>'; |
|
| 138 | + return '<p>'.__('Perform bulk actions to multiple price types.', 'event_espresso').'</p>'; |
|
| 139 | 139 | } |
| 140 | 140 | |
| 141 | 141 | protected function _search_stop() |
@@ -144,6 +144,6 @@ discard block |
||
| 144 | 144 | . __( |
| 145 | 145 | 'Search through default pricing. The following sources will be searched: Price Name, Price Type, Price Description, and Price Amount.', |
| 146 | 146 | 'event_espresso' |
| 147 | - ) . '</p>'; |
|
| 147 | + ).'</p>'; |
|
| 148 | 148 | } |
| 149 | 149 | } |
@@ -15,84 +15,84 @@ |
||
| 15 | 15 | class Pricing_Edit_Price_Type_Help_Tour extends EE_Help_Tour |
| 16 | 16 | { |
| 17 | 17 | |
| 18 | - protected function _set_tour_properties() |
|
| 19 | - { |
|
| 20 | - $this->_label = __('Edit Price Type Tour', 'event_espresso'); |
|
| 21 | - $this->_slug = 'edit-price-type-joyride'; |
|
| 22 | - } |
|
| 18 | + protected function _set_tour_properties() |
|
| 19 | + { |
|
| 20 | + $this->_label = __('Edit Price Type Tour', 'event_espresso'); |
|
| 21 | + $this->_slug = 'edit-price-type-joyride'; |
|
| 22 | + } |
|
| 23 | 23 | |
| 24 | 24 | |
| 25 | - protected function _set_tour_stops() |
|
| 26 | - { |
|
| 27 | - $this->_stops = array( |
|
| 28 | - 10 => array( |
|
| 29 | - 'content' => $this->_start(), |
|
| 30 | - ), |
|
| 31 | - 20 => array( |
|
| 32 | - 'id' => 'base_type', |
|
| 33 | - 'content' => $this->_basic_type_stop(), |
|
| 34 | - 'options' => array( |
|
| 35 | - 'tipLocation' => 'top', |
|
| 36 | - 'tipAdjustmentY' => -50, |
|
| 37 | - 'tipAdjustmentX' => -15, |
|
| 38 | - ), |
|
| 39 | - ), |
|
| 40 | - 30 => array( |
|
| 41 | - 'id' => 'PRT_name', |
|
| 42 | - 'content' => $this->_price_type_name_stop(), |
|
| 43 | - 'options' => array( |
|
| 44 | - 'tipLocation' => 'top', |
|
| 45 | - 'tipAdjustmentY' => -40, |
|
| 46 | - ), |
|
| 47 | - ), |
|
| 48 | - 40 => array( |
|
| 49 | - 'id' => 'PRT_name', |
|
| 50 | - 'content' => $this->_percentage_dollar_amount_stop(), |
|
| 51 | - 'options' => array( |
|
| 52 | - 'tipLocation' => 'top', |
|
| 53 | - 'tipAdjustmentY' => 45, |
|
| 54 | - ), |
|
| 55 | - ), |
|
| 56 | - 50 => array( |
|
| 57 | - 'id' => 'PRT_order', |
|
| 58 | - 'content' => $this->_order_of_application_stop(), |
|
| 59 | - 'options' => array( |
|
| 60 | - 'tipLocation' => 'top', |
|
| 61 | - 'tipAdjustmentY' => -40, |
|
| 62 | - ), |
|
| 63 | - ), |
|
| 64 | - ); |
|
| 65 | - } |
|
| 25 | + protected function _set_tour_stops() |
|
| 26 | + { |
|
| 27 | + $this->_stops = array( |
|
| 28 | + 10 => array( |
|
| 29 | + 'content' => $this->_start(), |
|
| 30 | + ), |
|
| 31 | + 20 => array( |
|
| 32 | + 'id' => 'base_type', |
|
| 33 | + 'content' => $this->_basic_type_stop(), |
|
| 34 | + 'options' => array( |
|
| 35 | + 'tipLocation' => 'top', |
|
| 36 | + 'tipAdjustmentY' => -50, |
|
| 37 | + 'tipAdjustmentX' => -15, |
|
| 38 | + ), |
|
| 39 | + ), |
|
| 40 | + 30 => array( |
|
| 41 | + 'id' => 'PRT_name', |
|
| 42 | + 'content' => $this->_price_type_name_stop(), |
|
| 43 | + 'options' => array( |
|
| 44 | + 'tipLocation' => 'top', |
|
| 45 | + 'tipAdjustmentY' => -40, |
|
| 46 | + ), |
|
| 47 | + ), |
|
| 48 | + 40 => array( |
|
| 49 | + 'id' => 'PRT_name', |
|
| 50 | + 'content' => $this->_percentage_dollar_amount_stop(), |
|
| 51 | + 'options' => array( |
|
| 52 | + 'tipLocation' => 'top', |
|
| 53 | + 'tipAdjustmentY' => 45, |
|
| 54 | + ), |
|
| 55 | + ), |
|
| 56 | + 50 => array( |
|
| 57 | + 'id' => 'PRT_order', |
|
| 58 | + 'content' => $this->_order_of_application_stop(), |
|
| 59 | + 'options' => array( |
|
| 60 | + 'tipLocation' => 'top', |
|
| 61 | + 'tipAdjustmentY' => -40, |
|
| 62 | + ), |
|
| 63 | + ), |
|
| 64 | + ); |
|
| 65 | + } |
|
| 66 | 66 | |
| 67 | 67 | |
| 68 | - protected function _start() |
|
| 69 | - { |
|
| 70 | - $content = '<h3>' . __('Edit Price Type', 'event_espresso') . '</h3>'; |
|
| 71 | - $content .= '<p>' |
|
| 72 | - . __( |
|
| 73 | - 'This tour of the Edit Price Type page will go over different areas of the screen to help you understand what they are used for.', |
|
| 74 | - 'event_espresso' |
|
| 75 | - ) . '</p>'; |
|
| 76 | - return $content; |
|
| 77 | - } |
|
| 68 | + protected function _start() |
|
| 69 | + { |
|
| 70 | + $content = '<h3>' . __('Edit Price Type', 'event_espresso') . '</h3>'; |
|
| 71 | + $content .= '<p>' |
|
| 72 | + . __( |
|
| 73 | + 'This tour of the Edit Price Type page will go over different areas of the screen to help you understand what they are used for.', |
|
| 74 | + 'event_espresso' |
|
| 75 | + ) . '</p>'; |
|
| 76 | + return $content; |
|
| 77 | + } |
|
| 78 | 78 | |
| 79 | - protected function _basic_type_stop() |
|
| 80 | - { |
|
| 81 | - return '<p>' . __('Set a price type to be a discount, surcharge, or tax.', 'event_espresso') . '</p>'; |
|
| 82 | - } |
|
| 79 | + protected function _basic_type_stop() |
|
| 80 | + { |
|
| 81 | + return '<p>' . __('Set a price type to be a discount, surcharge, or tax.', 'event_espresso') . '</p>'; |
|
| 82 | + } |
|
| 83 | 83 | |
| 84 | - protected function _price_type_name_stop() |
|
| 85 | - { |
|
| 86 | - return '<p>' . __('The name of the price type.', 'event_espresso') . '</p>'; |
|
| 87 | - } |
|
| 84 | + protected function _price_type_name_stop() |
|
| 85 | + { |
|
| 86 | + return '<p>' . __('The name of the price type.', 'event_espresso') . '</p>'; |
|
| 87 | + } |
|
| 88 | 88 | |
| 89 | - protected function _percentage_dollar_amount_stop() |
|
| 90 | - { |
|
| 91 | - return '<p>' . __('Set a price type to be percentage-based or a fixed amount.', 'event_espresso') . '</p>'; |
|
| 92 | - } |
|
| 89 | + protected function _percentage_dollar_amount_stop() |
|
| 90 | + { |
|
| 91 | + return '<p>' . __('Set a price type to be percentage-based or a fixed amount.', 'event_espresso') . '</p>'; |
|
| 92 | + } |
|
| 93 | 93 | |
| 94 | - protected function _order_of_application_stop() |
|
| 95 | - { |
|
| 96 | - return '<p>' . __('Set the order of application for a price type.', 'event_espresso') . '</p>'; |
|
| 97 | - } |
|
| 94 | + protected function _order_of_application_stop() |
|
| 95 | + { |
|
| 96 | + return '<p>' . __('Set the order of application for a price type.', 'event_espresso') . '</p>'; |
|
| 97 | + } |
|
| 98 | 98 | } |
@@ -67,32 +67,32 @@ |
||
| 67 | 67 | |
| 68 | 68 | protected function _start() |
| 69 | 69 | { |
| 70 | - $content = '<h3>' . __('Edit Price Type', 'event_espresso') . '</h3>'; |
|
| 70 | + $content = '<h3>'.__('Edit Price Type', 'event_espresso').'</h3>'; |
|
| 71 | 71 | $content .= '<p>' |
| 72 | 72 | . __( |
| 73 | 73 | 'This tour of the Edit Price Type page will go over different areas of the screen to help you understand what they are used for.', |
| 74 | 74 | 'event_espresso' |
| 75 | - ) . '</p>'; |
|
| 75 | + ).'</p>'; |
|
| 76 | 76 | return $content; |
| 77 | 77 | } |
| 78 | 78 | |
| 79 | 79 | protected function _basic_type_stop() |
| 80 | 80 | { |
| 81 | - return '<p>' . __('Set a price type to be a discount, surcharge, or tax.', 'event_espresso') . '</p>'; |
|
| 81 | + return '<p>'.__('Set a price type to be a discount, surcharge, or tax.', 'event_espresso').'</p>'; |
|
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | protected function _price_type_name_stop() |
| 85 | 85 | { |
| 86 | - return '<p>' . __('The name of the price type.', 'event_espresso') . '</p>'; |
|
| 86 | + return '<p>'.__('The name of the price type.', 'event_espresso').'</p>'; |
|
| 87 | 87 | } |
| 88 | 88 | |
| 89 | 89 | protected function _percentage_dollar_amount_stop() |
| 90 | 90 | { |
| 91 | - return '<p>' . __('Set a price type to be percentage-based or a fixed amount.', 'event_espresso') . '</p>'; |
|
| 91 | + return '<p>'.__('Set a price type to be percentage-based or a fixed amount.', 'event_espresso').'</p>'; |
|
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | protected function _order_of_application_stop() |
| 95 | 95 | { |
| 96 | - return '<p>' . __('Set the order of application for a price type.', 'event_espresso') . '</p>'; |
|
| 96 | + return '<p>'.__('Set the order of application for a price type.', 'event_espresso').'</p>'; |
|
| 97 | 97 | } |
| 98 | 98 | } |