@@ -1,22 +1,22 @@ |
||
1 | 1 | <?php |
2 | 2 | //required variables for template: |
3 | 3 | assert($question_group instanceof EE_Question_Group); |
4 | -assert(isset($all_questions) && (empty($all_questions) || is_array($all_questions)));//list of unused questions |
|
5 | -foreach($all_questions as $question_option){ |
|
4 | +assert(isset($all_questions) && (empty($all_questions) || is_array($all_questions))); //list of unused questions |
|
5 | +foreach ($all_questions as $question_option) { |
|
6 | 6 | assert($question_option); |
7 | 7 | assert($question_option instanceof EE_Question); |
8 | 8 | } |
9 | 9 | ?> |
10 | -<h4><?php _e('Check off all questions that you wish to appear in this group.','event_espresso');?></h4> |
|
10 | +<h4><?php _e('Check off all questions that you wish to appear in this group.', 'event_espresso'); ?></h4> |
|
11 | 11 | <ul> |
12 | 12 | <?php |
13 | - foreach( $all_questions as $question_ID=>$question ){ |
|
13 | + foreach ($all_questions as $question_ID=>$question) { |
|
14 | 14 | /*@var $question EE_Question*/ |
15 | - $checked = array_key_exists( $question_ID, $question_group->questions() ) ? ' checked="checked"' : ''; |
|
15 | + $checked = array_key_exists($question_ID, $question_group->questions()) ? ' checked="checked"' : ''; |
|
16 | 16 | ?> |
17 | 17 | <li> |
18 | 18 | <label for="question-<?php echo $question_ID?>"> |
19 | - <input type="checkbox" name="questions[<?php echo $question_ID;?>]" id="question-<?php echo $question_ID;?>" value="<?php echo $question_ID;?>"<?php echo $checked;?>/> |
|
19 | + <input type="checkbox" name="questions[<?php echo $question_ID; ?>]" id="question-<?php echo $question_ID; ?>" value="<?php echo $question_ID; ?>"<?php echo $checked; ?>/> |
|
20 | 20 | <?php echo $question->display_text()?> |
21 | 21 | </label> |
22 | 22 | </li> |
@@ -1,3 +1,3 @@ |
||
1 | 1 | <div class="padding"> |
2 | - <?php do_action( 'AHEE__Extend_Registration_Form_Admin_Page___reg_form_settings_template' ); ?> |
|
2 | + <?php do_action('AHEE__Extend_Registration_Form_Admin_Page___reg_form_settings_template'); ?> |
|
3 | 3 | </div> |
@@ -1,4 +1,6 @@ discard block |
||
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 | * |
@@ -123,8 +125,9 @@ discard block |
||
123 | 125 | } |
124 | 126 | |
125 | 127 | //if no reg id then get out cause need a reg id |
126 | - if ( empty( $REG_ID ) || empty( $DTT_ID ) ) |
|
127 | - throw new EE_Error(__('This route cannot be viewed unless registration and datetime IDs are included in the request (via REG_ID and DTT_ID parameters)', 'event_espresso') ); |
|
128 | + if ( empty( $REG_ID ) || empty( $DTT_ID ) ) { |
|
129 | + throw new EE_Error(__('This route cannot be viewed unless registration and datetime IDs are included in the request (via REG_ID and DTT_ID parameters)', 'event_espresso') ); |
|
130 | + } |
|
128 | 131 | |
129 | 132 | //set orderby |
130 | 133 | $orderby = 'CHK_timestamp'; //note that with this table we're only providing the option to orderby the timestamp value. |
@@ -147,8 +150,9 @@ discard block |
||
147 | 150 | $query_params = array( $_where, 'order_by' => array( $orderby => $order ), 'limit' => $limit ); |
148 | 151 | |
149 | 152 | //if no per_page value then we just want to return a count of all Check-ins |
150 | - if ( $count ) |
|
151 | - return EEM_Checkin::instance()->count( array( $_where ) ); |
|
153 | + if ( $count ) { |
|
154 | + return EEM_Checkin::instance()->count( array( $_where ) ); |
|
155 | + } |
|
152 | 156 | |
153 | 157 | return $count ? EEM_Checkin::instance()->count( array( $_where ) ) : EEM_Checkin::instance()->get_all($query_params); |
154 | 158 | } |
@@ -28,7 +28,7 @@ discard block |
||
28 | 28 | |
29 | 29 | |
30 | 30 | |
31 | - public function __construct( $admin_page ) { |
|
31 | + public function __construct($admin_page) { |
|
32 | 32 | parent::__construct($admin_page); |
33 | 33 | } |
34 | 34 | |
@@ -36,8 +36,8 @@ discard block |
||
36 | 36 | |
37 | 37 | |
38 | 38 | protected function _setup_data() { |
39 | - $this->_data = $this->_get_checkins( $this->_per_page ); |
|
40 | - $this->_all_data_count = $this->_get_checkins( $this->_per_page, TRUE ); |
|
39 | + $this->_data = $this->_get_checkins($this->_per_page); |
|
40 | + $this->_all_data_count = $this->_get_checkins($this->_per_page, TRUE); |
|
41 | 41 | } |
42 | 42 | |
43 | 43 | |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | ); |
59 | 59 | |
60 | 60 | $this->_sortable_columns = array( |
61 | - 'CHK_timestamp' => array( 'CHK_timestamp' => TRUE ) |
|
61 | + 'CHK_timestamp' => array('CHK_timestamp' => TRUE) |
|
62 | 62 | ); |
63 | 63 | |
64 | 64 | $this->_primary_column = 'CHK_in'; |
@@ -82,25 +82,25 @@ discard block |
||
82 | 82 | } |
83 | 83 | |
84 | 84 | |
85 | - function column_cb($item ) { |
|
86 | - return sprintf( '<input type="checkbox" name="checkbox[%1$s]" />', $item->ID() ); |
|
85 | + function column_cb($item) { |
|
86 | + return sprintf('<input type="checkbox" name="checkbox[%1$s]" />', $item->ID()); |
|
87 | 87 | } |
88 | 88 | |
89 | 89 | |
90 | - function column_CHK_in( EE_Checkin $item ) { |
|
90 | + function column_CHK_in(EE_Checkin $item) { |
|
91 | 91 | $checkinstatus = $item->get('CHK_in'); |
92 | 92 | $checkinstatus = $checkinstatus ? EE_Registration::checkin_status_in : EE_Registration::checkin_status_out; |
93 | - return '<span class="checkin-icons checkedin-status-' . $checkinstatus . '"></span><span class="show-on-mobile-view-only">' . $item->get_datetime('CHK_timestamp') . '</span>'; |
|
93 | + return '<span class="checkin-icons checkedin-status-'.$checkinstatus.'"></span><span class="show-on-mobile-view-only">'.$item->get_datetime('CHK_timestamp').'</span>'; |
|
94 | 94 | } |
95 | 95 | |
96 | 96 | |
97 | 97 | |
98 | - function column_CHK_timestamp( EE_Checkin $item ) { |
|
98 | + function column_CHK_timestamp(EE_Checkin $item) { |
|
99 | 99 | $actions = array(); |
100 | - $delete_url = EE_Admin_Page::add_query_args_and_nonce( array('action' => 'delete_checkin_row', 'DTT_ID' => $this->_req_data['DTT_ID'], '_REGID' => $this->_req_data['_REGID'], 'CHK_ID' => $item->ID() ) ); |
|
101 | - $actions['delete_checkin'] = EE_Registry::instance()->CAP->current_user_can( 'ee_delete_checkins', 'espresso_registrations_delete_checkin_row' ) ? '<a href="' . $delete_url . '" title="' . esc_attr__('Click here to delete this check-in record', 'event_espresso') . '">' . __('Delete', 'event_espresso') . '</a>' : ''; |
|
100 | + $delete_url = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'delete_checkin_row', 'DTT_ID' => $this->_req_data['DTT_ID'], '_REGID' => $this->_req_data['_REGID'], 'CHK_ID' => $item->ID())); |
|
101 | + $actions['delete_checkin'] = EE_Registry::instance()->CAP->current_user_can('ee_delete_checkins', 'espresso_registrations_delete_checkin_row') ? '<a href="'.$delete_url.'" title="'.esc_attr__('Click here to delete this check-in record', 'event_espresso').'">'.__('Delete', 'event_espresso').'</a>' : ''; |
|
102 | 102 | |
103 | - return sprintf( '%1$s %2$s', $item->get_datetime('CHK_timestamp'), $this->row_actions($actions) ); |
|
103 | + return sprintf('%1$s %2$s', $item->get_datetime('CHK_timestamp'), $this->row_actions($actions)); |
|
104 | 104 | } |
105 | 105 | |
106 | 106 | |
@@ -115,30 +115,30 @@ discard block |
||
115 | 115 | * @param bool $count Whether to return a count or not |
116 | 116 | * @return EE_Checkin[]|int |
117 | 117 | */ |
118 | - protected function _get_checkins( $per_page = 10, $count = FALSE ) { |
|
119 | - $REG_ID = isset( $this->_req_data['_REGID'] ) ? $this->_req_data['_REGID'] : FALSE; |
|
120 | - $DTT_ID = isset( $this->_req_data['DTT_ID'] ) ? $this->_req_data['DTT_ID'] : FALSE; |
|
118 | + protected function _get_checkins($per_page = 10, $count = FALSE) { |
|
119 | + $REG_ID = isset($this->_req_data['_REGID']) ? $this->_req_data['_REGID'] : FALSE; |
|
120 | + $DTT_ID = isset($this->_req_data['DTT_ID']) ? $this->_req_data['DTT_ID'] : FALSE; |
|
121 | 121 | |
122 | 122 | //if user does not have the capability for the checkins for this registration then get out! |
123 | - if ( ! EE_Registry::instance()->CAP->current_user_can( 'ee_read_checkin', 'espresso_registrations_registration_checkins', $REG_ID ) ) { |
|
123 | + if ( ! EE_Registry::instance()->CAP->current_user_can('ee_read_checkin', 'espresso_registrations_registration_checkins', $REG_ID)) { |
|
124 | 124 | return $count ? 0 : array(); |
125 | 125 | } |
126 | 126 | |
127 | 127 | //if no reg id then get out cause need a reg id |
128 | - if ( empty( $REG_ID ) || empty( $DTT_ID ) ) |
|
129 | - throw new EE_Error(__('This route cannot be viewed unless registration and datetime IDs are included in the request (via REG_ID and DTT_ID parameters)', 'event_espresso') ); |
|
128 | + if (empty($REG_ID) || empty($DTT_ID)) |
|
129 | + throw new EE_Error(__('This route cannot be viewed unless registration and datetime IDs are included in the request (via REG_ID and DTT_ID parameters)', 'event_espresso')); |
|
130 | 130 | |
131 | 131 | //set orderby |
132 | 132 | $orderby = 'CHK_timestamp'; //note that with this table we're only providing the option to orderby the timestamp value. |
133 | 133 | |
134 | - $order = !empty( $this->_req_data['order'] ) ? $this->_req_data['order'] : 'ASC'; |
|
134 | + $order = ! empty($this->_req_data['order']) ? $this->_req_data['order'] : 'ASC'; |
|
135 | 135 | |
136 | - $current_page = isset( $this->_req_data['paged'] ) && !empty( $this->_req_data['paged'] ) ? $this->_req_data['paged'] : 1; |
|
137 | - $per_page = isset( $this->_req_data['perpage'] ) && !empty( $this->_req_data['perpage'] ) ? $this->_req_data['perpage'] : $per_page; |
|
136 | + $current_page = isset($this->_req_data['paged']) && ! empty($this->_req_data['paged']) ? $this->_req_data['paged'] : 1; |
|
137 | + $per_page = isset($this->_req_data['perpage']) && ! empty($this->_req_data['perpage']) ? $this->_req_data['perpage'] : $per_page; |
|
138 | 138 | $limit = NULL; |
139 | - if ( !$count ) { |
|
140 | - $offset = ($current_page-1)*$per_page; |
|
141 | - $limit = array( $offset, $per_page ); |
|
139 | + if ( ! $count) { |
|
140 | + $offset = ($current_page - 1) * $per_page; |
|
141 | + $limit = array($offset, $per_page); |
|
142 | 142 | } |
143 | 143 | |
144 | 144 | $_where = array( |
@@ -146,13 +146,13 @@ discard block |
||
146 | 146 | 'DTT_ID' => $DTT_ID |
147 | 147 | ); |
148 | 148 | |
149 | - $query_params = array( $_where, 'order_by' => array( $orderby => $order ), 'limit' => $limit ); |
|
149 | + $query_params = array($_where, 'order_by' => array($orderby => $order), 'limit' => $limit); |
|
150 | 150 | |
151 | 151 | //if no per_page value then we just want to return a count of all Check-ins |
152 | - if ( $count ) |
|
153 | - return EEM_Checkin::instance()->count( array( $_where ) ); |
|
152 | + if ($count) |
|
153 | + return EEM_Checkin::instance()->count(array($_where)); |
|
154 | 154 | |
155 | - return $count ? EEM_Checkin::instance()->count( array( $_where ) ) : EEM_Checkin::instance()->get_all($query_params); |
|
155 | + return $count ? EEM_Checkin::instance()->count(array($_where)) : EEM_Checkin::instance()->get_all($query_params); |
|
156 | 156 | } |
157 | 157 | |
158 | 158 | } //end class EE_Registration_CheckIn_List_Table |
@@ -1,6 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
2 | +if (!defined('EVENT_ESPRESSO_VERSION') ) { |
|
3 | 3 | exit('NO direct script access allowed'); |
4 | +} |
|
4 | 5 | |
5 | 6 | /** |
6 | 7 | * Event Espresso |
@@ -679,8 +680,9 @@ discard block |
||
679 | 680 | EE_Error::add_error(__('Missing some required data to toggle the Check-in', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ ); |
680 | 681 | } |
681 | 682 | |
682 | - if ( defined('DOING_AJAX' ) ) |
|
683 | - return $new_status; |
|
683 | + if ( defined('DOING_AJAX' ) ) { |
|
684 | + return $new_status; |
|
685 | + } |
|
684 | 686 | |
685 | 687 | $this->_redirect_after_action( FALSE,'', '', $query_args, TRUE ); |
686 | 688 | |
@@ -918,7 +920,7 @@ discard block |
||
918 | 920 | $query_params['force_join'] = array('Attendee');//force join to attendee model so that it gets cached, because we're going to need the attendee for each registration |
919 | 921 | if($count){ |
920 | 922 | $registrations = EEM_Registration::instance()->count(array($query_params[0])); |
921 | - }else{ |
|
923 | + } else{ |
|
922 | 924 | $registrations = EEM_Registration::instance()->get_all($query_params); |
923 | 925 | |
924 | 926 |
@@ -631,8 +631,6 @@ |
||
631 | 631 | /** |
632 | 632 | * handles toggleing the checkin status for the registration, |
633 | 633 | * @access protected |
634 | - * @param boolean $check_in |
|
635 | - * @return void |
|
636 | 634 | */ |
637 | 635 | protected function _toggle_checkin_status() { |
638 | 636 | //first let's get the query args out of the way for the redirect |
@@ -506,9 +506,9 @@ discard block |
||
506 | 506 | |
507 | 507 | /** |
508 | 508 | * generates Business Reports regarding Registrations |
509 | - * @access protected |
|
510 | - * @return void |
|
511 | - */ |
|
509 | + * @access protected |
|
510 | + * @return void |
|
511 | + */ |
|
512 | 512 | protected function _registration_reports() { |
513 | 513 | $template_path = EE_ADMIN_TEMPLATE . 'admin_reports.template.php'; |
514 | 514 | $this->_template_args['admin_page_content'] = EEH_Template::display_template( $template_path, $this->_reports_template_data, true ); |
@@ -676,14 +676,14 @@ discard block |
||
676 | 676 | protected function _registration_checkin_list_table() { |
677 | 677 | do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' ); |
678 | 678 | $reg_id = isset( $this->_req_data['_REGID'] ) ? $this->_req_data['_REGID'] : null; |
679 | - /** @var EE_Registration $reg */ |
|
680 | - $reg = EEM_Registration::instance()->get_one_by_ID($reg_id); |
|
679 | + /** @var EE_Registration $reg */ |
|
680 | + $reg = EEM_Registration::instance()->get_one_by_ID($reg_id); |
|
681 | 681 | $this->_admin_page_title .= $this->get_action_link_or_button( |
682 | - 'new_registration', |
|
683 | - 'add-registrant', |
|
684 | - array('event_id' => $reg->event_ID()), |
|
685 | - 'add-new-h2' |
|
686 | - ); |
|
682 | + 'new_registration', |
|
683 | + 'add-registrant', |
|
684 | + array('event_id' => $reg->event_ID()), |
|
685 | + 'add-new-h2' |
|
686 | + ); |
|
687 | 687 | |
688 | 688 | $legend_items = array( |
689 | 689 | 'checkin' => array( |
@@ -745,10 +745,10 @@ discard block |
||
745 | 745 | |
746 | 746 | /** |
747 | 747 | * handles toggleing the checkin status for the registration, |
748 | - * @access protected |
|
749 | - * @param boolean $check_in |
|
750 | - * @return void |
|
751 | - */ |
|
748 | + * @access protected |
|
749 | + * @param boolean $check_in |
|
750 | + * @return void |
|
751 | + */ |
|
752 | 752 | protected function _toggle_checkin_status() { |
753 | 753 | //first let's get the query args out of the way for the redirect |
754 | 754 | $query_args = array( |
@@ -910,11 +910,11 @@ discard block |
||
910 | 910 | 'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_approved, |
911 | 911 | 'desc' => EEH_Template::pretty_status( EEM_Registration::status_id_approved, FALSE, 'sentence' ) |
912 | 912 | ), |
913 | - 'cancelled_status' => array( |
|
913 | + 'cancelled_status' => array( |
|
914 | 914 | 'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_cancelled, |
915 | 915 | 'desc' => EEH_Template::pretty_status( EEM_Registration::status_id_cancelled, FALSE, 'sentence' ) |
916 | 916 | ), |
917 | - 'declined_status' => array( |
|
917 | + 'declined_status' => array( |
|
918 | 918 | 'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_declined, |
919 | 919 | 'desc' => EEH_Template::pretty_status( EEM_Registration::status_id_declined, FALSE, 'sentence' ) |
920 | 920 | ), |
@@ -942,9 +942,9 @@ discard block |
||
942 | 942 | /** |
943 | 943 | * get_attendees |
944 | 944 | * @param bool $count whether to return count or data. |
945 | - * @access public |
|
946 | - * @return array |
|
947 | - */ |
|
945 | + * @access public |
|
946 | + * @return array |
|
947 | + */ |
|
948 | 948 | public function get_event_attendees( $per_page = 10, $count = FALSE, $trash = FALSE, $orderby = '' ) { |
949 | 949 | |
950 | 950 | do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' ); |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
2 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) |
|
3 | 3 | exit('NO direct script access allowed'); |
4 | 4 | |
5 | 5 | /** |
@@ -37,20 +37,20 @@ discard block |
||
37 | 37 | protected $_reports_template_data = array(); |
38 | 38 | |
39 | 39 | |
40 | - public function __construct( $routing = TRUE ) { |
|
41 | - parent::__construct( $routing ); |
|
42 | - define( 'REG_CAF_TEMPLATE_PATH', EE_CORE_CAF_ADMIN_EXTEND . 'registrations/templates/'); |
|
43 | - define( 'REG_CAF_ASSETS', EE_CORE_CAF_ADMIN_EXTEND . 'registrations/assets/'); |
|
44 | - define( 'REG_CAF_ASSETS_URL', EE_CORE_CAF_ADMIN_EXTEND_URL . 'registrations/assets/'); |
|
40 | + public function __construct($routing = TRUE) { |
|
41 | + parent::__construct($routing); |
|
42 | + define('REG_CAF_TEMPLATE_PATH', EE_CORE_CAF_ADMIN_EXTEND.'registrations/templates/'); |
|
43 | + define('REG_CAF_ASSETS', EE_CORE_CAF_ADMIN_EXTEND.'registrations/assets/'); |
|
44 | + define('REG_CAF_ASSETS_URL', EE_CORE_CAF_ADMIN_EXTEND_URL.'registrations/assets/'); |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | |
48 | 48 | protected function _extend_page_config() { |
49 | - $this->_admin_base_path = EE_CORE_CAF_ADMIN_EXTEND . 'registrations'; |
|
49 | + $this->_admin_base_path = EE_CORE_CAF_ADMIN_EXTEND.'registrations'; |
|
50 | 50 | |
51 | - $reg_id = ! empty( $this->_req_data['_REG_ID'] ) && ! is_array( $this->_req_data['_REG_ID'] ) ? $this->_req_data['_REG_ID'] : 0; |
|
52 | - $att_id = ! empty( $this->_req_data[ 'ATT_ID' ] ) ? ! is_array( $this->_req_data['ATT_ID'] ) : 0; |
|
53 | - $att_id = ! empty( $this->_req_data['post'] ) && ! is_array( $this->_req_data['post'] ) ? $this->_req_data['post'] : $att_id; |
|
51 | + $reg_id = ! empty($this->_req_data['_REG_ID']) && ! is_array($this->_req_data['_REG_ID']) ? $this->_req_data['_REG_ID'] : 0; |
|
52 | + $att_id = ! empty($this->_req_data['ATT_ID']) ? ! is_array($this->_req_data['ATT_ID']) : 0; |
|
53 | + $att_id = ! empty($this->_req_data['post']) && ! is_array($this->_req_data['post']) ? $this->_req_data['post'] : $att_id; |
|
54 | 54 | |
55 | 55 | $new_page_routes = array( |
56 | 56 | 'reports' => array( |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | ) |
90 | 90 | ); |
91 | 91 | |
92 | - $this->_page_routes = array_merge( $this->_page_routes, $new_page_routes ); |
|
92 | + $this->_page_routes = array_merge($this->_page_routes, $new_page_routes); |
|
93 | 93 | |
94 | 94 | $new_page_config = array( |
95 | 95 | 'reports' => array( |
@@ -134,8 +134,8 @@ discard block |
||
134 | 134 | 'filename' => 'registrations_event_checkin_other' |
135 | 135 | ) |
136 | 136 | ), |
137 | - 'help_tour' => array( 'Event_Checkin_Help_Tour' ), |
|
138 | - 'qtips' => array('Registration_List_Table_Tips' ), |
|
137 | + 'help_tour' => array('Event_Checkin_Help_Tour'), |
|
138 | + 'qtips' => array('Registration_List_Table_Tips'), |
|
139 | 139 | 'list_table' => 'EE_Event_Registrations_List_Table', |
140 | 140 | 'metaboxes' => array(), |
141 | 141 | 'require_nonce' => FALSE |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | ), |
154 | 154 | ); |
155 | 155 | |
156 | - $this->_page_config = array_merge( $this->_page_config, $new_page_config ); |
|
156 | + $this->_page_config = array_merge($this->_page_config, $new_page_config); |
|
157 | 157 | $this->_page_config['contact_list']['list_table'] = 'Extend_EE_Attendee_Contact_List_Table'; |
158 | 158 | $this->_page_config['default']['list_table'] = 'Extend_EE_Registrations_List_Table'; |
159 | 159 | } |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | |
163 | 163 | protected function _ajax_hooks() { |
164 | 164 | parent::_ajax_hooks(); |
165 | - add_action( 'wp_ajax_get_newsletter_form_content', array( $this, 'get_newsletter_form_content' ) ); |
|
165 | + add_action('wp_ajax_get_newsletter_form_content', array($this, 'get_newsletter_form_content')); |
|
166 | 166 | } |
167 | 167 | |
168 | 168 | |
@@ -171,20 +171,20 @@ discard block |
||
171 | 171 | parent::load_scripts_styles(); |
172 | 172 | |
173 | 173 | //if newsletter message type is active then let's add filter and load js for it. |
174 | - if ( EEH_MSG_Template::is_mt_active('newsletter') ) { |
|
174 | + if (EEH_MSG_Template::is_mt_active('newsletter')) { |
|
175 | 175 | //enqueue newsletter js |
176 | - wp_enqueue_script( 'ee-newsletter-trigger', REG_CAF_ASSETS_URL . 'ee-newsletter-trigger.js', array( 'ee-dialog' ), EVENT_ESPRESSO_VERSION, TRUE ); |
|
177 | - wp_enqueue_style( 'ee-newsletter-trigger-css', REG_CAF_ASSETS_URL . 'ee-newsletter-trigger.css', array(), EVENT_ESPRESSO_VERSION ); |
|
176 | + wp_enqueue_script('ee-newsletter-trigger', REG_CAF_ASSETS_URL.'ee-newsletter-trigger.js', array('ee-dialog'), EVENT_ESPRESSO_VERSION, TRUE); |
|
177 | + wp_enqueue_style('ee-newsletter-trigger-css', REG_CAF_ASSETS_URL.'ee-newsletter-trigger.css', array(), EVENT_ESPRESSO_VERSION); |
|
178 | 178 | //hook in buttons for newsletter message type trigger. |
179 | - add_action('AHEE__EE_Admin_List_Table__extra_tablenav__after_bottom_buttons', array( $this, 'add_newsletter_action_buttons'), 10 ); |
|
179 | + add_action('AHEE__EE_Admin_List_Table__extra_tablenav__after_bottom_buttons', array($this, 'add_newsletter_action_buttons'), 10); |
|
180 | 180 | } |
181 | 181 | } |
182 | 182 | |
183 | 183 | |
184 | 184 | |
185 | 185 | public function load_scripts_styles_reports() { |
186 | - wp_register_script( 'ee-reg-reports-js', REG_CAF_ASSETS_URL . 'ee-registration-admin-reports.js', array( 'google-charts' ), EVENT_ESPRESSO_VERSION, true ); |
|
187 | - wp_enqueue_script( 'ee-reg-reports-js' ); |
|
186 | + wp_register_script('ee-reg-reports-js', REG_CAF_ASSETS_URL.'ee-registration-admin-reports.js', array('google-charts'), EVENT_ESPRESSO_VERSION, true); |
|
187 | + wp_enqueue_script('ee-reg-reports-js'); |
|
188 | 188 | $this->_registration_reports_js_setup(); |
189 | 189 | } |
190 | 190 | |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | 'slug' => 'all', |
217 | 217 | 'label' => __('All', 'event_espresso'), |
218 | 218 | 'count' => 0, |
219 | - 'bulk_action' => !isset( $this->_req_data['event_id'] ) ? array() : array( |
|
219 | + 'bulk_action' => ! isset($this->_req_data['event_id']) ? array() : array( |
|
220 | 220 | 'toggle_checkin_status' => __('Toggle Check-In', 'event_espresso'), |
221 | 221 | //'trash_registrations' => __('Trash Registrations', 'event_espresso') |
222 | 222 | ) |
@@ -234,7 +234,7 @@ discard block |
||
234 | 234 | 'slug' => 'all', |
235 | 235 | 'label' => __('All', 'event_espresso'), |
236 | 236 | 'count' => 0, |
237 | - 'bulk_action' => array( 'delete_checkin_rows' => __('Delete Check-In Rows', 'event_espresso') ) |
|
237 | + 'bulk_action' => array('delete_checkin_rows' => __('Delete Check-In Rows', 'event_espresso')) |
|
238 | 238 | ), |
239 | 239 | ); |
240 | 240 | } |
@@ -250,20 +250,20 @@ discard block |
||
250 | 250 | */ |
251 | 251 | public function get_newsletter_form_content() { |
252 | 252 | //do a nonce check cause we're not coming in from an normal route here. |
253 | - $nonce = isset( $this->_req_data['get_newsletter_form_content_nonce'] ) ? sanitize_text_field( $this->_req_data['get_newsletter_form_content_nonce'] ) : ''; |
|
253 | + $nonce = isset($this->_req_data['get_newsletter_form_content_nonce']) ? sanitize_text_field($this->_req_data['get_newsletter_form_content_nonce']) : ''; |
|
254 | 254 | $nonce_ref = 'get_newsletter_form_content_nonce'; |
255 | 255 | |
256 | - $this->_verify_nonce( $nonce, $nonce_ref ); |
|
256 | + $this->_verify_nonce($nonce, $nonce_ref); |
|
257 | 257 | //let's get the mtp for the incoming MTP_ ID |
258 | - if ( !isset( $this->_req_data['GRP_ID'] ) ) { |
|
259 | - EE_Error::add_error( __('There must be something broken with the js or html structure because the required data for getting a message template group is not present (need an GRP_ID).', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ ); |
|
258 | + if ( ! isset($this->_req_data['GRP_ID'])) { |
|
259 | + EE_Error::add_error(__('There must be something broken with the js or html structure because the required data for getting a message template group is not present (need an GRP_ID).', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__); |
|
260 | 260 | $this->_template_args['success'] = FALSE; |
261 | 261 | $this->_template_args['error'] = TRUE; |
262 | 262 | $this->_return_json(); |
263 | 263 | } |
264 | - $MTPG = EEM_Message_Template_Group::instance()->get_one_by_ID( $this->_req_data['GRP_ID'] ); |
|
265 | - if ( ! $MTPG instanceof EE_Message_Template_Group ) { |
|
266 | - EE_Error::add_error( sprintf( __('The GRP_ID given (%d) does not appear to have a corresponding row in the database.', 'event_espresso'), $this->_req_data['GRP_ID'] ), __FILE__, __FUNCTION__, __LINE__ ); |
|
264 | + $MTPG = EEM_Message_Template_Group::instance()->get_one_by_ID($this->_req_data['GRP_ID']); |
|
265 | + if ( ! $MTPG instanceof EE_Message_Template_Group) { |
|
266 | + EE_Error::add_error(sprintf(__('The GRP_ID given (%d) does not appear to have a corresponding row in the database.', 'event_espresso'), $this->_req_data['GRP_ID']), __FILE__, __FUNCTION__, __LINE__); |
|
267 | 267 | $this->_template_args['success'] = FALSE; |
268 | 268 | $this->_template_args['error'] = TRUE; |
269 | 269 | $this->_return_json(); |
@@ -272,11 +272,11 @@ discard block |
||
272 | 272 | $MTPs = $MTPG->context_templates(); |
273 | 273 | $MTPs = $MTPs['attendee']; |
274 | 274 | $template_fields = array(); |
275 | - foreach ( $MTPs as $MTP ) { |
|
275 | + foreach ($MTPs as $MTP) { |
|
276 | 276 | $field = $MTP->get('MTP_template_field'); |
277 | - if ( $field == 'content' ) { |
|
277 | + if ($field == 'content') { |
|
278 | 278 | $content = $MTP->get('MTP_content'); |
279 | - if ( !empty( $content['newsletter_content'] ) ) { |
|
279 | + if ( ! empty($content['newsletter_content'])) { |
|
280 | 280 | $template_fields['newsletter_content'] = $content['newsletter_content']; |
281 | 281 | } |
282 | 282 | continue; |
@@ -289,7 +289,7 @@ discard block |
||
289 | 289 | $this->_template_args['data'] = array( |
290 | 290 | 'batch_message_from' => isset($template_fields['from']) ? $template_fields['from'] : '', |
291 | 291 | 'batch_message_subject' => isset($template_fields['subject']) ? $template_fields['subject'] : '', |
292 | - 'batch_message_content' => isset( $template_fields['newsletter_content'] ) ? $template_fields['newsletter_content'] : '' |
|
292 | + 'batch_message_content' => isset($template_fields['newsletter_content']) ? $template_fields['newsletter_content'] : '' |
|
293 | 293 | ); |
294 | 294 | $this->_return_json(); |
295 | 295 | } |
@@ -305,8 +305,8 @@ discard block |
||
305 | 305 | * @param EE_Admin_List_Table $list_table |
306 | 306 | * @return string html string for extra buttons |
307 | 307 | */ |
308 | - public function add_newsletter_action_buttons( EE_Admin_List_Table $list_table ) { |
|
309 | - if ( ! EE_Registry::instance()->CAP->current_user_can( 'ee_send_message', 'espresso_registrations_newsletter_selected_send' ) ) { |
|
308 | + public function add_newsletter_action_buttons(EE_Admin_List_Table $list_table) { |
|
309 | + if ( ! EE_Registry::instance()->CAP->current_user_can('ee_send_message', 'espresso_registrations_newsletter_selected_send')) { |
|
310 | 310 | return ''; |
311 | 311 | } |
312 | 312 | |
@@ -315,13 +315,13 @@ discard block |
||
315 | 315 | 'event_registrations', |
316 | 316 | 'default' |
317 | 317 | ); |
318 | - if ( $this->_current_page == 'espresso_registrations' && in_array( $this->_req_action, $routes_to_add_to ) ) { |
|
319 | - if ( ( $this->_req_action == 'event_registrations' && empty( $this->_req_data['event_id'] ) ) || ( isset( $this->_req_data['status'] ) && $this->_req_data['status'] == 'trash' ) ) { |
|
318 | + if ($this->_current_page == 'espresso_registrations' && in_array($this->_req_action, $routes_to_add_to)) { |
|
319 | + if (($this->_req_action == 'event_registrations' && empty($this->_req_data['event_id'])) || (isset($this->_req_data['status']) && $this->_req_data['status'] == 'trash')) { |
|
320 | 320 | echo ''; |
321 | 321 | } else { |
322 | - $button_text = sprintf( __('Send Batch Message (%s selected)', 'event_espresso'), '<span class="send-selected-newsletter-count">0</span>' ); |
|
323 | - echo '<button id="selected-batch-send-trigger" class="button secondary-button"><span class="dashicons dashicons-email "></span>' . $button_text . '</button>'; |
|
324 | - add_action('admin_footer', array( $this, 'newsletter_send_form_skeleton') ); |
|
322 | + $button_text = sprintf(__('Send Batch Message (%s selected)', 'event_espresso'), '<span class="send-selected-newsletter-count">0</span>'); |
|
323 | + echo '<button id="selected-batch-send-trigger" class="button secondary-button"><span class="dashicons dashicons-email "></span>'.$button_text.'</button>'; |
|
324 | + add_action('admin_footer', array($this, 'newsletter_send_form_skeleton')); |
|
325 | 325 | } |
326 | 326 | } |
327 | 327 | } |
@@ -333,37 +333,37 @@ discard block |
||
333 | 333 | $list_table = $this->_list_table_object; |
334 | 334 | $codes = array(); |
335 | 335 | //need to templates for the newsletter message type for the template selector. |
336 | - $values[] = array( 'text' => __('Select Template to Use', 'event_espresso'), 'id' => 0 ); |
|
337 | - $mtps = EEM_Message_Template_Group::instance()->get_all( array( array( 'MTP_message_type' => 'newsletter', 'MTP_messenger' => 'email' ) ) ); |
|
338 | - foreach ( $mtps as $mtp ) { |
|
336 | + $values[] = array('text' => __('Select Template to Use', 'event_espresso'), 'id' => 0); |
|
337 | + $mtps = EEM_Message_Template_Group::instance()->get_all(array(array('MTP_message_type' => 'newsletter', 'MTP_messenger' => 'email'))); |
|
338 | + foreach ($mtps as $mtp) { |
|
339 | 339 | $name = $mtp->name(); |
340 | 340 | $values[] = array( |
341 | - 'text' => empty( $name ) ? __('Global', 'event_espresso') : $name, |
|
341 | + 'text' => empty($name) ? __('Global', 'event_espresso') : $name, |
|
342 | 342 | 'id' => $mtp->ID() |
343 | 343 | ); |
344 | 344 | } |
345 | 345 | |
346 | 346 | //need to get a list of shortcodes that are available for the newsletter message type. |
347 | - $shortcodes = EEH_MSG_Template::get_shortcodes( 'newsletter', 'email', array(), 'attendee', FALSE ); |
|
348 | - foreach ( $shortcodes as $field => $shortcode_array ) { |
|
349 | - $codes[$field] = implode(', ', array_keys($shortcode_array ) ); |
|
347 | + $shortcodes = EEH_MSG_Template::get_shortcodes('newsletter', 'email', array(), 'attendee', FALSE); |
|
348 | + foreach ($shortcodes as $field => $shortcode_array) { |
|
349 | + $codes[$field] = implode(', ', array_keys($shortcode_array)); |
|
350 | 350 | } |
351 | 351 | |
352 | 352 | $shortcodes = $codes; |
353 | 353 | |
354 | - $form_template = REG_CAF_TEMPLATE_PATH . 'newsletter-send-form.template.php'; |
|
354 | + $form_template = REG_CAF_TEMPLATE_PATH.'newsletter-send-form.template.php'; |
|
355 | 355 | $form_template_args = array( |
356 | 356 | 'form_action' => admin_url('admin.php?page=espresso_registrations'), |
357 | 357 | 'form_route' => 'newsletter_selected_send', |
358 | 358 | 'form_nonce_name' => 'newsletter_selected_send_nonce', |
359 | - 'form_nonce' => wp_create_nonce( 'newsletter_selected_send_nonce' ), |
|
359 | + 'form_nonce' => wp_create_nonce('newsletter_selected_send_nonce'), |
|
360 | 360 | 'redirect_back_to' => $this->_req_action, |
361 | - 'ajax_nonce' => wp_create_nonce( 'get_newsletter_form_content_nonce'), |
|
362 | - 'template_selector' => EEH_Form_Fields::select_input('newsletter_mtp_selected', $values ), |
|
361 | + 'ajax_nonce' => wp_create_nonce('get_newsletter_form_content_nonce'), |
|
362 | + 'template_selector' => EEH_Form_Fields::select_input('newsletter_mtp_selected', $values), |
|
363 | 363 | 'shortcodes' => $shortcodes, |
364 | 364 | 'id_type' => $list_table instanceof EE_Attendee_Contact_List_Table ? 'contact' : 'registration' |
365 | 365 | ); |
366 | - EEH_Template::display_template( $form_template, $form_template_args ); |
|
366 | + EEH_Template::display_template($form_template, $form_template_args); |
|
367 | 367 | } |
368 | 368 | |
369 | 369 | |
@@ -378,7 +378,7 @@ discard block |
||
378 | 378 | protected function _newsletter_selected_send() { |
379 | 379 | $success = TRUE; |
380 | 380 | //first we need to make sure we have a GRP_ID so we know what template we're sending and updating! |
381 | - if ( empty( $this->_req_data['newsletter_mtp_selected'] ) ) { |
|
381 | + if (empty($this->_req_data['newsletter_mtp_selected'])) { |
|
382 | 382 | EE_Error::add_error( |
383 | 383 | __( |
384 | 384 | 'In order to send a message, a Message Template GRP_ID is needed. It was not provided so messages were not sent.', |
@@ -389,7 +389,7 @@ discard block |
||
389 | 389 | $success = FALSE; |
390 | 390 | } |
391 | 391 | |
392 | - if ( $success ) { |
|
392 | + if ($success) { |
|
393 | 393 | //update Message template in case there are any changes |
394 | 394 | $Message_Template_Group = EEM_Message_Template_Group::instance()->get_one_by_ID( |
395 | 395 | $this->_req_data['newsletter_mtp_selected'] |
@@ -397,7 +397,7 @@ discard block |
||
397 | 397 | $Message_Templates = $Message_Template_Group instanceof EE_Message_Template_Group |
398 | 398 | ? $Message_Template_Group->context_templates() |
399 | 399 | : array(); |
400 | - if ( empty( $Message_Templates ) ) { |
|
400 | + if (empty($Message_Templates)) { |
|
401 | 401 | EE_Error::add_error( |
402 | 402 | __( |
403 | 403 | 'Unable to retrieve message template fields from the db. Messages not sent.', |
@@ -408,25 +408,25 @@ discard block |
||
408 | 408 | } |
409 | 409 | |
410 | 410 | //let's just update the specific fields |
411 | - foreach ( $Message_Templates['attendee'] as $Message_Template ) { |
|
412 | - if ( $Message_Template instanceof EE_Message_Template ) { |
|
413 | - $field = $Message_Template->get( 'MTP_template_field' ); |
|
414 | - $content = $Message_Template->get( 'MTP_content' ); |
|
411 | + foreach ($Message_Templates['attendee'] as $Message_Template) { |
|
412 | + if ($Message_Template instanceof EE_Message_Template) { |
|
413 | + $field = $Message_Template->get('MTP_template_field'); |
|
414 | + $content = $Message_Template->get('MTP_content'); |
|
415 | 415 | $new_content = $content; |
416 | - switch ( $field ) { |
|
416 | + switch ($field) { |
|
417 | 417 | case 'from' : |
418 | - $new_content = ! empty( $this->_req_data['batch_message']['from'] ) |
|
418 | + $new_content = ! empty($this->_req_data['batch_message']['from']) |
|
419 | 419 | ? $this->_req_data['batch_message']['from'] |
420 | 420 | : $content; |
421 | 421 | break; |
422 | 422 | case 'subject' : |
423 | - $new_content = ! empty( $this->_req_data['batch_message']['subject'] ) |
|
423 | + $new_content = ! empty($this->_req_data['batch_message']['subject']) |
|
424 | 424 | ? $this->_req_data['batch_message']['subject'] |
425 | 425 | : $content; |
426 | 426 | break; |
427 | 427 | case 'content' : |
428 | 428 | $new_content = $content; |
429 | - $new_content['newsletter_content'] = ! empty( $this->_req_data['batch_message']['content'] ) |
|
429 | + $new_content['newsletter_content'] = ! empty($this->_req_data['batch_message']['content']) |
|
430 | 430 | ? $this->_req_data['batch_message']['content'] |
431 | 431 | : $content['newsletter_content']; |
432 | 432 | break; |
@@ -434,35 +434,35 @@ discard block |
||
434 | 434 | continue; |
435 | 435 | break; |
436 | 436 | } |
437 | - $Message_Template->set( 'MTP_content', $new_content ); |
|
437 | + $Message_Template->set('MTP_content', $new_content); |
|
438 | 438 | $Message_Template->save(); |
439 | 439 | } |
440 | 440 | } |
441 | 441 | |
442 | 442 | //great fields are updated! now let's make sure we just have contact objects (EE_Attendee). |
443 | - $id_type = ! empty( $this->_req_data['batch_message']['id_type'] ) |
|
443 | + $id_type = ! empty($this->_req_data['batch_message']['id_type']) |
|
444 | 444 | ? $this->_req_data['batch_message']['id_type'] |
445 | 445 | : 'registration'; |
446 | 446 | |
447 | 447 | //id_type will affect how we assemble the ids. |
448 | - $ids = ! empty( $this->_req_data['batch_message']['ids'] ) |
|
449 | - ? json_decode( stripslashes($this->_req_data['batch_message']['ids']) ) |
|
448 | + $ids = ! empty($this->_req_data['batch_message']['ids']) |
|
449 | + ? json_decode(stripslashes($this->_req_data['batch_message']['ids'])) |
|
450 | 450 | : array(); |
451 | 451 | |
452 | 452 | $registrations_used_for_contact_data = array(); |
453 | 453 | //using switch because eventually we'll have other contexts that will be used for generating messages. |
454 | - switch ( $id_type ) { |
|
454 | + switch ($id_type) { |
|
455 | 455 | case 'registration' : |
456 | 456 | $registrations_used_for_contact_data = EEM_Registration::instance()->get_all( |
457 | 457 | array( |
458 | 458 | array( |
459 | - 'REG_ID' => array( 'IN', $ids ) |
|
459 | + 'REG_ID' => array('IN', $ids) |
|
460 | 460 | ) |
461 | 461 | ) |
462 | 462 | ); |
463 | 463 | break; |
464 | 464 | case 'contact' : |
465 | - $registrations_used_for_contact_data = EEM_Registration::instance()->get_latest_registration_for_each_of_given_contacts( $ids ); |
|
465 | + $registrations_used_for_contact_data = EEM_Registration::instance()->get_latest_registration_for_each_of_given_contacts($ids); |
|
466 | 466 | break; |
467 | 467 | } |
468 | 468 | do_action( |
@@ -473,8 +473,8 @@ discard block |
||
473 | 473 | //kept for backward compat, internally we no longer use this action. |
474 | 474 | //@deprecated 4.8.36.rc.002 |
475 | 475 | $contacts = $id_type == 'registration' |
476 | - ? EEM_Attendee::instance()->get_array_of_contacts_from_reg_ids( $ids ) |
|
477 | - : EEM_Attendee::instance()->get_all( array( array( 'ATT_ID' => array('in', $ids ) ) ) ); |
|
476 | + ? EEM_Attendee::instance()->get_array_of_contacts_from_reg_ids($ids) |
|
477 | + : EEM_Attendee::instance()->get_all(array(array('ATT_ID' => array('in', $ids)))); |
|
478 | 478 | do_action( |
479 | 479 | 'AHEE__Extend_Registrations_Admin_Page___newsletter_selected_send', |
480 | 480 | $contacts, |
@@ -482,11 +482,11 @@ discard block |
||
482 | 482 | ); |
483 | 483 | } |
484 | 484 | $query_args = array( |
485 | - 'action' => !empty( $this->_req_data['redirect_back_to'] ) |
|
485 | + 'action' => ! empty($this->_req_data['redirect_back_to']) |
|
486 | 486 | ? $this->_req_data['redirect_back_to'] |
487 | 487 | : 'default' |
488 | 488 | ); |
489 | - $this->_redirect_after_action( FALSE, '', '', $query_args, TRUE ); |
|
489 | + $this->_redirect_after_action(FALSE, '', '', $query_args, TRUE); |
|
490 | 490 | } |
491 | 491 | |
492 | 492 | |
@@ -508,8 +508,8 @@ discard block |
||
508 | 508 | * @return void |
509 | 509 | */ |
510 | 510 | protected function _registration_reports() { |
511 | - $template_path = EE_ADMIN_TEMPLATE . 'admin_reports.template.php'; |
|
512 | - $this->_template_args['admin_page_content'] = EEH_Template::display_template( $template_path, $this->_reports_template_data, true ); |
|
511 | + $template_path = EE_ADMIN_TEMPLATE.'admin_reports.template.php'; |
|
512 | + $this->_template_args['admin_page_content'] = EEH_Template::display_template($template_path, $this->_reports_template_data, true); |
|
513 | 513 | // the final template wrapper |
514 | 514 | $this->display_admin_page_with_no_sidebar(); |
515 | 515 | |
@@ -522,28 +522,28 @@ discard block |
||
522 | 522 | * |
523 | 523 | * @return string |
524 | 524 | */ |
525 | - private function _registrations_per_day_report( $period = '-1 month' ) { |
|
525 | + private function _registrations_per_day_report($period = '-1 month') { |
|
526 | 526 | $report_ID = 'reg-admin-registrations-per-day-report-dv'; |
527 | 527 | |
528 | - $results = EEM_Registration::instance()->get_registrations_per_day_and_per_status_report( $period ); |
|
528 | + $results = EEM_Registration::instance()->get_registrations_per_day_and_per_status_report($period); |
|
529 | 529 | |
530 | 530 | $results = (array) $results; |
531 | 531 | $regs = array(); |
532 | 532 | $subtitle = ''; |
533 | 533 | |
534 | - if( $results ) { |
|
534 | + if ($results) { |
|
535 | 535 | $column_titles = array(); |
536 | 536 | $tracker = 0; |
537 | - foreach ( $results as $result ) { |
|
537 | + foreach ($results as $result) { |
|
538 | 538 | $report_column_values = array(); |
539 | - foreach( $result as $property_name => $property_value ) { |
|
539 | + foreach ($result as $property_name => $property_value) { |
|
540 | 540 | $property_value = $property_name == 'Registration_REG_date' ? $property_value : (int) $property_value; |
541 | 541 | $report_column_values[] = $property_value; |
542 | - if ( $tracker === 0 ) { |
|
543 | - if ( $property_name == 'Registration_REG_date' ) { |
|
544 | - $column_titles[] = __( 'Date (only days with registrations are shown)', 'event_espresso' ); |
|
542 | + if ($tracker === 0) { |
|
543 | + if ($property_name == 'Registration_REG_date') { |
|
544 | + $column_titles[] = __('Date (only days with registrations are shown)', 'event_espresso'); |
|
545 | 545 | } else { |
546 | - $column_titles[] = EEH_Template::pretty_status( $property_name, false, 'sentence' ); |
|
546 | + $column_titles[] = EEH_Template::pretty_status($property_name, false, 'sentence'); |
|
547 | 547 | } |
548 | 548 | } |
549 | 549 | } |
@@ -552,36 +552,36 @@ discard block |
||
552 | 552 | } |
553 | 553 | |
554 | 554 | //make sure the column_titles is pushed to the beginning of the array |
555 | - array_unshift( $regs, $column_titles ); |
|
555 | + array_unshift($regs, $column_titles); |
|
556 | 556 | //setup the date range. |
557 | - $DateTimeZone = new DateTimeZone( EEH_DTT_Helper::get_timezone() ); |
|
558 | - $beginning_date = new DateTime( "now " . $period, $DateTimeZone ); |
|
559 | - $ending_date = new DateTime( "now", $DateTimeZone ); |
|
557 | + $DateTimeZone = new DateTimeZone(EEH_DTT_Helper::get_timezone()); |
|
558 | + $beginning_date = new DateTime("now ".$period, $DateTimeZone); |
|
559 | + $ending_date = new DateTime("now", $DateTimeZone); |
|
560 | 560 | $subtitle = sprintf( |
561 | - _x( 'For the period: %1$s to %2$s', 'Used to give date range', 'event_espresso' ), |
|
562 | - $beginning_date->format( 'Y-m-d' ), |
|
563 | - $ending_date->format( 'Y-m-d' ) |
|
561 | + _x('For the period: %1$s to %2$s', 'Used to give date range', 'event_espresso'), |
|
562 | + $beginning_date->format('Y-m-d'), |
|
563 | + $ending_date->format('Y-m-d') |
|
564 | 564 | ); |
565 | 565 | } |
566 | 566 | |
567 | - $report_title = __( 'Total Registrations per Day', 'event_espresso' ); |
|
567 | + $report_title = __('Total Registrations per Day', 'event_espresso'); |
|
568 | 568 | |
569 | 569 | $report_params = array( |
570 | 570 | 'title' => $report_title, |
571 | 571 | 'subtitle' => $subtitle, |
572 | 572 | 'id' => $report_ID, |
573 | 573 | 'regs' => $regs, |
574 | - 'noResults' => empty( $regs ), |
|
574 | + 'noResults' => empty($regs), |
|
575 | 575 | 'noRegsMsg' => sprintf( |
576 | 576 | __( |
577 | 577 | '%sThere are currently no registration records in the last month for this report.%s', |
578 | 578 | 'event_espresso' |
579 | 579 | ), |
580 | - '<h2>' . $report_title . '</h2><p>', |
|
580 | + '<h2>'.$report_title.'</h2><p>', |
|
581 | 581 | '</p>' |
582 | 582 | ), |
583 | 583 | ); |
584 | - wp_localize_script( 'ee-reg-reports-js', 'regPerDay', $report_params ); |
|
584 | + wp_localize_script('ee-reg-reports-js', 'regPerDay', $report_params); |
|
585 | 585 | |
586 | 586 | return $report_ID; |
587 | 587 | } |
@@ -593,29 +593,29 @@ discard block |
||
593 | 593 | * |
594 | 594 | * @return string |
595 | 595 | */ |
596 | - private function _registrations_per_event_report( $period = '-1 month' ) { |
|
596 | + private function _registrations_per_event_report($period = '-1 month') { |
|
597 | 597 | |
598 | 598 | $report_ID = 'reg-admin-registrations-per-event-report-dv'; |
599 | 599 | |
600 | - $results = EEM_Registration::instance()->get_registrations_per_event_and_per_status_report( $period ); |
|
600 | + $results = EEM_Registration::instance()->get_registrations_per_event_and_per_status_report($period); |
|
601 | 601 | |
602 | 602 | $results = (array) $results; |
603 | 603 | $regs = array(); |
604 | 604 | $subtitle = ''; |
605 | 605 | |
606 | - if ( $results ) { |
|
606 | + if ($results) { |
|
607 | 607 | $column_titles = array(); |
608 | 608 | $tracker = 0; |
609 | - foreach ( $results as $result ) { |
|
609 | + foreach ($results as $result) { |
|
610 | 610 | $report_column_values = array(); |
611 | - foreach( $result as $property_name => $property_value ) { |
|
612 | - $property_value = $property_name == 'Registration_Event' ? wp_trim_words( $property_value, 4, '...' ) : (int) $property_value; |
|
611 | + foreach ($result as $property_name => $property_value) { |
|
612 | + $property_value = $property_name == 'Registration_Event' ? wp_trim_words($property_value, 4, '...') : (int) $property_value; |
|
613 | 613 | $report_column_values[] = $property_value; |
614 | - if ( $tracker === 0 ) { |
|
615 | - if ( $property_name == 'Registration_Event' ) { |
|
616 | - $column_titles[] = __( 'Event', 'event_espresso' ); |
|
614 | + if ($tracker === 0) { |
|
615 | + if ($property_name == 'Registration_Event') { |
|
616 | + $column_titles[] = __('Event', 'event_espresso'); |
|
617 | 617 | } else { |
618 | - $column_titles[] = EEH_Template::pretty_status( $property_name, false, 'sentence' ); |
|
618 | + $column_titles[] = EEH_Template::pretty_status($property_name, false, 'sentence'); |
|
619 | 619 | } |
620 | 620 | } |
621 | 621 | } |
@@ -624,37 +624,37 @@ discard block |
||
624 | 624 | } |
625 | 625 | |
626 | 626 | //make sure the column_titles is pushed to the beginning of the array |
627 | - array_unshift( $regs, $column_titles ); |
|
627 | + array_unshift($regs, $column_titles); |
|
628 | 628 | |
629 | 629 | //setup the date range. |
630 | - $DateTimeZone = new DateTimeZone( EEH_DTT_Helper::get_timezone() ); |
|
631 | - $beginning_date = new DateTime( "now " . $period, $DateTimeZone ); |
|
632 | - $ending_date = new DateTime( "now", $DateTimeZone ); |
|
630 | + $DateTimeZone = new DateTimeZone(EEH_DTT_Helper::get_timezone()); |
|
631 | + $beginning_date = new DateTime("now ".$period, $DateTimeZone); |
|
632 | + $ending_date = new DateTime("now", $DateTimeZone); |
|
633 | 633 | $subtitle = sprintf( |
634 | - _x( 'For the period: %1$s to %2$s', 'Used to give date range', 'event_espresso' ), |
|
635 | - $beginning_date->format( 'Y-m-d' ), |
|
636 | - $ending_date->format( 'Y-m-d' ) |
|
634 | + _x('For the period: %1$s to %2$s', 'Used to give date range', 'event_espresso'), |
|
635 | + $beginning_date->format('Y-m-d'), |
|
636 | + $ending_date->format('Y-m-d') |
|
637 | 637 | ); |
638 | 638 | } |
639 | 639 | |
640 | - $report_title = __( 'Total Registrations per Event', 'event_espresso' ); |
|
640 | + $report_title = __('Total Registrations per Event', 'event_espresso'); |
|
641 | 641 | |
642 | 642 | $report_params = array( |
643 | 643 | 'title' => $report_title, |
644 | 644 | 'subtitle' => $subtitle, |
645 | 645 | 'id' => $report_ID, |
646 | 646 | 'regs' => $regs, |
647 | - 'noResults' => empty( $regs ), |
|
647 | + 'noResults' => empty($regs), |
|
648 | 648 | 'noRegsMsg' => sprintf( |
649 | 649 | __( |
650 | 650 | '%sThere are currently no registration records in the last month for this report.%s', |
651 | 651 | 'event_espresso' |
652 | 652 | ), |
653 | - '<h2>' . $report_title . '</h2><p>', |
|
653 | + '<h2>'.$report_title.'</h2><p>', |
|
654 | 654 | '</p>' |
655 | 655 | ), |
656 | 656 | ); |
657 | - wp_localize_script( 'ee-reg-reports-js', 'regPerEvent', $report_params ); |
|
657 | + wp_localize_script('ee-reg-reports-js', 'regPerEvent', $report_params); |
|
658 | 658 | |
659 | 659 | return $report_ID; |
660 | 660 | } |
@@ -668,8 +668,8 @@ discard block |
||
668 | 668 | * @return void |
669 | 669 | */ |
670 | 670 | protected function _registration_checkin_list_table() { |
671 | - do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' ); |
|
672 | - $reg_id = isset( $this->_req_data['_REGID'] ) ? $this->_req_data['_REGID'] : null; |
|
671 | + do_action('AHEE_log', __FILE__, __FUNCTION__, ''); |
|
672 | + $reg_id = isset($this->_req_data['_REGID']) ? $this->_req_data['_REGID'] : null; |
|
673 | 673 | /** @var EE_Registration $reg */ |
674 | 674 | $reg = EEM_Registration::instance()->get_one_by_ID($reg_id); |
675 | 675 | $this->_admin_page_title .= $this->get_action_link_or_button( |
@@ -689,15 +689,15 @@ discard block |
||
689 | 689 | 'desc' => __('This indicates the attendee has been checked out', 'event_espresso') |
690 | 690 | ) |
691 | 691 | ); |
692 | - $this->_template_args['after_list_table'] = $this->_display_legend( $legend_items ); |
|
692 | + $this->_template_args['after_list_table'] = $this->_display_legend($legend_items); |
|
693 | 693 | |
694 | 694 | |
695 | - $dtt_id = isset( $this->_req_data['DTT_ID'] ) ? $this->_req_data['DTT_ID'] : NULL; |
|
696 | - $go_back_url = !empty( $reg_id ) ? EE_Admin_Page::add_query_args_and_nonce(array('action' => 'event_registrations', 'event_id' => EEM_Registration::instance()->get_one_by_ID($reg_id)->get_first_related('Event')->ID(), 'DTT_ID' => $dtt_id ), $this->_admin_base_url ) : ''; |
|
695 | + $dtt_id = isset($this->_req_data['DTT_ID']) ? $this->_req_data['DTT_ID'] : NULL; |
|
696 | + $go_back_url = ! empty($reg_id) ? EE_Admin_Page::add_query_args_and_nonce(array('action' => 'event_registrations', 'event_id' => EEM_Registration::instance()->get_one_by_ID($reg_id)->get_first_related('Event')->ID(), 'DTT_ID' => $dtt_id), $this->_admin_base_url) : ''; |
|
697 | 697 | |
698 | - $this->_template_args['before_list_table'] = !empty( $reg_id ) && !empty( $dtt_id ) ? '<h2>' . sprintf(__("%s's check in records for %s at the event, %s", 'event_espresso'), '<span id="checkin-attendee-name">' . EEM_Registration::instance()->get_one_by_ID($reg_id)->get_first_related('Attendee')->full_name() . '</span>', '<span id="checkin-dtt"><a href="' . $go_back_url . '">' . EEM_Datetime::instance()->get_one_by_ID($dtt_id)->start_date_and_time() . ' - ' . EEM_Datetime::instance()->get_one_by_ID($dtt_id)->end_date_and_time() . '</a></span>', '<span id="checkin-event-name">' . EEM_Datetime::instance()->get_one_by_ID($dtt_id)->get_first_related('Event')->get('EVT_name') . '</span>' ) . '</h2>' : ''; |
|
699 | - $this->_template_args['list_table_hidden_fields'] = !empty( $reg_id ) ? '<input type="hidden" name="_REGID" value="' . $reg_id . '">' : ''; |
|
700 | - $this->_template_args['list_table_hidden_fields'] .= !empty( $dtt_id ) ? '<input type="hidden" name="DTT_ID" value="' . $dtt_id . '">' : ''; |
|
698 | + $this->_template_args['before_list_table'] = ! empty($reg_id) && ! empty($dtt_id) ? '<h2>'.sprintf(__("%s's check in records for %s at the event, %s", 'event_espresso'), '<span id="checkin-attendee-name">'.EEM_Registration::instance()->get_one_by_ID($reg_id)->get_first_related('Attendee')->full_name().'</span>', '<span id="checkin-dtt"><a href="'.$go_back_url.'">'.EEM_Datetime::instance()->get_one_by_ID($dtt_id)->start_date_and_time().' - '.EEM_Datetime::instance()->get_one_by_ID($dtt_id)->end_date_and_time().'</a></span>', '<span id="checkin-event-name">'.EEM_Datetime::instance()->get_one_by_ID($dtt_id)->get_first_related('Event')->get('EVT_name').'</span>').'</h2>' : ''; |
|
699 | + $this->_template_args['list_table_hidden_fields'] = ! empty($reg_id) ? '<input type="hidden" name="_REGID" value="'.$reg_id.'">' : ''; |
|
700 | + $this->_template_args['list_table_hidden_fields'] .= ! empty($dtt_id) ? '<input type="hidden" name="DTT_ID" value="'.$dtt_id.'">' : ''; |
|
701 | 701 | |
702 | 702 | $this->display_admin_list_table_page_with_no_sidebar(); |
703 | 703 | } |
@@ -710,24 +710,24 @@ discard block |
||
710 | 710 | */ |
711 | 711 | public function toggle_checkin_status() { |
712 | 712 | //first make sure we have the necessary data |
713 | - if ( !isset( $this->_req_data['_regid'] ) ) { |
|
714 | - EE_Error::add_error( __('There must be something broken with the html structure because the required data for toggling the Check-in status is not being sent via ajax', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ ); |
|
713 | + if ( ! isset($this->_req_data['_regid'])) { |
|
714 | + EE_Error::add_error(__('There must be something broken with the html structure because the required data for toggling the Check-in status is not being sent via ajax', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__); |
|
715 | 715 | $this->_template_args['success'] = FALSE; |
716 | 716 | $this->_template_args['error'] = TRUE; |
717 | 717 | $this->_return_json(); |
718 | 718 | }; |
719 | 719 | |
720 | 720 | //do a nonce check cause we're not coming in from an normal route here. |
721 | - $nonce = isset( $this->_req_data['checkinnonce'] ) ? sanitize_text_field( $this->_req_data['checkinnonce'] ) : ''; |
|
721 | + $nonce = isset($this->_req_data['checkinnonce']) ? sanitize_text_field($this->_req_data['checkinnonce']) : ''; |
|
722 | 722 | $nonce_ref = 'checkin_nonce'; |
723 | 723 | |
724 | - $this->_verify_nonce( $nonce, $nonce_ref ); |
|
724 | + $this->_verify_nonce($nonce, $nonce_ref); |
|
725 | 725 | |
726 | 726 | //beautiful! Made it this far so let's get the status. |
727 | 727 | $new_status = $this->_toggle_checkin_status(); |
728 | 728 | |
729 | 729 | //setup new class to return via ajax |
730 | - $this->_template_args['admin_page_content'] = 'clickable trigger-checkin checkin-icons checkedin-status-' . $new_status; |
|
730 | + $this->_template_args['admin_page_content'] = 'clickable trigger-checkin checkin-icons checkedin-status-'.$new_status; |
|
731 | 731 | $this->_template_args['success'] = TRUE; |
732 | 732 | $this->_return_json(); |
733 | 733 | } |
@@ -747,32 +747,32 @@ discard block |
||
747 | 747 | //first let's get the query args out of the way for the redirect |
748 | 748 | $query_args = array( |
749 | 749 | 'action' => 'event_registrations', |
750 | - 'event_id' => isset( $this->_req_data['event_id'] ) ? $this->_req_data['event_id'] : NULL, |
|
751 | - 'DTT_ID' => isset( $this->_req_data['DTT_ID'] ) ? $this->_req_data['DTT_ID'] : NULL |
|
750 | + 'event_id' => isset($this->_req_data['event_id']) ? $this->_req_data['event_id'] : NULL, |
|
751 | + 'DTT_ID' => isset($this->_req_data['DTT_ID']) ? $this->_req_data['DTT_ID'] : NULL |
|
752 | 752 | ); |
753 | 753 | $new_status = FALSE; |
754 | 754 | |
755 | 755 | // bulk action check in toggle |
756 | - if ( ! empty( $this->_req_data['checkbox'] ) && is_array( $this->_req_data['checkbox'] )) { |
|
756 | + if ( ! empty($this->_req_data['checkbox']) && is_array($this->_req_data['checkbox'])) { |
|
757 | 757 | // cycle thru checkboxes |
758 | - while ( list( $REG_ID, $value ) = each($this->_req_data['checkbox'])) { |
|
759 | - $DTT_ID = isset( $this->_req_data['DTT_ID'] ) ? $this->_req_data['DTT_ID'] : NULL; |
|
758 | + while (list($REG_ID, $value) = each($this->_req_data['checkbox'])) { |
|
759 | + $DTT_ID = isset($this->_req_data['DTT_ID']) ? $this->_req_data['DTT_ID'] : NULL; |
|
760 | 760 | $new_status = $this->_toggle_checkin($REG_ID, $DTT_ID); |
761 | 761 | } |
762 | 762 | |
763 | - } elseif ( isset( $this->_req_data['_regid'] ) ) { |
|
763 | + } elseif (isset($this->_req_data['_regid'])) { |
|
764 | 764 | //coming from ajax request |
765 | - $DTT_ID = isset( $this->_req_data['dttid'] ) ? $this->_req_data['dttid'] : NULL; |
|
765 | + $DTT_ID = isset($this->_req_data['dttid']) ? $this->_req_data['dttid'] : NULL; |
|
766 | 766 | $query_args['DTT_ID'] = $DTT_ID; |
767 | 767 | $new_status = $this->_toggle_checkin($this->_req_data['_regid'], $DTT_ID); |
768 | 768 | } else { |
769 | - EE_Error::add_error(__('Missing some required data to toggle the Check-in', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ ); |
|
769 | + EE_Error::add_error(__('Missing some required data to toggle the Check-in', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__); |
|
770 | 770 | } |
771 | 771 | |
772 | - if ( defined('DOING_AJAX' ) ) |
|
772 | + if (defined('DOING_AJAX')) |
|
773 | 773 | return $new_status; |
774 | 774 | |
775 | - $this->_redirect_after_action( FALSE,'', '', $query_args, TRUE ); |
|
775 | + $this->_redirect_after_action(FALSE, '', '', $query_args, TRUE); |
|
776 | 776 | |
777 | 777 | } |
778 | 778 | |
@@ -788,11 +788,11 @@ discard block |
||
788 | 788 | */ |
789 | 789 | private function _toggle_checkin($REG_ID, $DTT_ID) { |
790 | 790 | $REG = EEM_Registration::instance()->get_one_by_ID($REG_ID); |
791 | - $new_status = $REG->toggle_checkin_status( $DTT_ID ); |
|
792 | - if ( $new_status !== FALSE ) { |
|
793 | - EE_Error::add_success($REG->get_checkin_msg($DTT_ID) ); |
|
791 | + $new_status = $REG->toggle_checkin_status($DTT_ID); |
|
792 | + if ($new_status !== FALSE) { |
|
793 | + EE_Error::add_success($REG->get_checkin_msg($DTT_ID)); |
|
794 | 794 | } else { |
795 | - EE_Error::add_error($REG->get_checkin_msg($DTT_ID, TRUE), __FILE__, __FUNCTION__, __LINE__ ); |
|
795 | + EE_Error::add_error($REG->get_checkin_msg($DTT_ID, TRUE), __FILE__, __FUNCTION__, __LINE__); |
|
796 | 796 | $new_status = FALSE; |
797 | 797 | } |
798 | 798 | return $new_status; |
@@ -808,28 +808,28 @@ discard block |
||
808 | 808 | protected function _delete_checkin_rows() { |
809 | 809 | $query_args = array( |
810 | 810 | 'action' => 'registration_checkins', |
811 | - 'DTT_ID' => isset( $this->_req_data['DTT_ID'] ) ? $this->_req_data['DTT_ID'] : 0, |
|
812 | - '_REGID' => isset( $this->_req_data['_REGID'] ) ? $this->_req_data['_REGID'] : 0 |
|
811 | + 'DTT_ID' => isset($this->_req_data['DTT_ID']) ? $this->_req_data['DTT_ID'] : 0, |
|
812 | + '_REGID' => isset($this->_req_data['_REGID']) ? $this->_req_data['_REGID'] : 0 |
|
813 | 813 | ); |
814 | - if ( !empty( $this->_req_data['checkbox'] ) && is_array( $this->_req_data['checkbox'] ) ) { |
|
815 | - while ( list( $CHK_ID, $value ) = each( $this->_req_data['checkbox'] ) ) { |
|
814 | + if ( ! empty($this->_req_data['checkbox']) && is_array($this->_req_data['checkbox'])) { |
|
815 | + while (list($CHK_ID, $value) = each($this->_req_data['checkbox'])) { |
|
816 | 816 | $errors = 0; |
817 | - if ( ! EEM_Checkin::instance()->delete_by_ID($CHK_ID ) ) { |
|
817 | + if ( ! EEM_Checkin::instance()->delete_by_ID($CHK_ID)) { |
|
818 | 818 | $errors++; |
819 | 819 | } |
820 | 820 | } |
821 | 821 | } else { |
822 | - EE_Error::add_error(__('So, something went wrong with the bulk delete because there was no data received for instructions on WHAT to delete!', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ ); |
|
823 | - $this->_redirect_after_action( FALSE, '', '', $query_args, TRUE ); |
|
822 | + EE_Error::add_error(__('So, something went wrong with the bulk delete because there was no data received for instructions on WHAT to delete!', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__); |
|
823 | + $this->_redirect_after_action(FALSE, '', '', $query_args, TRUE); |
|
824 | 824 | } |
825 | 825 | |
826 | - if ( $errors > 0 ) { |
|
827 | - EE_Error::add_error( sprintf( __('There were %d records that did not delete successfully', 'event_espresso'), $errors ), __FILE__, __FUNCTION__, __LINE__ ); |
|
826 | + if ($errors > 0) { |
|
827 | + EE_Error::add_error(sprintf(__('There were %d records that did not delete successfully', 'event_espresso'), $errors), __FILE__, __FUNCTION__, __LINE__); |
|
828 | 828 | } else { |
829 | - EE_Error::add_success( __('Records were successfully deleted', 'event_espresso') ); |
|
829 | + EE_Error::add_success(__('Records were successfully deleted', 'event_espresso')); |
|
830 | 830 | } |
831 | 831 | |
832 | - $this->_redirect_after_action( FALSE, '', '', $query_args, TRUE ); |
|
832 | + $this->_redirect_after_action(FALSE, '', '', $query_args, TRUE); |
|
833 | 833 | } |
834 | 834 | |
835 | 835 | |
@@ -841,20 +841,20 @@ discard block |
||
841 | 841 | protected function _delete_checkin_row() { |
842 | 842 | $query_args = array( |
843 | 843 | 'action' => 'registration_checkins', |
844 | - 'DTT_ID' => isset( $this->_req_data['DTT_ID'] ) ? $this->_req_data['DTT_ID'] : 0, |
|
845 | - '_REGID' => isset( $this->_req_data['_REGID'] ) ? $this->_req_data['_REGID'] : 0 |
|
844 | + 'DTT_ID' => isset($this->_req_data['DTT_ID']) ? $this->_req_data['DTT_ID'] : 0, |
|
845 | + '_REGID' => isset($this->_req_data['_REGID']) ? $this->_req_data['_REGID'] : 0 |
|
846 | 846 | ); |
847 | 847 | |
848 | - if ( !empty( $this->_req_data['CHK_ID'] ) ) { |
|
849 | - if ( ! EEM_Checkin::instance()->delete_by_ID($this->_req_data['CHK_ID'] ) ) { |
|
850 | - EE_Error::add_error(__('Something went wrong and this check-in record was not deleted', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ ); |
|
848 | + if ( ! empty($this->_req_data['CHK_ID'])) { |
|
849 | + if ( ! EEM_Checkin::instance()->delete_by_ID($this->_req_data['CHK_ID'])) { |
|
850 | + EE_Error::add_error(__('Something went wrong and this check-in record was not deleted', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__); |
|
851 | 851 | } else { |
852 | - EE_Error::add_success( __('Check-In record successfully deleted', 'event_espresso') ); |
|
852 | + EE_Error::add_success(__('Check-In record successfully deleted', 'event_espresso')); |
|
853 | 853 | } |
854 | 854 | } else { |
855 | - EE_Error::add_error(__('In order to delete a Check-in record, there must be a Check-In ID available. There is not. It is not your fault, there is just a gremlin living in the code', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ ); |
|
855 | + EE_Error::add_error(__('In order to delete a Check-in record, there must be a Check-In ID available. There is not. It is not your fault, there is just a gremlin living in the code', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__); |
|
856 | 856 | } |
857 | - $this->_redirect_after_action( FALSE, '', '', $query_args, TRUE ); |
|
857 | + $this->_redirect_after_action(FALSE, '', '', $query_args, TRUE); |
|
858 | 858 | } |
859 | 859 | |
860 | 860 | |
@@ -867,12 +867,12 @@ discard block |
||
867 | 867 | * @throws \EE_Error |
868 | 868 | */ |
869 | 869 | protected function _event_registrations_list_table() { |
870 | - do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' ); |
|
871 | - $this->_admin_page_title .= isset( $this->_req_data['event_id'] ) |
|
870 | + do_action('AHEE_log', __FILE__, __FUNCTION__, ''); |
|
871 | + $this->_admin_page_title .= isset($this->_req_data['event_id']) |
|
872 | 872 | ? $this->get_action_link_or_button( |
873 | 873 | 'new_registration', |
874 | 874 | 'add-registrant', |
875 | - array( 'event_id' => $this->_req_data['event_id'] ), |
|
875 | + array('event_id' => $this->_req_data['event_id']), |
|
876 | 876 | 'add-new-h2', |
877 | 877 | '', |
878 | 878 | false |
@@ -901,35 +901,35 @@ discard block |
||
901 | 901 | 'desc' => __('View All Check-in Records for this Registrant', 'event_espresso') |
902 | 902 | ), |
903 | 903 | 'approved_status' => array( |
904 | - 'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_approved, |
|
905 | - 'desc' => EEH_Template::pretty_status( EEM_Registration::status_id_approved, FALSE, 'sentence' ) |
|
904 | + 'class' => 'ee-status-legend ee-status-legend-'.EEM_Registration::status_id_approved, |
|
905 | + 'desc' => EEH_Template::pretty_status(EEM_Registration::status_id_approved, FALSE, 'sentence') |
|
906 | 906 | ), |
907 | 907 | 'cancelled_status' => array( |
908 | - 'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_cancelled, |
|
909 | - 'desc' => EEH_Template::pretty_status( EEM_Registration::status_id_cancelled, FALSE, 'sentence' ) |
|
908 | + 'class' => 'ee-status-legend ee-status-legend-'.EEM_Registration::status_id_cancelled, |
|
909 | + 'desc' => EEH_Template::pretty_status(EEM_Registration::status_id_cancelled, FALSE, 'sentence') |
|
910 | 910 | ), |
911 | 911 | 'declined_status' => array( |
912 | - 'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_declined, |
|
913 | - 'desc' => EEH_Template::pretty_status( EEM_Registration::status_id_declined, FALSE, 'sentence' ) |
|
912 | + 'class' => 'ee-status-legend ee-status-legend-'.EEM_Registration::status_id_declined, |
|
913 | + 'desc' => EEH_Template::pretty_status(EEM_Registration::status_id_declined, FALSE, 'sentence') |
|
914 | 914 | ), |
915 | 915 | 'not_approved' => array( |
916 | - 'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_not_approved, |
|
917 | - 'desc' => EEH_Template::pretty_status( EEM_Registration::status_id_not_approved, FALSE, 'sentence' ) |
|
916 | + 'class' => 'ee-status-legend ee-status-legend-'.EEM_Registration::status_id_not_approved, |
|
917 | + 'desc' => EEH_Template::pretty_status(EEM_Registration::status_id_not_approved, FALSE, 'sentence') |
|
918 | 918 | ), |
919 | 919 | 'pending_status' => array( |
920 | - 'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_pending_payment, |
|
921 | - 'desc' => EEH_Template::pretty_status( EEM_Registration::status_id_pending_payment, FALSE, 'sentence' ) |
|
920 | + 'class' => 'ee-status-legend ee-status-legend-'.EEM_Registration::status_id_pending_payment, |
|
921 | + 'desc' => EEH_Template::pretty_status(EEM_Registration::status_id_pending_payment, FALSE, 'sentence') |
|
922 | 922 | ), |
923 | 923 | 'wait_list' => array( |
924 | - 'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_wait_list, |
|
925 | - 'desc' => EEH_Template::pretty_status( EEM_Registration::status_id_wait_list, FALSE, 'sentence' ) |
|
924 | + 'class' => 'ee-status-legend ee-status-legend-'.EEM_Registration::status_id_wait_list, |
|
925 | + 'desc' => EEH_Template::pretty_status(EEM_Registration::status_id_wait_list, FALSE, 'sentence') |
|
926 | 926 | ), |
927 | 927 | ); |
928 | - $this->_template_args['after_list_table'] = $this->_display_legend( $legend_items ); |
|
928 | + $this->_template_args['after_list_table'] = $this->_display_legend($legend_items); |
|
929 | 929 | |
930 | - $event_id = isset( $this->_req_data['event_id'] ) ? $this->_req_data['event_id'] : null; |
|
931 | - $this->_template_args['before_list_table'] = !empty( $event_id ) ? '<h2>' . sprintf(__('Viewing Registrations for Event: %s', 'event_espresso'), EEM_Event::instance()->get_one_by_ID($event_id)->get('EVT_name') ) . '</h2>' : ''; |
|
932 | - $this->_template_args['list_table_hidden_fields'] = !empty( $event_id ) ? '<input type="hidden" name="event_id" value="' . $event_id . '">' : ''; |
|
930 | + $event_id = isset($this->_req_data['event_id']) ? $this->_req_data['event_id'] : null; |
|
931 | + $this->_template_args['before_list_table'] = ! empty($event_id) ? '<h2>'.sprintf(__('Viewing Registrations for Event: %s', 'event_espresso'), EEM_Event::instance()->get_one_by_ID($event_id)->get('EVT_name')).'</h2>' : ''; |
|
932 | + $this->_template_args['list_table_hidden_fields'] = ! empty($event_id) ? '<input type="hidden" name="event_id" value="'.$event_id.'">' : ''; |
|
933 | 933 | |
934 | 934 | $this->display_admin_list_table_page_with_no_sidebar(); |
935 | 935 | } |
@@ -943,15 +943,15 @@ discard block |
||
943 | 943 | * @access public |
944 | 944 | * @return array |
945 | 945 | */ |
946 | - public function get_event_attendees( $per_page = 10, $count = FALSE, $trash = FALSE, $orderby = '' ) { |
|
946 | + public function get_event_attendees($per_page = 10, $count = FALSE, $trash = FALSE, $orderby = '') { |
|
947 | 947 | |
948 | - do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' ); |
|
949 | - require_once(EE_MODELS . 'EEM_Attendee.model.php'); |
|
948 | + do_action('AHEE_log', __FILE__, __FUNCTION__, ''); |
|
949 | + require_once(EE_MODELS.'EEM_Attendee.model.php'); |
|
950 | 950 | //$ATT_MDL = EEM_Attendee::instance(); |
951 | 951 | |
952 | - $EVT_ID = isset($this->_req_data['event_id']) ? absint( $this->_req_data['event_id'] ) : FALSE; |
|
953 | - $CAT_ID = isset($this->_req_data['category_id']) ? absint( $this->_req_data['category_id'] ) : FALSE; |
|
954 | - $DTT_ID = isset( $this->_req_data['DTT_ID'] ) ? $this->_req_data['DTT_ID'] : NULL; |
|
952 | + $EVT_ID = isset($this->_req_data['event_id']) ? absint($this->_req_data['event_id']) : FALSE; |
|
953 | + $CAT_ID = isset($this->_req_data['category_id']) ? absint($this->_req_data['category_id']) : FALSE; |
|
954 | + $DTT_ID = isset($this->_req_data['DTT_ID']) ? $this->_req_data['DTT_ID'] : NULL; |
|
955 | 955 | |
956 | 956 | $this->_req_data['orderby'] = ! empty($this->_req_data['orderby']) ? $this->_req_data['orderby'] : $orderby; |
957 | 957 | |
@@ -964,94 +964,94 @@ discard block |
||
964 | 964 | // $orderby = 'reg.REG_final_price'; |
965 | 965 | } |
966 | 966 | |
967 | - $sort = ( isset( $this->_req_data['order'] ) && ! empty( $this->_req_data['order'] )) ? $this->_req_data['order'] : 'ASC'; |
|
967 | + $sort = (isset($this->_req_data['order']) && ! empty($this->_req_data['order'])) ? $this->_req_data['order'] : 'ASC'; |
|
968 | 968 | |
969 | - $current_page = isset( $this->_req_data['paged'] ) && !empty( $this->_req_data['paged'] ) ? $this->_req_data['paged'] : 1; |
|
970 | - $per_page = isset( $this->_req_data['perpage'] ) && !empty( $this->_req_data['perpage'] ) ? $this->_req_data['perpage'] : $per_page; |
|
969 | + $current_page = isset($this->_req_data['paged']) && ! empty($this->_req_data['paged']) ? $this->_req_data['paged'] : 1; |
|
970 | + $per_page = isset($this->_req_data['perpage']) && ! empty($this->_req_data['perpage']) ? $this->_req_data['perpage'] : $per_page; |
|
971 | 971 | |
972 | 972 | |
973 | - $offset = ($current_page-1)*$per_page; |
|
974 | - $limit = $count ? NULL : array( $offset, $per_page ); |
|
975 | - $query_params = array(array('Event.status'=>array('IN', array_keys(EEM_Event::instance()->get_status_array())))); |
|
976 | - if ($EVT_ID){ |
|
977 | - $query_params[0]['EVT_ID']=$EVT_ID; |
|
973 | + $offset = ($current_page - 1) * $per_page; |
|
974 | + $limit = $count ? NULL : array($offset, $per_page); |
|
975 | + $query_params = array(array('Event.status'=>array('IN', array_keys(EEM_Event::instance()->get_status_array())))); |
|
976 | + if ($EVT_ID) { |
|
977 | + $query_params[0]['EVT_ID'] = $EVT_ID; |
|
978 | 978 | } |
979 | - if($CAT_ID){ |
|
979 | + if ($CAT_ID) { |
|
980 | 980 | throw new EE_Error("You specified a Category Id for this query. Thats odd because we are now using terms and taxonomies. So did you mean the term taxonomy id o rthe term id?"); |
981 | 981 | } |
982 | 982 | |
983 | 983 | //if DTT is included we do multiple datetimes. |
984 | - if ( $DTT_ID ) { |
|
984 | + if ($DTT_ID) { |
|
985 | 985 | $query_params[0]['Ticket.Datetime.DTT_ID'] = $DTT_ID; |
986 | 986 | } |
987 | 987 | |
988 | 988 | //make sure we only have default where on the current regs |
989 | 989 | $query_params['default_where_conditions'] = 'this_model_only'; |
990 | 990 | |
991 | - $status_ids_array = apply_filters( 'FHEE__Extend_Registrations_Admin_Page__get_event_attendees__status_ids_array', array( EEM_Registration::status_id_pending_payment, EEM_Registration::status_id_approved ) ); |
|
991 | + $status_ids_array = apply_filters('FHEE__Extend_Registrations_Admin_Page__get_event_attendees__status_ids_array', array(EEM_Registration::status_id_pending_payment, EEM_Registration::status_id_approved)); |
|
992 | 992 | |
993 | - $query_params[0]['STS_ID']= array('IN', $status_ids_array ); |
|
993 | + $query_params[0]['STS_ID'] = array('IN', $status_ids_array); |
|
994 | 994 | |
995 | - if($trash){ |
|
996 | - $query_params[0]['Attendee.status']= EEM_CPT_Base::post_status_trashed; |
|
995 | + if ($trash) { |
|
996 | + $query_params[0]['Attendee.status'] = EEM_CPT_Base::post_status_trashed; |
|
997 | 997 | } |
998 | 998 | |
999 | - if ( isset( $this->_req_data['s'] ) ) { |
|
1000 | - $sstr = '%' . $this->_req_data['s'] . '%'; |
|
999 | + if (isset($this->_req_data['s'])) { |
|
1000 | + $sstr = '%'.$this->_req_data['s'].'%'; |
|
1001 | 1001 | $query_params[0]['OR'] = array( |
1002 | - 'Event.EVT_name' => array( 'LIKE', $sstr), |
|
1003 | - 'Event.EVT_desc' => array( 'LIKE', $sstr ), |
|
1004 | - 'Event.EVT_short_desc' => array( 'LIKE' , $sstr ), |
|
1005 | - 'Attendee.ATT_fname' => array( 'LIKE', $sstr ), |
|
1006 | - 'Attendee.ATT_lname' => array( 'LIKE', $sstr ), |
|
1007 | - 'Attendee.ATT_short_bio' => array( 'LIKE', $sstr ), |
|
1008 | - 'Attendee.ATT_email' => array('LIKE', $sstr ), |
|
1009 | - 'Attendee.ATT_address' => array( 'LIKE', $sstr ), |
|
1010 | - 'Attendee.ATT_address2' => array( 'LIKE', $sstr ), |
|
1011 | - 'Attendee.ATT_city' => array( 'LIKE', $sstr ), |
|
1012 | - 'REG_final_price' => array( 'LIKE', $sstr ), |
|
1013 | - 'REG_code' => array( 'LIKE', $sstr ), |
|
1014 | - 'REG_count' => array( 'LIKE' , $sstr ), |
|
1015 | - 'REG_group_size' => array( 'LIKE' , $sstr ), |
|
1016 | - 'Ticket.TKT_name' => array( 'LIKE', $sstr ), |
|
1017 | - 'Ticket.TKT_description' => array( 'LIKE', $sstr ) |
|
1002 | + 'Event.EVT_name' => array('LIKE', $sstr), |
|
1003 | + 'Event.EVT_desc' => array('LIKE', $sstr), |
|
1004 | + 'Event.EVT_short_desc' => array('LIKE', $sstr), |
|
1005 | + 'Attendee.ATT_fname' => array('LIKE', $sstr), |
|
1006 | + 'Attendee.ATT_lname' => array('LIKE', $sstr), |
|
1007 | + 'Attendee.ATT_short_bio' => array('LIKE', $sstr), |
|
1008 | + 'Attendee.ATT_email' => array('LIKE', $sstr), |
|
1009 | + 'Attendee.ATT_address' => array('LIKE', $sstr), |
|
1010 | + 'Attendee.ATT_address2' => array('LIKE', $sstr), |
|
1011 | + 'Attendee.ATT_city' => array('LIKE', $sstr), |
|
1012 | + 'REG_final_price' => array('LIKE', $sstr), |
|
1013 | + 'REG_code' => array('LIKE', $sstr), |
|
1014 | + 'REG_count' => array('LIKE', $sstr), |
|
1015 | + 'REG_group_size' => array('LIKE', $sstr), |
|
1016 | + 'Ticket.TKT_name' => array('LIKE', $sstr), |
|
1017 | + 'Ticket.TKT_description' => array('LIKE', $sstr) |
|
1018 | 1018 | ); |
1019 | 1019 | } |
1020 | 1020 | |
1021 | 1021 | $query_params['order_by'][$orderby] = $sort; |
1022 | 1022 | $query_params['limit'] = $limit; |
1023 | - $query_params['force_join'] = array('Attendee');//force join to attendee model so that it gets cached, because we're going to need the attendee for each registration |
|
1024 | - if($count){ |
|
1025 | - $registrations = EEM_Registration::instance()->count(array($query_params[0], 'default_where_conditions' => 'this_model_only' )); |
|
1026 | - }else{ |
|
1023 | + $query_params['force_join'] = array('Attendee'); //force join to attendee model so that it gets cached, because we're going to need the attendee for each registration |
|
1024 | + if ($count) { |
|
1025 | + $registrations = EEM_Registration::instance()->count(array($query_params[0], 'default_where_conditions' => 'this_model_only')); |
|
1026 | + } else { |
|
1027 | 1027 | $registrations = EEM_Registration::instance()->get_all($query_params); |
1028 | 1028 | |
1029 | 1029 | |
1030 | 1030 | // $registrations = EEM_Registration::instance(); |
1031 | 1031 | // $all_attendees = EEM_Attendee::instance()->get_event_attendees( $EVT_ID, $CAT_ID, $reg_status, $trash, $orderby, $sort, $limit, $output ); |
1032 | - if ( isset( $registrations[0] ) && $registrations[0] instanceof EE_Registration ) { |
|
1032 | + if (isset($registrations[0]) && $registrations[0] instanceof EE_Registration) { |
|
1033 | 1033 | //EEH_Debug_Tools::printr( $all_attendees[0], '$all_attendees[0] <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' ); |
1034 | 1034 | // name |
1035 | 1035 | $first_registration = $registrations[0]; |
1036 | 1036 | $event_obj = $first_registration->event_obj(); |
1037 | - if($event_obj){ |
|
1037 | + if ($event_obj) { |
|
1038 | 1038 | $event_name = $first_registration->event_obj()->name(); |
1039 | - $event_date = 'TODO: we need to get date from earliest price date or should this be the actual event date?';//$first_registration->date_obj()->reg_start_date_and_time('l F j, Y,', ' g:i:s a');// isset( $registrations[0]->DTT_EVT_start ) ? date( 'l F j, Y, g:i:s a', $registrations[0]->DTT_EVT_start ) : ''; |
|
1039 | + $event_date = 'TODO: we need to get date from earliest price date or should this be the actual event date?'; //$first_registration->date_obj()->reg_start_date_and_time('l F j, Y,', ' g:i:s a');// isset( $registrations[0]->DTT_EVT_start ) ? date( 'l F j, Y, g:i:s a', $registrations[0]->DTT_EVT_start ) : ''; |
|
1040 | 1040 | // edit event link |
1041 | - if ( $event_name != '' ) { |
|
1042 | - $edit_event_url = self::add_query_args_and_nonce( array( 'action'=>'edit_event', 'EVT_ID'=>$EVT_ID ), EVENTS_ADMIN_URL ); |
|
1043 | - $edit_event_lnk = '<a href="'.$edit_event_url.'" title="' . esc_attr__( 'Edit ', 'event_espresso' ) . $event_name . '">' . __( 'Edit Event', 'event_espresso' ) . '</a>'; |
|
1044 | - $event_name .= ' <span class="admin-page-header-edit-lnk not-bold">' . $edit_event_lnk . '</span>' ; |
|
1041 | + if ($event_name != '') { |
|
1042 | + $edit_event_url = self::add_query_args_and_nonce(array('action'=>'edit_event', 'EVT_ID'=>$EVT_ID), EVENTS_ADMIN_URL); |
|
1043 | + $edit_event_lnk = '<a href="'.$edit_event_url.'" title="'.esc_attr__('Edit ', 'event_espresso').$event_name.'">'.__('Edit Event', 'event_espresso').'</a>'; |
|
1044 | + $event_name .= ' <span class="admin-page-header-edit-lnk not-bold">'.$edit_event_lnk.'</span>'; |
|
1045 | 1045 | } |
1046 | 1046 | |
1047 | - $back_2_reg_url = self::add_query_args_and_nonce( array( 'action'=>'default' ), REG_ADMIN_URL ); |
|
1048 | - $back_2_reg_lnk = '<a href="'.$back_2_reg_url.'" title="' . esc_attr__( 'click to return to viewing all registrations ', 'event_espresso' ) . '">« ' . __( 'Back to All Registrations', 'event_espresso' ) . '</a>'; |
|
1047 | + $back_2_reg_url = self::add_query_args_and_nonce(array('action'=>'default'), REG_ADMIN_URL); |
|
1048 | + $back_2_reg_lnk = '<a href="'.$back_2_reg_url.'" title="'.esc_attr__('click to return to viewing all registrations ', 'event_espresso').'">« '.__('Back to All Registrations', 'event_espresso').'</a>'; |
|
1049 | 1049 | |
1050 | 1050 | $this->_template_args['before_admin_page_content'] = ' |
1051 | 1051 | <div id="admin-page-header"> |
1052 | - <h1><span class="small-text not-bold">'.__( 'Event: ', 'event_espresso' ).'</span>'. $event_name .'</h1> |
|
1053 | - <h3><span class="small-text not-bold">'.__( 'Date: ', 'event_espresso' ). '</span>'. $event_date .'</h3> |
|
1054 | - <span class="admin-page-header-go-back-lnk not-bold">' . $back_2_reg_lnk . '</span> |
|
1052 | + <h1><span class="small-text not-bold">'.__('Event: ', 'event_espresso').'</span>'.$event_name.'</h1> |
|
1053 | + <h3><span class="small-text not-bold">'.__('Date: ', 'event_espresso').'</span>'.$event_date.'</h3> |
|
1054 | + <span class="admin-page-header-go-back-lnk not-bold">' . $back_2_reg_lnk.'</span> |
|
1055 | 1055 | </div> |
1056 | 1056 | '; |
1057 | 1057 | } |
@@ -32,7 +32,7 @@ |
||
32 | 32 | <input type="hidden" id="get_newsletter_form_content_nonce" name="get_newsletter_form_content_nonce" value="<?php echo $ajax_nonce; ?>"> |
33 | 33 | <input type="hidden" name="batch_message[id_type]" value="<?php echo $id_type; ?>"> |
34 | 34 | <input id="newsletter-batch-ids" type="hidden" name="batch_message[ids]" value=""> |
35 | - <h3 class="newsletter-send-form-title"><?php printf( __('Sending batch message to %s people...', 'event_espresso'), '[NUMPEOPLE]' ); ?></h3> |
|
35 | + <h3 class="newsletter-send-form-title"><?php printf(__('Sending batch message to %s people...', 'event_espresso'), '[NUMPEOPLE]'); ?></h3> |
|
36 | 36 | <label for="batch-message-template-selector"><?php _e('Select Template:', 'event_espresso'); ?></label> |
37 | 37 | <?php echo $template_selector; ?> |
38 | 38 | <div class="batch-message-edit-fields" style="display:none;"> |
@@ -38,7 +38,7 @@ |
||
38 | 38 | </dt> |
39 | 39 | <dd> |
40 | 40 | <p> |
41 | - <?php printf( __('You can add the events or venues page as items to the navigation menu by going to Appearance --> Menus and check the boxes found under the %sEvent Espresso Pages%s section. Then click the Add to Menu button and finally click on the Save Menu button.', 'event_espresso'), '<strong>', '</strong>' ); ?> |
|
41 | + <?php printf(__('You can add the events or venues page as items to the navigation menu by going to Appearance --> Menus and check the boxes found under the %sEvent Espresso Pages%s section. Then click the Add to Menu button and finally click on the Save Menu button.', 'event_espresso'), '<strong>', '</strong>'); ?> |
|
42 | 42 | <br /> |
43 | 43 | <?php _e('Quick Link:', 'event_espresso'); ?> |
44 | 44 | <a href="<?php echo site_url('/wp-admin/nav-menus.php'); ?>"><?php _e('Menu Manager', 'event_espresso'); ?></a> |
@@ -28,9 +28,9 @@ discard block |
||
28 | 28 | */ |
29 | 29 | class Price_Types_List_Table extends EE_Admin_List_Table { |
30 | 30 | |
31 | - public function __construct( $admin_page ) { |
|
31 | + public function __construct($admin_page) { |
|
32 | 32 | parent::__construct($admin_page); |
33 | - require_once(EE_MODELS . 'EEM_Price_Type.model.php'); |
|
33 | + require_once(EE_MODELS.'EEM_Price_Type.model.php'); |
|
34 | 34 | $this->_PRT = EEM_Price_Type::instance(); |
35 | 35 | } |
36 | 36 | |
@@ -39,9 +39,9 @@ discard block |
||
39 | 39 | |
40 | 40 | protected function _setup_data() { |
41 | 41 | $trashed = $this->_admin_page->get_view() == 'trashed' ? TRUE : FALSE; |
42 | - $this->_data = $this->_admin_page->get_price_types_overview_data( $this->_per_page, FALSE, $trashed ); |
|
43 | - $this->_all_data_count = $this->_admin_page->get_price_types_overview_data( $this->_per_page, TRUE, FALSE ); |
|
44 | - $this->_trashed_count = $this->_admin_page->get_price_types_overview_data( $this->_per_page, TRUE, TRUE ); |
|
42 | + $this->_data = $this->_admin_page->get_price_types_overview_data($this->_per_page, FALSE, $trashed); |
|
43 | + $this->_all_data_count = $this->_admin_page->get_price_types_overview_data($this->_per_page, TRUE, FALSE); |
|
44 | + $this->_trashed_count = $this->_admin_page->get_price_types_overview_data($this->_per_page, TRUE, TRUE); |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | |
@@ -57,14 +57,14 @@ discard block |
||
57 | 57 | $this->_columns = array( |
58 | 58 | 'cb' => '<input type="checkbox" />', //Render a checkbox instead of text |
59 | 59 | 'name' => __('Name', 'event_espresso'), |
60 | - 'base_type' => '<div class="jst-cntr">' . __('Base Type', 'event_espresso') . '</div>', |
|
61 | - 'percent' => '<div class="jst-cntr">' . __('Applied', 'event_espresso') . '<br/>' . __('as ', 'event_espresso') . '<span class="big-text">' . __('%', 'event_espresso') . '</span>' . __(' or ', 'event_espresso') . '<span class="big-text">' . __('$', 'event_espresso') . '</span></div>', |
|
62 | - 'order' => '<div class="jst-cntr">' . __('Order of', 'event_espresso') . '<br/>' . __('Application', 'event_espresso') . '</div>' |
|
60 | + 'base_type' => '<div class="jst-cntr">'.__('Base Type', 'event_espresso').'</div>', |
|
61 | + 'percent' => '<div class="jst-cntr">'.__('Applied', 'event_espresso').'<br/>'.__('as ', 'event_espresso').'<span class="big-text">'.__('%', 'event_espresso').'</span>'.__(' or ', 'event_espresso').'<span class="big-text">'.__('$', 'event_espresso').'</span></div>', |
|
62 | + 'order' => '<div class="jst-cntr">'.__('Order of', 'event_espresso').'<br/>'.__('Application', 'event_espresso').'</div>' |
|
63 | 63 | ); |
64 | 64 | |
65 | 65 | $this->_sortable_columns = array( |
66 | 66 | // TRUE means its already sorted |
67 | - 'name' => array( 'name' => FALSE ) |
|
67 | + 'name' => array('name' => FALSE) |
|
68 | 68 | ); |
69 | 69 | |
70 | 70 | $this->_hidden_columns = array(); |
@@ -82,7 +82,7 @@ discard block |
||
82 | 82 | |
83 | 83 | protected function _add_view_counts() { |
84 | 84 | $this->_views['all']['count'] = $this->_all_data_count; |
85 | - if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_default_price_types', 'pricing_trash_price_type' ) ) { |
|
85 | + if (EE_Registry::instance()->CAP->current_user_can('ee_delete_default_price_types', 'pricing_trash_price_type')) { |
|
86 | 86 | $this->_views['trashed']['count'] = $this->_trashed_count; |
87 | 87 | } |
88 | 88 | } |
@@ -92,8 +92,8 @@ discard block |
||
92 | 92 | |
93 | 93 | |
94 | 94 | function column_cb($item) { |
95 | - if ( $item->base_type() !== 1 ) |
|
96 | - return sprintf( '<input type="checkbox" name="checkbox[%1$s]" />', /* $1%s */ $item->ID() ); |
|
95 | + if ($item->base_type() !== 1) |
|
96 | + return sprintf('<input type="checkbox" name="checkbox[%1$s]" />', /* $1%s */ $item->ID()); |
|
97 | 97 | return ''; |
98 | 98 | } |
99 | 99 | |
@@ -106,30 +106,30 @@ discard block |
||
106 | 106 | //Build row actions |
107 | 107 | $actions = array(); |
108 | 108 | // edit price link |
109 | - if ( EE_Registry::instance()->CAP->current_user_can( 'ee_edit_default_price_type', 'pricing_edit_price_type', $item->ID() ) ) { |
|
110 | - $edit_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'edit_price_type', 'id'=>$item->ID() ), PRICING_ADMIN_URL ); |
|
111 | - $actions['edit'] = '<a href="'.$edit_lnk_url.'" title="' . esc_attr__( 'Edit Price Type', 'event_espresso' ) . '">' . __( 'Edit', 'event_espresso' ) . '</a>'; |
|
109 | + if (EE_Registry::instance()->CAP->current_user_can('ee_edit_default_price_type', 'pricing_edit_price_type', $item->ID())) { |
|
110 | + $edit_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'edit_price_type', 'id'=>$item->ID()), PRICING_ADMIN_URL); |
|
111 | + $actions['edit'] = '<a href="'.$edit_lnk_url.'" title="'.esc_attr__('Edit Price Type', 'event_espresso').'">'.__('Edit', 'event_espresso').'</a>'; |
|
112 | 112 | } |
113 | 113 | |
114 | - $name_link = EE_Registry::instance()->CAP->current_user_can( 'ee_edit_default_price_type', 'pricing_edit_price_type', $item->ID() ) ? '<a href="'.$edit_lnk_url.'" title="' . esc_attr__( 'Edit Price Type', 'event_espresso' ) . '">' . stripslashes( $item->name() ) . '</a>' : $item->name(); |
|
114 | + $name_link = EE_Registry::instance()->CAP->current_user_can('ee_edit_default_price_type', 'pricing_edit_price_type', $item->ID()) ? '<a href="'.$edit_lnk_url.'" title="'.esc_attr__('Edit Price Type', 'event_espresso').'">'.stripslashes($item->name()).'</a>' : $item->name(); |
|
115 | 115 | |
116 | - if ( $item->base_type() !== 1 ) { |
|
117 | - if ( $this->_view == 'all' ) { |
|
116 | + if ($item->base_type() !== 1) { |
|
117 | + if ($this->_view == 'all') { |
|
118 | 118 | // trash price link |
119 | - if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_default_price_type', 'pricing_trash_price_type', $item->ID() ) ) { |
|
120 | - $trash_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'trash_price_type', 'id'=>$item->ID(), 'noheader' => TRUE ), PRICING_ADMIN_URL ); |
|
121 | - $actions['trash'] = '<a href="'.$trash_lnk_url.'" title="' . esc_attr__( 'Move Price Type to Trash', 'event_espresso' ) . '">' . __( 'Move to Trash', 'event_espresso' ) . '</a>'; |
|
119 | + if (EE_Registry::instance()->CAP->current_user_can('ee_delete_default_price_type', 'pricing_trash_price_type', $item->ID())) { |
|
120 | + $trash_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'trash_price_type', 'id'=>$item->ID(), 'noheader' => TRUE), PRICING_ADMIN_URL); |
|
121 | + $actions['trash'] = '<a href="'.$trash_lnk_url.'" title="'.esc_attr__('Move Price Type to Trash', 'event_espresso').'">'.__('Move to Trash', 'event_espresso').'</a>'; |
|
122 | 122 | } |
123 | 123 | } else { |
124 | 124 | // restore price link |
125 | - if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_default_price_type', 'pricing_restore_price_type', $item->ID() ) ) { |
|
126 | - $restore_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'restore_price_type', 'id'=>$item->ID(), 'noheader' => TRUE ), PRICING_ADMIN_URL ); |
|
127 | - $actions['restore'] = '<a href="'.$restore_lnk_url.'" title="' . esc_attr__( 'Restore Price Type', 'event_espresso' ) . '">' . __( 'Restore', 'event_espresso' ) . '</a>'; |
|
125 | + if (EE_Registry::instance()->CAP->current_user_can('ee_delete_default_price_type', 'pricing_restore_price_type', $item->ID())) { |
|
126 | + $restore_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'restore_price_type', 'id'=>$item->ID(), 'noheader' => TRUE), PRICING_ADMIN_URL); |
|
127 | + $actions['restore'] = '<a href="'.$restore_lnk_url.'" title="'.esc_attr__('Restore Price Type', 'event_espresso').'">'.__('Restore', 'event_espresso').'</a>'; |
|
128 | 128 | } |
129 | 129 | // delete price link |
130 | - if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_default_price_type', 'pricing_delete_price_type', $item->ID() ) ) { |
|
131 | - $delete_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'delete_price_type', 'id'=>$item->ID(), 'noheader' => TRUE ), PRICING_ADMIN_URL ); |
|
132 | - $actions['delete'] = '<a href="'.$delete_lnk_url.'" title="' . esc_attr__( 'Delete Price Type Permanently', 'event_espresso' ) . '">' . __( 'Delete Permanently', 'event_espresso' ) . '</a>'; |
|
130 | + if (EE_Registry::instance()->CAP->current_user_can('ee_delete_default_price_type', 'pricing_delete_price_type', $item->ID())) { |
|
131 | + $delete_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'delete_price_type', 'id'=>$item->ID(), 'noheader' => TRUE), PRICING_ADMIN_URL); |
|
132 | + $actions['delete'] = '<a href="'.$delete_lnk_url.'" title="'.esc_attr__('Delete Price Type Permanently', 'event_espresso').'">'.__('Delete Permanently', 'event_espresso').'</a>'; |
|
133 | 133 | } |
134 | 134 | } |
135 | 135 | } |
@@ -147,14 +147,14 @@ discard block |
||
147 | 147 | |
148 | 148 | |
149 | 149 | function column_base_type($item) { |
150 | - return '<div class="jst-cntr">' . $item->base_type_name() . '</div>'; |
|
150 | + return '<div class="jst-cntr">'.$item->base_type_name().'</div>'; |
|
151 | 151 | } |
152 | 152 | |
153 | 153 | |
154 | 154 | |
155 | 155 | |
156 | 156 | function column_percent($item) { |
157 | - return '<div class="jst-cntr">' . ( $item->is_percent() ? '%' : EE_Registry::instance()->CFG->currency->sign ) . '</div>'; |
|
157 | + return '<div class="jst-cntr">'.($item->is_percent() ? '%' : EE_Registry::instance()->CFG->currency->sign).'</div>'; |
|
158 | 158 | } |
159 | 159 | |
160 | 160 | |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | |
163 | 163 | |
164 | 164 | function column_order($item) { |
165 | - return '<div class="jst-cntr">' . $item->order() . '</div>'; |
|
165 | + return '<div class="jst-cntr">'.$item->order().'</div>'; |
|
166 | 166 | } |
167 | 167 | |
168 | 168 |
@@ -1,4 +1,6 @@ discard block |
||
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 | /** |
4 | 6 | * Event Espresso |
@@ -92,8 +94,9 @@ discard block |
||
92 | 94 | |
93 | 95 | |
94 | 96 | function column_cb($item) { |
95 | - if ( $item->base_type() !== 1 ) |
|
96 | - return sprintf( '<input type="checkbox" name="checkbox[%1$s]" />', /* $1%s */ $item->ID() ); |
|
97 | + if ( $item->base_type() !== 1 ) { |
|
98 | + return sprintf( '<input type="checkbox" name="checkbox[%1$s]" />', /* $1%s */ $item->ID() ); |
|
99 | + } |
|
97 | 100 | return ''; |
98 | 101 | } |
99 | 102 |
@@ -79,10 +79,10 @@ |
||
79 | 79 | 'amount' => array( 'amount' => FALSE ) |
80 | 80 | ); |
81 | 81 | |
82 | - $this->_hidden_columns = array( |
|
82 | + $this->_hidden_columns = array( |
|
83 | 83 | ); |
84 | 84 | |
85 | - $this->_ajax_sorting_callback = 'update_prices_order'; |
|
85 | + $this->_ajax_sorting_callback = 'update_prices_order'; |
|
86 | 86 | |
87 | 87 | } |
88 | 88 |
@@ -1,4 +1,6 @@ discard block |
||
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 | /** |
4 | 6 | * Event Espresso |
@@ -118,8 +120,9 @@ discard block |
||
118 | 120 | |
119 | 121 | $new_row = $row_class; |
120 | 122 | |
121 | - if ( $item->type_obj()->base_type() !== 1 && $item->type_obj()->base_type() !== 4 ) |
|
122 | - $new_row .= ' rowsortable'; |
|
123 | + if ( $item->type_obj()->base_type() !== 1 && $item->type_obj()->base_type() !== 4 ) { |
|
124 | + $new_row .= ' rowsortable'; |
|
125 | + } |
|
123 | 126 | |
124 | 127 | return ' class="' . $new_row . '"'; |
125 | 128 | } |
@@ -131,8 +134,9 @@ discard block |
||
131 | 134 | |
132 | 135 | |
133 | 136 | function column_cb($item) { |
134 | - if ( $item->type_obj()->base_type() !== 1 ) |
|
135 | - return sprintf( '<input type="checkbox" name="checkbox[%1$s]" value="%1$s" />', /* $1%s */ $item->ID() ); |
|
137 | + if ( $item->type_obj()->base_type() !== 1 ) { |
|
138 | + return sprintf( '<input type="checkbox" name="checkbox[%1$s]" value="%1$s" />', /* $1%s */ $item->ID() ); |
|
139 | + } |
|
136 | 140 | return ''; |
137 | 141 | } |
138 | 142 |
@@ -36,9 +36,9 @@ discard block |
||
36 | 36 | */ |
37 | 37 | protected $_price_types = array(); |
38 | 38 | |
39 | - public function __construct( $admin_page ) { |
|
39 | + public function __construct($admin_page) { |
|
40 | 40 | parent::__construct($admin_page); |
41 | - require_once(EE_MODELS . 'EEM_Price_Type.model.php'); |
|
41 | + require_once(EE_MODELS.'EEM_Price_Type.model.php'); |
|
42 | 42 | $this->_PRT = EEM_Price_Type::instance(); |
43 | 43 | $this->_price_types = $this->_PRT->get_all_deleted_and_undeleted(); |
44 | 44 | } |
@@ -48,9 +48,9 @@ discard block |
||
48 | 48 | |
49 | 49 | protected function _setup_data() { |
50 | 50 | $trashed = $this->_admin_page->get_view() == 'trashed' ? true : false; |
51 | - $this->_data = $this->_admin_page->get_prices_overview_data( $this->_per_page, false, $trashed ); |
|
52 | - $this->_all_data_count = $this->_admin_page->get_prices_overview_data( $this->_per_page, true, false ); |
|
53 | - $this->_trashed_count = $this->_admin_page->get_prices_overview_data( $this->_per_page, true, true ); |
|
51 | + $this->_data = $this->_admin_page->get_prices_overview_data($this->_per_page, false, $trashed); |
|
52 | + $this->_all_data_count = $this->_admin_page->get_prices_overview_data($this->_per_page, true, false); |
|
53 | + $this->_trashed_count = $this->_admin_page->get_prices_overview_data($this->_per_page, true, true); |
|
54 | 54 | } |
55 | 55 | |
56 | 56 | |
@@ -74,9 +74,9 @@ discard block |
||
74 | 74 | |
75 | 75 | $this->_sortable_columns = array( |
76 | 76 | // true means its already sorted |
77 | - 'name' => array( 'name' => false ), |
|
78 | - 'type' => array( 'type' => false ), |
|
79 | - 'amount' => array( 'amount' => false ) |
|
77 | + 'name' => array('name' => false), |
|
78 | + 'type' => array('type' => false), |
|
79 | + 'amount' => array('amount' => false) |
|
80 | 80 | ); |
81 | 81 | |
82 | 82 | $this->_hidden_columns = array( |
@@ -98,7 +98,7 @@ discard block |
||
98 | 98 | |
99 | 99 | protected function _add_view_counts() { |
100 | 100 | $this->_views['all']['count'] = $this->_all_data_count; |
101 | - if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_default_prices', 'pricing_trash_price') ) { |
|
101 | + if (EE_Registry::instance()->CAP->current_user_can('ee_delete_default_prices', 'pricing_trash_price')) { |
|
102 | 102 | $this->_views['trashed']['count'] = $this->_trashed_count; |
103 | 103 | } |
104 | 104 | } |
@@ -112,16 +112,16 @@ discard block |
||
112 | 112 | * @param object $item the current item |
113 | 113 | * @return string |
114 | 114 | */ |
115 | - protected function _get_row_class( $item ) { |
|
115 | + protected function _get_row_class($item) { |
|
116 | 116 | static $row_class = ''; |
117 | - $row_class = ( $row_class == '' ? 'alternate' : '' ); |
|
117 | + $row_class = ($row_class == '' ? 'alternate' : ''); |
|
118 | 118 | |
119 | 119 | $new_row = $row_class; |
120 | 120 | |
121 | - if ( $item->type_obj()->base_type() !== 1 && $item->type_obj()->base_type() !== 4 ) |
|
121 | + if ($item->type_obj()->base_type() !== 1 && $item->type_obj()->base_type() !== 4) |
|
122 | 122 | $new_row .= ' rowsortable'; |
123 | 123 | |
124 | - return ' class="' . $new_row . '"'; |
|
124 | + return ' class="'.$new_row.'"'; |
|
125 | 125 | } |
126 | 126 | |
127 | 127 | |
@@ -131,8 +131,8 @@ discard block |
||
131 | 131 | |
132 | 132 | |
133 | 133 | function column_cb($item) { |
134 | - if ( $item->type_obj()->base_type() !== 1 ) |
|
135 | - return sprintf( '<input type="checkbox" name="checkbox[%1$s]" value="%1$s" />', /* $1%s */ $item->ID() ); |
|
134 | + if ($item->type_obj()->base_type() !== 1) |
|
135 | + return sprintf('<input type="checkbox" name="checkbox[%1$s]" value="%1$s" />', /* $1%s */ $item->ID()); |
|
136 | 136 | return ''; |
137 | 137 | } |
138 | 138 | |
@@ -145,31 +145,31 @@ discard block |
||
145 | 145 | //Build row actions |
146 | 146 | $actions = array(); |
147 | 147 | // edit price link |
148 | - if ( EE_Registry::instance()->CAP->current_user_can( 'ee_edit_default_price', 'pricing_edit_price', $item->ID() ) ) { |
|
149 | - $edit_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'edit_price', 'id'=>$item->ID() ), PRICING_ADMIN_URL ); |
|
150 | - $actions['edit'] = '<a href="'.$edit_lnk_url.'" title="' . esc_attr__( 'Edit Price', 'event_espresso' ) . '">' . __( 'Edit', 'event_espresso' ) . '</a>'; |
|
148 | + if (EE_Registry::instance()->CAP->current_user_can('ee_edit_default_price', 'pricing_edit_price', $item->ID())) { |
|
149 | + $edit_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'edit_price', 'id'=>$item->ID()), PRICING_ADMIN_URL); |
|
150 | + $actions['edit'] = '<a href="'.$edit_lnk_url.'" title="'.esc_attr__('Edit Price', 'event_espresso').'">'.__('Edit', 'event_espresso').'</a>'; |
|
151 | 151 | } |
152 | 152 | |
153 | - $name_link = EE_Registry::instance()->CAP->current_user_can( 'ee_edit_default_price', 'edit_price', $item->ID() ) ? '<a href="'.$edit_lnk_url.'" title="' . esc_attr__( 'Edit Price', 'event_espresso' ) . '">' . stripslashes( $item->name() ) . '</a>' : $item->name(); |
|
153 | + $name_link = EE_Registry::instance()->CAP->current_user_can('ee_edit_default_price', 'edit_price', $item->ID()) ? '<a href="'.$edit_lnk_url.'" title="'.esc_attr__('Edit Price', 'event_espresso').'">'.stripslashes($item->name()).'</a>' : $item->name(); |
|
154 | 154 | |
155 | - if ( $item->type_obj()->base_type() !== 1 ) { |
|
155 | + if ($item->type_obj()->base_type() !== 1) { |
|
156 | 156 | if ($this->_view == 'all') { |
157 | 157 | // trash price link |
158 | - if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_default_price', 'pricing_trash_price', $item->ID() ) ) { |
|
159 | - $trash_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'trash_price', 'id'=>$item->ID(), 'noheader' => true ), PRICING_ADMIN_URL ); |
|
160 | - $actions['trash'] = '<a href="'.$trash_lnk_url.'" title="' . esc_attr__( 'Move Price to Trash', 'event_espresso' ) . '">' . __( 'Move to Trash', 'event_espresso' ) . '</a>'; |
|
158 | + if (EE_Registry::instance()->CAP->current_user_can('ee_delete_default_price', 'pricing_trash_price', $item->ID())) { |
|
159 | + $trash_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'trash_price', 'id'=>$item->ID(), 'noheader' => true), PRICING_ADMIN_URL); |
|
160 | + $actions['trash'] = '<a href="'.$trash_lnk_url.'" title="'.esc_attr__('Move Price to Trash', 'event_espresso').'">'.__('Move to Trash', 'event_espresso').'</a>'; |
|
161 | 161 | } |
162 | 162 | } else { |
163 | - if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_default_price', 'pricing_restore_price', $item->ID() ) ) { |
|
163 | + if (EE_Registry::instance()->CAP->current_user_can('ee_delete_default_price', 'pricing_restore_price', $item->ID())) { |
|
164 | 164 | // restore price link |
165 | - $restore_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'restore_price', 'id'=>$item->ID(), 'noheader' => true ), PRICING_ADMIN_URL ); |
|
166 | - $actions['restore'] = '<a href="'.$restore_lnk_url.'" title="' . esc_attr__( 'Restore Price', 'event_espresso' ) . '">' . __( 'Restore', 'event_espresso' ) . '</a>'; |
|
165 | + $restore_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'restore_price', 'id'=>$item->ID(), 'noheader' => true), PRICING_ADMIN_URL); |
|
166 | + $actions['restore'] = '<a href="'.$restore_lnk_url.'" title="'.esc_attr__('Restore Price', 'event_espresso').'">'.__('Restore', 'event_espresso').'</a>'; |
|
167 | 167 | } |
168 | 168 | |
169 | 169 | // delete price link |
170 | - if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_default_price', 'pricing_delete_price', $item->ID() ) ) { |
|
171 | - $delete_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'delete_price', 'id'=>$item->ID(), 'noheader' => true ), PRICING_ADMIN_URL ); |
|
172 | - $actions['delete'] = '<a href="'.$delete_lnk_url.'" title="' . esc_attr__( 'Delete Price Permanently', 'event_espresso' ) . '">' . __( 'Delete Permanently', 'event_espresso' ) . '</a>'; |
|
170 | + if (EE_Registry::instance()->CAP->current_user_can('ee_delete_default_price', 'pricing_delete_price', $item->ID())) { |
|
171 | + $delete_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'delete_price', 'id'=>$item->ID(), 'noheader' => true), PRICING_ADMIN_URL); |
|
172 | + $actions['delete'] = '<a href="'.$delete_lnk_url.'" title="'.esc_attr__('Delete Price Permanently', 'event_espresso').'">'.__('Delete Permanently', 'event_espresso').'</a>'; |
|
173 | 173 | } |
174 | 174 | } |
175 | 175 | } |
@@ -178,7 +178,7 @@ discard block |
||
178 | 178 | return sprintf('%1$s <span style="color:silver">(id:%2$s)</span>%3$s', |
179 | 179 | /* $1%s */ $name_link, |
180 | 180 | /* $2%s */ $item->ID(), |
181 | - /* $3%s */ $this->row_actions( $actions ) |
|
181 | + /* $3%s */ $this->row_actions($actions) |
|
182 | 182 | ); |
183 | 183 | } |
184 | 184 | |
@@ -195,7 +195,7 @@ discard block |
||
195 | 195 | |
196 | 196 | |
197 | 197 | function column_description($item) { |
198 | - return stripslashes( $item->desc() ); |
|
198 | + return stripslashes($item->desc()); |
|
199 | 199 | } |
200 | 200 | |
201 | 201 | |
@@ -204,9 +204,9 @@ discard block |
||
204 | 204 | |
205 | 205 | function column_amount($item) { |
206 | 206 | if ($this->_price_types[$item->type()]->is_percent()) { |
207 | - return '<div class="pad-amnt-rght">' . number_format($item->amount(), 1) . '%</div>'; |
|
207 | + return '<div class="pad-amnt-rght">'.number_format($item->amount(), 1).'%</div>'; |
|
208 | 208 | } else { |
209 | - return '<div class="pad-amnt-rght">' . EEH_Template::format_currency( $item->amount() ) . '</div>'; |
|
209 | + return '<div class="pad-amnt-rght">'.EEH_Template::format_currency($item->amount()).'</div>'; |
|
210 | 210 | } |
211 | 211 | } |
212 | 212 |
@@ -1,4 +1,6 @@ discard block |
||
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 | * |
@@ -513,7 +515,7 @@ discard block |
||
513 | 515 | |
514 | 516 | if($count){ |
515 | 517 | return EEM_Price::instance()->count_deleted_and_undeleted(array($_where)); |
516 | - }else{ |
|
518 | + } else{ |
|
517 | 519 | return EEM_Price::instance()->get_all_deleted_and_undeleted($query_params); |
518 | 520 | } |
519 | 521 | } |
@@ -943,7 +945,7 @@ discard block |
||
943 | 945 | 'limit'=>$limit); |
944 | 946 | if($count){ |
945 | 947 | return EEM_Price_Type::instance()->count_deleted_and_undeleted($query_params); |
946 | - }else{ |
|
948 | + } else{ |
|
947 | 949 | return EEM_Price_Type::instance()->get_all_deleted_and_undeleted($query_params); |
948 | 950 | } |
949 | 951 |
@@ -78,9 +78,9 @@ discard block |
||
78 | 78 | |
79 | 79 | /** |
80 | 80 | * an array for storing request actions and their corresponding methods |
81 | - * @access private |
|
82 | - * @return void |
|
83 | - */ |
|
81 | + * @access private |
|
82 | + * @return void |
|
83 | + */ |
|
84 | 84 | protected function _set_page_routes() { |
85 | 85 | $prc_id = ! empty( $this->_req_data['PRC_ID'] ) && ! is_array( $this->_req_data['PRC_ID'] ) ? $this->_req_data['PRC_ID'] : 0; |
86 | 86 | $prt_id = ! empty( $this->_req_data['PRT_ID'] ) && ! is_array( $this->_req_data['PRT_ID'] ) ? $this->_req_data['PRT_ID'] : 0; |
@@ -185,16 +185,16 @@ discard block |
||
185 | 185 | 'capability' => 'ee_delete_default_price_type', |
186 | 186 | 'obj_id' => $prt_id |
187 | 187 | ), |
188 | - 'tax_settings' => array( |
|
189 | - 'func' => '_tax_settings', |
|
190 | - 'capability' => 'manage_options' |
|
191 | - ), |
|
192 | - 'update_tax_settings' => array( |
|
193 | - 'func' => '_update_tax_settings', |
|
194 | - 'capability' => 'manage_options', |
|
195 | - 'noheader' => true |
|
196 | - ), |
|
197 | - ); |
|
188 | + 'tax_settings' => array( |
|
189 | + 'func' => '_tax_settings', |
|
190 | + 'capability' => 'manage_options' |
|
191 | + ), |
|
192 | + 'update_tax_settings' => array( |
|
193 | + 'func' => '_update_tax_settings', |
|
194 | + 'capability' => 'manage_options', |
|
195 | + 'noheader' => true |
|
196 | + ), |
|
197 | + ); |
|
198 | 198 | } |
199 | 199 | |
200 | 200 | |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | 'order' => 10 |
210 | 210 | ), |
211 | 211 | 'list_table' => 'Prices_List_Table', |
212 | - 'help_tabs' => array( |
|
212 | + 'help_tabs' => array( |
|
213 | 213 | 'pricing_default_pricing_help_tab' => array( |
214 | 214 | 'title' => __('Default Pricing', 'event_espresso'), |
215 | 215 | 'filename' => 'pricing_default_pricing' |
@@ -232,13 +232,13 @@ discard block |
||
232 | 232 | 'order' => 20, |
233 | 233 | 'persistent' => FALSE |
234 | 234 | ), |
235 | - 'help_tabs' => array( |
|
235 | + 'help_tabs' => array( |
|
236 | 236 | 'add_new_default_price_help_tab' => array( |
237 | 237 | 'title' => __('Add New Default Price', 'event_espresso'), |
238 | 238 | 'filename' => 'pricing_add_new_default_price' |
239 | 239 | ) |
240 | 240 | ), |
241 | - 'help_tour' => array('Pricing_Add_New_Default_Price_Help_Tour'), |
|
241 | + 'help_tour' => array('Pricing_Add_New_Default_Price_Help_Tour'), |
|
242 | 242 | 'metaboxes' => array( '_publish_post_box', '_espresso_news_post_box', '_price_details_meta_boxes' ), |
243 | 243 | 'require_nonce' => FALSE |
244 | 244 | ), |
@@ -250,7 +250,7 @@ discard block |
||
250 | 250 | 'persistent' => FALSE |
251 | 251 | ), |
252 | 252 | 'metaboxes' => array( '_publish_post_box', '_espresso_news_post_box', '_price_details_meta_boxes' ), |
253 | - 'help_tabs' => array( |
|
253 | + 'help_tabs' => array( |
|
254 | 254 | 'edit_default_price_help_tab' => array( |
255 | 255 | 'title' => __('Edit Default Price', 'event_espresso'), |
256 | 256 | 'filename' => 'pricing_edit_default_price' |
@@ -265,7 +265,7 @@ discard block |
||
265 | 265 | 'order' => 30 |
266 | 266 | ), |
267 | 267 | 'list_table' => 'Price_Types_List_Table', |
268 | - 'help_tabs' => array( |
|
268 | + 'help_tabs' => array( |
|
269 | 269 | 'pricing_price_types_help_tab' => array( |
270 | 270 | 'title' => __('Price Types', 'event_espresso'), |
271 | 271 | 'filename' => 'pricing_price_types' |
@@ -289,13 +289,13 @@ discard block |
||
289 | 289 | 'order' => 40, |
290 | 290 | 'persistent' => FALSE |
291 | 291 | ), |
292 | - 'help_tabs' => array( |
|
292 | + 'help_tabs' => array( |
|
293 | 293 | 'add_new_price_type_help_tab' => array( |
294 | 294 | 'title' => __('Add New Price Type', 'event_espresso'), |
295 | 295 | 'filename' => 'pricing_add_new_price_type' |
296 | 296 | ) |
297 | 297 | ), |
298 | - 'help_tour' => array( 'Pricing_Add_New_Price_Type_Help_Tour' ), |
|
298 | + 'help_tour' => array( 'Pricing_Add_New_Price_Type_Help_Tour' ), |
|
299 | 299 | 'metaboxes' => array( '_publish_post_box', '_espresso_news_post_box', '_price_type_details_meta_boxes' ), |
300 | 300 | 'require_nonce' => FALSE |
301 | 301 | ), |
@@ -305,36 +305,36 @@ discard block |
||
305 | 305 | 'order' => 40, |
306 | 306 | 'persistent' => FALSE |
307 | 307 | ), |
308 | - 'help_tabs' => array( |
|
308 | + 'help_tabs' => array( |
|
309 | 309 | 'edit_price_type_help_tab' => array( |
310 | 310 | 'title' => __('Edit Price Type', 'event_espresso'), |
311 | 311 | 'filename' => 'pricing_edit_price_type' |
312 | 312 | ) |
313 | 313 | ), |
314 | - 'help_tour' => array( 'Pricing_Edit_Price_Type_Help_Tour' ), |
|
314 | + 'help_tour' => array( 'Pricing_Edit_Price_Type_Help_Tour' ), |
|
315 | 315 | 'metaboxes' => array( '_publish_post_box', '_espresso_news_post_box', '_price_type_details_meta_boxes' ), |
316 | 316 | |
317 | 317 | 'require_nonce' => FALSE |
318 | 318 | ), |
319 | - 'tax_settings' => array( |
|
320 | - 'nav' => array( |
|
321 | - 'label' => esc_html__('Tax Settings', 'event_espresso'), |
|
322 | - 'order' => 40 |
|
323 | - ), |
|
324 | - 'labels' => array( |
|
325 | - 'publishbox' => esc_html__('Update Tax Settings', 'event_espresso') |
|
326 | - ), |
|
327 | - 'metaboxes' => array_merge($this->_default_espresso_metaboxes, array('_publish_post_box')), |
|
328 | - // 'help_tabs' => array( |
|
329 | - // 'registration_form_reg_form_settings_help_tab' => array( |
|
330 | - // 'title' => esc_html__('Registration Form Settings', 'event_espresso'), |
|
331 | - // 'filename' => 'registration_form_reg_form_settings' |
|
332 | - // ), |
|
333 | - // ), |
|
334 | - // 'help_tour' => array('Registration_Form_Settings_Help_Tour'), |
|
335 | - 'require_nonce' => true |
|
336 | - ) |
|
337 | - ); |
|
319 | + 'tax_settings' => array( |
|
320 | + 'nav' => array( |
|
321 | + 'label' => esc_html__('Tax Settings', 'event_espresso'), |
|
322 | + 'order' => 40 |
|
323 | + ), |
|
324 | + 'labels' => array( |
|
325 | + 'publishbox' => esc_html__('Update Tax Settings', 'event_espresso') |
|
326 | + ), |
|
327 | + 'metaboxes' => array_merge($this->_default_espresso_metaboxes, array('_publish_post_box')), |
|
328 | + // 'help_tabs' => array( |
|
329 | + // 'registration_form_reg_form_settings_help_tab' => array( |
|
330 | + // 'title' => esc_html__('Registration Form Settings', 'event_espresso'), |
|
331 | + // 'filename' => 'registration_form_reg_form_settings' |
|
332 | + // ), |
|
333 | + // ), |
|
334 | + // 'help_tour' => array('Registration_Form_Settings_Help_Tour'), |
|
335 | + 'require_nonce' => true |
|
336 | + ) |
|
337 | + ); |
|
338 | 338 | } |
339 | 339 | |
340 | 340 | |
@@ -460,16 +460,16 @@ discard block |
||
460 | 460 | |
461 | 461 | /** |
462 | 462 | * generates HTML for main Prices Admin page |
463 | - * @access protected |
|
464 | - * @return void |
|
465 | - */ |
|
463 | + * @access protected |
|
464 | + * @return void |
|
465 | + */ |
|
466 | 466 | protected function _price_overview_list_table() { |
467 | 467 | $this->_admin_page_title .= ' ' . $this->get_action_link_or_button( |
468 | - 'add_new_price', |
|
469 | - 'add', |
|
470 | - array(), |
|
471 | - 'add-new-h2' |
|
472 | - ); |
|
468 | + 'add_new_price', |
|
469 | + 'add', |
|
470 | + array(), |
|
471 | + 'add-new-h2' |
|
472 | + ); |
|
473 | 473 | $this->admin_page_title .= $this->_learn_more_about_pricing_link(); |
474 | 474 | $this->_search_btn_label = __('Default Prices', 'event_espresso'); |
475 | 475 | $this->display_admin_list_table_page_with_no_sidebar(); |
@@ -481,13 +481,13 @@ discard block |
||
481 | 481 | |
482 | 482 | |
483 | 483 | /** |
484 | - * retrieve data for Prices List table |
|
485 | - * @access public |
|
486 | - * @param int $per_page how many prices displayed per page |
|
487 | - * @param boolean $count return the count or objects |
|
488 | - * @param boolean $trashed whether the current view is of the trash can - eww yuck! |
|
489 | - * @return mixed (int|array) int = count || array of price objects |
|
490 | - */ |
|
484 | + * retrieve data for Prices List table |
|
485 | + * @access public |
|
486 | + * @param int $per_page how many prices displayed per page |
|
487 | + * @param boolean $count return the count or objects |
|
488 | + * @param boolean $trashed whether the current view is of the trash can - eww yuck! |
|
489 | + * @return mixed (int|array) int = count || array of price objects |
|
490 | + */ |
|
491 | 491 | public function get_prices_overview_data( $per_page = 10, $count = FALSE, $trashed = FALSE ) { |
492 | 492 | |
493 | 493 | do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' ); |
@@ -557,9 +557,9 @@ discard block |
||
557 | 557 | |
558 | 558 | /** |
559 | 559 | * _price_details |
560 | - * @access protected |
|
561 | - * @return void |
|
562 | - */ |
|
560 | + * @access protected |
|
561 | + * @return void |
|
562 | + */ |
|
563 | 563 | protected function _edit_price_details() { |
564 | 564 | do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' ); |
565 | 565 | // grab price ID |
@@ -628,9 +628,9 @@ discard block |
||
628 | 628 | |
629 | 629 | /** |
630 | 630 | * declare price details page metaboxes |
631 | - * @access protected |
|
632 | - * @return void |
|
633 | - */ |
|
631 | + * @access protected |
|
632 | + * @return void |
|
633 | + */ |
|
634 | 634 | protected function _price_details_meta_boxes() { |
635 | 635 | add_meta_box( 'edit-price-details-mbox', __( 'Default Price Details', 'event_espresso' ), array( $this, '_edit_price_details_meta_box' ), $this->wp_page_slug, 'normal', 'high' ); |
636 | 636 | } |
@@ -642,9 +642,9 @@ discard block |
||
642 | 642 | |
643 | 643 | /** |
644 | 644 | * _edit_price_details_meta_box |
645 | - * @access public |
|
646 | - * @return void |
|
647 | - */ |
|
645 | + * @access public |
|
646 | + * @return void |
|
647 | + */ |
|
648 | 648 | public function _edit_price_details_meta_box() { |
649 | 649 | echo EEH_Template::display_template( PRICING_TEMPLATE_PATH . 'pricing_details_main_meta_box.template.php', $this->_template_args, TRUE ); |
650 | 650 | } |
@@ -655,9 +655,9 @@ discard block |
||
655 | 655 | |
656 | 656 | /** |
657 | 657 | * set_price_column_values |
658 | - * @access protected |
|
659 | - * @return array |
|
660 | - */ |
|
658 | + * @access protected |
|
659 | + * @return array |
|
660 | + */ |
|
661 | 661 | protected function set_price_column_values() { |
662 | 662 | |
663 | 663 | do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' ); |
@@ -684,10 +684,10 @@ discard block |
||
684 | 684 | |
685 | 685 | /** |
686 | 686 | * insert_or_update_price |
687 | - * @param boolean $insert - whether to insert or update |
|
688 | - * @access protected |
|
689 | - * @return void |
|
690 | - */ |
|
687 | + * @param boolean $insert - whether to insert or update |
|
688 | + * @access protected |
|
689 | + * @return void |
|
690 | + */ |
|
691 | 691 | protected function _insert_or_update_price( $insert = FALSE ) { |
692 | 692 | |
693 | 693 | //echo '<h3>'. __CLASS__ . '->' . __FUNCTION__ . ' <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span></h3>'; |
@@ -760,10 +760,10 @@ discard block |
||
760 | 760 | |
761 | 761 | /** |
762 | 762 | * _trash_or_restore_price |
763 | - * @param boolean $trash - whether to move item to trash (TRUE) or restore it (FALSE) |
|
764 | - * @access protected |
|
765 | - * @return void |
|
766 | - */ |
|
763 | + * @param boolean $trash - whether to move item to trash (TRUE) or restore it (FALSE) |
|
764 | + * @access protected |
|
765 | + * @return void |
|
766 | + */ |
|
767 | 767 | protected function _trash_or_restore_price( $trash = TRUE ) { |
768 | 768 | |
769 | 769 | //echo '<h3>'. __CLASS__ . '->' . __FUNCTION__ . ' <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span></h3>'; |
@@ -843,9 +843,9 @@ discard block |
||
843 | 843 | |
844 | 844 | /** |
845 | 845 | * _delete_price |
846 | - * @access protected |
|
847 | - * @return void |
|
848 | - */ |
|
846 | + * @access protected |
|
847 | + * @return void |
|
848 | + */ |
|
849 | 849 | protected function _delete_price() { |
850 | 850 | |
851 | 851 | //echo '<h3>'. __CLASS__ . '->' . __FUNCTION__ . ' <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span></h3>'; |
@@ -922,16 +922,16 @@ discard block |
||
922 | 922 | |
923 | 923 | /** |
924 | 924 | * generates HTML for main Prices Admin page |
925 | - * @access protected |
|
926 | - * @return void |
|
927 | - */ |
|
925 | + * @access protected |
|
926 | + * @return void |
|
927 | + */ |
|
928 | 928 | protected function _price_types_overview_list_table() { |
929 | 929 | $this->_admin_page_title .= ' ' . $this->get_action_link_or_button( |
930 | - 'add_new_price_type', |
|
931 | - 'add_type', |
|
932 | - array(), |
|
933 | - 'add-new-h2' |
|
934 | - ); |
|
930 | + 'add_new_price_type', |
|
931 | + 'add_type', |
|
932 | + array(), |
|
933 | + 'add-new-h2' |
|
934 | + ); |
|
935 | 935 | $this->admin_page_title .= $this->_learn_more_about_pricing_link(); |
936 | 936 | $this->_search_btn_label = __('Price Types', 'event_espresso'); |
937 | 937 | $this->display_admin_list_table_page_with_no_sidebar(); |
@@ -943,13 +943,13 @@ discard block |
||
943 | 943 | |
944 | 944 | |
945 | 945 | /** |
946 | - * retrieve data for Price Types List table |
|
947 | - * @access public |
|
948 | - * @param int $per_page how many prices displayed per page |
|
949 | - * @param boolean $count return the count or objects |
|
950 | - * @param boolean $trashed whether the current view is of the trash can - eww yuck! |
|
951 | - * @return mixed (int|array) int = count || array of price objects |
|
952 | - */ |
|
946 | + * retrieve data for Price Types List table |
|
947 | + * @access public |
|
948 | + * @param int $per_page how many prices displayed per page |
|
949 | + * @param boolean $count return the count or objects |
|
950 | + * @param boolean $trashed whether the current view is of the trash can - eww yuck! |
|
951 | + * @return mixed (int|array) int = count || array of price objects |
|
952 | + */ |
|
953 | 953 | public function get_price_types_overview_data( $per_page = 10, $count = FALSE, $trashed = FALSE ) { |
954 | 954 | |
955 | 955 | do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' ); |
@@ -1004,9 +1004,9 @@ discard block |
||
1004 | 1004 | |
1005 | 1005 | /** |
1006 | 1006 | * _edit_price_type_details |
1007 | - * @access protected |
|
1008 | - * @return void |
|
1009 | - */ |
|
1007 | + * @access protected |
|
1008 | + * @return void |
|
1009 | + */ |
|
1010 | 1010 | protected function _edit_price_type_details() { |
1011 | 1011 | |
1012 | 1012 | do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' ); |
@@ -1070,9 +1070,9 @@ discard block |
||
1070 | 1070 | |
1071 | 1071 | /** |
1072 | 1072 | * declare price type details page metaboxes |
1073 | - * @access protected |
|
1074 | - * @return void |
|
1075 | - */ |
|
1073 | + * @access protected |
|
1074 | + * @return void |
|
1075 | + */ |
|
1076 | 1076 | protected function _price_type_details_meta_boxes() { |
1077 | 1077 | add_meta_box( 'edit-price-details-mbox', __( 'Price Type Details', 'event_espresso' ), array( $this, '_edit_price_type_details_meta_box' ), $this->wp_page_slug, 'normal', 'high' ); |
1078 | 1078 | } |
@@ -1083,9 +1083,9 @@ discard block |
||
1083 | 1083 | |
1084 | 1084 | /** |
1085 | 1085 | * _edit_price_type_details_meta_box |
1086 | - * @access public |
|
1087 | - * @return void |
|
1088 | - */ |
|
1086 | + * @access public |
|
1087 | + * @return void |
|
1088 | + */ |
|
1089 | 1089 | public function _edit_price_type_details_meta_box() { |
1090 | 1090 | echo EEH_Template::display_template( PRICING_TEMPLATE_PATH . 'pricing_type_details_main_meta_box.template.php', $this->_template_args, TRUE ); |
1091 | 1091 | } |
@@ -1095,9 +1095,9 @@ discard block |
||
1095 | 1095 | |
1096 | 1096 | /** |
1097 | 1097 | * set_price_type_column_values |
1098 | - * @access protected |
|
1099 | - * @return void |
|
1100 | - */ |
|
1098 | + * @access protected |
|
1099 | + * @return void |
|
1100 | + */ |
|
1101 | 1101 | protected function set_price_type_column_values() { |
1102 | 1102 | |
1103 | 1103 | do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' ); |
@@ -1145,10 +1145,10 @@ discard block |
||
1145 | 1145 | |
1146 | 1146 | /** |
1147 | 1147 | * _insert_or_update_price_type |
1148 | - * @param boolean $new_price_type - whether to insert or update |
|
1149 | - * @access protected |
|
1150 | - * @return void |
|
1151 | - */ |
|
1148 | + * @param boolean $new_price_type - whether to insert or update |
|
1149 | + * @access protected |
|
1150 | + * @return void |
|
1151 | + */ |
|
1152 | 1152 | protected function _insert_or_update_price_type( $new_price_type = FALSE ) { |
1153 | 1153 | |
1154 | 1154 | // echo '<h3>'. __CLASS__ . '->' . __FUNCTION__ . ' <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span></h3>'; |
@@ -1189,10 +1189,10 @@ discard block |
||
1189 | 1189 | |
1190 | 1190 | /** |
1191 | 1191 | * _trash_or_restore_price_type |
1192 | - * @param boolean $trash - whether to move item to trash (TRUE) or restore it (FALSE) |
|
1193 | - * @access protected |
|
1194 | - * @return void |
|
1195 | - */ |
|
1192 | + * @param boolean $trash - whether to move item to trash (TRUE) or restore it (FALSE) |
|
1193 | + * @access protected |
|
1194 | + * @return void |
|
1195 | + */ |
|
1196 | 1196 | protected function _trash_or_restore_price_type( $trash = TRUE ) { |
1197 | 1197 | |
1198 | 1198 | //echo '<h3>'. __CLASS__ . '->' . __FUNCTION__ . ' <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span></h3>'; |
@@ -1246,9 +1246,9 @@ discard block |
||
1246 | 1246 | |
1247 | 1247 | /** |
1248 | 1248 | * _delete_price_type |
1249 | - * @access protected |
|
1250 | - * @return void |
|
1251 | - */ |
|
1249 | + * @access protected |
|
1250 | + * @return void |
|
1251 | + */ |
|
1252 | 1252 | protected function _delete_price_type() { |
1253 | 1253 | |
1254 | 1254 | //echo '<h3>'. __CLASS__ . '->' . __FUNCTION__ . ' <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span></h3>'; |
@@ -1285,76 +1285,76 @@ discard block |
||
1285 | 1285 | |
1286 | 1286 | /** |
1287 | 1287 | * _learn_more_about_pricing_link |
1288 | - * @access protected |
|
1289 | - * @return string |
|
1290 | - */ |
|
1288 | + * @access protected |
|
1289 | + * @return string |
|
1290 | + */ |
|
1291 | 1291 | protected function _learn_more_about_pricing_link() { |
1292 | 1292 | return '<a class="hidden" style="margin:0 20px; cursor:pointer; font-size:12px;" >' . __('learn more about how pricing works', 'event_espresso') . '</a>'; |
1293 | 1293 | } |
1294 | 1294 | |
1295 | 1295 | |
1296 | 1296 | |
1297 | - protected function _tax_settings() { |
|
1298 | - $this->_set_add_edit_form_tags('update_tax_settings'); |
|
1299 | - $this->_set_publish_post_box_vars(null, false, false, null, false); |
|
1300 | - $this->_template_args['admin_page_content'] = $this->tax_settings_form()->get_html(); |
|
1301 | - $this->display_admin_page_with_sidebar(); |
|
1302 | - } |
|
1303 | - |
|
1304 | - |
|
1305 | - |
|
1306 | - /** |
|
1307 | - * @return \EE_Form_Section_Proper |
|
1308 | - * @throws \EE_Error |
|
1309 | - */ |
|
1310 | - protected function tax_settings_form() { |
|
1311 | - return new EE_Form_Section_Proper( |
|
1312 | - array( |
|
1313 | - 'name' => 'tax_settings_form', |
|
1314 | - 'html_id' => 'tax_settings_form', |
|
1315 | - 'layout_strategy' => new EE_Div_Per_Section_Layout(), |
|
1316 | - 'subsections' => apply_filters( |
|
1317 | - 'FHEE__Pricing_Admin_Page__tax_settings_form__form_subsections', |
|
1318 | - array( |
|
1319 | - 'tax_settings' => new EE_Form_Section_Proper( |
|
1320 | - array( |
|
1321 | - 'name' => 'tax_settings_tbl', |
|
1322 | - 'html_id' => 'tax_settings_tbl', |
|
1323 | - 'html_class' => 'form-table', |
|
1324 | - 'layout_strategy' => new EE_Admin_Two_Column_Layout(), |
|
1325 | - 'subsections' => array( |
|
1326 | - 'prices_displayed_including_taxes' => new EE_Yes_No_Input( |
|
1327 | - array( |
|
1328 | - 'html_label_text' => __( |
|
1329 | - "Show Prices With Taxes Included?", |
|
1330 | - 'event_espresso' |
|
1331 | - ), |
|
1332 | - 'html_help_text' => __( |
|
1333 | - 'Indicates whether or not to display prices with the taxes included', |
|
1334 | - 'event_espresso' |
|
1335 | - ), |
|
1336 | - 'default' => isset( |
|
1337 | - EE_Registry::instance() |
|
1338 | - ->CFG |
|
1339 | - ->tax_settings |
|
1340 | - ->prices_displayed_including_taxes |
|
1341 | - ) |
|
1342 | - ? EE_Registry::instance() |
|
1343 | - ->CFG |
|
1344 | - ->tax_settings |
|
1345 | - ->prices_displayed_including_taxes |
|
1346 | - : true, |
|
1347 | - 'display_html_label_text' => false |
|
1348 | - ) |
|
1349 | - ), |
|
1350 | - ) |
|
1351 | - ) |
|
1352 | - ) |
|
1353 | - ) |
|
1354 | - ) |
|
1355 | - ) |
|
1356 | - ); |
|
1357 | - } |
|
1297 | + protected function _tax_settings() { |
|
1298 | + $this->_set_add_edit_form_tags('update_tax_settings'); |
|
1299 | + $this->_set_publish_post_box_vars(null, false, false, null, false); |
|
1300 | + $this->_template_args['admin_page_content'] = $this->tax_settings_form()->get_html(); |
|
1301 | + $this->display_admin_page_with_sidebar(); |
|
1302 | + } |
|
1303 | + |
|
1304 | + |
|
1305 | + |
|
1306 | + /** |
|
1307 | + * @return \EE_Form_Section_Proper |
|
1308 | + * @throws \EE_Error |
|
1309 | + */ |
|
1310 | + protected function tax_settings_form() { |
|
1311 | + return new EE_Form_Section_Proper( |
|
1312 | + array( |
|
1313 | + 'name' => 'tax_settings_form', |
|
1314 | + 'html_id' => 'tax_settings_form', |
|
1315 | + 'layout_strategy' => new EE_Div_Per_Section_Layout(), |
|
1316 | + 'subsections' => apply_filters( |
|
1317 | + 'FHEE__Pricing_Admin_Page__tax_settings_form__form_subsections', |
|
1318 | + array( |
|
1319 | + 'tax_settings' => new EE_Form_Section_Proper( |
|
1320 | + array( |
|
1321 | + 'name' => 'tax_settings_tbl', |
|
1322 | + 'html_id' => 'tax_settings_tbl', |
|
1323 | + 'html_class' => 'form-table', |
|
1324 | + 'layout_strategy' => new EE_Admin_Two_Column_Layout(), |
|
1325 | + 'subsections' => array( |
|
1326 | + 'prices_displayed_including_taxes' => new EE_Yes_No_Input( |
|
1327 | + array( |
|
1328 | + 'html_label_text' => __( |
|
1329 | + "Show Prices With Taxes Included?", |
|
1330 | + 'event_espresso' |
|
1331 | + ), |
|
1332 | + 'html_help_text' => __( |
|
1333 | + 'Indicates whether or not to display prices with the taxes included', |
|
1334 | + 'event_espresso' |
|
1335 | + ), |
|
1336 | + 'default' => isset( |
|
1337 | + EE_Registry::instance() |
|
1338 | + ->CFG |
|
1339 | + ->tax_settings |
|
1340 | + ->prices_displayed_including_taxes |
|
1341 | + ) |
|
1342 | + ? EE_Registry::instance() |
|
1343 | + ->CFG |
|
1344 | + ->tax_settings |
|
1345 | + ->prices_displayed_including_taxes |
|
1346 | + : true, |
|
1347 | + 'display_html_label_text' => false |
|
1348 | + ) |
|
1349 | + ), |
|
1350 | + ) |
|
1351 | + ) |
|
1352 | + ) |
|
1353 | + ) |
|
1354 | + ) |
|
1355 | + ) |
|
1356 | + ); |
|
1357 | + } |
|
1358 | 1358 | |
1359 | 1359 | |
1360 | 1360 |
@@ -31,8 +31,8 @@ discard block |
||
31 | 31 | * @param bool $routing |
32 | 32 | * @return Pricing_Admin_Page |
33 | 33 | */ |
34 | - public function __construct( $routing = TRUE ) { |
|
35 | - parent::__construct( $routing ); |
|
34 | + public function __construct($routing = TRUE) { |
|
35 | + parent::__construct($routing); |
|
36 | 36 | } |
37 | 37 | |
38 | 38 | |
@@ -49,7 +49,7 @@ discard block |
||
49 | 49 | |
50 | 50 | |
51 | 51 | protected function _ajax_hooks() { |
52 | - add_action('wp_ajax_espresso_update_prices_order', array( $this, 'update_price_order' )); |
|
52 | + add_action('wp_ajax_espresso_update_prices_order', array($this, 'update_price_order')); |
|
53 | 53 | } |
54 | 54 | |
55 | 55 | |
@@ -82,8 +82,8 @@ discard block |
||
82 | 82 | * @return void |
83 | 83 | */ |
84 | 84 | protected function _set_page_routes() { |
85 | - $prc_id = ! empty( $this->_req_data['PRC_ID'] ) && ! is_array( $this->_req_data['PRC_ID'] ) ? $this->_req_data['PRC_ID'] : 0; |
|
86 | - $prt_id = ! empty( $this->_req_data['PRT_ID'] ) && ! is_array( $this->_req_data['PRT_ID'] ) ? $this->_req_data['PRT_ID'] : 0; |
|
85 | + $prc_id = ! empty($this->_req_data['PRC_ID']) && ! is_array($this->_req_data['PRC_ID']) ? $this->_req_data['PRC_ID'] : 0; |
|
86 | + $prt_id = ! empty($this->_req_data['PRT_ID']) && ! is_array($this->_req_data['PRT_ID']) ? $this->_req_data['PRT_ID'] : 0; |
|
87 | 87 | $this->_page_routes = array( |
88 | 88 | 'default' => array( |
89 | 89 | 'func' => '_price_overview_list_table', |
@@ -91,38 +91,38 @@ discard block |
||
91 | 91 | ), |
92 | 92 | 'add_new_price' => array( |
93 | 93 | 'func' => '_edit_price_details', |
94 | - 'args' => array( 'new_price' => TRUE ), |
|
94 | + 'args' => array('new_price' => TRUE), |
|
95 | 95 | 'capability' => 'ee_edit_default_prices' |
96 | 96 | ), |
97 | 97 | 'edit_price' => array( |
98 | 98 | 'func' => '_edit_price_details', |
99 | - 'args' => array( 'new_price' => FALSE ), |
|
99 | + 'args' => array('new_price' => FALSE), |
|
100 | 100 | 'capability' => 'ee_edit_default_price', |
101 | 101 | 'obj_id' => $prc_id |
102 | 102 | ), |
103 | 103 | 'insert_price' => array( |
104 | 104 | 'func' => '_insert_or_update_price', |
105 | - 'args' => array( 'new_price' => TRUE ), |
|
105 | + 'args' => array('new_price' => TRUE), |
|
106 | 106 | 'noheader' => TRUE, |
107 | 107 | 'capability' => 'ee_edit_default_prices', |
108 | 108 | ), |
109 | 109 | 'update_price' => array( |
110 | 110 | 'func' => '_insert_or_update_price', |
111 | - 'args' => array( 'new_price' => FALSE ), |
|
111 | + 'args' => array('new_price' => FALSE), |
|
112 | 112 | 'noheader' => TRUE, |
113 | 113 | 'capability' => 'ee_edit_default_price', |
114 | 114 | 'obj_id' => $prc_id |
115 | 115 | ), |
116 | 116 | 'trash_price' => array( |
117 | 117 | 'func' => '_trash_or_restore_price', |
118 | - 'args' => array( 'trash' => TRUE ), |
|
118 | + 'args' => array('trash' => TRUE), |
|
119 | 119 | 'noheader' => TRUE, |
120 | 120 | 'capability' => 'ee_delete_default_price', |
121 | 121 | 'obj_id' => $prc_id |
122 | 122 | ), |
123 | 123 | 'restore_price' => array( |
124 | 124 | 'func' => '_trash_or_restore_price', |
125 | - 'args' => array( 'trash' => FALSE ), |
|
125 | + 'args' => array('trash' => FALSE), |
|
126 | 126 | 'noheader' => TRUE, |
127 | 127 | 'capability' => 'ee_delete_default_price', |
128 | 128 | 'obj_id' => $prc_id |
@@ -154,27 +154,27 @@ discard block |
||
154 | 154 | ), |
155 | 155 | 'insert_price_type' => array( |
156 | 156 | 'func' => '_insert_or_update_price_type', |
157 | - 'args' => array( 'new_price_type' => TRUE ), |
|
157 | + 'args' => array('new_price_type' => TRUE), |
|
158 | 158 | 'noheader' => TRUE, |
159 | 159 | 'capability' => 'ee_edit_default_price_types' |
160 | 160 | ), |
161 | 161 | 'update_price_type' => array( |
162 | 162 | 'func' => '_insert_or_update_price_type', |
163 | - 'args' => array( 'new_price_type' => FALSE ), |
|
163 | + 'args' => array('new_price_type' => FALSE), |
|
164 | 164 | 'noheader' => TRUE, |
165 | 165 | 'capability' => 'ee_edit_default_price_type', |
166 | 166 | 'obj_id' => $prt_id |
167 | 167 | ), |
168 | 168 | 'trash_price_type' => array( |
169 | 169 | 'func' => '_trash_or_restore_price_type', |
170 | - 'args' => array( 'trash' => TRUE ), |
|
170 | + 'args' => array('trash' => TRUE), |
|
171 | 171 | 'noheader' => TRUE, |
172 | 172 | 'capability' => 'ee_delete_default_price_type', |
173 | 173 | 'obj_id' => $prt_id |
174 | 174 | ), |
175 | 175 | 'restore_price_type' => array( |
176 | 176 | 'func' => '_trash_or_restore_price_type', |
177 | - 'args' => array( 'trash' => FALSE ), |
|
177 | + 'args' => array('trash' => FALSE), |
|
178 | 178 | 'noheader' => TRUE, |
179 | 179 | 'capability' => 'ee_delete_default_price_type', |
180 | 180 | 'obj_id' => $prt_id |
@@ -223,7 +223,7 @@ discard block |
||
223 | 223 | 'filename' => 'pricing_default_pricing_views_bulk_actions_search' |
224 | 224 | ) |
225 | 225 | ), |
226 | - 'help_tour' => array( 'Pricing_Default_Prices_Help_Tour'), |
|
226 | + 'help_tour' => array('Pricing_Default_Prices_Help_Tour'), |
|
227 | 227 | 'require_nonce' => FALSE |
228 | 228 | ), |
229 | 229 | 'add_new_price' => array( |
@@ -239,24 +239,24 @@ discard block |
||
239 | 239 | ) |
240 | 240 | ), |
241 | 241 | 'help_tour' => array('Pricing_Add_New_Default_Price_Help_Tour'), |
242 | - 'metaboxes' => array( '_publish_post_box', '_espresso_news_post_box', '_price_details_meta_boxes' ), |
|
242 | + 'metaboxes' => array('_publish_post_box', '_espresso_news_post_box', '_price_details_meta_boxes'), |
|
243 | 243 | 'require_nonce' => FALSE |
244 | 244 | ), |
245 | 245 | 'edit_price' => array( |
246 | 246 | 'nav' => array( |
247 | 247 | 'label' => __('Edit Default Price', 'event_espresso'), |
248 | 248 | 'order' => 20, |
249 | - 'url' => isset($this->_req_data['id']) ? add_query_arg(array('id' => $this->_req_data['id'] ), $this->_current_page_view_url ) : $this->_admin_base_url, |
|
249 | + 'url' => isset($this->_req_data['id']) ? add_query_arg(array('id' => $this->_req_data['id']), $this->_current_page_view_url) : $this->_admin_base_url, |
|
250 | 250 | 'persistent' => FALSE |
251 | 251 | ), |
252 | - 'metaboxes' => array( '_publish_post_box', '_espresso_news_post_box', '_price_details_meta_boxes' ), |
|
252 | + 'metaboxes' => array('_publish_post_box', '_espresso_news_post_box', '_price_details_meta_boxes'), |
|
253 | 253 | 'help_tabs' => array( |
254 | 254 | 'edit_default_price_help_tab' => array( |
255 | 255 | 'title' => __('Edit Default Price', 'event_espresso'), |
256 | 256 | 'filename' => 'pricing_edit_default_price' |
257 | 257 | ) |
258 | 258 | ), |
259 | - 'help_tour' => array( 'Pricing_Edit_Default_Price_Help_Tour' ), |
|
259 | + 'help_tour' => array('Pricing_Edit_Default_Price_Help_Tour'), |
|
260 | 260 | 'require_nonce' => FALSE |
261 | 261 | ), |
262 | 262 | 'price_types' => array( |
@@ -279,7 +279,7 @@ discard block |
||
279 | 279 | 'filename' => 'pricing_price_types_views_bulk_actions_search' |
280 | 280 | ), |
281 | 281 | ), |
282 | - 'help_tour' => array( 'Pricing_Price_Types_Default_Help_Tour' ), |
|
282 | + 'help_tour' => array('Pricing_Price_Types_Default_Help_Tour'), |
|
283 | 283 | 'metaboxes' => array('_espresso_news_post_box', '_espresso_links_post_box'), |
284 | 284 | 'require_nonce' => FALSE |
285 | 285 | ), |
@@ -295,8 +295,8 @@ discard block |
||
295 | 295 | 'filename' => 'pricing_add_new_price_type' |
296 | 296 | ) |
297 | 297 | ), |
298 | - 'help_tour' => array( 'Pricing_Add_New_Price_Type_Help_Tour' ), |
|
299 | - 'metaboxes' => array( '_publish_post_box', '_espresso_news_post_box', '_price_type_details_meta_boxes' ), |
|
298 | + 'help_tour' => array('Pricing_Add_New_Price_Type_Help_Tour'), |
|
299 | + 'metaboxes' => array('_publish_post_box', '_espresso_news_post_box', '_price_type_details_meta_boxes'), |
|
300 | 300 | 'require_nonce' => FALSE |
301 | 301 | ), |
302 | 302 | 'edit_price_type' => array( |
@@ -311,8 +311,8 @@ discard block |
||
311 | 311 | 'filename' => 'pricing_edit_price_type' |
312 | 312 | ) |
313 | 313 | ), |
314 | - 'help_tour' => array( 'Pricing_Edit_Price_Type_Help_Tour' ), |
|
315 | - 'metaboxes' => array( '_publish_post_box', '_espresso_news_post_box', '_price_type_details_meta_boxes' ), |
|
314 | + 'help_tour' => array('Pricing_Edit_Price_Type_Help_Tour'), |
|
315 | + 'metaboxes' => array('_publish_post_box', '_espresso_news_post_box', '_price_type_details_meta_boxes'), |
|
316 | 316 | |
317 | 317 | 'require_nonce' => FALSE |
318 | 318 | ), |
@@ -367,7 +367,7 @@ discard block |
||
367 | 367 | public function load_scripts_styles() { |
368 | 368 | //styles |
369 | 369 | wp_enqueue_style('espresso-ui-theme'); |
370 | - wp_register_style( 'espresso_PRICING', PRICING_ASSETS_URL . 'espresso_pricing_admin.css', array(), EVENT_ESPRESSO_VERSION ); |
|
370 | + wp_register_style('espresso_PRICING', PRICING_ASSETS_URL.'espresso_pricing_admin.css', array(), EVENT_ESPRESSO_VERSION); |
|
371 | 371 | wp_enqueue_style('espresso_PRICING'); |
372 | 372 | |
373 | 373 | //scripts |
@@ -377,8 +377,8 @@ discard block |
||
377 | 377 | //wp_enqueue_script('jquery-ui-dialog'); |
378 | 378 | //wp_enqueue_script('jquery-ui-draggable'); |
379 | 379 | //wp_enqueue_script('jquery-ui-datepicker'); |
380 | - wp_register_script( 'espresso_PRICING', PRICING_ASSETS_URL . 'espresso_pricing_admin.js', array('jquery'), EVENT_ESPRESSO_VERSION, TRUE ); |
|
381 | - wp_enqueue_script( 'espresso_PRICING' ); |
|
380 | + wp_register_script('espresso_PRICING', PRICING_ASSETS_URL.'espresso_pricing_admin.js', array('jquery'), EVENT_ESPRESSO_VERSION, TRUE); |
|
381 | + wp_enqueue_script('espresso_PRICING'); |
|
382 | 382 | } |
383 | 383 | |
384 | 384 | |
@@ -386,7 +386,7 @@ discard block |
||
386 | 386 | |
387 | 387 | |
388 | 388 | public function load_scripts_styles_default() { |
389 | - wp_enqueue_script( 'espresso_ajax_table_sorting' ); |
|
389 | + wp_enqueue_script('espresso_ajax_table_sorting'); |
|
390 | 390 | } |
391 | 391 | |
392 | 392 | |
@@ -414,7 +414,7 @@ discard block |
||
414 | 414 | ) |
415 | 415 | ); |
416 | 416 | |
417 | - if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_default_prices', 'pricing_trash_price' ) ) { |
|
417 | + if (EE_Registry::instance()->CAP->current_user_can('ee_delete_default_prices', 'pricing_trash_price')) { |
|
418 | 418 | $this->_views['trashed'] = array( |
419 | 419 | 'slug' => 'trashed', |
420 | 420 | 'label' => __('Trash', 'event_espresso'), |
@@ -444,7 +444,7 @@ discard block |
||
444 | 444 | ) |
445 | 445 | ); |
446 | 446 | |
447 | - if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_default_price_types', 'pricing_trash_price_type' ) ) { |
|
447 | + if (EE_Registry::instance()->CAP->current_user_can('ee_delete_default_price_types', 'pricing_trash_price_type')) { |
|
448 | 448 | $this->_views['trashed'] = array( |
449 | 449 | 'slug' => 'trashed', |
450 | 450 | 'label' => __('Trash', 'event_espresso'), |
@@ -464,7 +464,7 @@ discard block |
||
464 | 464 | * @return void |
465 | 465 | */ |
466 | 466 | protected function _price_overview_list_table() { |
467 | - $this->_admin_page_title .= ' ' . $this->get_action_link_or_button( |
|
467 | + $this->_admin_page_title .= ' '.$this->get_action_link_or_button( |
|
468 | 468 | 'add_new_price', |
469 | 469 | 'add', |
470 | 470 | array(), |
@@ -488,18 +488,18 @@ discard block |
||
488 | 488 | * @param boolean $trashed whether the current view is of the trash can - eww yuck! |
489 | 489 | * @return mixed (int|array) int = count || array of price objects |
490 | 490 | */ |
491 | - public function get_prices_overview_data( $per_page = 10, $count = FALSE, $trashed = FALSE ) { |
|
491 | + public function get_prices_overview_data($per_page = 10, $count = FALSE, $trashed = FALSE) { |
|
492 | 492 | |
493 | - do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' ); |
|
493 | + do_action('AHEE_log', __FILE__, __FUNCTION__, ''); |
|
494 | 494 | // start with an empty array |
495 | 495 | $event_pricing = array(); |
496 | 496 | |
497 | - require_once( PRICING_ADMIN . 'Prices_List_Table.class.php' ); |
|
498 | - require_once(EE_MODELS . 'EEM_Price.model.php'); |
|
497 | + require_once(PRICING_ADMIN.'Prices_List_Table.class.php'); |
|
498 | + require_once(EE_MODELS.'EEM_Price.model.php'); |
|
499 | 499 | //$PRC = EEM_Price::instance(); |
500 | 500 | |
501 | 501 | $this->_req_data['orderby'] = empty($this->_req_data['orderby']) ? '' : $this->_req_data['orderby']; |
502 | - $order = ( isset( $this->_req_data['order'] ) && ! empty( $this->_req_data['order'] )) ? $this->_req_data['order'] : 'ASC'; |
|
502 | + $order = (isset($this->_req_data['order']) && ! empty($this->_req_data['order'])) ? $this->_req_data['order'] : 'ASC'; |
|
503 | 503 | |
504 | 504 | switch ($this->_req_data['orderby']) { |
505 | 505 | case 'name': |
@@ -512,27 +512,27 @@ discard block |
||
512 | 512 | $orderby = array('PRC_amount'=>$order); |
513 | 513 | break; |
514 | 514 | default: |
515 | - $orderby = array( 'PRC_order'=>$order, 'Price_Type.PRT_order'=>$order, 'PRC_ID'=>$order); |
|
515 | + $orderby = array('PRC_order'=>$order, 'Price_Type.PRT_order'=>$order, 'PRC_ID'=>$order); |
|
516 | 516 | } |
517 | 517 | |
518 | - $current_page = isset( $this->_req_data['paged'] ) && !empty( $this->_req_data['paged'] ) ? $this->_req_data['paged'] : 1; |
|
519 | - $per_page = isset( $this->_req_data['perpage'] ) && !empty( $this->_req_data['perpage'] ) ? $this->_req_data['perpage'] : $per_page; |
|
518 | + $current_page = isset($this->_req_data['paged']) && ! empty($this->_req_data['paged']) ? $this->_req_data['paged'] : 1; |
|
519 | + $per_page = isset($this->_req_data['perpage']) && ! empty($this->_req_data['perpage']) ? $this->_req_data['perpage'] : $per_page; |
|
520 | 520 | |
521 | 521 | $_where = array( |
522 | 522 | 'PRC_is_default' => 1, |
523 | 523 | 'PRC_deleted' => $trashed |
524 | 524 | ); |
525 | 525 | |
526 | - $offset = ($current_page-1)*$per_page; |
|
527 | - $limit = array( $offset, $per_page ); |
|
526 | + $offset = ($current_page - 1) * $per_page; |
|
527 | + $limit = array($offset, $per_page); |
|
528 | 528 | |
529 | - if ( isset( $this->_req_data['s'] ) ) { |
|
530 | - $sstr = '%' . $this->_req_data['s'] . '%'; |
|
529 | + if (isset($this->_req_data['s'])) { |
|
530 | + $sstr = '%'.$this->_req_data['s'].'%'; |
|
531 | 531 | $_where['OR'] = array( |
532 | - 'PRC_name' => array('LIKE',$sstr ), |
|
533 | - 'PRC_desc' => array('LIKE',$sstr ), |
|
534 | - 'PRC_amount' => array( 'LIKE',$sstr ), |
|
535 | - 'Price_Type.PRT_name' => array( 'LIKE', $sstr ) |
|
532 | + 'PRC_name' => array('LIKE', $sstr), |
|
533 | + 'PRC_desc' => array('LIKE', $sstr), |
|
534 | + 'PRC_amount' => array('LIKE', $sstr), |
|
535 | + 'Price_Type.PRT_name' => array('LIKE', $sstr) |
|
536 | 536 | ); |
537 | 537 | } |
538 | 538 | |
@@ -543,9 +543,9 @@ discard block |
||
543 | 543 | 'group_by'=>'PRC_ID' |
544 | 544 | ); |
545 | 545 | |
546 | - if($count){ |
|
547 | - return $trashed ? EEM_Price::instance()->count( array( $_where ) ) : EEM_Price::instance()->count_deleted_and_undeleted(array($_where)); |
|
548 | - }else{ |
|
546 | + if ($count) { |
|
547 | + return $trashed ? EEM_Price::instance()->count(array($_where)) : EEM_Price::instance()->count_deleted_and_undeleted(array($_where)); |
|
548 | + } else { |
|
549 | 549 | return EEM_Price::instance()->get_all_deleted_and_undeleted($query_params); |
550 | 550 | } |
551 | 551 | } |
@@ -561,49 +561,49 @@ discard block |
||
561 | 561 | * @return void |
562 | 562 | */ |
563 | 563 | protected function _edit_price_details() { |
564 | - do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' ); |
|
564 | + do_action('AHEE_log', __FILE__, __FUNCTION__, ''); |
|
565 | 565 | // grab price ID |
566 | - $PRC_ID = isset( $this->_req_data['id'] ) && ! empty( $this->_req_data['id'] ) ? absint( $this->_req_data['id'] ) : FALSE; |
|
566 | + $PRC_ID = isset($this->_req_data['id']) && ! empty($this->_req_data['id']) ? absint($this->_req_data['id']) : FALSE; |
|
567 | 567 | // change page title based on request action |
568 | - switch( $this->_req_action ) { |
|
568 | + switch ($this->_req_action) { |
|
569 | 569 | case 'add_new_price' : |
570 | - $this->_admin_page_title = esc_html__( 'Add New Price', 'event_espresso' ); |
|
570 | + $this->_admin_page_title = esc_html__('Add New Price', 'event_espresso'); |
|
571 | 571 | break; |
572 | 572 | case 'edit_price' : |
573 | - $this->_admin_page_title = esc_html__( 'Edit Price', 'event_espresso' ); |
|
573 | + $this->_admin_page_title = esc_html__('Edit Price', 'event_espresso'); |
|
574 | 574 | break; |
575 | 575 | default : |
576 | - $this->_admin_page_title = ucwords( str_replace( '_', ' ', $this->_req_action )); |
|
576 | + $this->_admin_page_title = ucwords(str_replace('_', ' ', $this->_req_action)); |
|
577 | 577 | } |
578 | 578 | // add PRC_ID to title if editing |
579 | - $this->_admin_page_title = $PRC_ID ? $this->_admin_page_title . ' # ' . $PRC_ID : $this->_admin_page_title; |
|
579 | + $this->_admin_page_title = $PRC_ID ? $this->_admin_page_title.' # '.$PRC_ID : $this->_admin_page_title; |
|
580 | 580 | |
581 | 581 | // get prices |
582 | - require_once(EE_MODELS . 'EEM_Price.model.php'); |
|
582 | + require_once(EE_MODELS.'EEM_Price.model.php'); |
|
583 | 583 | $PRC = EEM_Price::instance(); |
584 | 584 | |
585 | - if ( $PRC_ID ) { |
|
586 | - $price = $PRC->get_one_by_ID( $PRC_ID ); |
|
585 | + if ($PRC_ID) { |
|
586 | + $price = $PRC->get_one_by_ID($PRC_ID); |
|
587 | 587 | $additional_hidden_fields = array( |
588 | - 'PRC_ID' => array( 'type' => 'hidden', 'value' => $PRC_ID ) |
|
588 | + 'PRC_ID' => array('type' => 'hidden', 'value' => $PRC_ID) |
|
589 | 589 | ); |
590 | - $this->_set_add_edit_form_tags( 'update_price', $additional_hidden_fields ); |
|
590 | + $this->_set_add_edit_form_tags('update_price', $additional_hidden_fields); |
|
591 | 591 | } else { |
592 | 592 | $price = $PRC->get_new_price(); |
593 | - $this->_set_add_edit_form_tags( 'insert_price' ); |
|
593 | + $this->_set_add_edit_form_tags('insert_price'); |
|
594 | 594 | } |
595 | 595 | |
596 | 596 | $this->_template_args['PRC_ID'] = $PRC_ID; |
597 | 597 | $this->_template_args['price'] = $price; |
598 | 598 | |
599 | 599 | // get price types |
600 | - require_once(EE_MODELS . 'EEM_Price_Type.model.php'); |
|
600 | + require_once(EE_MODELS.'EEM_Price_Type.model.php'); |
|
601 | 601 | $PRT = EEM_Price_Type::instance(); |
602 | - $price_types = $PRT->get_all( array( array('PBT_ID' => array('!=', 1 ) ) ) ); |
|
602 | + $price_types = $PRT->get_all(array(array('PBT_ID' => array('!=', 1)))); |
|
603 | 603 | $price_type_names = array(); |
604 | 604 | if (empty($price_types)) { |
605 | - $msg = __( 'You have no price types defined. Please add a price type before adding a price.', 'event_espresso' ); |
|
606 | - EE_Error::add_error( $msg, __FILE__, __FUNCTION__, __LINE__ ); |
|
605 | + $msg = __('You have no price types defined. Please add a price type before adding a price.', 'event_espresso'); |
|
606 | + EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__); |
|
607 | 607 | exit(); |
608 | 608 | } else { |
609 | 609 | foreach ($price_types as $type) { |
@@ -616,7 +616,7 @@ discard block |
||
616 | 616 | $this->_template_args['price_types'] = $price_type_names; |
617 | 617 | $this->_template_args['learn_more_about_pricing_link'] = $this->_learn_more_about_pricing_link(); |
618 | 618 | |
619 | - $this->_set_publish_post_box_vars( 'id', $PRC_ID ); |
|
619 | + $this->_set_publish_post_box_vars('id', $PRC_ID); |
|
620 | 620 | // the details template wrapper |
621 | 621 | $this->display_admin_page_with_sidebar(); |
622 | 622 | } |
@@ -632,7 +632,7 @@ discard block |
||
632 | 632 | * @return void |
633 | 633 | */ |
634 | 634 | protected function _price_details_meta_boxes() { |
635 | - add_meta_box( 'edit-price-details-mbox', __( 'Default Price Details', 'event_espresso' ), array( $this, '_edit_price_details_meta_box' ), $this->wp_page_slug, 'normal', 'high' ); |
|
635 | + add_meta_box('edit-price-details-mbox', __('Default Price Details', 'event_espresso'), array($this, '_edit_price_details_meta_box'), $this->wp_page_slug, 'normal', 'high'); |
|
636 | 636 | } |
637 | 637 | |
638 | 638 | |
@@ -646,7 +646,7 @@ discard block |
||
646 | 646 | * @return void |
647 | 647 | */ |
648 | 648 | public function _edit_price_details_meta_box() { |
649 | - echo EEH_Template::display_template( PRICING_TEMPLATE_PATH . 'pricing_details_main_meta_box.template.php', $this->_template_args, TRUE ); |
|
649 | + echo EEH_Template::display_template(PRICING_TEMPLATE_PATH.'pricing_details_main_meta_box.template.php', $this->_template_args, TRUE); |
|
650 | 650 | } |
651 | 651 | |
652 | 652 | |
@@ -660,7 +660,7 @@ discard block |
||
660 | 660 | */ |
661 | 661 | protected function set_price_column_values() { |
662 | 662 | |
663 | - do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' ); |
|
663 | + do_action('AHEE_log', __FILE__, __FUNCTION__, ''); |
|
664 | 664 | |
665 | 665 | $set_column_values = array( |
666 | 666 | 'PRT_ID' => absint($this->_req_data['PRT_ID']), |
@@ -688,12 +688,12 @@ discard block |
||
688 | 688 | * @access protected |
689 | 689 | * @return void |
690 | 690 | */ |
691 | - protected function _insert_or_update_price( $insert = FALSE ) { |
|
691 | + protected function _insert_or_update_price($insert = FALSE) { |
|
692 | 692 | |
693 | 693 | //echo '<h3>'. __CLASS__ . '->' . __FUNCTION__ . ' <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span></h3>'; |
694 | - do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' ); |
|
694 | + do_action('AHEE_log', __FILE__, __FUNCTION__, ''); |
|
695 | 695 | |
696 | - require_once(EE_MODELS . 'EEM_Price.model.php'); |
|
696 | + require_once(EE_MODELS.'EEM_Price.model.php'); |
|
697 | 697 | $PRC = EEM_Price::instance(); |
698 | 698 | |
699 | 699 | // why be so pessimistic ??? : ( |
@@ -701,14 +701,14 @@ discard block |
||
701 | 701 | |
702 | 702 | $set_column_values = $this->set_price_column_values(); |
703 | 703 | // is this a new Price ? |
704 | - if ( $insert ) { |
|
704 | + if ($insert) { |
|
705 | 705 | // run the insert |
706 | - if ( $PRC_ID = $PRC->insert( $set_column_values )) { |
|
706 | + if ($PRC_ID = $PRC->insert($set_column_values)) { |
|
707 | 707 | //make sure this new price modifier is attached to the ticket but ONLY if it is not a tax type |
708 | 708 | $PR = EEM_price::instance()->get_one_by_ID($PRC_ID); |
709 | - if ( $PR->type_obj()->base_type() !== EEM_Price_Type::base_type_tax ) { |
|
709 | + if ($PR->type_obj()->base_type() !== EEM_Price_Type::base_type_tax) { |
|
710 | 710 | $ticket = EEM_Ticket::instance()->get_one_by_ID(1); |
711 | - $ticket->_add_relation_to( $PR, 'Price' ); |
|
711 | + $ticket->_add_relation_to($PR, 'Price'); |
|
712 | 712 | $ticket->save(); |
713 | 713 | } |
714 | 714 | $success = 1; |
@@ -718,29 +718,29 @@ discard block |
||
718 | 718 | } |
719 | 719 | $action_desc = 'created'; |
720 | 720 | } else { |
721 | - $PRC_ID = absint( $this->_req_data['PRC_ID'] ); |
|
721 | + $PRC_ID = absint($this->_req_data['PRC_ID']); |
|
722 | 722 | // run the update |
723 | - $where_cols_n_values = array( 'PRC_ID' => $PRC_ID ); |
|
724 | - if ( $PRC->update( $set_column_values, array($where_cols_n_values))) { |
|
723 | + $where_cols_n_values = array('PRC_ID' => $PRC_ID); |
|
724 | + if ($PRC->update($set_column_values, array($where_cols_n_values))) { |
|
725 | 725 | $success = 1; |
726 | 726 | } |
727 | 727 | |
728 | 728 | $PR = EEM_Price::instance()->get_one_by_ID($PRC_ID); |
729 | - if ( $PR->type_obj()->base_type() !== EEM_Price_Type::base_type_tax ) { |
|
729 | + if ($PR->type_obj()->base_type() !== EEM_Price_Type::base_type_tax) { |
|
730 | 730 | |
731 | 731 | //if this is $PRC_ID == 1, then we need to update the default ticket attached to this price so the TKT_price value is updated. |
732 | - if ( $PRC_ID === 1 ) { |
|
732 | + if ($PRC_ID === 1) { |
|
733 | 733 | $ticket = $PR->get_first_related('Ticket'); |
734 | - if ( $ticket ) { |
|
735 | - $ticket->set('TKT_price', $PR->get('PRC_amount') ); |
|
736 | - $ticket->set('TKT_name', $PR->get('PRC_name') ); |
|
734 | + if ($ticket) { |
|
735 | + $ticket->set('TKT_price', $PR->get('PRC_amount')); |
|
736 | + $ticket->set('TKT_name', $PR->get('PRC_name')); |
|
737 | 737 | $ticket->set('TKT_description', $PR->get('PRC_desc')); |
738 | 738 | $ticket->save(); |
739 | 739 | } |
740 | 740 | } else { |
741 | 741 | //we make sure this price is attached to base ticket. but ONLY if its not a tax ticket type. |
742 | 742 | $ticket = EEM_Ticket::instance()->get_one_by_ID(1); |
743 | - $ticket->_add_relation_to( $PRC_ID, 'Price' ); |
|
743 | + $ticket->_add_relation_to($PRC_ID, 'Price'); |
|
744 | 744 | $ticket->save(); |
745 | 745 | } |
746 | 746 | } |
@@ -748,9 +748,9 @@ discard block |
||
748 | 748 | $action_desc = 'updated'; |
749 | 749 | } |
750 | 750 | |
751 | - $query_args = array( 'action' => 'edit_price', 'id' => $PRC_ID ); |
|
751 | + $query_args = array('action' => 'edit_price', 'id' => $PRC_ID); |
|
752 | 752 | |
753 | - $this->_redirect_after_action( $success, 'Prices', $action_desc, $query_args ); |
|
753 | + $this->_redirect_after_action($success, 'Prices', $action_desc, $query_args); |
|
754 | 754 | |
755 | 755 | } |
756 | 756 | |
@@ -764,12 +764,12 @@ discard block |
||
764 | 764 | * @access protected |
765 | 765 | * @return void |
766 | 766 | */ |
767 | - protected function _trash_or_restore_price( $trash = TRUE ) { |
|
767 | + protected function _trash_or_restore_price($trash = TRUE) { |
|
768 | 768 | |
769 | 769 | //echo '<h3>'. __CLASS__ . '->' . __FUNCTION__ . ' <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span></h3>'; |
770 | - do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' ); |
|
770 | + do_action('AHEE_log', __FILE__, __FUNCTION__, ''); |
|
771 | 771 | |
772 | - require_once(EE_MODELS . 'EEM_Price.model.php'); |
|
772 | + require_once(EE_MODELS.'EEM_Price.model.php'); |
|
773 | 773 | $PRC = EEM_Price::instance(); |
774 | 774 | |
775 | 775 | $success = 1; |
@@ -778,18 +778,18 @@ discard block |
||
778 | 778 | //get base ticket for updating |
779 | 779 | $ticket = EEM_Ticket::instance()->get_one_by_ID(1); |
780 | 780 | //Checkboxes |
781 | - if (!empty($this->_req_data['checkbox']) && is_array($this->_req_data['checkbox'])) { |
|
781 | + if ( ! empty($this->_req_data['checkbox']) && is_array($this->_req_data['checkbox'])) { |
|
782 | 782 | // if array has more than one element than success message should be plural |
783 | - $success = count( $this->_req_data['checkbox'] ) > 1 ? 2 : 1; |
|
783 | + $success = count($this->_req_data['checkbox']) > 1 ? 2 : 1; |
|
784 | 784 | // cycle thru checkboxes |
785 | - while (list( $PRC_ID, $value ) = each($this->_req_data['checkbox'])) { |
|
786 | - if ( ! $PRC->update_by_ID(array('PRC_deleted' => $PRC_deleted), absint($PRC_ID) ) ) { |
|
785 | + while (list($PRC_ID, $value) = each($this->_req_data['checkbox'])) { |
|
786 | + if ( ! $PRC->update_by_ID(array('PRC_deleted' => $PRC_deleted), absint($PRC_ID))) { |
|
787 | 787 | $success = 0; |
788 | 788 | } else { |
789 | 789 | $PR = EEM_Price::instance()->get_one_by_ID($PRC_ID); |
790 | - if ( $PR->type_obj()->base_type() !== EEM_Price_Type::base_type_tax ) { |
|
790 | + if ($PR->type_obj()->base_type() !== EEM_Price_Type::base_type_tax) { |
|
791 | 791 | //if trashing then remove relations to base default ticket. If restoring then add back to base default ticket |
792 | - if ( $PRC_deleted ) { |
|
792 | + if ($PRC_deleted) { |
|
793 | 793 | $ticket->_remove_relation_to($PRC_ID, 'Price'); |
794 | 794 | } else { |
795 | 795 | $ticket->_add_relation_to($PRC_ID, 'Price'); |
@@ -801,14 +801,14 @@ discard block |
||
801 | 801 | |
802 | 802 | } else { |
803 | 803 | // grab single id and delete |
804 | - $PRC_ID = isset( $this->_req_data['id'] ) ? absint($this->_req_data['id']) : 0; |
|
805 | - if ( empty( $PRC_ID ) || ! $PRC->update_by_ID(array('PRC_deleted' => $PRC_deleted), $PRC_ID) ) { |
|
804 | + $PRC_ID = isset($this->_req_data['id']) ? absint($this->_req_data['id']) : 0; |
|
805 | + if (empty($PRC_ID) || ! $PRC->update_by_ID(array('PRC_deleted' => $PRC_deleted), $PRC_ID)) { |
|
806 | 806 | $success = 0; |
807 | 807 | } else { |
808 | 808 | $PR = EEM_Price::instance()->get_one_by_ID($PRC_ID); |
809 | - if ( $PR->type_obj()->base_type() !== EEM_Price_Type::base_type_tax ) { |
|
809 | + if ($PR->type_obj()->base_type() !== EEM_Price_Type::base_type_tax) { |
|
810 | 810 | //if trashing then remove relations to base default ticket. If restoring then add back to base default ticket |
811 | - if ( $PRC_deleted ) { |
|
811 | + if ($PRC_deleted) { |
|
812 | 812 | $ticket->_remove_relation_to($PRC_ID, 'Price'); |
813 | 813 | } else { |
814 | 814 | $ticket->_add_relation_to($PRC_ID, 'Price'); |
@@ -822,17 +822,17 @@ discard block |
||
822 | 822 | 'action' => 'default' |
823 | 823 | ); |
824 | 824 | |
825 | - if ( $success ) { |
|
826 | - if ( $trash ) { |
|
825 | + if ($success) { |
|
826 | + if ($trash) { |
|
827 | 827 | $msg = $success == 2 ? __('The Prices have been trashed.', 'event_espresso') : __('The Price has been trashed.', 'event_espresso'); |
828 | 828 | } else { |
829 | 829 | $msg = $success == 2 ? __('The Prices have been restored.', 'event_espresso') : __('The Price has been restored.', 'event_espresso'); |
830 | 830 | } |
831 | 831 | |
832 | - EE_Error::add_success( $msg ); |
|
832 | + EE_Error::add_success($msg); |
|
833 | 833 | } |
834 | 834 | |
835 | - $this->_redirect_after_action( FALSE, '', '', $query_args, TRUE ); |
|
835 | + $this->_redirect_after_action(FALSE, '', '', $query_args, TRUE); |
|
836 | 836 | |
837 | 837 | } |
838 | 838 | |
@@ -849,19 +849,19 @@ discard block |
||
849 | 849 | protected function _delete_price() { |
850 | 850 | |
851 | 851 | //echo '<h3>'. __CLASS__ . '->' . __FUNCTION__ . ' <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span></h3>'; |
852 | - do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' ); |
|
852 | + do_action('AHEE_log', __FILE__, __FUNCTION__, ''); |
|
853 | 853 | |
854 | - require_once(EE_MODELS . 'EEM_Price.model.php'); |
|
854 | + require_once(EE_MODELS.'EEM_Price.model.php'); |
|
855 | 855 | $PRC = EEM_Price::instance(); |
856 | 856 | |
857 | 857 | $success = 1; |
858 | 858 | //Checkboxes |
859 | - if (!empty($this->_req_data['checkbox']) && is_array($this->_req_data['checkbox'])) { |
|
859 | + if ( ! empty($this->_req_data['checkbox']) && is_array($this->_req_data['checkbox'])) { |
|
860 | 860 | // if array has more than one element than success message should be plural |
861 | - $success = count( $this->_req_data['checkbox'] ) > 1 ? 2 : 1; |
|
861 | + $success = count($this->_req_data['checkbox']) > 1 ? 2 : 1; |
|
862 | 862 | // cycle thru bulk action checkboxes |
863 | - while (list( $PRC_ID, $value ) = each($this->_req_data['checkbox'])) { |
|
864 | - if (!$PRC->delete_permanently_by_ID(absint($PRC_ID))) { |
|
863 | + while (list($PRC_ID, $value) = each($this->_req_data['checkbox'])) { |
|
864 | + if ( ! $PRC->delete_permanently_by_ID(absint($PRC_ID))) { |
|
865 | 865 | $success = 0; |
866 | 866 | } |
867 | 867 | } |
@@ -875,7 +875,7 @@ discard block |
||
875 | 875 | |
876 | 876 | } |
877 | 877 | |
878 | - $this->_redirect_after_action( $success, 'Prices', 'deleted', array() ); |
|
878 | + $this->_redirect_after_action($success, 'Prices', 'deleted', array()); |
|
879 | 879 | |
880 | 880 | } |
881 | 881 | |
@@ -883,16 +883,16 @@ discard block |
||
883 | 883 | |
884 | 884 | |
885 | 885 | public function update_price_order() { |
886 | - $success = __( 'Price order was updated successfully.', 'event_espresso' ); |
|
886 | + $success = __('Price order was updated successfully.', 'event_espresso'); |
|
887 | 887 | |
888 | 888 | // grab our row IDs |
889 | - $row_ids = isset( $this->_req_data['row_ids'] ) && ! empty( $this->_req_data['row_ids'] ) ? explode( ',', rtrim( $this->_req_data['row_ids'], ',' )) : FALSE; |
|
889 | + $row_ids = isset($this->_req_data['row_ids']) && ! empty($this->_req_data['row_ids']) ? explode(',', rtrim($this->_req_data['row_ids'], ',')) : FALSE; |
|
890 | 890 | |
891 | - if ( is_array( $row_ids )) { |
|
892 | - for ( $i = 0; $i < count( $row_ids ); $i++ ) { |
|
891 | + if (is_array($row_ids)) { |
|
892 | + for ($i = 0; $i < count($row_ids); $i++) { |
|
893 | 893 | //Update the prices when re-ordering |
894 | 894 | $id = absint($row_ids[$i]); |
895 | - if ( EEM_Price::instance()->update ( array( 'PRC_order' => $i+1 ), array(array( 'PRC_ID' => $id ) )) === FALSE ) { |
|
895 | + if (EEM_Price::instance()->update(array('PRC_order' => $i + 1), array(array('PRC_ID' => $id))) === FALSE) { |
|
896 | 896 | $success = FALSE; |
897 | 897 | } |
898 | 898 | } |
@@ -900,9 +900,9 @@ discard block |
||
900 | 900 | $success = FALSE; |
901 | 901 | } |
902 | 902 | |
903 | - $errors = ! $success ? __( 'An error occurred. The price order was not updated.', 'event_espresso' ) : FALSE; |
|
903 | + $errors = ! $success ? __('An error occurred. The price order was not updated.', 'event_espresso') : FALSE; |
|
904 | 904 | |
905 | - echo json_encode( array( 'return_data' => FALSE, 'success' => $success, 'errors' => $errors )); |
|
905 | + echo json_encode(array('return_data' => FALSE, 'success' => $success, 'errors' => $errors)); |
|
906 | 906 | die(); |
907 | 907 | } |
908 | 908 | |
@@ -926,7 +926,7 @@ discard block |
||
926 | 926 | * @return void |
927 | 927 | */ |
928 | 928 | protected function _price_types_overview_list_table() { |
929 | - $this->_admin_page_title .= ' ' . $this->get_action_link_or_button( |
|
929 | + $this->_admin_page_title .= ' '.$this->get_action_link_or_button( |
|
930 | 930 | 'add_new_price_type', |
931 | 931 | 'add_type', |
932 | 932 | array(), |
@@ -950,46 +950,46 @@ discard block |
||
950 | 950 | * @param boolean $trashed whether the current view is of the trash can - eww yuck! |
951 | 951 | * @return mixed (int|array) int = count || array of price objects |
952 | 952 | */ |
953 | - public function get_price_types_overview_data( $per_page = 10, $count = FALSE, $trashed = FALSE ) { |
|
953 | + public function get_price_types_overview_data($per_page = 10, $count = FALSE, $trashed = FALSE) { |
|
954 | 954 | |
955 | - do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' ); |
|
955 | + do_action('AHEE_log', __FILE__, __FUNCTION__, ''); |
|
956 | 956 | // start with an empty array |
957 | 957 | |
958 | - require_once( PRICING_ADMIN . 'Price_Types_List_Table.class.php' ); |
|
959 | - require_once( EE_MODELS . 'EEM_Price_Type.model.php' ); |
|
958 | + require_once(PRICING_ADMIN.'Price_Types_List_Table.class.php'); |
|
959 | + require_once(EE_MODELS.'EEM_Price_Type.model.php'); |
|
960 | 960 | |
961 | 961 | $this->_req_data['orderby'] = empty($this->_req_data['orderby']) ? '' : $this->_req_data['orderby']; |
962 | - $order = ( isset( $this->_req_data['order'] ) && ! empty( $this->_req_data['order'] )) ? $this->_req_data['order'] : 'ASC'; |
|
962 | + $order = (isset($this->_req_data['order']) && ! empty($this->_req_data['order'])) ? $this->_req_data['order'] : 'ASC'; |
|
963 | 963 | switch ($this->_req_data['orderby']) { |
964 | 964 | case 'name': |
965 | - $orderby = array( 'PRT_name' => $order); |
|
965 | + $orderby = array('PRT_name' => $order); |
|
966 | 966 | break; |
967 | 967 | default: |
968 | - $orderby = array( 'PRT_order' => $order); |
|
968 | + $orderby = array('PRT_order' => $order); |
|
969 | 969 | } |
970 | 970 | |
971 | 971 | |
972 | - $current_page = isset( $this->_req_data['paged'] ) && !empty( $this->_req_data['paged'] ) ? $this->_req_data['paged'] : 1; |
|
973 | - $per_page = isset( $this->_req_data['perpage'] ) && !empty( $this->_req_data['perpage'] ) ? $this->_req_data['perpage'] : $per_page; |
|
972 | + $current_page = isset($this->_req_data['paged']) && ! empty($this->_req_data['paged']) ? $this->_req_data['paged'] : 1; |
|
973 | + $per_page = isset($this->_req_data['perpage']) && ! empty($this->_req_data['perpage']) ? $this->_req_data['perpage'] : $per_page; |
|
974 | 974 | |
975 | - $offset = ($current_page-1)*$per_page; |
|
976 | - $limit = array( $offset, $per_page ); |
|
975 | + $offset = ($current_page - 1) * $per_page; |
|
976 | + $limit = array($offset, $per_page); |
|
977 | 977 | |
978 | - $_where = array('PRT_deleted'=>$trashed, 'PBT_ID' => array('!=', 1 ) ); |
|
978 | + $_where = array('PRT_deleted'=>$trashed, 'PBT_ID' => array('!=', 1)); |
|
979 | 979 | |
980 | - if ( isset( $this->_req_data['s'] ) ) { |
|
981 | - $sstr = '%' . $this->_req_data['s'] . '%'; |
|
980 | + if (isset($this->_req_data['s'])) { |
|
981 | + $sstr = '%'.$this->_req_data['s'].'%'; |
|
982 | 982 | $_where['OR'] = array( |
983 | - 'PRT_name' => array( 'LIKE', $sstr ) |
|
983 | + 'PRT_name' => array('LIKE', $sstr) |
|
984 | 984 | ); |
985 | 985 | } |
986 | 986 | $query_params = array( |
987 | 987 | $_where, |
988 | 988 | 'order_by'=>$orderby, |
989 | 989 | 'limit'=>$limit); |
990 | - if($count){ |
|
990 | + if ($count) { |
|
991 | 991 | return EEM_Price_Type::instance()->count_deleted_and_undeleted($query_params); |
992 | - }else{ |
|
992 | + } else { |
|
993 | 993 | return EEM_Price_Type::instance()->get_all_deleted_and_undeleted($query_params); |
994 | 994 | } |
995 | 995 | |
@@ -1009,34 +1009,34 @@ discard block |
||
1009 | 1009 | */ |
1010 | 1010 | protected function _edit_price_type_details() { |
1011 | 1011 | |
1012 | - do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' ); |
|
1012 | + do_action('AHEE_log', __FILE__, __FUNCTION__, ''); |
|
1013 | 1013 | |
1014 | 1014 | |
1015 | 1015 | // grab price type ID |
1016 | - $PRT_ID = isset( $this->_req_data['id'] ) && ! empty( $this->_req_data['id'] ) ? absint( $this->_req_data['id'] ) : FALSE; |
|
1016 | + $PRT_ID = isset($this->_req_data['id']) && ! empty($this->_req_data['id']) ? absint($this->_req_data['id']) : FALSE; |
|
1017 | 1017 | // change page title based on request action |
1018 | - switch( $this->_req_action ) { |
|
1018 | + switch ($this->_req_action) { |
|
1019 | 1019 | case 'add_new_price_type' : |
1020 | - $this->_admin_page_title = esc_html__( 'Add New Price Type', 'event_espresso' ); |
|
1020 | + $this->_admin_page_title = esc_html__('Add New Price Type', 'event_espresso'); |
|
1021 | 1021 | break; |
1022 | 1022 | case 'edit_price_type' : |
1023 | - $this->_admin_page_title = esc_html__( 'Edit Price Type', 'event_espresso' ); |
|
1023 | + $this->_admin_page_title = esc_html__('Edit Price Type', 'event_espresso'); |
|
1024 | 1024 | break; |
1025 | 1025 | default : |
1026 | - $this->_admin_page_title = ucwords( str_replace( '_', ' ', $this->_req_action )); |
|
1026 | + $this->_admin_page_title = ucwords(str_replace('_', ' ', $this->_req_action)); |
|
1027 | 1027 | } |
1028 | 1028 | // add PRT_ID to title if editing |
1029 | - $this->_admin_page_title = $PRT_ID ? $this->_admin_page_title . ' # ' . $PRT_ID : $this->_admin_page_title; |
|
1029 | + $this->_admin_page_title = $PRT_ID ? $this->_admin_page_title.' # '.$PRT_ID : $this->_admin_page_title; |
|
1030 | 1030 | |
1031 | 1031 | // require_once(EE_MODELS . 'EEM_Price_Type.model.php'); |
1032 | 1032 | |
1033 | - if ( $PRT_ID ) { |
|
1034 | - $price_type = EEM_Price_Type::instance()->get_one_by_ID( $PRT_ID ); |
|
1035 | - $additional_hidden_fields = array( 'PRT_ID' => array( 'type' => 'hidden', 'value' => $PRT_ID )); |
|
1036 | - $this->_set_add_edit_form_tags( 'update_price_type', $additional_hidden_fields ); |
|
1033 | + if ($PRT_ID) { |
|
1034 | + $price_type = EEM_Price_Type::instance()->get_one_by_ID($PRT_ID); |
|
1035 | + $additional_hidden_fields = array('PRT_ID' => array('type' => 'hidden', 'value' => $PRT_ID)); |
|
1036 | + $this->_set_add_edit_form_tags('update_price_type', $additional_hidden_fields); |
|
1037 | 1037 | } else { |
1038 | 1038 | $price_type = EEM_Price_Type::instance()->get_new_price_type(); |
1039 | - $this->_set_add_edit_form_tags( 'insert_price_type' ); |
|
1039 | + $this->_set_add_edit_form_tags('insert_price_type'); |
|
1040 | 1040 | } |
1041 | 1041 | |
1042 | 1042 | $this->_template_args['PRT_ID'] = $PRT_ID; |
@@ -1045,19 +1045,19 @@ discard block |
||
1045 | 1045 | |
1046 | 1046 | $base_types = EEM_Price_Type::instance()->get_base_types(); |
1047 | 1047 | $select_values = array(); |
1048 | - foreach ( $base_types as $ref => $text ) { |
|
1049 | - if ( $ref == EEM_Price_Type::base_type_base_price ) { |
|
1048 | + foreach ($base_types as $ref => $text) { |
|
1049 | + if ($ref == EEM_Price_Type::base_type_base_price) { |
|
1050 | 1050 | //do not allow creation of base_type_base_prices because that's a system only base type. |
1051 | 1051 | continue; |
1052 | 1052 | } |
1053 | - $values[] = array( 'id' => $ref, 'text' => $text ); |
|
1053 | + $values[] = array('id' => $ref, 'text' => $text); |
|
1054 | 1054 | } |
1055 | 1055 | |
1056 | 1056 | |
1057 | 1057 | $this->_template_args['base_type_select'] = EEH_Form_Fields::select_input('base_type', $values, $price_type->base_type(), 'id="price-type-base-type-slct"'); |
1058 | 1058 | $this->_template_args['learn_more_about_pricing_link'] = $this->_learn_more_about_pricing_link(); |
1059 | - $redirect_URL = add_query_arg( array( 'action' => 'price_types'), $this->_admin_base_url ); |
|
1060 | - $this->_set_publish_post_box_vars( 'id', $PRT_ID, FALSE, $redirect_URL ); |
|
1059 | + $redirect_URL = add_query_arg(array('action' => 'price_types'), $this->_admin_base_url); |
|
1060 | + $this->_set_publish_post_box_vars('id', $PRT_ID, FALSE, $redirect_URL); |
|
1061 | 1061 | // the details template wrapper |
1062 | 1062 | $this->display_admin_page_with_sidebar(); |
1063 | 1063 | |
@@ -1074,7 +1074,7 @@ discard block |
||
1074 | 1074 | * @return void |
1075 | 1075 | */ |
1076 | 1076 | protected function _price_type_details_meta_boxes() { |
1077 | - add_meta_box( 'edit-price-details-mbox', __( 'Price Type Details', 'event_espresso' ), array( $this, '_edit_price_type_details_meta_box' ), $this->wp_page_slug, 'normal', 'high' ); |
|
1077 | + add_meta_box('edit-price-details-mbox', __('Price Type Details', 'event_espresso'), array($this, '_edit_price_type_details_meta_box'), $this->wp_page_slug, 'normal', 'high'); |
|
1078 | 1078 | } |
1079 | 1079 | |
1080 | 1080 | |
@@ -1087,7 +1087,7 @@ discard block |
||
1087 | 1087 | * @return void |
1088 | 1088 | */ |
1089 | 1089 | public function _edit_price_type_details_meta_box() { |
1090 | - echo EEH_Template::display_template( PRICING_TEMPLATE_PATH . 'pricing_type_details_main_meta_box.template.php', $this->_template_args, TRUE ); |
|
1090 | + echo EEH_Template::display_template(PRICING_TEMPLATE_PATH.'pricing_type_details_main_meta_box.template.php', $this->_template_args, TRUE); |
|
1091 | 1091 | } |
1092 | 1092 | |
1093 | 1093 | |
@@ -1100,9 +1100,9 @@ discard block |
||
1100 | 1100 | */ |
1101 | 1101 | protected function set_price_type_column_values() { |
1102 | 1102 | |
1103 | - do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' ); |
|
1103 | + do_action('AHEE_log', __FILE__, __FUNCTION__, ''); |
|
1104 | 1104 | |
1105 | - $base_type = !empty( $this->_req_data['base_type'] ) ? $this->_req_data['base_type'] : EEM_Price_Type::base_type_base_price; |
|
1105 | + $base_type = ! empty($this->_req_data['base_type']) ? $this->_req_data['base_type'] : EEM_Price_Type::base_type_base_price; |
|
1106 | 1106 | |
1107 | 1107 | switch ($base_type) { |
1108 | 1108 | |
@@ -1149,12 +1149,12 @@ discard block |
||
1149 | 1149 | * @access protected |
1150 | 1150 | * @return void |
1151 | 1151 | */ |
1152 | - protected function _insert_or_update_price_type( $new_price_type = FALSE ) { |
|
1152 | + protected function _insert_or_update_price_type($new_price_type = FALSE) { |
|
1153 | 1153 | |
1154 | 1154 | // echo '<h3>'. __CLASS__ . '->' . __FUNCTION__ . ' <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span></h3>'; |
1155 | - do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' ); |
|
1155 | + do_action('AHEE_log', __FILE__, __FUNCTION__, ''); |
|
1156 | 1156 | |
1157 | - require_once(EE_MODELS . 'EEM_Price_Type.model.php'); |
|
1157 | + require_once(EE_MODELS.'EEM_Price_Type.model.php'); |
|
1158 | 1158 | $PRT = EEM_Price_Type::instance(); |
1159 | 1159 | |
1160 | 1160 | // why be so pessimistic ??? : ( |
@@ -1162,24 +1162,24 @@ discard block |
||
1162 | 1162 | |
1163 | 1163 | $set_column_values = $this->set_price_type_column_values(); |
1164 | 1164 | // is this a new Price ? |
1165 | - if ( $new_price_type ) { |
|
1165 | + if ($new_price_type) { |
|
1166 | 1166 | // run the insert |
1167 | - if ( $PRT_ID = $PRT->insert( $set_column_values )) { |
|
1167 | + if ($PRT_ID = $PRT->insert($set_column_values)) { |
|
1168 | 1168 | $success = 1; |
1169 | 1169 | } |
1170 | 1170 | $action_desc = 'created'; |
1171 | 1171 | } else { |
1172 | 1172 | $PRT_ID = absint($this->_req_data['PRT_ID']); |
1173 | 1173 | // run the update |
1174 | - $where_cols_n_values = array('PRT_ID' => $PRT_ID ); |
|
1175 | - if ( $PRT->update( $set_column_values, array( $where_cols_n_values ))) { |
|
1174 | + $where_cols_n_values = array('PRT_ID' => $PRT_ID); |
|
1175 | + if ($PRT->update($set_column_values, array($where_cols_n_values))) { |
|
1176 | 1176 | $success = 1; |
1177 | 1177 | } |
1178 | 1178 | $action_desc = 'updated'; |
1179 | 1179 | } |
1180 | 1180 | |
1181 | - $query_args = array( 'action'=> 'edit_price_type', 'id' => $PRT_ID ); |
|
1182 | - $this->_redirect_after_action( $success, 'Price Type', $action_desc, $query_args ); |
|
1181 | + $query_args = array('action'=> 'edit_price_type', 'id' => $PRT_ID); |
|
1182 | + $this->_redirect_after_action($success, 'Price Type', $action_desc, $query_args); |
|
1183 | 1183 | |
1184 | 1184 | } |
1185 | 1185 | |
@@ -1193,49 +1193,49 @@ discard block |
||
1193 | 1193 | * @access protected |
1194 | 1194 | * @return void |
1195 | 1195 | */ |
1196 | - protected function _trash_or_restore_price_type( $trash = TRUE ) { |
|
1196 | + protected function _trash_or_restore_price_type($trash = TRUE) { |
|
1197 | 1197 | |
1198 | 1198 | //echo '<h3>'. __CLASS__ . '->' . __FUNCTION__ . ' <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span></h3>'; |
1199 | - do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' ); |
|
1199 | + do_action('AHEE_log', __FILE__, __FUNCTION__, ''); |
|
1200 | 1200 | |
1201 | - require_once(EE_MODELS . 'EEM_Price_Type.model.php'); |
|
1201 | + require_once(EE_MODELS.'EEM_Price_Type.model.php'); |
|
1202 | 1202 | $PRT = EEM_Price_Type::instance(); |
1203 | 1203 | |
1204 | 1204 | $success = 1; |
1205 | 1205 | $PRT_deleted = $trash ? TRUE : FALSE; |
1206 | 1206 | //Checkboxes |
1207 | - if (!empty($this->_req_data['checkbox']) && is_array($this->_req_data['checkbox'])) { |
|
1207 | + if ( ! empty($this->_req_data['checkbox']) && is_array($this->_req_data['checkbox'])) { |
|
1208 | 1208 | // if array has more than one element than success message should be plural |
1209 | - $success = count( $this->_req_data['checkbox'] ) > 1 ? 2 : 1; |
|
1210 | - $what = count( $this->_req_data['checkbox'] ) > 1 ? 'Price Types' : 'Price Type'; |
|
1209 | + $success = count($this->_req_data['checkbox']) > 1 ? 2 : 1; |
|
1210 | + $what = count($this->_req_data['checkbox']) > 1 ? 'Price Types' : 'Price Type'; |
|
1211 | 1211 | // cycle thru checkboxes |
1212 | - while (list( $PRT_ID, $value ) = each($this->_req_data['checkbox'])) { |
|
1213 | - if ( ! $PRT->update_by_ID(array('PRT_deleted' => $PRT_deleted), $PRT_ID ) ) { |
|
1212 | + while (list($PRT_ID, $value) = each($this->_req_data['checkbox'])) { |
|
1213 | + if ( ! $PRT->update_by_ID(array('PRT_deleted' => $PRT_deleted), $PRT_ID)) { |
|
1214 | 1214 | $success = 0; |
1215 | 1215 | } |
1216 | 1216 | } |
1217 | 1217 | |
1218 | 1218 | } else { |
1219 | 1219 | // grab single id and delete |
1220 | - $PRT_ID = isset( $this->_req_data['id'] ) ? absint($this->_req_data['id']) : 0; |
|
1221 | - if ( empty( $PRT_ID ) || ! $PRT->update_by_ID(array('PRT_deleted' => $PRT_deleted), $PRT_ID )) { |
|
1220 | + $PRT_ID = isset($this->_req_data['id']) ? absint($this->_req_data['id']) : 0; |
|
1221 | + if (empty($PRT_ID) || ! $PRT->update_by_ID(array('PRT_deleted' => $PRT_deleted), $PRT_ID)) { |
|
1222 | 1222 | $success = 0; |
1223 | 1223 | } |
1224 | 1224 | $what = 'Price Type'; |
1225 | 1225 | |
1226 | 1226 | } |
1227 | 1227 | |
1228 | - $query_args = array( 'action' => 'price_types' ); |
|
1229 | - if ( $success ) { |
|
1230 | - if ( $trash ) { |
|
1228 | + $query_args = array('action' => 'price_types'); |
|
1229 | + if ($success) { |
|
1230 | + if ($trash) { |
|
1231 | 1231 | $msg = $success > 1 ? __('The Price Types have been trashed.', 'event_espresso') : __('The Price Type has been trashed.', 'event_espresso'); |
1232 | 1232 | } else { |
1233 | 1233 | $msg = $success > 1 ? __('The Price Types have been restored.', 'event_espresso') : __('The Price Type has been restored.', 'event_espresso'); |
1234 | 1234 | } |
1235 | - EE_Error::add_success( $msg ); |
|
1235 | + EE_Error::add_success($msg); |
|
1236 | 1236 | } |
1237 | 1237 | |
1238 | - $this->_redirect_after_action( FALSE, '', '', $query_args, TRUE ); |
|
1238 | + $this->_redirect_after_action(FALSE, '', '', $query_args, TRUE); |
|
1239 | 1239 | |
1240 | 1240 | } |
1241 | 1241 | |
@@ -1252,19 +1252,19 @@ discard block |
||
1252 | 1252 | protected function _delete_price_type() { |
1253 | 1253 | |
1254 | 1254 | //echo '<h3>'. __CLASS__ . '->' . __FUNCTION__ . ' <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span></h3>'; |
1255 | - do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' ); |
|
1255 | + do_action('AHEE_log', __FILE__, __FUNCTION__, ''); |
|
1256 | 1256 | |
1257 | 1257 | $PRT = EEM_Price_Type::instance(); |
1258 | 1258 | |
1259 | 1259 | $success = 1; |
1260 | 1260 | //Checkboxes |
1261 | - if (!empty($this->_req_data['checkbox'])) { |
|
1261 | + if ( ! empty($this->_req_data['checkbox'])) { |
|
1262 | 1262 | // if array has more than one element than success message should be plural |
1263 | - $success = count( $this->_req_data['checkbox'] ) > 1 ? 2 : 1; |
|
1263 | + $success = count($this->_req_data['checkbox']) > 1 ? 2 : 1; |
|
1264 | 1264 | $what = $PRT->item_name($success); |
1265 | 1265 | // cycle thru bulk action checkboxes |
1266 | - while (list( $PRT_ID, $value ) = each($this->_req_data['checkbox'])) { |
|
1267 | - if (!$PRT->delete_permanently_by_ID($PRT_ID) ) { |
|
1266 | + while (list($PRT_ID, $value) = each($this->_req_data['checkbox'])) { |
|
1267 | + if ( ! $PRT->delete_permanently_by_ID($PRT_ID)) { |
|
1268 | 1268 | $success = 0; |
1269 | 1269 | } |
1270 | 1270 | } |
@@ -1272,8 +1272,8 @@ discard block |
||
1272 | 1272 | } |
1273 | 1273 | |
1274 | 1274 | |
1275 | - $query_args = array( 'action'=> 'price_types' ); |
|
1276 | - $this->_redirect_after_action( $success, $what, 'deleted', $query_args ); |
|
1275 | + $query_args = array('action'=> 'price_types'); |
|
1276 | + $this->_redirect_after_action($success, $what, 'deleted', $query_args); |
|
1277 | 1277 | |
1278 | 1278 | } |
1279 | 1279 | |
@@ -1289,7 +1289,7 @@ discard block |
||
1289 | 1289 | * @return string |
1290 | 1290 | */ |
1291 | 1291 | protected function _learn_more_about_pricing_link() { |
1292 | - return '<a class="hidden" style="margin:0 20px; cursor:pointer; font-size:12px;" >' . __('learn more about how pricing works', 'event_espresso') . '</a>'; |
|
1292 | + return '<a class="hidden" style="margin:0 20px; cursor:pointer; font-size:12px;" >'.__('learn more about how pricing works', 'event_espresso').'</a>'; |
|
1293 | 1293 | } |
1294 | 1294 | |
1295 | 1295 | |
@@ -1365,17 +1365,17 @@ discard block |
||
1365 | 1365 | * @return void |
1366 | 1366 | */ |
1367 | 1367 | public function _update_tax_settings() { |
1368 | - if ( ! isset( EE_Registry::instance()->CFG->tax_settings ) ) { |
|
1368 | + if ( ! isset(EE_Registry::instance()->CFG->tax_settings)) { |
|
1369 | 1369 | EE_Registry::instance()->CFG->tax_settings = new EE_Tax_Config(); |
1370 | 1370 | } |
1371 | 1371 | try { |
1372 | 1372 | $tax_form = $this->tax_settings_form(); |
1373 | 1373 | //check for form submission |
1374 | - if ( $tax_form->was_submitted() ) { |
|
1374 | + if ($tax_form->was_submitted()) { |
|
1375 | 1375 | //capture form data |
1376 | 1376 | $tax_form->receive_form_submission(); |
1377 | 1377 | //validate form data |
1378 | - if ( $tax_form->is_valid() ) { |
|
1378 | + if ($tax_form->is_valid()) { |
|
1379 | 1379 | //grab validated data from form |
1380 | 1380 | $valid_data = $tax_form->valid_data(); |
1381 | 1381 | //set data on config |
@@ -1385,7 +1385,7 @@ discard block |
||
1385 | 1385 | ->prices_displayed_including_taxes |
1386 | 1386 | = $valid_data['tax_settings']['prices_displayed_including_taxes']; |
1387 | 1387 | } else { |
1388 | - if ( $tax_form->submission_error_message() !== '' ) { |
|
1388 | + if ($tax_form->submission_error_message() !== '') { |
|
1389 | 1389 | EE_Error::add_error( |
1390 | 1390 | $tax_form->submission_error_message(), |
1391 | 1391 | __FILE__, |
@@ -1395,8 +1395,8 @@ discard block |
||
1395 | 1395 | } |
1396 | 1396 | } |
1397 | 1397 | } |
1398 | - } catch ( EE_Error $e ) { |
|
1399 | - EE_Error::add_error( $e->get_error(), __FILE__, __FUNCTION__, __LINE__ ); |
|
1398 | + } catch (EE_Error $e) { |
|
1399 | + EE_Error::add_error($e->get_error(), __FILE__, __FUNCTION__, __LINE__); |
|
1400 | 1400 | } |
1401 | 1401 | |
1402 | 1402 | $what = 'Tax Settings'; |
@@ -1407,7 +1407,7 @@ discard block |
||
1407 | 1407 | __FUNCTION__, |
1408 | 1408 | __LINE__ |
1409 | 1409 | ); |
1410 | - $this->_redirect_after_action( $success, $what, 'updated', array( 'action' => 'tax_settings' ) ); |
|
1410 | + $this->_redirect_after_action($success, $what, 'updated', array('action' => 'tax_settings')); |
|
1411 | 1411 | } |
1412 | 1412 | |
1413 | 1413 |