コード例 #1
0
 /**
  * 		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();
 }