@@ -6,7 +6,7 @@ discard block |
||
6 | 6 | * @package Event Espresso |
7 | 7 | * @subpackage messages |
8 | 8 | */ |
9 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
9 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) |
|
10 | 10 | exit('NO direct script access allowed'); |
11 | 11 | |
12 | 12 | /** |
@@ -24,11 +24,11 @@ discard block |
||
24 | 24 | */ |
25 | 25 | class EE_Messages_Html_Receipt_Validator extends EE_Messages_Validator { |
26 | 26 | |
27 | - public function __construct( $fields, $context ) { |
|
27 | + public function __construct($fields, $context) { |
|
28 | 28 | $this->_m_name = 'html'; |
29 | 29 | $this->_mt_name = 'receipt'; |
30 | 30 | |
31 | - parent::__construct( $fields, $context ); |
|
31 | + parent::__construct($fields, $context); |
|
32 | 32 | } |
33 | 33 | |
34 | 34 | /** |
@@ -6,8 +6,9 @@ |
||
6 | 6 | * @package Event Espresso |
7 | 7 | * @subpackage messages |
8 | 8 | */ |
9 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
9 | +if (!defined('EVENT_ESPRESSO_VERSION') ) { |
|
10 | 10 | exit('NO direct script access allowed'); |
11 | +} |
|
11 | 12 | |
12 | 13 | /** |
13 | 14 | * |
@@ -6,7 +6,7 @@ discard block |
||
6 | 6 | * @package Event Espresso |
7 | 7 | * @subpackage messages |
8 | 8 | */ |
9 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
9 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) |
|
10 | 10 | exit('NO direct script access allowed'); |
11 | 11 | |
12 | 12 | /** |
@@ -34,16 +34,16 @@ discard block |
||
34 | 34 | $this->_shortcodes = array( |
35 | 35 | '[TICKET_LINE_ITEM_LIST]' => __('Outputs a list of ticket line items.', 'event_espresso'), |
36 | 36 | '[TAX_LINE_ITEM_LIST]' => __('Outputs a list of tax line items.', 'event_espresso'), |
37 | - '[ADDITIONAL_LINE_ITEM_LIST]' => __( 'Outputs a list of additional line items (other charges or discounts)', 'event_espresso' ), |
|
37 | + '[ADDITIONAL_LINE_ITEM_LIST]' => __('Outputs a list of additional line items (other charges or discounts)', 'event_espresso'), |
|
38 | 38 | '[PRICE_MODIFIER_LINE_ITEM_LIST]' => __('Outputs a list of price modifier line items', 'event_espresso') |
39 | 39 | ); |
40 | 40 | } |
41 | 41 | |
42 | 42 | |
43 | 43 | |
44 | - protected function _parser( $shortcode ) { |
|
44 | + protected function _parser($shortcode) { |
|
45 | 45 | |
46 | - switch ( $shortcode ) { |
|
46 | + switch ($shortcode) { |
|
47 | 47 | case '[TICKET_LINE_ITEM_LIST]' : |
48 | 48 | return $this->_get_ticket_line_item_list(); |
49 | 49 | break; |
@@ -80,11 +80,11 @@ discard block |
||
80 | 80 | $this->_validate_list_requirements(); |
81 | 81 | $this->_set_shortcode_helper(); |
82 | 82 | |
83 | - if ( ! $this->_data['data'] instanceof EE_Ticket ) { |
|
83 | + if ( ! $this->_data['data'] instanceof EE_Ticket) { |
|
84 | 84 | return ''; |
85 | 85 | } |
86 | 86 | |
87 | - $valid_shortcodes = array( 'line_item', 'line_item_list', 'ticket' ); |
|
87 | + $valid_shortcodes = array('line_item', 'line_item_list', 'ticket'); |
|
88 | 88 | |
89 | 89 | $ticket = $this->_data['data']; |
90 | 90 | $templates = $this->_extra_data['template']; |
@@ -94,10 +94,10 @@ discard block |
||
94 | 94 | $ticket_line_item = $addressee_obj->tickets[$ticket->ID()]['line_item']; |
95 | 95 | $sub_line_items = $addressee_obj->tickets[$ticket->ID()]['sub_line_items']; |
96 | 96 | |
97 | - $template = count( $sub_line_items ) < 2 ? $templates['ticket_line_item_no_pms'] : $templates['ticket_line_item_pms']; |
|
97 | + $template = count($sub_line_items) < 2 ? $templates['ticket_line_item_no_pms'] : $templates['ticket_line_item_pms']; |
|
98 | 98 | |
99 | 99 | //now we just return the appropriate template parsed for each ticket. |
100 | - return $this->_shortcode_helper->parse_line_item_list_template( $template, $ticket_line_item, $valid_shortcodes, $this->_extra_data ); |
|
100 | + return $this->_shortcode_helper->parse_line_item_list_template($template, $ticket_line_item, $valid_shortcodes, $this->_extra_data); |
|
101 | 101 | } |
102 | 102 | |
103 | 103 | |
@@ -115,18 +115,18 @@ discard block |
||
115 | 115 | $this->_validate_list_requirements(); |
116 | 116 | $this->_set_shortcode_helper(); |
117 | 117 | |
118 | - if ( ! $this->_data['data'] instanceof EE_Messages_Addressee ) { |
|
118 | + if ( ! $this->_data['data'] instanceof EE_Messages_Addressee) { |
|
119 | 119 | return ''; |
120 | 120 | } |
121 | 121 | |
122 | 122 | //made it here so we're good to go. |
123 | - $valid_shortcodes = array( 'line_item' ); |
|
123 | + $valid_shortcodes = array('line_item'); |
|
124 | 124 | $templates = $this->_data['template']; |
125 | 125 | |
126 | 126 | $tax_line_items = $this->_data['data']->tax_line_items; |
127 | 127 | $line_item_list = ''; |
128 | - foreach ( $tax_line_items as $line_item ) { |
|
129 | - $line_item_list .= $this->_shortcode_helper->parse_line_item_list_template( $templates['tax_line_item_list'], $line_item, $valid_shortcodes, $this->_extra_data ); |
|
128 | + foreach ($tax_line_items as $line_item) { |
|
129 | + $line_item_list .= $this->_shortcode_helper->parse_line_item_list_template($templates['tax_line_item_list'], $line_item, $valid_shortcodes, $this->_extra_data); |
|
130 | 130 | } |
131 | 131 | |
132 | 132 | return $line_item_list; |
@@ -144,18 +144,18 @@ discard block |
||
144 | 144 | $this->_validate_list_requirements(); |
145 | 145 | $this->_set_shortcode_helper(); |
146 | 146 | |
147 | - if ( ! $this->_data['data'] instanceof EE_Messages_Addressee ) { |
|
147 | + if ( ! $this->_data['data'] instanceof EE_Messages_Addressee) { |
|
148 | 148 | return ''; |
149 | 149 | } |
150 | 150 | |
151 | 151 | //made it here so we're good to go. |
152 | - $valid_shortcodes = array( 'line_item' ); |
|
152 | + $valid_shortcodes = array('line_item'); |
|
153 | 153 | $templates = $this->_data['template']; |
154 | 154 | |
155 | 155 | $additional_line_items = $this->_data['data']->additional_line_items; |
156 | 156 | $line_item_list = ''; |
157 | - foreach ( $additional_line_items as $line_item ) { |
|
158 | - $line_item_list .= $this->_shortcode_helper->parse_line_item_list_template( $templates['additional_line_item_list'], $line_item, $valid_shortcodes, $this->_extra_data ); |
|
157 | + foreach ($additional_line_items as $line_item) { |
|
158 | + $line_item_list .= $this->_shortcode_helper->parse_line_item_list_template($templates['additional_line_item_list'], $line_item, $valid_shortcodes, $this->_extra_data); |
|
159 | 159 | } |
160 | 160 | |
161 | 161 | |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | $this->_validate_list_requirements(); |
179 | 179 | $this->_set_shortcode_helper(); |
180 | 180 | |
181 | - if ( ! $this->_data['data'] instanceof EE_Line_Item ) { |
|
181 | + if ( ! $this->_data['data'] instanceof EE_Line_Item) { |
|
182 | 182 | return ''; |
183 | 183 | } |
184 | 184 | |
@@ -187,16 +187,16 @@ discard block |
||
187 | 187 | $templates = $this->_extra_data['template']; |
188 | 188 | $addressee_obj = $this->_extra_data['data']; |
189 | 189 | |
190 | - $valid_shortcodes = array( 'line_item' ); |
|
190 | + $valid_shortcodes = array('line_item'); |
|
191 | 191 | |
192 | 192 | $main_line_item_id = $main_line_item->ID(); |
193 | 193 | |
194 | - $price_mod_line_items = ! empty( $addressee_obj->line_items_with_children[$main_line_item_id]['children'] ) ? $addressee_obj->line_items_with_children[$main_line_item_id]['children'] : array(); |
|
194 | + $price_mod_line_items = ! empty($addressee_obj->line_items_with_children[$main_line_item_id]['children']) ? $addressee_obj->line_items_with_children[$main_line_item_id]['children'] : array(); |
|
195 | 195 | |
196 | 196 | $line_item_list = ''; |
197 | 197 | |
198 | - foreach( $price_mod_line_items as $line_item ) { |
|
199 | - $line_item_list .= $this->_shortcode_helper->parse_line_item_list_template( $templates['price_modifier_line_item_list'], $line_item, $valid_shortcodes, $this->_extra_data ); |
|
198 | + foreach ($price_mod_line_items as $line_item) { |
|
199 | + $line_item_list .= $this->_shortcode_helper->parse_line_item_list_template($templates['price_modifier_line_item_list'], $line_item, $valid_shortcodes, $this->_extra_data); |
|
200 | 200 | } |
201 | 201 | |
202 | 202 | return $line_item_list; |
@@ -6,8 +6,9 @@ |
||
6 | 6 | * @package Event Espresso |
7 | 7 | * @subpackage messages |
8 | 8 | */ |
9 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
9 | +if (!defined('EVENT_ESPRESSO_VERSION') ) { |
|
10 | 10 | exit('NO direct script access allowed'); |
11 | +} |
|
11 | 12 | |
12 | 13 | /** |
13 | 14 | * |
@@ -1,4 +1,6 @@ |
||
1 | -<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed'); |
|
1 | +<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
2 | + exit('No direct script access allowed'); |
|
3 | +} |
|
2 | 4 | /** |
3 | 5 | * Event Espresso |
4 | 6 | * |
@@ -280,7 +280,7 @@ discard block |
||
280 | 280 | * process_registration_from_admin |
281 | 281 | * |
282 | 282 | * @access public |
283 | - * @return int |
|
283 | + * @return EE_Transaction |
|
284 | 284 | */ |
285 | 285 | public static function process_registration_from_admin() { |
286 | 286 | EED_Single_Page_Checkout::load_reg_steps(); |
@@ -608,7 +608,7 @@ discard block |
||
608 | 608 | * _get_transaction_and_cart_for_previous_visit |
609 | 609 | * |
610 | 610 | * @access private |
611 | - * @return mixed EE_Transaction|NULL |
|
611 | + * @return EE_Transaction|null EE_Transaction|NULL |
|
612 | 612 | */ |
613 | 613 | private function _get_transaction_and_cart_for_previous_visit() { |
614 | 614 | /** @var $TXN_model EEM_Transaction */ |
@@ -677,7 +677,7 @@ discard block |
||
677 | 677 | * generates a new EE_Transaction object and adds it to the $_transaction property. |
678 | 678 | * |
679 | 679 | * @access private |
680 | - * @return mixed EE_Transaction|NULL |
|
680 | + * @return EE_Transaction|null EE_Transaction|NULL |
|
681 | 681 | */ |
682 | 682 | private function _initialize_transaction() { |
683 | 683 | try { |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | * @return EED_Single_Page_Checkout |
39 | 39 | */ |
40 | 40 | public static function instance() { |
41 | - return parent::get_instance( __CLASS__ ); |
|
41 | + return parent::get_instance(__CLASS__); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | |
@@ -83,20 +83,20 @@ discard block |
||
83 | 83 | */ |
84 | 84 | public static function set_hooks_admin() { |
85 | 85 | EED_Single_Page_Checkout::set_definitions(); |
86 | - if ( defined( 'DOING_AJAX' )) { |
|
86 | + if (defined('DOING_AJAX')) { |
|
87 | 87 | EED_Single_Page_Checkout::load_request_handler(); |
88 | 88 | EED_Single_Page_Checkout::load_reg_steps(); |
89 | 89 | } else { |
90 | 90 | // hook into the top of pre_get_posts to set the reg step routing, which gives other modules or plugins a chance to modify the reg steps, but just before the routes get called |
91 | - add_action( 'pre_get_posts', array( 'EED_Single_Page_Checkout', 'load_reg_steps' ), 1 ); |
|
91 | + add_action('pre_get_posts', array('EED_Single_Page_Checkout', 'load_reg_steps'), 1); |
|
92 | 92 | } |
93 | 93 | // set ajax hooks |
94 | - add_action( 'wp_ajax_process_reg_step', array( 'EED_Single_Page_Checkout', 'process_reg_step' )); |
|
95 | - add_action( 'wp_ajax_nopriv_process_reg_step', array( 'EED_Single_Page_Checkout', 'process_reg_step' )); |
|
96 | - add_action( 'wp_ajax_display_spco_reg_step', array( 'EED_Single_Page_Checkout', 'display_reg_step' )); |
|
97 | - add_action( 'wp_ajax_nopriv_display_spco_reg_step', array( 'EED_Single_Page_Checkout', 'display_reg_step' )); |
|
98 | - add_action( 'wp_ajax_update_reg_step', array( 'EED_Single_Page_Checkout', 'update_reg_step' )); |
|
99 | - add_action( 'wp_ajax_nopriv_update_reg_step', array( 'EED_Single_Page_Checkout', 'update_reg_step' )); |
|
94 | + add_action('wp_ajax_process_reg_step', array('EED_Single_Page_Checkout', 'process_reg_step')); |
|
95 | + add_action('wp_ajax_nopriv_process_reg_step', array('EED_Single_Page_Checkout', 'process_reg_step')); |
|
96 | + add_action('wp_ajax_display_spco_reg_step', array('EED_Single_Page_Checkout', 'display_reg_step')); |
|
97 | + add_action('wp_ajax_nopriv_display_spco_reg_step', array('EED_Single_Page_Checkout', 'display_reg_step')); |
|
98 | + add_action('wp_ajax_update_reg_step', array('EED_Single_Page_Checkout', 'update_reg_step')); |
|
99 | + add_action('wp_ajax_nopriv_update_reg_step', array('EED_Single_Page_Checkout', 'update_reg_step')); |
|
100 | 100 | } |
101 | 101 | |
102 | 102 | |
@@ -105,8 +105,8 @@ discard block |
||
105 | 105 | * process ajax request |
106 | 106 | * @param string $ajax_action |
107 | 107 | */ |
108 | - public static function process_ajax_request( $ajax_action ) { |
|
109 | - EE_Registry::instance()->REQ->set( 'action', $ajax_action ); |
|
108 | + public static function process_ajax_request($ajax_action) { |
|
109 | + EE_Registry::instance()->REQ->set('action', $ajax_action); |
|
110 | 110 | EED_Single_Page_Checkout::instance()->_initialize(); |
111 | 111 | } |
112 | 112 | |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | * ajax display registration step |
117 | 117 | */ |
118 | 118 | public static function display_reg_step() { |
119 | - EED_Single_Page_Checkout::process_ajax_request( 'display_spco_reg_step' ); |
|
119 | + EED_Single_Page_Checkout::process_ajax_request('display_spco_reg_step'); |
|
120 | 120 | } |
121 | 121 | |
122 | 122 | |
@@ -125,7 +125,7 @@ discard block |
||
125 | 125 | * ajax process registration step |
126 | 126 | */ |
127 | 127 | public static function process_reg_step() { |
128 | - EED_Single_Page_Checkout::process_ajax_request( 'process_reg_step' ); |
|
128 | + EED_Single_Page_Checkout::process_ajax_request('process_reg_step'); |
|
129 | 129 | } |
130 | 130 | |
131 | 131 | |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | * ajax process registration step |
135 | 135 | */ |
136 | 136 | public static function update_reg_step() { |
137 | - EED_Single_Page_Checkout::process_ajax_request( 'update_reg_step' ); |
|
137 | + EED_Single_Page_Checkout::process_ajax_request('update_reg_step'); |
|
138 | 138 | } |
139 | 139 | |
140 | 140 | |
@@ -147,8 +147,8 @@ discard block |
||
147 | 147 | */ |
148 | 148 | public static function load_request_handler() { |
149 | 149 | // load core Request_Handler class |
150 | - if ( ! isset( EE_Registry::instance()->REQ )) { |
|
151 | - EE_Registry::instance()->load_core( 'Request_Handler' ); |
|
150 | + if ( ! isset(EE_Registry::instance()->REQ)) { |
|
151 | + EE_Registry::instance()->load_core('Request_Handler'); |
|
152 | 152 | } |
153 | 153 | } |
154 | 154 | |
@@ -161,13 +161,13 @@ discard block |
||
161 | 161 | * @return void |
162 | 162 | */ |
163 | 163 | public static function set_definitions() { |
164 | - define( 'SPCO_BASE_PATH', rtrim( str_replace( array( '\\', '/' ), DS, plugin_dir_path( __FILE__ )), DS ) . DS ); |
|
165 | - define( 'SPCO_CSS_URL', plugin_dir_url( __FILE__ ) . 'css' . DS ); |
|
166 | - define( 'SPCO_IMG_URL', plugin_dir_url( __FILE__ ) . 'img' . DS ); |
|
167 | - define( 'SPCO_JS_URL', plugin_dir_url( __FILE__ ) . 'js' . DS ); |
|
168 | - define( 'SPCO_INC_PATH', SPCO_BASE_PATH . 'inc' . DS ); |
|
169 | - define( 'SPCO_TEMPLATES_PATH', SPCO_BASE_PATH . 'templates' . DS ); |
|
170 | - EEH_Autoloader::register_autoloaders_for_each_file_in_folder( SPCO_BASE_PATH, TRUE ); |
|
164 | + define('SPCO_BASE_PATH', rtrim(str_replace(array('\\', '/'), DS, plugin_dir_path(__FILE__)), DS).DS); |
|
165 | + define('SPCO_CSS_URL', plugin_dir_url(__FILE__).'css'.DS); |
|
166 | + define('SPCO_IMG_URL', plugin_dir_url(__FILE__).'img'.DS); |
|
167 | + define('SPCO_JS_URL', plugin_dir_url(__FILE__).'js'.DS); |
|
168 | + define('SPCO_INC_PATH', SPCO_BASE_PATH.'inc'.DS); |
|
169 | + define('SPCO_TEMPLATES_PATH', SPCO_BASE_PATH.'templates'.DS); |
|
170 | + EEH_Autoloader::register_autoloaders_for_each_file_in_folder(SPCO_BASE_PATH, TRUE); |
|
171 | 171 | } |
172 | 172 | |
173 | 173 | |
@@ -182,31 +182,31 @@ discard block |
||
182 | 182 | */ |
183 | 183 | public static function load_reg_steps() { |
184 | 184 | static $reg_steps_loaded = FALSE; |
185 | - if ( $reg_steps_loaded ) { |
|
185 | + if ($reg_steps_loaded) { |
|
186 | 186 | return; |
187 | 187 | } |
188 | 188 | // load EE_SPCO_Reg_Step base class |
189 | - EE_Registry::instance()->load_file( SPCO_INC_PATH, 'EE_SPCO_Reg_Step', 'class' ); |
|
189 | + EE_Registry::instance()->load_file(SPCO_INC_PATH, 'EE_SPCO_Reg_Step', 'class'); |
|
190 | 190 | // filter list of reg_steps |
191 | - $reg_steps_to_load = apply_filters( 'AHEE__SPCO__load_reg_steps__reg_steps_to_load', EED_Single_Page_Checkout::get_reg_steps() ); |
|
191 | + $reg_steps_to_load = apply_filters('AHEE__SPCO__load_reg_steps__reg_steps_to_load', EED_Single_Page_Checkout::get_reg_steps()); |
|
192 | 192 | // sort by key (order) |
193 | - ksort( $reg_steps_to_load ); |
|
193 | + ksort($reg_steps_to_load); |
|
194 | 194 | // loop through folders |
195 | - foreach ( $reg_steps_to_load as $order => $reg_step ) { |
|
195 | + foreach ($reg_steps_to_load as $order => $reg_step) { |
|
196 | 196 | // we need a |
197 | - if ( isset( $reg_step['file_path'], $reg_step['class_name'], $reg_step['slug'] )) { |
|
197 | + if (isset($reg_step['file_path'], $reg_step['class_name'], $reg_step['slug'])) { |
|
198 | 198 | // copy over to the reg_steps_array |
199 | - EED_Single_Page_Checkout::$_reg_steps_array[ $order ] = $reg_step; |
|
199 | + EED_Single_Page_Checkout::$_reg_steps_array[$order] = $reg_step; |
|
200 | 200 | // register custom key route for each reg step ( ie: step=>"slug" - this is the entire reason we load the reg steps array now ) |
201 | - EE_Config::register_route( $reg_step['slug'], 'EED_Single_Page_Checkout', 'run', 'step' ); |
|
201 | + EE_Config::register_route($reg_step['slug'], 'EED_Single_Page_Checkout', 'run', 'step'); |
|
202 | 202 | // add AJAX or other hooks |
203 | - if ( isset( $reg_step['has_hooks'] ) && $reg_step['has_hooks'] ) { |
|
203 | + if (isset($reg_step['has_hooks']) && $reg_step['has_hooks']) { |
|
204 | 204 | // setup autoloaders if necessary |
205 | - if ( ! class_exists( $reg_step['class_name'] )) { |
|
206 | - EEH_Autoloader::register_autoloaders_for_each_file_in_folder( $reg_step['file_path'], TRUE ); |
|
205 | + if ( ! class_exists($reg_step['class_name'])) { |
|
206 | + EEH_Autoloader::register_autoloaders_for_each_file_in_folder($reg_step['file_path'], TRUE); |
|
207 | 207 | } |
208 | - if ( is_callable( $reg_step['class_name'], 'set_hooks' )) { |
|
209 | - call_user_func( array( $reg_step['class_name'], 'set_hooks' )); |
|
208 | + if (is_callable($reg_step['class_name'], 'set_hooks')) { |
|
209 | + call_user_func(array($reg_step['class_name'], 'set_hooks')); |
|
210 | 210 | } |
211 | 211 | } |
212 | 212 | } |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | */ |
226 | 226 | public static function get_reg_steps() { |
227 | 227 | $reg_steps = EE_Registry::instance()->CFG->registration->reg_steps; |
228 | - if ( empty( $reg_steps )) { |
|
228 | + if (empty($reg_steps)) { |
|
229 | 229 | $reg_steps = array( |
230 | 230 | 10 => array( |
231 | 231 | 'file_path' => SPCO_INC_PATH, |
@@ -266,9 +266,9 @@ discard block |
||
266 | 266 | */ |
267 | 267 | public static function registration_checkout_for_admin() { |
268 | 268 | EED_Single_Page_Checkout::load_reg_steps(); |
269 | - EE_Registry::instance()->REQ->set( 'step', 'attendee_information' ); |
|
270 | - EE_Registry::instance()->REQ->set( 'action', 'display_spco_reg_step' ); |
|
271 | - EE_Registry::instance()->REQ->set( 'process_form_submission', false ); |
|
269 | + EE_Registry::instance()->REQ->set('step', 'attendee_information'); |
|
270 | + EE_Registry::instance()->REQ->set('action', 'display_spco_reg_step'); |
|
271 | + EE_Registry::instance()->REQ->set('process_form_submission', false); |
|
272 | 272 | EED_Single_Page_Checkout::instance()->_initialize(); |
273 | 273 | EED_Single_Page_Checkout::instance()->_display_spco_reg_form(); |
274 | 274 | return EE_Registry::instance()->REQ->get_output(); |
@@ -284,14 +284,14 @@ discard block |
||
284 | 284 | */ |
285 | 285 | public static function process_registration_from_admin() { |
286 | 286 | EED_Single_Page_Checkout::load_reg_steps(); |
287 | - EE_Registry::instance()->REQ->set( 'step', 'attendee_information' ); |
|
288 | - EE_Registry::instance()->REQ->set( 'action', 'process_reg_step' ); |
|
289 | - EE_Registry::instance()->REQ->set( 'process_form_submission', true ); |
|
287 | + EE_Registry::instance()->REQ->set('step', 'attendee_information'); |
|
288 | + EE_Registry::instance()->REQ->set('action', 'process_reg_step'); |
|
289 | + EE_Registry::instance()->REQ->set('process_form_submission', true); |
|
290 | 290 | EED_Single_Page_Checkout::instance()->_initialize(); |
291 | - if ( EED_Single_Page_Checkout::instance()->checkout->current_step->completed() ) { |
|
292 | - $final_reg_step = end( EED_Single_Page_Checkout::instance()->checkout->reg_steps ); |
|
293 | - if ( $final_reg_step instanceof EE_SPCO_Reg_Step_Finalize_Registration ) { |
|
294 | - if ( $final_reg_step->process_reg_step() ) { |
|
291 | + if (EED_Single_Page_Checkout::instance()->checkout->current_step->completed()) { |
|
292 | + $final_reg_step = end(EED_Single_Page_Checkout::instance()->checkout->reg_steps); |
|
293 | + if ($final_reg_step instanceof EE_SPCO_Reg_Step_Finalize_Registration) { |
|
294 | + if ($final_reg_step->process_reg_step()) { |
|
295 | 295 | return EED_Single_Page_Checkout::instance()->checkout->transaction; |
296 | 296 | } |
297 | 297 | } |
@@ -308,8 +308,8 @@ discard block |
||
308 | 308 | * @param WP_Query $WP_Query |
309 | 309 | * @return void |
310 | 310 | */ |
311 | - public function run( $WP_Query ) { |
|
312 | - if ( $WP_Query instanceof WP_Query && $WP_Query->is_main_query() ) { |
|
311 | + public function run($WP_Query) { |
|
312 | + if ($WP_Query instanceof WP_Query && $WP_Query->is_main_query()) { |
|
313 | 313 | $this->_initialize(); |
314 | 314 | } |
315 | 315 | } |
@@ -324,8 +324,8 @@ discard block |
||
324 | 324 | * @param WP_Query $WP_Query |
325 | 325 | * @return void |
326 | 326 | */ |
327 | - public static function init( $WP_Query ) { |
|
328 | - if ( $WP_Query instanceof WP_Query && $WP_Query->is_main_query() ) { |
|
327 | + public static function init($WP_Query) { |
|
328 | + if ($WP_Query instanceof WP_Query && $WP_Query->is_main_query()) { |
|
329 | 329 | EED_Single_Page_Checkout::instance()->_initialize(); |
330 | 330 | } |
331 | 331 | } |
@@ -341,7 +341,7 @@ discard block |
||
341 | 341 | */ |
342 | 342 | private function _initialize() { |
343 | 343 | // ensure SPCO doesn't run twice |
344 | - if ( EED_Single_Page_Checkout::$_initialized ) { |
|
344 | + if (EED_Single_Page_Checkout::$_initialized) { |
|
345 | 345 | return; |
346 | 346 | } |
347 | 347 | // setup the EE_Checkout object |
@@ -349,22 +349,22 @@ discard block |
||
349 | 349 | // get the $_GET |
350 | 350 | $this->_get_request_vars(); |
351 | 351 | // filter continue_reg |
352 | - $this->checkout->continue_reg = apply_filters( 'FHEE__EED_Single_Page_Checkout__init___continue_reg', TRUE, $this->checkout ); |
|
352 | + $this->checkout->continue_reg = apply_filters('FHEE__EED_Single_Page_Checkout__init___continue_reg', TRUE, $this->checkout); |
|
353 | 353 | // load the reg steps array |
354 | - if ( ! $this->_load_and_instantiate_reg_steps() ) { |
|
354 | + if ( ! $this->_load_and_instantiate_reg_steps()) { |
|
355 | 355 | EED_Single_Page_Checkout::$_initialized = true; |
356 | 356 | return; |
357 | 357 | } |
358 | 358 | // set the current step |
359 | - $this->checkout->set_current_step( $this->checkout->step ); |
|
359 | + $this->checkout->set_current_step($this->checkout->step); |
|
360 | 360 | // and the next step |
361 | 361 | $this->checkout->set_next_step(); |
362 | 362 | // was there already a valid transaction in the checkout from the session ? |
363 | - if ( ! $this->checkout->transaction instanceof EE_Transaction ) { |
|
363 | + if ( ! $this->checkout->transaction instanceof EE_Transaction) { |
|
364 | 364 | // get transaction from db or session |
365 | 365 | $this->checkout->transaction = $this->checkout->reg_url_link && ! is_admin() ? $this->_get_transaction_and_cart_for_previous_visit() : $this->_get_cart_for_current_session_and_setup_new_transaction(); |
366 | - if ( ! $this->checkout->transaction instanceof EE_Transaction ) { |
|
367 | - EE_Error::add_error( __( 'Your Registration and Transaction information could not be retrieved from the db.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__); |
|
366 | + if ( ! $this->checkout->transaction instanceof EE_Transaction) { |
|
367 | + EE_Error::add_error(__('Your Registration and Transaction information could not be retrieved from the db.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__); |
|
368 | 368 | // add some style and make it dance |
369 | 369 | $this->checkout->transaction = EE_Transaction::new_instance(); |
370 | 370 | $this->add_styles_and_scripts(); |
@@ -372,10 +372,10 @@ discard block |
||
372 | 372 | return; |
373 | 373 | } |
374 | 374 | // and the registrations for the transaction |
375 | - $this->_get_registrations( $this->checkout->transaction ); |
|
375 | + $this->_get_registrations($this->checkout->transaction); |
|
376 | 376 | } |
377 | 377 | // verify that everything has been setup correctly |
378 | - if ( ! $this->_final_verifications() ) { |
|
378 | + if ( ! $this->_final_verifications()) { |
|
379 | 379 | EED_Single_Page_Checkout::$_initialized = true; |
380 | 380 | return; |
381 | 381 | } |
@@ -400,7 +400,7 @@ discard block |
||
400 | 400 | // set no cache headers and constants |
401 | 401 | EE_System::do_not_cache(); |
402 | 402 | // remove transaction lock |
403 | - add_action( 'shutdown', array( $this, 'unlock_transaction' ), 1 ); |
|
403 | + add_action('shutdown', array($this, 'unlock_transaction'), 1); |
|
404 | 404 | } |
405 | 405 | |
406 | 406 | |
@@ -417,16 +417,16 @@ discard block |
||
417 | 417 | // look in session for existing checkout |
418 | 418 | $checkout = EE_Registry::instance()->SSN->checkout(); |
419 | 419 | // verify |
420 | - if ( ! $checkout instanceof EE_Checkout ) { |
|
420 | + if ( ! $checkout instanceof EE_Checkout) { |
|
421 | 421 | // instantiate EE_Checkout object for handling the properties of the current checkout process |
422 | - $checkout = EE_Registry::instance()->load_file( SPCO_INC_PATH, 'EE_Checkout', 'class', array(), FALSE ); |
|
422 | + $checkout = EE_Registry::instance()->load_file(SPCO_INC_PATH, 'EE_Checkout', 'class', array(), FALSE); |
|
423 | 423 | // verify again |
424 | - if ( ! $checkout instanceof EE_Checkout ) { |
|
425 | - throw new EE_Error( __( 'The EE_Checkout class could not be loaded.', 'event_espresso' ) ); |
|
424 | + if ( ! $checkout instanceof EE_Checkout) { |
|
425 | + throw new EE_Error(__('The EE_Checkout class could not be loaded.', 'event_espresso')); |
|
426 | 426 | } |
427 | 427 | } else { |
428 | - if ( $checkout->current_step->is_final_step() && $checkout->exit_spco() === true ) { |
|
429 | - wp_safe_redirect( $checkout->redirect_url ); |
|
428 | + if ($checkout->current_step->is_final_step() && $checkout->exit_spco() === true) { |
|
429 | + wp_safe_redirect($checkout->redirect_url); |
|
430 | 430 | exit(); |
431 | 431 | } |
432 | 432 | } |
@@ -447,22 +447,22 @@ discard block |
||
447 | 447 | // load classes |
448 | 448 | EED_Single_Page_Checkout::load_request_handler(); |
449 | 449 | //make sure this request is marked as belonging to EE |
450 | - EE_Registry::instance()->REQ->set_espresso_page( TRUE ); |
|
450 | + EE_Registry::instance()->REQ->set_espresso_page(TRUE); |
|
451 | 451 | // which step is being requested ? |
452 | - $this->checkout->step = EE_Registry::instance()->REQ->get( 'step', $this->_get_first_step() ); |
|
452 | + $this->checkout->step = EE_Registry::instance()->REQ->get('step', $this->_get_first_step()); |
|
453 | 453 | // which step is being edited ? |
454 | - $this->checkout->edit_step = EE_Registry::instance()->REQ->get( 'edit_step', '' ); |
|
454 | + $this->checkout->edit_step = EE_Registry::instance()->REQ->get('edit_step', ''); |
|
455 | 455 | // and what we're doing on the current step |
456 | - $this->checkout->action = EE_Registry::instance()->REQ->get( 'action', 'display_spco_reg_step' ); |
|
456 | + $this->checkout->action = EE_Registry::instance()->REQ->get('action', 'display_spco_reg_step'); |
|
457 | 457 | // returning to edit ? |
458 | - $this->checkout->reg_url_link = EE_Registry::instance()->REQ->get( 'e_reg_url_link', '' ); |
|
458 | + $this->checkout->reg_url_link = EE_Registry::instance()->REQ->get('e_reg_url_link', ''); |
|
459 | 459 | // or some other kind of revisit ? |
460 | - $this->checkout->revisit = EE_Registry::instance()->REQ->get( 'revisit', FALSE ); |
|
460 | + $this->checkout->revisit = EE_Registry::instance()->REQ->get('revisit', FALSE); |
|
461 | 461 | // and whether or not to generate a reg form for this request |
462 | - $this->checkout->generate_reg_form = EE_Registry::instance()->REQ->get( 'generate_reg_form', TRUE ); // TRUE FALSE |
|
462 | + $this->checkout->generate_reg_form = EE_Registry::instance()->REQ->get('generate_reg_form', TRUE); // TRUE FALSE |
|
463 | 463 | // and whether or not to process a reg form submission for this request |
464 | - $this->checkout->process_form_submission = EE_Registry::instance()->REQ->get( 'process_form_submission', FALSE ); // TRUE FALSE |
|
465 | - $this->checkout->process_form_submission = $this->checkout->action !== 'display_spco_reg_step' ? $this->checkout->process_form_submission : FALSE; // TRUE FALSE |
|
464 | + $this->checkout->process_form_submission = EE_Registry::instance()->REQ->get('process_form_submission', FALSE); // TRUE FALSE |
|
465 | + $this->checkout->process_form_submission = $this->checkout->action !== 'display_spco_reg_step' ? $this->checkout->process_form_submission : FALSE; // TRUE FALSE |
|
466 | 466 | //$this->_display_request_vars(); |
467 | 467 | } |
468 | 468 | |
@@ -477,14 +477,14 @@ discard block |
||
477 | 477 | * @return array |
478 | 478 | */ |
479 | 479 | protected function _display_request_vars() { |
480 | - EEH_Debug_Tools::printr( $_REQUEST, '$_REQUEST', __FILE__, __LINE__ ); |
|
481 | - EEH_Debug_Tools::printr( $this->checkout->step, '$this->checkout->step', __FILE__, __LINE__ ); |
|
482 | - EEH_Debug_Tools::printr( $this->checkout->edit_step, '$this->checkout->edit_step', __FILE__, __LINE__ ); |
|
483 | - EEH_Debug_Tools::printr( $this->checkout->action, '$this->checkout->action', __FILE__, __LINE__ ); |
|
484 | - EEH_Debug_Tools::printr( $this->checkout->reg_url_link, '$this->checkout->reg_url_link', __FILE__, __LINE__ ); |
|
485 | - EEH_Debug_Tools::printr( $this->checkout->revisit, '$this->checkout->revisit', __FILE__, __LINE__ ); |
|
486 | - EEH_Debug_Tools::printr( $this->checkout->generate_reg_form, '$this->checkout->generate_reg_form', __FILE__, __LINE__ ); |
|
487 | - EEH_Debug_Tools::printr( $this->checkout->process_form_submission, '$this->checkout->process_form_submission', __FILE__, __LINE__ ); |
|
480 | + EEH_Debug_Tools::printr($_REQUEST, '$_REQUEST', __FILE__, __LINE__); |
|
481 | + EEH_Debug_Tools::printr($this->checkout->step, '$this->checkout->step', __FILE__, __LINE__); |
|
482 | + EEH_Debug_Tools::printr($this->checkout->edit_step, '$this->checkout->edit_step', __FILE__, __LINE__); |
|
483 | + EEH_Debug_Tools::printr($this->checkout->action, '$this->checkout->action', __FILE__, __LINE__); |
|
484 | + EEH_Debug_Tools::printr($this->checkout->reg_url_link, '$this->checkout->reg_url_link', __FILE__, __LINE__); |
|
485 | + EEH_Debug_Tools::printr($this->checkout->revisit, '$this->checkout->revisit', __FILE__, __LINE__); |
|
486 | + EEH_Debug_Tools::printr($this->checkout->generate_reg_form, '$this->checkout->generate_reg_form', __FILE__, __LINE__); |
|
487 | + EEH_Debug_Tools::printr($this->checkout->process_form_submission, '$this->checkout->process_form_submission', __FILE__, __LINE__); |
|
488 | 488 | } |
489 | 489 | |
490 | 490 | |
@@ -498,8 +498,8 @@ discard block |
||
498 | 498 | * @return array |
499 | 499 | */ |
500 | 500 | private function _get_first_step() { |
501 | - $first_step = reset( EED_Single_Page_Checkout::$_reg_steps_array ); |
|
502 | - return isset( $first_step['slug'] ) ? $first_step['slug'] : 'attendee_information'; |
|
501 | + $first_step = reset(EED_Single_Page_Checkout::$_reg_steps_array); |
|
502 | + return isset($first_step['slug']) ? $first_step['slug'] : 'attendee_information'; |
|
503 | 503 | } |
504 | 504 | |
505 | 505 | |
@@ -514,35 +514,35 @@ discard block |
||
514 | 514 | */ |
515 | 515 | private function _load_and_instantiate_reg_steps() { |
516 | 516 | // have reg_steps already been instantiated ? |
517 | - if ( empty( $this->checkout->reg_steps )) { |
|
517 | + if (empty($this->checkout->reg_steps)) { |
|
518 | 518 | // if not, then loop through raw reg steps array |
519 | - foreach ( EED_Single_Page_Checkout::$_reg_steps_array as $order => $reg_step ) { |
|
520 | - if ( ! $this->_load_and_instantiate_reg_step( $reg_step, $order )) { |
|
519 | + foreach (EED_Single_Page_Checkout::$_reg_steps_array as $order => $reg_step) { |
|
520 | + if ( ! $this->_load_and_instantiate_reg_step($reg_step, $order)) { |
|
521 | 521 | return false; |
522 | 522 | } |
523 | 523 | } |
524 | 524 | EE_Registry::instance()->CFG->registration->skip_reg_confirmation = TRUE; |
525 | 525 | EE_Registry::instance()->CFG->registration->reg_confirmation_last = TRUE; |
526 | 526 | // skip the registration_confirmation page ? |
527 | - if ( EE_Registry::instance()->CFG->registration->skip_reg_confirmation ) { |
|
527 | + if (EE_Registry::instance()->CFG->registration->skip_reg_confirmation) { |
|
528 | 528 | // just remove it from the reg steps array |
529 | - $this->checkout->remove_reg_step( 'registration_confirmation' ); |
|
530 | - } else if ( EE_Registry::instance()->CFG->registration->reg_confirmation_last && isset( $this->checkout->reg_steps['registration_confirmation'] )) { |
|
529 | + $this->checkout->remove_reg_step('registration_confirmation'); |
|
530 | + } else if (EE_Registry::instance()->CFG->registration->reg_confirmation_last && isset($this->checkout->reg_steps['registration_confirmation'])) { |
|
531 | 531 | // set the order to something big like 100 |
532 | - $this->checkout->set_reg_step_order( 'registration_confirmation', 100 ); |
|
532 | + $this->checkout->set_reg_step_order('registration_confirmation', 100); |
|
533 | 533 | } |
534 | 534 | // filter the array for good luck |
535 | - $this->checkout->reg_steps = apply_filters( 'FHEE__Single_Page_Checkout__load_reg_steps__reg_steps', $this->checkout->reg_steps ); |
|
535 | + $this->checkout->reg_steps = apply_filters('FHEE__Single_Page_Checkout__load_reg_steps__reg_steps', $this->checkout->reg_steps); |
|
536 | 536 | // finally re-sort based on the reg step class order properties |
537 | 537 | $this->checkout->sort_reg_steps(); |
538 | 538 | } else { |
539 | - foreach ( $this->checkout->reg_steps as $reg_step ) { |
|
539 | + foreach ($this->checkout->reg_steps as $reg_step) { |
|
540 | 540 | // set all current step stati to FALSE |
541 | - $reg_step->set_is_current_step( FALSE ); |
|
541 | + $reg_step->set_is_current_step(FALSE); |
|
542 | 542 | } |
543 | 543 | } |
544 | - if ( empty( $this->checkout->reg_steps )) { |
|
545 | - EE_Error::add_error( __( 'No Reg Steps were loaded..', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__); |
|
544 | + if (empty($this->checkout->reg_steps)) { |
|
545 | + EE_Error::add_error(__('No Reg Steps were loaded..', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__); |
|
546 | 546 | return false; |
547 | 547 | } |
548 | 548 | // make reg step details available to JS |
@@ -560,34 +560,34 @@ discard block |
||
560 | 560 | * @param int $order |
561 | 561 | * @return bool |
562 | 562 | */ |
563 | - private function _load_and_instantiate_reg_step( $reg_step = array(), $order = 0 ) { |
|
563 | + private function _load_and_instantiate_reg_step($reg_step = array(), $order = 0) { |
|
564 | 564 | |
565 | 565 | // we need a file_path, class_name, and slug to add a reg step |
566 | - if ( isset( $reg_step['file_path'], $reg_step['class_name'], $reg_step['slug'] )) { |
|
566 | + if (isset($reg_step['file_path'], $reg_step['class_name'], $reg_step['slug'])) { |
|
567 | 567 | // if editing a specific step, but this is NOT that step... (and it's not the 'finalize_registration' step) |
568 | - if ( $this->checkout->reg_url_link && $this->checkout->step !== $reg_step['slug'] && $reg_step['slug'] !== 'finalize_registration' ) { |
|
568 | + if ($this->checkout->reg_url_link && $this->checkout->step !== $reg_step['slug'] && $reg_step['slug'] !== 'finalize_registration') { |
|
569 | 569 | return true; |
570 | 570 | } |
571 | 571 | // instantiate step class using file path and class name |
572 | - $reg_step_obj = EE_Registry::instance()->load_file( $reg_step['file_path'], $reg_step['class_name'], 'class', $this->checkout, FALSE ); |
|
572 | + $reg_step_obj = EE_Registry::instance()->load_file($reg_step['file_path'], $reg_step['class_name'], 'class', $this->checkout, FALSE); |
|
573 | 573 | // did we gets the goods ? |
574 | - if ( $reg_step_obj instanceof EE_SPCO_Reg_Step ) { |
|
574 | + if ($reg_step_obj instanceof EE_SPCO_Reg_Step) { |
|
575 | 575 | // set reg step order based on config |
576 | - $reg_step_obj->set_order( $order ); |
|
576 | + $reg_step_obj->set_order($order); |
|
577 | 577 | // add instantiated reg step object to the master reg steps array |
578 | - $this->checkout->add_reg_step( $reg_step_obj ); |
|
578 | + $this->checkout->add_reg_step($reg_step_obj); |
|
579 | 579 | } else { |
580 | - EE_Error::add_error( __( 'The current step could not be set.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ ); |
|
580 | + EE_Error::add_error(__('The current step could not be set.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__); |
|
581 | 581 | return false; |
582 | 582 | } |
583 | 583 | } else { |
584 | - if ( WP_DEBUG ) { |
|
584 | + if (WP_DEBUG) { |
|
585 | 585 | EE_Error::add_error( |
586 | 586 | sprintf( |
587 | - __( 'A registration step could not be loaded. One or more of the following data points is invalid:%4$s%5$sFile Path: %1$s%6$s%5$sClass Name: %2$s%6$s%5$sSlug: %3$s%6$s%7$s', 'event_espresso' ), |
|
588 | - isset( $reg_step['file_path'] ) ? $reg_step['file_path'] : '', |
|
589 | - isset( $reg_step['class_name'] ) ? $reg_step['class_name'] : '', |
|
590 | - isset( $reg_step['slug'] ) ? $reg_step['slug'] : '', |
|
587 | + __('A registration step could not be loaded. One or more of the following data points is invalid:%4$s%5$sFile Path: %1$s%6$s%5$sClass Name: %2$s%6$s%5$sSlug: %3$s%6$s%7$s', 'event_espresso'), |
|
588 | + isset($reg_step['file_path']) ? $reg_step['file_path'] : '', |
|
589 | + isset($reg_step['class_name']) ? $reg_step['class_name'] : '', |
|
590 | + isset($reg_step['slug']) ? $reg_step['slug'] : '', |
|
591 | 591 | '<ul>', |
592 | 592 | '<li>', |
593 | 593 | '</li>', |
@@ -611,16 +611,16 @@ discard block |
||
611 | 611 | */ |
612 | 612 | private function _get_transaction_and_cart_for_previous_visit() { |
613 | 613 | /** @var $TXN_model EEM_Transaction */ |
614 | - $TXN_model = EE_Registry::instance()->load_model( 'Transaction' ); |
|
614 | + $TXN_model = EE_Registry::instance()->load_model('Transaction'); |
|
615 | 615 | // because the reg_url_link is present in the request, this is a return visit to SPCO, so we'll get the transaction data from the db |
616 | - $transaction = $TXN_model->get_transaction_from_reg_url_link( $this->checkout->reg_url_link ); |
|
616 | + $transaction = $TXN_model->get_transaction_from_reg_url_link($this->checkout->reg_url_link); |
|
617 | 617 | // verify transaction |
618 | - if ( $transaction instanceof EE_Transaction ) { |
|
618 | + if ($transaction instanceof EE_Transaction) { |
|
619 | 619 | // and get the cart that was used for that transaction |
620 | - $this->checkout->cart = $this->_get_cart_for_transaction( $transaction ); |
|
620 | + $this->checkout->cart = $this->_get_cart_for_transaction($transaction); |
|
621 | 621 | return $transaction; |
622 | 622 | } else { |
623 | - EE_Error::add_error( __( 'Your Registration and Transaction information could not be retrieved from the db.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__); |
|
623 | + EE_Error::add_error(__('Your Registration and Transaction information could not be retrieved from the db.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__); |
|
624 | 624 | return NULL; |
625 | 625 | } |
626 | 626 | } |
@@ -634,11 +634,11 @@ discard block |
||
634 | 634 | * @param EE_Transaction $transaction |
635 | 635 | * @return EE_Cart |
636 | 636 | */ |
637 | - private function _get_cart_for_transaction( $transaction ) { |
|
638 | - $cart = $transaction instanceof EE_Transaction ? EE_Cart::get_cart_from_txn( $transaction ) : NULL; |
|
637 | + private function _get_cart_for_transaction($transaction) { |
|
638 | + $cart = $transaction instanceof EE_Transaction ? EE_Cart::get_cart_from_txn($transaction) : NULL; |
|
639 | 639 | // verify cart |
640 | - if ( ! $cart instanceof EE_Cart ) { |
|
641 | - $cart = EE_Registry::instance()->load_core( 'Cart' ); |
|
640 | + if ( ! $cart instanceof EE_Cart) { |
|
641 | + $cart = EE_Registry::instance()->load_core('Cart'); |
|
642 | 642 | } |
643 | 643 | return $cart; |
644 | 644 | } |
@@ -655,17 +655,17 @@ discard block |
||
655 | 655 | private function _get_cart_for_current_session_and_setup_new_transaction() { |
656 | 656 | // if there's no transaction, then this is the FIRST visit to SPCO |
657 | 657 | // so load up the cart ( passing nothing for the TXN because it doesn't exist yet ) |
658 | - $this->checkout->cart = $this->_get_cart_for_transaction( NULL ); |
|
658 | + $this->checkout->cart = $this->_get_cart_for_transaction(NULL); |
|
659 | 659 | // and then create a new transaction |
660 | 660 | $transaction = $this->_initialize_transaction(); |
661 | 661 | // verify transaction |
662 | - if ( $transaction instanceof EE_Transaction ) { |
|
662 | + if ($transaction instanceof EE_Transaction) { |
|
663 | 663 | // save it so that we have an ID for other objects to use |
664 | 664 | $transaction->save(); |
665 | 665 | // and save TXN data to the cart |
666 | - $this->checkout->cart->get_grand_total()->save_this_and_descendants_to_txn( $transaction->ID() ); |
|
666 | + $this->checkout->cart->get_grand_total()->save_this_and_descendants_to_txn($transaction->ID()); |
|
667 | 667 | } else { |
668 | - EE_Error::add_error( __( 'A Valid Transaction could not be initialized.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ ); |
|
668 | + EE_Error::add_error(__('A Valid Transaction could not be initialized.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__); |
|
669 | 669 | } |
670 | 670 | return $transaction; |
671 | 671 | } |
@@ -681,15 +681,15 @@ discard block |
||
681 | 681 | private function _initialize_transaction() { |
682 | 682 | try { |
683 | 683 | // create new TXN |
684 | - return EE_Transaction::new_instance( array( |
|
685 | - 'TXN_timestamp' => current_time( 'timestamp' ), |
|
684 | + return EE_Transaction::new_instance(array( |
|
685 | + 'TXN_timestamp' => current_time('timestamp'), |
|
686 | 686 | 'TXN_reg_steps' => $this->checkout->initialize_txn_reg_steps_array(), |
687 | 687 | 'TXN_total' => $this->checkout->cart->get_cart_grand_total(), |
688 | 688 | 'TXN_paid' => 0, |
689 | 689 | 'STS_ID' => EEM_Transaction::failed_status_code, |
690 | 690 | )); |
691 | - } catch( Exception $e ) { |
|
692 | - EE_Error::add_error( $e->getMessage(), __FILE__, __FUNCTION__, __LINE__); |
|
691 | + } catch (Exception $e) { |
|
692 | + EE_Error::add_error($e->getMessage(), __FILE__, __FUNCTION__, __LINE__); |
|
693 | 693 | } |
694 | 694 | return NULL; |
695 | 695 | } |
@@ -703,34 +703,34 @@ discard block |
||
703 | 703 | * @param EE_Transaction $transaction |
704 | 704 | * @return EE_Cart |
705 | 705 | */ |
706 | - private function _get_registrations( EE_Transaction $transaction ) { |
|
706 | + private function _get_registrations(EE_Transaction $transaction) { |
|
707 | 707 | // first step: grab the registrants { : o |
708 | - $registrations = $transaction->registrations( $this->checkout->reg_cache_where_params ); |
|
708 | + $registrations = $transaction->registrations($this->checkout->reg_cache_where_params); |
|
709 | 709 | // verify registrations have been set |
710 | - if ( empty( $registrations )) { |
|
710 | + if (empty($registrations)) { |
|
711 | 711 | // if no cached registrations, then check the db |
712 | - $registrations = $transaction->registrations( $this->checkout->reg_cache_where_params ); |
|
712 | + $registrations = $transaction->registrations($this->checkout->reg_cache_where_params); |
|
713 | 713 | // still nothing ? well as long as this isn't a revisit |
714 | - if ( empty( $registrations ) && ! $this->checkout->revisit ) { |
|
714 | + if (empty($registrations) && ! $this->checkout->revisit) { |
|
715 | 715 | // generate new registrations from scratch |
716 | - $registrations = $this->_initialize_registrations( $transaction ); |
|
716 | + $registrations = $this->_initialize_registrations($transaction); |
|
717 | 717 | } |
718 | 718 | } |
719 | 719 | // sort by their original registration order |
720 | - usort( $registrations, array( 'EED_Single_Page_Checkout', 'sort_registrations_by_REG_count' )); |
|
720 | + usort($registrations, array('EED_Single_Page_Checkout', 'sort_registrations_by_REG_count')); |
|
721 | 721 | // then loop thru the array |
722 | - foreach ( $registrations as $registration ) { |
|
722 | + foreach ($registrations as $registration) { |
|
723 | 723 | // verify each registration |
724 | - if ( $registration instanceof EE_Registration ) { |
|
724 | + if ($registration instanceof EE_Registration) { |
|
725 | 725 | // we display all attendee info for the primary registrant |
726 | - if ( $this->checkout->reg_url_link == $registration->reg_url_link() && $registration->is_primary_registrant() ) { |
|
726 | + if ($this->checkout->reg_url_link == $registration->reg_url_link() && $registration->is_primary_registrant()) { |
|
727 | 727 | $this->checkout->primary_revisit = TRUE; |
728 | 728 | break; |
729 | - } else if ( $this->checkout->revisit && $this->checkout->reg_url_link != $registration->reg_url_link() ) { |
|
729 | + } else if ($this->checkout->revisit && $this->checkout->reg_url_link != $registration->reg_url_link()) { |
|
730 | 730 | // but hide info if it doesn't belong to you |
731 | - $transaction->clear_cache( 'Registration', $registration->ID() ); |
|
731 | + $transaction->clear_cache('Registration', $registration->ID()); |
|
732 | 732 | } |
733 | - $this->checkout->set_reg_status_updated( $registration->ID(), false ); |
|
733 | + $this->checkout->set_reg_status_updated($registration->ID(), false); |
|
734 | 734 | } |
735 | 735 | } |
736 | 736 | } |
@@ -744,37 +744,37 @@ discard block |
||
744 | 744 | * @param EE_Transaction $transaction |
745 | 745 | * @return array |
746 | 746 | */ |
747 | - private function _initialize_registrations( EE_Transaction $transaction ) { |
|
747 | + private function _initialize_registrations(EE_Transaction $transaction) { |
|
748 | 748 | $registrations = array(); |
749 | - if ( $transaction instanceof EE_Transaction ) { |
|
749 | + if ($transaction instanceof EE_Transaction) { |
|
750 | 750 | /** @type EE_Registration_Processor $registration_processor */ |
751 | - $registration_processor = EE_Registry::instance()->load_class( 'Registration_Processor' ); |
|
751 | + $registration_processor = EE_Registry::instance()->load_class('Registration_Processor'); |
|
752 | 752 | $att_nmbr = 0; |
753 | 753 | $this->checkout->total_ticket_count = $this->checkout->cart->all_ticket_quantity_count(); |
754 | 754 | // now let's add the cart items to the $transaction |
755 | - foreach ( $this->checkout->cart->get_tickets() as $item ) { |
|
755 | + foreach ($this->checkout->cart->get_tickets() as $item) { |
|
756 | 756 | // grab the related ticket object for this line_item |
757 | 757 | $ticket = $item->ticket(); |
758 | - if ( ! $ticket instanceof EE_Ticket ){ |
|
759 | - EE_Error::add_error(sprintf(__("Line item %s did not contain a valid ticket", "event_espresso"),$item->ID()), __FILE__, __FUNCTION__, __LINE__); |
|
758 | + if ( ! $ticket instanceof EE_Ticket) { |
|
759 | + EE_Error::add_error(sprintf(__("Line item %s did not contain a valid ticket", "event_espresso"), $item->ID()), __FILE__, __FUNCTION__, __LINE__); |
|
760 | 760 | break; |
761 | 761 | } |
762 | - $first_datetime = $ticket->get_first_related( 'Datetime' ); |
|
763 | - if ( ! $first_datetime instanceof EE_Datetime ){ |
|
764 | - EE_Error::add_error(sprintf(__("The ticket (%s) is not associated with any valid datetimes.", "event_espresso"),$ticket->name()), __FILE__, __FUNCTION__, __LINE__ ); |
|
762 | + $first_datetime = $ticket->get_first_related('Datetime'); |
|
763 | + if ( ! $first_datetime instanceof EE_Datetime) { |
|
764 | + EE_Error::add_error(sprintf(__("The ticket (%s) is not associated with any valid datetimes.", "event_espresso"), $ticket->name()), __FILE__, __FUNCTION__, __LINE__); |
|
765 | 765 | continue; |
766 | 766 | } |
767 | - $event = $first_datetime->get_first_related( 'Event' ); |
|
768 | - if ( ! $event instanceof EE_Event ){ |
|
769 | - EE_Error::add_error(sprintf(__("The ticket (%s) is not associated with a valid event.", "event_espresso"),$ticket->name()),__FILE__,__FUNCTION__,__LINE__); |
|
767 | + $event = $first_datetime->get_first_related('Event'); |
|
768 | + if ( ! $event instanceof EE_Event) { |
|
769 | + EE_Error::add_error(sprintf(__("The ticket (%s) is not associated with a valid event.", "event_espresso"), $ticket->name()), __FILE__, __FUNCTION__, __LINE__); |
|
770 | 770 | continue; |
771 | 771 | } |
772 | 772 | //do the following for each ticket of this type they selected |
773 | - for ( $x = 1; $x <= $item->quantity(); $x++ ) { |
|
773 | + for ($x = 1; $x <= $item->quantity(); $x++) { |
|
774 | 774 | $att_nmbr++; |
775 | - $reg_url_link = $registration_processor->generate_reg_url_link( $att_nmbr, $item ); |
|
775 | + $reg_url_link = $registration_processor->generate_reg_url_link($att_nmbr, $item); |
|
776 | 776 | // now create a new registration for the ticket |
777 | - $registration = EE_Registration::new_instance( array( |
|
777 | + $registration = EE_Registration::new_instance(array( |
|
778 | 778 | 'EVT_ID' => $event->ID(), |
779 | 779 | 'TXN_ID' => $transaction->ID(), |
780 | 780 | 'TKT_ID' => $ticket->ID(), |
@@ -786,12 +786,12 @@ discard block |
||
786 | 786 | 'REG_group_size' => $this->checkout->total_ticket_count, |
787 | 787 | 'REG_url_link' => $reg_url_link |
788 | 788 | )); |
789 | - $registration->set_reg_code( $registration_processor->generate_reg_code( $registration )); |
|
789 | + $registration->set_reg_code($registration_processor->generate_reg_code($registration)); |
|
790 | 790 | $registration->save(); |
791 | - $registration->_add_relation_to( $event, 'Event', array(), $event->ID() ); |
|
792 | - $registration->_add_relation_to( $item->ticket(), 'Ticket', array(), $item->ticket()->ID() ); |
|
793 | - $transaction->_add_relation_to( $registration, 'Registration' ); |
|
794 | - $registrations[ $registration->ID() ] = $registration; |
|
791 | + $registration->_add_relation_to($event, 'Event', array(), $event->ID()); |
|
792 | + $registration->_add_relation_to($item->ticket(), 'Ticket', array(), $item->ticket()->ID()); |
|
793 | + $transaction->_add_relation_to($registration, 'Registration'); |
|
794 | + $registrations[$registration->ID()] = $registration; |
|
795 | 795 | } |
796 | 796 | } |
797 | 797 | } |
@@ -808,12 +808,12 @@ discard block |
||
808 | 808 | * @param EE_Registration $reg_B |
809 | 809 | * @return array() |
810 | 810 | */ |
811 | - public static function sort_registrations_by_REG_count( EE_Registration $reg_A, EE_Registration $reg_B ) { |
|
811 | + public static function sort_registrations_by_REG_count(EE_Registration $reg_A, EE_Registration $reg_B) { |
|
812 | 812 | // this shouldn't ever happen within the same TXN, but oh well |
813 | - if ( $reg_A->count() == $reg_B->count() ) { |
|
813 | + if ($reg_A->count() == $reg_B->count()) { |
|
814 | 814 | return 0; |
815 | 815 | } |
816 | - return ( $reg_A->count() > $reg_B->count() ) ? 1 : -1; |
|
816 | + return ($reg_A->count() > $reg_B->count()) ? 1 : -1; |
|
817 | 817 | } |
818 | 818 | |
819 | 819 | |
@@ -827,30 +827,30 @@ discard block |
||
827 | 827 | * @return bool |
828 | 828 | */ |
829 | 829 | private function _final_verifications() { |
830 | - if ( ! $this->checkout->current_step instanceof EE_SPCO_Reg_Step ) { |
|
831 | - EE_Error::add_error( __( 'We\'re sorry but the registration process can not proceed because one or more registration steps were not setup correctly. Please refresh the page and try again or contact support.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ ); |
|
830 | + if ( ! $this->checkout->current_step instanceof EE_SPCO_Reg_Step) { |
|
831 | + EE_Error::add_error(__('We\'re sorry but the registration process can not proceed because one or more registration steps were not setup correctly. Please refresh the page and try again or contact support.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__); |
|
832 | 832 | return false; |
833 | 833 | } |
834 | - if ( ! empty( $this->checkout->reg_url_link )) { |
|
834 | + if ( ! empty($this->checkout->reg_url_link)) { |
|
835 | 835 | $valid_registrant = $this->checkout->transaction->primary_registration(); |
836 | - if ( ! $valid_registrant instanceof EE_Registration ) { |
|
837 | - EE_Error::add_error( __( 'We\'re sorry but there appears to be an error with the "reg_url_link" or the primary registrant for this transaction. Please refresh the page and try again or contact support.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ ); |
|
836 | + if ( ! $valid_registrant instanceof EE_Registration) { |
|
837 | + EE_Error::add_error(__('We\'re sorry but there appears to be an error with the "reg_url_link" or the primary registrant for this transaction. Please refresh the page and try again or contact support.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__); |
|
838 | 838 | return false; |
839 | 839 | } |
840 | 840 | $valid_registrant = null; |
841 | - foreach ( $this->checkout->transaction->registrations( $this->checkout->reg_cache_where_params ) as $registration ) { |
|
842 | - if ( $registration instanceof EE_Registration ) { |
|
843 | - if ( $registration->reg_url_link() == $this->checkout->reg_url_link ) { |
|
841 | + foreach ($this->checkout->transaction->registrations($this->checkout->reg_cache_where_params) as $registration) { |
|
842 | + if ($registration instanceof EE_Registration) { |
|
843 | + if ($registration->reg_url_link() == $this->checkout->reg_url_link) { |
|
844 | 844 | $valid_registrant = $registration; |
845 | 845 | } |
846 | 846 | } |
847 | 847 | } |
848 | - if ( ! $valid_registrant instanceof EE_Registration ) { |
|
849 | - EE_Error::add_error( __( 'We\'re sorry but there appears to be an error with the "reg_url_link" or the transaction itself. Please refresh the page and try again or contact support.', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ ); |
|
848 | + if ( ! $valid_registrant instanceof EE_Registration) { |
|
849 | + EE_Error::add_error(__('We\'re sorry but there appears to be an error with the "reg_url_link" or the transaction itself. Please refresh the page and try again or contact support.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__); |
|
850 | 850 | return false; |
851 | 851 | } |
852 | 852 | } |
853 | - $this->checkout = apply_filters( 'FHEE__EED_Single_Page_Checkout___final_verifications__checkout', $this->checkout ); |
|
853 | + $this->checkout = apply_filters('FHEE__EED_Single_Page_Checkout___final_verifications__checkout', $this->checkout); |
|
854 | 854 | return true; |
855 | 855 | } |
856 | 856 | |
@@ -867,7 +867,7 @@ discard block |
||
867 | 867 | */ |
868 | 868 | private function _initialize_reg_steps() { |
869 | 869 | /** @type EE_Transaction_Processor $transaction_processor */ |
870 | - $transaction_processor = EE_Registry::instance()->load_class( 'Transaction_Processor' ); |
|
870 | + $transaction_processor = EE_Registry::instance()->load_class('Transaction_Processor'); |
|
871 | 871 | // call set_reg_step_initiated ??? |
872 | 872 | if ( |
873 | 873 | // first time visiting SPCO ? |
@@ -876,24 +876,24 @@ discard block |
||
876 | 876 | && $this->checkout->action === 'display_spco_reg_step' |
877 | 877 | ) { |
878 | 878 | // set the start time for this reg step |
879 | - if ( ! $transaction_processor->set_reg_step_initiated( $this->checkout->transaction, $this->checkout->current_step->slug() ) ) { |
|
880 | - if ( WP_DEBUG ) { |
|
881 | - EE_Error::add_error( sprintf(__( 'The "%1$s" registration step was not initialized properly.', 'event_espresso' ), $this->checkout->current_step->name() ), __FILE__, __FUNCTION__, __LINE__ ); |
|
879 | + if ( ! $transaction_processor->set_reg_step_initiated($this->checkout->transaction, $this->checkout->current_step->slug())) { |
|
880 | + if (WP_DEBUG) { |
|
881 | + EE_Error::add_error(sprintf(__('The "%1$s" registration step was not initialized properly.', 'event_espresso'), $this->checkout->current_step->name()), __FILE__, __FUNCTION__, __LINE__); |
|
882 | 882 | } |
883 | 883 | }; |
884 | 884 | } |
885 | 885 | // loop thru all steps to call their individual "initialize" methods and set i18n strings for JS |
886 | - foreach ( $this->checkout->reg_steps as $reg_step ) { |
|
886 | + foreach ($this->checkout->reg_steps as $reg_step) { |
|
887 | 887 | $reg_step->initialize_reg_step(); |
888 | 888 | // i18n |
889 | 889 | $reg_step->translate_js_strings(); |
890 | - if ( $reg_step->is_current_step() ) { |
|
890 | + if ($reg_step->is_current_step()) { |
|
891 | 891 | // the text that appears on the reg step form submit button |
892 | 892 | $reg_step->set_submit_button_text(); |
893 | 893 | } |
894 | 894 | } |
895 | 895 | // dynamically creates hook point like: AHEE__Single_Page_Checkout___initialize_reg_step__attendee_information |
896 | - do_action( "AHEE__Single_Page_Checkout___initialize_reg_step__{$this->checkout->current_step->slug()}", $this->checkout->current_step ); |
|
896 | + do_action("AHEE__Single_Page_Checkout___initialize_reg_step__{$this->checkout->current_step->slug()}", $this->checkout->current_step); |
|
897 | 897 | } |
898 | 898 | |
899 | 899 | |
@@ -906,38 +906,38 @@ discard block |
||
906 | 906 | */ |
907 | 907 | private function _check_form_submission() { |
908 | 908 | //does this request require the reg form to be generated ? |
909 | - if ( $this->checkout->generate_reg_form ) { |
|
909 | + if ($this->checkout->generate_reg_form) { |
|
910 | 910 | // ever heard that song by Blue Rodeo ? |
911 | 911 | try { |
912 | 912 | $this->checkout->current_step->reg_form = $this->checkout->current_step->generate_reg_form(); |
913 | 913 | // if not displaying a form, then check for form submission |
914 | - if ( $this->checkout->process_form_submission && $this->checkout->current_step->reg_form->was_submitted() ) { |
|
914 | + if ($this->checkout->process_form_submission && $this->checkout->current_step->reg_form->was_submitted()) { |
|
915 | 915 | // clear out any old data in case this step is being run again |
916 | - $this->checkout->current_step->set_valid_data( array() ); |
|
916 | + $this->checkout->current_step->set_valid_data(array()); |
|
917 | 917 | // capture submitted form data |
918 | 918 | $this->checkout->current_step->reg_form->receive_form_submission( |
919 | - apply_filters( 'FHEE__Single_Page_Checkout___check_form_submission__request_params', EE_Registry::instance()->REQ->params(), $this->checkout ) |
|
919 | + apply_filters('FHEE__Single_Page_Checkout___check_form_submission__request_params', EE_Registry::instance()->REQ->params(), $this->checkout) |
|
920 | 920 | ); |
921 | 921 | // validate submitted form data |
922 | - if ( ! $this->checkout->current_step->reg_form->is_valid() || ! $this->checkout->continue_reg ) { |
|
922 | + if ( ! $this->checkout->current_step->reg_form->is_valid() || ! $this->checkout->continue_reg) { |
|
923 | 923 | // thou shall not pass !!! |
924 | 924 | $this->checkout->continue_reg = FALSE; |
925 | 925 | // any form validation errors? |
926 | - if ( $this->checkout->current_step->reg_form->submission_error_message() != '' ) { |
|
926 | + if ($this->checkout->current_step->reg_form->submission_error_message() != '') { |
|
927 | 927 | $submission_error_messages = array(); |
928 | 928 | // bad, bad, bad registrant |
929 | - foreach( $this->checkout->current_step->reg_form->get_validation_errors_accumulated() as $validation_error ){ |
|
930 | - if ( $validation_error instanceof EE_Validation_Error ) { |
|
931 | - $submission_error_messages[] = sprintf( __( '%s : %s', 'event_espresso' ), $validation_error->get_form_section()->html_label_text(), $validation_error->getMessage() ); |
|
929 | + foreach ($this->checkout->current_step->reg_form->get_validation_errors_accumulated() as $validation_error) { |
|
930 | + if ($validation_error instanceof EE_Validation_Error) { |
|
931 | + $submission_error_messages[] = sprintf(__('%s : %s', 'event_espresso'), $validation_error->get_form_section()->html_label_text(), $validation_error->getMessage()); |
|
932 | 932 | } |
933 | 933 | } |
934 | - EE_Error::add_error( join( '<br />', $submission_error_messages ), __FILE__, __FUNCTION__, __LINE__ ); |
|
934 | + EE_Error::add_error(join('<br />', $submission_error_messages), __FILE__, __FUNCTION__, __LINE__); |
|
935 | 935 | } |
936 | 936 | // well not really... what will happen is we'll just get redirected back to redo the current step |
937 | 937 | $this->go_to_next_step(); |
938 | 938 | } |
939 | 939 | } |
940 | - } catch( EE_Error $e ) { |
|
940 | + } catch (EE_Error $e) { |
|
941 | 941 | $e->get_error(); |
942 | 942 | } |
943 | 943 | } |
@@ -953,38 +953,38 @@ discard block |
||
953 | 953 | */ |
954 | 954 | private function _process_form_action() { |
955 | 955 | // what cha wanna do? |
956 | - switch( $this->checkout->action ) { |
|
956 | + switch ($this->checkout->action) { |
|
957 | 957 | // AJAX next step reg form |
958 | 958 | case 'display_spco_reg_step' : |
959 | 959 | $this->checkout->redirect = FALSE; |
960 | - if ( EE_Registry::instance()->REQ->ajax ) { |
|
961 | - $this->checkout->json_response->set_reg_step_html( $this->checkout->current_step->display_reg_form() ); |
|
960 | + if (EE_Registry::instance()->REQ->ajax) { |
|
961 | + $this->checkout->json_response->set_reg_step_html($this->checkout->current_step->display_reg_form()); |
|
962 | 962 | } |
963 | 963 | break; |
964 | 964 | |
965 | 965 | default : |
966 | 966 | // meh... do one of those other steps first |
967 | - if ( ! empty( $this->checkout->action ) && is_callable( array( $this->checkout->current_step, $this->checkout->action ))) { |
|
967 | + if ( ! empty($this->checkout->action) && is_callable(array($this->checkout->current_step, $this->checkout->action))) { |
|
968 | 968 | // dynamically creates hook point like: AHEE__Single_Page_Checkout__before_attendee_information__process_reg_step |
969 | - do_action( "AHEE__Single_Page_Checkout__before_{$this->checkout->current_step->slug()}__{$this->checkout->action}", $this->checkout->current_step ); |
|
969 | + do_action("AHEE__Single_Page_Checkout__before_{$this->checkout->current_step->slug()}__{$this->checkout->action}", $this->checkout->current_step); |
|
970 | 970 | // call action on current step |
971 | - if ( call_user_func( array( $this->checkout->current_step, $this->checkout->action )) ) { |
|
971 | + if (call_user_func(array($this->checkout->current_step, $this->checkout->action))) { |
|
972 | 972 | // good registrant, you get to proceed |
973 | - if ( $this->checkout->current_step->success_message() != '' ) { |
|
974 | - if ( apply_filters( 'FHEE__Single_Page_Checkout___process_form_action__display_success', false ) ) { |
|
975 | - EE_Error::add_success( $this->checkout->current_step->success_message() . '<br />' . $this->checkout->next_step->_instructions() ); |
|
973 | + if ($this->checkout->current_step->success_message() != '') { |
|
974 | + if (apply_filters('FHEE__Single_Page_Checkout___process_form_action__display_success', false)) { |
|
975 | + EE_Error::add_success($this->checkout->current_step->success_message().'<br />'.$this->checkout->next_step->_instructions()); |
|
976 | 976 | } |
977 | 977 | } |
978 | 978 | // pack it up, pack it in... |
979 | 979 | $this->_setup_redirect(); |
980 | 980 | } |
981 | 981 | // dynamically creates hook point like: AHEE__Single_Page_Checkout__after_payment_options__process_reg_step |
982 | - do_action( "AHEE__Single_Page_Checkout__after_{$this->checkout->current_step->slug()}__{$this->checkout->action}", $this->checkout->current_step ); |
|
982 | + do_action("AHEE__Single_Page_Checkout__after_{$this->checkout->current_step->slug()}__{$this->checkout->action}", $this->checkout->current_step); |
|
983 | 983 | |
984 | 984 | } else { |
985 | 985 | EE_Error::add_error( |
986 | 986 | sprintf( |
987 | - __( 'The requested form action "%s" does not exist for the current "%s" registration step.', 'event_espresso' ), |
|
987 | + __('The requested form action "%s" does not exist for the current "%s" registration step.', 'event_espresso'), |
|
988 | 988 | $this->checkout->action, |
989 | 989 | $this->checkout->current_step->name() |
990 | 990 | ), |
@@ -1008,10 +1008,10 @@ discard block |
||
1008 | 1008 | * @return void |
1009 | 1009 | */ |
1010 | 1010 | public function add_styles_and_scripts() { |
1011 | - if ( $this->checkout->admin_request ) { |
|
1012 | - add_action('admin_enqueue_scripts', array($this, 'enqueue_styles_and_scripts'), 10 ); |
|
1011 | + if ($this->checkout->admin_request) { |
|
1012 | + add_action('admin_enqueue_scripts', array($this, 'enqueue_styles_and_scripts'), 10); |
|
1013 | 1013 | } else { |
1014 | - add_action( 'wp_enqueue_scripts', array( $this, 'enqueue_styles_and_scripts' ), 10 ); |
|
1014 | + add_action('wp_enqueue_scripts', array($this, 'enqueue_styles_and_scripts'), 10); |
|
1015 | 1015 | } |
1016 | 1016 | } |
1017 | 1017 | |
@@ -1027,45 +1027,45 @@ discard block |
||
1027 | 1027 | EE_Registry::$i18n_js_strings['revisit'] = $this->checkout->revisit; |
1028 | 1028 | EE_Registry::$i18n_js_strings['e_reg_url_link'] = $this->checkout->reg_url_link; |
1029 | 1029 | EE_Registry::$i18n_js_strings['server_error'] = __('An unknown error occurred on the server while attempting to process your request. Please refresh the page and try again or contact support.', 'event_espresso'); |
1030 | - EE_Registry::$i18n_js_strings['invalid_json_response'] = __( 'An invalid response was returned from the server while attempting to process your request. Please refresh the page and try again or contact support.', 'event_espresso' ); |
|
1031 | - EE_Registry::$i18n_js_strings['validation_error'] = __( 'There appears to be a problem with the form validation configuration! Please check the admin settings or contact support.', 'event_espresso' ); |
|
1032 | - EE_Registry::$i18n_js_strings['invalid_payment_method'] = __( 'There appears to be a problem with the payment method configuration! Please refresh the page and try again or contact support.', 'event_espresso' ); |
|
1030 | + EE_Registry::$i18n_js_strings['invalid_json_response'] = __('An invalid response was returned from the server while attempting to process your request. Please refresh the page and try again or contact support.', 'event_espresso'); |
|
1031 | + EE_Registry::$i18n_js_strings['validation_error'] = __('There appears to be a problem with the form validation configuration! Please check the admin settings or contact support.', 'event_espresso'); |
|
1032 | + EE_Registry::$i18n_js_strings['invalid_payment_method'] = __('There appears to be a problem with the payment method configuration! Please refresh the page and try again or contact support.', 'event_espresso'); |
|
1033 | 1033 | EE_Registry::$i18n_js_strings['reg_step_error'] = __('This registration step could not be completed. Please refresh the page and try again.', 'event_espresso'); |
1034 | 1034 | EE_Registry::$i18n_js_strings['invalid_coupon'] = __('We\'re sorry but that coupon code does not appear to be valid. If this is incorrect, please contact the site administrator.', 'event_espresso'); |
1035 | - EE_Registry::$i18n_js_strings['process_registration'] = sprintf( __( 'Please wait while we process your registration.%sDo not refresh the page or navigate away while this is happening.%sThank you for your patience.', 'event_espresso' ), '<br/>', '<br/>' ); |
|
1036 | - EE_Registry::$i18n_js_strings['language'] = get_bloginfo( 'language' ); |
|
1035 | + EE_Registry::$i18n_js_strings['process_registration'] = sprintf(__('Please wait while we process your registration.%sDo not refresh the page or navigate away while this is happening.%sThank you for your patience.', 'event_espresso'), '<br/>', '<br/>'); |
|
1036 | + EE_Registry::$i18n_js_strings['language'] = get_bloginfo('language'); |
|
1037 | 1037 | EE_Registry::$i18n_js_strings['EESID'] = EE_Registry::instance()->SSN->id(); |
1038 | 1038 | EE_Registry::$i18n_js_strings['datepicker_yearRange'] = '-150:+20'; |
1039 | - EE_Registry::$i18n_js_strings['timer_years'] = __( 'years', 'event_espresso' ); |
|
1040 | - EE_Registry::$i18n_js_strings['timer_months'] = __( 'months', 'event_espresso' ); |
|
1041 | - EE_Registry::$i18n_js_strings['timer_weeks'] = __( 'weeks', 'event_espresso' ); |
|
1042 | - EE_Registry::$i18n_js_strings['timer_days'] = __( 'days', 'event_espresso' ); |
|
1043 | - EE_Registry::$i18n_js_strings['timer_hours'] = __( 'hours', 'event_espresso' ); |
|
1044 | - EE_Registry::$i18n_js_strings['timer_minutes'] = __( 'minutes', 'event_espresso' ); |
|
1045 | - EE_Registry::$i18n_js_strings['timer_seconds'] = __( 'seconds', 'event_espresso' ); |
|
1046 | - EE_Registry::$i18n_js_strings['timer_year'] = __( 'year', 'event_espresso' ); |
|
1047 | - EE_Registry::$i18n_js_strings['timer_month'] = __( 'month', 'event_espresso' ); |
|
1048 | - EE_Registry::$i18n_js_strings['timer_week'] = __( 'week', 'event_espresso' ); |
|
1049 | - EE_Registry::$i18n_js_strings['timer_day'] = __( 'day', 'event_espresso' ); |
|
1050 | - EE_Registry::$i18n_js_strings['timer_hour'] = __( 'hour', 'event_espresso' ); |
|
1051 | - EE_Registry::$i18n_js_strings['timer_minute'] = __( 'minute', 'event_espresso' ); |
|
1052 | - EE_Registry::$i18n_js_strings['timer_second'] = __( 'second', 'event_espresso' ); |
|
1039 | + EE_Registry::$i18n_js_strings['timer_years'] = __('years', 'event_espresso'); |
|
1040 | + EE_Registry::$i18n_js_strings['timer_months'] = __('months', 'event_espresso'); |
|
1041 | + EE_Registry::$i18n_js_strings['timer_weeks'] = __('weeks', 'event_espresso'); |
|
1042 | + EE_Registry::$i18n_js_strings['timer_days'] = __('days', 'event_espresso'); |
|
1043 | + EE_Registry::$i18n_js_strings['timer_hours'] = __('hours', 'event_espresso'); |
|
1044 | + EE_Registry::$i18n_js_strings['timer_minutes'] = __('minutes', 'event_espresso'); |
|
1045 | + EE_Registry::$i18n_js_strings['timer_seconds'] = __('seconds', 'event_espresso'); |
|
1046 | + EE_Registry::$i18n_js_strings['timer_year'] = __('year', 'event_espresso'); |
|
1047 | + EE_Registry::$i18n_js_strings['timer_month'] = __('month', 'event_espresso'); |
|
1048 | + EE_Registry::$i18n_js_strings['timer_week'] = __('week', 'event_espresso'); |
|
1049 | + EE_Registry::$i18n_js_strings['timer_day'] = __('day', 'event_espresso'); |
|
1050 | + EE_Registry::$i18n_js_strings['timer_hour'] = __('hour', 'event_espresso'); |
|
1051 | + EE_Registry::$i18n_js_strings['timer_minute'] = __('minute', 'event_espresso'); |
|
1052 | + EE_Registry::$i18n_js_strings['timer_second'] = __('second', 'event_espresso'); |
|
1053 | 1053 | EE_Registry::$i18n_js_strings['registration_expiration_notice'] = sprintf( |
1054 | - __( '%1$sWe\'re sorry, but you\'re registration time has expired |
|
1054 | + __('%1$sWe\'re sorry, but you\'re registration time has expired |
|
1055 | 1055 | .%2$s%3$s%4$sIf you still wish to complete your registration, please |
1056 | 1056 | return to the %5$sEvent List%6$sEvent List%7$s and reselect your |
1057 | 1057 | tickets if available. Please except our apologies for any inconvenience this |
1058 | - may have caused.%8$s', 'event_espresso' ), |
|
1058 | + may have caused.%8$s', 'event_espresso'), |
|
1059 | 1059 | '<h4 class="important-notice">', |
1060 | 1060 | '</h4>', |
1061 | 1061 | '<br />', |
1062 | 1062 | '<p>', |
1063 | - '<a href="'. get_post_type_archive_link( 'espresso_events' ) . '" title="', |
|
1063 | + '<a href="'.get_post_type_archive_link('espresso_events').'" title="', |
|
1064 | 1064 | '">', |
1065 | 1065 | '</a>', |
1066 | 1066 | '</p>' |
1067 | 1067 | ); |
1068 | - EE_Registry::$i18n_js_strings[ 'ajax_submit' ] = apply_filters( 'FHEE__Single_Page_Checkout__translate_js_strings__ajax_submit', true ); |
|
1068 | + EE_Registry::$i18n_js_strings['ajax_submit'] = apply_filters('FHEE__Single_Page_Checkout__translate_js_strings__ajax_submit', true); |
|
1069 | 1069 | } |
1070 | 1070 | |
1071 | 1071 | |
@@ -1078,28 +1078,28 @@ discard block |
||
1078 | 1078 | */ |
1079 | 1079 | public function enqueue_styles_and_scripts() { |
1080 | 1080 | // load css |
1081 | - wp_register_style( 'single_page_checkout', SPCO_CSS_URL . 'single_page_checkout.css', array(), EVENT_ESPRESSO_VERSION ); |
|
1082 | - wp_enqueue_style( 'single_page_checkout' ); |
|
1081 | + wp_register_style('single_page_checkout', SPCO_CSS_URL.'single_page_checkout.css', array(), EVENT_ESPRESSO_VERSION); |
|
1082 | + wp_enqueue_style('single_page_checkout'); |
|
1083 | 1083 | // i18n |
1084 | 1084 | $this->translate_js_strings(); |
1085 | 1085 | // load JS |
1086 | - wp_register_script( 'jquery_plugin', EE_THIRD_PARTY_URL . 'jquery .plugin.min.js', array( 'jquery' ), '1.0.1', TRUE ); |
|
1087 | - wp_register_script( 'jquery_countdown', EE_THIRD_PARTY_URL . 'jquery .countdown.min.js', array( 'jquery_plugin' ), '2.0.2', TRUE ); |
|
1088 | - wp_register_script( 'single_page_checkout', SPCO_JS_URL . 'single_page_checkout.js', array( 'espresso_core', 'underscore', 'ee_form_section_validation', 'jquery_countdown' ), EVENT_ESPRESSO_VERSION, TRUE ); |
|
1089 | - wp_enqueue_script( 'single_page_checkout' ); |
|
1090 | - wp_localize_script( 'single_page_checkout', 'eei18n', EE_Registry::$i18n_js_strings ); |
|
1086 | + wp_register_script('jquery_plugin', EE_THIRD_PARTY_URL.'jquery .plugin.min.js', array('jquery'), '1.0.1', TRUE); |
|
1087 | + wp_register_script('jquery_countdown', EE_THIRD_PARTY_URL.'jquery .countdown.min.js', array('jquery_plugin'), '2.0.2', TRUE); |
|
1088 | + wp_register_script('single_page_checkout', SPCO_JS_URL.'single_page_checkout.js', array('espresso_core', 'underscore', 'ee_form_section_validation', 'jquery_countdown'), EVENT_ESPRESSO_VERSION, TRUE); |
|
1089 | + wp_enqueue_script('single_page_checkout'); |
|
1090 | + wp_localize_script('single_page_checkout', 'eei18n', EE_Registry::$i18n_js_strings); |
|
1091 | 1091 | |
1092 | 1092 | /** |
1093 | 1093 | * global action hook for enqueueing styles and scripts with |
1094 | 1094 | * spco calls. |
1095 | 1095 | */ |
1096 | - do_action( 'AHEE__EED_Single_Page_Checkout__enqueue_styles_and_scripts', $this ); |
|
1096 | + do_action('AHEE__EED_Single_Page_Checkout__enqueue_styles_and_scripts', $this); |
|
1097 | 1097 | |
1098 | 1098 | /** |
1099 | 1099 | * dynamic action hook for enqueueing styles and scripts with spco calls. |
1100 | 1100 | * The hook will end up being something like AHEE__EED_Single_Page_Checkout__enqueue_styles_and_scripts__attendee_information |
1101 | 1101 | */ |
1102 | - do_action( 'AHEE__EED_Single_Page_Checkout__enqueue_styles_and_scripts__' . $this->checkout->current_step->slug(), $this ); |
|
1102 | + do_action('AHEE__EED_Single_Page_Checkout__enqueue_styles_and_scripts__'.$this->checkout->current_step->slug(), $this); |
|
1103 | 1103 | |
1104 | 1104 | // add css and JS for current step |
1105 | 1105 | $this->checkout->current_step->enqueue_styles_and_scripts(); |
@@ -1115,11 +1115,11 @@ discard block |
||
1115 | 1115 | */ |
1116 | 1116 | private function _display_spco_reg_form() { |
1117 | 1117 | // if registering via the admin, just display the reg form for the current step |
1118 | - if ( $this->checkout->admin_request ) { |
|
1119 | - EE_Registry::instance()->REQ->add_output( $this->checkout->current_step->display_reg_form() ); |
|
1118 | + if ($this->checkout->admin_request) { |
|
1119 | + EE_Registry::instance()->REQ->add_output($this->checkout->current_step->display_reg_form()); |
|
1120 | 1120 | } else { |
1121 | 1121 | // add powered by EE msg |
1122 | - add_action( 'AHEE__SPCO__reg_form_footer', array( 'EED_Single_Page_Checkout', 'display_registration_footer' )); |
|
1122 | + add_action('AHEE__SPCO__reg_form_footer', array('EED_Single_Page_Checkout', 'display_registration_footer')); |
|
1123 | 1123 | $this->checkout->registration_form = new EE_Form_Section_Proper( |
1124 | 1124 | array( |
1125 | 1125 | 'name' => 'single-page-checkout', |
@@ -1127,17 +1127,17 @@ discard block |
||
1127 | 1127 | 'layout_strategy' => |
1128 | 1128 | new EE_Template_Layout( |
1129 | 1129 | array( |
1130 | - 'layout_template_file' => SPCO_TEMPLATES_PATH . 'registration_page_wrapper.template.php', |
|
1130 | + 'layout_template_file' => SPCO_TEMPLATES_PATH.'registration_page_wrapper.template.php', |
|
1131 | 1131 | 'template_args' => array( |
1132 | - 'empty_cart' => count( $this->checkout->transaction->registrations( $this->checkout->reg_cache_where_params )) < 1 ? TRUE : FALSE, |
|
1132 | + 'empty_cart' => count($this->checkout->transaction->registrations($this->checkout->reg_cache_where_params)) < 1 ? TRUE : FALSE, |
|
1133 | 1133 | 'revisit' => $this->checkout->revisit, |
1134 | 1134 | 'reg_steps' => $this->checkout->reg_steps, |
1135 | 1135 | 'next_step' => $this->checkout->next_step instanceof EE_SPCO_Reg_Step ? $this->checkout->next_step->slug() : '', |
1136 | 1136 | 'empty_msg' => apply_filters( |
1137 | 1137 | 'FHEE__Single_Page_Checkout__display_spco_reg_form__empty_msg', |
1138 | 1138 | sprintf( |
1139 | - __( 'You need to %1$sReturn to Events list%2$sselect at least one event%3$s before you can proceed with the registration process.', 'event_espresso' ), |
|
1140 | - '<a href="'. get_post_type_archive_link( 'espresso_events' ) . '" title="', |
|
1139 | + __('You need to %1$sReturn to Events list%2$sselect at least one event%3$s before you can proceed with the registration process.', 'event_espresso'), |
|
1140 | + '<a href="'.get_post_type_archive_link('espresso_events').'" title="', |
|
1141 | 1141 | '">', |
1142 | 1142 | '</a>' |
1143 | 1143 | ) |
@@ -1145,16 +1145,16 @@ discard block |
||
1145 | 1145 | 'registration_time_limit' => |
1146 | 1146 | $this->checkout->get_registration_time_limit(), |
1147 | 1147 | 'session_expiration' => |
1148 | - gmdate( 'M d, Y H:i:s', |
|
1148 | + gmdate('M d, Y H:i:s', |
|
1149 | 1149 | EE_Registry::instance() |
1150 | - ->SSN->expiration() + ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS ) ) |
|
1150 | + ->SSN->expiration() + (get_option('gmt_offset') * HOUR_IN_SECONDS)) |
|
1151 | 1151 | ) |
1152 | 1152 | ) |
1153 | 1153 | ) |
1154 | 1154 | ) |
1155 | 1155 | ); |
1156 | 1156 | // load template and add to output sent that gets filtered into the_content() |
1157 | - EE_Registry::instance()->REQ->add_output( $this->checkout->registration_form->get_html_and_js() ); |
|
1157 | + EE_Registry::instance()->REQ->add_output($this->checkout->registration_form->get_html_and_js()); |
|
1158 | 1158 | } |
1159 | 1159 | } |
1160 | 1160 | |
@@ -1168,8 +1168,8 @@ discard block |
||
1168 | 1168 | * @internal param string $label |
1169 | 1169 | * @return string |
1170 | 1170 | */ |
1171 | - public function add_extra_finalize_registration_inputs( $next_step ) { |
|
1172 | - if ( $next_step == 'finalize_registration' ) { |
|
1171 | + public function add_extra_finalize_registration_inputs($next_step) { |
|
1172 | + if ($next_step == 'finalize_registration') { |
|
1173 | 1173 | echo '<div id="spco-extra-finalize_registration-inputs-dv"></div>'; |
1174 | 1174 | } |
1175 | 1175 | } |
@@ -1183,18 +1183,18 @@ discard block |
||
1183 | 1183 | * @return string |
1184 | 1184 | */ |
1185 | 1185 | public static function display_registration_footer() { |
1186 | - if ( apply_filters( 'FHEE__EE_Front__Controller__show_reg_footer', EE_Registry::instance()->CFG->admin->show_reg_footer ) ) { |
|
1187 | - EE_Registry::instance()->CFG->admin->affiliate_id = ! empty( EE_Registry::instance()->CFG->admin->affiliate_id ) ? EE_Registry::instance()->CFG->admin->affiliate_id : 'default'; |
|
1188 | - $url = add_query_arg( array( 'ap_id' => EE_Registry::instance()->CFG->admin->affiliate_id ), 'http://eventespresso.com/' ); |
|
1189 | - $url = apply_filters( 'FHEE__EE_Front_Controller__registration_footer__url', $url ); |
|
1186 | + if (apply_filters('FHEE__EE_Front__Controller__show_reg_footer', EE_Registry::instance()->CFG->admin->show_reg_footer)) { |
|
1187 | + EE_Registry::instance()->CFG->admin->affiliate_id = ! empty(EE_Registry::instance()->CFG->admin->affiliate_id) ? EE_Registry::instance()->CFG->admin->affiliate_id : 'default'; |
|
1188 | + $url = add_query_arg(array('ap_id' => EE_Registry::instance()->CFG->admin->affiliate_id), 'http://eventespresso.com/'); |
|
1189 | + $url = apply_filters('FHEE__EE_Front_Controller__registration_footer__url', $url); |
|
1190 | 1190 | echo apply_filters( |
1191 | 1191 | 'FHEE__EE_Front_Controller__display_registration_footer', |
1192 | 1192 | sprintf( |
1193 | - __( '%1$sEvent Registration Powered by Event Espresso%2$sEvent Registration and Ticketing%3$s Powered by %4$sEvent Espresso - Event Registration and Management System for WordPress%5$sEvent Espresso%6$s', 'event_espresso' ), |
|
1194 | - '<div id="espresso-registration-footer-dv"><a href="' . $url . '" title="', |
|
1193 | + __('%1$sEvent Registration Powered by Event Espresso%2$sEvent Registration and Ticketing%3$s Powered by %4$sEvent Espresso - Event Registration and Management System for WordPress%5$sEvent Espresso%6$s', 'event_espresso'), |
|
1194 | + '<div id="espresso-registration-footer-dv"><a href="'.$url.'" title="', |
|
1195 | 1195 | '" target="_blank">', |
1196 | 1196 | '</a>', |
1197 | - '<a href="' . $url . '" title="', |
|
1197 | + '<a href="'.$url.'" title="', |
|
1198 | 1198 | '" target="_blank">', |
1199 | 1199 | '</a></div>' |
1200 | 1200 | ) |
@@ -1225,12 +1225,12 @@ discard block |
||
1225 | 1225 | * @return array |
1226 | 1226 | */ |
1227 | 1227 | private function _setup_redirect() { |
1228 | - if ( $this->checkout->continue_reg && $this->checkout->next_step instanceof EE_SPCO_Reg_Step ) { |
|
1228 | + if ($this->checkout->continue_reg && $this->checkout->next_step instanceof EE_SPCO_Reg_Step) { |
|
1229 | 1229 | $this->checkout->redirect = TRUE; |
1230 | - if ( empty( $this->checkout->redirect_url )) { |
|
1230 | + if (empty($this->checkout->redirect_url)) { |
|
1231 | 1231 | $this->checkout->redirect_url = $this->checkout->next_step->reg_step_url(); |
1232 | 1232 | } |
1233 | - $this->checkout->redirect_url = apply_filters( 'FHEE__EED_Single_Page_Checkout___setup_redirect__checkout_redirect_url', $this->checkout->redirect_url, $this->checkout ); |
|
1233 | + $this->checkout->redirect_url = apply_filters('FHEE__EED_Single_Page_Checkout___setup_redirect__checkout_redirect_url', $this->checkout->redirect_url, $this->checkout); |
|
1234 | 1234 | } |
1235 | 1235 | } |
1236 | 1236 | |
@@ -1243,7 +1243,7 @@ discard block |
||
1243 | 1243 | * @return void |
1244 | 1244 | */ |
1245 | 1245 | public function go_to_next_step() { |
1246 | - if ( $this->checkout->admin_request || $this->checkout->action == 'redirect_form' ) { |
|
1246 | + if ($this->checkout->admin_request || $this->checkout->action == 'redirect_form') { |
|
1247 | 1247 | return; |
1248 | 1248 | } |
1249 | 1249 | // AJAX response |
@@ -1264,7 +1264,7 @@ discard block |
||
1264 | 1264 | */ |
1265 | 1265 | protected function _handle_json_response() { |
1266 | 1266 | // if this is an ajax request |
1267 | - if ( EE_Registry::instance()->REQ->ajax ) { |
|
1267 | + if (EE_Registry::instance()->REQ->ajax) { |
|
1268 | 1268 | // DEBUG LOG |
1269 | 1269 | //$this->checkout->log( |
1270 | 1270 | // __CLASS__, __FUNCTION__, __LINE__, |
@@ -1274,9 +1274,9 @@ discard block |
||
1274 | 1274 | // 'continue_reg' => $this->checkout->continue_reg, |
1275 | 1275 | // ) |
1276 | 1276 | //); |
1277 | - $this->checkout->json_response->set_registration_time_limit( $this->checkout->get_registration_time_limit() ); |
|
1277 | + $this->checkout->json_response->set_registration_time_limit($this->checkout->get_registration_time_limit()); |
|
1278 | 1278 | // just send the ajax ( |
1279 | - $json_response = apply_filters( 'FHEE__EE_Single_Page_Checkout__JSON_response', $this->checkout->json_response ); |
|
1279 | + $json_response = apply_filters('FHEE__EE_Single_Page_Checkout__JSON_response', $this->checkout->json_response); |
|
1280 | 1280 | $this->unlock_transaction(); |
1281 | 1281 | echo $json_response; |
1282 | 1282 | exit(); |
@@ -1293,9 +1293,9 @@ discard block |
||
1293 | 1293 | */ |
1294 | 1294 | protected function _handle_html_redirects() { |
1295 | 1295 | // going somewhere ? |
1296 | - if ( $this->checkout->redirect && ! empty( $this->checkout->redirect_url ) ) { |
|
1296 | + if ($this->checkout->redirect && ! empty($this->checkout->redirect_url)) { |
|
1297 | 1297 | // store notices in a transient |
1298 | - EE_Error::get_notices( false, true, true ); |
|
1298 | + EE_Error::get_notices(false, true, true); |
|
1299 | 1299 | $this->unlock_transaction(); |
1300 | 1300 | // DEBUG LOG |
1301 | 1301 | //$this->checkout->log( |
@@ -1306,7 +1306,7 @@ discard block |
||
1306 | 1306 | // 'headers_list' => headers_list(), |
1307 | 1307 | // ) |
1308 | 1308 | //); |
1309 | - wp_safe_redirect( $this->checkout->redirect_url ); |
|
1309 | + wp_safe_redirect($this->checkout->redirect_url); |
|
1310 | 1310 | exit(); |
1311 | 1311 | } |
1312 | 1312 | } |
@@ -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 | /** |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | * |
26 | 26 | * ------------------------------------------------------------------------ |
27 | 27 | */ |
28 | -class EE_PMT_Bank extends EE_PMT_Base{ |
|
28 | +class EE_PMT_Bank extends EE_PMT_Base { |
|
29 | 29 | |
30 | 30 | |
31 | 31 | |
@@ -38,7 +38,7 @@ discard block |
||
38 | 38 | $this->_pretty_name = __("Bank", 'event_espresso'); |
39 | 39 | parent::__construct($pm_instance); |
40 | 40 | $this->_default_button_url = $this->file_url().'lib'.DS.'bank-logo.png'; |
41 | - $this->_default_description = __( 'Make payment using an electronic funds transfer from your bank.', 'event_espresso' ); |
|
41 | + $this->_default_description = __('Make payment using an electronic funds transfer from your bank.', 'event_espresso'); |
|
42 | 42 | } |
43 | 43 | |
44 | 44 | |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | * @param \EE_Transaction $transaction |
49 | 49 | * @return NULL |
50 | 50 | */ |
51 | - public function generate_new_billing_form( EE_Transaction $transaction = NULL ) { |
|
51 | + public function generate_new_billing_form(EE_Transaction $transaction = NULL) { |
|
52 | 52 | return NULL; |
53 | 53 | } |
54 | 54 | |
@@ -62,12 +62,12 @@ discard block |
||
62 | 62 | return new EE_Payment_Method_Form(array( |
63 | 63 | 'extra_meta_inputs'=>array( |
64 | 64 | 'page_title'=>new EE_Text_Input(array( |
65 | - 'html_label_text'=> sprintf(__("Title %s", "event_espresso"), $this->get_help_tab_link()), |
|
65 | + 'html_label_text'=> sprintf(__("Title %s", "event_espresso"), $this->get_help_tab_link()), |
|
66 | 66 | 'default'=> __("Electronic Funds Transfers", 'event_espresso') |
67 | 67 | )), |
68 | 68 | 'payment_instructions'=>new EE_Text_Area_Input(array( |
69 | - 'html_label_text'=> sprintf(__("Payment Instructions %s", "event_espresso"), $this->get_help_tab_link()), |
|
70 | - 'html_help_text' => __( 'Provide instructions on how registrants can send the bank draft payment. Eg, mention your account name, bank account number, bank name, bank routing code, and bank address, etc.', 'event_espresso' ), |
|
69 | + 'html_label_text'=> sprintf(__("Payment Instructions %s", "event_espresso"), $this->get_help_tab_link()), |
|
70 | + 'html_help_text' => __('Provide instructions on how registrants can send the bank draft payment. Eg, mention your account name, bank account number, bank name, bank routing code, and bank address, etc.', 'event_espresso'), |
|
71 | 71 | 'default'=> __('Please initiate an electronic payment using the following bank information: <br/> Account Owner: Luke Skywalker <br/>Bank Account # 1234567890 <br/>Bank Name: Rebellion Bank <br/>Routing Number: 12345 <br/>Bank Address: 12345 Wookie Rd., Planet Corellian. <br/> Payment must be received within 48 hours of event date.', 'event_espresso') |
72 | 72 | )), |
73 | 73 | ), |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | * @see EE_PMT_Base::help_tabs_config() |
83 | 83 | * @return array |
84 | 84 | */ |
85 | - public function help_tabs_config(){ |
|
85 | + public function help_tabs_config() { |
|
86 | 86 | return array( |
87 | 87 | $this->get_help_tab_name() => array( |
88 | 88 | 'title' => __('Bank Draft Settings', 'event_espresso'), |
@@ -99,7 +99,7 @@ discard block |
||
99 | 99 | * Other gateways may want to override this, such as offline gateways. |
100 | 100 | * @return string |
101 | 101 | */ |
102 | - public function payment_overview_content(EE_Payment $payment){ |
|
102 | + public function payment_overview_content(EE_Payment $payment) { |
|
103 | 103 | EE_Registry::instance()->load_helper('Template'); |
104 | 104 | $extra_meta_for_payment_method = $this->_pm_instance->all_extra_meta_array(); |
105 | 105 | $template_vars = array_merge( |
@@ -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 | * |
@@ -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 | * |
@@ -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 | /** |
@@ -25,7 +25,7 @@ discard block |
||
25 | 25 | * |
26 | 26 | * ------------------------------------------------------------------------ |
27 | 27 | */ |
28 | -class EE_PMT_Invoice extends EE_PMT_Base{ |
|
28 | +class EE_PMT_Invoice extends EE_PMT_Base { |
|
29 | 29 | |
30 | 30 | |
31 | 31 | |
@@ -36,7 +36,7 @@ discard block |
||
36 | 36 | */ |
37 | 37 | public function __construct($pm_instance = NULL) { |
38 | 38 | $this->_pretty_name = __("Invoice", 'event_espresso'); |
39 | - $this->_default_description = __( 'After clicking "Finalize Registration", you will be given instructions on how to access your invoice and complete your payment.', 'event_espresso' ); |
|
39 | + $this->_default_description = __('After clicking "Finalize Registration", you will be given instructions on how to access your invoice and complete your payment.', 'event_espresso'); |
|
40 | 40 | parent::__construct($pm_instance); |
41 | 41 | $this->_default_button_url = $this->file_url().'lib'.DS.'invoice-logo.png'; |
42 | 42 | } |
@@ -48,7 +48,7 @@ discard block |
||
48 | 48 | * @param \EE_Transaction $transaction |
49 | 49 | * @return NULL |
50 | 50 | */ |
51 | - public function generate_new_billing_form( EE_Transaction $transaction = NULL ) { |
|
51 | + public function generate_new_billing_form(EE_Transaction $transaction = NULL) { |
|
52 | 52 | return NULL; |
53 | 53 | } |
54 | 54 | |
@@ -61,49 +61,49 @@ discard block |
||
61 | 61 | public function generate_new_settings_form() { |
62 | 62 | $pdf_payee_input_name = 'pdf_payee_name'; |
63 | 63 | $confirmation_text_input_name = 'page_confirmation_text'; |
64 | - $form = new EE_Payment_Method_Form(array( |
|
64 | + $form = new EE_Payment_Method_Form(array( |
|
65 | 65 | // 'payment_method_type' => $this, |
66 | 66 | 'extra_meta_inputs'=>array( |
67 | 67 | $pdf_payee_input_name => new EE_Text_Input(array( |
68 | - 'html_label_text' => sprintf( __( 'Payee Name %s', 'event_espresso' ), $this->get_help_tab_link()) |
|
68 | + 'html_label_text' => sprintf(__('Payee Name %s', 'event_espresso'), $this->get_help_tab_link()) |
|
69 | 69 | )), |
70 | 70 | 'pdf_payee_email' => new EE_Text_Input(array( |
71 | - 'html_label_text' => sprintf( __( 'Payee Email %s', 'event_espresso' ), $this->get_help_tab_link()), |
|
71 | + 'html_label_text' => sprintf(__('Payee Email %s', 'event_espresso'), $this->get_help_tab_link()), |
|
72 | 72 | )), |
73 | 73 | 'pdf_payee_tax_number' => new EE_Text_Input(array( |
74 | - 'html_label_text' => sprintf( __( 'Payee Tax Number %s', 'event_espresso' ), $this->get_help_tab_link()), |
|
74 | + 'html_label_text' => sprintf(__('Payee Tax Number %s', 'event_espresso'), $this->get_help_tab_link()), |
|
75 | 75 | )), |
76 | 76 | 'pdf_payee_address' => new EE_Text_Area_Input(array( |
77 | - 'html_label_text' => sprintf( __( 'Payee Address %s', 'event_espresso' ), $this->get_help_tab_link()), |
|
77 | + 'html_label_text' => sprintf(__('Payee Address %s', 'event_espresso'), $this->get_help_tab_link()), |
|
78 | 78 | )), |
79 | 79 | 'pdf_instructions'=>new EE_Text_Area_Input(array( |
80 | - 'html_label_text'=> sprintf(__("Instructions %s", "event_espresso"), $this->get_help_tab_link()), |
|
80 | + 'html_label_text'=> sprintf(__("Instructions %s", "event_espresso"), $this->get_help_tab_link()), |
|
81 | 81 | 'default'=> __("Please send this invoice with payment attached to the address above, or use the payment link below. Payment must be received within 48 hours of event date.", 'event_espresso') |
82 | 82 | )), |
83 | 83 | 'pdf_logo_image'=>new EE_Admin_File_Uploader_Input(array( |
84 | - 'html_label_text'=> sprintf(__("Logo Image %s", "event_espresso"), $this->get_help_tab_link()), |
|
84 | + 'html_label_text'=> sprintf(__("Logo Image %s", "event_espresso"), $this->get_help_tab_link()), |
|
85 | 85 | 'default'=> EE_Config::instance()->organization->logo_url, |
86 | 86 | 'html_help_text'=> __("(Logo for the top left of the invoice)", 'event_espresso'), |
87 | 87 | )), |
88 | 88 | $confirmation_text_input_name =>new EE_Text_Area_Input(array( |
89 | - 'html_label_text'=> sprintf(__("Confirmation Text %s", "event_espresso"), $this->get_help_tab_link()), |
|
89 | + 'html_label_text'=> sprintf(__("Confirmation Text %s", "event_espresso"), $this->get_help_tab_link()), |
|
90 | 90 | 'default'=> __("Payment must be received within 48 hours of event date. Details about where to send payment is included on the invoice.", 'event_espresso') |
91 | 91 | )), |
92 | 92 | 'page_extra_info'=>new EE_Text_Area_Input(array( |
93 | - 'html_label_text'=> sprintf(__("Extra Info %s", "event_espresso"), $this->get_help_tab_link()), |
|
93 | + 'html_label_text'=> sprintf(__("Extra Info %s", "event_espresso"), $this->get_help_tab_link()), |
|
94 | 94 | )), |
95 | 95 | ), |
96 | 96 | 'include'=>array( |
97 | - 'PMD_ID', 'PMD_name','PMD_desc','PMD_admin_name','PMD_admin_desc', 'PMD_type','PMD_slug', 'PMD_open_by_default','PMD_button_url','PMD_scope','Currency', |
|
98 | - $pdf_payee_input_name, 'pdf_payee_email', 'pdf_payee_tax_number', 'pdf_payee_address', 'pdf_instructions','pdf_logo_image', |
|
97 | + 'PMD_ID', 'PMD_name', 'PMD_desc', 'PMD_admin_name', 'PMD_admin_desc', 'PMD_type', 'PMD_slug', 'PMD_open_by_default', 'PMD_button_url', 'PMD_scope', 'Currency', |
|
98 | + $pdf_payee_input_name, 'pdf_payee_email', 'pdf_payee_tax_number', 'pdf_payee_address', 'pdf_instructions', 'pdf_logo_image', |
|
99 | 99 | $confirmation_text_input_name, 'page_extra_info'), |
100 | 100 | )); |
101 | 101 | $form->add_subsections( |
102 | - array( 'header1' => new EE_Form_Section_HTML_From_Template( 'payment_methods/Invoice/templates/invoice_settings_header_display.template.php' )), |
|
102 | + array('header1' => new EE_Form_Section_HTML_From_Template('payment_methods/Invoice/templates/invoice_settings_header_display.template.php')), |
|
103 | 103 | $pdf_payee_input_name |
104 | 104 | ); |
105 | 105 | $form->add_subsections( |
106 | - array( 'header2'=>new EE_Form_Section_HTML_From_Template( 'payment_methods/Invoice/templates/invoice_settings_header_gateway.template.php' )), |
|
106 | + array('header2'=>new EE_Form_Section_HTML_From_Template('payment_methods/Invoice/templates/invoice_settings_header_gateway.template.php')), |
|
107 | 107 | $confirmation_text_input_name |
108 | 108 | ); |
109 | 109 | return $form; |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | * @see EE_PMT_Base::help_tabs_config() |
117 | 117 | * @return array |
118 | 118 | */ |
119 | - public function help_tabs_config(){ |
|
119 | + public function help_tabs_config() { |
|
120 | 120 | return array( |
121 | 121 | $this->get_help_tab_name() => array( |
122 | 122 | 'title' => __('Invoice Settings', 'event_espresso'), |
@@ -134,7 +134,7 @@ discard block |
||
134 | 134 | * @param \EE_Payment $payment |
135 | 135 | * @return string |
136 | 136 | */ |
137 | - public function payment_overview_content( EE_Payment $payment ){ |
|
137 | + public function payment_overview_content(EE_Payment $payment) { |
|
138 | 138 | EE_Registry::instance()->load_helper('Template'); |
139 | 139 | return EEH_Template::display_template( |
140 | 140 | $this->_file_folder.'templates'.DS.'invoice_payment_details_content.template.php', |
@@ -144,7 +144,7 @@ discard block |
||
144 | 144 | 'payment' => $payment, |
145 | 145 | 'page_confirmation_text' => '', |
146 | 146 | 'page_extra_info' => '', |
147 | - 'invoice_url' => $payment->transaction()->primary_registration()->invoice_url( 'html' ) |
|
147 | + 'invoice_url' => $payment->transaction()->primary_registration()->invoice_url('html') |
|
148 | 148 | ), |
149 | 149 | $this->_pm_instance->all_extra_meta_array() |
150 | 150 | ), |
@@ -1,4 +1,6 @@ |
||
1 | -<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed'); |
|
1 | +<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
2 | + exit('No direct script access allowed'); |
|
3 | +} |
|
2 | 4 | /** |
3 | 5 | * Event Espresso |
4 | 6 | * |
@@ -51,7 +51,7 @@ discard block |
||
51 | 51 | * @param WP $WP |
52 | 52 | * @return void |
53 | 53 | */ |
54 | - public function run( WP $WP ) { |
|
54 | + public function run(WP $WP) { |
|
55 | 55 | } |
56 | 56 | |
57 | 57 | /** |
@@ -61,19 +61,19 @@ discard block |
||
61 | 61 | * @param array $attributes |
62 | 62 | * @return string |
63 | 63 | */ |
64 | - public function process_shortcode( $attributes = array() ) { |
|
65 | - EE_Registry::instance()->load_core( 'Session' ); |
|
66 | - $transaction = EE_Registry::instance()->SSN->get_session_data( 'transaction' ); |
|
67 | - if ( $transaction instanceof EE_Transaction ) { |
|
68 | - do_action( 'AHEE__EES_Espresso_Cancelled__process_shortcode__transaction', $transaction ); |
|
64 | + public function process_shortcode($attributes = array()) { |
|
65 | + EE_Registry::instance()->load_core('Session'); |
|
66 | + $transaction = EE_Registry::instance()->SSN->get_session_data('transaction'); |
|
67 | + if ($transaction instanceof EE_Transaction) { |
|
68 | + do_action('AHEE__EES_Espresso_Cancelled__process_shortcode__transaction', $transaction); |
|
69 | 69 | $registrations = $transaction->registrations(); |
70 | - foreach( $registrations as $registration ) { |
|
71 | - if ( $registration instanceof EE_Registration ) { |
|
72 | - do_action( 'AHEE__EES_Espresso_Cancelled__process_shortcode__registration', $registration ); |
|
70 | + foreach ($registrations as $registration) { |
|
71 | + if ($registration instanceof EE_Registration) { |
|
72 | + do_action('AHEE__EES_Espresso_Cancelled__process_shortcode__registration', $registration); |
|
73 | 73 | } |
74 | 74 | } |
75 | 75 | } |
76 | - EE_Registry::instance()->SSN->clear_session( __CLASS__, __FUNCTION__ ); |
|
76 | + EE_Registry::instance()->SSN->clear_session(__CLASS__, __FUNCTION__); |
|
77 | 77 | return EE_Registry::instance()->REQ->get_output(); |
78 | 78 | } |
79 | 79 |
@@ -1,4 +1,6 @@ |
||
1 | -<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed'); |
|
1 | +<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
2 | + exit('No direct script access allowed'); |
|
3 | +} |
|
2 | 4 | /** |
3 | 5 | * Event Espresso |
4 | 6 | * |
@@ -91,7 +91,7 @@ discard block |
||
91 | 91 | * @return void |
92 | 92 | */ |
93 | 93 | public static function set_hooks() { |
94 | - add_action( 'wp_loaded', array( 'EES_Espresso_Thank_You', 'set_definitions' ), 2 ); |
|
94 | + add_action('wp_loaded', array('EES_Espresso_Thank_You', 'set_definitions'), 2); |
|
95 | 95 | } |
96 | 96 | |
97 | 97 | /** |
@@ -102,10 +102,10 @@ discard block |
||
102 | 102 | */ |
103 | 103 | public static function set_hooks_admin() { |
104 | 104 | // AJAX for IPN monitoring |
105 | - add_filter( 'heartbeat_received', array( 'EES_Espresso_Thank_You', 'thank_you_page_IPN_monitor' ), 10, 3 ); |
|
106 | - add_filter( 'heartbeat_nopriv_received', array( 'EES_Espresso_Thank_You', 'thank_you_page_IPN_monitor' ), 10, 3 ); |
|
107 | - add_action( 'wp_ajax_espresso_resend_reg_confirmation_email', array( 'EES_Espresso_Thank_You', 'resend_reg_confirmation_email' ), 10, 2 ); |
|
108 | - add_action( 'wp_ajax_nopriv_espresso_resend_reg_confirmation_email', array( 'EES_Espresso_Thank_You', 'resend_reg_confirmation_email' ), 10, 2 ); |
|
105 | + add_filter('heartbeat_received', array('EES_Espresso_Thank_You', 'thank_you_page_IPN_monitor'), 10, 3); |
|
106 | + add_filter('heartbeat_nopriv_received', array('EES_Espresso_Thank_You', 'thank_you_page_IPN_monitor'), 10, 3); |
|
107 | + add_action('wp_ajax_espresso_resend_reg_confirmation_email', array('EES_Espresso_Thank_You', 'resend_reg_confirmation_email'), 10, 2); |
|
108 | + add_action('wp_ajax_nopriv_espresso_resend_reg_confirmation_email', array('EES_Espresso_Thank_You', 'resend_reg_confirmation_email'), 10, 2); |
|
109 | 109 | } |
110 | 110 | |
111 | 111 | |
@@ -117,8 +117,8 @@ discard block |
||
117 | 117 | * @return void |
118 | 118 | */ |
119 | 119 | public static function set_definitions() { |
120 | - define( 'THANK_YOU_ASSETS_URL', plugin_dir_url( __FILE__ ) . 'assets' . DS ); |
|
121 | - define( 'THANK_YOU_TEMPLATES_PATH', str_replace( '\\', DS, plugin_dir_path( __FILE__ )) . 'templates' . DS ); |
|
120 | + define('THANK_YOU_ASSETS_URL', plugin_dir_url(__FILE__).'assets'.DS); |
|
121 | + define('THANK_YOU_TEMPLATES_PATH', str_replace('\\', DS, plugin_dir_path(__FILE__)).'templates'.DS); |
|
122 | 122 | } |
123 | 123 | |
124 | 124 | |
@@ -130,23 +130,23 @@ discard block |
||
130 | 130 | * @return EE_Transaction |
131 | 131 | */ |
132 | 132 | public function get_txn() { |
133 | - if ( $this->_current_txn instanceof EE_Transaction ) { |
|
133 | + if ($this->_current_txn instanceof EE_Transaction) { |
|
134 | 134 | return $this->_current_txn; |
135 | 135 | } |
136 | - $TXN_model = EE_Registry::instance()->load_model( 'Transaction' ); |
|
137 | - if ( ! $TXN_model instanceof EEM_Transaction ) { |
|
136 | + $TXN_model = EE_Registry::instance()->load_model('Transaction'); |
|
137 | + if ( ! $TXN_model instanceof EEM_Transaction) { |
|
138 | 138 | EE_Error::add_error( |
139 | - __( 'The transaction model could not be established.', 'event_espresso' ), |
|
139 | + __('The transaction model could not be established.', 'event_espresso'), |
|
140 | 140 | __FILE__, __FUNCTION__, __LINE__ |
141 | 141 | ); |
142 | 142 | return NULL; |
143 | 143 | } |
144 | 144 | //get the transaction. yes, we may have just loaded it, but it may have been updated, or this may be via an ajax request |
145 | - $this->_current_txn = $TXN_model->get_transaction_from_reg_url_link( $this->_reg_url_link ); |
|
145 | + $this->_current_txn = $TXN_model->get_transaction_from_reg_url_link($this->_reg_url_link); |
|
146 | 146 | // verify TXN |
147 | - if ( ! $this->_current_txn instanceof EE_Transaction ) { |
|
147 | + if ( ! $this->_current_txn instanceof EE_Transaction) { |
|
148 | 148 | EE_Error::add_error( |
149 | - __( 'No transaction information could be retrieved or the transaction data is not of the correct type.', 'event_espresso' ), |
|
149 | + __('No transaction information could be retrieved or the transaction data is not of the correct type.', 'event_espresso'), |
|
150 | 150 | __FILE__, __FUNCTION__, __LINE__ |
151 | 151 | ); |
152 | 152 | return NULL; |
@@ -163,16 +163,16 @@ discard block |
||
163 | 163 | * @param int $since |
164 | 164 | * @return mixed array of EE_Payment || FALSE |
165 | 165 | */ |
166 | - public function get_txn_payments( $since = 0 ) { |
|
167 | - if ( ! $this->get_txn() ) { |
|
166 | + public function get_txn_payments($since = 0) { |
|
167 | + if ( ! $this->get_txn()) { |
|
168 | 168 | return FALSE; |
169 | 169 | } |
170 | - $args = array( 'order_by' => array( 'PAY_timestamp' => 'ASC' )); |
|
171 | - if ( $since > 0 ) { |
|
172 | - $args[0] = array( 'PAY_timestamp' => array( '>', $since )); |
|
170 | + $args = array('order_by' => array('PAY_timestamp' => 'ASC')); |
|
171 | + if ($since > 0) { |
|
172 | + $args[0] = array('PAY_timestamp' => array('>', $since)); |
|
173 | 173 | } |
174 | 174 | // get array of payments with most recent first |
175 | - $payments = $this->_current_txn->payments( $args ); |
|
175 | + $payments = $this->_current_txn->payments($args); |
|
176 | 176 | // global $wpdb; |
177 | 177 | // echo $wpdb->last_query; |
178 | 178 | // EEH_Debug_Tools::printr( $payments, '$payments <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' ); |
@@ -188,19 +188,19 @@ discard block |
||
188 | 188 | * @return void |
189 | 189 | */ |
190 | 190 | private function _get_reg_url_link() { |
191 | - if ( ! empty( $this->_reg_url_link )) { |
|
191 | + if ( ! empty($this->_reg_url_link)) { |
|
192 | 192 | return; |
193 | 193 | } |
194 | 194 | // only do thank you page stuff if we have a REG_url_link in the url |
195 | - if ( ! EE_Registry::instance()->REQ->is_set( 'e_reg_url_link' )) { |
|
195 | + if ( ! EE_Registry::instance()->REQ->is_set('e_reg_url_link')) { |
|
196 | 196 | EE_Error::add_error( |
197 | - __( 'No transaction information could be retrieved because the registration URL link is missing or invalid.', 'event_espresso' ), |
|
197 | + __('No transaction information could be retrieved because the registration URL link is missing or invalid.', 'event_espresso'), |
|
198 | 198 | __FILE__, __FUNCTION__, __LINE__ |
199 | 199 | ); |
200 | 200 | return; |
201 | 201 | } |
202 | 202 | // check for reg_url_link |
203 | - $this->_reg_url_link = EE_Registry::instance()->REQ->get( 'e_reg_url_link' ); |
|
203 | + $this->_reg_url_link = EE_Registry::instance()->REQ->get('e_reg_url_link'); |
|
204 | 204 | } |
205 | 205 | |
206 | 206 | |
@@ -212,8 +212,8 @@ discard block |
||
212 | 212 | * @param string $reg_url_link |
213 | 213 | * @return string |
214 | 214 | */ |
215 | - public function set_reg_url_link( $reg_url_link = NULL ) { |
|
216 | - $this->_reg_url_link = ! empty( $reg_url_link ) ? $reg_url_link : $this->_reg_url_link; |
|
215 | + public function set_reg_url_link($reg_url_link = NULL) { |
|
216 | + $this->_reg_url_link = ! empty($reg_url_link) ? $reg_url_link : $this->_reg_url_link; |
|
217 | 217 | } |
218 | 218 | |
219 | 219 | |
@@ -226,21 +226,21 @@ discard block |
||
226 | 226 | * @param WP $WP |
227 | 227 | * @return void |
228 | 228 | */ |
229 | - public function run( WP $WP ) { |
|
229 | + public function run(WP $WP) { |
|
230 | 230 | // ensure this shortcode doesn't trigger on anything BUT the thank you page |
231 | - if ( isset( $WP->request ) && basename( $WP->request ) != basename( EE_Registry::instance()->CFG->core->thank_you_page_url() )) { |
|
231 | + if (isset($WP->request) && basename($WP->request) != basename(EE_Registry::instance()->CFG->core->thank_you_page_url())) { |
|
232 | 232 | return; |
233 | - } else if ( isset( $WP->query_vars['page_id'] ) && $WP->query_vars['page_id'] != EE_Registry::instance()->CFG->core->thank_you_page_id ) { |
|
233 | + } else if (isset($WP->query_vars['page_id']) && $WP->query_vars['page_id'] != EE_Registry::instance()->CFG->core->thank_you_page_id) { |
|
234 | 234 | return; |
235 | 235 | } |
236 | 236 | $this->_get_reg_url_link(); |
237 | 237 | // resend_reg_confirmation_email ? |
238 | - if ( EE_Registry::instance()->REQ->is_set( 'resend' )) { |
|
238 | + if (EE_Registry::instance()->REQ->is_set('resend')) { |
|
239 | 239 | EES_Espresso_Thank_You::resend_reg_confirmation_email(); |
240 | 240 | } |
241 | 241 | // load assets |
242 | - add_action( 'wp_enqueue_scripts', array( $this, 'load_js' ), 10 ); |
|
243 | - add_action( 'shutdown', array( EE_Session::instance(), 'clear_session' )); |
|
242 | + add_action('wp_enqueue_scripts', array($this, 'load_js'), 10); |
|
243 | + add_action('shutdown', array(EE_Session::instance(), 'clear_session')); |
|
244 | 244 | } |
245 | 245 | |
246 | 246 | |
@@ -251,25 +251,25 @@ discard block |
||
251 | 251 | * @return void |
252 | 252 | */ |
253 | 253 | public function load_js() { |
254 | - wp_register_script( 'thank_you_page', THANK_YOU_ASSETS_URL . 'thank_you_page.js', array( 'espresso_core', 'heartbeat' ), EVENT_ESPRESSO_VERSION, TRUE ); |
|
255 | - wp_enqueue_script( 'thank_you_page' ); |
|
254 | + wp_register_script('thank_you_page', THANK_YOU_ASSETS_URL.'thank_you_page.js', array('espresso_core', 'heartbeat'), EVENT_ESPRESSO_VERSION, TRUE); |
|
255 | + wp_enqueue_script('thank_you_page'); |
|
256 | 256 | EE_Registry::$i18n_js_strings['e_reg_url_link'] = $this->_reg_url_link; |
257 | 257 | EE_Registry::$i18n_js_strings['initial_access'] = current_time('timestamp'); |
258 | 258 | EE_Registry::$i18n_js_strings['IPN_wait_time'] = EES_Espresso_Thank_You::IPN_wait_time; |
259 | 259 | EE_Registry::$i18n_js_strings['TXN_complete'] = EEM_Transaction::complete_status_code; |
260 | 260 | EE_Registry::$i18n_js_strings['TXN_incomplete'] = EEM_Transaction::incomplete_status_code; |
261 | - EE_Registry::$i18n_js_strings['checking_for_new_payments'] = __( 'checking for new payments...', 'event_espresso' ); |
|
262 | - EE_Registry::$i18n_js_strings['loading_payment_info'] = __( 'loading payment information...', 'event_espresso' ); |
|
261 | + EE_Registry::$i18n_js_strings['checking_for_new_payments'] = __('checking for new payments...', 'event_espresso'); |
|
262 | + EE_Registry::$i18n_js_strings['loading_payment_info'] = __('loading payment information...', 'event_espresso'); |
|
263 | 263 | EE_Registry::$i18n_js_strings['server_error'] = __('An unknown error occurred on the server while attempting to process your request. Please refresh the page and try again.', 'event_espresso'); |
264 | 264 | EE_Registry::$i18n_js_strings['slow_IPN'] = apply_filters( |
265 | 265 | 'EES_Espresso_Thank_You__load_js__slow_IPN', |
266 | 266 | sprintf( |
267 | - __( '%sThe Payment Notification appears to be taking longer than usual to arrive. Maybe check back later or just wait for your payment and registration confirmation results to be sent to you via email. We apologize for any inconvenience this may have caused.%s', 'event_espresso' ), |
|
267 | + __('%sThe Payment Notification appears to be taking longer than usual to arrive. Maybe check back later or just wait for your payment and registration confirmation results to be sent to you via email. We apologize for any inconvenience this may have caused.%s', 'event_espresso'), |
|
268 | 268 | '<div id="espresso-thank-you-page-slow-IPN-dv" class="ee-attention jst-left">', |
269 | 269 | '</div>' |
270 | 270 | ) |
271 | 271 | ); |
272 | - wp_localize_script( 'thank_you_page', 'eei18n', EE_Registry::$i18n_js_strings ); |
|
272 | + wp_localize_script('thank_you_page', 'eei18n', EE_Registry::$i18n_js_strings); |
|
273 | 273 | } |
274 | 274 | |
275 | 275 | |
@@ -283,26 +283,26 @@ discard block |
||
283 | 283 | */ |
284 | 284 | public function init() { |
285 | 285 | $this->_get_reg_url_link(); |
286 | - if ( ! $this->get_txn() ) { |
|
286 | + if ( ! $this->get_txn()) { |
|
287 | 287 | return NULL; |
288 | 288 | } |
289 | 289 | // if we've made it to the Thank You page, then let's toggle any "Failed" transactions to "Incomplete" |
290 | - if ( $this->_current_txn->status_ID() == EEM_Transaction::failed_status_code ) { |
|
291 | - $this->_current_txn->set_status( EEM_Transaction::incomplete_status_code ); |
|
290 | + if ($this->_current_txn->status_ID() == EEM_Transaction::failed_status_code) { |
|
291 | + $this->_current_txn->set_status(EEM_Transaction::incomplete_status_code); |
|
292 | 292 | $this->_current_txn->save(); |
293 | 293 | } |
294 | 294 | $this->_primary_registrant = $this->_current_txn->primary_registration() instanceof EE_Registration ? $this->_current_txn->primary_registration() : NULL; |
295 | 295 | $this->_is_primary = $this->_primary_registrant->reg_url_link() == $this->_reg_url_link ? TRUE : FALSE; |
296 | 296 | |
297 | - $show_try_pay_again_link_default = do_action( 'AHEE__EES_Espresso_Thank_You__init__show_try_pay_again_link_default', TRUE ); |
|
297 | + $show_try_pay_again_link_default = do_action('AHEE__EES_Espresso_Thank_You__init__show_try_pay_again_link_default', TRUE); |
|
298 | 298 | // txn status ? |
299 | - if( $this->_current_txn->is_completed() ){ |
|
299 | + if ($this->_current_txn->is_completed()) { |
|
300 | 300 | $this->_show_try_pay_again_link = $show_try_pay_again_link_default; |
301 | - } else if ( $this->_current_txn->is_incomplete() && ( $this->_primary_registrant->is_approved() || $this->_primary_registrant->is_pending_payment() )){ |
|
301 | + } else if ($this->_current_txn->is_incomplete() && ($this->_primary_registrant->is_approved() || $this->_primary_registrant->is_pending_payment())) { |
|
302 | 302 | $this->_show_try_pay_again_link = TRUE; |
303 | - } else if ( $this->_primary_registrant->is_approved() || $this->_primary_registrant->is_pending_payment() ) { |
|
303 | + } else if ($this->_primary_registrant->is_approved() || $this->_primary_registrant->is_pending_payment()) { |
|
304 | 304 | // its pending |
305 | - $this->_show_try_pay_again_link = isset( EE_Registry::instance()->CFG->registration->show_pending_payment_options ) && EE_Registry::instance()->CFG->registration->show_pending_payment_options ? TRUE : $show_try_pay_again_link_default; |
|
305 | + $this->_show_try_pay_again_link = isset(EE_Registry::instance()->CFG->registration->show_pending_payment_options) && EE_Registry::instance()->CFG->registration->show_pending_payment_options ? TRUE : $show_try_pay_again_link_default; |
|
306 | 306 | } else { |
307 | 307 | $this->_show_try_pay_again_link = $show_try_pay_again_link_default; |
308 | 308 | } |
@@ -310,18 +310,18 @@ discard block |
||
310 | 310 | $this->_is_offline_payment_method = $this->_current_txn->payment_method() instanceof EE_Payment_Method && $this->_current_txn->payment_method()->is_off_line() ? TRUE : FALSE; |
311 | 311 | // link to SPCO |
312 | 312 | $revisit_spco_url = add_query_arg( |
313 | - array( 'ee'=>'_register', 'revisit'=>TRUE, 'e_reg_url_link'=>$this->_reg_url_link ), |
|
313 | + array('ee'=>'_register', 'revisit'=>TRUE, 'e_reg_url_link'=>$this->_reg_url_link), |
|
314 | 314 | EE_Registry::instance()->CFG->core->reg_page_url() |
315 | 315 | ); |
316 | 316 | // link to SPCO payment_options |
317 | - $this->_SPCO_payment_options_url = $this->_primary_registrant instanceof EE_Registration ? $this->_primary_registrant->payment_overview_url() : add_query_arg( array('step'=>'payment_options' ), $revisit_spco_url ); |
|
317 | + $this->_SPCO_payment_options_url = $this->_primary_registrant instanceof EE_Registration ? $this->_primary_registrant->payment_overview_url() : add_query_arg(array('step'=>'payment_options'), $revisit_spco_url); |
|
318 | 318 | // link to SPCO attendee_information |
319 | 319 | $this->_SPCO_attendee_information_url = $this->_primary_registrant instanceof EE_Registration ? $this->_primary_registrant->edit_attendee_information_url() : FALSE; |
320 | 320 | |
321 | - EE_Registry::instance()->load_helper( 'Template' ); |
|
322 | - EE_Registry::instance()->load_helper( 'Template_Validator' ); |
|
321 | + EE_Registry::instance()->load_helper('Template'); |
|
322 | + EE_Registry::instance()->load_helper('Template_Validator'); |
|
323 | 323 | |
324 | - do_action( 'AHEE__EES_Espresso_Thank_You__init_end', $this->_current_txn ); |
|
324 | + do_action('AHEE__EES_Espresso_Thank_You__init_end', $this->_current_txn); |
|
325 | 325 | // set no cache headers and constants |
326 | 326 | EE_System::do_not_cache(); |
327 | 327 | |
@@ -337,32 +337,32 @@ discard block |
||
337 | 337 | * @param array $attributes |
338 | 338 | * @return string |
339 | 339 | */ |
340 | - public function process_shortcode( $attributes = array() ) { |
|
340 | + public function process_shortcode($attributes = array()) { |
|
341 | 341 | |
342 | 342 | $this->init(); |
343 | 343 | |
344 | - if ( ! $this->_current_txn instanceof EE_Transaction ) { |
|
344 | + if ( ! $this->_current_txn instanceof EE_Transaction) { |
|
345 | 345 | return EE_Error::get_notices(); |
346 | 346 | } |
347 | - EE_Registry::instance()->load_helper( 'Debug_Tools' ); |
|
348 | - EEH_Debug_Tools::log( __CLASS__, __FUNCTION__, __LINE__, array( $this->_current_txn ), true, |
|
349 | - 'EE_Transaction: ' . $this->_current_txn->ID() ); |
|
347 | + EE_Registry::instance()->load_helper('Debug_Tools'); |
|
348 | + EEH_Debug_Tools::log(__CLASS__, __FUNCTION__, __LINE__, array($this->_current_txn), true, |
|
349 | + 'EE_Transaction: '.$this->_current_txn->ID()); |
|
350 | 350 | // link to receipt |
351 | - $template_args['TXN_receipt_url'] = $this->_current_txn->receipt_url( 'html' ); |
|
352 | - if ( ! empty( $template_args['TXN_receipt_url'] )) { |
|
353 | - $template_args['order_conf_desc'] = __( '%1$sCongratulations%2$sYour registration has been successfully processed.%3$sCheck your email for your registration confirmation or click the button below to view / download / print a full description of your purchases and registration information.', 'event_espresso' ); |
|
351 | + $template_args['TXN_receipt_url'] = $this->_current_txn->receipt_url('html'); |
|
352 | + if ( ! empty($template_args['TXN_receipt_url'])) { |
|
353 | + $template_args['order_conf_desc'] = __('%1$sCongratulations%2$sYour registration has been successfully processed.%3$sCheck your email for your registration confirmation or click the button below to view / download / print a full description of your purchases and registration information.', 'event_espresso'); |
|
354 | 354 | } else { |
355 | - $template_args['order_conf_desc'] = __( '%1$sCongratulations%2$sYour registration has been successfully processed.%3$sCheck your email for your registration confirmation.', 'event_espresso' ); |
|
355 | + $template_args['order_conf_desc'] = __('%1$sCongratulations%2$sYour registration has been successfully processed.%3$sCheck your email for your registration confirmation.', 'event_espresso'); |
|
356 | 356 | } |
357 | 357 | $template_args['transaction'] = $this->_current_txn; |
358 | - $template_args['revisit'] = EE_Registry::instance()->REQ->get( 'revisit', FALSE ); |
|
358 | + $template_args['revisit'] = EE_Registry::instance()->REQ->get('revisit', FALSE); |
|
359 | 359 | |
360 | - add_action( 'AHEE__thank_you_page_overview_template__content', array( $this, 'get_registration_details' )); |
|
361 | - if ( $this->_is_primary && $this->_payments_closed && ! $this->_current_txn->is_free() ) { |
|
362 | - add_action( 'AHEE__thank_you_page_overview_template__content', array( $this, 'get_ajax_content' )); |
|
360 | + add_action('AHEE__thank_you_page_overview_template__content', array($this, 'get_registration_details')); |
|
361 | + if ($this->_is_primary && $this->_payments_closed && ! $this->_current_txn->is_free()) { |
|
362 | + add_action('AHEE__thank_you_page_overview_template__content', array($this, 'get_ajax_content')); |
|
363 | 363 | } |
364 | 364 | |
365 | - return EEH_Template::locate_template( THANK_YOU_TEMPLATES_PATH . 'thank-you-page-overview.template.php', $template_args, TRUE, TRUE ); |
|
365 | + return EEH_Template::locate_template(THANK_YOU_TEMPLATES_PATH.'thank-you-page-overview.template.php', $template_args, TRUE, TRUE); |
|
366 | 366 | |
367 | 367 | } |
368 | 368 | |
@@ -379,15 +379,15 @@ discard block |
||
379 | 379 | * @param array $data |
380 | 380 | * @return array |
381 | 381 | */ |
382 | - public static function thank_you_page_IPN_monitor( $response = array(), $data = array() ) { |
|
382 | + public static function thank_you_page_IPN_monitor($response = array(), $data = array()) { |
|
383 | 383 | // does this heartbeat contain our data ? |
384 | - if ( ! isset( $data['espresso_thank_you_page'] )) { |
|
384 | + if ( ! isset($data['espresso_thank_you_page'])) { |
|
385 | 385 | return $response; |
386 | 386 | } |
387 | 387 | // check for reg_url_link in the incoming heartbeat data |
388 | - if ( ! isset( $data['espresso_thank_you_page']['e_reg_url_link'] )) { |
|
389 | - $response['espresso_thank_you_page'] = array ( |
|
390 | - 'errors' => ! empty( $notices['errors'] ) ? $notices['errors'] : __( 'No transaction information could be retrieved because the registration URL link is missing or invalid.', 'event_espresso' ) |
|
388 | + if ( ! isset($data['espresso_thank_you_page']['e_reg_url_link'])) { |
|
389 | + $response['espresso_thank_you_page'] = array( |
|
390 | + 'errors' => ! empty($notices['errors']) ? $notices['errors'] : __('No transaction information could be retrieved because the registration URL link is missing or invalid.', 'event_espresso') |
|
391 | 391 | ); |
392 | 392 | return $response; |
393 | 393 | } |
@@ -397,24 +397,24 @@ discard block |
||
397 | 397 | EES_Espresso_Thank_You::set_definitions(); |
398 | 398 | /** @var $espresso_thank_you_page EES_Espresso_Thank_You */ |
399 | 399 | $espresso_thank_you_page = EES_Espresso_Thank_You::instance(); |
400 | - $espresso_thank_you_page->set_reg_url_link( $data['espresso_thank_you_page']['e_reg_url_link'] ); |
|
400 | + $espresso_thank_you_page->set_reg_url_link($data['espresso_thank_you_page']['e_reg_url_link']); |
|
401 | 401 | $espresso_thank_you_page->init(); |
402 | 402 | //get TXN |
403 | 403 | $TXN = $espresso_thank_you_page->get_txn(); |
404 | 404 | // no TXN? then get out |
405 | - if ( ! $TXN instanceof EE_Transaction ) { |
|
405 | + if ( ! $TXN instanceof EE_Transaction) { |
|
406 | 406 | $notices = EE_Error::get_notices(); |
407 | - $response['espresso_thank_you_page'] = array ( |
|
408 | - 'errors' => ! empty( $notices['errors'] ) ? $notices['errors'] : sprintf( __( 'The information for your transaction could not be retrieved from the server or the transaction data received was invalid because of a technical reason. (%s)', 'event_espresso' ), __LINE__ ) |
|
407 | + $response['espresso_thank_you_page'] = array( |
|
408 | + 'errors' => ! empty($notices['errors']) ? $notices['errors'] : sprintf(__('The information for your transaction could not be retrieved from the server or the transaction data received was invalid because of a technical reason. (%s)', 'event_espresso'), __LINE__) |
|
409 | 409 | ); |
410 | 410 | return $response; |
411 | 411 | } |
412 | 412 | // grab transient of TXN's status |
413 | - $txn_status = isset( $data['espresso_thank_you_page']['txn_status'] ) ? $data['espresso_thank_you_page']['txn_status'] : NULL; |
|
413 | + $txn_status = isset($data['espresso_thank_you_page']['txn_status']) ? $data['espresso_thank_you_page']['txn_status'] : NULL; |
|
414 | 414 | // has the TXN status changed since we last checked (or empty because this is the first time running through this code)? |
415 | - if ( $txn_status !== $TXN->status_ID() ) { |
|
415 | + if ($txn_status !== $TXN->status_ID()) { |
|
416 | 416 | // switch between two possible basic outcomes |
417 | - switch( $TXN->status_ID()) { |
|
417 | + switch ($TXN->status_ID()) { |
|
418 | 418 | // TXN has been updated in some way |
419 | 419 | case EEM_Transaction::overpaid_status_code: |
420 | 420 | case EEM_Transaction::complete_status_code: |
@@ -429,29 +429,29 @@ discard block |
||
429 | 429 | case EEM_Transaction::failed_status_code: |
430 | 430 | default: |
431 | 431 | // keep on waiting... |
432 | - return $espresso_thank_you_page->_update_server_wait_time( $data['espresso_thank_you_page'] ); |
|
432 | + return $espresso_thank_you_page->_update_server_wait_time($data['espresso_thank_you_page']); |
|
433 | 433 | } |
434 | 434 | |
435 | 435 | // or is the TXN still failed (never been updated) ??? |
436 | - } else if ( $TXN->failed() ) { |
|
436 | + } else if ($TXN->failed()) { |
|
437 | 437 | // keep on waiting... |
438 | - return $espresso_thank_you_page->_update_server_wait_time( $data['espresso_thank_you_page'] ); |
|
438 | + return $espresso_thank_you_page->_update_server_wait_time($data['espresso_thank_you_page']); |
|
439 | 439 | } |
440 | 440 | // TXN is happening so let's get the payments now |
441 | 441 | // if we've already gotten payments then the heartbeat data will contain the timestamp of the last time we checked |
442 | - $since = isset( $data['espresso_thank_you_page']['get_payments_since'] ) ? $data['espresso_thank_you_page']['get_payments_since'] : 0; |
|
442 | + $since = isset($data['espresso_thank_you_page']['get_payments_since']) ? $data['espresso_thank_you_page']['get_payments_since'] : 0; |
|
443 | 443 | // then check for payments |
444 | - $payments = $espresso_thank_you_page->get_txn_payments( $since ); |
|
444 | + $payments = $espresso_thank_you_page->get_txn_payments($since); |
|
445 | 445 | // has a payment been processed ? |
446 | - if ( ! empty( $payments ) || $espresso_thank_you_page->_is_offline_payment_method ) { |
|
447 | - if ( $since ) { |
|
446 | + if ( ! empty($payments) || $espresso_thank_you_page->_is_offline_payment_method) { |
|
447 | + if ($since) { |
|
448 | 448 | $response['espresso_thank_you_page'] = array( |
449 | - 'new_payments' => $espresso_thank_you_page->get_new_payments( $payments ), |
|
449 | + 'new_payments' => $espresso_thank_you_page->get_new_payments($payments), |
|
450 | 450 | 'transaction_details' => $espresso_thank_you_page->get_transaction_details(), |
451 | 451 | 'txn_status' => $TXN->status_ID() |
452 | 452 | ); |
453 | 453 | } else { |
454 | - $response['espresso_thank_you_page']['payment_details'] = $espresso_thank_you_page->get_payment_details( $payments ); |
|
454 | + $response['espresso_thank_you_page']['payment_details'] = $espresso_thank_you_page->get_payment_details($payments); |
|
455 | 455 | } |
456 | 456 | // reset time to check for payments |
457 | 457 | $response['espresso_thank_you_page']['get_payments_since'] = current_time('timestamp'); |
@@ -471,9 +471,9 @@ discard block |
||
471 | 471 | * @param array $thank_you_page_data thank you page portion of the incoming JSON array from the WP heartbeat data |
472 | 472 | * @return array |
473 | 473 | */ |
474 | - private function _update_server_wait_time( $thank_you_page_data = array() ) { |
|
475 | - $response['espresso_thank_you_page'] = array ( |
|
476 | - 'still_waiting' => isset( $thank_you_page_data['initial_access'] ) ? current_time('timestamp') - $thank_you_page_data['initial_access'] : 0, |
|
474 | + private function _update_server_wait_time($thank_you_page_data = array()) { |
|
475 | + $response['espresso_thank_you_page'] = array( |
|
476 | + 'still_waiting' => isset($thank_you_page_data['initial_access']) ? current_time('timestamp') - $thank_you_page_data['initial_access'] : 0, |
|
477 | 477 | 'txn_status' => $this->_current_txn->status_ID() |
478 | 478 | ); |
479 | 479 | return $response; |
@@ -496,13 +496,13 @@ discard block |
||
496 | 496 | $template_args['SPCO_attendee_information_url'] = $this->_SPCO_attendee_information_url; |
497 | 497 | |
498 | 498 | $template_args['resend_reg_confirmation_url'] = add_query_arg( |
499 | - array( 'token'=>$this->_reg_url_link, 'resend_reg_confirmation' => 'true' ), |
|
499 | + array('token'=>$this->_reg_url_link, 'resend_reg_confirmation' => 'true'), |
|
500 | 500 | EE_Registry::instance()->CFG->core->thank_you_page_url() |
501 | 501 | ); |
502 | 502 | // verify template arguments |
503 | - EEH_Template_Validator::verify_instanceof( $template_args['transaction'], '$transaction', 'EE_Transaction' ); |
|
504 | - EEH_Template_Validator::verify_isnt_null( $template_args['SPCO_attendee_information_url'], '$SPCO_attendee_information_url'); |
|
505 | - echo EEH_Template::locate_template( THANK_YOU_TEMPLATES_PATH . 'thank-you-page-registration-details.template.php', $template_args, TRUE, TRUE ); |
|
503 | + EEH_Template_Validator::verify_instanceof($template_args['transaction'], '$transaction', 'EE_Transaction'); |
|
504 | + EEH_Template_Validator::verify_isnt_null($template_args['SPCO_attendee_information_url'], '$SPCO_attendee_information_url'); |
|
505 | + echo EEH_Template::locate_template(THANK_YOU_TEMPLATES_PATH.'thank-you-page-registration-details.template.php', $template_args, TRUE, TRUE); |
|
506 | 506 | } |
507 | 507 | |
508 | 508 | |
@@ -511,38 +511,38 @@ discard block |
||
511 | 511 | * resend_reg_confirmation_email |
512 | 512 | */ |
513 | 513 | public static function resend_reg_confirmation_email() { |
514 | - EE_Registry::instance()->load_core( 'Request_Handler' ); |
|
515 | - $reg_url_link = EE_Registry::instance()->REQ->get( 'token' ); |
|
514 | + EE_Registry::instance()->load_core('Request_Handler'); |
|
515 | + $reg_url_link = EE_Registry::instance()->REQ->get('token'); |
|
516 | 516 | |
517 | 517 | // was a REG_ID passed ? |
518 | - if ( $reg_url_link ) { |
|
519 | - $registration = EE_Registry::instance()->load_model( 'Registration' )->get_one( array( array( 'REG_url_link' => $reg_url_link ))); |
|
520 | - if ( $registration instanceof EE_Registration ) { |
|
518 | + if ($reg_url_link) { |
|
519 | + $registration = EE_Registry::instance()->load_model('Registration')->get_one(array(array('REG_url_link' => $reg_url_link))); |
|
520 | + if ($registration instanceof EE_Registration) { |
|
521 | 521 | // resend email |
522 | - EED_Messages::process_resend( array( '_REG_ID' => $registration->ID() )); |
|
522 | + EED_Messages::process_resend(array('_REG_ID' => $registration->ID())); |
|
523 | 523 | } else { |
524 | 524 | EE_Error::add_error( |
525 | - __( 'The Registration Confirmation email could not be sent because a valid Registration could not be retrieved from the database.', 'event_espresso' ), |
|
525 | + __('The Registration Confirmation email could not be sent because a valid Registration could not be retrieved from the database.', 'event_espresso'), |
|
526 | 526 | __FILE__, __FUNCTION__, __LINE__ |
527 | 527 | ); |
528 | 528 | } |
529 | 529 | } else { |
530 | 530 | EE_Error::add_error( |
531 | - __( 'The Registration Confirmation email could not be sent because a registration token is missing or invalid.', 'event_espresso' ), |
|
531 | + __('The Registration Confirmation email could not be sent because a registration token is missing or invalid.', 'event_espresso'), |
|
532 | 532 | __FILE__, __FUNCTION__, __LINE__ |
533 | 533 | ); |
534 | 534 | } |
535 | 535 | // request sent via AJAX ? |
536 | - if ( EE_FRONT_AJAX ) { |
|
537 | - echo json_encode( EE_Error::get_notices( FALSE )); |
|
536 | + if (EE_FRONT_AJAX) { |
|
537 | + echo json_encode(EE_Error::get_notices(FALSE)); |
|
538 | 538 | die(); |
539 | 539 | // or was JS disabled ? |
540 | 540 | } else { |
541 | 541 | // save errors so that they get picked up on the next request |
542 | - EE_Error::get_notices( TRUE, TRUE ); |
|
542 | + EE_Error::get_notices(TRUE, TRUE); |
|
543 | 543 | wp_safe_redirect( |
544 | 544 | add_query_arg( |
545 | - array( 'e_reg_url_link'=> $reg_url_link ), |
|
545 | + array('e_reg_url_link'=> $reg_url_link), |
|
546 | 546 | EE_Registry::instance()->CFG->core->thank_you_page_url() |
547 | 547 | ) |
548 | 548 | ); |
@@ -558,19 +558,19 @@ discard block |
||
558 | 558 | * @return string |
559 | 559 | */ |
560 | 560 | public function get_ajax_content() { |
561 | - if ( ! $this->_primary_registrant->is_not_approved() ) { |
|
561 | + if ( ! $this->_primary_registrant->is_not_approved()) { |
|
562 | 562 | ?> |
563 | 563 | <div id="espresso-thank-you-page-ajax-content-dv"> |
564 | 564 | <div id="espresso-thank-you-page-ajax-transaction-dv"></div> |
565 | 565 | <div id="espresso-thank-you-page-ajax-payment-dv"></div> |
566 | 566 | <div id="espresso-thank-you-page-ajax-loading-dv"> |
567 | 567 | <div id="ee-ajax-loading-dv" class="left lt-blue-text"> |
568 | - <span class="dashicons dashicons-upload"></span><span id="ee-ajax-loading-msg-spn"><?php _e( 'loading transaction and payment information...', 'event_espresso' );?></span> |
|
568 | + <span class="dashicons dashicons-upload"></span><span id="ee-ajax-loading-msg-spn"><?php _e('loading transaction and payment information...', 'event_espresso'); ?></span> |
|
569 | 569 | </div> |
570 | - <?php if ( ! $this->_is_offline_payment_method ) : ?> |
|
570 | + <?php if ( ! $this->_is_offline_payment_method) : ?> |
|
571 | 571 | <p id="ee-ajax-loading-pg" class="highlight-bg small-text clear"> |
572 | - <?php echo apply_filters( 'EES_Espresso_Thank_You__get_ajax_content__waiting_for_IPN_msg', __( 'Some payment gateways can take 15 minutes or more to return their payment notification, so please be patient if you require payment confirmation as soon as possible. Please note that as soon as everything is finalized, we will send your full payment and registration confirmation results to you via email.', 'event_espresso' ));?><br/> |
|
573 | - <span class="jst-rght ee-block small-text lt-grey-text"><?php _e( 'current wait time ', 'event_espresso' );?><span id="espresso-thank-you-page-ajax-time-dv">00:00:00</span></span> |
|
572 | + <?php echo apply_filters('EES_Espresso_Thank_You__get_ajax_content__waiting_for_IPN_msg', __('Some payment gateways can take 15 minutes or more to return their payment notification, so please be patient if you require payment confirmation as soon as possible. Please note that as soon as everything is finalized, we will send your full payment and registration confirmation results to you via email.', 'event_espresso')); ?><br/> |
|
573 | + <span class="jst-rght ee-block small-text lt-grey-text"><?php _e('current wait time ', 'event_espresso'); ?><span id="espresso-thank-you-page-ajax-time-dv">00:00:00</span></span> |
|
574 | 574 | </p> |
575 | 575 | <?php endif; ?> |
576 | 576 | </div> |
@@ -580,9 +580,9 @@ discard block |
||
580 | 580 | } else { |
581 | 581 | ?> |
582 | 582 | <div id="espresso-thank-you-page-not-approved-message-dv"> |
583 | - <h4 class="orange-text"><?php _e('Important Notice:', 'event_espresso');?></h4> |
|
583 | + <h4 class="orange-text"><?php _e('Important Notice:', 'event_espresso'); ?></h4> |
|
584 | 584 | <p id="events-requiring-pre-approval-pg" class="small-text"> |
585 | - <?php echo apply_filters( 'AHEE__EES_Espresso_Thank_You__get_ajax_content__not_approved_message', __('The Event you have registered for does not require payment at this time and was not billed for during this transaction. Billing will only occur after all attendees have been approved by the event organizer. You will be notified when your registration has been processed. If this is a free event, then no billing will occur.', 'event_espresso') ); ?> |
|
585 | + <?php echo apply_filters('AHEE__EES_Espresso_Thank_You__get_ajax_content__not_approved_message', __('The Event you have registered for does not require payment at this time and was not billed for during this transaction. Billing will only occur after all attendees have been approved by the event organizer. You will be notified when your registration has been processed. If this is a free event, then no billing will occur.', 'event_espresso')); ?> |
|
586 | 586 | </p> |
587 | 587 | <div class="clear"></div> |
588 | 588 | </div> |
@@ -603,15 +603,15 @@ discard block |
||
603 | 603 | $template_args = array(); |
604 | 604 | $template_args['transaction'] = $this->_current_txn; |
605 | 605 | $template_args['reg_url_link'] = $this->_reg_url_link; |
606 | - $template_args['primary_registrant_name'] = $this->_primary_registrant->attendee()->full_name( TRUE ); |
|
606 | + $template_args['primary_registrant_name'] = $this->_primary_registrant->attendee()->full_name(TRUE); |
|
607 | 607 | // link to SPCO payment_options |
608 | 608 | $template_args['show_try_pay_again_link'] = $this->_show_try_pay_again_link; |
609 | 609 | $template_args['SPCO_payment_options_url'] = $this->_SPCO_payment_options_url; |
610 | 610 | // verify template arguments |
611 | - EEH_Template_Validator::verify_instanceof( $template_args['transaction'], '$transaction', 'EE_Transaction' ); |
|
612 | - EEH_Template_Validator::verify_isnt_null( $template_args['show_try_pay_again_link'], '$show_try_pay_again_link' ); |
|
613 | - EEH_Template_Validator::verify_isnt_null( $template_args['SPCO_payment_options_url'], '$SPCO_payment_options_url' ); |
|
614 | - return EEH_Template::locate_template( THANK_YOU_TEMPLATES_PATH . 'thank-you-page-transaction-details.template.php', $template_args, TRUE, TRUE ); |
|
611 | + EEH_Template_Validator::verify_instanceof($template_args['transaction'], '$transaction', 'EE_Transaction'); |
|
612 | + EEH_Template_Validator::verify_isnt_null($template_args['show_try_pay_again_link'], '$show_try_pay_again_link'); |
|
613 | + EEH_Template_Validator::verify_isnt_null($template_args['SPCO_payment_options_url'], '$SPCO_payment_options_url'); |
|
614 | + return EEH_Template::locate_template(THANK_YOU_TEMPLATES_PATH.'thank-you-page-transaction-details.template.php', $template_args, TRUE, TRUE); |
|
615 | 615 | } |
616 | 616 | |
617 | 617 | |
@@ -623,9 +623,9 @@ discard block |
||
623 | 623 | * @param EE_Payment $payment |
624 | 624 | * @return string |
625 | 625 | */ |
626 | - public function get_payment_row_html( $payment = NULL ) { |
|
626 | + public function get_payment_row_html($payment = NULL) { |
|
627 | 627 | $html = ''; |
628 | - if ( $payment instanceof EE_Payment ) { |
|
628 | + if ($payment instanceof EE_Payment) { |
|
629 | 629 | if ( |
630 | 630 | $payment->payment_method() instanceof EE_Payment_Method |
631 | 631 | && $payment->payment_method()->is_off_site() |
@@ -634,25 +634,25 @@ discard block |
||
634 | 634 | // considering the registrant has made it to the Thank You page, |
635 | 635 | // any failed payments may actually be pending and the IPN is just slow |
636 | 636 | // so let's |
637 | - $payment->set_status( EEM_Payment::status_id_pending ); |
|
637 | + $payment->set_status(EEM_Payment::status_id_pending); |
|
638 | 638 | } |
639 | - $payment_declined_msg = $payment->STS_ID() === EEM_Payment::status_id_declined ? '<br /><span class="small-text">' . $payment->gateway_response() . '</span>' : ''; |
|
639 | + $payment_declined_msg = $payment->STS_ID() === EEM_Payment::status_id_declined ? '<br /><span class="small-text">'.$payment->gateway_response().'</span>' : ''; |
|
640 | 640 | $html .= ' |
641 | 641 | <tr> |
642 | 642 | <td> |
643 | - ' . $payment->timestamp() . ' |
|
643 | + ' . $payment->timestamp().' |
|
644 | 644 | </td> |
645 | 645 | <td> |
646 | - ' . ( $payment->payment_method() instanceof EE_Payment_Method ? $payment->payment_method()->name() : __( 'Unknown', 'event_espresso' ) ) . ' |
|
646 | + ' . ($payment->payment_method() instanceof EE_Payment_Method ? $payment->payment_method()->name() : __('Unknown', 'event_espresso')).' |
|
647 | 647 | </td> |
648 | 648 | <td class="jst-rght"> |
649 | - ' . EEH_Template::format_currency( $payment->amount() ) . ' |
|
649 | + ' . EEH_Template::format_currency($payment->amount()).' |
|
650 | 650 | </td> |
651 | 651 | <td class="jst-rght" style="line-height:1;"> |
652 | - ' . $payment->pretty_status( TRUE ) . $payment_declined_msg . ' |
|
652 | + ' . $payment->pretty_status(TRUE).$payment_declined_msg.' |
|
653 | 653 | </td> |
654 | 654 | </tr>'; |
655 | - do_action( 'AHEE__thank_you_page_payment_details_template__after_each_payment', $payment ); |
|
655 | + do_action('AHEE__thank_you_page_payment_details_template__after_each_payment', $payment); |
|
656 | 656 | } |
657 | 657 | return $html; |
658 | 658 | } |
@@ -666,34 +666,34 @@ discard block |
||
666 | 666 | * @param array $payments |
667 | 667 | * @return string |
668 | 668 | */ |
669 | - public function get_payment_details( $payments = array() ) { |
|
669 | + public function get_payment_details($payments = array()) { |
|
670 | 670 | //prepare variables for displaying |
671 | 671 | $template_args = array(); |
672 | 672 | $template_args['transaction'] = $this->_current_txn; |
673 | 673 | $template_args['reg_url_link'] = $this->_reg_url_link; |
674 | 674 | $template_args['payments'] = array(); |
675 | - foreach ( $payments as $payment ) { |
|
676 | - $template_args['payments'][] = $this->get_payment_row_html( $payment ); |
|
675 | + foreach ($payments as $payment) { |
|
676 | + $template_args['payments'][] = $this->get_payment_row_html($payment); |
|
677 | 677 | } |
678 | 678 | //create a hacky payment object, but dont save it |
679 | - $payment = EE_Payment::new_instance( array( |
|
679 | + $payment = EE_Payment::new_instance(array( |
|
680 | 680 | 'TXN_ID'=>$this->_current_txn->ID(), |
681 | 681 | 'STS_ID'=>EEM_Payment::status_id_pending, |
682 | 682 | 'PAY_timestamp'=>current_time('timestamp'), |
683 | 683 | 'PAY_amount'=>$this->_current_txn->total(), |
684 | 684 | 'PMD_ID'=>$this->_current_txn->payment_method_ID() |
685 | 685 | )); |
686 | - $template_args['gateway_content'] = $this->_current_txn->payment_method()->type_obj()->payment_overview_content($payment);//EEM_Gateways::instance()->get_payment_overview_content( $gateway_name, $payment ); |
|
686 | + $template_args['gateway_content'] = $this->_current_txn->payment_method()->type_obj()->payment_overview_content($payment); //EEM_Gateways::instance()->get_payment_overview_content( $gateway_name, $payment ); |
|
687 | 687 | // link to SPCO payment_options |
688 | 688 | $template_args['show_try_pay_again_link'] = $this->_show_try_pay_again_link; |
689 | 689 | $template_args['SPCO_payment_options_url'] = $this->_SPCO_payment_options_url; |
690 | 690 | // verify template arguments |
691 | - EEH_Template_Validator::verify_instanceof( $template_args['transaction'], '$transaction', 'EE_Transaction' ); |
|
692 | - EEH_Template_Validator::verify_isnt_null( $template_args['payments'], '$payments' ); |
|
693 | - EEH_Template_Validator::verify_isnt_null( $template_args['show_try_pay_again_link'], '$show_try_pay_again_link' ); |
|
694 | - EEH_Template_Validator::verify_isnt_null( $template_args['gateway_content'], '$gateway_content'); |
|
695 | - EEH_Template_Validator::verify_isnt_null( $template_args['SPCO_payment_options_url'], '$SPCO_payment_options_url'); |
|
696 | - return EEH_Template::locate_template( THANK_YOU_TEMPLATES_PATH . 'thank-you-page-payment-details.template.php', $template_args, TRUE, TRUE ); |
|
691 | + EEH_Template_Validator::verify_instanceof($template_args['transaction'], '$transaction', 'EE_Transaction'); |
|
692 | + EEH_Template_Validator::verify_isnt_null($template_args['payments'], '$payments'); |
|
693 | + EEH_Template_Validator::verify_isnt_null($template_args['show_try_pay_again_link'], '$show_try_pay_again_link'); |
|
694 | + EEH_Template_Validator::verify_isnt_null($template_args['gateway_content'], '$gateway_content'); |
|
695 | + EEH_Template_Validator::verify_isnt_null($template_args['SPCO_payment_options_url'], '$SPCO_payment_options_url'); |
|
696 | + return EEH_Template::locate_template(THANK_YOU_TEMPLATES_PATH.'thank-you-page-payment-details.template.php', $template_args, TRUE, TRUE); |
|
697 | 697 | } |
698 | 698 | |
699 | 699 | |
@@ -705,11 +705,11 @@ discard block |
||
705 | 705 | * @param array $payments |
706 | 706 | * @return string |
707 | 707 | */ |
708 | - public function get_new_payments( $payments = array() ) { |
|
708 | + public function get_new_payments($payments = array()) { |
|
709 | 709 | $payments_html = ''; |
710 | 710 | //prepare variables for displaying |
711 | - foreach ( $payments as $payment ) { |
|
712 | - $payments_html .= $this->get_payment_row_html( $payment ); |
|
711 | + foreach ($payments as $payment) { |
|
712 | + $payments_html .= $this->get_payment_row_html($payment); |
|
713 | 713 | } |
714 | 714 | return $payments_html; |
715 | 715 | } |
@@ -113,7 +113,7 @@ discard block |
||
113 | 113 | /** |
114 | 114 | * get Price type |
115 | 115 | * @access public |
116 | - * @return int |
|
116 | + * @return boolean |
|
117 | 117 | */ |
118 | 118 | public function type() { |
119 | 119 | return $this->get( 'PRT_ID' ); |
@@ -124,7 +124,7 @@ discard block |
||
124 | 124 | /** |
125 | 125 | * get Price Amount |
126 | 126 | * @access public |
127 | - * @return float |
|
127 | + * @return boolean |
|
128 | 128 | */ |
129 | 129 | public function amount() { |
130 | 130 | return $this->get( 'PRC_amount' ); |
@@ -135,7 +135,7 @@ discard block |
||
135 | 135 | /** |
136 | 136 | * get Price Name |
137 | 137 | * @access public |
138 | - * @return string |
|
138 | + * @return boolean |
|
139 | 139 | */ |
140 | 140 | public function name() { |
141 | 141 | return $this->get( 'PRC_name' ); |
@@ -146,7 +146,7 @@ discard block |
||
146 | 146 | /** |
147 | 147 | * get Price description |
148 | 148 | * @access public |
149 | - * @return string |
|
149 | + * @return boolean |
|
150 | 150 | */ |
151 | 151 | public function desc() { |
152 | 152 | return $this->get( 'PRC_desc' ); |
@@ -157,7 +157,7 @@ discard block |
||
157 | 157 | /** |
158 | 158 | * get overrides |
159 | 159 | * @access public |
160 | - * @return int |
|
160 | + * @return boolean |
|
161 | 161 | */ |
162 | 162 | public function overrides() { |
163 | 163 | return $this->get( 'PRC_overrides' ); |
@@ -168,7 +168,7 @@ discard block |
||
168 | 168 | /** |
169 | 169 | * get order |
170 | 170 | * @access public |
171 | - * @return int |
|
171 | + * @return boolean |
|
172 | 172 | */ |
173 | 173 | public function order() { |
174 | 174 | return $this->get( 'PRC_order' ); |
@@ -181,7 +181,7 @@ discard block |
||
181 | 181 | * |
182 | 182 | * @since 4.5.0 |
183 | 183 | * |
184 | - * @return int |
|
184 | + * @return boolean |
|
185 | 185 | */ |
186 | 186 | public function wp_user() { |
187 | 187 | return $this->get('PRC_wp_user'); |
@@ -1,5 +1,5 @@ discard block |
||
1 | -<?php if ( !defined( 'EVENT_ESPRESSO_VERSION' ) ) { |
|
2 | - exit( 'No direct script access allowed' ); |
|
1 | +<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
2 | + exit('No direct script access allowed'); |
|
3 | 3 | } |
4 | 4 | /** |
5 | 5 | * Event Espresso |
@@ -32,9 +32,9 @@ discard block |
||
32 | 32 | * @param string $timezone |
33 | 33 | * @return EE_Price |
34 | 34 | */ |
35 | - public static function new_instance( $props_n_values = array(), $timezone = '' ) { |
|
36 | - $has_object = parent::_check_for_object( $props_n_values, __CLASS__ ); |
|
37 | - return $has_object ? $has_object : new self( $props_n_values, FALSE, $timezone ); |
|
35 | + public static function new_instance($props_n_values = array(), $timezone = '') { |
|
36 | + $has_object = parent::_check_for_object($props_n_values, __CLASS__); |
|
37 | + return $has_object ? $has_object : new self($props_n_values, FALSE, $timezone); |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | |
@@ -44,8 +44,8 @@ discard block |
||
44 | 44 | * @param string $timezone |
45 | 45 | * @return EE_Price |
46 | 46 | */ |
47 | - public static function new_instance_from_db( $props_n_values = array(), $timezone = '' ) { |
|
48 | - return new self( $props_n_values, TRUE, $timezone ); |
|
47 | + public static function new_instance_from_db($props_n_values = array(), $timezone = '') { |
|
48 | + return new self($props_n_values, TRUE, $timezone); |
|
49 | 49 | } |
50 | 50 | |
51 | 51 | |
@@ -56,8 +56,8 @@ discard block |
||
56 | 56 | * @access public |
57 | 57 | * @param int $PRT_ID |
58 | 58 | */ |
59 | - public function set_type( $PRT_ID = 0 ) { |
|
60 | - $this->set( 'PRT_ID', $PRT_ID ); |
|
59 | + public function set_type($PRT_ID = 0) { |
|
60 | + $this->set('PRT_ID', $PRT_ID); |
|
61 | 61 | } |
62 | 62 | |
63 | 63 | |
@@ -68,8 +68,8 @@ discard block |
||
68 | 68 | * @access public |
69 | 69 | * @param float $PRC_amount |
70 | 70 | */ |
71 | - public function set_amount( $PRC_amount = 0.00 ) { |
|
72 | - $this->set( 'PRC_amount', $PRC_amount ); |
|
71 | + public function set_amount($PRC_amount = 0.00) { |
|
72 | + $this->set('PRC_amount', $PRC_amount); |
|
73 | 73 | } |
74 | 74 | |
75 | 75 | |
@@ -80,8 +80,8 @@ discard block |
||
80 | 80 | * @access public |
81 | 81 | * @param string $PRC_name |
82 | 82 | */ |
83 | - public function set_name( $PRC_name = '' ) { |
|
84 | - $this->set( 'PRC_name', $PRC_name ); |
|
83 | + public function set_name($PRC_name = '') { |
|
84 | + $this->set('PRC_name', $PRC_name); |
|
85 | 85 | } |
86 | 86 | |
87 | 87 | |
@@ -92,8 +92,8 @@ discard block |
||
92 | 92 | * @access public |
93 | 93 | * @param string $PRC_desc |
94 | 94 | */ |
95 | - public function set_description( $PRC_desc = '' ) { |
|
96 | - $this->Set( 'PRC_desc', $PRC_desc ); |
|
95 | + public function set_description($PRC_desc = '') { |
|
96 | + $this->Set('PRC_desc', $PRC_desc); |
|
97 | 97 | } |
98 | 98 | |
99 | 99 | |
@@ -104,8 +104,8 @@ discard block |
||
104 | 104 | * @access public |
105 | 105 | * @param bool $PRC_deleted |
106 | 106 | */ |
107 | - public function set_deleted( $PRC_deleted = NULL ) { |
|
108 | - $this->set( 'PRC_deleted', $PRC_deleted ); |
|
107 | + public function set_deleted($PRC_deleted = NULL) { |
|
108 | + $this->set('PRC_deleted', $PRC_deleted); |
|
109 | 109 | } |
110 | 110 | |
111 | 111 | |
@@ -116,7 +116,7 @@ discard block |
||
116 | 116 | * @return int |
117 | 117 | */ |
118 | 118 | public function type() { |
119 | - return $this->get( 'PRT_ID' ); |
|
119 | + return $this->get('PRT_ID'); |
|
120 | 120 | } |
121 | 121 | |
122 | 122 | |
@@ -127,7 +127,7 @@ discard block |
||
127 | 127 | * @return float |
128 | 128 | */ |
129 | 129 | public function amount() { |
130 | - return $this->get( 'PRC_amount' ); |
|
130 | + return $this->get('PRC_amount'); |
|
131 | 131 | } |
132 | 132 | |
133 | 133 | |
@@ -138,7 +138,7 @@ discard block |
||
138 | 138 | * @return string |
139 | 139 | */ |
140 | 140 | public function name() { |
141 | - return $this->get( 'PRC_name' ); |
|
141 | + return $this->get('PRC_name'); |
|
142 | 142 | } |
143 | 143 | |
144 | 144 | |
@@ -149,7 +149,7 @@ discard block |
||
149 | 149 | * @return string |
150 | 150 | */ |
151 | 151 | public function desc() { |
152 | - return $this->get( 'PRC_desc' ); |
|
152 | + return $this->get('PRC_desc'); |
|
153 | 153 | } |
154 | 154 | |
155 | 155 | |
@@ -160,7 +160,7 @@ discard block |
||
160 | 160 | * @return int |
161 | 161 | */ |
162 | 162 | public function overrides() { |
163 | - return $this->get( 'PRC_overrides' ); |
|
163 | + return $this->get('PRC_overrides'); |
|
164 | 164 | } |
165 | 165 | |
166 | 166 | |
@@ -171,7 +171,7 @@ discard block |
||
171 | 171 | * @return int |
172 | 172 | */ |
173 | 173 | public function order() { |
174 | - return $this->get( 'PRC_order' ); |
|
174 | + return $this->get('PRC_order'); |
|
175 | 175 | } |
176 | 176 | |
177 | 177 | |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | * @return bool |
196 | 196 | */ |
197 | 197 | public function deleted() { |
198 | - return $this->get( 'PRC_deleted' ); |
|
198 | + return $this->get('PRC_deleted'); |
|
199 | 199 | } |
200 | 200 | |
201 | 201 | |
@@ -204,7 +204,7 @@ discard block |
||
204 | 204 | * @return bool |
205 | 205 | */ |
206 | 206 | public function parent() { |
207 | - return $this->get( 'PRC_parent' ); |
|
207 | + return $this->get('PRC_parent'); |
|
208 | 208 | } |
209 | 209 | |
210 | 210 | |
@@ -226,7 +226,7 @@ discard block |
||
226 | 226 | * @return EE_Price_Type |
227 | 227 | */ |
228 | 228 | public function type_obj() { |
229 | - return $this->get_first_related( 'Price_Type' ); |
|
229 | + return $this->get_first_related('Price_Type'); |
|
230 | 230 | } |
231 | 231 | |
232 | 232 | |
@@ -248,7 +248,7 @@ discard block |
||
248 | 248 | */ |
249 | 249 | public function is_percent() { |
250 | 250 | $price_type = $this->type_obj(); |
251 | - return $price_type->get( 'PRT_is_percent' ); |
|
251 | + return $price_type->get('PRT_is_percent'); |
|
252 | 252 | } |
253 | 253 | |
254 | 254 | |
@@ -260,7 +260,7 @@ discard block |
||
260 | 260 | * @return string |
261 | 261 | */ |
262 | 262 | public function pretty_price() { |
263 | - return ! $this->is_percent() ? $this->get_pretty('PRC_amount') : $this->get('PRC_amount') . '%'; |
|
263 | + return ! $this->is_percent() ? $this->get_pretty('PRC_amount') : $this->get('PRC_amount').'%'; |
|
264 | 264 | } |
265 | 265 | |
266 | 266 | |
@@ -269,7 +269,7 @@ discard block |
||
269 | 269 | * @return mixed |
270 | 270 | */ |
271 | 271 | public function get_price_without_currency_symbol() { |
272 | - return str_replace( EE_Registry::instance()->CFG->currency->sign, '', $this->get_pretty( 'PRC_amount' ) ); |
|
272 | + return str_replace(EE_Registry::instance()->CFG->currency->sign, '', $this->get_pretty('PRC_amount')); |
|
273 | 273 | } |
274 | 274 | } |
275 | 275 |
@@ -99,11 +99,11 @@ |
||
99 | 99 | |
100 | 100 | |
101 | 101 | /** |
102 | - * set deleted |
|
103 | - * |
|
104 | - * @access public |
|
105 | - * @param bool $PRC_deleted |
|
106 | - */ |
|
102 | + * set deleted |
|
103 | + * |
|
104 | + * @access public |
|
105 | + * @param bool $PRC_deleted |
|
106 | + */ |
|
107 | 107 | public function set_deleted( $PRC_deleted = NULL ) { |
108 | 108 | $this->set( 'PRC_deleted', $PRC_deleted ); |
109 | 109 | } |
@@ -30,7 +30,7 @@ discard block |
||
30 | 30 | |
31 | 31 | /** |
32 | 32 | * @param array $props_n_values |
33 | - * @return EE_Question|mixed |
|
33 | + * @return null|EE_Question |
|
34 | 34 | */ |
35 | 35 | public static function new_instance( $props_n_values = array() ) { |
36 | 36 | $has_object = parent::_check_for_object( $props_n_values, __CLASS__ ); |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | /** |
178 | 178 | * returns the text for displaying the question to users |
179 | 179 | * @access public |
180 | - * @return string |
|
180 | + * @return boolean |
|
181 | 181 | */ |
182 | 182 | public function display_text() { |
183 | 183 | return $this->get( 'QST_display_text' ); |
@@ -188,7 +188,7 @@ discard block |
||
188 | 188 | /** |
189 | 189 | * returns the text for the administrative label |
190 | 190 | * @access public |
191 | - * @return string |
|
191 | + * @return boolean |
|
192 | 192 | */ |
193 | 193 | public function admin_label() { |
194 | 194 | return $this->get( 'QST_admin_label' ); |
@@ -199,7 +199,7 @@ discard block |
||
199 | 199 | /** |
200 | 200 | * returns the attendee column name for this question |
201 | 201 | * @access public |
202 | - * @return string |
|
202 | + * @return boolean |
|
203 | 203 | */ |
204 | 204 | public function system_ID() { |
205 | 205 | return $this->get( 'QST_system' ); |
@@ -222,7 +222,7 @@ discard block |
||
222 | 222 | * returns the text which should be displayed when a user |
223 | 223 | * doesn't answer this question in a form |
224 | 224 | * @access public |
225 | - * @return string |
|
225 | + * @return boolean |
|
226 | 226 | */ |
227 | 227 | public function required_text() { |
228 | 228 | return $this->get( 'QST_required_text' ); |
@@ -233,7 +233,7 @@ discard block |
||
233 | 233 | /** |
234 | 234 | * returns the type of this question |
235 | 235 | * @access public |
236 | - * @return string |
|
236 | + * @return boolean |
|
237 | 237 | */ |
238 | 238 | public function type() { |
239 | 239 | return $this->get( 'QST_type' ); |
@@ -245,7 +245,7 @@ discard block |
||
245 | 245 | * returns an integer showing where this question should |
246 | 246 | * be placed in a sequence of questions |
247 | 247 | * @access public |
248 | - * @return int |
|
248 | + * @return boolean |
|
249 | 249 | */ |
250 | 250 | public function order() { |
251 | 251 | return $this->get( 'QST_order' ); |
@@ -268,7 +268,7 @@ discard block |
||
268 | 268 | /** |
269 | 269 | * returns the id the wordpress user who created this question |
270 | 270 | * @access public |
271 | - * @return int |
|
271 | + * @return boolean |
|
272 | 272 | */ |
273 | 273 | public function wp_user() { |
274 | 274 | return $this->get( 'QST_wp_user' ); |
@@ -362,7 +362,7 @@ discard block |
||
362 | 362 | * Adds an option for this question. Note: if the option were previously associated with a different |
363 | 363 | * Question, that relationship will be overwritten. |
364 | 364 | * @param EE_Question_Option $option |
365 | - * @return boolean success |
|
365 | + * @return EE_Base_Class success |
|
366 | 366 | */ |
367 | 367 | public function add_option( EE_Question_Option $option ) { |
368 | 368 | return $this->_add_relation_to( $option, 'Question_Option' ); |
@@ -385,7 +385,7 @@ discard block |
||
385 | 385 | /** |
386 | 386 | * Marks the option as deleted. |
387 | 387 | * @param EE_Question_Option $option |
388 | - * @return boolean success |
|
388 | + * @return EE_Base_Class success |
|
389 | 389 | */ |
390 | 390 | public function remove_option( EE_Question_Option $option ) { |
391 | 391 | return $this->_remove_relation_to( $option, 'Question_Option' ); |
@@ -1,5 +1,5 @@ discard block |
||
1 | -<?php if ( !defined( 'EVENT_ESPRESSO_VERSION' ) ) { |
|
2 | - exit( 'No direct script access allowed' ); |
|
1 | +<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
2 | + exit('No direct script access allowed'); |
|
3 | 3 | } |
4 | 4 | /** |
5 | 5 | * Event Espresso |
@@ -32,9 +32,9 @@ discard block |
||
32 | 32 | * @param array $props_n_values |
33 | 33 | * @return EE_Question|mixed |
34 | 34 | */ |
35 | - public static function new_instance( $props_n_values = array() ) { |
|
36 | - $has_object = parent::_check_for_object( $props_n_values, __CLASS__ ); |
|
37 | - return $has_object ? $has_object : new self( $props_n_values ); |
|
35 | + public static function new_instance($props_n_values = array()) { |
|
36 | + $has_object = parent::_check_for_object($props_n_values, __CLASS__); |
|
37 | + return $has_object ? $has_object : new self($props_n_values); |
|
38 | 38 | } |
39 | 39 | |
40 | 40 | |
@@ -43,8 +43,8 @@ discard block |
||
43 | 43 | * @param array $props_n_values |
44 | 44 | * @return EE_Question |
45 | 45 | */ |
46 | - public static function new_instance_from_db( $props_n_values = array() ) { |
|
47 | - return new self( $props_n_values, TRUE ); |
|
46 | + public static function new_instance_from_db($props_n_values = array()) { |
|
47 | + return new self($props_n_values, TRUE); |
|
48 | 48 | } |
49 | 49 | |
50 | 50 | |
@@ -55,8 +55,8 @@ discard block |
||
55 | 55 | * @access public |
56 | 56 | * @param string $QST_display_text |
57 | 57 | */ |
58 | - public function set_display_text( $QST_display_text = '' ) { |
|
59 | - $this->set( 'QST_display_text', $QST_display_text ); |
|
58 | + public function set_display_text($QST_display_text = '') { |
|
59 | + $this->set('QST_display_text', $QST_display_text); |
|
60 | 60 | } |
61 | 61 | |
62 | 62 | |
@@ -67,8 +67,8 @@ discard block |
||
67 | 67 | * @access public |
68 | 68 | * @param string $QST_admin_label |
69 | 69 | */ |
70 | - public function set_admin_label( $QST_admin_label = '' ) { |
|
71 | - $this->set( 'QST_admin_label', $QST_admin_label ); |
|
70 | + public function set_admin_label($QST_admin_label = '') { |
|
71 | + $this->set('QST_admin_label', $QST_admin_label); |
|
72 | 72 | } |
73 | 73 | |
74 | 74 | |
@@ -79,8 +79,8 @@ discard block |
||
79 | 79 | * @access public |
80 | 80 | * @param mixed $QST_system |
81 | 81 | */ |
82 | - public function set_system_ID( $QST_system = '' ) { |
|
83 | - $this->set( 'QST_system', $QST_system ); |
|
82 | + public function set_system_ID($QST_system = '') { |
|
83 | + $this->set('QST_system', $QST_system); |
|
84 | 84 | } |
85 | 85 | |
86 | 86 | |
@@ -91,8 +91,8 @@ discard block |
||
91 | 91 | * @access public |
92 | 92 | * @param string $QST_type |
93 | 93 | */ |
94 | - public function set_question_type( $QST_type = '' ) { |
|
95 | - $this->set( 'QST_type', $QST_type ); |
|
94 | + public function set_question_type($QST_type = '') { |
|
95 | + $this->set('QST_type', $QST_type); |
|
96 | 96 | } |
97 | 97 | |
98 | 98 | |
@@ -103,8 +103,8 @@ discard block |
||
103 | 103 | * @access public |
104 | 104 | * @param bool $QST_required |
105 | 105 | */ |
106 | - public function set_required( $QST_required = FALSE ) { |
|
107 | - $this->set( 'QST_required', $QST_required ); |
|
106 | + public function set_required($QST_required = FALSE) { |
|
107 | + $this->set('QST_required', $QST_required); |
|
108 | 108 | } |
109 | 109 | |
110 | 110 | |
@@ -115,8 +115,8 @@ discard block |
||
115 | 115 | * @access public |
116 | 116 | * @param string $QST_required_text |
117 | 117 | */ |
118 | - public function set_required_text( $QST_required_text = '' ) { |
|
119 | - $this->set( 'QST_required_text', $QST_required_text ); |
|
118 | + public function set_required_text($QST_required_text = '') { |
|
119 | + $this->set('QST_required_text', $QST_required_text); |
|
120 | 120 | } |
121 | 121 | |
122 | 122 | |
@@ -127,8 +127,8 @@ discard block |
||
127 | 127 | * @access public |
128 | 128 | * @param int $QST_order |
129 | 129 | */ |
130 | - public function set_order( $QST_order = 0 ) { |
|
131 | - $this->set( 'QST_order', $QST_order ); |
|
130 | + public function set_order($QST_order = 0) { |
|
131 | + $this->set('QST_order', $QST_order); |
|
132 | 132 | } |
133 | 133 | |
134 | 134 | |
@@ -139,8 +139,8 @@ discard block |
||
139 | 139 | * @access public |
140 | 140 | * @param bool $QST_admin_only |
141 | 141 | */ |
142 | - public function set_admin_only( $QST_admin_only = FALSE ) { |
|
143 | - $this->set( 'QST_admin_only', $QST_admin_only ); |
|
142 | + public function set_admin_only($QST_admin_only = FALSE) { |
|
143 | + $this->set('QST_admin_only', $QST_admin_only); |
|
144 | 144 | } |
145 | 145 | |
146 | 146 | |
@@ -151,8 +151,8 @@ discard block |
||
151 | 151 | * @access public |
152 | 152 | * @param int $QST_wp_user |
153 | 153 | */ |
154 | - public function set_wp_user( $QST_wp_user = 1 ) { |
|
155 | - $this->set( 'QST_wp_user', $QST_wp_user ); |
|
154 | + public function set_wp_user($QST_wp_user = 1) { |
|
155 | + $this->set('QST_wp_user', $QST_wp_user); |
|
156 | 156 | } |
157 | 157 | |
158 | 158 | |
@@ -168,8 +168,8 @@ discard block |
||
168 | 168 | * @access public |
169 | 169 | * @param bool $QST_deleted |
170 | 170 | */ |
171 | - public function set_deleted( $QST_deleted = FALSE ) { |
|
172 | - $this->set( 'QST_deleted', $QST_deleted ); |
|
171 | + public function set_deleted($QST_deleted = FALSE) { |
|
172 | + $this->set('QST_deleted', $QST_deleted); |
|
173 | 173 | } |
174 | 174 | |
175 | 175 | |
@@ -180,7 +180,7 @@ discard block |
||
180 | 180 | * @return string |
181 | 181 | */ |
182 | 182 | public function display_text() { |
183 | - return $this->get( 'QST_display_text' ); |
|
183 | + return $this->get('QST_display_text'); |
|
184 | 184 | } |
185 | 185 | |
186 | 186 | |
@@ -191,7 +191,7 @@ discard block |
||
191 | 191 | * @return string |
192 | 192 | */ |
193 | 193 | public function admin_label() { |
194 | - return $this->get( 'QST_admin_label' ); |
|
194 | + return $this->get('QST_admin_label'); |
|
195 | 195 | } |
196 | 196 | |
197 | 197 | |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | * @return string |
203 | 203 | */ |
204 | 204 | public function system_ID() { |
205 | - return $this->get( 'QST_system' ); |
|
205 | + return $this->get('QST_system'); |
|
206 | 206 | } |
207 | 207 | |
208 | 208 | |
@@ -213,7 +213,7 @@ discard block |
||
213 | 213 | * @return boolean |
214 | 214 | */ |
215 | 215 | public function required() { |
216 | - return $this->get( 'QST_required' ); |
|
216 | + return $this->get('QST_required'); |
|
217 | 217 | } |
218 | 218 | |
219 | 219 | |
@@ -225,7 +225,7 @@ discard block |
||
225 | 225 | * @return string |
226 | 226 | */ |
227 | 227 | public function required_text() { |
228 | - return $this->get( 'QST_required_text' ); |
|
228 | + return $this->get('QST_required_text'); |
|
229 | 229 | } |
230 | 230 | |
231 | 231 | |
@@ -236,7 +236,7 @@ discard block |
||
236 | 236 | * @return string |
237 | 237 | */ |
238 | 238 | public function type() { |
239 | - return $this->get( 'QST_type' ); |
|
239 | + return $this->get('QST_type'); |
|
240 | 240 | } |
241 | 241 | |
242 | 242 | |
@@ -248,7 +248,7 @@ discard block |
||
248 | 248 | * @return int |
249 | 249 | */ |
250 | 250 | public function order() { |
251 | - return $this->get( 'QST_order' ); |
|
251 | + return $this->get('QST_order'); |
|
252 | 252 | } |
253 | 253 | |
254 | 254 | |
@@ -260,7 +260,7 @@ discard block |
||
260 | 260 | * @return boolean |
261 | 261 | */ |
262 | 262 | public function admin_only() { |
263 | - return $this->get( 'QST_admin_only' ); |
|
263 | + return $this->get('QST_admin_only'); |
|
264 | 264 | } |
265 | 265 | |
266 | 266 | |
@@ -271,7 +271,7 @@ discard block |
||
271 | 271 | * @return int |
272 | 272 | */ |
273 | 273 | public function wp_user() { |
274 | - return $this->get( 'QST_wp_user' ); |
|
274 | + return $this->get('QST_wp_user'); |
|
275 | 275 | } |
276 | 276 | |
277 | 277 | |
@@ -282,7 +282,7 @@ discard block |
||
282 | 282 | * @return boolean |
283 | 283 | */ |
284 | 284 | public function deleted() { |
285 | - return $this->get( 'QST_deleted' ); |
|
285 | + return $this->get('QST_deleted'); |
|
286 | 286 | } |
287 | 287 | |
288 | 288 | |
@@ -292,7 +292,7 @@ discard block |
||
292 | 292 | * @return EE_Answer[] |
293 | 293 | */ |
294 | 294 | public function answers() { |
295 | - return $this->get_many_related( 'Answer' ); |
|
295 | + return $this->get_many_related('Answer'); |
|
296 | 296 | } |
297 | 297 | |
298 | 298 | |
@@ -302,7 +302,7 @@ discard block |
||
302 | 302 | * @return boolean true = has answers, false = no answers. |
303 | 303 | */ |
304 | 304 | public function has_answers() { |
305 | - return $this->count_related( 'Answer' ) > 0 ? TRUE : FALSE; |
|
305 | + return $this->count_related('Answer') > 0 ? TRUE : FALSE; |
|
306 | 306 | } |
307 | 307 | |
308 | 308 | |
@@ -312,7 +312,7 @@ discard block |
||
312 | 312 | * @return EE_Question_Group[] |
313 | 313 | */ |
314 | 314 | public function question_groups() { |
315 | - return $this->get_many_related( 'Question_Group' ); |
|
315 | + return $this->get_many_related('Question_Group'); |
|
316 | 316 | } |
317 | 317 | |
318 | 318 | |
@@ -326,24 +326,24 @@ discard block |
||
326 | 326 | * whether it was trashed or not. |
327 | 327 | * @return EE_Question_Option[] |
328 | 328 | */ |
329 | - public function options( $notDeletedOptionsOnly = TRUE, $selected_value_to_always_include = NULL ) { |
|
330 | - if ( ! $this->ID() ) { |
|
329 | + public function options($notDeletedOptionsOnly = TRUE, $selected_value_to_always_include = NULL) { |
|
330 | + if ( ! $this->ID()) { |
|
331 | 331 | return array(); |
332 | 332 | } |
333 | 333 | $query_params = array(); |
334 | - if ( $selected_value_to_always_include ) { |
|
335 | - if ( is_array( $selected_value_to_always_include ) ) { |
|
336 | - $query_params[ 0 ][ 'OR*options-query' ][ 'QSO_value' ] = array( 'IN', $selected_value_to_always_include ); |
|
334 | + if ($selected_value_to_always_include) { |
|
335 | + if (is_array($selected_value_to_always_include)) { |
|
336 | + $query_params[0]['OR*options-query']['QSO_value'] = array('IN', $selected_value_to_always_include); |
|
337 | 337 | } else { |
338 | - $query_params[ 0 ][ 'OR*options-query' ][ 'QSO_value' ] = $selected_value_to_always_include; |
|
338 | + $query_params[0]['OR*options-query']['QSO_value'] = $selected_value_to_always_include; |
|
339 | 339 | } |
340 | 340 | } |
341 | - if ( $notDeletedOptionsOnly ) { |
|
342 | - $query_params[ 0 ][ 'OR*options-query' ][ 'QSO_deleted' ] = FALSE; |
|
341 | + if ($notDeletedOptionsOnly) { |
|
342 | + $query_params[0]['OR*options-query']['QSO_deleted'] = FALSE; |
|
343 | 343 | } |
344 | 344 | //order by QSO_order |
345 | - $query_params[ 'order_by' ] = array( 'QSO_order' => 'ASC' ); |
|
346 | - return $this->get_many_related( 'Question_Option', $query_params ); |
|
345 | + $query_params['order_by'] = array('QSO_order' => 'ASC'); |
|
346 | + return $this->get_many_related('Question_Option', $query_params); |
|
347 | 347 | } |
348 | 348 | |
349 | 349 | |
@@ -353,7 +353,7 @@ discard block |
||
353 | 353 | * @return \EE_Question_Option[] |
354 | 354 | */ |
355 | 355 | public function temp_options() { |
356 | - return $this->_model_relations[ 'Question_Option' ]; |
|
356 | + return $this->_model_relations['Question_Option']; |
|
357 | 357 | } |
358 | 358 | |
359 | 359 | |
@@ -364,8 +364,8 @@ discard block |
||
364 | 364 | * @param EE_Question_Option $option |
365 | 365 | * @return boolean success |
366 | 366 | */ |
367 | - public function add_option( EE_Question_Option $option ) { |
|
368 | - return $this->_add_relation_to( $option, 'Question_Option' ); |
|
367 | + public function add_option(EE_Question_Option $option) { |
|
368 | + return $this->_add_relation_to($option, 'Question_Option'); |
|
369 | 369 | } |
370 | 370 | |
371 | 371 | |
@@ -375,8 +375,8 @@ discard block |
||
375 | 375 | * @param EE_Question_Option $option |
376 | 376 | * @return boolean success |
377 | 377 | */ |
378 | - public function add_temp_option( EE_Question_Option $option ) { |
|
379 | - $this->_model_relations[ 'Question_Option' ][ ] = $option; |
|
378 | + public function add_temp_option(EE_Question_Option $option) { |
|
379 | + $this->_model_relations['Question_Option'][] = $option; |
|
380 | 380 | return TRUE; |
381 | 381 | } |
382 | 382 | |
@@ -387,8 +387,8 @@ discard block |
||
387 | 387 | * @param EE_Question_Option $option |
388 | 388 | * @return boolean success |
389 | 389 | */ |
390 | - public function remove_option( EE_Question_Option $option ) { |
|
391 | - return $this->_remove_relation_to( $option, 'Question_Option' ); |
|
390 | + public function remove_option(EE_Question_Option $option) { |
|
391 | + return $this->_remove_relation_to($option, 'Question_Option'); |
|
392 | 392 | } |
393 | 393 | |
394 | 394 | |
@@ -397,8 +397,8 @@ discard block |
||
397 | 397 | * @return bool |
398 | 398 | */ |
399 | 399 | public function is_system_question() { |
400 | - $system_ID = $this->get( 'QST_system' ); |
|
401 | - return ! empty( $system_ID ) ? TRUE : FALSE; |
|
400 | + $system_ID = $this->get('QST_system'); |
|
401 | + return ! empty($system_ID) ? TRUE : FALSE; |
|
402 | 402 | } |
403 | 403 | |
404 | 404 | |
@@ -411,8 +411,8 @@ discard block |
||
411 | 411 | */ |
412 | 412 | public function set_order_to_latest() { |
413 | 413 | $latest_order = $this->get_model()->get_latest_question_order(); |
414 | - $latest_order ++; |
|
415 | - $this->set( 'QST_order', $latest_order ); |
|
414 | + $latest_order++; |
|
415 | + $this->set('QST_order', $latest_order); |
|
416 | 416 | } |
417 | 417 | |
418 | 418 |