@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
| 2 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) |
|
| 3 | 3 | exit('NO direct script access allowed'); |
| 4 | 4 | |
| 5 | 5 | /** |
@@ -87,13 +87,13 @@ discard block |
||
| 87 | 87 | |
| 88 | 88 | |
| 89 | 89 | public function load_scripts_styles() { |
| 90 | - wp_register_style( 'ee-other-services-css', EE_OTHER_SERVICES_ASSETS_URL . 'other-services.css' , array('ee-admin-css') , EVENT_ESPRESSO_VERSION ); |
|
| 91 | - wp_enqueue_style( 'ee-other-services-css' ); |
|
| 90 | + wp_register_style('ee-other-services-css', EE_OTHER_SERVICES_ASSETS_URL.'other-services.css', array('ee-admin-css'), EVENT_ESPRESSO_VERSION); |
|
| 91 | + wp_enqueue_style('ee-other-services-css'); |
|
| 92 | 92 | } |
| 93 | 93 | |
| 94 | 94 | |
| 95 | 95 | protected function _other_services() { |
| 96 | - $this->_template_args['admin_page_content'] = EEH_Template::display_template( EE_OTHER_SERVICES_ADMIN_TEMPLATE_PATH . 'other_services_content.template.php', array(), true ); |
|
| 96 | + $this->_template_args['admin_page_content'] = EEH_Template::display_template(EE_OTHER_SERVICES_ADMIN_TEMPLATE_PATH.'other_services_content.template.php', array(), true); |
|
| 97 | 97 | $this->display_admin_page_with_no_sidebar(); |
| 98 | 98 | } |
| 99 | 99 | |
@@ -1,6 +1,7 @@ |
||
| 1 | 1 | <?php |
| 2 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
| 2 | +if (!defined('EVENT_ESPRESSO_VERSION') ) { |
|
| 3 | 3 | exit('NO direct script access allowed'); |
| 4 | +} |
|
| 4 | 5 | |
| 5 | 6 | /** |
| 6 | 7 | * Event Espresso |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
| 2 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) |
|
| 3 | 3 | exit('NO direct script access allowed'); |
| 4 | 4 | |
| 5 | 5 | /** |
@@ -32,11 +32,11 @@ discard block |
||
| 32 | 32 | |
| 33 | 33 | public function __construct() { |
| 34 | 34 | //define some help/support page related constants |
| 35 | - define( 'EE_OTHER_SERVICES_PG_SLUG', 'espresso_packages' ); |
|
| 36 | - define( 'EE_OTHER_SERVICES_ADMIN_URL', admin_url('admin.php?page=' . EE_OTHER_SERVICES_PG_SLUG )); |
|
| 37 | - define( 'EE_OTHER_SERVICES_ADMIN_TEMPLATE_PATH', EE_ADMIN_PAGES . 'other_services/templates/'); |
|
| 38 | - define( 'EE_OTHER_SERVICES_ADMIN', EE_ADMIN_PAGES . 'other_services/' ); |
|
| 39 | - define( 'EE_OTHER_SERVICES_ASSETS_URL', EE_ADMIN_PAGES_URL . 'other_services/assets/'); |
|
| 35 | + define('EE_OTHER_SERVICES_PG_SLUG', 'espresso_packages'); |
|
| 36 | + define('EE_OTHER_SERVICES_ADMIN_URL', admin_url('admin.php?page='.EE_OTHER_SERVICES_PG_SLUG)); |
|
| 37 | + define('EE_OTHER_SERVICES_ADMIN_TEMPLATE_PATH', EE_ADMIN_PAGES.'other_services/templates/'); |
|
| 38 | + define('EE_OTHER_SERVICES_ADMIN', EE_ADMIN_PAGES.'other_services/'); |
|
| 39 | + define('EE_OTHER_SERVICES_ASSETS_URL', EE_ADMIN_PAGES_URL.'other_services/assets/'); |
|
| 40 | 40 | |
| 41 | 41 | parent::__construct(); |
| 42 | 42 | } |
@@ -46,7 +46,7 @@ discard block |
||
| 46 | 46 | } |
| 47 | 47 | |
| 48 | 48 | protected function _set_menu_map() { |
| 49 | - $this->_menu_map = new EE_Admin_Page_Sub_Menu( array( |
|
| 49 | + $this->_menu_map = new EE_Admin_Page_Sub_Menu(array( |
|
| 50 | 50 | 'menu_group' => 'extras', |
| 51 | 51 | 'menu_order' => 30, |
| 52 | 52 | 'show_on_menu' => EE_Admin_Page_Menu_Map::BLOG_AND_NETWORK_ADMIN, |
@@ -1,6 +1,7 @@ |
||
| 1 | 1 | <?php |
| 2 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
| 2 | +if (!defined('EVENT_ESPRESSO_VERSION') ) { |
|
| 3 | 3 | exit('NO direct script access allowed'); |
| 4 | +} |
|
| 4 | 5 | |
| 5 | 6 | /** |
| 6 | 7 | * Event Espresso |
@@ -1,6 +1,7 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
| 2 | +if (!defined('EVENT_ESPRESSO_VERSION') ) { |
|
| 3 | 3 | exit('NO direct script access allowed'); |
| 4 | +} |
|
| 4 | 5 | |
| 5 | 6 | /** |
| 6 | 7 | * Event Espresso |
@@ -185,9 +186,9 @@ discard block |
||
| 185 | 186 | public function column_PMD_ID(EE_Change_Log $item){ |
| 186 | 187 | if($item->object() instanceof EE_Payment_Method){ |
| 187 | 188 | return $item->object()->admin_name(); |
| 188 | - }elseif($item->object() instanceof EE_Payment && $item->object()->payment_method()){ |
|
| 189 | + } elseif($item->object() instanceof EE_Payment && $item->object()->payment_method()){ |
|
| 189 | 190 | return $item->object()->payment_method()->admin_name(); |
| 190 | - }else{ |
|
| 191 | + } else{ |
|
| 191 | 192 | return __("No longer exists", 'event_espresso'); |
| 192 | 193 | } |
| 193 | 194 | } |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
| 2 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) |
|
| 3 | 3 | exit('NO direct script access allowed'); |
| 4 | 4 | |
| 5 | 5 | /** |
@@ -35,7 +35,7 @@ discard block |
||
| 35 | 35 | * @param \EE_Admin_Page $admin_page |
| 36 | 36 | * @return Payment_Log_Admin_List_Table |
| 37 | 37 | */ |
| 38 | - public function __construct( $admin_page ) { |
|
| 38 | + public function __construct($admin_page) { |
|
| 39 | 39 | parent::__construct($admin_page); |
| 40 | 40 | } |
| 41 | 41 | |
@@ -52,8 +52,8 @@ discard block |
||
| 52 | 52 | // }else{ |
| 53 | 53 | // $this->_data = $this->_admin_page->get_questions( $this->_per_page,$this->_current_page, FALSE ); |
| 54 | 54 | // } |
| 55 | - $this->_all_data_count = $this->_admin_page->get_payment_logs( $this->_per_page,$this->_current_page, TRUE ); |
|
| 56 | - add_action('AHEE__EE_Admin_List_Table__extra_tablenav__after_bottom_buttons',array($this,'add_download_logs_checkbox')); |
|
| 55 | + $this->_all_data_count = $this->_admin_page->get_payment_logs($this->_per_page, $this->_current_page, TRUE); |
|
| 56 | + add_action('AHEE__EE_Admin_List_Table__extra_tablenav__after_bottom_buttons', array($this, 'add_download_logs_checkbox')); |
|
| 57 | 57 | } |
| 58 | 58 | |
| 59 | 59 | |
@@ -63,8 +63,8 @@ discard block |
||
| 63 | 63 | * adds a checkbox to the bottom of the list table, instead of at the top with the rest of the filters |
| 64 | 64 | * @return void |
| 65 | 65 | */ |
| 66 | - public function add_download_logs_checkbox(){ |
|
| 67 | - echo "<input type='submit' class='button-primary' id='download_results' name='download_results' value='". __( 'Download Results', 'event_espresso' )."'>"; |
|
| 66 | + public function add_download_logs_checkbox() { |
|
| 67 | + echo "<input type='submit' class='button-primary' id='download_results' name='download_results' value='".__('Download Results', 'event_espresso')."'>"; |
|
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | |
@@ -75,8 +75,8 @@ discard block |
||
| 75 | 75 | */ |
| 76 | 76 | protected function _set_properties() { |
| 77 | 77 | $this->_wp_list_args = array( |
| 78 | - 'singular' => __('payment log', 'event_espresso' ), |
|
| 79 | - 'plural' => __('payment logs', 'event_espresso' ), |
|
| 78 | + 'singular' => __('payment log', 'event_espresso'), |
|
| 79 | + 'plural' => __('payment logs', 'event_espresso'), |
|
| 80 | 80 | 'ajax' => TRUE, //for now, |
| 81 | 81 | 'screen' => $this->_admin_page->get_current_screen()->id |
| 82 | 82 | ); |
@@ -90,7 +90,7 @@ discard block |
||
| 90 | 90 | ); |
| 91 | 91 | |
| 92 | 92 | $this->_sortable_columns = array( |
| 93 | - 'LOG_time' => array( 'LOG_time' => TRUE ), |
|
| 93 | + 'LOG_time' => array('LOG_time' => TRUE), |
|
| 94 | 94 | ); |
| 95 | 95 | |
| 96 | 96 | $this->_hidden_columns = array( |
@@ -108,18 +108,18 @@ discard block |
||
| 108 | 108 | $filters = array(); |
| 109 | 109 | //todo we're currently using old functions here. We need to move things into the Events_Admin_Page() class as methods. |
| 110 | 110 | $payment_methods = EEM_Payment_Method::instance()->get_all(); |
| 111 | - $payment_method_names = array(array('id'=>'all','text'=> __("All", 'event_espresso')),array('id'=>'0','text'=> __("Unknown Payment Method", 'event_espresso'))); |
|
| 112 | - foreach($payment_methods as $payment_method){ |
|
| 113 | - $payment_method_names[] = array('id'=>$payment_method->ID(),'text'=>$payment_method->admin_name()); |
|
| 111 | + $payment_method_names = array(array('id'=>'all', 'text'=> __("All", 'event_espresso')), array('id'=>'0', 'text'=> __("Unknown Payment Method", 'event_espresso'))); |
|
| 112 | + foreach ($payment_methods as $payment_method) { |
|
| 113 | + $payment_method_names[] = array('id'=>$payment_method->ID(), 'text'=>$payment_method->admin_name()); |
|
| 114 | 114 | } |
| 115 | 115 | $filters[] = EEH_Form_Fields::select_input('_payment_method', $payment_method_names, isset($this->_req_data['_payment_method']) ? $this->_req_data['_payment_method'] : 'all'); |
| 116 | - $start_date = isset( $this->_req_data['payment-filter-start-date'] ) ? wp_strip_all_tags( $this->_req_data['payment-filter-start-date'] ) : date( 'm/d/Y', strtotime( '-6 months' )); |
|
| 117 | - $end_date = isset( $this->_req_data['payment-filter-end-date'] ) ? wp_strip_all_tags( $this->_req_data['payment-filter-end-date'] ) : date( 'm/d/Y' ); |
|
| 116 | + $start_date = isset($this->_req_data['payment-filter-start-date']) ? wp_strip_all_tags($this->_req_data['payment-filter-start-date']) : date('m/d/Y', strtotime('-6 months')); |
|
| 117 | + $end_date = isset($this->_req_data['payment-filter-end-date']) ? wp_strip_all_tags($this->_req_data['payment-filter-end-date']) : date('m/d/Y'); |
|
| 118 | 118 | ob_start(); |
| 119 | 119 | ?> |
| 120 | - <label for="txn-filter-start-date"><?php _e( 'Display Transactions from ', 'event_espresso' ); ?></label> |
|
| 120 | + <label for="txn-filter-start-date"><?php _e('Display Transactions from ', 'event_espresso'); ?></label> |
|
| 121 | 121 | <input id="payment-filter-start-date" class="datepicker" type="text" value="<?php echo $start_date; ?>" name="payment-filter-start-date" size="15"/> |
| 122 | - <label for="txn-filter-end-date"><?php _e( ' until ', 'event_espresso' ); ?></label> |
|
| 122 | + <label for="txn-filter-end-date"><?php _e(' until ', 'event_espresso'); ?></label> |
|
| 123 | 123 | <input id="payment-filter-end-date" class="datepicker" type="text" value="<?php echo $end_date; ?>" name="payment-filter-end-date" size="15"/> |
| 124 | 124 | <?php |
| 125 | 125 | $filters[] = ob_get_clean(); |
@@ -133,7 +133,7 @@ discard block |
||
| 133 | 133 | * @return void |
| 134 | 134 | */ |
| 135 | 135 | protected function _add_view_counts() { |
| 136 | - $this->_views['all']['count'] = $this->_admin_page->get_payment_logs( $this->_per_page,$this->_current_page, TRUE ); |
|
| 136 | + $this->_views['all']['count'] = $this->_admin_page->get_payment_logs($this->_per_page, $this->_current_page, TRUE); |
|
| 137 | 137 | } |
| 138 | 138 | |
| 139 | 139 | |
@@ -144,7 +144,7 @@ discard block |
||
| 144 | 144 | * @return string |
| 145 | 145 | */ |
| 146 | 146 | public function column_cb($item) { |
| 147 | - return sprintf( '<input type="checkbox" class="option_id" name="checkbox[%1$d]" value="%1$d" />', $item->ID() ); |
|
| 147 | + return sprintf('<input type="checkbox" class="option_id" name="checkbox[%1$d]" value="%1$d" />', $item->ID()); |
|
| 148 | 148 | } |
| 149 | 149 | |
| 150 | 150 | |
@@ -170,7 +170,7 @@ discard block |
||
| 170 | 170 | * @param \EE_Change_Log $item |
| 171 | 171 | * @return string |
| 172 | 172 | */ |
| 173 | - public function column_LOG_time(EE_Change_Log $item){ |
|
| 173 | + public function column_LOG_time(EE_Change_Log $item) { |
|
| 174 | 174 | return $item->get_datetime('LOG_time'); |
| 175 | 175 | } |
| 176 | 176 | |
@@ -181,12 +181,12 @@ discard block |
||
| 181 | 181 | * @param \EE_Change_Log $item |
| 182 | 182 | * @return string |
| 183 | 183 | */ |
| 184 | - public function column_PMD_ID(EE_Change_Log $item){ |
|
| 185 | - if($item->object() instanceof EE_Payment_Method){ |
|
| 184 | + public function column_PMD_ID(EE_Change_Log $item) { |
|
| 185 | + if ($item->object() instanceof EE_Payment_Method) { |
|
| 186 | 186 | return $item->object()->admin_name(); |
| 187 | - }elseif($item->object() instanceof EE_Payment && $item->object()->payment_method()){ |
|
| 187 | + }elseif ($item->object() instanceof EE_Payment && $item->object()->payment_method()) { |
|
| 188 | 188 | return $item->object()->payment_method()->admin_name(); |
| 189 | - }else{ |
|
| 189 | + } else { |
|
| 190 | 190 | return __("No longer exists", 'event_espresso'); |
| 191 | 191 | } |
| 192 | 192 | } |
@@ -198,11 +198,11 @@ discard block |
||
| 198 | 198 | * @param \EE_Change_Log $item |
| 199 | 199 | * @return string |
| 200 | 200 | */ |
| 201 | - public function column_TXN_ID(EE_Change_Log $item){ |
|
| 202 | - if($item->object() instanceof EE_Payment){ |
|
| 203 | - if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_transaction', 'espresso_transactions_view_transaction', $item->object()->TXN_ID() )) { |
|
| 204 | - $view_txn_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'view_transaction', 'TXN_ID'=>$item->object()->TXN_ID() ), TXN_ADMIN_URL ); |
|
| 205 | - return '<a href="'.$view_txn_lnk_url.'" title="' . sprintf( esc_attr__( 'click to view transaction #%s', 'event_espresso' ), $item->object()->TXN_ID() ) . '">' . sprintf( __( 'view txn %s', 'event_espresso' ), $item->object()->TXN_ID() ) . '</a>'; |
|
| 201 | + public function column_TXN_ID(EE_Change_Log $item) { |
|
| 202 | + if ($item->object() instanceof EE_Payment) { |
|
| 203 | + if (EE_Registry::instance()->CAP->current_user_can('ee_read_transaction', 'espresso_transactions_view_transaction', $item->object()->TXN_ID())) { |
|
| 204 | + $view_txn_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'view_transaction', 'TXN_ID'=>$item->object()->TXN_ID()), TXN_ADMIN_URL); |
|
| 205 | + return '<a href="'.$view_txn_lnk_url.'" title="'.sprintf(esc_attr__('click to view transaction #%s', 'event_espresso'), $item->object()->TXN_ID()).'">'.sprintf(__('view txn %s', 'event_espresso'), $item->object()->TXN_ID()).'</a>'; |
|
| 206 | 206 | } |
| 207 | 207 | } else { |
| 208 | 208 | return __("Unable to find transaction", 'event_espresso'); |
@@ -83,7 +83,7 @@ discard block |
||
| 83 | 83 | * |
| 84 | 84 | * When cap mapping is implemented, some routes will need to use the singular form of |
| 85 | 85 | * capability method and also include the $id of the payment method for the route. |
| 86 | - **/ |
|
| 86 | + **/ |
|
| 87 | 87 | $this->_page_routes = array( |
| 88 | 88 | 'default' => array( |
| 89 | 89 | 'func'=>'_payment_methods_list', |
@@ -747,9 +747,9 @@ discard block |
||
| 747 | 747 | |
| 748 | 748 | /** |
| 749 | 749 | * _update_payment_settings |
| 750 | - * @access protected |
|
| 751 | - * @return array |
|
| 752 | - */ |
|
| 750 | + * @access protected |
|
| 751 | + * @return array |
|
| 752 | + */ |
|
| 753 | 753 | protected function _update_payment_settings() { |
| 754 | 754 | EE_Registry::instance()->CFG->registration->show_pending_payment_options = isset( $this->_req_data['show_pending_payment_options'] ) ? $this->_req_data['show_pending_payment_options'] : FALSE; |
| 755 | 755 | EE_Registry::instance()->CFG = apply_filters( 'FHEE__Payments_Admin_Page___update_payment_settings__CFG', EE_Registry::instance()->CFG ); |
@@ -1,6 +1,7 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
| 2 | +if (!defined('EVENT_ESPRESSO_VERSION') ) { |
|
| 3 | 3 | exit('NO direct script access allowed'); |
| 4 | +} |
|
| 4 | 5 | |
| 5 | 6 | /** |
| 6 | 7 | * Event Espresso |
@@ -655,7 +656,7 @@ discard block |
||
| 655 | 656 | $payment_method = EE_Payment_Method_Manager::instance()->activate_a_payment_method_of_type( $payment_method_type ); |
| 656 | 657 | |
| 657 | 658 | $this->_redirect_after_action(1, 'Payment Method', 'activated', array('action' => 'default','payment_method'=>$payment_method->slug())); |
| 658 | - }else{ |
|
| 659 | + } else{ |
|
| 659 | 660 | $this->_redirect_after_action(FALSE, 'Payment Method', 'activated', array('action' => 'default')); |
| 660 | 661 | } |
| 661 | 662 | } |
@@ -670,7 +671,7 @@ discard block |
||
| 670 | 671 | EE_Registry::instance()->load_lib('Payment_Method_Manager'); |
| 671 | 672 | $count_updated = EE_Payment_Method_Manager::instance()->deactivate_payment_method( $payment_method_slug ); |
| 672 | 673 | $this->_redirect_after_action($count_updated, 'Payment Method', 'deactivated', array('action' => 'default','payment_method'=>$payment_method_slug)); |
| 673 | - }else{ |
|
| 674 | + } else{ |
|
| 674 | 675 | $this->_redirect_after_action(FALSE, 'Payment Method', 'deactivated', array('action' => 'default')); |
| 675 | 676 | } |
| 676 | 677 | } |
@@ -712,7 +713,7 @@ discard block |
||
| 712 | 713 | $pm = $correct_pmt_form_to_use->get_model_object(); |
| 713 | 714 | /** @var $pm EE_Payment_Method */ |
| 714 | 715 | $this->_redirect_after_action(TRUE, 'Payment Method', 'updated', array('action' => 'default','payment_method'=>$pm->slug())); |
| 715 | - }else{ |
|
| 716 | + } else{ |
|
| 716 | 717 | EE_Error::add_error( |
| 717 | 718 | sprintf( |
| 718 | 719 | __('Payment method of type %s was not saved because there were validation errors. They have been marked in the form', 'event_espresso'), |
@@ -838,7 +839,7 @@ discard block |
||
| 838 | 839 | if(isset($this->_req_data['order'])){ |
| 839 | 840 | $sort = ( isset( $this->_req_data['order'] ) && ! empty( $this->_req_data['order'] )) ? $this->_req_data['order'] : 'DESC'; |
| 840 | 841 | $query_params['order_by'] = array('LOG_time' => $sort); |
| 841 | - }else{ |
|
| 842 | + } else{ |
|
| 842 | 843 | $query_params['order_by'] = array('LOG_time' => 'DESC'); |
| 843 | 844 | } |
| 844 | 845 | $offset = ($current_page-1)*$per_page; |
@@ -881,7 +882,7 @@ discard block |
||
| 881 | 882 | $comparison = $timeA < $timeB ? -1 : 1; |
| 882 | 883 | if(strtoupper($this->_sort_logs_again_direction) == 'DESC'){ |
| 883 | 884 | return $comparison * -1; |
| 884 | - }else{ |
|
| 885 | + } else{ |
|
| 885 | 886 | return $comparison; |
| 886 | 887 | } |
| 887 | 888 | } |
@@ -896,7 +897,7 @@ discard block |
||
| 896 | 897 | if( $payment_log->object() instanceof EE_Payment ){ |
| 897 | 898 | $payment_method = $payment_log->object()->payment_method(); |
| 898 | 899 | $transaction = $payment_log->object()->transaction(); |
| 899 | - }elseif($payment_log->object() instanceof EE_Payment_Method){ |
|
| 900 | + } elseif($payment_log->object() instanceof EE_Payment_Method){ |
|
| 900 | 901 | $payment_method = $payment_log->object(); |
| 901 | 902 | } |
| 902 | 903 | } |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
| 2 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) |
|
| 3 | 3 | exit('NO direct script access allowed'); |
| 4 | 4 | |
| 5 | 5 | /** |
@@ -44,8 +44,8 @@ discard block |
||
| 44 | 44 | * @param bool $routing indicate whether we want to just load the object and handle routing or just load the object. |
| 45 | 45 | * @return \Payments_Admin_Page |
| 46 | 46 | */ |
| 47 | - public function __construct( $routing = TRUE ) { |
|
| 48 | - parent::__construct( $routing ); |
|
| 47 | + public function __construct($routing = TRUE) { |
|
| 48 | + parent::__construct($routing); |
|
| 49 | 49 | } |
| 50 | 50 | |
| 51 | 51 | |
@@ -130,19 +130,19 @@ discard block |
||
| 130 | 130 | protected function _set_page_config() { |
| 131 | 131 | $payment_method_list_config = array( |
| 132 | 132 | 'nav' => array( |
| 133 | - 'label' => __( 'Payment Methods', 'event_espresso' ), |
|
| 133 | + 'label' => __('Payment Methods', 'event_espresso'), |
|
| 134 | 134 | 'order' => 10 |
| 135 | 135 | ), |
| 136 | 136 | 'metaboxes' => $this->_default_espresso_metaboxes, |
| 137 | 137 | 'help_tabs' => array_merge( |
| 138 | 138 | array( |
| 139 | 139 | 'payment_methods_overview_help_tab' => array( |
| 140 | - 'title' => __( 'Payment Methods Overview', 'event_espresso' ), |
|
| 140 | + 'title' => __('Payment Methods Overview', 'event_espresso'), |
|
| 141 | 141 | 'filename' => 'payment_methods_overview' |
| 142 | 142 | ) |
| 143 | 143 | ), |
| 144 | 144 | $this->_add_payment_method_help_tabs() ), |
| 145 | - 'help_tour' => array( 'Payment_Methods_Selection_Help_Tour' ), |
|
| 145 | + 'help_tour' => array('Payment_Methods_Selection_Help_Tour'), |
|
| 146 | 146 | 'require_nonce' => false |
| 147 | 147 | ); |
| 148 | 148 | |
@@ -160,7 +160,7 @@ discard block |
||
| 160 | 160 | ) |
| 161 | 161 | ), |
| 162 | 162 | //'help_tour' => array( 'Payment_Methods_Settings_Help_Tour' ), |
| 163 | - 'metaboxes' => array_merge( $this->_default_espresso_metaboxes, array( '_publish_post_box' ) ), |
|
| 163 | + 'metaboxes' => array_merge($this->_default_espresso_metaboxes, array('_publish_post_box')), |
|
| 164 | 164 | 'require_nonce' => FALSE |
| 165 | 165 | ), |
| 166 | 166 | 'payment_log'=>array( |
@@ -179,17 +179,17 @@ discard block |
||
| 179 | 179 | /** |
| 180 | 180 | * @return array |
| 181 | 181 | */ |
| 182 | - protected function _add_payment_method_help_tabs(){ |
|
| 182 | + protected function _add_payment_method_help_tabs() { |
|
| 183 | 183 | EE_Registry::instance()->load_lib('Payment_Method_Manager'); |
| 184 | 184 | $payment_method_types = EE_Payment_Method_Manager::instance()->payment_method_types(); |
| 185 | 185 | $all_pmt_help_tabs_config = array(); |
| 186 | - foreach( $payment_method_types as $payment_method_type ){ |
|
| 187 | - if ( ! EE_Registry::instance()->CAP->current_user_can( $payment_method_type->cap_name(), 'specific_payment_method_type_access' ) ) { |
|
| 186 | + foreach ($payment_method_types as $payment_method_type) { |
|
| 187 | + if ( ! EE_Registry::instance()->CAP->current_user_can($payment_method_type->cap_name(), 'specific_payment_method_type_access')) { |
|
| 188 | 188 | continue; |
| 189 | 189 | } |
| 190 | - foreach( $payment_method_type->help_tabs_config() as $help_tab_name => $config ){ |
|
| 191 | - $template_args = isset( $config[ 'template_args' ] ) ? $config[ 'template_args' ] : array(); |
|
| 192 | - $template_args[ 'admin_page_obj' ] = $this; |
|
| 190 | + foreach ($payment_method_type->help_tabs_config() as $help_tab_name => $config) { |
|
| 191 | + $template_args = isset($config['template_args']) ? $config['template_args'] : array(); |
|
| 192 | + $template_args['admin_page_obj'] = $this; |
|
| 193 | 193 | $all_pmt_help_tabs_config[$help_tab_name] = array( |
| 194 | 194 | 'title'=>$config['title'], |
| 195 | 195 | 'content'=>EEH_Template::display_template( |
@@ -216,9 +216,9 @@ discard block |
||
| 216 | 216 | |
| 217 | 217 | |
| 218 | 218 | public function load_scripts_styles() { |
| 219 | - wp_enqueue_script( 'ee_admin_js' ); |
|
| 220 | - wp_enqueue_script( 'ee-text-links' ); |
|
| 221 | - wp_enqueue_script( 'espresso_payments', EE_PAYMENTS_ASSETS_URL . 'espresso_payments_admin.js', array( 'espresso-ui-theme', 'ee-datepicker' ), EVENT_ESPRESSO_VERSION, TRUE ); |
|
| 219 | + wp_enqueue_script('ee_admin_js'); |
|
| 220 | + wp_enqueue_script('ee-text-links'); |
|
| 221 | + wp_enqueue_script('espresso_payments', EE_PAYMENTS_ASSETS_URL.'espresso_payments_admin.js', array('espresso-ui-theme', 'ee-datepicker'), EVENT_ESPRESSO_VERSION, TRUE); |
|
| 222 | 222 | } |
| 223 | 223 | |
| 224 | 224 | |
@@ -227,9 +227,9 @@ discard block |
||
| 227 | 227 | |
| 228 | 228 | public function load_scripts_styles_default() { |
| 229 | 229 | //styles |
| 230 | - wp_register_style( 'espresso_payments', EE_PAYMENTS_ASSETS_URL . 'ee-payments.css', array(), EVENT_ESPRESSO_VERSION ); |
|
| 231 | - wp_enqueue_style( 'espresso_payments' ); |
|
| 232 | - wp_enqueue_style( 'ee-text-links' ); |
|
| 230 | + wp_register_style('espresso_payments', EE_PAYMENTS_ASSETS_URL.'ee-payments.css', array(), EVENT_ESPRESSO_VERSION); |
|
| 231 | + wp_enqueue_style('espresso_payments'); |
|
| 232 | + wp_enqueue_style('ee-text-links'); |
|
| 233 | 233 | //scripts |
| 234 | 234 | } |
| 235 | 235 | |
@@ -243,44 +243,44 @@ discard block |
||
| 243 | 243 | * to the loading process. However, people MUST setup the details for the payment method so its safe to do a |
| 244 | 244 | * recheck here. |
| 245 | 245 | */ |
| 246 | - EE_Registry::instance()->load_lib( 'Payment_Method_Manager' ); |
|
| 246 | + EE_Registry::instance()->load_lib('Payment_Method_Manager'); |
|
| 247 | 247 | EEM_Payment_Method::instance()->verify_button_urls(); |
| 248 | 248 | //setup tabs, one for each payment method type |
| 249 | 249 | $tabs = array(); |
| 250 | 250 | $payment_methods = array(); |
| 251 | - foreach( EE_Payment_Method_Manager::instance()->payment_method_types() as $pmt_obj ) { |
|
| 251 | + foreach (EE_Payment_Method_Manager::instance()->payment_method_types() as $pmt_obj) { |
|
| 252 | 252 | // we don't want to show admin-only PMTs for now |
| 253 | - if ( $pmt_obj instanceof EE_PMT_Admin_Only ) { |
|
| 253 | + if ($pmt_obj instanceof EE_PMT_Admin_Only) { |
|
| 254 | 254 | continue; |
| 255 | 255 | } |
| 256 | 256 | //check access |
| 257 | - if ( ! EE_Registry::instance()->CAP->current_user_can( $pmt_obj->cap_name(), 'specific_payment_method_type_access' ) ) { |
|
| 257 | + if ( ! EE_Registry::instance()->CAP->current_user_can($pmt_obj->cap_name(), 'specific_payment_method_type_access')) { |
|
| 258 | 258 | continue; |
| 259 | 259 | } |
| 260 | 260 | //check for any active pms of that type |
| 261 | - $payment_method = EEM_Payment_Method::instance()->get_one_of_type( $pmt_obj->system_name() ); |
|
| 262 | - if ( ! $payment_method instanceof EE_Payment_Method ) { |
|
| 261 | + $payment_method = EEM_Payment_Method::instance()->get_one_of_type($pmt_obj->system_name()); |
|
| 262 | + if ( ! $payment_method instanceof EE_Payment_Method) { |
|
| 263 | 263 | $payment_method = EE_Payment_Method::new_instance( |
| 264 | 264 | array( |
| 265 | - 'PMD_slug' =>sanitize_key( $pmt_obj->system_name() ), |
|
| 265 | + 'PMD_slug' =>sanitize_key($pmt_obj->system_name()), |
|
| 266 | 266 | 'PMD_type' =>$pmt_obj->system_name(), |
| 267 | 267 | 'PMD_name' =>$pmt_obj->pretty_name(), |
| 268 | 268 | 'PMD_admin_name' =>$pmt_obj->pretty_name() |
| 269 | 269 | ) |
| 270 | 270 | ); |
| 271 | 271 | } |
| 272 | - $payment_methods[ $payment_method->slug() ] = $payment_method; |
|
| 272 | + $payment_methods[$payment_method->slug()] = $payment_method; |
|
| 273 | 273 | } |
| 274 | - $payment_methods = apply_filters( 'FHEE__Payments_Admin_Page___payment_methods_list__payment_methods', $payment_methods ); |
|
| 275 | - foreach( $payment_methods as $payment_method ) { |
|
| 276 | - if ( $payment_method instanceof EE_Payment_Method ) { |
|
| 274 | + $payment_methods = apply_filters('FHEE__Payments_Admin_Page___payment_methods_list__payment_methods', $payment_methods); |
|
| 275 | + foreach ($payment_methods as $payment_method) { |
|
| 276 | + if ($payment_method instanceof EE_Payment_Method) { |
|
| 277 | 277 | add_meta_box( |
| 278 | 278 | //html id |
| 279 | - 'espresso_' . $payment_method->slug() . '_payment_settings', |
|
| 279 | + 'espresso_'.$payment_method->slug().'_payment_settings', |
|
| 280 | 280 | //title |
| 281 | - sprintf( __( '%s Settings', 'event_espresso' ), $payment_method->admin_name() ), |
|
| 281 | + sprintf(__('%s Settings', 'event_espresso'), $payment_method->admin_name()), |
|
| 282 | 282 | //callback |
| 283 | - array( $this, 'payment_method_settings_meta_box' ), |
|
| 283 | + array($this, 'payment_method_settings_meta_box'), |
|
| 284 | 284 | //post type |
| 285 | 285 | null, |
| 286 | 286 | //context |
@@ -288,19 +288,19 @@ discard block |
||
| 288 | 288 | //priority |
| 289 | 289 | 'default', |
| 290 | 290 | //callback args |
| 291 | - array( 'payment_method' => $payment_method ) |
|
| 291 | + array('payment_method' => $payment_method) |
|
| 292 | 292 | ); |
| 293 | 293 | //setup for tabbed content |
| 294 | - $tabs[ $payment_method->slug() ] = array( |
|
| 294 | + $tabs[$payment_method->slug()] = array( |
|
| 295 | 295 | 'label' => $payment_method->admin_name(), |
| 296 | 296 | 'class' => $payment_method->active() ? 'gateway-active' : '', |
| 297 | - 'href' => 'espresso_' . $payment_method->slug() . '_payment_settings', |
|
| 298 | - 'title' => __( 'Modify this Payment Method', 'event_espresso' ), |
|
| 297 | + 'href' => 'espresso_'.$payment_method->slug().'_payment_settings', |
|
| 298 | + 'title' => __('Modify this Payment Method', 'event_espresso'), |
|
| 299 | 299 | 'slug' => $payment_method->slug() |
| 300 | 300 | ); |
| 301 | 301 | } |
| 302 | 302 | } |
| 303 | - $this->_template_args['admin_page_header'] = EEH_Tabbed_Content::tab_text_links( $tabs, 'payment_method_links', '|', $this->_get_active_payment_method_slug() ); |
|
| 303 | + $this->_template_args['admin_page_header'] = EEH_Tabbed_Content::tab_text_links($tabs, 'payment_method_links', '|', $this->_get_active_payment_method_slug()); |
|
| 304 | 304 | $this->display_admin_page_with_sidebar(); |
| 305 | 305 | |
| 306 | 306 | } |
@@ -311,20 +311,20 @@ discard block |
||
| 311 | 311 | * _get_active_payment_method_slug |
| 312 | 312 | * @return string |
| 313 | 313 | */ |
| 314 | - protected function _get_active_payment_method_slug(){ |
|
| 314 | + protected function _get_active_payment_method_slug() { |
|
| 315 | 315 | $payment_method_slug = FALSE; |
| 316 | 316 | //decide which payment method tab to open first, as dictated by the request's 'payment_method' |
| 317 | - if ( isset( $this->_req_data['payment_method'] )) { |
|
| 317 | + if (isset($this->_req_data['payment_method'])) { |
|
| 318 | 318 | // if they provided the current payment method, use it |
| 319 | - $payment_method_slug = sanitize_key( $this->_req_data['payment_method'] ); |
|
| 319 | + $payment_method_slug = sanitize_key($this->_req_data['payment_method']); |
|
| 320 | 320 | } |
| 321 | - $payment_method = EEM_Payment_Method::instance()->get_one( array( array( 'PMD_slug' => $payment_method_slug ))); |
|
| 321 | + $payment_method = EEM_Payment_Method::instance()->get_one(array(array('PMD_slug' => $payment_method_slug))); |
|
| 322 | 322 | // if that didn't work or wasn't provided, find another way to select the current pm |
| 323 | - if ( ! $this->_verify_payment_method( $payment_method )) { |
|
| 323 | + if ( ! $this->_verify_payment_method($payment_method)) { |
|
| 324 | 324 | // like, looking for an active one |
| 325 | - $payment_method = EEM_Payment_Method::instance()->get_one_active( 'CART' ); |
|
| 325 | + $payment_method = EEM_Payment_Method::instance()->get_one_active('CART'); |
|
| 326 | 326 | // test that one as well |
| 327 | - if ( $this->_verify_payment_method( $payment_method )) { |
|
| 327 | + if ($this->_verify_payment_method($payment_method)) { |
|
| 328 | 328 | $payment_method_slug = $payment_method->slug(); |
| 329 | 329 | } else { |
| 330 | 330 | $payment_method_slug = 'paypal_standard'; |
@@ -342,11 +342,11 @@ discard block |
||
| 342 | 342 | * @param \EE_Payment_Method $payment_method |
| 343 | 343 | * @return boolean |
| 344 | 344 | */ |
| 345 | - protected function _verify_payment_method( $payment_method ){ |
|
| 345 | + protected function _verify_payment_method($payment_method) { |
|
| 346 | 346 | if ( |
| 347 | 347 | $payment_method instanceof EE_Payment_Method && |
| 348 | 348 | $payment_method->type_obj() instanceof EE_PMT_Base && |
| 349 | - EE_Registry::instance()->CAP->current_user_can( $payment_method->type_obj()->cap_name(), 'specific_payment_method_type_access' ) |
|
| 349 | + EE_Registry::instance()->CAP->current_user_can($payment_method->type_obj()->cap_name(), 'specific_payment_method_type_access') |
|
| 350 | 350 | ) { |
| 351 | 351 | return TRUE; |
| 352 | 352 | } |
@@ -363,21 +363,21 @@ discard block |
||
| 363 | 363 | * @return string |
| 364 | 364 | * @throws EE_Error |
| 365 | 365 | */ |
| 366 | - public function payment_method_settings_meta_box( $post_obj_which_is_null, $metabox ){ |
|
| 367 | - $payment_method = isset( $metabox['args'], $metabox['args']['payment_method'] ) ? $metabox['args']['payment_method'] : NULL; |
|
| 368 | - if ( ! $payment_method instanceof EE_Payment_Method ){ |
|
| 369 | - throw new EE_Error( sprintf( __( 'Payment method metabox setup incorrectly. No Payment method object was supplied', 'event_espresso' ))); |
|
| 366 | + public function payment_method_settings_meta_box($post_obj_which_is_null, $metabox) { |
|
| 367 | + $payment_method = isset($metabox['args'], $metabox['args']['payment_method']) ? $metabox['args']['payment_method'] : NULL; |
|
| 368 | + if ( ! $payment_method instanceof EE_Payment_Method) { |
|
| 369 | + throw new EE_Error(sprintf(__('Payment method metabox setup incorrectly. No Payment method object was supplied', 'event_espresso'))); |
|
| 370 | 370 | } |
| 371 | 371 | $payment_method_scopes = $payment_method->active(); |
| 372 | 372 | // if the payment method really exists show its form, otherwise the activation template |
| 373 | - if ( $payment_method->ID() && ! empty( $payment_method_scopes )) { |
|
| 374 | - $form = $this->_generate_payment_method_settings_form( $payment_method ); |
|
| 375 | - if ( $form->form_data_present_in( $this->_req_data )) { |
|
| 376 | - $form->receive_form_submission( $this->_req_data ); |
|
| 373 | + if ($payment_method->ID() && ! empty($payment_method_scopes)) { |
|
| 374 | + $form = $this->_generate_payment_method_settings_form($payment_method); |
|
| 375 | + if ($form->form_data_present_in($this->_req_data)) { |
|
| 376 | + $form->receive_form_submission($this->_req_data); |
|
| 377 | 377 | } |
| 378 | - echo $form->form_open() . $form->get_html_and_js() . $form->form_close(); |
|
| 378 | + echo $form->form_open().$form->get_html_and_js().$form->form_close(); |
|
| 379 | 379 | } else { |
| 380 | - echo $this->_activate_payment_method_button( $payment_method )->get_html_and_js(); |
|
| 380 | + echo $this->_activate_payment_method_button($payment_method)->get_html_and_js(); |
|
| 381 | 381 | } |
| 382 | 382 | } |
| 383 | 383 | |
@@ -390,14 +390,14 @@ discard block |
||
| 390 | 390 | * @param \EE_Payment_Method $payment_method |
| 391 | 391 | * @return \EE_Form_Section_Proper |
| 392 | 392 | */ |
| 393 | - protected function _generate_payment_method_settings_form( EE_Payment_Method $payment_method ) { |
|
| 394 | - if ( ! $payment_method instanceof EE_Payment_Method ){ |
|
| 393 | + protected function _generate_payment_method_settings_form(EE_Payment_Method $payment_method) { |
|
| 394 | + if ( ! $payment_method instanceof EE_Payment_Method) { |
|
| 395 | 395 | return new EE_Form_Section_Proper(); |
| 396 | 396 | } |
| 397 | 397 | return new EE_Form_Section_Proper( |
| 398 | 398 | array( |
| 399 | - 'name' => $payment_method->slug() . '_settings_form', |
|
| 400 | - 'html_id' => $payment_method->slug() . '_settings_form', |
|
| 399 | + 'name' => $payment_method->slug().'_settings_form', |
|
| 400 | + 'html_id' => $payment_method->slug().'_settings_form', |
|
| 401 | 401 | 'action' => EE_Admin_Page::add_query_args_and_nonce( |
| 402 | 402 | array( |
| 403 | 403 | 'action' => 'update_payment_method', |
@@ -409,12 +409,12 @@ discard block |
||
| 409 | 409 | 'subsections' => apply_filters( |
| 410 | 410 | 'FHEE__Payments_Admin_Page___generate_payment_method_settings_form__form_subsections', |
| 411 | 411 | array( |
| 412 | - 'pci_dss_compliance_' . $payment_method->slug() => $this->_pci_dss_compliance( $payment_method ), |
|
| 413 | - 'currency_support_' . $payment_method->slug() => $this->_currency_support( $payment_method ), |
|
| 414 | - 'payment_method_settings_' . $payment_method->slug() => $this->_payment_method_settings( $payment_method ), |
|
| 415 | - 'update_' . $payment_method->slug() => $this->_update_payment_method_button( $payment_method ), |
|
| 416 | - 'deactivate_' . $payment_method->slug() => $this->_deactivate_payment_method_button( $payment_method ), |
|
| 417 | - 'fine_print_' . $payment_method->slug() => $this->_fine_print() |
|
| 412 | + 'pci_dss_compliance_'.$payment_method->slug() => $this->_pci_dss_compliance($payment_method), |
|
| 413 | + 'currency_support_'.$payment_method->slug() => $this->_currency_support($payment_method), |
|
| 414 | + 'payment_method_settings_'.$payment_method->slug() => $this->_payment_method_settings($payment_method), |
|
| 415 | + 'update_'.$payment_method->slug() => $this->_update_payment_method_button($payment_method), |
|
| 416 | + 'deactivate_'.$payment_method->slug() => $this->_deactivate_payment_method_button($payment_method), |
|
| 417 | + 'fine_print_'.$payment_method->slug() => $this->_fine_print() |
|
| 418 | 418 | ), |
| 419 | 419 | $payment_method |
| 420 | 420 | ) |
@@ -431,19 +431,19 @@ discard block |
||
| 431 | 431 | * @param \EE_Payment_Method $payment_method |
| 432 | 432 | * @return \EE_Form_Section_Proper |
| 433 | 433 | */ |
| 434 | - protected function _pci_dss_compliance( EE_Payment_Method $payment_method ) { |
|
| 435 | - if ( $payment_method->type_obj()->requires_https() ) { |
|
| 434 | + protected function _pci_dss_compliance(EE_Payment_Method $payment_method) { |
|
| 435 | + if ($payment_method->type_obj()->requires_https()) { |
|
| 436 | 436 | return new EE_Form_Section_HTML( |
| 437 | 437 | EEH_HTML::tr( |
| 438 | 438 | EEH_HTML::th( |
| 439 | 439 | EEH_HTML::label( |
| 440 | - EEH_HTML::strong( __( 'IMPORTANT', 'event_espresso' ), '', 'important-notice' ) |
|
| 440 | + EEH_HTML::strong(__('IMPORTANT', 'event_espresso'), '', 'important-notice') |
|
| 441 | 441 | ) |
| 442 | - ) . |
|
| 442 | + ). |
|
| 443 | 443 | EEH_HTML::td( |
| 444 | - EEH_HTML::strong( __( 'You are responsible for your own website security and Payment Card Industry Data Security Standards (PCI DSS) compliance.', 'event_espresso' )) . |
|
| 445 | - EEH_HTML::br() . |
|
| 446 | - __( 'Learn more about ', 'event_espresso' ) . EEH_HTML::link( 'https://www.pcisecuritystandards.org/merchants/index.php', __( 'PCI DSS compliance', 'event_espresso' )) |
|
| 444 | + EEH_HTML::strong(__('You are responsible for your own website security and Payment Card Industry Data Security Standards (PCI DSS) compliance.', 'event_espresso')). |
|
| 445 | + EEH_HTML::br(). |
|
| 446 | + __('Learn more about ', 'event_espresso').EEH_HTML::link('https://www.pcisecuritystandards.org/merchants/index.php', __('PCI DSS compliance', 'event_espresso')) |
|
| 447 | 447 | ) |
| 448 | 448 | ) |
| 449 | 449 | ); |
@@ -461,19 +461,19 @@ discard block |
||
| 461 | 461 | * @param \EE_Payment_Method $payment_method |
| 462 | 462 | * @return \EE_Form_Section_Proper |
| 463 | 463 | */ |
| 464 | - protected function _currency_support( EE_Payment_Method $payment_method ) { |
|
| 465 | - if ( ! $payment_method->usable_for_currency( EE_Config::instance()->currency->code )) { |
|
| 464 | + protected function _currency_support(EE_Payment_Method $payment_method) { |
|
| 465 | + if ( ! $payment_method->usable_for_currency(EE_Config::instance()->currency->code)) { |
|
| 466 | 466 | return new EE_Form_Section_HTML( |
| 467 | 467 | EEH_HTML::tr( |
| 468 | 468 | EEH_HTML::th( |
| 469 | 469 | EEH_HTML::label( |
| 470 | - EEH_HTML::strong( __( 'IMPORTANT', 'event_espresso' ), '', 'important-notice' ) |
|
| 470 | + EEH_HTML::strong(__('IMPORTANT', 'event_espresso'), '', 'important-notice') |
|
| 471 | 471 | ) |
| 472 | - ) . |
|
| 472 | + ). |
|
| 473 | 473 | EEH_HTML::td( |
| 474 | 474 | EEH_HTML::strong( |
| 475 | 475 | sprintf( |
| 476 | - __( 'This payment method does not support the currency set on your site (%1$s) and so will not appear as a payment option to registrants. Please activate a different payment method or change your site\'s country and associated currency.', 'event_espresso'), |
|
| 476 | + __('This payment method does not support the currency set on your site (%1$s) and so will not appear as a payment option to registrants. Please activate a different payment method or change your site\'s country and associated currency.', 'event_espresso'), |
|
| 477 | 477 | EE_Config::instance()->currency->code |
| 478 | 478 | ) |
| 479 | 479 | ) |
@@ -493,9 +493,9 @@ discard block |
||
| 493 | 493 | * @param \EE_Payment_Method $payment_method |
| 494 | 494 | * @return \EE_Form_Section_HTML |
| 495 | 495 | */ |
| 496 | - protected function _payment_method_settings( EE_Payment_Method $payment_method ) { |
|
| 496 | + protected function _payment_method_settings(EE_Payment_Method $payment_method) { |
|
| 497 | 497 | //modify the form so we only have/show fields that will be implemented for this version |
| 498 | - return $this->_simplify_form( $payment_method->type_obj()->settings_form(), $payment_method->name() ); |
|
| 498 | + return $this->_simplify_form($payment_method->type_obj()->settings_form(), $payment_method->name()); |
|
| 499 | 499 | } |
| 500 | 500 | |
| 501 | 501 | |
@@ -508,8 +508,8 @@ discard block |
||
| 508 | 508 | * @return \EE_Payment_Method_Form |
| 509 | 509 | * @throws \EE_Error |
| 510 | 510 | */ |
| 511 | - protected function _simplify_form( $form_section, $payment_method_name = '' ){ |
|
| 512 | - if ( $form_section instanceof EE_Payment_Method_Form ) { |
|
| 511 | + protected function _simplify_form($form_section, $payment_method_name = '') { |
|
| 512 | + if ($form_section instanceof EE_Payment_Method_Form) { |
|
| 513 | 513 | $form_section->exclude( |
| 514 | 514 | array( |
| 515 | 515 | 'PMD_type', //dont want them changing the type |
@@ -520,7 +520,7 @@ discard block |
||
| 520 | 520 | ); |
| 521 | 521 | return $form_section; |
| 522 | 522 | } else { |
| 523 | - throw new EE_Error( sprintf( __( 'The EE_Payment_Method_Form for the "%1$s" payment method is missing or invalid.', 'event_espresso' ), $payment_method_name )); |
|
| 523 | + throw new EE_Error(sprintf(__('The EE_Payment_Method_Form for the "%1$s" payment method is missing or invalid.', 'event_espresso'), $payment_method_name)); |
|
| 524 | 524 | } |
| 525 | 525 | } |
| 526 | 526 | |
@@ -533,18 +533,18 @@ discard block |
||
| 533 | 533 | * @param \EE_Payment_Method $payment_method |
| 534 | 534 | * @return \EE_Form_Section_HTML |
| 535 | 535 | */ |
| 536 | - protected function _update_payment_method_button( EE_Payment_Method $payment_method ) { |
|
| 536 | + protected function _update_payment_method_button(EE_Payment_Method $payment_method) { |
|
| 537 | 537 | $update_button = new EE_Submit_Input( |
| 538 | 538 | array( |
| 539 | - 'html_id' => 'save_' . $payment_method->slug() . '_settings', |
|
| 540 | - 'default' => sprintf( __( 'Update %s Payment Settings', 'event_espresso' ), $payment_method->admin_name() ), |
|
| 539 | + 'html_id' => 'save_'.$payment_method->slug().'_settings', |
|
| 540 | + 'default' => sprintf(__('Update %s Payment Settings', 'event_espresso'), $payment_method->admin_name()), |
|
| 541 | 541 | 'html_label' => EEH_HTML::nbsp() |
| 542 | 542 | ) |
| 543 | 543 | ); |
| 544 | 544 | return new EE_Form_Section_HTML( |
| 545 | - EEH_HTML::no_row( EEH_HTML::br(2) ) . |
|
| 545 | + EEH_HTML::no_row(EEH_HTML::br(2)). |
|
| 546 | 546 | EEH_HTML::tr( |
| 547 | - EEH_HTML::th( __( 'Update Settings', 'event_espresso') ) . |
|
| 547 | + EEH_HTML::th(__('Update Settings', 'event_espresso')). |
|
| 548 | 548 | EEH_HTML::td( |
| 549 | 549 | $update_button->get_html_for_input() |
| 550 | 550 | ) |
@@ -561,11 +561,11 @@ discard block |
||
| 561 | 561 | * @param \EE_Payment_Method $payment_method |
| 562 | 562 | * @return \EE_Form_Section_Proper |
| 563 | 563 | */ |
| 564 | - protected function _deactivate_payment_method_button( EE_Payment_Method $payment_method ) { |
|
| 565 | - $link_text_and_title = sprintf( __( 'Deactivate %1$s Payments?', 'event_espresso'), $payment_method->admin_name() ); |
|
| 564 | + protected function _deactivate_payment_method_button(EE_Payment_Method $payment_method) { |
|
| 565 | + $link_text_and_title = sprintf(__('Deactivate %1$s Payments?', 'event_espresso'), $payment_method->admin_name()); |
|
| 566 | 566 | return new EE_Form_Section_HTML( |
| 567 | 567 | EEH_HTML::tr( |
| 568 | - EEH_HTML::th( __( 'Deactivate Payment Method', 'event_espresso') ) . |
|
| 568 | + EEH_HTML::th(__('Deactivate Payment Method', 'event_espresso')). |
|
| 569 | 569 | EEH_HTML::td( |
| 570 | 570 | EEH_HTML::link( |
| 571 | 571 | EE_Admin_Page::add_query_args_and_nonce( |
@@ -577,7 +577,7 @@ discard block |
||
| 577 | 577 | ), |
| 578 | 578 | $link_text_and_title, |
| 579 | 579 | $link_text_and_title, |
| 580 | - 'deactivate_' . $payment_method->slug(), |
|
| 580 | + 'deactivate_'.$payment_method->slug(), |
|
| 581 | 581 | 'espresso-button button-secondary' |
| 582 | 582 | ) |
| 583 | 583 | ) |
@@ -593,12 +593,12 @@ discard block |
||
| 593 | 593 | * @param \EE_Payment_Method $payment_method |
| 594 | 594 | * @return \EE_Form_Section_Proper |
| 595 | 595 | */ |
| 596 | - protected function _activate_payment_method_button( EE_Payment_Method $payment_method ) { |
|
| 597 | - $link_text_and_title = sprintf( __( 'Activate %1$s Payment Method?', 'event_espresso'), $payment_method->admin_name() ); |
|
| 596 | + protected function _activate_payment_method_button(EE_Payment_Method $payment_method) { |
|
| 597 | + $link_text_and_title = sprintf(__('Activate %1$s Payment Method?', 'event_espresso'), $payment_method->admin_name()); |
|
| 598 | 598 | return new EE_Form_Section_Proper( |
| 599 | 599 | array( |
| 600 | - 'name' => 'activate_' . $payment_method->slug() . '_settings_form', |
|
| 601 | - 'html_id' => 'activate_' . $payment_method->slug() . '_settings_form', |
|
| 600 | + 'name' => 'activate_'.$payment_method->slug().'_settings_form', |
|
| 601 | + 'html_id' => 'activate_'.$payment_method->slug().'_settings_form', |
|
| 602 | 602 | 'action' => '#', |
| 603 | 603 | 'layout_strategy' => new EE_Admin_Two_Column_Layout(), |
| 604 | 604 | 'subsections' => apply_filters( |
@@ -607,8 +607,8 @@ discard block |
||
| 607 | 607 | new EE_Form_Section_HTML( |
| 608 | 608 | EEH_HTML::tr( |
| 609 | 609 | EEH_HTML::th( |
| 610 | - EEH_HTML::label( __( 'Click to Activate ', 'event_espresso' )) |
|
| 611 | - ) . |
|
| 610 | + EEH_HTML::label(__('Click to Activate ', 'event_espresso')) |
|
| 611 | + ). |
|
| 612 | 612 | EEH_HTML::td( |
| 613 | 613 | EEH_HTML::link( |
| 614 | 614 | EE_Admin_Page::add_query_args_and_nonce( |
@@ -620,7 +620,7 @@ discard block |
||
| 620 | 620 | ), |
| 621 | 621 | $link_text_and_title, |
| 622 | 622 | $link_text_and_title, |
| 623 | - 'activate_' . $payment_method->slug(), |
|
| 623 | + 'activate_'.$payment_method->slug(), |
|
| 624 | 624 | 'espresso-button-green button-primary' |
| 625 | 625 | ) |
| 626 | 626 | ) |
@@ -642,9 +642,9 @@ discard block |
||
| 642 | 642 | protected function _fine_print() { |
| 643 | 643 | return new EE_Form_Section_HTML( |
| 644 | 644 | EEH_HTML::tr( |
| 645 | - EEH_HTML::th() . |
|
| 645 | + EEH_HTML::th(). |
|
| 646 | 646 | EEH_HTML::td( |
| 647 | - EEH_HTML::p( __( 'All fields marked with a * are required fields', 'event_espresso' ), '', 'grey-text' ) |
|
| 647 | + EEH_HTML::p(__('All fields marked with a * are required fields', 'event_espresso'), '', 'grey-text') |
|
| 648 | 648 | ) |
| 649 | 649 | ) |
| 650 | 650 | ); |
@@ -656,15 +656,15 @@ discard block |
||
| 656 | 656 | * Activates a payment method of that type. Mostly assuming there is only 1 of that type (or none so far) |
| 657 | 657 | * @global WP_User $current_user |
| 658 | 658 | */ |
| 659 | - protected function _activate_payment_method(){ |
|
| 660 | - if(isset($this->_req_data['payment_method_type'])){ |
|
| 659 | + protected function _activate_payment_method() { |
|
| 660 | + if (isset($this->_req_data['payment_method_type'])) { |
|
| 661 | 661 | $payment_method_type = sanitize_text_field($this->_req_data['payment_method_type']); |
| 662 | 662 | //see if one exists |
| 663 | - EE_Registry::instance()->load_lib( 'Payment_Method_Manager' ); |
|
| 664 | - $payment_method = EE_Payment_Method_Manager::instance()->activate_a_payment_method_of_type( $payment_method_type ); |
|
| 663 | + EE_Registry::instance()->load_lib('Payment_Method_Manager'); |
|
| 664 | + $payment_method = EE_Payment_Method_Manager::instance()->activate_a_payment_method_of_type($payment_method_type); |
|
| 665 | 665 | |
| 666 | - $this->_redirect_after_action(1, 'Payment Method', 'activated', array('action' => 'default','payment_method'=>$payment_method->slug())); |
|
| 667 | - }else{ |
|
| 666 | + $this->_redirect_after_action(1, 'Payment Method', 'activated', array('action' => 'default', 'payment_method'=>$payment_method->slug())); |
|
| 667 | + } else { |
|
| 668 | 668 | $this->_redirect_after_action(FALSE, 'Payment Method', 'activated', array('action' => 'default')); |
| 669 | 669 | } |
| 670 | 670 | } |
@@ -672,14 +672,14 @@ discard block |
||
| 672 | 672 | /** |
| 673 | 673 | * Deactivates the payment method with the specified slug, and redirects. |
| 674 | 674 | */ |
| 675 | - protected function _deactivate_payment_method(){ |
|
| 676 | - if(isset($this->_req_data['payment_method'])){ |
|
| 675 | + protected function _deactivate_payment_method() { |
|
| 676 | + if (isset($this->_req_data['payment_method'])) { |
|
| 677 | 677 | $payment_method_slug = sanitize_key($this->_req_data['payment_method']); |
| 678 | 678 | //deactivate it |
| 679 | 679 | EE_Registry::instance()->load_lib('Payment_Method_Manager'); |
| 680 | - $count_updated = EE_Payment_Method_Manager::instance()->deactivate_payment_method( $payment_method_slug ); |
|
| 681 | - $this->_redirect_after_action($count_updated, 'Payment Method', 'deactivated', array('action' => 'default','payment_method'=>$payment_method_slug)); |
|
| 682 | - }else{ |
|
| 680 | + $count_updated = EE_Payment_Method_Manager::instance()->deactivate_payment_method($payment_method_slug); |
|
| 681 | + $this->_redirect_after_action($count_updated, 'Payment Method', 'deactivated', array('action' => 'default', 'payment_method'=>$payment_method_slug)); |
|
| 682 | + } else { |
|
| 683 | 683 | $this->_redirect_after_action(FALSE, 'Payment Method', 'deactivated', array('action' => 'default')); |
| 684 | 684 | } |
| 685 | 685 | } |
@@ -693,39 +693,39 @@ discard block |
||
| 693 | 693 | * subsequently called 'headers_sent_func' which is _payment_methods_list) |
| 694 | 694 | * @return void |
| 695 | 695 | */ |
| 696 | - protected function _update_payment_method(){ |
|
| 697 | - if( $_SERVER['REQUEST_METHOD'] == 'POST'){ |
|
| 696 | + protected function _update_payment_method() { |
|
| 697 | + if ($_SERVER['REQUEST_METHOD'] == 'POST') { |
|
| 698 | 698 | //ok let's find which gateway form to use based on the form input |
| 699 | 699 | EE_Registry::instance()->load_lib('Payment_Method_Manager'); |
| 700 | 700 | /** @var $correct_pmt_form_to_use EE_Payment_Method_Form */ |
| 701 | 701 | $correct_pmt_form_to_use = NULL; |
| 702 | 702 | $pmt_obj = NULL; |
| 703 | - foreach(EE_Payment_Method_Manager::instance()->payment_method_types() as $pmt_obj){ |
|
| 703 | + foreach (EE_Payment_Method_Manager::instance()->payment_method_types() as $pmt_obj) { |
|
| 704 | 704 | /** @var $pmt_obj EE_PMT_Base */ |
| 705 | 705 | //get the form and simplify it, like what we do when we display it |
| 706 | 706 | $pmt_form = $pmt_obj->settings_form(); |
| 707 | 707 | $this->_simplify_form($pmt_form); |
| 708 | - if($pmt_form->form_data_present_in($this->_req_data)){ |
|
| 708 | + if ($pmt_form->form_data_present_in($this->_req_data)) { |
|
| 709 | 709 | $correct_pmt_form_to_use = $pmt_form; |
| 710 | 710 | break; |
| 711 | 711 | } |
| 712 | 712 | } |
| 713 | 713 | //if we couldn't find the correct payment method type... |
| 714 | - if( ! $correct_pmt_form_to_use ){ |
|
| 714 | + if ( ! $correct_pmt_form_to_use) { |
|
| 715 | 715 | EE_Error::add_error(__("We could not find which payment method type your form submission related to. Please contact support", 'event_espresso'), __FILE__, __FUNCTION__, __LINE__); |
| 716 | 716 | $this->_redirect_after_action(FALSE, 'Payment Method', 'activated', array('action' => 'default')); |
| 717 | 717 | } |
| 718 | 718 | $correct_pmt_form_to_use->receive_form_submission($this->_req_data); |
| 719 | - if($correct_pmt_form_to_use->is_valid()){ |
|
| 719 | + if ($correct_pmt_form_to_use->is_valid()) { |
|
| 720 | 720 | $correct_pmt_form_to_use->save(); |
| 721 | 721 | $pm = $correct_pmt_form_to_use->get_model_object(); |
| 722 | 722 | /** @var $pm EE_Payment_Method */ |
| 723 | - $this->_redirect_after_action(TRUE, 'Payment Method', 'updated', array('action' => 'default','payment_method'=>$pm->slug())); |
|
| 724 | - }else{ |
|
| 723 | + $this->_redirect_after_action(TRUE, 'Payment Method', 'updated', array('action' => 'default', 'payment_method'=>$pm->slug())); |
|
| 724 | + } else { |
|
| 725 | 725 | EE_Error::add_error( |
| 726 | 726 | sprintf( |
| 727 | 727 | __('Payment method of type %s was not saved because there were validation errors. They have been marked in the form', 'event_espresso'), |
| 728 | - $pmt_obj instanceof EE_PMT_Base ? $pmt_obj->pretty_name() : __( '"(unknown)"', 'event_espresso' ) |
|
| 728 | + $pmt_obj instanceof EE_PMT_Base ? $pmt_obj->pretty_name() : __('"(unknown)"', 'event_espresso') |
|
| 729 | 729 | ), |
| 730 | 730 | __FILE__, |
| 731 | 731 | __FUNCTION__, |
@@ -742,11 +742,11 @@ discard block |
||
| 742 | 742 | protected function _payment_settings() { |
| 743 | 743 | |
| 744 | 744 | $this->_template_args['values'] = $this->_yes_no_values; |
| 745 | - $this->_template_args['show_pending_payment_options'] = isset( EE_Registry::instance()->CFG->registration->show_pending_payment_options ) ? absint( EE_Registry::instance()->CFG->registration->show_pending_payment_options ) : FALSE; |
|
| 745 | + $this->_template_args['show_pending_payment_options'] = isset(EE_Registry::instance()->CFG->registration->show_pending_payment_options) ? absint(EE_Registry::instance()->CFG->registration->show_pending_payment_options) : FALSE; |
|
| 746 | 746 | |
| 747 | - $this->_set_add_edit_form_tags( 'update_payment_settings' ); |
|
| 748 | - $this->_set_publish_post_box_vars( NULL, FALSE, FALSE, NULL, FALSE ); |
|
| 749 | - $this->_template_args['admin_page_content'] = EEH_Template::display_template( EE_PAYMENTS_TEMPLATE_PATH . 'payment_settings.template.php', $this->_template_args, TRUE ); |
|
| 747 | + $this->_set_add_edit_form_tags('update_payment_settings'); |
|
| 748 | + $this->_set_publish_post_box_vars(NULL, FALSE, FALSE, NULL, FALSE); |
|
| 749 | + $this->_template_args['admin_page_content'] = EEH_Template::display_template(EE_PAYMENTS_TEMPLATE_PATH.'payment_settings.template.php', $this->_template_args, TRUE); |
|
| 750 | 750 | $this->display_admin_page_with_sidebar(); |
| 751 | 751 | |
| 752 | 752 | } |
@@ -760,13 +760,13 @@ discard block |
||
| 760 | 760 | * @return array |
| 761 | 761 | */ |
| 762 | 762 | protected function _update_payment_settings() { |
| 763 | - EE_Registry::instance()->CFG->registration->show_pending_payment_options = isset( $this->_req_data['show_pending_payment_options'] ) ? $this->_req_data['show_pending_payment_options'] : FALSE; |
|
| 764 | - EE_Registry::instance()->CFG = apply_filters( 'FHEE__Payments_Admin_Page___update_payment_settings__CFG', EE_Registry::instance()->CFG ); |
|
| 763 | + EE_Registry::instance()->CFG->registration->show_pending_payment_options = isset($this->_req_data['show_pending_payment_options']) ? $this->_req_data['show_pending_payment_options'] : FALSE; |
|
| 764 | + EE_Registry::instance()->CFG = apply_filters('FHEE__Payments_Admin_Page___update_payment_settings__CFG', EE_Registry::instance()->CFG); |
|
| 765 | 765 | |
| 766 | 766 | |
| 767 | - $what = __('Payment Settings','event_espresso'); |
|
| 768 | - $success = $this->_update_espresso_configuration( $what, EE_Registry::instance()->CFG, __FILE__, __FUNCTION__, __LINE__ ); |
|
| 769 | - $this->_redirect_after_action( $success, $what, __('updated','event_espresso'), array( 'action' => 'payment_settings' ) ); |
|
| 767 | + $what = __('Payment Settings', 'event_espresso'); |
|
| 768 | + $success = $this->_update_espresso_configuration($what, EE_Registry::instance()->CFG, __FILE__, __FUNCTION__, __LINE__); |
|
| 769 | + $this->_redirect_after_action($success, $what, __('updated', 'event_espresso'), array('action' => 'payment_settings')); |
|
| 770 | 770 | |
| 771 | 771 | } |
| 772 | 772 | protected function _payment_log_overview_list_table() { |
@@ -792,18 +792,18 @@ discard block |
||
| 792 | 792 | * @param bool $count |
| 793 | 793 | * @return array |
| 794 | 794 | */ |
| 795 | - public function get_payment_logs($per_page = 50, $current_page = 0, $count = false){ |
|
| 796 | - EE_Registry::instance()->load_model( 'Change_Log' ); |
|
| 795 | + public function get_payment_logs($per_page = 50, $current_page = 0, $count = false) { |
|
| 796 | + EE_Registry::instance()->load_model('Change_Log'); |
|
| 797 | 797 | //we may need to do multiple queries (joining differently), so we actually wan tan array of query params |
| 798 | - $query_params = array(array('LOG_type'=> EEM_Change_Log::type_gateway)); |
|
| 798 | + $query_params = array(array('LOG_type'=> EEM_Change_Log::type_gateway)); |
|
| 799 | 799 | //check if they've selected a specific payment method |
| 800 | - if( isset($this->_req_data['_payment_method']) && $this->_req_data['_payment_method'] !== 'all'){ |
|
| 800 | + if (isset($this->_req_data['_payment_method']) && $this->_req_data['_payment_method'] !== 'all') { |
|
| 801 | 801 | $query_params[0]['OR*pm_or_pay_pm'] = array('Payment.Payment_Method.PMD_ID'=>$this->_req_data['_payment_method'], |
| 802 | 802 | 'Payment_Method.PMD_ID'=>$this->_req_data['_payment_method']); |
| 803 | 803 | } |
| 804 | 804 | //take into account search |
| 805 | - if(isset($this->_req_data['s']) && $this->_req_data['s']){ |
|
| 806 | - $similarity_string = array('LIKE','%'.str_replace("","%",$this->_req_data['s']) .'%'); |
|
| 805 | + if (isset($this->_req_data['s']) && $this->_req_data['s']) { |
|
| 806 | + $similarity_string = array('LIKE', '%'.str_replace("", "%", $this->_req_data['s']).'%'); |
|
| 807 | 807 | $query_params[0]['OR*s']['Payment.Transaction.Registration.Attendee.ATT_fname'] = $similarity_string; |
| 808 | 808 | $query_params[0]['OR*s']['Payment.Transaction.Registration.Attendee.ATT_lname'] = $similarity_string; |
| 809 | 809 | $query_params[0]['OR*s']['Payment.Transaction.Registration.Attendee.ATT_email'] = $similarity_string; |
@@ -818,48 +818,48 @@ discard block |
||
| 818 | 818 | $query_params[0]['OR*s']['LOG_message'] = $similarity_string; |
| 819 | 819 | |
| 820 | 820 | } |
| 821 | - if(isset( $this->_req_data['payment-filter-start-date'] ) && isset( $this->_req_data['payment-filter-end-date'] )){ |
|
| 821 | + if (isset($this->_req_data['payment-filter-start-date']) && isset($this->_req_data['payment-filter-end-date'])) { |
|
| 822 | 822 | //add date |
| 823 | - $start_date =wp_strip_all_tags( $this->_req_data['payment-filter-start-date'] ); |
|
| 824 | - $end_date = wp_strip_all_tags( $this->_req_data['payment-filter-end-date'] ); |
|
| 823 | + $start_date = wp_strip_all_tags($this->_req_data['payment-filter-start-date']); |
|
| 824 | + $end_date = wp_strip_all_tags($this->_req_data['payment-filter-end-date']); |
|
| 825 | 825 | //make sure our timestamps start and end right at the boundaries for each day |
| 826 | - $start_date = date( 'Y-m-d', strtotime( $start_date ) ) . ' 00:00:00'; |
|
| 827 | - $end_date = date( 'Y-m-d', strtotime( $end_date ) ) . ' 23:59:59'; |
|
| 826 | + $start_date = date('Y-m-d', strtotime($start_date)).' 00:00:00'; |
|
| 827 | + $end_date = date('Y-m-d', strtotime($end_date)).' 23:59:59'; |
|
| 828 | 828 | |
| 829 | 829 | //convert to timestamps |
| 830 | - $start_date = strtotime( $start_date ); |
|
| 831 | - $end_date = strtotime( $end_date ); |
|
| 830 | + $start_date = strtotime($start_date); |
|
| 831 | + $end_date = strtotime($end_date); |
|
| 832 | 832 | |
| 833 | 833 | //makes sure start date is the lowest value and vice versa |
| 834 | - $start_date = min( $start_date, $end_date ); |
|
| 835 | - $end_date = max( $start_date, $end_date ); |
|
| 834 | + $start_date = min($start_date, $end_date); |
|
| 835 | + $end_date = max($start_date, $end_date); |
|
| 836 | 836 | |
| 837 | 837 | //convert for query |
| 838 | - $start_date = EEM_Change_Log::instance()->convert_datetime_for_query( 'LOG_time', date( 'Y-m-d H:i:s', $start_date ), 'Y-m-d H:i:s' ); |
|
| 839 | - $end_date = EEM_Change_Log::instance()->convert_datetime_for_query( 'LOG_time', date( 'Y-m-d H:i:s', $end_date ), 'Y-m-d H:i:s' ); |
|
| 838 | + $start_date = EEM_Change_Log::instance()->convert_datetime_for_query('LOG_time', date('Y-m-d H:i:s', $start_date), 'Y-m-d H:i:s'); |
|
| 839 | + $end_date = EEM_Change_Log::instance()->convert_datetime_for_query('LOG_time', date('Y-m-d H:i:s', $end_date), 'Y-m-d H:i:s'); |
|
| 840 | 840 | |
| 841 | - $query_params[0]['LOG_time'] = array('BETWEEN',array($start_date,$end_date)); |
|
| 841 | + $query_params[0]['LOG_time'] = array('BETWEEN', array($start_date, $end_date)); |
|
| 842 | 842 | |
| 843 | 843 | } |
| 844 | - if($count){ |
|
| 844 | + if ($count) { |
|
| 845 | 845 | return EEM_Change_Log::instance()->count($query_params); |
| 846 | 846 | } |
| 847 | - if(isset($this->_req_data['order'])){ |
|
| 848 | - $sort = ( isset( $this->_req_data['order'] ) && ! empty( $this->_req_data['order'] )) ? $this->_req_data['order'] : 'DESC'; |
|
| 847 | + if (isset($this->_req_data['order'])) { |
|
| 848 | + $sort = (isset($this->_req_data['order']) && ! empty($this->_req_data['order'])) ? $this->_req_data['order'] : 'DESC'; |
|
| 849 | 849 | $query_params['order_by'] = array('LOG_time' => $sort); |
| 850 | - }else{ |
|
| 850 | + } else { |
|
| 851 | 851 | $query_params['order_by'] = array('LOG_time' => 'DESC'); |
| 852 | 852 | } |
| 853 | - $offset = ($current_page-1)*$per_page; |
|
| 853 | + $offset = ($current_page - 1) * $per_page; |
|
| 854 | 854 | |
| 855 | - if( ! isset($this->_req_data['download_results'])){ |
|
| 856 | - $query_params['limit'] = array( $offset, $per_page ); |
|
| 855 | + if ( ! isset($this->_req_data['download_results'])) { |
|
| 856 | + $query_params['limit'] = array($offset, $per_page); |
|
| 857 | 857 | } |
| 858 | 858 | |
| 859 | 859 | |
| 860 | 860 | |
| 861 | 861 | //now they've requested to instead just download the file instead of viewing it. |
| 862 | - if(isset($this->_req_data['download_results'])){ |
|
| 862 | + if (isset($this->_req_data['download_results'])) { |
|
| 863 | 863 | $wpdb_results = EEM_Change_Log::instance()->get_all_efficiently($query_params); |
| 864 | 864 | header('Content-Disposition: attachment'); |
| 865 | 865 | header("Content-Disposition: attachment; filename=ee_payment_logs_for_".sanitize_key(site_url())); |
@@ -881,36 +881,36 @@ discard block |
||
| 881 | 881 | * @param EE_Change_Log $logB |
| 882 | 882 | * @return int |
| 883 | 883 | */ |
| 884 | - protected function _sort_logs_again($logA,$logB){ |
|
| 884 | + protected function _sort_logs_again($logA, $logB) { |
|
| 885 | 885 | $timeA = $logA->get_raw('LOG_time'); |
| 886 | 886 | $timeB = $logB->get_raw('LOG_time'); |
| 887 | - if($timeA == $timeB){ |
|
| 887 | + if ($timeA == $timeB) { |
|
| 888 | 888 | return 0; |
| 889 | 889 | } |
| 890 | 890 | $comparison = $timeA < $timeB ? -1 : 1; |
| 891 | - if(strtoupper($this->_sort_logs_again_direction) == 'DESC'){ |
|
| 891 | + if (strtoupper($this->_sort_logs_again_direction) == 'DESC') { |
|
| 892 | 892 | return $comparison * -1; |
| 893 | - }else{ |
|
| 893 | + } else { |
|
| 894 | 894 | return $comparison; |
| 895 | 895 | } |
| 896 | 896 | } |
| 897 | 897 | |
| 898 | 898 | protected function _payment_log_details() { |
| 899 | - EE_Registry::instance()->load_model( 'Change_Log' ); |
|
| 899 | + EE_Registry::instance()->load_model('Change_Log'); |
|
| 900 | 900 | /** @var $payment_log EE_Change_Log */ |
| 901 | 901 | $payment_log = EEM_Change_Log::instance()->get_one_by_ID($this->_req_data['ID']); |
| 902 | 902 | $payment_method = NULL; |
| 903 | 903 | $transaction = NULL; |
| 904 | - if( $payment_log instanceof EE_Change_Log ){ |
|
| 905 | - if( $payment_log->object() instanceof EE_Payment ){ |
|
| 904 | + if ($payment_log instanceof EE_Change_Log) { |
|
| 905 | + if ($payment_log->object() instanceof EE_Payment) { |
|
| 906 | 906 | $payment_method = $payment_log->object()->payment_method(); |
| 907 | 907 | $transaction = $payment_log->object()->transaction(); |
| 908 | - }elseif($payment_log->object() instanceof EE_Payment_Method){ |
|
| 908 | + }elseif ($payment_log->object() instanceof EE_Payment_Method) { |
|
| 909 | 909 | $payment_method = $payment_log->object(); |
| 910 | 910 | } |
| 911 | 911 | } |
| 912 | 912 | $this->_template_args['admin_page_content'] = EEH_Template::display_template( |
| 913 | - EE_PAYMENTS_TEMPLATE_PATH . 'payment_log_details.template.php', |
|
| 913 | + EE_PAYMENTS_TEMPLATE_PATH.'payment_log_details.template.php', |
|
| 914 | 914 | array( |
| 915 | 915 | 'payment_log'=>$payment_log, |
| 916 | 916 | 'payment_method'=>$payment_method, |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
| 2 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) |
|
| 3 | 3 | exit('NO direct script access allowed'); |
| 4 | 4 | |
| 5 | 5 | /** |
@@ -68,21 +68,21 @@ discard block |
||
| 68 | 68 | |
| 69 | 69 | |
| 70 | 70 | protected function _start() { |
| 71 | - $content = '<h3>' . __('Payment Methods', 'event_espresso') . '</h3>'; |
|
| 72 | - $content .= '<p>' . __('This tour of the Payment Methods page will go over different areas of the screen to help you understand what they are used for.', 'event_espresso') . '</p>'; |
|
| 71 | + $content = '<h3>'.__('Payment Methods', 'event_espresso').'</h3>'; |
|
| 72 | + $content .= '<p>'.__('This tour of the Payment Methods page will go over different areas of the screen to help you understand what they are used for.', 'event_espresso').'</p>'; |
|
| 73 | 73 | return $content; |
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | protected function _gateway_links_stop() { |
| 77 | - return '<p>' . __('Available payment methods are shown here. Clicking on a payment method will provide you with an option to activate that payment gateway.', 'event_espresso') . '</p>'; |
|
| 77 | + return '<p>'.__('Available payment methods are shown here. Clicking on a payment method will provide you with an option to activate that payment gateway.', 'event_espresso').'</p>'; |
|
| 78 | 78 | } |
| 79 | 79 | |
| 80 | 80 | protected function _gateway_settings_metabox_stop() { |
| 81 | - return '<p>' . __('A payment gateway must first be enabled. You will then be able to configure the payment gateway. Be sure to save settings after configuring your payment gateway.', 'event_espresso') . '</p>'; |
|
| 81 | + return '<p>'.__('A payment gateway must first be enabled. You will then be able to configure the payment gateway. Be sure to save settings after configuring your payment gateway.', 'event_espresso').'</p>'; |
|
| 82 | 82 | } |
| 83 | 83 | |
| 84 | 84 | protected function _end_tour_stop() { |
| 85 | - return '<p>' . __('After configuring your payment gateway, go to the Event Editor to create your first event with Event Espresso.', 'event_espresso') . '</p>'; |
|
| 85 | + return '<p>'.__('After configuring your payment gateway, go to the Event Editor to create your first event with Event Espresso.', 'event_espresso').'</p>'; |
|
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | } |
| 89 | 89 | \ No newline at end of file |
@@ -1,6 +1,7 @@ |
||
| 1 | 1 | <?php |
| 2 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
| 2 | +if (!defined('EVENT_ESPRESSO_VERSION') ) { |
|
| 3 | 3 | exit('NO direct script access allowed'); |
| 4 | +} |
|
| 4 | 5 | |
| 5 | 6 | /** |
| 6 | 7 | * Event Espresso |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
| 2 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) |
|
| 3 | 3 | exit('NO direct script access allowed'); |
| 4 | 4 | |
| 5 | 5 | /** |
@@ -53,12 +53,12 @@ discard block |
||
| 53 | 53 | |
| 54 | 54 | |
| 55 | 55 | protected function _start() { |
| 56 | - $content = '<h3>' . __('Payment Settings', 'event_espresso') . '</h3>'; |
|
| 57 | - $content .= '<p>' . __('This tour of the Payment Settings page will go over different areas of the screen to help you understand what they are used for.', 'event_espresso') . '</p>'; |
|
| 56 | + $content = '<h3>'.__('Payment Settings', 'event_espresso').'</h3>'; |
|
| 57 | + $content .= '<p>'.__('This tour of the Payment Settings page will go over different areas of the screen to help you understand what they are used for.', 'event_espresso').'</p>'; |
|
| 58 | 58 | return $content; |
| 59 | 59 | } |
| 60 | 60 | |
| 61 | 61 | protected function _show_pending_options_stop() { |
| 62 | - return '<p>' . __('Specify whether to provide your registrants with the option to retry payments.', 'event_espresso') . '</p>'; |
|
| 62 | + return '<p>'.__('Specify whether to provide your registrants with the option to retry payments.', 'event_espresso').'</p>'; |
|
| 63 | 63 | } |
| 64 | 64 | } |
| 65 | 65 | \ No newline at end of file |
@@ -1,6 +1,7 @@ |
||
| 1 | 1 | <?php |
| 2 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
| 2 | +if (!defined('EVENT_ESPRESSO_VERSION') ) { |
|
| 3 | 3 | exit('NO direct script access allowed'); |
| 4 | +} |
|
| 4 | 5 | |
| 5 | 6 | /** |
| 6 | 7 | * Event Espresso |
@@ -3,27 +3,27 @@ |
||
| 3 | 3 | if (!defined('EVENT_ESPRESSO_VERSION')) |
| 4 | 4 | exit('No direct script access allowed'); |
| 5 | 5 | /** |
| 6 | - * Event Espresso |
|
| 7 | - * |
|
| 8 | - * Event Registration and Management Plugin for WordPress |
|
| 9 | - * |
|
| 10 | - * @ package Event Espresso |
|
| 11 | - * @ author Seth Shoultes |
|
| 12 | - * @ copyright (c) 2008-2011 Event Espresso All Rights Reserved. |
|
| 13 | - * @ license http://eventespresso.com/support/terms-conditions/ * see Plugin Licensing * |
|
| 14 | - * @ link http://www.eventespresso.com |
|
| 15 | - * @ version 4.3 |
|
| 16 | - * |
|
| 17 | - * ------------------------------------------------------------------------ |
|
| 18 | - * |
|
| 19 | - * payment_log_details |
|
| 20 | - * |
|
| 21 | - * @package Event Espresso |
|
| 22 | - * @subpackage |
|
| 23 | - * @author Mike Nelson |
|
| 24 | - * |
|
| 25 | - * ------------------------------------------------------------------------ |
|
| 26 | - */ |
|
| 6 | + * Event Espresso |
|
| 7 | + * |
|
| 8 | + * Event Registration and Management Plugin for WordPress |
|
| 9 | + * |
|
| 10 | + * @ package Event Espresso |
|
| 11 | + * @ author Seth Shoultes |
|
| 12 | + * @ copyright (c) 2008-2011 Event Espresso All Rights Reserved. |
|
| 13 | + * @ license http://eventespresso.com/support/terms-conditions/ * see Plugin Licensing * |
|
| 14 | + * @ link http://www.eventespresso.com |
|
| 15 | + * @ version 4.3 |
|
| 16 | + * |
|
| 17 | + * ------------------------------------------------------------------------ |
|
| 18 | + * |
|
| 19 | + * payment_log_details |
|
| 20 | + * |
|
| 21 | + * @package Event Espresso |
|
| 22 | + * @subpackage |
|
| 23 | + * @author Mike Nelson |
|
| 24 | + * |
|
| 25 | + * ------------------------------------------------------------------------ |
|
| 26 | + */ |
|
| 27 | 27 | /*@var EE_Change_Log $payment_Log */ |
| 28 | 28 | /*@var EE_Payment_Method $payment_Method*/ |
| 29 | 29 | /*@var EE_Transaction $transaction*/ |
@@ -1,6 +1,6 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -if (!defined('EVENT_ESPRESSO_VERSION')) |
|
| 3 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) |
|
| 4 | 4 | exit('No direct script access allowed'); |
| 5 | 5 | /** |
| 6 | 6 | * Event Espresso |
@@ -61,7 +61,7 @@ discard block |
||
| 61 | 61 | </label> |
| 62 | 62 | </th> |
| 63 | 63 | <td> |
| 64 | - <?php echo $transaction ? $transaction->ID() : __("Could not be determined", 'event_espresso');?> |
|
| 64 | + <?php echo $transaction ? $transaction->ID() : __("Could not be determined", 'event_espresso'); ?> |
|
| 65 | 65 | |
| 66 | 66 | </td> |
| 67 | 67 | </tr> |
@@ -72,7 +72,7 @@ discard block |
||
| 72 | 72 | </label> |
| 73 | 73 | </th> |
| 74 | 74 | <td> |
| 75 | - <?php echo $payment_log->e('LOG_message','as_table');//EEH_Template::layout_array_as_table($payment_log->content())?> |
|
| 75 | + <?php echo $payment_log->e('LOG_message', 'as_table'); //EEH_Template::layout_array_as_table($payment_log->content())?> |
|
| 76 | 76 | </td> |
| 77 | 77 | </tr> |
| 78 | 78 | </tbody> |
@@ -1,7 +1,8 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | -if (!defined('EVENT_ESPRESSO_VERSION')) |
|
| 3 | +if (!defined('EVENT_ESPRESSO_VERSION')) { |
|
| 4 | 4 | exit('No direct script access allowed'); |
| 5 | +} |
|
| 5 | 6 | /** |
| 6 | 7 | * Event Espresso |
| 7 | 8 | * |
@@ -14,7 +14,7 @@ |
||
| 14 | 14 | <td> |
| 15 | 15 | |
| 16 | 16 | <a id="activate_<?php echo $payment_method->slug()?>" class="espresso-button-green button-primary" href="<?php echo $activate_url?>"> |
| 17 | - <?php printf(__("Activate %s Payment Method?", "event_espresso"),$payment_method->admin_name()); ?> |
|
| 17 | + <?php printf(__("Activate %s Payment Method?", "event_espresso"), $payment_method->admin_name()); ?> |
|
| 18 | 18 | </a> |
| 19 | 19 | </td> |
| 20 | 20 | </tr> |
@@ -9,7 +9,7 @@ |
||
| 9 | 9 | </label> |
| 10 | 10 | </th> |
| 11 | 11 | <td> |
| 12 | - <?php echo EEH_Form_Fields::select_input('show_pending_payment_options', $values, $show_pending_payment_options ); ?> |
|
| 12 | + <?php echo EEH_Form_Fields::select_input('show_pending_payment_options', $values, $show_pending_payment_options); ?> |
|
| 13 | 13 | |
| 14 | 14 | </td> |
| 15 | 15 | </tr> |