@@ -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; |
@@ -200,7 +200,7 @@ discard block |
||
200 | 200 | 'order' => 10 |
201 | 201 | ), |
202 | 202 | 'list_table' => 'Prices_List_Table', |
203 | - 'help_tabs' => array( |
|
203 | + 'help_tabs' => array( |
|
204 | 204 | 'pricing_default_pricing_help_tab' => array( |
205 | 205 | 'title' => __('Default Pricing', 'event_espresso'), |
206 | 206 | 'filename' => 'pricing_default_pricing' |
@@ -223,13 +223,13 @@ discard block |
||
223 | 223 | 'order' => 20, |
224 | 224 | 'persistent' => FALSE |
225 | 225 | ), |
226 | - 'help_tabs' => array( |
|
226 | + 'help_tabs' => array( |
|
227 | 227 | 'add_new_default_price_help_tab' => array( |
228 | 228 | 'title' => __('Add New Default Price', 'event_espresso'), |
229 | 229 | 'filename' => 'pricing_add_new_default_price' |
230 | 230 | ) |
231 | 231 | ), |
232 | - 'help_tour' => array('Pricing_Add_New_Default_Price_Help_Tour'), |
|
232 | + 'help_tour' => array('Pricing_Add_New_Default_Price_Help_Tour'), |
|
233 | 233 | 'metaboxes' => array( '_publish_post_box', '_espresso_news_post_box', '_price_details_meta_boxes' ), |
234 | 234 | 'require_nonce' => FALSE |
235 | 235 | ), |
@@ -241,7 +241,7 @@ discard block |
||
241 | 241 | 'persistent' => FALSE |
242 | 242 | ), |
243 | 243 | 'metaboxes' => array( '_publish_post_box', '_espresso_news_post_box', '_price_details_meta_boxes' ), |
244 | - 'help_tabs' => array( |
|
244 | + 'help_tabs' => array( |
|
245 | 245 | 'edit_default_price_help_tab' => array( |
246 | 246 | 'title' => __('Edit Default Price', 'event_espresso'), |
247 | 247 | 'filename' => 'pricing_edit_default_price' |
@@ -256,7 +256,7 @@ discard block |
||
256 | 256 | 'order' => 30 |
257 | 257 | ), |
258 | 258 | 'list_table' => 'Price_Types_List_Table', |
259 | - 'help_tabs' => array( |
|
259 | + 'help_tabs' => array( |
|
260 | 260 | 'pricing_price_types_help_tab' => array( |
261 | 261 | 'title' => __('Price Types', 'event_espresso'), |
262 | 262 | 'filename' => 'pricing_price_types' |
@@ -280,13 +280,13 @@ discard block |
||
280 | 280 | 'order' => 40, |
281 | 281 | 'persistent' => FALSE |
282 | 282 | ), |
283 | - 'help_tabs' => array( |
|
283 | + 'help_tabs' => array( |
|
284 | 284 | 'add_new_price_type_help_tab' => array( |
285 | 285 | 'title' => __('Add New Price Type', 'event_espresso'), |
286 | 286 | 'filename' => 'pricing_add_new_price_type' |
287 | 287 | ) |
288 | 288 | ), |
289 | - 'help_tour' => array( 'Pricing_Add_New_Price_Type_Help_Tour' ), |
|
289 | + 'help_tour' => array( 'Pricing_Add_New_Price_Type_Help_Tour' ), |
|
290 | 290 | 'metaboxes' => array( '_publish_post_box', '_espresso_news_post_box', '_price_type_details_meta_boxes' ), |
291 | 291 | 'require_nonce' => FALSE |
292 | 292 | ), |
@@ -296,13 +296,13 @@ discard block |
||
296 | 296 | 'order' => 40, |
297 | 297 | 'persistent' => FALSE |
298 | 298 | ), |
299 | - 'help_tabs' => array( |
|
299 | + 'help_tabs' => array( |
|
300 | 300 | 'edit_price_type_help_tab' => array( |
301 | 301 | 'title' => __('Edit Price Type', 'event_espresso'), |
302 | 302 | 'filename' => 'pricing_edit_price_type' |
303 | 303 | ) |
304 | 304 | ), |
305 | - 'help_tour' => array( 'Pricing_Edit_Price_Type_Help_Tour' ), |
|
305 | + 'help_tour' => array( 'Pricing_Edit_Price_Type_Help_Tour' ), |
|
306 | 306 | 'metaboxes' => array( '_publish_post_box', '_espresso_news_post_box', '_price_type_details_meta_boxes' ), |
307 | 307 | |
308 | 308 | 'require_nonce' => FALSE |
@@ -433,16 +433,16 @@ discard block |
||
433 | 433 | |
434 | 434 | /** |
435 | 435 | * generates HTML for main Prices Admin page |
436 | - * @access protected |
|
437 | - * @return void |
|
438 | - */ |
|
436 | + * @access protected |
|
437 | + * @return void |
|
438 | + */ |
|
439 | 439 | protected function _price_overview_list_table() { |
440 | 440 | $this->_admin_page_title .= ' ' . $this->get_action_link_or_button( |
441 | - 'add_new_price', |
|
442 | - 'add', |
|
443 | - array(), |
|
444 | - 'add-new-h2' |
|
445 | - ); |
|
441 | + 'add_new_price', |
|
442 | + 'add', |
|
443 | + array(), |
|
444 | + 'add-new-h2' |
|
445 | + ); |
|
446 | 446 | $this->admin_page_title .= $this->_learn_more_about_pricing_link(); |
447 | 447 | $this->_search_btn_label = __('Default Prices', 'event_espresso'); |
448 | 448 | $this->display_admin_list_table_page_with_no_sidebar(); |
@@ -454,13 +454,13 @@ discard block |
||
454 | 454 | |
455 | 455 | |
456 | 456 | /** |
457 | - * retrieve data for Prices List table |
|
458 | - * @access public |
|
459 | - * @param int $per_page how many prices displayed per page |
|
460 | - * @param boolean $count return the count or objects |
|
461 | - * @param boolean $trashed whether the current view is of the trash can - eww yuck! |
|
462 | - * @return mixed (int|array) int = count || array of price objects |
|
463 | - */ |
|
457 | + * retrieve data for Prices List table |
|
458 | + * @access public |
|
459 | + * @param int $per_page how many prices displayed per page |
|
460 | + * @param boolean $count return the count or objects |
|
461 | + * @param boolean $trashed whether the current view is of the trash can - eww yuck! |
|
462 | + * @return mixed (int|array) int = count || array of price objects |
|
463 | + */ |
|
464 | 464 | public function get_prices_overview_data( $per_page = 10, $count = FALSE, $trashed = FALSE ) { |
465 | 465 | |
466 | 466 | do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' ); |
@@ -530,9 +530,9 @@ discard block |
||
530 | 530 | |
531 | 531 | /** |
532 | 532 | * _price_details |
533 | - * @access protected |
|
534 | - * @return void |
|
535 | - */ |
|
533 | + * @access protected |
|
534 | + * @return void |
|
535 | + */ |
|
536 | 536 | protected function _edit_price_details() { |
537 | 537 | do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' ); |
538 | 538 | // grab price ID |
@@ -592,9 +592,9 @@ discard block |
||
592 | 592 | |
593 | 593 | /** |
594 | 594 | * declare price details page metaboxes |
595 | - * @access protected |
|
596 | - * @return void |
|
597 | - */ |
|
595 | + * @access protected |
|
596 | + * @return void |
|
597 | + */ |
|
598 | 598 | protected function _price_details_meta_boxes() { |
599 | 599 | 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' ); |
600 | 600 | } |
@@ -606,9 +606,9 @@ discard block |
||
606 | 606 | |
607 | 607 | /** |
608 | 608 | * _edit_price_details_meta_box |
609 | - * @access public |
|
610 | - * @return void |
|
611 | - */ |
|
609 | + * @access public |
|
610 | + * @return void |
|
611 | + */ |
|
612 | 612 | public function _edit_price_details_meta_box() { |
613 | 613 | echo EEH_Template::display_template( PRICING_TEMPLATE_PATH . 'pricing_details_main_meta_box.template.php', $this->_template_args, TRUE ); |
614 | 614 | } |
@@ -619,9 +619,9 @@ discard block |
||
619 | 619 | |
620 | 620 | /** |
621 | 621 | * set_price_column_values |
622 | - * @access protected |
|
623 | - * @return array |
|
624 | - */ |
|
622 | + * @access protected |
|
623 | + * @return array |
|
624 | + */ |
|
625 | 625 | protected function set_price_column_values() { |
626 | 626 | |
627 | 627 | do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' ); |
@@ -648,10 +648,10 @@ discard block |
||
648 | 648 | |
649 | 649 | /** |
650 | 650 | * insert_or_update_price |
651 | - * @param boolean $insert - whether to insert or update |
|
652 | - * @access protected |
|
653 | - * @return void |
|
654 | - */ |
|
651 | + * @param boolean $insert - whether to insert or update |
|
652 | + * @access protected |
|
653 | + * @return void |
|
654 | + */ |
|
655 | 655 | protected function _insert_or_update_price( $insert = FALSE ) { |
656 | 656 | |
657 | 657 | //echo '<h3>'. __CLASS__ . '->' . __FUNCTION__ . ' <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span></h3>'; |
@@ -724,10 +724,10 @@ discard block |
||
724 | 724 | |
725 | 725 | /** |
726 | 726 | * _trash_or_restore_price |
727 | - * @param boolean $trash - whether to move item to trash (TRUE) or restore it (FALSE) |
|
728 | - * @access protected |
|
729 | - * @return void |
|
730 | - */ |
|
727 | + * @param boolean $trash - whether to move item to trash (TRUE) or restore it (FALSE) |
|
728 | + * @access protected |
|
729 | + * @return void |
|
730 | + */ |
|
731 | 731 | protected function _trash_or_restore_price( $trash = TRUE ) { |
732 | 732 | |
733 | 733 | //echo '<h3>'. __CLASS__ . '->' . __FUNCTION__ . ' <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span></h3>'; |
@@ -807,9 +807,9 @@ discard block |
||
807 | 807 | |
808 | 808 | /** |
809 | 809 | * _delete_price |
810 | - * @access protected |
|
811 | - * @return void |
|
812 | - */ |
|
810 | + * @access protected |
|
811 | + * @return void |
|
812 | + */ |
|
813 | 813 | protected function _delete_price() { |
814 | 814 | |
815 | 815 | //echo '<h3>'. __CLASS__ . '->' . __FUNCTION__ . ' <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span></h3>'; |
@@ -886,16 +886,16 @@ discard block |
||
886 | 886 | |
887 | 887 | /** |
888 | 888 | * generates HTML for main Prices Admin page |
889 | - * @access protected |
|
890 | - * @return void |
|
891 | - */ |
|
889 | + * @access protected |
|
890 | + * @return void |
|
891 | + */ |
|
892 | 892 | protected function _price_types_overview_list_table() { |
893 | 893 | $this->_admin_page_title .= ' ' . $this->get_action_link_or_button( |
894 | - 'add_new_price_type', |
|
895 | - 'add_type', |
|
896 | - array(), |
|
897 | - 'add-new-h2' |
|
898 | - ); |
|
894 | + 'add_new_price_type', |
|
895 | + 'add_type', |
|
896 | + array(), |
|
897 | + 'add-new-h2' |
|
898 | + ); |
|
899 | 899 | $this->admin_page_title .= $this->_learn_more_about_pricing_link(); |
900 | 900 | $this->_search_btn_label = __('Price Types', 'event_espresso'); |
901 | 901 | $this->display_admin_list_table_page_with_no_sidebar(); |
@@ -907,13 +907,13 @@ discard block |
||
907 | 907 | |
908 | 908 | |
909 | 909 | /** |
910 | - * retrieve data for Price Types List table |
|
911 | - * @access public |
|
912 | - * @param int $per_page how many prices displayed per page |
|
913 | - * @param boolean $count return the count or objects |
|
914 | - * @param boolean $trashed whether the current view is of the trash can - eww yuck! |
|
915 | - * @return mixed (int|array) int = count || array of price objects |
|
916 | - */ |
|
910 | + * retrieve data for Price Types List table |
|
911 | + * @access public |
|
912 | + * @param int $per_page how many prices displayed per page |
|
913 | + * @param boolean $count return the count or objects |
|
914 | + * @param boolean $trashed whether the current view is of the trash can - eww yuck! |
|
915 | + * @return mixed (int|array) int = count || array of price objects |
|
916 | + */ |
|
917 | 917 | public function get_price_types_overview_data( $per_page = 10, $count = FALSE, $trashed = FALSE ) { |
918 | 918 | |
919 | 919 | do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' ); |
@@ -968,9 +968,9 @@ discard block |
||
968 | 968 | |
969 | 969 | /** |
970 | 970 | * _edit_price_type_details |
971 | - * @access protected |
|
972 | - * @return void |
|
973 | - */ |
|
971 | + * @access protected |
|
972 | + * @return void |
|
973 | + */ |
|
974 | 974 | protected function _edit_price_type_details() { |
975 | 975 | |
976 | 976 | do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' ); |
@@ -1025,9 +1025,9 @@ discard block |
||
1025 | 1025 | |
1026 | 1026 | /** |
1027 | 1027 | * declare price type details page metaboxes |
1028 | - * @access protected |
|
1029 | - * @return void |
|
1030 | - */ |
|
1028 | + * @access protected |
|
1029 | + * @return void |
|
1030 | + */ |
|
1031 | 1031 | protected function _price_type_details_meta_boxes() { |
1032 | 1032 | 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' ); |
1033 | 1033 | } |
@@ -1038,9 +1038,9 @@ discard block |
||
1038 | 1038 | |
1039 | 1039 | /** |
1040 | 1040 | * _edit_price_type_details_meta_box |
1041 | - * @access public |
|
1042 | - * @return void |
|
1043 | - */ |
|
1041 | + * @access public |
|
1042 | + * @return void |
|
1043 | + */ |
|
1044 | 1044 | public function _edit_price_type_details_meta_box() { |
1045 | 1045 | echo EEH_Template::display_template( PRICING_TEMPLATE_PATH . 'pricing_type_details_main_meta_box.template.php', $this->_template_args, TRUE ); |
1046 | 1046 | } |
@@ -1050,9 +1050,9 @@ discard block |
||
1050 | 1050 | |
1051 | 1051 | /** |
1052 | 1052 | * set_price_type_column_values |
1053 | - * @access protected |
|
1054 | - * @return void |
|
1055 | - */ |
|
1053 | + * @access protected |
|
1054 | + * @return void |
|
1055 | + */ |
|
1056 | 1056 | protected function set_price_type_column_values() { |
1057 | 1057 | |
1058 | 1058 | do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' ); |
@@ -1100,10 +1100,10 @@ discard block |
||
1100 | 1100 | |
1101 | 1101 | /** |
1102 | 1102 | * _insert_or_update_price_type |
1103 | - * @param boolean $new_price_type - whether to insert or update |
|
1104 | - * @access protected |
|
1105 | - * @return void |
|
1106 | - */ |
|
1103 | + * @param boolean $new_price_type - whether to insert or update |
|
1104 | + * @access protected |
|
1105 | + * @return void |
|
1106 | + */ |
|
1107 | 1107 | protected function _insert_or_update_price_type( $new_price_type = FALSE ) { |
1108 | 1108 | |
1109 | 1109 | // echo '<h3>'. __CLASS__ . '->' . __FUNCTION__ . ' <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span></h3>'; |
@@ -1144,10 +1144,10 @@ discard block |
||
1144 | 1144 | |
1145 | 1145 | /** |
1146 | 1146 | * _trash_or_restore_price_type |
1147 | - * @param boolean $trash - whether to move item to trash (TRUE) or restore it (FALSE) |
|
1148 | - * @access protected |
|
1149 | - * @return void |
|
1150 | - */ |
|
1147 | + * @param boolean $trash - whether to move item to trash (TRUE) or restore it (FALSE) |
|
1148 | + * @access protected |
|
1149 | + * @return void |
|
1150 | + */ |
|
1151 | 1151 | protected function _trash_or_restore_price_type( $trash = TRUE ) { |
1152 | 1152 | |
1153 | 1153 | //echo '<h3>'. __CLASS__ . '->' . __FUNCTION__ . ' <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span></h3>'; |
@@ -1201,9 +1201,9 @@ discard block |
||
1201 | 1201 | |
1202 | 1202 | /** |
1203 | 1203 | * _delete_price_type |
1204 | - * @access protected |
|
1205 | - * @return void |
|
1206 | - */ |
|
1204 | + * @access protected |
|
1205 | + * @return void |
|
1206 | + */ |
|
1207 | 1207 | protected function _delete_price_type() { |
1208 | 1208 | |
1209 | 1209 | //echo '<h3>'. __CLASS__ . '->' . __FUNCTION__ . ' <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span></h3>'; |
@@ -1240,9 +1240,9 @@ discard block |
||
1240 | 1240 | |
1241 | 1241 | /** |
1242 | 1242 | * _learn_more_about_pricing_link |
1243 | - * @access protected |
|
1244 | - * @return string |
|
1245 | - */ |
|
1243 | + * @access protected |
|
1244 | + * @return string |
|
1245 | + */ |
|
1246 | 1246 | protected function _learn_more_about_pricing_link() { |
1247 | 1247 | return '<a class="hidden" style="margin:0 20px; cursor:pointer; font-size:12px;" >' . __('learn more about how pricing works', 'event_espresso') . '</a>'; |
1248 | 1248 | } |
@@ -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 |
@@ -214,7 +214,7 @@ discard block |
||
214 | 214 | 'filename' => 'pricing_default_pricing_views_bulk_actions_search' |
215 | 215 | ) |
216 | 216 | ), |
217 | - 'help_tour' => array( 'Pricing_Default_Prices_Help_Tour'), |
|
217 | + 'help_tour' => array('Pricing_Default_Prices_Help_Tour'), |
|
218 | 218 | 'require_nonce' => FALSE |
219 | 219 | ), |
220 | 220 | 'add_new_price' => array( |
@@ -230,24 +230,24 @@ discard block |
||
230 | 230 | ) |
231 | 231 | ), |
232 | 232 | 'help_tour' => array('Pricing_Add_New_Default_Price_Help_Tour'), |
233 | - 'metaboxes' => array( '_publish_post_box', '_espresso_news_post_box', '_price_details_meta_boxes' ), |
|
233 | + 'metaboxes' => array('_publish_post_box', '_espresso_news_post_box', '_price_details_meta_boxes'), |
|
234 | 234 | 'require_nonce' => FALSE |
235 | 235 | ), |
236 | 236 | 'edit_price' => array( |
237 | 237 | 'nav' => array( |
238 | 238 | 'label' => __('Edit Default Price', 'event_espresso'), |
239 | 239 | 'order' => 20, |
240 | - 'url' => isset($this->_req_data['id']) ? add_query_arg(array('id' => $this->_req_data['id'] ), $this->_current_page_view_url ) : $this->_admin_base_url, |
|
240 | + 'url' => isset($this->_req_data['id']) ? add_query_arg(array('id' => $this->_req_data['id']), $this->_current_page_view_url) : $this->_admin_base_url, |
|
241 | 241 | 'persistent' => FALSE |
242 | 242 | ), |
243 | - 'metaboxes' => array( '_publish_post_box', '_espresso_news_post_box', '_price_details_meta_boxes' ), |
|
243 | + 'metaboxes' => array('_publish_post_box', '_espresso_news_post_box', '_price_details_meta_boxes'), |
|
244 | 244 | 'help_tabs' => array( |
245 | 245 | 'edit_default_price_help_tab' => array( |
246 | 246 | 'title' => __('Edit Default Price', 'event_espresso'), |
247 | 247 | 'filename' => 'pricing_edit_default_price' |
248 | 248 | ) |
249 | 249 | ), |
250 | - 'help_tour' => array( 'Pricing_Edit_Default_Price_Help_Tour' ), |
|
250 | + 'help_tour' => array('Pricing_Edit_Default_Price_Help_Tour'), |
|
251 | 251 | 'require_nonce' => FALSE |
252 | 252 | ), |
253 | 253 | 'price_types' => array( |
@@ -270,7 +270,7 @@ discard block |
||
270 | 270 | 'filename' => 'pricing_price_types_views_bulk_actions_search' |
271 | 271 | ), |
272 | 272 | ), |
273 | - 'help_tour' => array( 'Pricing_Price_Types_Default_Help_Tour' ), |
|
273 | + 'help_tour' => array('Pricing_Price_Types_Default_Help_Tour'), |
|
274 | 274 | 'metaboxes' => array('_espresso_news_post_box', '_espresso_links_post_box'), |
275 | 275 | 'require_nonce' => FALSE |
276 | 276 | ), |
@@ -286,8 +286,8 @@ discard block |
||
286 | 286 | 'filename' => 'pricing_add_new_price_type' |
287 | 287 | ) |
288 | 288 | ), |
289 | - 'help_tour' => array( 'Pricing_Add_New_Price_Type_Help_Tour' ), |
|
290 | - 'metaboxes' => array( '_publish_post_box', '_espresso_news_post_box', '_price_type_details_meta_boxes' ), |
|
289 | + 'help_tour' => array('Pricing_Add_New_Price_Type_Help_Tour'), |
|
290 | + 'metaboxes' => array('_publish_post_box', '_espresso_news_post_box', '_price_type_details_meta_boxes'), |
|
291 | 291 | 'require_nonce' => FALSE |
292 | 292 | ), |
293 | 293 | 'edit_price_type' => array( |
@@ -302,8 +302,8 @@ discard block |
||
302 | 302 | 'filename' => 'pricing_edit_price_type' |
303 | 303 | ) |
304 | 304 | ), |
305 | - 'help_tour' => array( 'Pricing_Edit_Price_Type_Help_Tour' ), |
|
306 | - 'metaboxes' => array( '_publish_post_box', '_espresso_news_post_box', '_price_type_details_meta_boxes' ), |
|
305 | + 'help_tour' => array('Pricing_Edit_Price_Type_Help_Tour'), |
|
306 | + 'metaboxes' => array('_publish_post_box', '_espresso_news_post_box', '_price_type_details_meta_boxes'), |
|
307 | 307 | |
308 | 308 | 'require_nonce' => FALSE |
309 | 309 | ) |
@@ -340,7 +340,7 @@ discard block |
||
340 | 340 | public function load_scripts_styles() { |
341 | 341 | //styles |
342 | 342 | wp_enqueue_style('espresso-ui-theme'); |
343 | - wp_register_style( 'espresso_PRICING', PRICING_ASSETS_URL . 'espresso_pricing_admin.css', array(), EVENT_ESPRESSO_VERSION ); |
|
343 | + wp_register_style('espresso_PRICING', PRICING_ASSETS_URL.'espresso_pricing_admin.css', array(), EVENT_ESPRESSO_VERSION); |
|
344 | 344 | wp_enqueue_style('espresso_PRICING'); |
345 | 345 | |
346 | 346 | //scripts |
@@ -350,8 +350,8 @@ discard block |
||
350 | 350 | //wp_enqueue_script('jquery-ui-dialog'); |
351 | 351 | //wp_enqueue_script('jquery-ui-draggable'); |
352 | 352 | //wp_enqueue_script('jquery-ui-datepicker'); |
353 | - wp_register_script( 'espresso_PRICING', PRICING_ASSETS_URL . 'espresso_pricing_admin.js', array('jquery'), EVENT_ESPRESSO_VERSION, TRUE ); |
|
354 | - wp_enqueue_script( 'espresso_PRICING' ); |
|
353 | + wp_register_script('espresso_PRICING', PRICING_ASSETS_URL.'espresso_pricing_admin.js', array('jquery'), EVENT_ESPRESSO_VERSION, TRUE); |
|
354 | + wp_enqueue_script('espresso_PRICING'); |
|
355 | 355 | } |
356 | 356 | |
357 | 357 | |
@@ -359,7 +359,7 @@ discard block |
||
359 | 359 | |
360 | 360 | |
361 | 361 | public function load_scripts_styles_default() { |
362 | - wp_enqueue_script( 'espresso_ajax_table_sorting' ); |
|
362 | + wp_enqueue_script('espresso_ajax_table_sorting'); |
|
363 | 363 | } |
364 | 364 | |
365 | 365 | |
@@ -387,7 +387,7 @@ discard block |
||
387 | 387 | ) |
388 | 388 | ); |
389 | 389 | |
390 | - if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_default_prices', 'pricing_trash_price' ) ) { |
|
390 | + if (EE_Registry::instance()->CAP->current_user_can('ee_delete_default_prices', 'pricing_trash_price')) { |
|
391 | 391 | $this->_views['trashed'] = array( |
392 | 392 | 'slug' => 'trashed', |
393 | 393 | 'label' => __('Trash', 'event_espresso'), |
@@ -417,7 +417,7 @@ discard block |
||
417 | 417 | ) |
418 | 418 | ); |
419 | 419 | |
420 | - if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_default_price_types', 'pricing_trash_price_type' ) ) { |
|
420 | + if (EE_Registry::instance()->CAP->current_user_can('ee_delete_default_price_types', 'pricing_trash_price_type')) { |
|
421 | 421 | $this->_views['trashed'] = array( |
422 | 422 | 'slug' => 'trashed', |
423 | 423 | 'label' => __('Trash', 'event_espresso'), |
@@ -437,7 +437,7 @@ discard block |
||
437 | 437 | * @return void |
438 | 438 | */ |
439 | 439 | protected function _price_overview_list_table() { |
440 | - $this->_admin_page_title .= ' ' . $this->get_action_link_or_button( |
|
440 | + $this->_admin_page_title .= ' '.$this->get_action_link_or_button( |
|
441 | 441 | 'add_new_price', |
442 | 442 | 'add', |
443 | 443 | array(), |
@@ -461,18 +461,18 @@ discard block |
||
461 | 461 | * @param boolean $trashed whether the current view is of the trash can - eww yuck! |
462 | 462 | * @return mixed (int|array) int = count || array of price objects |
463 | 463 | */ |
464 | - public function get_prices_overview_data( $per_page = 10, $count = FALSE, $trashed = FALSE ) { |
|
464 | + public function get_prices_overview_data($per_page = 10, $count = FALSE, $trashed = FALSE) { |
|
465 | 465 | |
466 | - do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' ); |
|
466 | + do_action('AHEE_log', __FILE__, __FUNCTION__, ''); |
|
467 | 467 | // start with an empty array |
468 | 468 | $event_pricing = array(); |
469 | 469 | |
470 | - require_once( PRICING_ADMIN . 'Prices_List_Table.class.php' ); |
|
471 | - require_once(EE_MODELS . 'EEM_Price.model.php'); |
|
470 | + require_once(PRICING_ADMIN.'Prices_List_Table.class.php'); |
|
471 | + require_once(EE_MODELS.'EEM_Price.model.php'); |
|
472 | 472 | //$PRC = EEM_Price::instance(); |
473 | 473 | |
474 | 474 | $this->_req_data['orderby'] = empty($this->_req_data['orderby']) ? '' : $this->_req_data['orderby']; |
475 | - $order = ( isset( $this->_req_data['order'] ) && ! empty( $this->_req_data['order'] )) ? $this->_req_data['order'] : 'ASC'; |
|
475 | + $order = (isset($this->_req_data['order']) && ! empty($this->_req_data['order'])) ? $this->_req_data['order'] : 'ASC'; |
|
476 | 476 | |
477 | 477 | switch ($this->_req_data['orderby']) { |
478 | 478 | case 'name': |
@@ -485,27 +485,27 @@ discard block |
||
485 | 485 | $orderby = array('PRC_amount'=>$order); |
486 | 486 | break; |
487 | 487 | default: |
488 | - $orderby = array( 'PRC_order'=>$order, 'Price_Type.PRT_order'=>$order, 'PRC_ID'=>$order); |
|
488 | + $orderby = array('PRC_order'=>$order, 'Price_Type.PRT_order'=>$order, 'PRC_ID'=>$order); |
|
489 | 489 | } |
490 | 490 | |
491 | - $current_page = isset( $this->_req_data['paged'] ) && !empty( $this->_req_data['paged'] ) ? $this->_req_data['paged'] : 1; |
|
492 | - $per_page = isset( $this->_req_data['perpage'] ) && !empty( $this->_req_data['perpage'] ) ? $this->_req_data['perpage'] : $per_page; |
|
491 | + $current_page = isset($this->_req_data['paged']) && ! empty($this->_req_data['paged']) ? $this->_req_data['paged'] : 1; |
|
492 | + $per_page = isset($this->_req_data['perpage']) && ! empty($this->_req_data['perpage']) ? $this->_req_data['perpage'] : $per_page; |
|
493 | 493 | |
494 | 494 | $_where = array( |
495 | 495 | 'PRC_is_default' => 1, |
496 | 496 | 'PRC_deleted' => $trashed |
497 | 497 | ); |
498 | 498 | |
499 | - $offset = ($current_page-1)*$per_page; |
|
500 | - $limit = array( $offset, $per_page ); |
|
499 | + $offset = ($current_page - 1) * $per_page; |
|
500 | + $limit = array($offset, $per_page); |
|
501 | 501 | |
502 | - if ( isset( $this->_req_data['s'] ) ) { |
|
503 | - $sstr = '%' . $this->_req_data['s'] . '%'; |
|
502 | + if (isset($this->_req_data['s'])) { |
|
503 | + $sstr = '%'.$this->_req_data['s'].'%'; |
|
504 | 504 | $_where['OR'] = array( |
505 | - 'PRC_name' => array('LIKE',$sstr ), |
|
506 | - 'PRC_desc' => array('LIKE',$sstr ), |
|
507 | - 'PRC_amount' => array( 'LIKE',$sstr ), |
|
508 | - 'Price_Type.PRT_name' => array( 'LIKE', $sstr ) |
|
505 | + 'PRC_name' => array('LIKE', $sstr), |
|
506 | + 'PRC_desc' => array('LIKE', $sstr), |
|
507 | + 'PRC_amount' => array('LIKE', $sstr), |
|
508 | + 'Price_Type.PRT_name' => array('LIKE', $sstr) |
|
509 | 509 | ); |
510 | 510 | } |
511 | 511 | |
@@ -516,9 +516,9 @@ discard block |
||
516 | 516 | 'group_by'=>'PRC_ID' |
517 | 517 | ); |
518 | 518 | |
519 | - if($count){ |
|
520 | - return $trashed ? EEM_Price::instance()->count( array( $_where ) ) : EEM_Price::instance()->count_deleted_and_undeleted(array($_where)); |
|
521 | - }else{ |
|
519 | + if ($count) { |
|
520 | + return $trashed ? EEM_Price::instance()->count(array($_where)) : EEM_Price::instance()->count_deleted_and_undeleted(array($_where)); |
|
521 | + } else { |
|
522 | 522 | return EEM_Price::instance()->get_all_deleted_and_undeleted($query_params); |
523 | 523 | } |
524 | 524 | } |
@@ -534,49 +534,49 @@ discard block |
||
534 | 534 | * @return void |
535 | 535 | */ |
536 | 536 | protected function _edit_price_details() { |
537 | - do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' ); |
|
537 | + do_action('AHEE_log', __FILE__, __FUNCTION__, ''); |
|
538 | 538 | // grab price ID |
539 | - $PRC_ID = isset( $this->_req_data['id'] ) && ! empty( $this->_req_data['id'] ) ? absint( $this->_req_data['id'] ) : FALSE; |
|
539 | + $PRC_ID = isset($this->_req_data['id']) && ! empty($this->_req_data['id']) ? absint($this->_req_data['id']) : FALSE; |
|
540 | 540 | // change page title based on request action |
541 | - switch( $this->_req_action ) { |
|
541 | + switch ($this->_req_action) { |
|
542 | 542 | case 'add_new_price' : |
543 | - $this->_admin_page_title = esc_html__( 'Add New Price', 'event_espresso' ); |
|
543 | + $this->_admin_page_title = esc_html__('Add New Price', 'event_espresso'); |
|
544 | 544 | break; |
545 | 545 | case 'edit_price' : |
546 | - $this->_admin_page_title = esc_html__( 'Edit Price', 'event_espresso' ); |
|
546 | + $this->_admin_page_title = esc_html__('Edit Price', 'event_espresso'); |
|
547 | 547 | break; |
548 | 548 | default : |
549 | - $this->_admin_page_title = ucwords( str_replace( '_', ' ', $this->_req_action )); |
|
549 | + $this->_admin_page_title = ucwords(str_replace('_', ' ', $this->_req_action)); |
|
550 | 550 | } |
551 | 551 | // add PRC_ID to title if editing |
552 | - $this->_admin_page_title = $PRC_ID ? $this->_admin_page_title . ' # ' . $PRC_ID : $this->_admin_page_title; |
|
552 | + $this->_admin_page_title = $PRC_ID ? $this->_admin_page_title.' # '.$PRC_ID : $this->_admin_page_title; |
|
553 | 553 | |
554 | 554 | // get prices |
555 | - require_once(EE_MODELS . 'EEM_Price.model.php'); |
|
555 | + require_once(EE_MODELS.'EEM_Price.model.php'); |
|
556 | 556 | $PRC = EEM_Price::instance(); |
557 | 557 | |
558 | - if ( $PRC_ID ) { |
|
559 | - $price = $PRC->get_one_by_ID( $PRC_ID ); |
|
558 | + if ($PRC_ID) { |
|
559 | + $price = $PRC->get_one_by_ID($PRC_ID); |
|
560 | 560 | $additional_hidden_fields = array( |
561 | - 'PRC_ID' => array( 'type' => 'hidden', 'value' => $PRC_ID ) |
|
561 | + 'PRC_ID' => array('type' => 'hidden', 'value' => $PRC_ID) |
|
562 | 562 | ); |
563 | - $this->_set_add_edit_form_tags( 'update_price', $additional_hidden_fields ); |
|
563 | + $this->_set_add_edit_form_tags('update_price', $additional_hidden_fields); |
|
564 | 564 | } else { |
565 | 565 | $price = $PRC->get_new_price(); |
566 | - $this->_set_add_edit_form_tags( 'insert_price' ); |
|
566 | + $this->_set_add_edit_form_tags('insert_price'); |
|
567 | 567 | } |
568 | 568 | |
569 | 569 | $this->_template_args['PRC_ID'] = $PRC_ID; |
570 | 570 | $this->_template_args['price'] = $price; |
571 | 571 | |
572 | 572 | // get price types |
573 | - require_once(EE_MODELS . 'EEM_Price_Type.model.php'); |
|
573 | + require_once(EE_MODELS.'EEM_Price_Type.model.php'); |
|
574 | 574 | $PRT = EEM_Price_Type::instance(); |
575 | - $price_types = $PRT->get_all( array( array('PBT_ID' => array('!=', 1 ) ) ) ); |
|
575 | + $price_types = $PRT->get_all(array(array('PBT_ID' => array('!=', 1)))); |
|
576 | 576 | $price_type_names = array(); |
577 | 577 | if (empty($price_types)) { |
578 | - $msg = __( 'You have no price types defined. Please add a price type before adding a price.', 'event_espresso' ); |
|
579 | - EE_Error::add_error( $msg, __FILE__, __FUNCTION__, __LINE__ ); |
|
578 | + $msg = __('You have no price types defined. Please add a price type before adding a price.', 'event_espresso'); |
|
579 | + EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__); |
|
580 | 580 | exit(); |
581 | 581 | } else { |
582 | 582 | foreach ($price_types as $type) { |
@@ -589,7 +589,7 @@ discard block |
||
589 | 589 | $this->_template_args['price_types'] = $price_type_names; |
590 | 590 | $this->_template_args['learn_more_about_pricing_link'] = $this->_learn_more_about_pricing_link(); |
591 | 591 | |
592 | - $this->_set_publish_post_box_vars( 'id', $PRC_ID ); |
|
592 | + $this->_set_publish_post_box_vars('id', $PRC_ID); |
|
593 | 593 | // the details template wrapper |
594 | 594 | $this->display_admin_page_with_sidebar(); |
595 | 595 | } |
@@ -605,7 +605,7 @@ discard block |
||
605 | 605 | * @return void |
606 | 606 | */ |
607 | 607 | protected function _price_details_meta_boxes() { |
608 | - 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' ); |
|
608 | + 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'); |
|
609 | 609 | } |
610 | 610 | |
611 | 611 | |
@@ -619,7 +619,7 @@ discard block |
||
619 | 619 | * @return void |
620 | 620 | */ |
621 | 621 | public function _edit_price_details_meta_box() { |
622 | - echo EEH_Template::display_template( PRICING_TEMPLATE_PATH . 'pricing_details_main_meta_box.template.php', $this->_template_args, TRUE ); |
|
622 | + echo EEH_Template::display_template(PRICING_TEMPLATE_PATH.'pricing_details_main_meta_box.template.php', $this->_template_args, TRUE); |
|
623 | 623 | } |
624 | 624 | |
625 | 625 | |
@@ -633,7 +633,7 @@ discard block |
||
633 | 633 | */ |
634 | 634 | protected function set_price_column_values() { |
635 | 635 | |
636 | - do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' ); |
|
636 | + do_action('AHEE_log', __FILE__, __FUNCTION__, ''); |
|
637 | 637 | |
638 | 638 | $set_column_values = array( |
639 | 639 | 'PRT_ID' => absint($this->_req_data['PRT_ID']), |
@@ -661,12 +661,12 @@ discard block |
||
661 | 661 | * @access protected |
662 | 662 | * @return void |
663 | 663 | */ |
664 | - protected function _insert_or_update_price( $insert = FALSE ) { |
|
664 | + protected function _insert_or_update_price($insert = FALSE) { |
|
665 | 665 | |
666 | 666 | //echo '<h3>'. __CLASS__ . '->' . __FUNCTION__ . ' <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span></h3>'; |
667 | - do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' ); |
|
667 | + do_action('AHEE_log', __FILE__, __FUNCTION__, ''); |
|
668 | 668 | |
669 | - require_once(EE_MODELS . 'EEM_Price.model.php'); |
|
669 | + require_once(EE_MODELS.'EEM_Price.model.php'); |
|
670 | 670 | $PRC = EEM_Price::instance(); |
671 | 671 | |
672 | 672 | // why be so pessimistic ??? : ( |
@@ -674,14 +674,14 @@ discard block |
||
674 | 674 | |
675 | 675 | $set_column_values = $this->set_price_column_values(); |
676 | 676 | // is this a new Price ? |
677 | - if ( $insert ) { |
|
677 | + if ($insert) { |
|
678 | 678 | // run the insert |
679 | - if ( $PRC_ID = $PRC->insert( $set_column_values )) { |
|
679 | + if ($PRC_ID = $PRC->insert($set_column_values)) { |
|
680 | 680 | //make sure this new price modifier is attached to the ticket but ONLY if it is not a tax type |
681 | 681 | $PR = EEM_price::instance()->get_one_by_ID($PRC_ID); |
682 | - if ( $PR->type_obj()->base_type() !== EEM_Price_Type::base_type_tax ) { |
|
682 | + if ($PR->type_obj()->base_type() !== EEM_Price_Type::base_type_tax) { |
|
683 | 683 | $ticket = EEM_Ticket::instance()->get_one_by_ID(1); |
684 | - $ticket->_add_relation_to( $PR, 'Price' ); |
|
684 | + $ticket->_add_relation_to($PR, 'Price'); |
|
685 | 685 | $ticket->save(); |
686 | 686 | } |
687 | 687 | $success = 1; |
@@ -691,29 +691,29 @@ discard block |
||
691 | 691 | } |
692 | 692 | $action_desc = 'created'; |
693 | 693 | } else { |
694 | - $PRC_ID = absint( $this->_req_data['PRC_ID'] ); |
|
694 | + $PRC_ID = absint($this->_req_data['PRC_ID']); |
|
695 | 695 | // run the update |
696 | - $where_cols_n_values = array( 'PRC_ID' => $PRC_ID ); |
|
697 | - if ( $PRC->update( $set_column_values, array($where_cols_n_values))) { |
|
696 | + $where_cols_n_values = array('PRC_ID' => $PRC_ID); |
|
697 | + if ($PRC->update($set_column_values, array($where_cols_n_values))) { |
|
698 | 698 | $success = 1; |
699 | 699 | } |
700 | 700 | |
701 | 701 | $PR = EEM_Price::instance()->get_one_by_ID($PRC_ID); |
702 | - if ( $PR->type_obj()->base_type() !== EEM_Price_Type::base_type_tax ) { |
|
702 | + if ($PR->type_obj()->base_type() !== EEM_Price_Type::base_type_tax) { |
|
703 | 703 | |
704 | 704 | //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. |
705 | - if ( $PRC_ID === 1 ) { |
|
705 | + if ($PRC_ID === 1) { |
|
706 | 706 | $ticket = $PR->get_first_related('Ticket'); |
707 | - if ( $ticket ) { |
|
708 | - $ticket->set('TKT_price', $PR->get('PRC_amount') ); |
|
709 | - $ticket->set('TKT_name', $PR->get('PRC_name') ); |
|
707 | + if ($ticket) { |
|
708 | + $ticket->set('TKT_price', $PR->get('PRC_amount')); |
|
709 | + $ticket->set('TKT_name', $PR->get('PRC_name')); |
|
710 | 710 | $ticket->set('TKT_description', $PR->get('PRC_desc')); |
711 | 711 | $ticket->save(); |
712 | 712 | } |
713 | 713 | } else { |
714 | 714 | //we make sure this price is attached to base ticket. but ONLY if its not a tax ticket type. |
715 | 715 | $ticket = EEM_Ticket::instance()->get_one_by_ID(1); |
716 | - $ticket->_add_relation_to( $PRC_ID, 'Price' ); |
|
716 | + $ticket->_add_relation_to($PRC_ID, 'Price'); |
|
717 | 717 | $ticket->save(); |
718 | 718 | } |
719 | 719 | } |
@@ -721,9 +721,9 @@ discard block |
||
721 | 721 | $action_desc = 'updated'; |
722 | 722 | } |
723 | 723 | |
724 | - $query_args = array( 'action' => 'edit_price', 'id' => $PRC_ID ); |
|
724 | + $query_args = array('action' => 'edit_price', 'id' => $PRC_ID); |
|
725 | 725 | |
726 | - $this->_redirect_after_action( $success, 'Prices', $action_desc, $query_args ); |
|
726 | + $this->_redirect_after_action($success, 'Prices', $action_desc, $query_args); |
|
727 | 727 | |
728 | 728 | } |
729 | 729 | |
@@ -737,12 +737,12 @@ discard block |
||
737 | 737 | * @access protected |
738 | 738 | * @return void |
739 | 739 | */ |
740 | - protected function _trash_or_restore_price( $trash = TRUE ) { |
|
740 | + protected function _trash_or_restore_price($trash = TRUE) { |
|
741 | 741 | |
742 | 742 | //echo '<h3>'. __CLASS__ . '->' . __FUNCTION__ . ' <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span></h3>'; |
743 | - do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' ); |
|
743 | + do_action('AHEE_log', __FILE__, __FUNCTION__, ''); |
|
744 | 744 | |
745 | - require_once(EE_MODELS . 'EEM_Price.model.php'); |
|
745 | + require_once(EE_MODELS.'EEM_Price.model.php'); |
|
746 | 746 | $PRC = EEM_Price::instance(); |
747 | 747 | |
748 | 748 | $success = 1; |
@@ -751,18 +751,18 @@ discard block |
||
751 | 751 | //get base ticket for updating |
752 | 752 | $ticket = EEM_Ticket::instance()->get_one_by_ID(1); |
753 | 753 | //Checkboxes |
754 | - if (!empty($this->_req_data['checkbox']) && is_array($this->_req_data['checkbox'])) { |
|
754 | + if ( ! empty($this->_req_data['checkbox']) && is_array($this->_req_data['checkbox'])) { |
|
755 | 755 | // if array has more than one element than success message should be plural |
756 | - $success = count( $this->_req_data['checkbox'] ) > 1 ? 2 : 1; |
|
756 | + $success = count($this->_req_data['checkbox']) > 1 ? 2 : 1; |
|
757 | 757 | // cycle thru checkboxes |
758 | - while (list( $PRC_ID, $value ) = each($this->_req_data['checkbox'])) { |
|
759 | - if ( ! $PRC->update_by_ID(array('PRC_deleted' => $PRC_deleted), absint($PRC_ID) ) ) { |
|
758 | + while (list($PRC_ID, $value) = each($this->_req_data['checkbox'])) { |
|
759 | + if ( ! $PRC->update_by_ID(array('PRC_deleted' => $PRC_deleted), absint($PRC_ID))) { |
|
760 | 760 | $success = 0; |
761 | 761 | } else { |
762 | 762 | $PR = EEM_Price::instance()->get_one_by_ID($PRC_ID); |
763 | - if ( $PR->type_obj()->base_type() !== EEM_Price_Type::base_type_tax ) { |
|
763 | + if ($PR->type_obj()->base_type() !== EEM_Price_Type::base_type_tax) { |
|
764 | 764 | //if trashing then remove relations to base default ticket. If restoring then add back to base default ticket |
765 | - if ( $PRC_deleted ) { |
|
765 | + if ($PRC_deleted) { |
|
766 | 766 | $ticket->_remove_relation_to($PRC_ID, 'Price'); |
767 | 767 | } else { |
768 | 768 | $ticket->_add_relation_to($PRC_ID, 'Price'); |
@@ -774,14 +774,14 @@ discard block |
||
774 | 774 | |
775 | 775 | } else { |
776 | 776 | // grab single id and delete |
777 | - $PRC_ID = isset( $this->_req_data['id'] ) ? absint($this->_req_data['id']) : 0; |
|
778 | - if ( empty( $PRC_ID ) || ! $PRC->update_by_ID(array('PRC_deleted' => $PRC_deleted), $PRC_ID) ) { |
|
777 | + $PRC_ID = isset($this->_req_data['id']) ? absint($this->_req_data['id']) : 0; |
|
778 | + if (empty($PRC_ID) || ! $PRC->update_by_ID(array('PRC_deleted' => $PRC_deleted), $PRC_ID)) { |
|
779 | 779 | $success = 0; |
780 | 780 | } else { |
781 | 781 | $PR = EEM_Price::instance()->get_one_by_ID($PRC_ID); |
782 | - if ( $PR->type_obj()->base_type() !== EEM_Price_Type::base_type_tax ) { |
|
782 | + if ($PR->type_obj()->base_type() !== EEM_Price_Type::base_type_tax) { |
|
783 | 783 | //if trashing then remove relations to base default ticket. If restoring then add back to base default ticket |
784 | - if ( $PRC_deleted ) { |
|
784 | + if ($PRC_deleted) { |
|
785 | 785 | $ticket->_remove_relation_to($PRC_ID, 'Price'); |
786 | 786 | } else { |
787 | 787 | $ticket->_add_relation_to($PRC_ID, 'Price'); |
@@ -795,17 +795,17 @@ discard block |
||
795 | 795 | 'action' => 'default' |
796 | 796 | ); |
797 | 797 | |
798 | - if ( $success ) { |
|
799 | - if ( $trash ) { |
|
798 | + if ($success) { |
|
799 | + if ($trash) { |
|
800 | 800 | $msg = $success == 2 ? __('The Prices have been trashed.', 'event_espresso') : __('The Price has been trashed.', 'event_espresso'); |
801 | 801 | } else { |
802 | 802 | $msg = $success == 2 ? __('The Prices have been restored.', 'event_espresso') : __('The Price has been restored.', 'event_espresso'); |
803 | 803 | } |
804 | 804 | |
805 | - EE_Error::add_success( $msg ); |
|
805 | + EE_Error::add_success($msg); |
|
806 | 806 | } |
807 | 807 | |
808 | - $this->_redirect_after_action( FALSE, '', '', $query_args, TRUE ); |
|
808 | + $this->_redirect_after_action(FALSE, '', '', $query_args, TRUE); |
|
809 | 809 | |
810 | 810 | } |
811 | 811 | |
@@ -822,19 +822,19 @@ discard block |
||
822 | 822 | protected function _delete_price() { |
823 | 823 | |
824 | 824 | //echo '<h3>'. __CLASS__ . '->' . __FUNCTION__ . ' <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span></h3>'; |
825 | - do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' ); |
|
825 | + do_action('AHEE_log', __FILE__, __FUNCTION__, ''); |
|
826 | 826 | |
827 | - require_once(EE_MODELS . 'EEM_Price.model.php'); |
|
827 | + require_once(EE_MODELS.'EEM_Price.model.php'); |
|
828 | 828 | $PRC = EEM_Price::instance(); |
829 | 829 | |
830 | 830 | $success = 1; |
831 | 831 | //Checkboxes |
832 | - if (!empty($this->_req_data['checkbox']) && is_array($this->_req_data['checkbox'])) { |
|
832 | + if ( ! empty($this->_req_data['checkbox']) && is_array($this->_req_data['checkbox'])) { |
|
833 | 833 | // if array has more than one element than success message should be plural |
834 | - $success = count( $this->_req_data['checkbox'] ) > 1 ? 2 : 1; |
|
834 | + $success = count($this->_req_data['checkbox']) > 1 ? 2 : 1; |
|
835 | 835 | // cycle thru bulk action checkboxes |
836 | - while (list( $PRC_ID, $value ) = each($this->_req_data['checkbox'])) { |
|
837 | - if (!$PRC->delete_permanently_by_ID(absint($PRC_ID))) { |
|
836 | + while (list($PRC_ID, $value) = each($this->_req_data['checkbox'])) { |
|
837 | + if ( ! $PRC->delete_permanently_by_ID(absint($PRC_ID))) { |
|
838 | 838 | $success = 0; |
839 | 839 | } |
840 | 840 | } |
@@ -848,7 +848,7 @@ discard block |
||
848 | 848 | |
849 | 849 | } |
850 | 850 | |
851 | - $this->_redirect_after_action( $success, 'Prices', 'deleted', array() ); |
|
851 | + $this->_redirect_after_action($success, 'Prices', 'deleted', array()); |
|
852 | 852 | |
853 | 853 | } |
854 | 854 | |
@@ -856,16 +856,16 @@ discard block |
||
856 | 856 | |
857 | 857 | |
858 | 858 | public function update_price_order() { |
859 | - $success = __( 'Price order was updated successfully.', 'event_espresso' ); |
|
859 | + $success = __('Price order was updated successfully.', 'event_espresso'); |
|
860 | 860 | |
861 | 861 | // grab our row IDs |
862 | - $row_ids = isset( $this->_req_data['row_ids'] ) && ! empty( $this->_req_data['row_ids'] ) ? explode( ',', rtrim( $this->_req_data['row_ids'], ',' )) : FALSE; |
|
862 | + $row_ids = isset($this->_req_data['row_ids']) && ! empty($this->_req_data['row_ids']) ? explode(',', rtrim($this->_req_data['row_ids'], ',')) : FALSE; |
|
863 | 863 | |
864 | - if ( is_array( $row_ids )) { |
|
865 | - for ( $i = 0; $i < count( $row_ids ); $i++ ) { |
|
864 | + if (is_array($row_ids)) { |
|
865 | + for ($i = 0; $i < count($row_ids); $i++) { |
|
866 | 866 | //Update the prices when re-ordering |
867 | 867 | $id = absint($row_ids[$i]); |
868 | - if ( EEM_Price::instance()->update ( array( 'PRC_order' => $i+1 ), array(array( 'PRC_ID' => $id ) )) === FALSE ) { |
|
868 | + if (EEM_Price::instance()->update(array('PRC_order' => $i + 1), array(array('PRC_ID' => $id))) === FALSE) { |
|
869 | 869 | $success = FALSE; |
870 | 870 | } |
871 | 871 | } |
@@ -873,9 +873,9 @@ discard block |
||
873 | 873 | $success = FALSE; |
874 | 874 | } |
875 | 875 | |
876 | - $errors = ! $success ? __( 'An error occurred. The price order was not updated.', 'event_espresso' ) : FALSE; |
|
876 | + $errors = ! $success ? __('An error occurred. The price order was not updated.', 'event_espresso') : FALSE; |
|
877 | 877 | |
878 | - echo json_encode( array( 'return_data' => FALSE, 'success' => $success, 'errors' => $errors )); |
|
878 | + echo json_encode(array('return_data' => FALSE, 'success' => $success, 'errors' => $errors)); |
|
879 | 879 | die(); |
880 | 880 | } |
881 | 881 | |
@@ -899,7 +899,7 @@ discard block |
||
899 | 899 | * @return void |
900 | 900 | */ |
901 | 901 | protected function _price_types_overview_list_table() { |
902 | - $this->_admin_page_title .= ' ' . $this->get_action_link_or_button( |
|
902 | + $this->_admin_page_title .= ' '.$this->get_action_link_or_button( |
|
903 | 903 | 'add_new_price_type', |
904 | 904 | 'add_type', |
905 | 905 | array(), |
@@ -923,46 +923,46 @@ discard block |
||
923 | 923 | * @param boolean $trashed whether the current view is of the trash can - eww yuck! |
924 | 924 | * @return mixed (int|array) int = count || array of price objects |
925 | 925 | */ |
926 | - public function get_price_types_overview_data( $per_page = 10, $count = FALSE, $trashed = FALSE ) { |
|
926 | + public function get_price_types_overview_data($per_page = 10, $count = FALSE, $trashed = FALSE) { |
|
927 | 927 | |
928 | - do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' ); |
|
928 | + do_action('AHEE_log', __FILE__, __FUNCTION__, ''); |
|
929 | 929 | // start with an empty array |
930 | 930 | |
931 | - require_once( PRICING_ADMIN . 'Price_Types_List_Table.class.php' ); |
|
932 | - require_once( EE_MODELS . 'EEM_Price_Type.model.php' ); |
|
931 | + require_once(PRICING_ADMIN.'Price_Types_List_Table.class.php'); |
|
932 | + require_once(EE_MODELS.'EEM_Price_Type.model.php'); |
|
933 | 933 | |
934 | 934 | $this->_req_data['orderby'] = empty($this->_req_data['orderby']) ? '' : $this->_req_data['orderby']; |
935 | - $order = ( isset( $this->_req_data['order'] ) && ! empty( $this->_req_data['order'] )) ? $this->_req_data['order'] : 'ASC'; |
|
935 | + $order = (isset($this->_req_data['order']) && ! empty($this->_req_data['order'])) ? $this->_req_data['order'] : 'ASC'; |
|
936 | 936 | switch ($this->_req_data['orderby']) { |
937 | 937 | case 'name': |
938 | - $orderby = array( 'PRT_name' => $order); |
|
938 | + $orderby = array('PRT_name' => $order); |
|
939 | 939 | break; |
940 | 940 | default: |
941 | - $orderby = array( 'PRT_order' => $order); |
|
941 | + $orderby = array('PRT_order' => $order); |
|
942 | 942 | } |
943 | 943 | |
944 | 944 | |
945 | - $current_page = isset( $this->_req_data['paged'] ) && !empty( $this->_req_data['paged'] ) ? $this->_req_data['paged'] : 1; |
|
946 | - $per_page = isset( $this->_req_data['perpage'] ) && !empty( $this->_req_data['perpage'] ) ? $this->_req_data['perpage'] : $per_page; |
|
945 | + $current_page = isset($this->_req_data['paged']) && ! empty($this->_req_data['paged']) ? $this->_req_data['paged'] : 1; |
|
946 | + $per_page = isset($this->_req_data['perpage']) && ! empty($this->_req_data['perpage']) ? $this->_req_data['perpage'] : $per_page; |
|
947 | 947 | |
948 | - $offset = ($current_page-1)*$per_page; |
|
949 | - $limit = array( $offset, $per_page ); |
|
948 | + $offset = ($current_page - 1) * $per_page; |
|
949 | + $limit = array($offset, $per_page); |
|
950 | 950 | |
951 | - $_where = array('PRT_deleted'=>$trashed, 'PBT_ID' => array('!=', 1 ) ); |
|
951 | + $_where = array('PRT_deleted'=>$trashed, 'PBT_ID' => array('!=', 1)); |
|
952 | 952 | |
953 | - if ( isset( $this->_req_data['s'] ) ) { |
|
954 | - $sstr = '%' . $this->_req_data['s'] . '%'; |
|
953 | + if (isset($this->_req_data['s'])) { |
|
954 | + $sstr = '%'.$this->_req_data['s'].'%'; |
|
955 | 955 | $_where['OR'] = array( |
956 | - 'PRT_name' => array( 'LIKE', $sstr ) |
|
956 | + 'PRT_name' => array('LIKE', $sstr) |
|
957 | 957 | ); |
958 | 958 | } |
959 | 959 | $query_params = array( |
960 | 960 | $_where, |
961 | 961 | 'order_by'=>$orderby, |
962 | 962 | 'limit'=>$limit); |
963 | - if($count){ |
|
963 | + if ($count) { |
|
964 | 964 | return EEM_Price_Type::instance()->count_deleted_and_undeleted($query_params); |
965 | - }else{ |
|
965 | + } else { |
|
966 | 966 | return EEM_Price_Type::instance()->get_all_deleted_and_undeleted($query_params); |
967 | 967 | } |
968 | 968 | |
@@ -982,34 +982,34 @@ discard block |
||
982 | 982 | */ |
983 | 983 | protected function _edit_price_type_details() { |
984 | 984 | |
985 | - do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' ); |
|
985 | + do_action('AHEE_log', __FILE__, __FUNCTION__, ''); |
|
986 | 986 | |
987 | 987 | |
988 | 988 | // grab price type ID |
989 | - $PRT_ID = isset( $this->_req_data['id'] ) && ! empty( $this->_req_data['id'] ) ? absint( $this->_req_data['id'] ) : FALSE; |
|
989 | + $PRT_ID = isset($this->_req_data['id']) && ! empty($this->_req_data['id']) ? absint($this->_req_data['id']) : FALSE; |
|
990 | 990 | // change page title based on request action |
991 | - switch( $this->_req_action ) { |
|
991 | + switch ($this->_req_action) { |
|
992 | 992 | case 'add_new_price_type' : |
993 | - $this->_admin_page_title = esc_html__( 'Add New Price Type', 'event_espresso' ); |
|
993 | + $this->_admin_page_title = esc_html__('Add New Price Type', 'event_espresso'); |
|
994 | 994 | break; |
995 | 995 | case 'edit_price_type' : |
996 | - $this->_admin_page_title = esc_html__( 'Edit Price Type', 'event_espresso' ); |
|
996 | + $this->_admin_page_title = esc_html__('Edit Price Type', 'event_espresso'); |
|
997 | 997 | break; |
998 | 998 | default : |
999 | - $this->_admin_page_title = ucwords( str_replace( '_', ' ', $this->_req_action )); |
|
999 | + $this->_admin_page_title = ucwords(str_replace('_', ' ', $this->_req_action)); |
|
1000 | 1000 | } |
1001 | 1001 | // add PRT_ID to title if editing |
1002 | - $this->_admin_page_title = $PRT_ID ? $this->_admin_page_title . ' # ' . $PRT_ID : $this->_admin_page_title; |
|
1002 | + $this->_admin_page_title = $PRT_ID ? $this->_admin_page_title.' # '.$PRT_ID : $this->_admin_page_title; |
|
1003 | 1003 | |
1004 | 1004 | // require_once(EE_MODELS . 'EEM_Price_Type.model.php'); |
1005 | 1005 | |
1006 | - if ( $PRT_ID ) { |
|
1007 | - $price_type = EEM_Price_Type::instance()->get_one_by_ID( $PRT_ID ); |
|
1008 | - $additional_hidden_fields = array( 'PRT_ID' => array( 'type' => 'hidden', 'value' => $PRT_ID )); |
|
1009 | - $this->_set_add_edit_form_tags( 'update_price_type', $additional_hidden_fields ); |
|
1006 | + if ($PRT_ID) { |
|
1007 | + $price_type = EEM_Price_Type::instance()->get_one_by_ID($PRT_ID); |
|
1008 | + $additional_hidden_fields = array('PRT_ID' => array('type' => 'hidden', 'value' => $PRT_ID)); |
|
1009 | + $this->_set_add_edit_form_tags('update_price_type', $additional_hidden_fields); |
|
1010 | 1010 | } else { |
1011 | 1011 | $price_type = EEM_Price_Type::instance()->get_new_price_type(); |
1012 | - $this->_set_add_edit_form_tags( 'insert_price_type' ); |
|
1012 | + $this->_set_add_edit_form_tags('insert_price_type'); |
|
1013 | 1013 | } |
1014 | 1014 | |
1015 | 1015 | $this->_template_args['PRT_ID'] = $PRT_ID; |
@@ -1018,19 +1018,19 @@ discard block |
||
1018 | 1018 | |
1019 | 1019 | $base_types = EEM_Price_Type::instance()->get_base_types(); |
1020 | 1020 | $select_values = array(); |
1021 | - foreach ( $base_types as $ref => $text ) { |
|
1022 | - if ( $ref == EEM_Price_Type::base_type_base_price ) { |
|
1021 | + foreach ($base_types as $ref => $text) { |
|
1022 | + if ($ref == EEM_Price_Type::base_type_base_price) { |
|
1023 | 1023 | //do not allow creation of base_type_base_prices because that's a system only base type. |
1024 | 1024 | continue; |
1025 | 1025 | } |
1026 | - $values[] = array( 'id' => $ref, 'text' => $text ); |
|
1026 | + $values[] = array('id' => $ref, 'text' => $text); |
|
1027 | 1027 | } |
1028 | 1028 | |
1029 | 1029 | |
1030 | 1030 | $this->_template_args['base_type_select'] = EEH_Form_Fields::select_input('base_type', $values, $price_type->base_type(), 'id="price-type-base-type-slct"'); |
1031 | 1031 | $this->_template_args['learn_more_about_pricing_link'] = $this->_learn_more_about_pricing_link(); |
1032 | - $redirect_URL = add_query_arg( array( 'action' => 'price_types'), $this->_admin_base_url ); |
|
1033 | - $this->_set_publish_post_box_vars( 'id', $PRT_ID, FALSE, $redirect_URL ); |
|
1032 | + $redirect_URL = add_query_arg(array('action' => 'price_types'), $this->_admin_base_url); |
|
1033 | + $this->_set_publish_post_box_vars('id', $PRT_ID, FALSE, $redirect_URL); |
|
1034 | 1034 | // the details template wrapper |
1035 | 1035 | $this->display_admin_page_with_sidebar(); |
1036 | 1036 | |
@@ -1047,7 +1047,7 @@ discard block |
||
1047 | 1047 | * @return void |
1048 | 1048 | */ |
1049 | 1049 | protected function _price_type_details_meta_boxes() { |
1050 | - 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' ); |
|
1050 | + 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'); |
|
1051 | 1051 | } |
1052 | 1052 | |
1053 | 1053 | |
@@ -1060,7 +1060,7 @@ discard block |
||
1060 | 1060 | * @return void |
1061 | 1061 | */ |
1062 | 1062 | public function _edit_price_type_details_meta_box() { |
1063 | - echo EEH_Template::display_template( PRICING_TEMPLATE_PATH . 'pricing_type_details_main_meta_box.template.php', $this->_template_args, TRUE ); |
|
1063 | + echo EEH_Template::display_template(PRICING_TEMPLATE_PATH.'pricing_type_details_main_meta_box.template.php', $this->_template_args, TRUE); |
|
1064 | 1064 | } |
1065 | 1065 | |
1066 | 1066 | |
@@ -1073,9 +1073,9 @@ discard block |
||
1073 | 1073 | */ |
1074 | 1074 | protected function set_price_type_column_values() { |
1075 | 1075 | |
1076 | - do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' ); |
|
1076 | + do_action('AHEE_log', __FILE__, __FUNCTION__, ''); |
|
1077 | 1077 | |
1078 | - $base_type = !empty( $this->_req_data['base_type'] ) ? $this->_req_data['base_type'] : EEM_Price_Type::base_type_base_price; |
|
1078 | + $base_type = ! empty($this->_req_data['base_type']) ? $this->_req_data['base_type'] : EEM_Price_Type::base_type_base_price; |
|
1079 | 1079 | |
1080 | 1080 | switch ($base_type) { |
1081 | 1081 | |
@@ -1122,12 +1122,12 @@ discard block |
||
1122 | 1122 | * @access protected |
1123 | 1123 | * @return void |
1124 | 1124 | */ |
1125 | - protected function _insert_or_update_price_type( $new_price_type = FALSE ) { |
|
1125 | + protected function _insert_or_update_price_type($new_price_type = FALSE) { |
|
1126 | 1126 | |
1127 | 1127 | // echo '<h3>'. __CLASS__ . '->' . __FUNCTION__ . ' <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span></h3>'; |
1128 | - do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' ); |
|
1128 | + do_action('AHEE_log', __FILE__, __FUNCTION__, ''); |
|
1129 | 1129 | |
1130 | - require_once(EE_MODELS . 'EEM_Price_Type.model.php'); |
|
1130 | + require_once(EE_MODELS.'EEM_Price_Type.model.php'); |
|
1131 | 1131 | $PRT = EEM_Price_Type::instance(); |
1132 | 1132 | |
1133 | 1133 | // why be so pessimistic ??? : ( |
@@ -1135,24 +1135,24 @@ discard block |
||
1135 | 1135 | |
1136 | 1136 | $set_column_values = $this->set_price_type_column_values(); |
1137 | 1137 | // is this a new Price ? |
1138 | - if ( $new_price_type ) { |
|
1138 | + if ($new_price_type) { |
|
1139 | 1139 | // run the insert |
1140 | - if ( $PRT_ID = $PRT->insert( $set_column_values )) { |
|
1140 | + if ($PRT_ID = $PRT->insert($set_column_values)) { |
|
1141 | 1141 | $success = 1; |
1142 | 1142 | } |
1143 | 1143 | $action_desc = 'created'; |
1144 | 1144 | } else { |
1145 | 1145 | $PRT_ID = absint($this->_req_data['PRT_ID']); |
1146 | 1146 | // run the update |
1147 | - $where_cols_n_values = array('PRT_ID' => $PRT_ID ); |
|
1148 | - if ( $PRT->update( $set_column_values, array( $where_cols_n_values ))) { |
|
1147 | + $where_cols_n_values = array('PRT_ID' => $PRT_ID); |
|
1148 | + if ($PRT->update($set_column_values, array($where_cols_n_values))) { |
|
1149 | 1149 | $success = 1; |
1150 | 1150 | } |
1151 | 1151 | $action_desc = 'updated'; |
1152 | 1152 | } |
1153 | 1153 | |
1154 | - $query_args = array( 'action'=> 'edit_price_type', 'id' => $PRT_ID ); |
|
1155 | - $this->_redirect_after_action( $success, 'Price Type', $action_desc, $query_args ); |
|
1154 | + $query_args = array('action'=> 'edit_price_type', 'id' => $PRT_ID); |
|
1155 | + $this->_redirect_after_action($success, 'Price Type', $action_desc, $query_args); |
|
1156 | 1156 | |
1157 | 1157 | } |
1158 | 1158 | |
@@ -1166,49 +1166,49 @@ discard block |
||
1166 | 1166 | * @access protected |
1167 | 1167 | * @return void |
1168 | 1168 | */ |
1169 | - protected function _trash_or_restore_price_type( $trash = TRUE ) { |
|
1169 | + protected function _trash_or_restore_price_type($trash = TRUE) { |
|
1170 | 1170 | |
1171 | 1171 | //echo '<h3>'. __CLASS__ . '->' . __FUNCTION__ . ' <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span></h3>'; |
1172 | - do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' ); |
|
1172 | + do_action('AHEE_log', __FILE__, __FUNCTION__, ''); |
|
1173 | 1173 | |
1174 | - require_once(EE_MODELS . 'EEM_Price_Type.model.php'); |
|
1174 | + require_once(EE_MODELS.'EEM_Price_Type.model.php'); |
|
1175 | 1175 | $PRT = EEM_Price_Type::instance(); |
1176 | 1176 | |
1177 | 1177 | $success = 1; |
1178 | 1178 | $PRT_deleted = $trash ? TRUE : FALSE; |
1179 | 1179 | //Checkboxes |
1180 | - if (!empty($this->_req_data['checkbox']) && is_array($this->_req_data['checkbox'])) { |
|
1180 | + if ( ! empty($this->_req_data['checkbox']) && is_array($this->_req_data['checkbox'])) { |
|
1181 | 1181 | // if array has more than one element than success message should be plural |
1182 | - $success = count( $this->_req_data['checkbox'] ) > 1 ? 2 : 1; |
|
1183 | - $what = count( $this->_req_data['checkbox'] ) > 1 ? 'Price Types' : 'Price Type'; |
|
1182 | + $success = count($this->_req_data['checkbox']) > 1 ? 2 : 1; |
|
1183 | + $what = count($this->_req_data['checkbox']) > 1 ? 'Price Types' : 'Price Type'; |
|
1184 | 1184 | // cycle thru checkboxes |
1185 | - while (list( $PRT_ID, $value ) = each($this->_req_data['checkbox'])) { |
|
1186 | - if ( ! $PRT->update_by_ID(array('PRT_deleted' => $PRT_deleted), $PRT_ID ) ) { |
|
1185 | + while (list($PRT_ID, $value) = each($this->_req_data['checkbox'])) { |
|
1186 | + if ( ! $PRT->update_by_ID(array('PRT_deleted' => $PRT_deleted), $PRT_ID)) { |
|
1187 | 1187 | $success = 0; |
1188 | 1188 | } |
1189 | 1189 | } |
1190 | 1190 | |
1191 | 1191 | } else { |
1192 | 1192 | // grab single id and delete |
1193 | - $PRT_ID = isset( $this->_req_data['id'] ) ? absint($this->_req_data['id']) : 0; |
|
1194 | - if ( empty( $PRT_ID ) || ! $PRT->update_by_ID(array('PRT_deleted' => $PRT_deleted), $PRT_ID )) { |
|
1193 | + $PRT_ID = isset($this->_req_data['id']) ? absint($this->_req_data['id']) : 0; |
|
1194 | + if (empty($PRT_ID) || ! $PRT->update_by_ID(array('PRT_deleted' => $PRT_deleted), $PRT_ID)) { |
|
1195 | 1195 | $success = 0; |
1196 | 1196 | } |
1197 | 1197 | $what = 'Price Type'; |
1198 | 1198 | |
1199 | 1199 | } |
1200 | 1200 | |
1201 | - $query_args = array( 'action' => 'price_types' ); |
|
1202 | - if ( $success ) { |
|
1203 | - if ( $trash ) { |
|
1201 | + $query_args = array('action' => 'price_types'); |
|
1202 | + if ($success) { |
|
1203 | + if ($trash) { |
|
1204 | 1204 | $msg = $success > 1 ? __('The Price Types have been trashed.', 'event_espresso') : __('The Price Type has been trashed.', 'event_espresso'); |
1205 | 1205 | } else { |
1206 | 1206 | $msg = $success > 1 ? __('The Price Types have been restored.', 'event_espresso') : __('The Price Type has been restored.', 'event_espresso'); |
1207 | 1207 | } |
1208 | - EE_Error::add_success( $msg ); |
|
1208 | + EE_Error::add_success($msg); |
|
1209 | 1209 | } |
1210 | 1210 | |
1211 | - $this->_redirect_after_action( FALSE, '', '', $query_args, TRUE ); |
|
1211 | + $this->_redirect_after_action(FALSE, '', '', $query_args, TRUE); |
|
1212 | 1212 | |
1213 | 1213 | } |
1214 | 1214 | |
@@ -1225,19 +1225,19 @@ discard block |
||
1225 | 1225 | protected function _delete_price_type() { |
1226 | 1226 | |
1227 | 1227 | //echo '<h3>'. __CLASS__ . '->' . __FUNCTION__ . ' <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span></h3>'; |
1228 | - do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' ); |
|
1228 | + do_action('AHEE_log', __FILE__, __FUNCTION__, ''); |
|
1229 | 1229 | |
1230 | 1230 | $PRT = EEM_Price_Type::instance(); |
1231 | 1231 | |
1232 | 1232 | $success = 1; |
1233 | 1233 | //Checkboxes |
1234 | - if (!empty($this->_req_data['checkbox'])) { |
|
1234 | + if ( ! empty($this->_req_data['checkbox'])) { |
|
1235 | 1235 | // if array has more than one element than success message should be plural |
1236 | - $success = count( $this->_req_data['checkbox'] ) > 1 ? 2 : 1; |
|
1236 | + $success = count($this->_req_data['checkbox']) > 1 ? 2 : 1; |
|
1237 | 1237 | $what = $PRT->item_name($success); |
1238 | 1238 | // cycle thru bulk action checkboxes |
1239 | - while (list( $PRT_ID, $value ) = each($this->_req_data['checkbox'])) { |
|
1240 | - if (!$PRT->delete_permanently_by_ID($PRT_ID) ) { |
|
1239 | + while (list($PRT_ID, $value) = each($this->_req_data['checkbox'])) { |
|
1240 | + if ( ! $PRT->delete_permanently_by_ID($PRT_ID)) { |
|
1241 | 1241 | $success = 0; |
1242 | 1242 | } |
1243 | 1243 | } |
@@ -1245,8 +1245,8 @@ discard block |
||
1245 | 1245 | } |
1246 | 1246 | |
1247 | 1247 | |
1248 | - $query_args = array( 'action'=> 'price_types' ); |
|
1249 | - $this->_redirect_after_action( $success, $what, 'deleted', $query_args ); |
|
1248 | + $query_args = array('action'=> 'price_types'); |
|
1249 | + $this->_redirect_after_action($success, $what, 'deleted', $query_args); |
|
1250 | 1250 | |
1251 | 1251 | } |
1252 | 1252 | |
@@ -1262,7 +1262,7 @@ discard block |
||
1262 | 1262 | * @return string |
1263 | 1263 | */ |
1264 | 1264 | protected function _learn_more_about_pricing_link() { |
1265 | - return '<a class="hidden" style="margin:0 20px; cursor:pointer; font-size:12px;" >' . __('learn more about how pricing works', 'event_espresso') . '</a>'; |
|
1265 | + return '<a class="hidden" style="margin:0 20px; cursor:pointer; font-size:12px;" >'.__('learn more about how pricing works', 'event_espresso').'</a>'; |
|
1266 | 1266 | } |
1267 | 1267 | |
1268 | 1268 |
@@ -23,7 +23,7 @@ discard block |
||
23 | 23 | * |
24 | 24 | * ------------------------------------------------------------------------ |
25 | 25 | */ |
26 | -class Pricing_Admin_Page_Init extends EE_Admin_Page_Init { |
|
26 | +class Pricing_Admin_Page_Init extends EE_Admin_Page_Init { |
|
27 | 27 | |
28 | 28 | |
29 | 29 | |
@@ -36,20 +36,20 @@ discard block |
||
36 | 36 | */ |
37 | 37 | public function __construct() { |
38 | 38 | |
39 | - do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' ); |
|
39 | + do_action('AHEE_log', __FILE__, __FUNCTION__, ''); |
|
40 | 40 | |
41 | - define( 'PRICING_PG_SLUG', 'pricing' ); |
|
42 | - define( 'PRICING_LABEL', __('Pricing', 'event_espresso')); |
|
43 | - define( 'PRICING_PG_NAME', ucwords( str_replace( '_', '', PRICING_PG_SLUG ))); |
|
44 | - define( 'PRICING_ADMIN', EE_CORE_CAF_ADMIN . 'new' . DS . PRICING_PG_SLUG . DS ); |
|
45 | - define( 'PRICING_ADMIN_URL', admin_url( 'admin.php?page=' . PRICING_PG_SLUG )); |
|
46 | - define( 'PRICING_ASSETS_PATH', PRICING_ADMIN . 'assets' . DS ); |
|
47 | - define( 'PRICING_ASSETS_URL', EE_CORE_CAF_ADMIN_URL . 'new' . DS . PRICING_PG_SLUG .'/assets/' ); |
|
48 | - define( 'PRICING_TEMPLATE_PATH', PRICING_ADMIN . 'templates' . DS ); |
|
49 | - define( 'PRICING_TEMPLATE_URL', EE_CORE_CAF_ADMIN_URL . 'new' . DS . PRICING_PG_SLUG . DS . 'templates/' ); |
|
41 | + define('PRICING_PG_SLUG', 'pricing'); |
|
42 | + define('PRICING_LABEL', __('Pricing', 'event_espresso')); |
|
43 | + define('PRICING_PG_NAME', ucwords(str_replace('_', '', PRICING_PG_SLUG))); |
|
44 | + define('PRICING_ADMIN', EE_CORE_CAF_ADMIN.'new'.DS.PRICING_PG_SLUG.DS); |
|
45 | + define('PRICING_ADMIN_URL', admin_url('admin.php?page='.PRICING_PG_SLUG)); |
|
46 | + define('PRICING_ASSETS_PATH', PRICING_ADMIN.'assets'.DS); |
|
47 | + define('PRICING_ASSETS_URL', EE_CORE_CAF_ADMIN_URL.'new'.DS.PRICING_PG_SLUG.'/assets/'); |
|
48 | + define('PRICING_TEMPLATE_PATH', PRICING_ADMIN.'templates'.DS); |
|
49 | + define('PRICING_TEMPLATE_URL', EE_CORE_CAF_ADMIN_URL.'new'.DS.PRICING_PG_SLUG.DS.'templates/'); |
|
50 | 50 | |
51 | 51 | parent::__construct(); |
52 | - $this->_folder_path = EE_CORE_CAF_ADMIN . 'new' . DS . $this->_folder_name . DS; |
|
52 | + $this->_folder_path = EE_CORE_CAF_ADMIN.'new'.DS.$this->_folder_name.DS; |
|
53 | 53 | |
54 | 54 | } |
55 | 55 | |
@@ -64,7 +64,7 @@ discard block |
||
64 | 64 | |
65 | 65 | |
66 | 66 | protected function _set_menu_map() { |
67 | - $this->_menu_map = new EE_Admin_Page_Sub_Menu( array( |
|
67 | + $this->_menu_map = new EE_Admin_Page_Sub_Menu(array( |
|
68 | 68 | 'menu_group' => 'management', |
69 | 69 | 'menu_order' => 20, |
70 | 70 | 'show_on_menu' => EE_Admin_Page_Menu_Map::BLOG_ADMIN_ONLY, |
@@ -1,4 +1,6 @@ |
||
1 | -<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed'); |
|
1 | +<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
2 | + exit('No direct script access allowed'); |
|
3 | +} |
|
2 | 4 | /** |
3 | 5 | * Event Espresso |
4 | 6 | * |
@@ -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 | /** |
@@ -78,25 +78,25 @@ discard block |
||
78 | 78 | |
79 | 79 | |
80 | 80 | protected function _start() { |
81 | - $content = '<h3>' . __('Add New Default Price', 'event_espresso') . '</h3>'; |
|
82 | - $content .= '<p>' . __('This tour of the add new default price page will go over different areas of the screen to help you understand what they are used for.', 'event_espresso') . '</p>'; |
|
81 | + $content = '<h3>'.__('Add New Default Price', 'event_espresso').'</h3>'; |
|
82 | + $content .= '<p>'.__('This tour of the add new default price page will go over different areas of the screen to help you understand what they are used for.', 'event_espresso').'</p>'; |
|
83 | 83 | return $content; |
84 | 84 | } |
85 | 85 | |
86 | 86 | protected function _price_type_stop() { |
87 | - return '<p>' . __('Price Types are a way of categorizing a price, discount, tax, or surcharge and indicating how it gets applied to a running total when a transaction occurs.', 'event_espresso') . '</p>'; |
|
87 | + return '<p>'.__('Price Types are a way of categorizing a price, discount, tax, or surcharge and indicating how it gets applied to a running total when a transaction occurs.', 'event_espresso').'</p>'; |
|
88 | 88 | } |
89 | 89 | |
90 | 90 | protected function _price_name_stop() { |
91 | - return '<p>' . __('The name of the price, discount, tax, or surcharge that will be seen by your customers.', 'event_espresso') . '</p>'; |
|
91 | + return '<p>'.__('The name of the price, discount, tax, or surcharge that will be seen by your customers.', 'event_espresso').'</p>'; |
|
92 | 92 | } |
93 | 93 | |
94 | 94 | protected function _price_description_stop() { |
95 | - return '<p>' . __('View the price type (price, discount, tax or surcharge) description.', 'event_espresso') . '</p>'; |
|
95 | + return '<p>'.__('View the price type (price, discount, tax or surcharge) description.', 'event_espresso').'</p>'; |
|
96 | 96 | } |
97 | 97 | |
98 | 98 | protected function _price_amount_stop() { |
99 | - return '<p>' . __('The ticket amount before any deductions.', 'event_espresso') . '</p>'; |
|
99 | + return '<p>'.__('The ticket amount before any deductions.', 'event_espresso').'</p>'; |
|
100 | 100 | } |
101 | 101 | |
102 | 102 | } |
103 | 103 | \ No newline at end of file |
@@ -6,8 +6,9 @@ |
||
6 | 6 | * @package Event Espresso |
7 | 7 | * @subpackage messages |
8 | 8 | */ |
9 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
9 | +if (!defined('EVENT_ESPRESSO_VERSION') ) { |
|
10 | 10 | exit('NO direct script access allowed'); |
11 | +} |
|
11 | 12 | |
12 | 13 | /** |
13 | 14 | * |
@@ -1,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 | /** |
@@ -78,25 +78,25 @@ discard block |
||
78 | 78 | |
79 | 79 | |
80 | 80 | protected function _start() { |
81 | - $content = '<h3>' . __('Add New Price Type', 'event_espresso') . '</h3>'; |
|
82 | - $content .= '<p>' . __('This tour of the Add New Price Type page will go over different areas of the screen to help you understand what they are used for.', 'event_espresso') . '</p>'; |
|
81 | + $content = '<h3>'.__('Add New Price Type', 'event_espresso').'</h3>'; |
|
82 | + $content .= '<p>'.__('This tour of the Add New Price Type page will go over different areas of the screen to help you understand what they are used for.', 'event_espresso').'</p>'; |
|
83 | 83 | return $content; |
84 | 84 | } |
85 | 85 | |
86 | 86 | protected function _basic_type_stop() { |
87 | - return '<p>' . __('Set a price type to be a discount, surcharge, or tax.', 'event_espresso') . '</p>'; |
|
87 | + return '<p>'.__('Set a price type to be a discount, surcharge, or tax.', 'event_espresso').'</p>'; |
|
88 | 88 | } |
89 | 89 | |
90 | 90 | protected function _price_type_name_stop() { |
91 | - return '<p>' . __('The name of the price type.', 'event_espresso') . '</p>'; |
|
91 | + return '<p>'.__('The name of the price type.', 'event_espresso').'</p>'; |
|
92 | 92 | } |
93 | 93 | |
94 | 94 | protected function _percentage_dollar_amount_stop() { |
95 | - return '<p>' . __('Set a price type to be percentage-based or a fixed amount.', 'event_espresso') . '</p>'; |
|
95 | + return '<p>'.__('Set a price type to be percentage-based or a fixed amount.', 'event_espresso').'</p>'; |
|
96 | 96 | } |
97 | 97 | |
98 | 98 | protected function _order_of_application_stop() { |
99 | - return '<p>' . __('Set the order of application for a price type.', 'event_espresso') . '</p>'; |
|
99 | + return '<p>'.__('Set the order of application for a price type.', 'event_espresso').'</p>'; |
|
100 | 100 | } |
101 | 101 | |
102 | 102 | } |
103 | 103 | \ No newline at end of file |
@@ -6,8 +6,9 @@ |
||
6 | 6 | * @package Event Espresso |
7 | 7 | * @subpackage messages |
8 | 8 | */ |
9 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
9 | +if (!defined('EVENT_ESPRESSO_VERSION') ) { |
|
10 | 10 | exit('NO direct script access allowed'); |
11 | +} |
|
11 | 12 | |
12 | 13 | /** |
13 | 14 | * |
@@ -1,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 | /** |
@@ -99,33 +99,33 @@ discard block |
||
99 | 99 | |
100 | 100 | |
101 | 101 | protected function _start() { |
102 | - $content = '<h3>' . __('Default Pricing', 'event_espresso') . '</h3>'; |
|
103 | - $content .= '<p>' . __('This tour of the Default Pricing page will go over different areas of the screen to help you understand what they are used for.', 'event_espresso') . '</p>'; |
|
102 | + $content = '<h3>'.__('Default Pricing', 'event_espresso').'</h3>'; |
|
103 | + $content .= '<p>'.__('This tour of the Default Pricing page will go over different areas of the screen to help you understand what they are used for.', 'event_espresso').'</p>'; |
|
104 | 104 | return $content; |
105 | 105 | } |
106 | 106 | |
107 | 107 | protected function _name_column_stop() { |
108 | - return '<p>' . __('The name of the price, discount, tax, or surcharge that will be seen by your customers. Can be sorted in ascending or descending order.', 'event_espresso') . '</p>'; |
|
108 | + return '<p>'.__('The name of the price, discount, tax, or surcharge that will be seen by your customers. Can be sorted in ascending or descending order.', 'event_espresso').'</p>'; |
|
109 | 109 | } |
110 | 110 | |
111 | 111 | protected function _type_column_stop() { |
112 | - return '<p>' . __('Price Types are a way of categorizing a price, discount, tax, or surcharge and indicating how it gets applied to a running total when a transaction occurs. Can be sorted in ascending or descending order.', 'event_espresso') . '</p>'; |
|
112 | + return '<p>'.__('Price Types are a way of categorizing a price, discount, tax, or surcharge and indicating how it gets applied to a running total when a transaction occurs. Can be sorted in ascending or descending order.', 'event_espresso').'</p>'; |
|
113 | 113 | } |
114 | 114 | |
115 | 115 | protected function _description_column_stop() { |
116 | - return '<p>' . __('View the price type (price, discount, tax or surcharge) description.', 'event_espresso') . '</p>'; |
|
116 | + return '<p>'.__('View the price type (price, discount, tax or surcharge) description.', 'event_espresso').'</p>'; |
|
117 | 117 | } |
118 | 118 | |
119 | 119 | protected function _amount_column_stop() { |
120 | - return '<p>' . __('The ticket amount before any deductions. Can be sorted in ascending or descending order.', 'event_espresso') . '</p>'; |
|
120 | + return '<p>'.__('The ticket amount before any deductions. Can be sorted in ascending or descending order.', 'event_espresso').'</p>'; |
|
121 | 121 | } |
122 | 122 | |
123 | 123 | protected function _bulk_actions_stop() { |
124 | - return '<p>' . __('Perform bulk actions to multiple price types.', 'event_espresso') . '</p>'; |
|
124 | + return '<p>'.__('Perform bulk actions to multiple price types.', 'event_espresso').'</p>'; |
|
125 | 125 | } |
126 | 126 | |
127 | 127 | protected function _search_stop() { |
128 | - return '<p>' . __('Search through default pricing. The following sources will be searched: Price Name, Price Type, Price Description, and Price Amount.', 'event_espresso') . '</p>'; |
|
128 | + return '<p>'.__('Search through default pricing. The following sources will be searched: Price Name, Price Type, Price Description, and Price Amount.', 'event_espresso').'</p>'; |
|
129 | 129 | } |
130 | 130 | |
131 | 131 | } |
132 | 132 | \ No newline at end of file |
@@ -6,8 +6,9 @@ |
||
6 | 6 | * @package Event Espresso |
7 | 7 | * @subpackage messages |
8 | 8 | */ |
9 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
9 | +if (!defined('EVENT_ESPRESSO_VERSION') ) { |
|
10 | 10 | exit('NO direct script access allowed'); |
11 | +} |
|
11 | 12 | |
12 | 13 | /** |
13 | 14 | * |
@@ -1,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 | /** |
@@ -78,25 +78,25 @@ discard block |
||
78 | 78 | |
79 | 79 | |
80 | 80 | protected function _start() { |
81 | - $content = '<h3>' . __('Edit Default Price', 'event_espresso') . '</h3>'; |
|
82 | - $content .= '<p>' . __('This tour of the Edit Default Price page will go over different areas of the screen to help you understand what they are used for.', 'event_espresso') . '</p>'; |
|
81 | + $content = '<h3>'.__('Edit Default Price', 'event_espresso').'</h3>'; |
|
82 | + $content .= '<p>'.__('This tour of the Edit Default Price page will go over different areas of the screen to help you understand what they are used for.', 'event_espresso').'</p>'; |
|
83 | 83 | return $content; |
84 | 84 | } |
85 | 85 | |
86 | 86 | protected function _price_type_stop() { |
87 | - return '<p>' . __('Price Types are a way of categorizing a price, discount, tax, or surcharge and indicating how it gets applied to a running total when a transaction occurs.', 'event_espresso') . '</p>'; |
|
87 | + return '<p>'.__('Price Types are a way of categorizing a price, discount, tax, or surcharge and indicating how it gets applied to a running total when a transaction occurs.', 'event_espresso').'</p>'; |
|
88 | 88 | } |
89 | 89 | |
90 | 90 | protected function _price_name_stop() { |
91 | - return '<p>' . __('The name of the price, discount, tax, or surcharge that will be seen by your customers.', 'event_espresso') . '</p>'; |
|
91 | + return '<p>'.__('The name of the price, discount, tax, or surcharge that will be seen by your customers.', 'event_espresso').'</p>'; |
|
92 | 92 | } |
93 | 93 | |
94 | 94 | protected function _price_description_stop() { |
95 | - return '<p>' . __('View the price type (price, discount, tax or surcharge) description.', 'event_espresso') . '</p>'; |
|
95 | + return '<p>'.__('View the price type (price, discount, tax or surcharge) description.', 'event_espresso').'</p>'; |
|
96 | 96 | } |
97 | 97 | |
98 | 98 | protected function _price_amount_stop() { |
99 | - return '<p>' . __('The ticket amount before any deductions.', 'event_espresso') . '</p>'; |
|
99 | + return '<p>'.__('The ticket amount before any deductions.', 'event_espresso').'</p>'; |
|
100 | 100 | } |
101 | 101 | |
102 | 102 | } |
103 | 103 | \ No newline at end of file |
@@ -6,8 +6,9 @@ |
||
6 | 6 | * @package Event Espresso |
7 | 7 | * @subpackage messages |
8 | 8 | */ |
9 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
9 | +if (!defined('EVENT_ESPRESSO_VERSION') ) { |
|
10 | 10 | exit('NO direct script access allowed'); |
11 | +} |
|
11 | 12 | |
12 | 13 | /** |
13 | 14 | * |
@@ -1,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 | /** |
@@ -78,25 +78,25 @@ discard block |
||
78 | 78 | |
79 | 79 | |
80 | 80 | protected function _start() { |
81 | - $content = '<h3>' . __('Edit Price Type', 'event_espresso') . '</h3>'; |
|
82 | - $content .= '<p>' . __('This tour of the Edit Price Type page will go over different areas of the screen to help you understand what they are used for.', 'event_espresso') . '</p>'; |
|
81 | + $content = '<h3>'.__('Edit Price Type', 'event_espresso').'</h3>'; |
|
82 | + $content .= '<p>'.__('This tour of the Edit Price Type page will go over different areas of the screen to help you understand what they are used for.', 'event_espresso').'</p>'; |
|
83 | 83 | return $content; |
84 | 84 | } |
85 | 85 | |
86 | 86 | protected function _basic_type_stop() { |
87 | - return '<p>' . __('Set a price type to be a discount, surcharge, or tax.', 'event_espresso') . '</p>'; |
|
87 | + return '<p>'.__('Set a price type to be a discount, surcharge, or tax.', 'event_espresso').'</p>'; |
|
88 | 88 | } |
89 | 89 | |
90 | 90 | protected function _price_type_name_stop() { |
91 | - return '<p>' . __('The name of the price type.', 'event_espresso') . '</p>'; |
|
91 | + return '<p>'.__('The name of the price type.', 'event_espresso').'</p>'; |
|
92 | 92 | } |
93 | 93 | |
94 | 94 | protected function _percentage_dollar_amount_stop() { |
95 | - return '<p>' . __('Set a price type to be percentage-based or a fixed amount.', 'event_espresso') . '</p>'; |
|
95 | + return '<p>'.__('Set a price type to be percentage-based or a fixed amount.', 'event_espresso').'</p>'; |
|
96 | 96 | } |
97 | 97 | |
98 | 98 | protected function _order_of_application_stop() { |
99 | - return '<p>' . __('Set the order of application for a price type.', 'event_espresso') . '</p>'; |
|
99 | + return '<p>'.__('Set the order of application for a price type.', 'event_espresso').'</p>'; |
|
100 | 100 | } |
101 | 101 | |
102 | 102 | } |
103 | 103 | \ No newline at end of file |
@@ -6,8 +6,9 @@ |
||
6 | 6 | * @package Event Espresso |
7 | 7 | * @subpackage messages |
8 | 8 | */ |
9 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
9 | +if (!defined('EVENT_ESPRESSO_VERSION') ) { |
|
10 | 10 | exit('NO direct script access allowed'); |
11 | +} |
|
11 | 12 | |
12 | 13 | /** |
13 | 14 | * |