/**
     * 		REG_date
     */
    function column_REG_date(EE_Registration $item)
    {
        //Build row actions
        $actions = array();
        //Build row actions
        $check_in_url = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'event_registrations', 'event_id' => $item->event_ID()), REG_ADMIN_URL);
        $actions['check_in'] = EE_Registry::instance()->CAP->current_user_can('ee_read_checkin', 'espresso_registrations_registration_checkins', $item->ID()) ? '
			<a href="' . $check_in_url . '" title="' . esc_attr__('The Check-In List allows you to easily toggle check-in status for this event', 'event_espresso') . '">' . __('View Check-ins', 'event_espresso') . '</a>' : __('View Check-ins', 'event_espresso');
        $view_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'view_transaction', 'TXN_ID' => $item->transaction()->ID()), TXN_ADMIN_URL);
        $REG_date = EE_Regisry::instance()->CAP->current_user_can('ee_read_transaction', 'espresso_transactions_view_transaction') ? '<a href="' . $view_lnk_url . '" title="' . esc_attr__('View Transaction Details', 'event_espresso') . '">' . $item->get_i18n_datetime('REG_date') . '</a>' : $item->get_i18n_datetime('REG_date');
        return sprintf('%1$s %2$s', $REG_date, $this->row_actions($actions));
    }
 /**
  * 		generates HTML for the View Registration Details Admin page
  *		@access protected
  *		@return void
  */
 protected function _registration_details()
 {
     $this->_template_args = array();
     $this->_set_registration_object();
     if (is_object($this->_registration)) {
         $transaction = $this->_registration->transaction() ? $this->_registration->transaction() : EE_Transaction::new_instance();
         $this->_session = $transaction->session_data();
         $event_id = $this->_registration->event_ID();
         $this->_template_args['reg_nmbr']['value'] = $this->_registration->ID();
         $this->_template_args['reg_nmbr']['label'] = __('Registration Number', 'event_espresso');
         $this->_template_args['reg_datetime']['value'] = $this->_registration->get_i18n_datetime('REG_date');
         $this->_template_args['reg_datetime']['label'] = __('Date', 'event_espresso');
         $this->_template_args['grand_total'] = $transaction->total();
         $this->_template_args['currency_sign'] = EE_Registry::instance()->CFG->currency->sign;
         // link back to overview
         $this->_template_args['reg_overview_url'] = REG_ADMIN_URL;
         $this->_template_args['registration'] = $this->_registration;
         $this->_template_args['filtered_registrations_link'] = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'default', 'event_id' => $event_id), REG_ADMIN_URL);
         $this->_template_args['filtered_transactions_link'] = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'default', 'EVT_ID' => $event_id, 'page' => 'espresso_transactions'), admin_url('admin.php'));
         $this->_template_args['event_link'] = EE_Admin_Page::add_query_args_and_nonce(array('page' => 'espresso_events', 'action' => 'edit', 'post' => $event_id), admin_url('admin.php'));
         //next and previous links
         $next_reg = $this->_registration->next(null, array(), 'REG_ID');
         $this->_template_args['next_registration'] = $next_reg ? $this->_next_link(EE_Admin_Page::add_query_args_and_nonce(array('action' => 'view_registration', '_REG_ID' => $next_reg['REG_ID']), REG_ADMIN_URL), 'dashicons dashicons-arrow-right ee-icon-size-22') : '';
         $previous_reg = $this->_registration->previous(null, array(), 'REG_ID');
         $this->_template_args['previous_registration'] = $previous_reg ? $this->_previous_link(EE_Admin_Page::add_query_args_and_nonce(array('action' => 'view_registration', '_REG_ID' => $previous_reg['REG_ID']), REG_ADMIN_URL), 'dashicons dashicons-arrow-left ee-icon-size-22') : '';
         // grab header
         $template_path = REG_TEMPLATE_PATH . 'reg_admin_details_header.template.php';
         $this->_template_args['admin_page_header'] = EEH_Template::display_template($template_path, $this->_template_args, TRUE);
     } else {
         $this->_template_args['admin_page_header'] = $this->display_espresso_notices();
     }
     // the details template wrapper
     $this->display_admin_page_with_sidebar();
 }
 function espresso_replace_invoice_shortcodes($content)
 {
     $EE = EE_Registry::instance();
     //Create the logo
     $invoice_logo_url = $this->invoice_payment_method->get_extra_meta('pdf_logo_image', TRUE, $EE->CFG->organization->logo_url);
     if (!empty($invoice_logo_url)) {
         $image_size = getimagesize($invoice_logo_url);
         $invoice_logo_image = '<img class="logo screen" src="' . $invoice_logo_url . '" ' . $image_size[3] . ' alt="logo" /> ';
     } else {
         $invoice_logo_image = '';
     }
     $SearchValues = array("[organization]", "[registration_code]", "[transaction_id]", "[name]", "[base_url]", "[download_link]", "[invoice_logo_image]", "[street]", "[city]", "[state]", "[zip]", "[email]", "[vat]", "[registration_date]", "[instructions]");
     $primary_attendee = $this->transaction->primary_registration()->attendee();
     $org_state = EE_Registry::instance()->load_model('State')->get_one_by_ID($EE->CFG->organization->STA_ID);
     if ($org_state) {
         $org_state_name = $org_state->name();
     } else {
         $org_state_name = '';
     }
     $ReplaceValues = array($EE->CFG->organization->get_pretty('name'), $this->registration->reg_code(), $this->transaction->ID(), $primary_attendee->full_name(), is_dir(EVENT_ESPRESSO_GATEWAY_DIR . '/invoice') ? EVENT_ESPRESSO_GATEWAY_URL . 'Invoice/lib/templates/' : EE_GATEWAYS_URL . 'Invoice/lib/templates/', $this->registration->invoice_url(), $invoice_logo_image, empty($EE->CFG->organization->address_2) ? $EE->CFG->organization->get_pretty('address_1') : $EE->CFG->organization->get_pretty('address_1') . '<br>' . $EE->CFG->organization->get_pretty('address_2'), $EE->CFG->organization->get_pretty('city'), $org_state_name, $EE->CFG->organization->get_pretty('zip'), $EE->CFG->organization->get_pretty('email'), $EE->CFG->organization->vat, $this->registration->get_i18n_datetime('REG_date', get_option('date_format')), $this->invoice_payment_method->get_extra_meta('pdf_instructions', TRUE));
     return str_replace($SearchValues, $ReplaceValues, $content);
 }