public function load_scripts_styles() { parent::load_scripts_styles(); //if newsletter message type is active then let's add filter and load js for it. if (EEH_MSG_Template::is_mt_active('newsletter')) { //enqueue newsletter js wp_enqueue_script('ee-newsletter-trigger', REG_CAF_ASSETS_URL . 'ee-newsletter-trigger.js', array('ee-dialog'), EVENT_ESPRESSO_VERSION, TRUE); wp_enqueue_style('ee-newsletter-trigger-css', REG_CAF_ASSETS_URL . 'ee-newsletter-trigger.css', array(), EVENT_ESPRESSO_VERSION); //hook in buttons for newsletter message type trigger. add_action('AHEE__EE_Admin_List_Table__extra_tablenav__after_bottom_buttons', array($this, 'add_newsletter_action_buttons'), 10); } }
/** * Callback for AHEE__Extend_Registrations_Admin_Page___newsletter_selected_send trigger * * @since 4.3.0 * * @param string $registration_message_trigger_url * @param EE_Registration $registration * @param string $messenger * @param string $message_type * @return string */ public static function registration_message_trigger_url($registration_message_trigger_url, EE_Registration $registration, $messenger = 'html', $message_type = 'invoice') { EE_Registry::instance()->load_helper('MSG_Template'); // whitelist $messenger switch ($messenger) { case 'pdf': $sending_messenger = 'pdf'; $generating_messenger = 'html'; break; case 'html': default: $sending_messenger = 'html'; $generating_messenger = 'html'; break; } // whitelist $message_type switch ($message_type) { case 'receipt': $message_type = 'receipt'; break; case 'invoice': default: $message_type = 'invoice'; break; } // verify that both the messenger AND the message type are active if (EEH_MSG_Template::is_messenger_active($sending_messenger) && EEH_MSG_Template::is_mt_active($message_type)) { //need to get the correct message template group for this (i.e. is there a custom invoice for the event this registration is registered for?) $template_query_params = array('MTP_is_active' => TRUE, 'MTP_messenger' => $generating_messenger, 'MTP_message_type' => $message_type, 'Event.EVT_ID' => $registration->event_ID()); //get the message template group. $msg_template_group = EEM_Message_Template_Group::instance()->get_one(array($template_query_params)); //if we don't have an EE_Message_Template_Group then return if (!$msg_template_group instanceof EE_Message_Template_Group) { // remove EVT_ID from query params so that global templates get picked up unset($template_query_params['Event.EVT_ID']); //get global template as the fallback $msg_template_group = EEM_Message_Template_Group::instance()->get_one(array($template_query_params)); } //if we don't have an EE_Message_Template_Group then return if (!$msg_template_group instanceof EE_Message_Template_Group) { return ''; } // generate the URL $registration_message_trigger_url = EEH_MSG_Template::generate_url_trigger($sending_messenger, $generating_messenger, 'purchaser', $message_type, $registration, $msg_template_group->ID(), $registration->transaction_ID()); } return $registration_message_trigger_url; }
/** * _transaction_details * generates HTML for the View Transaction Details Admin page * * @access protected * @return void */ protected function _transaction_details() { do_action('AHEE__Transactions_Admin_Page__transaction_details__start', $this->_transaction); EE_Registry::instance()->load_helper('MSG_Template'); $this->_set_transaction_status_array(); $this->_template_args = array(); $this->_template_args['transactions_page'] = $this->_wp_page_slug; $this->_set_transaction_object(); $primary_registration = $this->_transaction->primary_registration(); $attendee = $primary_registration instanceof EE_Registration ? $primary_registration->attendee() : NULL; $this->_template_args['txn_nmbr']['value'] = $this->_transaction->ID(); $this->_template_args['txn_nmbr']['label'] = __('Transaction Number', 'event_espresso'); $this->_template_args['txn_datetime']['value'] = $this->_transaction->get_datetime('TXN_timestamp', 'l F j, Y', 'g:i:s a'); $this->_template_args['txn_datetime']['label'] = __('Date', 'event_espresso'); $this->_template_args['txn_status']['value'] = self::$_txn_status[$this->_transaction->get('STS_ID')]; $this->_template_args['txn_status']['label'] = __('Transaction Status', 'event_espresso'); $this->_template_args['txn_status']['class'] = 'status-' . $this->_transaction->get('STS_ID'); $this->_template_args['grand_total'] = $this->_transaction->get('TXN_total'); $this->_template_args['total_paid'] = $this->_transaction->get('TXN_paid'); if ($attendee instanceof EE_Attendee && EE_Registry::instance()->CAP->current_user_can('ee_send_message', 'espresso_transactions_send_payment_reminder')) { EE_Registry::instance()->load_helper('MSG_Template'); $this->_template_args['send_payment_reminder_button'] = EEH_MSG_Template::is_mt_active('payment_reminder') && $this->_transaction->get('STS_ID') != EEM_Transaction::complete_status_code && $this->_transaction->get('STS_ID') != EEM_Transaction::overpaid_status_code ? EEH_Template::get_button_or_link(EE_Admin_Page::add_query_args_and_nonce(array('action' => 'send_payment_reminder', 'TXN_ID' => $this->_transaction->ID(), 'redirect_to' => 'view_transaction'), TXN_ADMIN_URL), __(' Send Payment Reminder'), 'button secondary-button right', 'dashicons dashicons-email-alt') : ''; } else { $this->_template_args['send_payment_reminder_button'] = ''; } $amount_due = $this->_transaction->get('TXN_total') - $this->_transaction->get('TXN_paid'); $this->_template_args['amount_due'] = EEH_Template::format_currency($amount_due, TRUE); if (EE_Registry::instance()->CFG->currency->sign_b4) { $this->_template_args['amount_due'] = EE_Registry::instance()->CFG->currency->sign . $this->_template_args['amount_due']; } else { $this->_template_args['amount_due'] = $this->_template_args['amount_due'] . EE_Registry::instance()->CFG->currency->sign; } $this->_template_args['amount_due_class'] = ''; if ($this->_transaction->get('TXN_paid') == $this->_transaction->get('TXN_total')) { // paid in full $this->_template_args['amount_due'] = FALSE; } elseif ($this->_transaction->get('TXN_paid') > $this->_transaction->get('TXN_total')) { // overpaid $this->_template_args['amount_due_class'] = 'txn-overview-no-payment-spn'; } elseif ($this->_transaction->get('TXN_total') > 0 && $this->_transaction->get('TXN_paid') > 0) { // monies owing $this->_template_args['amount_due_class'] = 'txn-overview-part-payment-spn'; } elseif ($this->_transaction->get('TXN_total') > 0 && $this->_transaction->get('TXN_paid') == 0) { // no payments made yet $this->_template_args['amount_due_class'] = 'txn-overview-no-payment-spn'; } elseif ($this->_transaction->get('TXN_total') == 0) { // free event $this->_template_args['amount_due'] = FALSE; } $payment_method = $this->_transaction->payment_method(); $this->_template_args['method_of_payment_name'] = $payment_method instanceof EE_Payment_Method ? $payment_method->admin_name() : __('Unknown', 'event_espresso'); $this->_template_args['currency_sign'] = EE_Registry::instance()->CFG->currency->sign; // link back to overview $this->_template_args['txn_overview_url'] = !empty($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : TXN_ADMIN_URL; //next and previous links $next_txn = $this->_transaction->next(null, array(array('STS_ID' => array('!=', EEM_Transaction::failed_status_code))), 'TXN_ID'); $this->_template_args['next_transaction'] = $next_txn ? $this->_next_link(EE_Admin_Page::add_query_args_and_nonce(array('action' => 'view_transaction', 'TXN_ID' => $next_txn['TXN_ID']), TXN_ADMIN_URL), 'dashicons dashicons-arrow-right ee-icon-size-22') : ''; $previous_txn = $this->_transaction->previous(null, array(array('STS_ID' => array('!=', EEM_Transaction::failed_status_code))), 'TXN_ID'); $this->_template_args['previous_transaction'] = $previous_txn ? $this->_previous_link(EE_Admin_Page::add_query_args_and_nonce(array('action' => 'view_transaction', 'TXN_ID' => $previous_txn['TXN_ID']), TXN_ADMIN_URL), 'dashicons dashicons-arrow-left ee-icon-size-22') : ''; // grab messages at the last second $this->_template_args['notices'] = EE_Error::get_notices(); // path to template $template_path = TXN_TEMPLATE_PATH . 'txn_admin_details_header.template.php'; $this->_template_args['admin_page_header'] = EEH_Template::display_template($template_path, $this->_template_args, TRUE); // the details template wrapper $this->display_admin_page_with_sidebar(); }
/** * generates HTML for the View Transaction Details Admin page * @access protected * @return void */ protected function _transaction_details() { $this->_get_transaction_status_array(); $this->_template_args = array(); $this->_template_args['transactions_page'] = $this->wp_page_slug; $this->_set_transaction_object(); $this->_template_args['txn_nmbr']['value'] = $this->_transaction->ID(); $this->_template_args['txn_nmbr']['label'] = __('Transaction Number', 'event_espresso'); $this->_template_args['txn_datetime']['value'] = $this->_transaction->get_datetime('TXN_timestamp', 'l F j, Y', 'g:i:s a'); $this->_template_args['txn_datetime']['label'] = __('Date', 'event_espresso'); $this->_template_args['txn_status']['value'] = self::$_txn_status[$this->_transaction->get('STS_ID')]; $this->_template_args['txn_status']['label'] = __('Transaction Status', 'event_espresso'); $this->_template_args['txn_status']['class'] = 'status-' . $this->_transaction->get('STS_ID'); $this->_template_args['grand_total'] = $this->_transaction->get('TXN_total'); $this->_template_args['total_paid'] = $this->_transaction->get('TXN_paid'); EE_Registry::instance()->load_helper('MSG_Template'); $this->_template_args['send_payment_reminder_button'] = EEH_MSG_Template::is_mt_active('payment_reminder') && $this->_transaction->get('STS_ID') != EEM_Transaction::complete_status_code && $this->_transaction->get('STS_ID') != EEM_Transaction::overpaid_status_code ? EEH_Template::get_button_or_link(EE_Admin_Page::add_query_args_and_nonce(array('action' => 'send_payment_reminder', 'TXN_ID' => $this->_transaction->ID(), 'redirect_to' => 'view_transaction'), TXN_ADMIN_URL), __(' Send Payment Reminder'), 'button secondary-button right', 'dashicons dashicons-email-alt') : ''; $amount_due = $this->_transaction->get('TXN_total') - $this->_transaction->get('TXN_paid'); $this->_template_args['amount_due'] = ' <span id="txn-admin-total-amount-due">' . EEH_Template::format_currency($amount_due, TRUE) . '</span>'; if (EE_Registry::instance()->CFG->currency->sign_b4) { $this->_template_args['amount_due'] = EE_Registry::instance()->CFG->currency->sign . $this->_template_args['amount_due']; } else { $this->_template_args['amount_due'] = $this->_template_args['amount_due'] . EE_Registry::instance()->CFG->currency->sign; } $this->_template_args['amount_due_class'] = ''; if ($this->_transaction->get('TXN_paid') == $this->_transaction->get('TXN_total')) { // paid in full $this->_template_args['amount_due'] = FALSE; } elseif ($this->_transaction->get('TXN_paid') > $this->_transaction->get('TXN_total')) { // overpaid $this->_template_args['amount_due_class'] = 'txn-overview-no-payment-spn'; } elseif ($this->_transaction->get('TXN_total') > 0 && $this->_transaction->get('TXN_paid') > 0) { // monies owing $this->_template_args['amount_due_class'] = 'txn-overview-part-payment-spn'; } elseif ($this->_transaction->get('TXN_total') > 0 && $this->_transaction->get('TXN_paid') == 0) { // no payments made yet $this->_template_args['amount_due_class'] = 'txn-overview-no-payment-spn'; } elseif ($this->_transaction->get('TXN_total') == 0) { // free event $this->_template_args['amount_due'] = FALSE; } $gateway = $this->_transaction->get_extra_meta('gateway', true, FALSE); $this->_template_args['method_of_payment'] = $gateway; $this->_template_args['currency_sign'] = EE_Registry::instance()->CFG->currency->sign; // link back to overview $this->_template_args['txn_overview_url'] = !empty($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : TXN_ADMIN_URL; // grab messages at the last second $this->_template_args['notices'] = EE_Error::get_notices(); // path to template $template_path = TXN_TEMPLATE_PATH . 'txn_admin_details_header.template.php'; $this->_template_args['admin_page_header'] = EEH_Template::display_template($template_path, $this->_template_args, TRUE); // the details template wrapper $this->display_admin_page_with_sidebar(); }
/** * column_actions * * @access public * @param \EE_Registration $item * @return string */ function column_actions(EE_Registration $item) { EE_Registry::instance()->load_helper('MSG_Template'); $attendee = $item->attendee(); $ticket = $item->ticket(); $this->_set_related_details($item); //Build row actions $view_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'view_registration', '_REG_ID' => $item->ID()), REG_ADMIN_URL); $edit_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'edit_attendee', 'post' => $item->attendee_ID()), REG_ADMIN_URL); // page=attendees&event_admin_reports=resend_email®istration_id=43653465634&event_id=2&form_action=resend_email //$resend_reg_lnk_url_params = array( 'action'=>'resend_registration', '_REG_ID'=>$item->REG_ID ); $resend_reg_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'resend_registration', '_REG_ID' => $item->ID()), REG_ADMIN_URL, true); //Build row actions $view_lnk = EE_Registry::instance()->CAP->current_user_can('ee_read_registration', 'espresso_registrations_view_registration', $item->ID()) ? ' <li> <a href="' . $view_lnk_url . '" title="' . esc_attr__('View Registration Details', 'event_espresso') . '" class="tiny-text"> <div class="dashicons dashicons-clipboard"></div> </a> </li>' : ''; $edit_lnk = EE_Registry::instance()->CAP->current_user_can('ee_edit_contacts', 'espresso_registrations_edit_attendee') && $attendee instanceof EE_Attendee ? ' <li> <a href="' . $edit_lnk_url . '" title="' . esc_attr__('Edit Contact Details', 'event_espresso') . '" class="tiny-text"> <div class="ee-icon ee-icon-user-edit ee-icon-size-16"></div> </a> </li>' : ''; $resend_reg_lnk = $attendee instanceof EE_Attendee && EE_Registry::instance()->CAP->current_user_can('ee_send_message', 'espresso_registrations_resend_registration', $item->ID()) ? ' <li> <a href="' . $resend_reg_lnk_url . '" title="' . esc_attr__('Resend Registration Details', 'event_espresso') . '" class="tiny-text"> <div class="dashicons dashicons-email-alt"></div> </a> </li>' : ''; // page=transactions&action=view_transaction&txn=256&_wpnonce=6414da4dbb $view_txn_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'view_transaction', 'TXN_ID' => $this->_transaction_details['id']), TXN_ADMIN_URL); $view_txn_lnk = EE_Registry::instance()->CAP->current_user_can('ee_read_transaction', 'espresso_transactions_view_transaction', $this->_transaction_details['id']) ? ' <li> <a class="ee-status-color-' . $this->_transaction_details['status'] . '" href="' . $view_txn_lnk_url . '" title="' . $this->_transaction_details['title_attr'] . '" class="tiny-text"> <div class="dashicons dashicons-cart"></div> </a> </li>' : ''; //invoice link $dl_invoice_lnk_url = $item->invoice_url(); //only show invoice link if message type is active. if ($item->is_primary_registrant() && $attendee instanceof EE_Attendee && EEH_MSG_Template::is_mt_active('invoice')) { $dl_invoice_lnk = ' <li> <a title="' . esc_attr__('View Transaction Invoice', 'event_espresso') . '" target="_blank" href="' . $dl_invoice_lnk_url . '" class="tiny-text"> <span class="dashicons dashicons-media-spreadsheet ee-icon-size-18"></span> </a> </li>'; } else { $dl_invoice_lnk = ''; } return $this->_action_string($view_lnk . $edit_lnk . $resend_reg_lnk . $view_txn_lnk . $dl_invoice_lnk, $item, 'ul', 'reg-overview-actions-ul'); }
/** * column_actions * @param \EE_Transaction $item * @return string */ function column_actions(EE_Transaction $item) { $registration = $item->primary_registration(); $attendee = $registration->attendee(); EE_Registry::instance()->load_helper('MSG_Template'); //Build row actions $view_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'view_transaction', 'TXN_ID' => $item->ID()), TXN_ADMIN_URL); $dl_invoice_lnk_url = $registration->invoice_url(); $dl_receipt_lnk_url = $registration->receipt_url(); $view_reg_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'view_registration', '_REG_ID' => $registration->ID()), REG_ADMIN_URL); $send_pay_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'send_payment_reminder', 'TXN_ID' => $item->ID()), TXN_ADMIN_URL); //Build row actions $view_lnk = ' <li> <a href="' . $view_lnk_url . '" title="' . esc_attr__('View Transaction Details', 'event_espresso') . '" class="tiny-text"> <span class="dashicons dashicons-cart"></span> </a> </li>'; //only show invoice link if message type is active. if ($attendee instanceof EE_Attendee && EEH_MSG_Template::is_mt_active('invoice')) { $dl_invoice_lnk = ' <li> <a title="' . esc_attr__('View Transaction Invoice', 'event_espresso') . '" target="_blank" href="' . $dl_invoice_lnk_url . '" class="tiny-text"> <span class="dashicons dashicons-media-spreadsheet ee-icon-size-18"></span> </a> </li>'; } else { $dl_invoice_lnk = ''; } //only show receipt link if message type is active. if ($attendee instanceof EE_Attendee && EEH_MSG_Template::is_mt_active('receipt')) { $dl_receipt_lnk = ' <li> <a title="' . esc_attr__('View Transaction Receipt', 'event_espresso') . '" target="_blank" href="' . $dl_receipt_lnk_url . '" class="tiny-text"> <span class="dashicons dashicons-media-default ee-icon-size-18"></span> </a> </li>'; } else { $dl_receipt_lnk = ''; } //only show payment reminder link if the message type is active. if (EEH_MSG_Template::is_mt_active('payment_reminder')) { $send_pay_lnk = $attendee instanceof EE_Attendee && EE_Registry::instance()->CAP->current_user_can('ee_send_message', 'espresso_transactions_send_payment_reminder') ? ' <li> <a href="' . $send_pay_lnk_url . '" title="' . esc_attr__('Send Payment Reminder', 'event_espresso') . '" class="tiny-text"> <span class="dashicons dashicons-email-alt"></span> </a> </li>' : ''; $send_pay_lnk = $item->get('STS_ID') != EEM_Transaction::complete_status_code && $item->get('STS_ID') != EEM_Transaction::overpaid_status_code ? $send_pay_lnk : ''; } else { $send_pay_lnk = ''; } $view_reg_lnk = EE_Registry::instance()->CAP->current_user_can('ee_read_registration', 'espresso_registrations_view_registration', $registration->ID()) ? ' <li> <a href="' . $view_reg_lnk_url . '" title="' . esc_attr__('View Registration Details', 'event_espresso') . '" class="tiny-text"> <span class="dashicons dashicons-clipboard"></span> </a> </li>' : ''; return $this->_action_string($view_lnk . $dl_invoice_lnk . $dl_receipt_lnk . $view_reg_lnk . $send_pay_lnk, $item, 'ul', 'txn-overview-actions-ul'); }
/** * _transaction_details * generates HTML for the View Transaction Details Admin page * * @access protected * @return void */ protected function _transaction_details() { do_action('AHEE__Transactions_Admin_Page__transaction_details__start', $this->_transaction); $this->_set_transaction_status_array(); $this->_template_args = array(); $this->_template_args['transactions_page'] = $this->_wp_page_slug; $this->_set_transaction_object(); $primary_registration = $this->_transaction->primary_registration(); $attendee = $primary_registration instanceof EE_Registration ? $primary_registration->attendee() : NULL; $this->_template_args['txn_nmbr']['value'] = $this->_transaction->ID(); $this->_template_args['txn_nmbr']['label'] = __('Transaction Number', 'event_espresso'); $this->_template_args['txn_datetime']['value'] = $this->_transaction->get_i18n_datetime('TXN_timestamp'); $this->_template_args['txn_datetime']['label'] = __('Date', 'event_espresso'); $this->_template_args['txn_status']['value'] = self::$_txn_status[$this->_transaction->get('STS_ID')]; $this->_template_args['txn_status']['label'] = __('Transaction Status', 'event_espresso'); $this->_template_args['txn_status']['class'] = 'status-' . $this->_transaction->get('STS_ID'); $this->_template_args['grand_total'] = $this->_transaction->get('TXN_total'); $this->_template_args['total_paid'] = $this->_transaction->get('TXN_paid'); if ($attendee instanceof EE_Attendee && EE_Registry::instance()->CAP->current_user_can('ee_send_message', 'espresso_transactions_send_payment_reminder')) { $this->_template_args['send_payment_reminder_button'] = EEH_MSG_Template::is_mt_active('payment_reminder') && $this->_transaction->get('STS_ID') != EEM_Transaction::complete_status_code && $this->_transaction->get('STS_ID') != EEM_Transaction::overpaid_status_code ? EEH_Template::get_button_or_link(EE_Admin_Page::add_query_args_and_nonce(array('action' => 'send_payment_reminder', 'TXN_ID' => $this->_transaction->ID(), 'redirect_to' => 'view_transaction'), TXN_ADMIN_URL), __(' Send Payment Reminder', 'event_espresso'), 'button secondary-button right', 'dashicons dashicons-email-alt') : ''; } else { $this->_template_args['send_payment_reminder_button'] = ''; } $amount_due = $this->_transaction->get('TXN_total') - $this->_transaction->get('TXN_paid'); $this->_template_args['amount_due'] = EEH_Template::format_currency($amount_due, TRUE); if (EE_Registry::instance()->CFG->currency->sign_b4) { $this->_template_args['amount_due'] = EE_Registry::instance()->CFG->currency->sign . $this->_template_args['amount_due']; } else { $this->_template_args['amount_due'] = $this->_template_args['amount_due'] . EE_Registry::instance()->CFG->currency->sign; } $this->_template_args['amount_due_class'] = ''; if ($this->_transaction->get('TXN_paid') == $this->_transaction->get('TXN_total')) { // paid in full $this->_template_args['amount_due'] = FALSE; } elseif ($this->_transaction->get('TXN_paid') > $this->_transaction->get('TXN_total')) { // overpaid $this->_template_args['amount_due_class'] = 'txn-overview-no-payment-spn'; } elseif ($this->_transaction->get('TXN_total') > 0 && $this->_transaction->get('TXN_paid') > 0) { // monies owing $this->_template_args['amount_due_class'] = 'txn-overview-part-payment-spn'; } elseif ($this->_transaction->get('TXN_total') > 0 && $this->_transaction->get('TXN_paid') == 0) { // no payments made yet $this->_template_args['amount_due_class'] = 'txn-overview-no-payment-spn'; } elseif ($this->_transaction->get('TXN_total') == 0) { // free event $this->_template_args['amount_due'] = FALSE; } $payment_method = $this->_transaction->payment_method(); $this->_template_args['method_of_payment_name'] = $payment_method instanceof EE_Payment_Method ? $payment_method->admin_name() : __('Unknown', 'event_espresso'); $this->_template_args['currency_sign'] = EE_Registry::instance()->CFG->currency->sign; // link back to overview $this->_template_args['txn_overview_url'] = !empty($_SERVER['HTTP_REFERER']) ? $_SERVER['HTTP_REFERER'] : TXN_ADMIN_URL; // next link $next_txn = $this->_transaction->next(null, array(array('STS_ID' => array('!=', EEM_Transaction::failed_status_code))), 'TXN_ID'); $this->_template_args['next_transaction'] = $next_txn ? $this->_next_link(EE_Admin_Page::add_query_args_and_nonce(array('action' => 'view_transaction', 'TXN_ID' => $next_txn['TXN_ID']), TXN_ADMIN_URL), 'dashicons dashicons-arrow-right ee-icon-size-22') : ''; // previous link $previous_txn = $this->_transaction->previous(null, array(array('STS_ID' => array('!=', EEM_Transaction::failed_status_code))), 'TXN_ID'); $this->_template_args['previous_transaction'] = $previous_txn ? $this->_previous_link(EE_Admin_Page::add_query_args_and_nonce(array('action' => 'view_transaction', 'TXN_ID' => $previous_txn['TXN_ID']), TXN_ADMIN_URL), 'dashicons dashicons-arrow-left ee-icon-size-22') : ''; // were we just redirected here after adding a new registration ??? if (isset($this->_req_data['redirect_from'], $this->_req_data['EVT_ID'], $this->_req_data['event_name'])) { if (EE_Registry::instance()->CAP->current_user_can('ee_edit_registrations', 'espresso_registrations_new_registration', $this->_req_data['EVT_ID'])) { $this->_admin_page_title .= '<a id="add-new-registration" class="add-new-h2 button-primary" href="'; $this->_admin_page_title .= EE_Admin_Page::add_query_args_and_nonce(array('page' => 'espresso_registrations', 'action' => 'new_registration', 'return' => 'default', 'TXN_ID' => $this->_transaction->ID(), 'event_id' => $this->_req_data['EVT_ID']), REG_ADMIN_URL); $this->_admin_page_title .= '">'; $this->_admin_page_title .= sprintf(__('Add Another New Registration to Event: "%1$s" ?'), htmlentities(urldecode($this->_req_data['event_name']), ENT_QUOTES, 'UTF-8')); $this->_admin_page_title .= '</a>'; } EE_Registry::instance()->SSN->clear_session(__CLASS__, __FUNCTION__); } // grab messages at the last second $this->_template_args['notices'] = EE_Error::get_notices(); // path to template $template_path = TXN_TEMPLATE_PATH . 'txn_admin_details_header.template.php'; $this->_template_args['admin_page_header'] = EEH_Template::display_template($template_path, $this->_template_args, TRUE); // the details template wrapper $this->display_admin_page_with_sidebar(); }