@@ -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 | /** |
@@ -98,34 +98,34 @@ discard block |
||
| 98 | 98 | |
| 99 | 99 | |
| 100 | 100 | protected function _start() { |
| 101 | - $content = '<h3>' . __('Edit Question Group', 'event_espresso') . '</h3>'; |
|
| 102 | - $content .= '<p>' . __('This tour of the Edit Question Group page will go over different areas of the screen to help you understand what they are used for.', 'event_espresso') . '</p>'; |
|
| 101 | + $content = '<h3>'.__('Edit Question Group', 'event_espresso').'</h3>'; |
|
| 102 | + $content .= '<p>'.__('This tour of the Edit Question Group page will go over different areas of the screen to help you understand what they are used for.', 'event_espresso').'</p>'; |
|
| 103 | 103 | |
| 104 | 104 | return $content; |
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | protected function _qsg_name_stop() { |
| 108 | - return '<p>' . __('The name of the question group.', 'event_espresso') . '</p>'; |
|
| 108 | + return '<p>'.__('The name of the question group.', 'event_espresso').'</p>'; |
|
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | protected function _qsg_identifier_stop() { |
| 112 | - return '<p>' . __('A unique name for your question group.', 'event_espresso') . '</p>'; |
|
| 112 | + return '<p>'.__('A unique name for your question group.', 'event_espresso').'</p>'; |
|
| 113 | 113 | } |
| 114 | 114 | |
| 115 | 115 | protected function _qsg_desc_stop() { |
| 116 | - return '<p>' . __('A description of the question group.', 'event_espresso') . '</p>'; |
|
| 116 | + return '<p>'.__('A description of the question group.', 'event_espresso').'</p>'; |
|
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | protected function _qsg_order_stop() { |
| 120 | - return '<p>' . __('Set the order that you want your question group to appear in.', 'event_espresso') . '</p>'; |
|
| 120 | + return '<p>'.__('Set the order that you want your question group to appear in.', 'event_espresso').'</p>'; |
|
| 121 | 121 | } |
| 122 | 122 | |
| 123 | 123 | protected function _qsg_show_group_name_stop() { |
| 124 | - return '<p>' . __('Specify whether the group name should be shown on the registration page.', 'event_espresso') . '</p>'; |
|
| 124 | + return '<p>'.__('Specify whether the group name should be shown on the registration page.', 'event_espresso').'</p>'; |
|
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | protected function _qsg_show_group_desc_stop() { |
| 128 | - return '<p>' . __('Specify whether the group description should be shown on the registration page.', 'event_espresso') . '</p>'; |
|
| 128 | + return '<p>'.__('Specify whether the group description should be shown on the registration page.', 'event_espresso').'</p>'; |
|
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | } |
| 132 | 132 | \ No newline at end of file |
@@ -1,6 +1,7 @@ |
||
| 1 | 1 | <?php |
| 2 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
| 2 | +if (!defined('EVENT_ESPRESSO_VERSION') ) { |
|
| 3 | 3 | exit('NO direct script access allowed'); |
| 4 | +} |
|
| 4 | 5 | |
| 5 | 6 | /** |
| 6 | 7 | * Event Espresso |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
| 2 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) |
|
| 3 | 3 | exit('NO direct script access allowed'); |
| 4 | 4 | |
| 5 | 5 | /** |
@@ -98,34 +98,34 @@ discard block |
||
| 98 | 98 | |
| 99 | 99 | |
| 100 | 100 | protected function _start() { |
| 101 | - $content = '<h3>' . __('Edit Question', 'event_espresso') . '</h3>'; |
|
| 102 | - $content .= '<p>' . __('This tour of the Edit Question page will go over different areas of the screen to help you understand what they are used for.', 'event_espresso') . '</p>'; |
|
| 101 | + $content = '<h3>'.__('Edit Question', 'event_espresso').'</h3>'; |
|
| 102 | + $content .= '<p>'.__('This tour of the Edit Question page will go over different areas of the screen to help you understand what they are used for.', 'event_espresso').'</p>'; |
|
| 103 | 103 | |
| 104 | 104 | return $content; |
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | protected function _qst_display_text_stop() { |
| 108 | - return '<p>' . __('This is the question that is displayed to registrants who are signing up for events.', 'event_espresso') . '</p>'; |
|
| 108 | + return '<p>'.__('This is the question that is displayed to registrants who are signing up for events.', 'event_espresso').'</p>'; |
|
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | protected function _qst_admin_label_stop() { |
| 112 | - return '<p>' . __('Helps you understand the difference between questions that may appear similar but are actually different.', 'event_espresso') . '</p>'; |
|
| 112 | + return '<p>'.__('Helps you understand the difference between questions that may appear similar but are actually different.', 'event_espresso').'</p>'; |
|
| 113 | 113 | } |
| 114 | 114 | |
| 115 | 115 | protected function _qst_admin_only_stop() { |
| 116 | - return '<p>' . __('Specify whether this question should be shown only to the admins.', 'event_espresso') . '</p>'; |
|
| 116 | + return '<p>'.__('Specify whether this question should be shown only to the admins.', 'event_espresso').'</p>'; |
|
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | protected function _qst_type_stop() { |
| 120 | - return '<p>' . __('Select the type of question. Available options are text, textarea, single, multiple, dropdown, and date.', 'event_espresso') . '</p>'; |
|
| 120 | + return '<p>'.__('Select the type of question. Available options are text, textarea, single, multiple, dropdown, and date.', 'event_espresso').'</p>'; |
|
| 121 | 121 | } |
| 122 | 122 | |
| 123 | 123 | protected function _qst_required_stop() { |
| 124 | - return '<p>' . __('Specify whether this question should be required.', 'event_espresso') . '</p>'; |
|
| 124 | + return '<p>'.__('Specify whether this question should be required.', 'event_espresso').'</p>'; |
|
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | protected function _qst_required_text_stop() { |
| 128 | - return '<p>' . __('Text to display when registrant does not answer question but is required to.', 'event_espresso') . '</p>'; |
|
| 128 | + return '<p>'.__('Text to display when registrant does not answer question but is required to.', 'event_espresso').'</p>'; |
|
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | } |
| 132 | 132 | \ No newline at end of file |
@@ -1,6 +1,7 @@ |
||
| 1 | 1 | <?php |
| 2 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
| 2 | +if (!defined('EVENT_ESPRESSO_VERSION') ) { |
|
| 3 | 3 | exit('NO direct script access allowed'); |
| 4 | +} |
|
| 4 | 5 | |
| 5 | 6 | /** |
| 6 | 7 | * Event Espresso |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
| 2 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) |
|
| 3 | 3 | exit('NO direct script access allowed'); |
| 4 | 4 | |
| 5 | 5 | /** |
@@ -42,7 +42,7 @@ discard block |
||
| 42 | 42 | ) |
| 43 | 43 | ); |
| 44 | 44 | |
| 45 | - if ( $this->_is_caf ) { |
|
| 45 | + if ($this->_is_caf) { |
|
| 46 | 46 | $this->_stops[15] = array( |
| 47 | 47 | 'id' => 'id', |
| 48 | 48 | 'content' => $this->_id_stop(), |
@@ -111,45 +111,45 @@ discard block |
||
| 111 | 111 | |
| 112 | 112 | |
| 113 | 113 | protected function _start() { |
| 114 | - $content = '<h3>' . __('Question Groups', 'event_espresso') . '</h3>'; |
|
| 115 | - if ( $this->_is_caf ) { |
|
| 116 | - $content .= '<p>' . __('This tour of the Question Groups page will go over different areas of the screen to help you understand what they are used for.', 'event_espresso') . '</p>'; |
|
| 114 | + $content = '<h3>'.__('Question Groups', 'event_espresso').'</h3>'; |
|
| 115 | + if ($this->_is_caf) { |
|
| 116 | + $content .= '<p>'.__('This tour of the Question Groups page will go over different areas of the screen to help you understand what they are used for.', 'event_espresso').'</p>'; |
|
| 117 | 117 | } else { |
| 118 | - $content .= '<p>' . __('Sorry, Event Espresso Decaf does not have this feature. Please purchase a support license to get access to this feature.', 'event_espresso') . '</p>'; |
|
| 118 | + $content .= '<p>'.__('Sorry, Event Espresso Decaf does not have this feature. Please purchase a support license to get access to this feature.', 'event_espresso').'</p>'; |
|
| 119 | 119 | } |
| 120 | 120 | |
| 121 | 121 | return $content; |
| 122 | 122 | } |
| 123 | 123 | |
| 124 | 124 | protected function _id_stop() { |
| 125 | - return '<p>' . __('View the ID of the question group. Can be sorted in ascending or descending order.', 'event_espresso') . '</p>'; |
|
| 125 | + return '<p>'.__('View the ID of the question group. Can be sorted in ascending or descending order.', 'event_espresso').'</p>'; |
|
| 126 | 126 | } |
| 127 | 127 | |
| 128 | 128 | protected function _name_stop() { |
| 129 | - return '<p>' . __('View available questions groups. You can reorder your questions by dragging and dropping them.', 'event_espresso') . '</p>'; |
|
| 129 | + return '<p>'.__('View available questions groups. You can reorder your questions by dragging and dropping them.', 'event_espresso').'</p>'; |
|
| 130 | 130 | } |
| 131 | 131 | |
| 132 | 132 | protected function _description_stop() { |
| 133 | - return '<p>' . __('View the question group description.', 'event_espresso') . '</p>'; |
|
| 133 | + return '<p>'.__('View the question group description.', 'event_espresso').'</p>'; |
|
| 134 | 134 | } |
| 135 | 135 | |
| 136 | 136 | protected function _show_group_name_stop() { |
| 137 | - return '<p>' . __('View if the name of the question group should be shown to customers.', 'event_espresso') . '</p>'; |
|
| 137 | + return '<p>'.__('View if the name of the question group should be shown to customers.', 'event_espresso').'</p>'; |
|
| 138 | 138 | } |
| 139 | 139 | |
| 140 | 140 | protected function _show_group_description_stop() { |
| 141 | - return '<p>' . __('View if the description of the question group should be shown to customers.', 'event_espresso') . '</p>'; |
|
| 141 | + return '<p>'.__('View if the description of the question group should be shown to customers.', 'event_espresso').'</p>'; |
|
| 142 | 142 | } |
| 143 | 143 | |
| 144 | 144 | protected function _bulk_actions_stop() { |
| 145 | - return '<p>' . __('Perform bulk actions to multiple question groups.', 'event_espresso') . '</p>'; |
|
| 145 | + return '<p>'.__('Perform bulk actions to multiple question groups.', 'event_espresso').'</p>'; |
|
| 146 | 146 | } |
| 147 | 147 | |
| 148 | 148 | protected function _search_stop() { |
| 149 | - return '<p>' . __('Search through questions. The following sources will be searched: question group name and question group description.', 'event_espresso') . '</p>'; |
|
| 149 | + return '<p>'.__('Search through questions. The following sources will be searched: question group name and question group description.', 'event_espresso').'</p>'; |
|
| 150 | 150 | } |
| 151 | 151 | |
| 152 | 152 | protected function _add_new_question_group_stop() { |
| 153 | - return '<p>' . __('Click here to create a new question group.', 'event_espresso') . '</p>'; |
|
| 153 | + return '<p>'.__('Click here to create a new question group.', 'event_espresso').'</p>'; |
|
| 154 | 154 | } |
| 155 | 155 | } |
| 156 | 156 | \ No newline at end of file |
@@ -1,6 +1,7 @@ |
||
| 1 | 1 | <?php |
| 2 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
| 2 | +if (!defined('EVENT_ESPRESSO_VERSION') ) { |
|
| 3 | 3 | exit('NO direct script access allowed'); |
| 4 | +} |
|
| 4 | 5 | |
| 5 | 6 | /** |
| 6 | 7 | * Event Espresso |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
| 2 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) |
|
| 3 | 3 | exit('NO direct script access allowed'); |
| 4 | 4 | |
| 5 | 5 | /** |
@@ -116,30 +116,30 @@ discard block |
||
| 116 | 116 | |
| 117 | 117 | |
| 118 | 118 | protected function _start() { |
| 119 | - $content = '<h3>' . __('Questions Overview', 'event_espresso') . '</h3>'; |
|
| 120 | - $content .= '<p>' . __('This tour of the Questions Overview page will go over different areas of the screen to help you understand what they are used for.', 'event_espresso') . '</p>'; |
|
| 119 | + $content = '<h3>'.__('Questions Overview', 'event_espresso').'</h3>'; |
|
| 120 | + $content .= '<p>'.__('This tour of the Questions Overview page will go over different areas of the screen to help you understand what they are used for.', 'event_espresso').'</p>'; |
|
| 121 | 121 | |
| 122 | 122 | return $content; |
| 123 | 123 | } |
| 124 | 124 | |
| 125 | 125 | protected function _display_text_stop() { |
| 126 | - return '<p>' . __('View available questions. You can reorder your questions by dragging and dropping them.', 'event_espresso') . '</p>'; |
|
| 126 | + return '<p>'.__('View available questions. You can reorder your questions by dragging and dropping them.', 'event_espresso').'</p>'; |
|
| 127 | 127 | } |
| 128 | 128 | |
| 129 | 129 | protected function _admin_label_stop() { |
| 130 | - return '<p>' . __('View the admin label for your questions.', 'event_espresso') . '</p>'; |
|
| 130 | + return '<p>'.__('View the admin label for your questions.', 'event_espresso').'</p>'; |
|
| 131 | 131 | } |
| 132 | 132 | |
| 133 | 133 | protected function _type_stop() { |
| 134 | - return '<p>' . __('View the type of question. Available options are Text, Textarea, Checkboxes, Radio Buttons, Dropdown, State/Province Dropdown, Country Dropdown, and Date Picker.', 'event_espresso') . '</p>'; |
|
| 134 | + return '<p>'.__('View the type of question. Available options are Text, Textarea, Checkboxes, Radio Buttons, Dropdown, State/Province Dropdown, Country Dropdown, and Date Picker.', 'event_espresso').'</p>'; |
|
| 135 | 135 | } |
| 136 | 136 | |
| 137 | 137 | protected function _values_stop() { |
| 138 | - return '<p>' . __('View stored values for checkboxes, radio buttons, and select boxes.', 'event_espresso') . '</p>'; |
|
| 138 | + return '<p>'.__('View stored values for checkboxes, radio buttons, and select boxes.', 'event_espresso').'</p>'; |
|
| 139 | 139 | } |
| 140 | 140 | |
| 141 | 141 | protected function _required_stop() { |
| 142 | - return '<p>' . __('View if a question is required.', 'event_espresso') . '</p>'; |
|
| 142 | + return '<p>'.__('View if a question is required.', 'event_espresso').'</p>'; |
|
| 143 | 143 | } |
| 144 | 144 | |
| 145 | 145 | /* protected function _bulk_actions_stop() { |
@@ -147,11 +147,11 @@ discard block |
||
| 147 | 147 | } */ |
| 148 | 148 | |
| 149 | 149 | protected function _search_stop() { |
| 150 | - return '<p>' . __('Search through questions. The following sources will be searched: Name of Question (display text).', 'event_espresso') . '</p>'; |
|
| 150 | + return '<p>'.__('Search through questions. The following sources will be searched: Name of Question (display text).', 'event_espresso').'</p>'; |
|
| 151 | 151 | } |
| 152 | 152 | |
| 153 | 153 | protected function _add_new_question_stop() { |
| 154 | - return '<p>' . __('Click here to add a new question.', 'event_espresso') . '</p>'; |
|
| 154 | + return '<p>'.__('Click here to add a new question.', 'event_espresso').'</p>'; |
|
| 155 | 155 | } |
| 156 | 156 | |
| 157 | 157 | } |
| 158 | 158 | \ No newline at end of file |
@@ -1,6 +1,7 @@ |
||
| 1 | 1 | <?php |
| 2 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
| 2 | +if (!defined('EVENT_ESPRESSO_VERSION') ) { |
|
| 3 | 3 | exit('NO direct script access allowed'); |
| 4 | +} |
|
| 4 | 5 | |
| 5 | 6 | /** |
| 6 | 7 | * Event Espresso |
@@ -1,5 +1,5 @@ discard block |
||
| 1 | 1 | <?php |
| 2 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
| 2 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) |
|
| 3 | 3 | exit('NO direct script access allowed'); |
| 4 | 4 | |
| 5 | 5 | /** |
@@ -98,34 +98,34 @@ discard block |
||
| 98 | 98 | |
| 99 | 99 | |
| 100 | 100 | protected function _start() { |
| 101 | - $content = '<h3>' . __('Registration Form Settings', 'event_espresso') . '</h3>'; |
|
| 102 | - $content .= '<p>' . __('This tour of the Registration Form Settings page will go over different areas of the screen to help you understand what they are used for.', 'event_espresso') . '</p>'; |
|
| 101 | + $content = '<h3>'.__('Registration Form Settings', 'event_espresso').'</h3>'; |
|
| 102 | + $content .= '<p>'.__('This tour of the Registration Form Settings page will go over different areas of the screen to help you understand what they are used for.', 'event_espresso').'</p>'; |
|
| 103 | 103 | |
| 104 | 104 | return $content; |
| 105 | 105 | } |
| 106 | 106 | |
| 107 | 107 | protected function _use_recaptcha_stop() { |
| 108 | - return '<p>' . __('Specify whether reCAPTCHA should be enabled.', 'event_espresso') . '</p>'; |
|
| 108 | + return '<p>'.__('Specify whether reCAPTCHA should be enabled.', 'event_espresso').'</p>'; |
|
| 109 | 109 | } |
| 110 | 110 | |
| 111 | 111 | protected function _recaptcha_public_key_stop() { |
| 112 | - return '<p>' . __('Enter your public key for reCAPTCHA.', 'event_espresso') . '</p>'; |
|
| 112 | + return '<p>'.__('Enter your public key for reCAPTCHA.', 'event_espresso').'</p>'; |
|
| 113 | 113 | } |
| 114 | 114 | |
| 115 | 115 | protected function _recaptcha_private_key_stop() { |
| 116 | - return '<p>' . __('Enter your private key for reCAPTCHA.', 'event_espresso') . '</p>'; |
|
| 116 | + return '<p>'.__('Enter your private key for reCAPTCHA.', 'event_espresso').'</p>'; |
|
| 117 | 117 | } |
| 118 | 118 | |
| 119 | 119 | protected function _recaptcha_theme_stop() { |
| 120 | - return '<p>' . __('Select a theme (style) for your reCAPTCHA.', 'event_espresso') . '</p>'; |
|
| 120 | + return '<p>'.__('Select a theme (style) for your reCAPTCHA.', 'event_espresso').'</p>'; |
|
| 121 | 121 | } |
| 122 | 122 | |
| 123 | 123 | protected function _recaptcha_language_stop() { |
| 124 | - return '<p>' . __('Specify the language that should be used for reCAPTCHA.', 'event_espresso') . '</p>'; |
|
| 124 | + return '<p>'.__('Specify the language that should be used for reCAPTCHA.', 'event_espresso').'</p>'; |
|
| 125 | 125 | } |
| 126 | 126 | |
| 127 | 127 | protected function _recaptcha_width_stop() { |
| 128 | - return '<p>' . __('Specify how wide (in pixels) the reCAPTCHA form should be.', 'event_espresso') . '</p>'; |
|
| 128 | + return '<p>'.__('Specify how wide (in pixels) the reCAPTCHA form should be.', 'event_espresso').'</p>'; |
|
| 129 | 129 | } |
| 130 | 130 | |
| 131 | 131 | } |
| 132 | 132 | \ No newline at end of file |
@@ -1,6 +1,7 @@ |
||
| 1 | 1 | <?php |
| 2 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
| 2 | +if (!defined('EVENT_ESPRESSO_VERSION') ) { |
|
| 3 | 3 | exit('NO direct script access allowed'); |
| 4 | +} |
|
| 4 | 5 | |
| 5 | 6 | /** |
| 6 | 7 | * Event Espresso |
@@ -92,7 +92,7 @@ |
||
| 92 | 92 | <input type="hidden" id="QST_type" name="QST_type" value="<?php echo $question->type()?>"/> |
| 93 | 93 | <?php |
| 94 | 94 | $explanatory_text = __('System question! This field cannot be changed.','event_espresso'); |
| 95 | - }else{ |
|
| 95 | + } else{ |
|
| 96 | 96 | $explanatory_text = __('Because there are currently answers for this question in the database, your options to change the question type have been limited to similar question-types.','event_espresso'); |
| 97 | 97 | } |
| 98 | 98 | if ( ! empty( $QST_system ) || $has_answers ) { ?> |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | <tbody> |
| 22 | 22 | <tr> |
| 23 | 23 | <th> |
| 24 | - <label for="QST_display_text"><?php echo $fields['QST_display_text']->get_nicename();?></label> <?php echo EEH_Template::get_help_tab_link('question_text_info');?> |
|
| 24 | + <label for="QST_display_text"><?php echo $fields['QST_display_text']->get_nicename(); ?></label> <?php echo EEH_Template::get_help_tab_link('question_text_info'); ?> |
|
| 25 | 25 | </th> |
| 26 | 26 | <td> |
| 27 | 27 | <input type="text" class="regular-text" id="QST_display_text" name="QST_display_text" value="<?php $question->f('QST_display_text')?>"/> |
@@ -31,23 +31,23 @@ discard block |
||
| 31 | 31 | |
| 32 | 32 | <tr> |
| 33 | 33 | <th> |
| 34 | - <label for="QST_admin_label"><?php echo $fields['QST_admin_label']->get_nicename();?></label> <?php echo EEH_Template::get_help_tab_link('question_label_info');?> |
|
| 34 | + <label for="QST_admin_label"><?php echo $fields['QST_admin_label']->get_nicename(); ?></label> <?php echo EEH_Template::get_help_tab_link('question_label_info'); ?> |
|
| 35 | 35 | </th> |
| 36 | 36 | <td> |
| 37 | 37 | <?php |
| 38 | - $disabled = ! empty( $QST_system ) ? ' disabled="disabled"' : ''; |
|
| 39 | - $id = ! empty( $QST_system ) ? '_disabled' : ''; |
|
| 38 | + $disabled = ! empty($QST_system) ? ' disabled="disabled"' : ''; |
|
| 39 | + $id = ! empty($QST_system) ? '_disabled' : ''; |
|
| 40 | 40 | ?> |
| 41 | 41 | <input type="text" class="regular-text" id="QST_admin_label<?php echo $id?>" name="QST_admin_label<?php echo $id?>" value="<?php $question->f('QST_admin_label')?>"<?php echo $disabled?>/> |
| 42 | 42 | <input class="QST_order" type="hidden" id="QST_order<?php echo $id; ?>" name = "QST_order<?php echo $id; ?>" value="<?php echo $question->get('QST_order'); ?>" /> |
| 43 | - <?php if ( ! empty( $QST_system )) { ?> |
|
| 43 | + <?php if ( ! empty($QST_system)) { ?> |
|
| 44 | 44 | <input type="hidden" id="QST_admin_label" name="QST_admin_label" value="<?php echo $question->admin_label()?>"/> |
| 45 | 45 | <?php } ?> |
| 46 | 46 | <br/> |
| 47 | 47 | <p class="description"> |
| 48 | - <?php if ( ! empty( $QST_system )) { ?> |
|
| 48 | + <?php if ( ! empty($QST_system)) { ?> |
|
| 49 | 49 | <span class="description" style="color:#D54E21;"> |
| 50 | - <?php _e('System question! This field cannot be changed.','event_espresso')?> |
|
| 50 | + <?php _e('System question! This field cannot be changed.', 'event_espresso')?> |
|
| 51 | 51 | </span> |
| 52 | 52 | <?php } ?> |
| 53 | 53 | |
@@ -57,21 +57,21 @@ discard block |
||
| 57 | 57 | |
| 58 | 58 | <tr> |
| 59 | 59 | <th> |
| 60 | - <label for="QST_admin_only"><?php echo $fields['QST_admin_only']->get_nicename();?></label> <?php echo EEH_Template::get_help_tab_link('question_admin_only_info');?> |
|
| 60 | + <label for="QST_admin_only"><?php echo $fields['QST_admin_only']->get_nicename(); ?></label> <?php echo EEH_Template::get_help_tab_link('question_admin_only_info'); ?> |
|
| 61 | 61 | </th> |
| 62 | 62 | <td> |
| 63 | 63 | <?php |
| 64 | - $disabled = ! empty( $QST_system ) ? ' disabled="disabled"' : ''; |
|
| 65 | - $id = ! empty( $QST_system ) ? '_disabled' : ''; |
|
| 64 | + $disabled = ! empty($QST_system) ? ' disabled="disabled"' : ''; |
|
| 65 | + $id = ! empty($QST_system) ? '_disabled' : ''; |
|
| 66 | 66 | $admin_only = $question->get('QST_admin_only'); |
| 67 | - $checked = !empty( $admin_only ) ? ' checked="checked"' : ''; |
|
| 67 | + $checked = ! empty($admin_only) ? ' checked="checked"' : ''; |
|
| 68 | 68 | ?> |
| 69 | 69 | <input class="QST_admin_only" type="checkbox" id="QST_admin_only<?php echo $id; ?>" name = "QST_admin_only<?php echo $id; ?>" value="1"<?php echo $disabled; echo $checked; ?>/> |
| 70 | 70 | <br/> |
| 71 | 71 | <p class="description"> |
| 72 | - <?php if ( ! empty( $QST_system )) { ?> |
|
| 72 | + <?php if ( ! empty($QST_system)) { ?> |
|
| 73 | 73 | <span class="description" style="color:#D54E21;"> |
| 74 | - <?php _e('System question! This field cannot be changed.','event_espresso')?> |
|
| 74 | + <?php _e('System question! This field cannot be changed.', 'event_espresso')?> |
|
| 75 | 75 | </span> |
| 76 | 76 | <?php } ?> |
| 77 | 77 | |
@@ -81,21 +81,21 @@ discard block |
||
| 81 | 81 | |
| 82 | 82 | <tr> |
| 83 | 83 | <th> |
| 84 | - <label for="QST_type"><?php echo $fields['QST_type']->get_nicename();?></label> <?php echo EEH_Template::get_help_tab_link('question_type_info');?> |
|
| 84 | + <label for="QST_type"><?php echo $fields['QST_type']->get_nicename(); ?></label> <?php echo EEH_Template::get_help_tab_link('question_type_info'); ?> |
|
| 85 | 85 | </th> |
| 86 | 86 | <td> |
| 87 | 87 | <?php |
| 88 | - $disabled = ! empty( $QST_system ) ? ' disabled="disabled"' : ''; |
|
| 89 | - $id = ! empty( $QST_system ) ? '_disabled' : ''; |
|
| 90 | - echo EEH_Form_Fields::select_input( 'QST_type' . $id, $question_types, $question->type(), 'id="QST_type' . $id . '"' . $disabled ); |
|
| 91 | - if( ! empty( $QST_system ) ) { ?> |
|
| 88 | + $disabled = ! empty($QST_system) ? ' disabled="disabled"' : ''; |
|
| 89 | + $id = ! empty($QST_system) ? '_disabled' : ''; |
|
| 90 | + echo EEH_Form_Fields::select_input('QST_type'.$id, $question_types, $question->type(), 'id="QST_type'.$id.'"'.$disabled); |
|
| 91 | + if ( ! empty($QST_system)) { ?> |
|
| 92 | 92 | <input type="hidden" id="QST_type" name="QST_type" value="<?php echo $question->type()?>"/> |
| 93 | 93 | <?php |
| 94 | - $explanatory_text = __('System question! This field cannot be changed.','event_espresso'); |
|
| 95 | - }else{ |
|
| 96 | - $explanatory_text = __('Because there are currently answers for this question in the database, your options to change the question type have been limited to similar question-types.','event_espresso'); |
|
| 94 | + $explanatory_text = __('System question! This field cannot be changed.', 'event_espresso'); |
|
| 95 | + } else { |
|
| 96 | + $explanatory_text = __('Because there are currently answers for this question in the database, your options to change the question type have been limited to similar question-types.', 'event_espresso'); |
|
| 97 | 97 | } |
| 98 | - if ( ! empty( $QST_system ) || $has_answers ) { ?> |
|
| 98 | + if ( ! empty($QST_system) || $has_answers) { ?> |
|
| 99 | 99 | <p><span class="description" style="color:#D54E21;"> |
| 100 | 100 | <?php echo $explanatory_text; ?> |
| 101 | 101 | </span></p> |
@@ -109,7 +109,7 @@ discard block |
||
| 109 | 109 | <tr id="question_options"> |
| 110 | 110 | <th> |
| 111 | 111 | <label> |
| 112 | - <?php _e('Answer Options','event_espresso')?> |
|
| 112 | + <?php _e('Answer Options', 'event_espresso')?> |
|
| 113 | 113 | </label> |
| 114 | 114 | </th> |
| 115 | 115 | <td> |
@@ -118,10 +118,10 @@ discard block |
||
| 118 | 118 | <thead> |
| 119 | 119 | <tr> |
| 120 | 120 | <th class="option-value-header"> |
| 121 | - <?php _e('Value','event_espresso')?> |
|
| 121 | + <?php _e('Value', 'event_espresso')?> |
|
| 122 | 122 | </th> |
| 123 | 123 | <th class="option-desc-header"> |
| 124 | - <?php _e('Description (optional, only shown on registration form)','event_espresso')?> |
|
| 124 | + <?php _e('Description (optional, only shown on registration form)', 'event_espresso')?> |
|
| 125 | 125 | </th> |
| 126 | 126 | <th> |
| 127 | 127 | </th> |
@@ -144,17 +144,17 @@ discard block |
||
| 144 | 144 | </tr> |
| 145 | 145 | |
| 146 | 146 | <?php |
| 147 | - $count=0; |
|
| 147 | + $count = 0; |
|
| 148 | 148 | $question_options = $question->options(); |
| 149 | - if ( ! empty( $question_options )) { |
|
| 150 | - foreach( $question_options as $option_id => $option ) { |
|
| 151 | - $disabled = $has_answers ? ' disabled="disabled"' : ''; |
|
| 149 | + if ( ! empty($question_options)) { |
|
| 150 | + foreach ($question_options as $option_id => $option) { |
|
| 151 | + $disabled = $has_answers ? ' disabled="disabled"' : ''; |
|
| 152 | 152 | ?> |
| 153 | 153 | <tr class="question-option ee-options-sortable"> |
| 154 | 154 | <td class="option-value-cell"> |
| 155 | 155 | <input type="hidden" class="QSO_order" name="question_options[<?php echo $count; ?>][QSO_order]" value="<?php echo $count; ?>"> |
| 156 | 156 | <input type="text" class="option-value regular-text" name="question_options[<?php echo $count?>][QSO_value]" value="<?php $option->f('QSO_value')?>"<?php echo $disabled; ?>> |
| 157 | - <?php if ( $has_answers ) : ?> |
|
| 157 | + <?php if ($has_answers) : ?> |
|
| 158 | 158 | <input type="hidden" name="question_options[<?php echo $count; ?>][QSO_value]" value="<?php echo $option->f('QSO_value'); ?>" > |
| 159 | 159 | <?php endif; ?> |
| 160 | 160 | </td> |
@@ -199,13 +199,13 @@ discard block |
||
| 199 | 199 | </table> |
| 200 | 200 | |
| 201 | 201 | <a id="new-question-option" class="button" style="margin:0 0 1em 3px;"> |
| 202 | - <?php _e('Add Another Answer Option','event_espresso')?> |
|
| 202 | + <?php _e('Add Another Answer Option', 'event_espresso')?> |
|
| 203 | 203 | </a><br/> |
| 204 | 204 | |
| 205 | 205 | <p class="description"> |
| 206 | - <?php _e('Answer Options are the choices that you give people to select from for RADIO_BTN, CHECKBOX or DROPDOWN questions. The Value is a simple key that will be saved to the database and the description is optional. Note that values CANNOT contain any HTML, but descriptions can.','event_espresso')?> |
|
| 206 | + <?php _e('Answer Options are the choices that you give people to select from for RADIO_BTN, CHECKBOX or DROPDOWN questions. The Value is a simple key that will be saved to the database and the description is optional. Note that values CANNOT contain any HTML, but descriptions can.', 'event_espresso')?> |
|
| 207 | 207 | </p> |
| 208 | - <?php if ( $has_answers ) : ?> |
|
| 208 | + <?php if ($has_answers) : ?> |
|
| 209 | 209 | <p class="description" style="color:#D54E21;"> |
| 210 | 210 | <?php _e('Answer values that are uneditable are this way because there are registrations in the database that have answers for this question. If you need to correct a mistake, or edit an existing option value, then trash the existing one and create a new option with the changes. This will ensure that the existing registrations that chose the original answer will preserve that answer.', 'event_espresso'); ?> |
| 211 | 211 | </p> |
@@ -216,32 +216,32 @@ discard block |
||
| 216 | 216 | |
| 217 | 217 | <tr> |
| 218 | 218 | <th> |
| 219 | - <label for="QST_required"><?php echo $fields['QST_required']->get_nicename();?></label> <?php echo EEH_Template::get_help_tab_link('required_question_info');?> |
|
| 219 | + <label for="QST_required"><?php echo $fields['QST_required']->get_nicename(); ?></label> <?php echo EEH_Template::get_help_tab_link('required_question_info'); ?> |
|
| 220 | 220 | </th> |
| 221 | 221 | <td> |
| 222 | 222 | <?php |
| 223 | - $system_required = array( 'fname', 'lname', 'email' ); |
|
| 224 | - $disabled = in_array( $QST_system, $system_required ) ? ' disabled="disabled"' : ''; |
|
| 223 | + $system_required = array('fname', 'lname', 'email'); |
|
| 224 | + $disabled = in_array($QST_system, $system_required) ? ' disabled="disabled"' : ''; |
|
| 225 | 225 | $required_on = $question->get('QST_admin_only'); |
| 226 | 226 | $show_required_msg = $required_on ? '' : ' display:none;'; |
| 227 | - $disabled = $required_on || ! empty( $disabled ) ? ' disabled="disabled"' : ''; |
|
| 228 | - $id = ! empty( $disabled ) && in_array( $QST_system, $system_required) ? '_disabled' : ''; |
|
| 229 | - $requiredOptions=array( |
|
| 230 | - array('text'=>'Optional','id'=>0), |
|
| 231 | - array('text'=>'Required','id'=>1) |
|
| 227 | + $disabled = $required_on || ! empty($disabled) ? ' disabled="disabled"' : ''; |
|
| 228 | + $id = ! empty($disabled) && in_array($QST_system, $system_required) ? '_disabled' : ''; |
|
| 229 | + $requiredOptions = array( |
|
| 230 | + array('text'=>'Optional', 'id'=>0), |
|
| 231 | + array('text'=>'Required', 'id'=>1) |
|
| 232 | 232 | ); |
| 233 | - echo EEH_Form_Fields::select_input('QST_required' . $id, $requiredOptions, $question->required(), 'id="QST_required' . $id . '"' . $disabled ); |
|
| 233 | + echo EEH_Form_Fields::select_input('QST_required'.$id, $requiredOptions, $question->required(), 'id="QST_required'.$id.'"'.$disabled); |
|
| 234 | 234 | ?> |
| 235 | 235 | <p><span id="required_toggled_on" class="description" style="color:#D54E21;<?php echo $show_required_msg; ?>"> |
| 236 | - <?php _e('Required is set to optional, and this field is disabled, because the question is Admin-Only.','event_espresso')?> |
|
| 236 | + <?php _e('Required is set to optional, and this field is disabled, because the question is Admin-Only.', 'event_espresso')?> |
|
| 237 | 237 | </span></p> |
| 238 | 238 | <p><span id="required_toggled_off" class="description" style="color:#D54E21; display: none;"> |
| 239 | - <?php _e('Required option field is no longer disabled because the question is not Admin-Only','event_espresso')?> |
|
| 239 | + <?php _e('Required option field is no longer disabled because the question is not Admin-Only', 'event_espresso')?> |
|
| 240 | 240 | </span></p> |
| 241 | - <?php if ( ! empty( $disabled ) && in_array( $QST_system, $system_required ) ) { ?> |
|
| 241 | + <?php if ( ! empty($disabled) && in_array($QST_system, $system_required)) { ?> |
|
| 242 | 242 | <input type="hidden" id="QST_required" name="QST_required" value="1"/> |
| 243 | 243 | <p><span class="description" style="color:#D54E21;"> |
| 244 | - <?php _e('System question! This field cannot be changed.','event_espresso')?> |
|
| 244 | + <?php _e('System question! This field cannot be changed.', 'event_espresso')?> |
|
| 245 | 245 | </span></p> |
| 246 | 246 | <?php } ?> |
| 247 | 247 | |
@@ -250,7 +250,7 @@ discard block |
||
| 250 | 250 | |
| 251 | 251 | <tr> |
| 252 | 252 | <th> |
| 253 | - <label for="QST_required_text"><?php _e('Required Text', 'event_espresso'); ?></label> <?php echo EEH_Template::get_help_tab_link('required_text_info');?> |
|
| 253 | + <label for="QST_required_text"><?php _e('Required Text', 'event_espresso'); ?></label> <?php echo EEH_Template::get_help_tab_link('required_text_info'); ?> |
|
| 254 | 254 | </th> |
| 255 | 255 | <td> |
| 256 | 256 | <input type="text" class="regular-text" id="QST_required_text" name="QST_required_text" value="<?php $question->f('QST_required_text')?>"/> |
@@ -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 | |
| 4 | 6 | class EE_Attendee_Contact_List_Table extends EE_Admin_List_Table { |
@@ -4,7 +4,7 @@ discard block |
||
| 4 | 4 | class EE_Attendee_Contact_List_Table extends EE_Admin_List_Table { |
| 5 | 5 | |
| 6 | 6 | |
| 7 | - public function __construct( $admin_page ) { |
|
| 7 | + public function __construct($admin_page) { |
|
| 8 | 8 | parent::__construct($admin_page); |
| 9 | 9 | } |
| 10 | 10 | |
@@ -12,8 +12,8 @@ discard block |
||
| 12 | 12 | |
| 13 | 13 | |
| 14 | 14 | protected function _setup_data() { |
| 15 | - $this->_data = $this->_view != 'trash' ? $this->_admin_page->get_attendees( $this->_per_page ) : $this->_admin_page->get_attendees( $this->_per_page, FALSE, TRUE ); |
|
| 16 | - $this->_all_data_count = $this->_view != 'trash' ? $this->_admin_page->get_attendees( $this->_per_page, TRUE ) : $this->_admin_page->get_attendees( $this->_per_page,TRUE, TRUE ); |
|
| 15 | + $this->_data = $this->_view != 'trash' ? $this->_admin_page->get_attendees($this->_per_page) : $this->_admin_page->get_attendees($this->_per_page, FALSE, TRUE); |
|
| 16 | + $this->_all_data_count = $this->_view != 'trash' ? $this->_admin_page->get_attendees($this->_per_page, TRUE) : $this->_admin_page->get_attendees($this->_per_page, TRUE, TRUE); |
|
| 17 | 17 | } |
| 18 | 18 | |
| 19 | 19 | |
@@ -41,13 +41,13 @@ discard block |
||
| 41 | 41 | ); |
| 42 | 42 | |
| 43 | 43 | $this->_sortable_columns = array( |
| 44 | - 'ATT_ID' => array( 'ATT_ID' => FALSE ), |
|
| 45 | - 'ATT_lname' => array( 'ATT_lname' => TRUE ), //true means its already sorted |
|
| 46 | - 'ATT_fname' => array( 'ATT_fname' => FALSE ), |
|
| 47 | - 'ATT_email' => array( 'ATT_email' => FALSE ), |
|
| 48 | - 'ATT_city' => array( 'ATT_city' => FALSE ), |
|
| 49 | - 'STA_ID' => array( 'STA_ID' => FALSE ), |
|
| 50 | - 'CNT_ISO' => array( 'CNT_ISO' => FALSE ) |
|
| 44 | + 'ATT_ID' => array('ATT_ID' => FALSE), |
|
| 45 | + 'ATT_lname' => array('ATT_lname' => TRUE), //true means its already sorted |
|
| 46 | + 'ATT_fname' => array('ATT_fname' => FALSE), |
|
| 47 | + 'ATT_email' => array('ATT_email' => FALSE), |
|
| 48 | + 'ATT_city' => array('ATT_city' => FALSE), |
|
| 49 | + 'STA_ID' => array('STA_ID' => FALSE), |
|
| 50 | + 'CNT_ISO' => array('CNT_ISO' => FALSE) |
|
| 51 | 51 | ); |
| 52 | 52 | |
| 53 | 53 | $this->_hidden_columns = array(); |
@@ -64,9 +64,9 @@ discard block |
||
| 64 | 64 | |
| 65 | 65 | |
| 66 | 66 | protected function _add_view_counts() { |
| 67 | - $this->_views['in_use']['count'] = $this->_admin_page->get_attendees( $this->_per_page, TRUE ); |
|
| 68 | - if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_contacts', 'espresso_registrations_delete_registration' ) ) { |
|
| 69 | - $this->_views['trash']['count'] = $this->_admin_page->get_attendees( $this->_per_page,TRUE, TRUE ); |
|
| 67 | + $this->_views['in_use']['count'] = $this->_admin_page->get_attendees($this->_per_page, TRUE); |
|
| 68 | + if (EE_Registry::instance()->CAP->current_user_can('ee_delete_contacts', 'espresso_registrations_delete_registration')) { |
|
| 69 | + $this->_views['trash']['count'] = $this->_admin_page->get_attendees($this->_per_page, TRUE, TRUE); |
|
| 70 | 70 | } |
| 71 | 71 | } |
| 72 | 72 | |
@@ -89,7 +89,7 @@ discard block |
||
| 89 | 89 | |
| 90 | 90 | |
| 91 | 91 | function column_cb($item) { |
| 92 | - return sprintf( '<input type="checkbox" name="checkbox[%1$s]" value="%1$s" />', /* $1%s */ $item->ID() ); |
|
| 92 | + return sprintf('<input type="checkbox" name="checkbox[%1$s]" value="%1$s" />', /* $1%s */ $item->ID()); |
|
| 93 | 93 | } |
| 94 | 94 | |
| 95 | 95 | |
@@ -97,9 +97,9 @@ discard block |
||
| 97 | 97 | |
| 98 | 98 | |
| 99 | 99 | function column_ATT_ID($item) { |
| 100 | - $content = $item->ID(); |
|
| 100 | + $content = $item->ID(); |
|
| 101 | 101 | $attendee_name = $item instanceof EE_Attendee ? $item->full_name() : ''; |
| 102 | - $content .= ' <span class="show-on-mobile-view-only">' . $attendee_name . '</span>'; |
|
| 102 | + $content .= ' <span class="show-on-mobile-view-only">'.$attendee_name.'</span>'; |
|
| 103 | 103 | return $content; |
| 104 | 104 | } |
| 105 | 105 | |
@@ -110,8 +110,8 @@ discard block |
||
| 110 | 110 | function column_ATT_lname($item) { |
| 111 | 111 | |
| 112 | 112 | // edit attendee link |
| 113 | - $edit_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'edit_attendee', 'post'=>$item->ID() ), REG_ADMIN_URL ); |
|
| 114 | - $name_link = EE_Registry::instance()->CAP->current_user_can( 'ee_edit_contacts', 'espresso_registrations_edit_attendee' ) ? '<a href="'.$edit_lnk_url.'" title="' . esc_attr__( 'Edit Contact', 'event_espresso' ) . '">' . $item->lname() . '</a>' : $item->lname(); |
|
| 113 | + $edit_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'edit_attendee', 'post'=>$item->ID()), REG_ADMIN_URL); |
|
| 114 | + $name_link = EE_Registry::instance()->CAP->current_user_can('ee_edit_contacts', 'espresso_registrations_edit_attendee') ? '<a href="'.$edit_lnk_url.'" title="'.esc_attr__('Edit Contact', 'event_espresso').'">'.$item->lname().'</a>' : $item->lname(); |
|
| 115 | 115 | return $name_link; |
| 116 | 116 | |
| 117 | 117 | } |
@@ -124,30 +124,30 @@ discard block |
||
| 124 | 124 | //Build row actions |
| 125 | 125 | $actions = array(); |
| 126 | 126 | // edit attendee link |
| 127 | - if ( EE_Registry::instance()->CAP->current_user_can( 'ee_edit_contacts', 'espresso_registrations_edit_attendee' ) ) { |
|
| 128 | - $edit_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'edit_attendee', 'post'=>$item->ID() ), REG_ADMIN_URL ); |
|
| 129 | - $actions['edit'] = '<a href="'.$edit_lnk_url.'" title="' . esc_attr__( 'Edit Contact', 'event_espresso' ) . '">' . __( 'Edit', 'event_espresso' ) . '</a>'; |
|
| 127 | + if (EE_Registry::instance()->CAP->current_user_can('ee_edit_contacts', 'espresso_registrations_edit_attendee')) { |
|
| 128 | + $edit_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'edit_attendee', 'post'=>$item->ID()), REG_ADMIN_URL); |
|
| 129 | + $actions['edit'] = '<a href="'.$edit_lnk_url.'" title="'.esc_attr__('Edit Contact', 'event_espresso').'">'.__('Edit', 'event_espresso').'</a>'; |
|
| 130 | 130 | } |
| 131 | 131 | |
| 132 | - if ( $this->_view == 'in_use' ) { |
|
| 132 | + if ($this->_view == 'in_use') { |
|
| 133 | 133 | // trash attendee link |
| 134 | - if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_contacts', 'espresso_registrations_trash_attendees' ) ) { |
|
| 135 | - $trash_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'trash_attendees', 'ATT_ID'=>$item->ID() ), REG_ADMIN_URL ); |
|
| 136 | - $actions['trash'] = '<a href="'.$trash_lnk_url.'" title="' . esc_attr__( 'Move Contact to Trash', 'event_espresso' ) . '">' . __( 'Trash', 'event_espresso' ) . '</a>'; |
|
| 134 | + if (EE_Registry::instance()->CAP->current_user_can('ee_delete_contacts', 'espresso_registrations_trash_attendees')) { |
|
| 135 | + $trash_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'trash_attendees', 'ATT_ID'=>$item->ID()), REG_ADMIN_URL); |
|
| 136 | + $actions['trash'] = '<a href="'.$trash_lnk_url.'" title="'.esc_attr__('Move Contact to Trash', 'event_espresso').'">'.__('Trash', 'event_espresso').'</a>'; |
|
| 137 | 137 | } |
| 138 | 138 | } else { |
| 139 | - if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_contacts', 'espresso_registrations_restore_attendees' ) ) { |
|
| 139 | + if (EE_Registry::instance()->CAP->current_user_can('ee_delete_contacts', 'espresso_registrations_restore_attendees')) { |
|
| 140 | 140 | // restore attendee link |
| 141 | - $restore_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'restore_attendees', 'ATT_ID'=>$item->ID() ), REG_ADMIN_URL ); |
|
| 142 | - $actions['restore'] = '<a href="'.$restore_lnk_url.'" title="' . esc_attr__( 'Restore Contact', 'event_espresso' ) . '">' . __( 'Restore', 'event_espresso' ) . '</a>'; |
|
| 141 | + $restore_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'restore_attendees', 'ATT_ID'=>$item->ID()), REG_ADMIN_URL); |
|
| 142 | + $actions['restore'] = '<a href="'.$restore_lnk_url.'" title="'.esc_attr__('Restore Contact', 'event_espresso').'">'.__('Restore', 'event_espresso').'</a>'; |
|
| 143 | 143 | } |
| 144 | 144 | } |
| 145 | 145 | |
| 146 | - $edit_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'edit_attendee', 'post'=>$item->ID() ), REG_ADMIN_URL ); |
|
| 147 | - $name_link = EE_Registry::instance()->CAP->current_user_can( 'ee_edit_contacts', 'espresso_registrations_edit_attendee' ) ? '<a href="'.$edit_lnk_url.'" title="' . esc_attr__( 'Edit Contact', 'event_espresso' ) . '">' . $item->fname() . '</a>' : $item->fname(); |
|
| 146 | + $edit_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'edit_attendee', 'post'=>$item->ID()), REG_ADMIN_URL); |
|
| 147 | + $name_link = EE_Registry::instance()->CAP->current_user_can('ee_edit_contacts', 'espresso_registrations_edit_attendee') ? '<a href="'.$edit_lnk_url.'" title="'.esc_attr__('Edit Contact', 'event_espresso').'">'.$item->fname().'</a>' : $item->fname(); |
|
| 148 | 148 | |
| 149 | 149 | //Return the name contents |
| 150 | - return sprintf('%1$s %2$s', $name_link, $this->row_actions($actions) ); |
|
| 150 | + return sprintf('%1$s %2$s', $name_link, $this->row_actions($actions)); |
|
| 151 | 151 | } |
| 152 | 152 | |
| 153 | 153 | |
@@ -155,7 +155,7 @@ discard block |
||
| 155 | 155 | |
| 156 | 156 | |
| 157 | 157 | function column_ATT_email($item) { |
| 158 | - return '<a href="mailto:' . $item->email() . '">' . $item->email() . '</a>'; |
|
| 158 | + return '<a href="mailto:'.$item->email().'">'.$item->email().'</a>'; |
|
| 159 | 159 | } |
| 160 | 160 | |
| 161 | 161 | |
@@ -175,8 +175,8 @@ discard block |
||
| 175 | 175 | |
| 176 | 176 | function column_STA_ID($item) { |
| 177 | 177 | $states = EEM_State::instance()->get_all_states(); |
| 178 | - $state = isset( $states[ $item->state_ID() ] ) ? $states[ $item->state_ID() ]->get( 'STA_name' ) : $item->state_ID(); |
|
| 179 | - return ! is_numeric( $state ) ? $state : ''; |
|
| 178 | + $state = isset($states[$item->state_ID()]) ? $states[$item->state_ID()]->get('STA_name') : $item->state_ID(); |
|
| 179 | + return ! is_numeric($state) ? $state : ''; |
|
| 180 | 180 | } |
| 181 | 181 | |
| 182 | 182 | |
@@ -184,8 +184,8 @@ discard block |
||
| 184 | 184 | function column_CNT_ISO($item) { |
| 185 | 185 | $countries = EEM_Country::instance()->get_all_countries(); |
| 186 | 186 | //EEH_Debug_Tools::printr( $countries, '$countries <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' ); |
| 187 | - $country = isset( $countries[ $item->country_ID() ] ) ? $countries[ $item->country_ID() ]->get( 'CNT_name' ) : $item->country_ID(); |
|
| 188 | - return ! is_numeric( $country ) ? $country : ''; |
|
| 187 | + $country = isset($countries[$item->country_ID()]) ? $countries[$item->country_ID()]->get('CNT_name') : $item->country_ID(); |
|
| 188 | + return ! is_numeric($country) ? $country : ''; |
|
| 189 | 189 | } |
| 190 | 190 | |
| 191 | 191 | |
@@ -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 | * |
@@ -574,7 +576,7 @@ discard block |
||
| 574 | 576 | if($item->transaction()){ |
| 575 | 577 | $view_txn_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'view_transaction', 'TXN_ID'=>$item->transaction_ID() ), TXN_ADMIN_URL ); |
| 576 | 578 | return EE_Registry::instance()->CAP->current_user_can( 'ee_read_transaction', 'espresso_transactions_view_transaction', $item->transaction_ID() ) ? '<span class="reg-pad-rght"><a class="status-'. $item->transaction()->status_ID() .'" href="'.$view_txn_lnk_url.'" title="' . esc_attr__( 'View Transaction', 'event_espresso' ) . '">' . $item->transaction()->pretty_total() . '</a></span>' : '<span class="reg-pad-rght">' . $item->transaction()->pretty_total() . '</span>'; |
| 577 | - }else{ |
|
| 579 | + } else{ |
|
| 578 | 580 | return __("None", "event_espresso"); |
| 579 | 581 | } |
| 580 | 582 | } |
@@ -332,12 +332,12 @@ discard block |
||
| 332 | 332 | * @param \EE_Registration $item |
| 333 | 333 | * @return string |
| 334 | 334 | */ |
| 335 | - function column_cb($item){ |
|
| 335 | + function column_cb($item){ |
|
| 336 | 336 | /** checkbox/lock **/ |
| 337 | 337 | $transaction = $item->get_first_related( 'Transaction' ); |
| 338 | 338 | $payment_count = $transaction instanceof EE_Transaction ? $transaction->count_related( 'Payment' ) : 0; |
| 339 | 339 | return $payment_count > 0 ? sprintf( '<input type="checkbox" name="_REG_ID[]" value="%1$s" />', $item->ID() ) . '<span class="ee-lock-icon"></span>' : sprintf( '<input type="checkbox" name="_REG_ID[]" value="%1$s" />', $item->ID() ); |
| 340 | - } |
|
| 340 | + } |
|
| 341 | 341 | |
| 342 | 342 | |
| 343 | 343 | |
@@ -371,7 +371,7 @@ discard block |
||
| 371 | 371 | */ |
| 372 | 372 | function column__REG_date(EE_Registration $item){ |
| 373 | 373 | $this->_set_related_details($item); |
| 374 | - //Build row actions |
|
| 374 | + //Build row actions |
|
| 375 | 375 | $view_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'view_transaction', 'TXN_ID'=> $this->_transaction_details['id'] ), TXN_ADMIN_URL ); |
| 376 | 376 | $view_link = EE_Registry::instance()->CAP->current_user_can('ee_read_transaction', 'espresso_transactions_view_transaction') ? '<a class="ee-status-color-' . $this->_transaction_details['status'] . '" href="'.$view_lnk_url.'" title="' . esc_attr( $this->_transaction_details['title_attr'] ) . '">' . $item->get_i18n_datetime( 'REG_date' ) . '</a>' : $item->get_i18n_datetime( 'REG_date' ); |
| 377 | 377 | $view_link .= '<br><span class="ee-status-text-small">' . EEH_Template::pretty_status( $this->_transaction_details['status'], false, 'sentence' ) . '</span>'; |
@@ -423,7 +423,7 @@ discard block |
||
| 423 | 423 | } else { |
| 424 | 424 | return __( 'There is no ticket on this registration', 'event_espresso' ); |
| 425 | 425 | } |
| 426 | - } |
|
| 426 | + } |
|
| 427 | 427 | |
| 428 | 428 | |
| 429 | 429 | |
@@ -445,14 +445,14 @@ discard block |
||
| 445 | 445 | $t = $item->get_first_related('Transaction'); |
| 446 | 446 | $payment_count = $t instanceof EE_Transaction ? $t->count_related('Payment') : 0; |
| 447 | 447 | |
| 448 | - //append group count to name |
|
| 449 | - $link .= ' ' . sprintf(__( '(%1$s / %2$s)', 'event_espresso' ), $item->count(), $item->group_size()); |
|
| 448 | + //append group count to name |
|
| 449 | + $link .= ' ' . sprintf(__( '(%1$s / %2$s)', 'event_espresso' ), $item->count(), $item->group_size()); |
|
| 450 | 450 | |
| 451 | - //append reg_code |
|
| 452 | - $link .= '<br>' . sprintf( __( 'Reg Code: %s', 'event_espresso' ), $item->get('REG_code') ); |
|
| 451 | + //append reg_code |
|
| 452 | + $link .= '<br>' . sprintf( __( 'Reg Code: %s', 'event_espresso' ), $item->get('REG_code') ); |
|
| 453 | 453 | |
| 454 | - //reg status text for accessibility |
|
| 455 | - $link .= '<br><span class="ee-status-text-small">' . EEH_Template::pretty_status( $item->status_ID(), false, 'sentence' ) . '</span>'; |
|
| 454 | + //reg status text for accessibility |
|
| 455 | + $link .= '<br><span class="ee-status-text-small">' . EEH_Template::pretty_status( $item->status_ID(), false, 'sentence' ) . '</span>'; |
|
| 456 | 456 | |
| 457 | 457 | //trash/restore/delete actions |
| 458 | 458 | $actions = array(); |
@@ -57,20 +57,20 @@ discard block |
||
| 57 | 57 | * @param \EE_Admin_Page $admin_page |
| 58 | 58 | * @return EE_Registrations_List_Table |
| 59 | 59 | */ |
| 60 | - function __construct( $admin_page ){ |
|
| 60 | + function __construct($admin_page) { |
|
| 61 | 61 | |
| 62 | - if ( ! empty( $_GET['event_id'] ) ) { |
|
| 62 | + if ( ! empty($_GET['event_id'])) { |
|
| 63 | 63 | $extra_query_args = array(); |
| 64 | - foreach ( $admin_page->get_views() as $key => $view_details ) { |
|
| 65 | - $extra_query_args[$view_details['slug']] = array( 'event_id' => $_GET['event_id'] ); |
|
| 64 | + foreach ($admin_page->get_views() as $key => $view_details) { |
|
| 65 | + $extra_query_args[$view_details['slug']] = array('event_id' => $_GET['event_id']); |
|
| 66 | 66 | } |
| 67 | - $this->_views = $admin_page->get_list_table_view_RLs( $extra_query_args ); |
|
| 67 | + $this->_views = $admin_page->get_list_table_view_RLs($extra_query_args); |
|
| 68 | 68 | } |
| 69 | 69 | |
| 70 | 70 | parent::__construct($admin_page); |
| 71 | 71 | $this->_status = $this->_admin_page->get_registration_status_array(); |
| 72 | 72 | |
| 73 | - EE_Registry::instance()->load_helper( 'Template' ); |
|
| 73 | + EE_Registry::instance()->load_helper('Template'); |
|
| 74 | 74 | } |
| 75 | 75 | |
| 76 | 76 | |
@@ -81,8 +81,8 @@ discard block |
||
| 81 | 81 | * @return void |
| 82 | 82 | */ |
| 83 | 83 | protected function _setup_data() { |
| 84 | - $this->_data = $this->_admin_page->get_registrations( $this->_per_page ); |
|
| 85 | - $this->_all_data_count = $this->_admin_page->get_registrations( $this->_per_page, TRUE, FALSE, FALSE ); |
|
| 84 | + $this->_data = $this->_admin_page->get_registrations($this->_per_page); |
|
| 85 | + $this->_all_data_count = $this->_admin_page->get_registrations($this->_per_page, TRUE, FALSE, FALSE); |
|
| 86 | 86 | } |
| 87 | 87 | |
| 88 | 88 | |
@@ -101,36 +101,36 @@ discard block |
||
| 101 | 101 | ); |
| 102 | 102 | |
| 103 | 103 | |
| 104 | - if ( isset( $_GET['event_id'] )) { |
|
| 104 | + if (isset($_GET['event_id'])) { |
|
| 105 | 105 | $this->_columns = array( |
| 106 | 106 | 'cb' => '<input type="checkbox" />', //Render a checkbox instead of text |
| 107 | - '_REG_ID' => __( 'ID', 'event_espresso' ), |
|
| 108 | - 'ATT_fname' => __( 'Name', 'event_espresso' ), |
|
| 107 | + '_REG_ID' => __('ID', 'event_espresso'), |
|
| 108 | + 'ATT_fname' => __('Name', 'event_espresso'), |
|
| 109 | 109 | 'ATT_email' => __('Email', 'event_espresso'), |
| 110 | - '_REG_date' => __( 'Reg Date', 'event_espresso' ), |
|
| 111 | - 'PRC_amount' => __( 'TKT Price', 'event_espresso' ), |
|
| 112 | - '_REG_final_price' => __( 'Final Price', 'event_espresso' ), |
|
| 113 | - 'TXN_total' => __( 'Total Txn', 'event_espresso' ), |
|
| 110 | + '_REG_date' => __('Reg Date', 'event_espresso'), |
|
| 111 | + 'PRC_amount' => __('TKT Price', 'event_espresso'), |
|
| 112 | + '_REG_final_price' => __('Final Price', 'event_espresso'), |
|
| 113 | + 'TXN_total' => __('Total Txn', 'event_espresso'), |
|
| 114 | 114 | 'TXN_paid' => __('Paid', 'event_espresso'), |
| 115 | - 'actions' => __( 'Actions', 'event_espresso' ) |
|
| 115 | + 'actions' => __('Actions', 'event_espresso') |
|
| 116 | 116 | ); |
| 117 | 117 | $this->_bottom_buttons = array( |
| 118 | 118 | 'report'=> array( |
| 119 | 119 | 'route' => 'registrations_report', |
| 120 | - 'extra_request' => isset( $this->_req_data['event_id'] ) ? array('EVT_ID'=>$this->_req_data['event_id']) : NULL |
|
| 120 | + 'extra_request' => isset($this->_req_data['event_id']) ? array('EVT_ID'=>$this->_req_data['event_id']) : NULL |
|
| 121 | 121 | ), |
| 122 | 122 | ); |
| 123 | 123 | } else { |
| 124 | 124 | $this->_columns = array( |
| 125 | 125 | 'cb' => '<input type="checkbox" />', //Render a checkbox instead of text |
| 126 | - '_REG_ID' => __( 'ID', 'event_espresso' ), |
|
| 127 | - 'ATT_fname' => __( 'Name', 'event_espresso' ), |
|
| 128 | - '_REG_date' => __( 'TXN Date', 'event_espresso' ), |
|
| 129 | - 'event_name' => __( 'Event', 'event_espresso' ), |
|
| 130 | - 'DTT_EVT_start' => __( 'Event Date', 'event_espresso' ), |
|
| 131 | - '_REG_final_price' => __( 'Price', 'event_espresso' ), |
|
| 132 | - '_REG_paid' => __( 'Paid', 'event_espresso' ), |
|
| 133 | - 'actions' => __( 'Actions', 'event_espresso' ) |
|
| 126 | + '_REG_ID' => __('ID', 'event_espresso'), |
|
| 127 | + 'ATT_fname' => __('Name', 'event_espresso'), |
|
| 128 | + '_REG_date' => __('TXN Date', 'event_espresso'), |
|
| 129 | + 'event_name' => __('Event', 'event_espresso'), |
|
| 130 | + 'DTT_EVT_start' => __('Event Date', 'event_espresso'), |
|
| 131 | + '_REG_final_price' => __('Price', 'event_espresso'), |
|
| 132 | + '_REG_paid' => __('Paid', 'event_espresso'), |
|
| 133 | + 'actions' => __('Actions', 'event_espresso') |
|
| 134 | 134 | ); |
| 135 | 135 | $this->_bottom_buttons = array( |
| 136 | 136 | 'report_all'=> array( |
@@ -142,11 +142,11 @@ discard block |
||
| 142 | 142 | $this->_primary_column = '_REG_ID'; |
| 143 | 143 | |
| 144 | 144 | $this->_sortable_columns = array( |
| 145 | - '_REG_date' => array( '_REG_date' => TRUE ), //true means its already sorted |
|
| 146 | - 'ATT_fname' => array( 'ATT_fname' => FALSE ), |
|
| 147 | - 'event_name' => array( 'event_name' => FALSE ), |
|
| 148 | - 'DTT_EVT_start' => array( 'DTT_EVT_start' => FALSE ), |
|
| 149 | - '_REG_ID' => array( '_REG_ID' => FALSE ), |
|
| 145 | + '_REG_date' => array('_REG_date' => TRUE), //true means its already sorted |
|
| 146 | + 'ATT_fname' => array('ATT_fname' => FALSE), |
|
| 147 | + 'event_name' => array('event_name' => FALSE), |
|
| 148 | + 'DTT_EVT_start' => array('DTT_EVT_start' => FALSE), |
|
| 149 | + '_REG_ID' => array('_REG_ID' => FALSE), |
|
| 150 | 150 | ); |
| 151 | 151 | |
| 152 | 152 | $this->_hidden_columns = array(); |
@@ -155,11 +155,11 @@ discard block |
||
| 155 | 155 | |
| 156 | 156 | |
| 157 | 157 | |
| 158 | - protected function _get_row_class( $item ) { |
|
| 159 | - $class = parent::_get_row_class( $item ); |
|
| 158 | + protected function _get_row_class($item) { |
|
| 159 | + $class = parent::_get_row_class($item); |
|
| 160 | 160 | //add status class |
| 161 | - $class .= ' ee-status-strip reg-status-' . $item->status_ID(); |
|
| 162 | - if ( $this->_has_checkbox_column ) { |
|
| 161 | + $class .= ' ee-status-strip reg-status-'.$item->status_ID(); |
|
| 162 | + if ($this->_has_checkbox_column) { |
|
| 163 | 163 | $class .= ' has-checkbox-column'; |
| 164 | 164 | } |
| 165 | 165 | return $class; |
@@ -172,15 +172,15 @@ discard block |
||
| 172 | 172 | * |
| 173 | 173 | * @param EE_Registration $registration |
| 174 | 174 | */ |
| 175 | - protected function _set_related_details( EE_Registration $registration ) { |
|
| 175 | + protected function _set_related_details(EE_Registration $registration) { |
|
| 176 | 176 | |
| 177 | - $transaction = $registration->get_first_related( 'Transaction' ); |
|
| 177 | + $transaction = $registration->get_first_related('Transaction'); |
|
| 178 | 178 | $status = $transaction instanceof EE_Transaction ? $transaction->status_ID() : EEM_Transaction::failed_status_code; |
| 179 | 179 | $this->_transaction_details = array( |
| 180 | 180 | 'transaction' => $transaction, |
| 181 | 181 | 'status' => $status, |
| 182 | 182 | 'id' => $transaction instanceof EE_Transaction ? $transaction->ID() : 0, |
| 183 | - 'title_attr' => sprintf( __('View Transaction Details (%s)', 'event_espresso'), EEH_Template::pretty_status( $status, false, 'sentence' ) ) |
|
| 183 | + 'title_attr' => sprintf(__('View Transaction Details (%s)', 'event_espresso'), EEH_Template::pretty_status($status, false, 'sentence')) |
|
| 184 | 184 | ); |
| 185 | 185 | |
| 186 | 186 | $event = $registration->event(); |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | 'event' => $event, |
| 190 | 190 | 'status' => $status, |
| 191 | 191 | 'id' => $event instanceof EE_Event ? $event->ID() : 0, |
| 192 | - 'title_attr' => sprintf( __('Edit Event (%s)', 'event_espresso'), EEH_Template::pretty_status( $status, false, 'sentence' ) ) |
|
| 192 | + 'title_attr' => sprintf(__('Edit Event (%s)', 'event_espresso'), EEH_Template::pretty_status($status, false, 'sentence')) |
|
| 193 | 193 | ); |
| 194 | 194 | } |
| 195 | 195 | |
@@ -204,26 +204,26 @@ discard block |
||
| 204 | 204 | $filters = array(); |
| 205 | 205 | |
| 206 | 206 | //todo we're currently using old functions here. We need to move things into the Events_Admin_Page() class as methods. |
| 207 | - EE_Registry::instance()->load_helper( 'Form_Fields' ); |
|
| 207 | + EE_Registry::instance()->load_helper('Form_Fields'); |
|
| 208 | 208 | |
| 209 | - $cur_date = isset( $this->_req_data['month_range'] ) ? $this->_req_data['month_range'] : ''; |
|
| 210 | - $cur_category = isset( $this->_req_data['EVT_CAT'] ) ? $this->_req_data['EVT_CAT'] : -1; |
|
| 211 | - $reg_status = isset( $this->_req_data['_reg_status'] ) ? $this->_req_data['_reg_status'] : ''; |
|
| 209 | + $cur_date = isset($this->_req_data['month_range']) ? $this->_req_data['month_range'] : ''; |
|
| 210 | + $cur_category = isset($this->_req_data['EVT_CAT']) ? $this->_req_data['EVT_CAT'] : -1; |
|
| 211 | + $reg_status = isset($this->_req_data['_reg_status']) ? $this->_req_data['_reg_status'] : ''; |
|
| 212 | 212 | |
| 213 | - $filters[] = EEH_Form_Fields::generate_registration_months_dropdown( $cur_date, $reg_status, $cur_category ); |
|
| 214 | - $filters[] = EEH_Form_Fields::generate_event_category_dropdown( $cur_category ); |
|
| 213 | + $filters[] = EEH_Form_Fields::generate_registration_months_dropdown($cur_date, $reg_status, $cur_category); |
|
| 214 | + $filters[] = EEH_Form_Fields::generate_event_category_dropdown($cur_category); |
|
| 215 | 215 | |
| 216 | 216 | $status = array(); |
| 217 | - $status[] = array( 'id' => 0, 'text' => __('Select Status', 'event_espresso') ); |
|
| 218 | - foreach ( $this->_status as $key => $value ) { |
|
| 219 | - $status[] = array( 'id' => $key, 'text' => $value ); |
|
| 217 | + $status[] = array('id' => 0, 'text' => __('Select Status', 'event_espresso')); |
|
| 218 | + foreach ($this->_status as $key => $value) { |
|
| 219 | + $status[] = array('id' => $key, 'text' => $value); |
|
| 220 | 220 | } |
| 221 | - if ( $this->_view != 'incomplete' ) { |
|
| 222 | - $filters[] = EEH_Form_Fields::select_input('_reg_status', $status, isset( $this->_req_data['_reg_status'] ) ? strtoupper( sanitize_key( $this->_req_data['_reg_status'] )) : '' ); |
|
| 221 | + if ($this->_view != 'incomplete') { |
|
| 222 | + $filters[] = EEH_Form_Fields::select_input('_reg_status', $status, isset($this->_req_data['_reg_status']) ? strtoupper(sanitize_key($this->_req_data['_reg_status'])) : ''); |
|
| 223 | 223 | } |
| 224 | 224 | |
| 225 | - if ( isset( $this->_req_data['event_id'] ) ) { |
|
| 226 | - $filters[] = EEH_Form_Fields::hidden_input( 'event_id', $this->_req_data['event_id'], 'reg_event_id' ); |
|
| 225 | + if (isset($this->_req_data['event_id'])) { |
|
| 226 | + $filters[] = EEH_Form_Fields::hidden_input('event_id', $this->_req_data['event_id'], 'reg_event_id'); |
|
| 227 | 227 | } |
| 228 | 228 | |
| 229 | 229 | return $filters; |
@@ -240,9 +240,9 @@ discard block |
||
| 240 | 240 | $this->_views['all']['count'] = $this->_total_registrations(); |
| 241 | 241 | $this->_views['month']['count'] = $this->_total_registrations_this_month(); |
| 242 | 242 | $this->_views['today']['count'] = $this->_total_registrations_today(); |
| 243 | - if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_registrations', 'espresso_registrations_trash_registrations' ) ) { |
|
| 244 | - $this->_views['incomplete']['count'] = $this->_total_registrations( 'incomplete' ); |
|
| 245 | - $this->_views['trash']['count'] = $this->_total_registrations( 'trash' ); |
|
| 243 | + if (EE_Registry::instance()->CAP->current_user_can('ee_delete_registrations', 'espresso_registrations_trash_registrations')) { |
|
| 244 | + $this->_views['incomplete']['count'] = $this->_total_registrations('incomplete'); |
|
| 245 | + $this->_views['trash']['count'] = $this->_total_registrations('trash'); |
|
| 246 | 246 | } |
| 247 | 247 | } |
| 248 | 248 | |
@@ -254,23 +254,23 @@ discard block |
||
| 254 | 254 | * @param string $view |
| 255 | 255 | * @return int |
| 256 | 256 | */ |
| 257 | - protected function _total_registrations( $view = '' ){ |
|
| 257 | + protected function _total_registrations($view = '') { |
|
| 258 | 258 | $_where = array(); |
| 259 | - $EVT_ID = isset( $this->_req_data['event_id'] ) ? absint( $this->_req_data['event_id'] ) : FALSE; |
|
| 260 | - if( $EVT_ID ) { |
|
| 259 | + $EVT_ID = isset($this->_req_data['event_id']) ? absint($this->_req_data['event_id']) : FALSE; |
|
| 260 | + if ($EVT_ID) { |
|
| 261 | 261 | $_where['EVT_ID'] = $EVT_ID; |
| 262 | 262 | } |
| 263 | - switch ( $view ) { |
|
| 263 | + switch ($view) { |
|
| 264 | 264 | case 'trash' : |
| 265 | - return EEM_Registration::instance()->count_deleted( array( $_where )); |
|
| 265 | + return EEM_Registration::instance()->count_deleted(array($_where)); |
|
| 266 | 266 | break; |
| 267 | 267 | case 'incomplete' : |
| 268 | 268 | $_where['STS_ID'] = EEM_Registration::status_id_incomplete; |
| 269 | 269 | break; |
| 270 | 270 | default : |
| 271 | - $_where['STS_ID'] = array( '!=', EEM_Registration::status_id_incomplete ); |
|
| 271 | + $_where['STS_ID'] = array('!=', EEM_Registration::status_id_incomplete); |
|
| 272 | 272 | } |
| 273 | - return EEM_Registration::instance()->count( array( $_where )); |
|
| 273 | + return EEM_Registration::instance()->count(array($_where)); |
|
| 274 | 274 | } |
| 275 | 275 | |
| 276 | 276 | |
@@ -280,24 +280,24 @@ discard block |
||
| 280 | 280 | * @access protected |
| 281 | 281 | * @return int |
| 282 | 282 | */ |
| 283 | - protected function _total_registrations_this_month(){ |
|
| 284 | - $EVT_ID = isset( $this->_req_data['event_id'] ) ? absint( $this->_req_data['event_id'] ) : FALSE; |
|
| 285 | - $_where = $EVT_ID ? array( 'EVT_ID' => $EVT_ID ) : array(); |
|
| 283 | + protected function _total_registrations_this_month() { |
|
| 284 | + $EVT_ID = isset($this->_req_data['event_id']) ? absint($this->_req_data['event_id']) : FALSE; |
|
| 285 | + $_where = $EVT_ID ? array('EVT_ID' => $EVT_ID) : array(); |
|
| 286 | 286 | $this_year_r = date('Y', current_time('timestamp')); |
| 287 | 287 | $time_start = ' 00:00:00'; |
| 288 | 288 | $time_end = ' 23:59:59'; |
| 289 | 289 | $this_month_r = date('m', current_time('timestamp')); |
| 290 | - $days_this_month = date( 't', current_time('timestamp') ); |
|
| 290 | + $days_this_month = date('t', current_time('timestamp')); |
|
| 291 | 291 | //setup date query. |
| 292 | - $beginning_string = EEM_Registration::instance()->convert_datetime_for_query( 'REG_date', $this_year_r . '-' . $this_month_r . '-01' . ' ' . $time_start, 'Y-m-d H:i:s' ); |
|
| 293 | - $end_string = EEM_Registration::instance()->convert_datetime_for_query( 'REG_date', $this_year_r . '-' . $this_month_r . '-' . $days_this_month . ' ' . $time_end, 'Y-m-d H:i:s' ); |
|
| 294 | - $_where['REG_date']= array('BETWEEN', |
|
| 292 | + $beginning_string = EEM_Registration::instance()->convert_datetime_for_query('REG_date', $this_year_r.'-'.$this_month_r.'-01'.' '.$time_start, 'Y-m-d H:i:s'); |
|
| 293 | + $end_string = EEM_Registration::instance()->convert_datetime_for_query('REG_date', $this_year_r.'-'.$this_month_r.'-'.$days_this_month.' '.$time_end, 'Y-m-d H:i:s'); |
|
| 294 | + $_where['REG_date'] = array('BETWEEN', |
|
| 295 | 295 | array( |
| 296 | 296 | $beginning_string, |
| 297 | 297 | $end_string |
| 298 | 298 | )); |
| 299 | - $_where['STS_ID'] = array( '!=', EEM_Registration::status_id_incomplete ); |
|
| 300 | - return EEM_Registration::instance()->count(array( $_where ) ); |
|
| 299 | + $_where['STS_ID'] = array('!=', EEM_Registration::status_id_incomplete); |
|
| 300 | + return EEM_Registration::instance()->count(array($_where)); |
|
| 301 | 301 | } |
| 302 | 302 | |
| 303 | 303 | |
@@ -307,20 +307,20 @@ discard block |
||
| 307 | 307 | * @access protected |
| 308 | 308 | * @return int |
| 309 | 309 | */ |
| 310 | - protected function _total_registrations_today(){ |
|
| 310 | + protected function _total_registrations_today() { |
|
| 311 | 311 | |
| 312 | - $EVT_ID = isset( $this->_req_data['event_id'] ) ? absint( $this->_req_data['event_id'] ) : FALSE; |
|
| 313 | - $_where = $EVT_ID ? array( 'EVT_ID' => $EVT_ID ) : array(); |
|
| 312 | + $EVT_ID = isset($this->_req_data['event_id']) ? absint($this->_req_data['event_id']) : FALSE; |
|
| 313 | + $_where = $EVT_ID ? array('EVT_ID' => $EVT_ID) : array(); |
|
| 314 | 314 | $current_date = date('Y-m-d', current_time('timestamp')); |
| 315 | 315 | $time_start = ' 00:00:00'; |
| 316 | 316 | $time_end = ' 23:59:59'; |
| 317 | - $_where['REG_date']= array('BETWEEN', |
|
| 317 | + $_where['REG_date'] = array('BETWEEN', |
|
| 318 | 318 | array( |
| 319 | - EEM_Registration::instance()->convert_datetime_for_query( 'REG_date', $current_date . $time_start, 'Y-m-d H:i:s' ), |
|
| 320 | - EEM_Registration::instance()->convert_datetime_for_query( 'REG_date', $current_date . $time_end, 'Y-m-d H:i:s' ) |
|
| 319 | + EEM_Registration::instance()->convert_datetime_for_query('REG_date', $current_date.$time_start, 'Y-m-d H:i:s'), |
|
| 320 | + EEM_Registration::instance()->convert_datetime_for_query('REG_date', $current_date.$time_end, 'Y-m-d H:i:s') |
|
| 321 | 321 | )); |
| 322 | - $_where['STS_ID'] = array( '!=', EEM_Registration::status_id_incomplete ); |
|
| 323 | - return EEM_Registration::instance()->count(array( $_where ) ); |
|
| 322 | + $_where['STS_ID'] = array('!=', EEM_Registration::status_id_incomplete); |
|
| 323 | + return EEM_Registration::instance()->count(array($_where)); |
|
| 324 | 324 | } |
| 325 | 325 | |
| 326 | 326 | |
@@ -332,11 +332,11 @@ discard block |
||
| 332 | 332 | * @param \EE_Registration $item |
| 333 | 333 | * @return string |
| 334 | 334 | */ |
| 335 | - function column_cb($item){ |
|
| 335 | + function column_cb($item) { |
|
| 336 | 336 | /** checkbox/lock **/ |
| 337 | - $transaction = $item->get_first_related( 'Transaction' ); |
|
| 338 | - $payment_count = $transaction instanceof EE_Transaction ? $transaction->count_related( 'Payment' ) : 0; |
|
| 339 | - return $payment_count > 0 ? sprintf( '<input type="checkbox" name="_REG_ID[]" value="%1$s" />', $item->ID() ) . '<span class="ee-lock-icon"></span>' : sprintf( '<input type="checkbox" name="_REG_ID[]" value="%1$s" />', $item->ID() ); |
|
| 337 | + $transaction = $item->get_first_related('Transaction'); |
|
| 338 | + $payment_count = $transaction instanceof EE_Transaction ? $transaction->count_related('Payment') : 0; |
|
| 339 | + return $payment_count > 0 ? sprintf('<input type="checkbox" name="_REG_ID[]" value="%1$s" />', $item->ID()).'<span class="ee-lock-icon"></span>' : sprintf('<input type="checkbox" name="_REG_ID[]" value="%1$s" />', $item->ID()); |
|
| 340 | 340 | } |
| 341 | 341 | |
| 342 | 342 | |
@@ -348,14 +348,14 @@ discard block |
||
| 348 | 348 | * @param \EE_Registration $item |
| 349 | 349 | * @return string |
| 350 | 350 | */ |
| 351 | - function column__REG_ID(EE_Registration $item){ |
|
| 351 | + function column__REG_ID(EE_Registration $item) { |
|
| 352 | 352 | $attendee = $item->attendee(); |
| 353 | 353 | $content = $item->ID(); |
| 354 | 354 | $content .= '<div class="show-on-mobile-view-only">'; |
| 355 | 355 | $content .= '<br>'; |
| 356 | 356 | $content .= $attendee instanceof EE_Attendee ? $attendee->full_name() : ''; |
| 357 | - $content .= ' ' . sprintf(__( '(%1$s / %2$s)', 'event_espresso' ), $item->count(), $item->group_size()); |
|
| 358 | - $content .= '<br>' . sprintf( __( 'Reg Code: %s', 'event_espresso' ), $item->get('REG_code') ); |
|
| 357 | + $content .= ' '.sprintf(__('(%1$s / %2$s)', 'event_espresso'), $item->count(), $item->group_size()); |
|
| 358 | + $content .= '<br>'.sprintf(__('Reg Code: %s', 'event_espresso'), $item->get('REG_code')); |
|
| 359 | 359 | $content .= '</div>'; |
| 360 | 360 | return $content; |
| 361 | 361 | } |
@@ -369,12 +369,12 @@ discard block |
||
| 369 | 369 | * @param \EE_Registration $item |
| 370 | 370 | * @return string |
| 371 | 371 | */ |
| 372 | - function column__REG_date(EE_Registration $item){ |
|
| 372 | + function column__REG_date(EE_Registration $item) { |
|
| 373 | 373 | $this->_set_related_details($item); |
| 374 | 374 | //Build row actions |
| 375 | - $view_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'view_transaction', 'TXN_ID'=> $this->_transaction_details['id'] ), TXN_ADMIN_URL ); |
|
| 376 | - $view_link = EE_Registry::instance()->CAP->current_user_can('ee_read_transaction', 'espresso_transactions_view_transaction') ? '<a class="ee-status-color-' . $this->_transaction_details['status'] . '" href="'.$view_lnk_url.'" title="' . esc_attr( $this->_transaction_details['title_attr'] ) . '">' . $item->get_i18n_datetime( 'REG_date' ) . '</a>' : $item->get_i18n_datetime( 'REG_date' ); |
|
| 377 | - $view_link .= '<br><span class="ee-status-text-small">' . EEH_Template::pretty_status( $this->_transaction_details['status'], false, 'sentence' ) . '</span>'; |
|
| 375 | + $view_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'view_transaction', 'TXN_ID'=> $this->_transaction_details['id']), TXN_ADMIN_URL); |
|
| 376 | + $view_link = EE_Registry::instance()->CAP->current_user_can('ee_read_transaction', 'espresso_transactions_view_transaction') ? '<a class="ee-status-color-'.$this->_transaction_details['status'].'" href="'.$view_lnk_url.'" title="'.esc_attr($this->_transaction_details['title_attr']).'">'.$item->get_i18n_datetime('REG_date').'</a>' : $item->get_i18n_datetime('REG_date'); |
|
| 377 | + $view_link .= '<br><span class="ee-status-text-small">'.EEH_Template::pretty_status($this->_transaction_details['status'], false, 'sentence').'</span>'; |
|
| 378 | 378 | return $view_link; |
| 379 | 379 | } |
| 380 | 380 | |
@@ -387,18 +387,18 @@ discard block |
||
| 387 | 387 | * @param \EE_Registration $item |
| 388 | 388 | * @return string |
| 389 | 389 | */ |
| 390 | - function column_event_name(EE_Registration $item){ |
|
| 391 | - $this->_set_related_details( $item ); |
|
| 390 | + function column_event_name(EE_Registration $item) { |
|
| 391 | + $this->_set_related_details($item); |
|
| 392 | 392 | // page=espresso_events&action=edit_event&EVT_ID=2&edit_event_nonce=cf3a7e5b62 |
| 393 | - $edit_event_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'edit', 'post'=>$item->event_ID() ), EVENTS_ADMIN_URL ); |
|
| 393 | + $edit_event_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'edit', 'post'=>$item->event_ID()), EVENTS_ADMIN_URL); |
|
| 394 | 394 | $event_name = $item->event_name(); |
| 395 | 395 | $event_name = $event_name ? $event_name : __("No Associated Event", 'event_espresso'); |
| 396 | - $edit_event = EE_Registry::instance()->CAP->current_user_can('ee_edit_event', 'edit_event', $item->event_ID() ) ? '<a class="ee-status-color-' . $this->_event_details['status'] . '" href="' . $edit_event_url . '" title="' . esc_attr( $this->_event_details['title_attr'] ) .'">' . wp_trim_words( $event_name, 30, '...' ) . '</a>' : wp_trim_words( $event_name, 30, '...' ) ; |
|
| 396 | + $edit_event = EE_Registry::instance()->CAP->current_user_can('ee_edit_event', 'edit_event', $item->event_ID()) ? '<a class="ee-status-color-'.$this->_event_details['status'].'" href="'.$edit_event_url.'" title="'.esc_attr($this->_event_details['title_attr']).'">'.wp_trim_words($event_name, 30, '...').'</a>' : wp_trim_words($event_name, 30, '...'); |
|
| 397 | 397 | |
| 398 | - $edit_event_url = EE_Admin_Page::add_query_args_and_nonce( array( 'event_id'=>$item->event_ID() ), REG_ADMIN_URL ); |
|
| 399 | - $actions['event_filter'] = '<a href="' . $edit_event_url . '" title="' . sprintf( esc_attr__( 'Filter this list to only show registrations for %s', 'event_espresso' ), $event_name ) .'">' . __( 'View Registrations', 'event_espresso' ) . '</a>'; |
|
| 398 | + $edit_event_url = EE_Admin_Page::add_query_args_and_nonce(array('event_id'=>$item->event_ID()), REG_ADMIN_URL); |
|
| 399 | + $actions['event_filter'] = '<a href="'.$edit_event_url.'" title="'.sprintf(esc_attr__('Filter this list to only show registrations for %s', 'event_espresso'), $event_name).'">'.__('View Registrations', 'event_espresso').'</a>'; |
|
| 400 | 400 | |
| 401 | - return sprintf('%1$s %2$s', $edit_event, $this->row_actions($actions) ); |
|
| 401 | + return sprintf('%1$s %2$s', $edit_event, $this->row_actions($actions)); |
|
| 402 | 402 | } |
| 403 | 403 | |
| 404 | 404 | |
@@ -410,18 +410,18 @@ discard block |
||
| 410 | 410 | * @param \EE_Registration $item |
| 411 | 411 | * @return string |
| 412 | 412 | */ |
| 413 | - function column_DTT_EVT_start(EE_Registration $item){ |
|
| 413 | + function column_DTT_EVT_start(EE_Registration $item) { |
|
| 414 | 414 | $datetime_strings = array(); |
| 415 | - $ticket = $item->ticket( TRUE ); |
|
| 416 | - if ( $ticket instanceof EE_Ticket ) { |
|
| 415 | + $ticket = $item->ticket(TRUE); |
|
| 416 | + if ($ticket instanceof EE_Ticket) { |
|
| 417 | 417 | $remove_defaults = array('default_where_conditions' => 'none'); |
| 418 | 418 | $datetimes = $ticket->datetimes($remove_defaults); |
| 419 | - foreach($datetimes as $datetime){ |
|
| 420 | - $datetime_strings[] = $datetime->get_i18n_datetime( 'DTT_EVT_start' ); |
|
| 419 | + foreach ($datetimes as $datetime) { |
|
| 420 | + $datetime_strings[] = $datetime->get_i18n_datetime('DTT_EVT_start'); |
|
| 421 | 421 | } |
| 422 | - return implode("<br />",$datetime_strings); |
|
| 422 | + return implode("<br />", $datetime_strings); |
|
| 423 | 423 | } else { |
| 424 | - return __( 'There is no ticket on this registration', 'event_espresso' ); |
|
| 424 | + return __('There is no ticket on this registration', 'event_espresso'); |
|
| 425 | 425 | } |
| 426 | 426 | } |
| 427 | 427 | |
@@ -434,45 +434,45 @@ discard block |
||
| 434 | 434 | * @param \EE_Registration $item |
| 435 | 435 | * @return string |
| 436 | 436 | */ |
| 437 | - function column_ATT_fname(EE_Registration $item){ |
|
| 437 | + function column_ATT_fname(EE_Registration $item) { |
|
| 438 | 438 | $attendee = $item->attendee(); |
| 439 | 439 | |
| 440 | - $edit_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'view_registration', '_REG_ID'=>$item->ID() ), REG_ADMIN_URL ); |
|
| 440 | + $edit_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'view_registration', '_REG_ID'=>$item->ID()), REG_ADMIN_URL); |
|
| 441 | 441 | $attendee_name = $attendee instanceof EE_Attendee ? $attendee->full_name() : ''; |
| 442 | - $link = EE_Registry::instance()->CAP->current_user_can('ee_read_registration', 'espresso_registrations_view_registration', $item->ID() ) ? '<a href="'.$edit_lnk_url.'" title="' . esc_attr__( 'View Registration Details', 'event_espresso' ) . '">' . $attendee_name . '</a>' : $attendee_name; |
|
| 442 | + $link = EE_Registry::instance()->CAP->current_user_can('ee_read_registration', 'espresso_registrations_view_registration', $item->ID()) ? '<a href="'.$edit_lnk_url.'" title="'.esc_attr__('View Registration Details', 'event_espresso').'">'.$attendee_name.'</a>' : $attendee_name; |
|
| 443 | 443 | $link .= $item->count() == 1 ? ' <sup><div class="dashicons dashicons-star-filled lt-blue-icon ee-icon-size-8"></div></sup>' : ''; |
| 444 | 444 | |
| 445 | 445 | $t = $item->get_first_related('Transaction'); |
| 446 | 446 | $payment_count = $t instanceof EE_Transaction ? $t->count_related('Payment') : 0; |
| 447 | 447 | |
| 448 | 448 | //append group count to name |
| 449 | - $link .= ' ' . sprintf(__( '(%1$s / %2$s)', 'event_espresso' ), $item->count(), $item->group_size()); |
|
| 449 | + $link .= ' '.sprintf(__('(%1$s / %2$s)', 'event_espresso'), $item->count(), $item->group_size()); |
|
| 450 | 450 | |
| 451 | 451 | //append reg_code |
| 452 | - $link .= '<br>' . sprintf( __( 'Reg Code: %s', 'event_espresso' ), $item->get('REG_code') ); |
|
| 452 | + $link .= '<br>'.sprintf(__('Reg Code: %s', 'event_espresso'), $item->get('REG_code')); |
|
| 453 | 453 | |
| 454 | 454 | //reg status text for accessibility |
| 455 | - $link .= '<br><span class="ee-status-text-small">' . EEH_Template::pretty_status( $item->status_ID(), false, 'sentence' ) . '</span>'; |
|
| 455 | + $link .= '<br><span class="ee-status-text-small">'.EEH_Template::pretty_status($item->status_ID(), false, 'sentence').'</span>'; |
|
| 456 | 456 | |
| 457 | 457 | //trash/restore/delete actions |
| 458 | 458 | $actions = array(); |
| 459 | - if ( $this->_view != 'trash' && $payment_count === 0 && EE_Registry::instance()->CAP->current_user_can( 'ee_delete_registration', 'espresso_registrations_trash_registrations', $item->ID() ) ) { |
|
| 460 | - $trash_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'trash_registrations', '_REG_ID'=>$item->ID() ), REG_ADMIN_URL ); |
|
| 461 | - $actions['trash'] = '<a href="'.$trash_lnk_url.'" title="' . esc_attr__( 'Trash Registration', 'event_espresso' ) . '">' . __( 'Trash', 'event_espresso' ) . '</a>'; |
|
| 462 | - } elseif ( $this->_view == 'trash' ) { |
|
| 459 | + if ($this->_view != 'trash' && $payment_count === 0 && EE_Registry::instance()->CAP->current_user_can('ee_delete_registration', 'espresso_registrations_trash_registrations', $item->ID())) { |
|
| 460 | + $trash_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'trash_registrations', '_REG_ID'=>$item->ID()), REG_ADMIN_URL); |
|
| 461 | + $actions['trash'] = '<a href="'.$trash_lnk_url.'" title="'.esc_attr__('Trash Registration', 'event_espresso').'">'.__('Trash', 'event_espresso').'</a>'; |
|
| 462 | + } elseif ($this->_view == 'trash') { |
|
| 463 | 463 | // restore registration link |
| 464 | - if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_registration', 'espresso_registrations_restore_registrations', $item->ID() ) ) { |
|
| 465 | - $restore_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'restore_registrations', '_REG_ID'=>$item->ID() ), REG_ADMIN_URL ); |
|
| 466 | - $actions['restore'] = '<a href="'.$restore_lnk_url.'" title="' . esc_attr__( 'Restore Registration', 'event_espresso' ) . '">' . __( 'Restore', 'event_espresso' ) . '</a>'; |
|
| 464 | + if (EE_Registry::instance()->CAP->current_user_can('ee_delete_registration', 'espresso_registrations_restore_registrations', $item->ID())) { |
|
| 465 | + $restore_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'restore_registrations', '_REG_ID'=>$item->ID()), REG_ADMIN_URL); |
|
| 466 | + $actions['restore'] = '<a href="'.$restore_lnk_url.'" title="'.esc_attr__('Restore Registration', 'event_espresso').'">'.__('Restore', 'event_espresso').'</a>'; |
|
| 467 | 467 | } |
| 468 | - if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_registration', 'espresso_registrations_ee_delete_registrations', $item->ID() ) ) { |
|
| 469 | - $delete_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'delete_registrations', '_REG_ID'=>$item->ID() ), REG_ADMIN_URL ); |
|
| 468 | + if (EE_Registry::instance()->CAP->current_user_can('ee_delete_registration', 'espresso_registrations_ee_delete_registrations', $item->ID())) { |
|
| 469 | + $delete_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'delete_registrations', '_REG_ID'=>$item->ID()), REG_ADMIN_URL); |
|
| 470 | 470 | |
| 471 | - $actions['delete'] = '<a href="'.$delete_lnk_url.'" title="' . esc_attr__( 'Delete Registration Permanently', 'event_espresso' ). '">' . __( 'Delete', 'event_espresso' ) . '</a>'; |
|
| 471 | + $actions['delete'] = '<a href="'.$delete_lnk_url.'" title="'.esc_attr__('Delete Registration Permanently', 'event_espresso').'">'.__('Delete', 'event_espresso').'</a>'; |
|
| 472 | 472 | } |
| 473 | 473 | } |
| 474 | 474 | |
| 475 | - return sprintf('%1$s %2$s', $link, $this->row_actions($actions) ); |
|
| 475 | + return sprintf('%1$s %2$s', $link, $this->row_actions($actions)); |
|
| 476 | 476 | } |
| 477 | 477 | |
| 478 | 478 | |
@@ -484,7 +484,7 @@ discard block |
||
| 484 | 484 | * @param \EE_Registration $item |
| 485 | 485 | * @return string |
| 486 | 486 | */ |
| 487 | - function column_ATT_email( EE_Registration $item ) { |
|
| 487 | + function column_ATT_email(EE_Registration $item) { |
|
| 488 | 488 | $attendee = $item->get_first_related('Attendee'); |
| 489 | 489 | return ! $attendee instanceof EE_Attendee ? __('No attached contact record.', 'event_espresso') : $attendee->email(); |
| 490 | 490 | } |
@@ -498,8 +498,8 @@ discard block |
||
| 498 | 498 | * @param \EE_Registration $item |
| 499 | 499 | * @return string |
| 500 | 500 | */ |
| 501 | - function column__REG_count(EE_Registration $item){ |
|
| 502 | - return sprintf(__( '%1$s / %2$s', 'event_espresso' ), $item->count(), $item->group_size()); |
|
| 501 | + function column__REG_count(EE_Registration $item) { |
|
| 502 | + return sprintf(__('%1$s / %2$s', 'event_espresso'), $item->count(), $item->group_size()); |
|
| 503 | 503 | } |
| 504 | 504 | |
| 505 | 505 | |
@@ -511,16 +511,16 @@ discard block |
||
| 511 | 511 | * @param \EE_Registration $item |
| 512 | 512 | * @return string |
| 513 | 513 | */ |
| 514 | - function column_PRC_amount(EE_Registration $item){ |
|
| 514 | + function column_PRC_amount(EE_Registration $item) { |
|
| 515 | 515 | $ticket = $item->ticket(); |
| 516 | 516 | |
| 517 | - $content = isset( $_GET['event_id'] ) && $ticket instanceof EE_Ticket ? '<span class="TKT_name">' . $ticket->name() . '</span><br />' : ''; |
|
| 517 | + $content = isset($_GET['event_id']) && $ticket instanceof EE_Ticket ? '<span class="TKT_name">'.$ticket->name().'</span><br />' : ''; |
|
| 518 | 518 | |
| 519 | - if ( $item->final_price() > 0 ) { |
|
| 520 | - $content .= '<span class="reg-pad-rght">' . $item->pretty_final_price() . '</span>'; |
|
| 519 | + if ($item->final_price() > 0) { |
|
| 520 | + $content .= '<span class="reg-pad-rght">'.$item->pretty_final_price().'</span>'; |
|
| 521 | 521 | } else { |
| 522 | 522 | // free event |
| 523 | - $content .= '<span class="reg-overview-free-event-spn reg-pad-rght">' . __( 'free', 'event_espresso' ) . '</span>'; |
|
| 523 | + $content .= '<span class="reg-overview-free-event-spn reg-pad-rght">'.__('free', 'event_espresso').'</span>'; |
|
| 524 | 524 | } |
| 525 | 525 | |
| 526 | 526 | return $content; |
@@ -536,11 +536,11 @@ discard block |
||
| 536 | 536 | * @param \EE_Registration $item |
| 537 | 537 | * @return string |
| 538 | 538 | */ |
| 539 | - function column__REG_final_price(EE_Registration $item){ |
|
| 539 | + function column__REG_final_price(EE_Registration $item) { |
|
| 540 | 540 | $ticket = $item->ticket(); |
| 541 | - $content = isset( $_GET['event_id'] ) || ! $ticket instanceof EE_Ticket ? '' : '<span class="TKT_name">' . $ticket->name() . '</span><br />'; |
|
| 541 | + $content = isset($_GET['event_id']) || ! $ticket instanceof EE_Ticket ? '' : '<span class="TKT_name">'.$ticket->name().'</span><br />'; |
|
| 542 | 542 | |
| 543 | - $content .= '<span class="reg-pad-rght">' . $item->pretty_final_price() . '</span>'; |
|
| 543 | + $content .= '<span class="reg-pad-rght">'.$item->pretty_final_price().'</span>'; |
|
| 544 | 544 | return $content; |
| 545 | 545 | |
| 546 | 546 | } |
@@ -554,8 +554,8 @@ discard block |
||
| 554 | 554 | * @param \EE_Registration $item |
| 555 | 555 | * @return string |
| 556 | 556 | */ |
| 557 | - function column__REG_paid(EE_Registration $item){ |
|
| 558 | - return '<span class="reg-pad-rght">' . $item->pretty_paid() . '</span>'; |
|
| 557 | + function column__REG_paid(EE_Registration $item) { |
|
| 558 | + return '<span class="reg-pad-rght">'.$item->pretty_paid().'</span>'; |
|
| 559 | 559 | } |
| 560 | 560 | |
| 561 | 561 | |
@@ -567,11 +567,11 @@ discard block |
||
| 567 | 567 | * @param \EE_Registration $item |
| 568 | 568 | * @return string |
| 569 | 569 | */ |
| 570 | - function column_TXN_total(EE_Registration $item){ |
|
| 571 | - if($item->transaction()){ |
|
| 572 | - $view_txn_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'view_transaction', 'TXN_ID'=>$item->transaction_ID() ), TXN_ADMIN_URL ); |
|
| 573 | - return EE_Registry::instance()->CAP->current_user_can( 'ee_read_transaction', 'espresso_transactions_view_transaction', $item->transaction_ID() ) ? '<span class="reg-pad-rght"><a class="status-'. $item->transaction()->status_ID() .'" href="'.$view_txn_lnk_url.'" title="' . esc_attr__( 'View Transaction', 'event_espresso' ) . '">' . $item->transaction()->pretty_total() . '</a></span>' : '<span class="reg-pad-rght">' . $item->transaction()->pretty_total() . '</span>'; |
|
| 574 | - }else{ |
|
| 570 | + function column_TXN_total(EE_Registration $item) { |
|
| 571 | + if ($item->transaction()) { |
|
| 572 | + $view_txn_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'view_transaction', 'TXN_ID'=>$item->transaction_ID()), TXN_ADMIN_URL); |
|
| 573 | + return EE_Registry::instance()->CAP->current_user_can('ee_read_transaction', 'espresso_transactions_view_transaction', $item->transaction_ID()) ? '<span class="reg-pad-rght"><a class="status-'.$item->transaction()->status_ID().'" href="'.$view_txn_lnk_url.'" title="'.esc_attr__('View Transaction', 'event_espresso').'">'.$item->transaction()->pretty_total().'</a></span>' : '<span class="reg-pad-rght">'.$item->transaction()->pretty_total().'</span>'; |
|
| 574 | + } else { |
|
| 575 | 575 | return __("None", "event_espresso"); |
| 576 | 576 | } |
| 577 | 577 | } |
@@ -585,15 +585,15 @@ discard block |
||
| 585 | 585 | * @param \EE_Registration $item |
| 586 | 586 | * @return string |
| 587 | 587 | */ |
| 588 | - function column_TXN_paid(EE_Registration $item){ |
|
| 588 | + function column_TXN_paid(EE_Registration $item) { |
|
| 589 | 589 | |
| 590 | - if ( $item->count() == 1 ) { |
|
| 590 | + if ($item->count() == 1) { |
|
| 591 | 591 | $transaction = $item->transaction() ? $item->transaction() : EE_Transaction::new_instance(); |
| 592 | - if ( $transaction->paid() >= $transaction->total() ) { |
|
| 592 | + if ($transaction->paid() >= $transaction->total()) { |
|
| 593 | 593 | return '<span class="reg-pad-rght"><div class="dashicons dashicons-yes green-icon"></div></span>'; |
| 594 | 594 | } else { |
| 595 | - $view_txn_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'view_transaction', 'TXN_ID'=>$item->transaction_ID() ), TXN_ADMIN_URL ); |
|
| 596 | - return EE_Registry::instance()->CAP->current_user_can('ee_read_transaction', 'espresso_transactions_view_transaction', $item->transaction_ID() ) ? '<span class="reg-pad-rght"><a class="status-'. $transaction->status_ID() .'" href="'.$view_txn_lnk_url.'" title="' . esc_attr__( 'View Transaction', 'event_espresso' ) . '">' . $item->transaction()->pretty_paid() . '</a><span>' : '<span class="reg-pad-rght">' . $item->transaction()->pretty_paid() . '</span>'; |
|
| 595 | + $view_txn_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'view_transaction', 'TXN_ID'=>$item->transaction_ID()), TXN_ADMIN_URL); |
|
| 596 | + return EE_Registry::instance()->CAP->current_user_can('ee_read_transaction', 'espresso_transactions_view_transaction', $item->transaction_ID()) ? '<span class="reg-pad-rght"><a class="status-'.$transaction->status_ID().'" href="'.$view_txn_lnk_url.'" title="'.esc_attr__('View Transaction', 'event_espresso').'">'.$item->transaction()->pretty_paid().'</a><span>' : '<span class="reg-pad-rght">'.$item->transaction()->pretty_paid().'</span>'; |
|
| 597 | 597 | } |
| 598 | 598 | } |
| 599 | 599 | |
@@ -614,44 +614,44 @@ discard block |
||
| 614 | 614 | EE_Registry::instance()->load_helper('MSG_Template'); |
| 615 | 615 | $attendee = $item->attendee(); |
| 616 | 616 | $ticket = $item->ticket(); |
| 617 | - $this->_set_related_details( $item ); |
|
| 617 | + $this->_set_related_details($item); |
|
| 618 | 618 | |
| 619 | 619 | //Build row actions |
| 620 | - $view_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'view_registration', '_REG_ID'=>$item->ID() ), REG_ADMIN_URL ); |
|
| 621 | - $edit_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'edit_attendee', 'post'=>$item->attendee_ID() ), REG_ADMIN_URL ); |
|
| 620 | + $view_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'view_registration', '_REG_ID'=>$item->ID()), REG_ADMIN_URL); |
|
| 621 | + $edit_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'edit_attendee', 'post'=>$item->attendee_ID()), REG_ADMIN_URL); |
|
| 622 | 622 | |
| 623 | 623 | // page=attendees&event_admin_reports=resend_email®istration_id=43653465634&event_id=2&form_action=resend_email |
| 624 | 624 | //$resend_reg_lnk_url_params = array( 'action'=>'resend_registration', '_REG_ID'=>$item->REG_ID ); |
| 625 | - $resend_reg_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'resend_registration', '_REG_ID'=>$item->ID() ), REG_ADMIN_URL, true ); |
|
| 625 | + $resend_reg_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'resend_registration', '_REG_ID'=>$item->ID()), REG_ADMIN_URL, true); |
|
| 626 | 626 | |
| 627 | 627 | |
| 628 | 628 | //Build row actions |
| 629 | - $view_lnk = EE_Registry::instance()->CAP->current_user_can('ee_read_registration', 'espresso_registrations_view_registration', $item->ID() ) ? ' |
|
| 629 | + $view_lnk = EE_Registry::instance()->CAP->current_user_can('ee_read_registration', 'espresso_registrations_view_registration', $item->ID()) ? ' |
|
| 630 | 630 | <li> |
| 631 | - <a href="'.$view_lnk_url.'" title="' . esc_attr__( 'View Registration Details', 'event_espresso' ) . '" class="tiny-text"> |
|
| 631 | + <a href="'.$view_lnk_url.'" title="'.esc_attr__('View Registration Details', 'event_espresso').'" class="tiny-text"> |
|
| 632 | 632 | <div class="dashicons dashicons-clipboard"></div> |
| 633 | 633 | </a> |
| 634 | 634 | </li>' : ''; |
| 635 | 635 | |
| 636 | - $edit_lnk = EE_Registry::instance()->CAP->current_user_can('ee_edit_contacts', 'espresso_registrations_edit_attendee' ) && $attendee instanceof EE_Attendee ?' |
|
| 636 | + $edit_lnk = EE_Registry::instance()->CAP->current_user_can('ee_edit_contacts', 'espresso_registrations_edit_attendee') && $attendee instanceof EE_Attendee ? ' |
|
| 637 | 637 | <li> |
| 638 | - <a href="'.$edit_lnk_url.'" title="' . esc_attr__( 'Edit Contact Details', 'event_espresso' ) . '" class="tiny-text"> |
|
| 638 | + <a href="'.$edit_lnk_url.'" title="'.esc_attr__('Edit Contact Details', 'event_espresso').'" class="tiny-text"> |
|
| 639 | 639 | <div class="ee-icon ee-icon-user-edit ee-icon-size-16"></div> |
| 640 | 640 | </a> |
| 641 | 641 | </li>' : ''; |
| 642 | 642 | |
| 643 | - $resend_reg_lnk = $attendee instanceof EE_Attendee && EE_Registry::instance()->CAP->current_user_can( 'ee_send_message', 'espresso_registrations_resend_registration', $item->ID() ) ? ' |
|
| 643 | + $resend_reg_lnk = $attendee instanceof EE_Attendee && EE_Registry::instance()->CAP->current_user_can('ee_send_message', 'espresso_registrations_resend_registration', $item->ID()) ? ' |
|
| 644 | 644 | <li> |
| 645 | - <a href="'.$resend_reg_lnk_url.'" title="' . esc_attr__( 'Resend Registration Details', 'event_espresso' ) . '" class="tiny-text"> |
|
| 645 | + <a href="'.$resend_reg_lnk_url.'" title="'.esc_attr__('Resend Registration Details', 'event_espresso').'" class="tiny-text"> |
|
| 646 | 646 | <div class="dashicons dashicons-email-alt"></div> |
| 647 | 647 | </a> |
| 648 | 648 | </li>' : ''; |
| 649 | 649 | |
| 650 | 650 | // page=transactions&action=view_transaction&txn=256&_wpnonce=6414da4dbb |
| 651 | - $view_txn_lnk_url = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'view_transaction', 'TXN_ID'=>$this->_transaction_details['id'] ), TXN_ADMIN_URL ); |
|
| 652 | - $view_txn_lnk = EE_Registry::instance()->CAP->current_user_can( 'ee_read_transaction', 'espresso_transactions_view_transaction', $this->_transaction_details['id'] ) ? ' |
|
| 651 | + $view_txn_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'view_transaction', 'TXN_ID'=>$this->_transaction_details['id']), TXN_ADMIN_URL); |
|
| 652 | + $view_txn_lnk = EE_Registry::instance()->CAP->current_user_can('ee_read_transaction', 'espresso_transactions_view_transaction', $this->_transaction_details['id']) ? ' |
|
| 653 | 653 | <li> |
| 654 | - <a class="ee-status-color-' . $this->_transaction_details['status'] . '" href="'.$view_txn_lnk_url.'" title="' . $this->_transaction_details['title_attr'] . '" class="tiny-text"> |
|
| 654 | + <a class="ee-status-color-' . $this->_transaction_details['status'].'" href="'.$view_txn_lnk_url.'" title="'.$this->_transaction_details['title_attr'].'" class="tiny-text"> |
|
| 655 | 655 | <div class="dashicons dashicons-cart"></div> |
| 656 | 656 | </a> |
| 657 | 657 | </li>' : ''; |
@@ -659,10 +659,10 @@ discard block |
||
| 659 | 659 | //invoice link |
| 660 | 660 | $dl_invoice_lnk_url = $item->invoice_url(); |
| 661 | 661 | //only show invoice link if message type is active. |
| 662 | - if ( $item->is_primary_registrant() && $attendee instanceof EE_Attendee && EEH_MSG_Template::is_mt_active( 'invoice' ) ) { |
|
| 662 | + if ($item->is_primary_registrant() && $attendee instanceof EE_Attendee && EEH_MSG_Template::is_mt_active('invoice')) { |
|
| 663 | 663 | $dl_invoice_lnk = ' |
| 664 | 664 | <li> |
| 665 | - <a title="' . esc_attr__( 'View Transaction Invoice', 'event_espresso' ) . '" target="_blank" href="'.$dl_invoice_lnk_url.'" class="tiny-text"> |
|
| 665 | + <a title="' . esc_attr__('View Transaction Invoice', 'event_espresso').'" target="_blank" href="'.$dl_invoice_lnk_url.'" class="tiny-text"> |
|
| 666 | 666 | <span class="dashicons dashicons-media-spreadsheet ee-icon-size-18"></span> |
| 667 | 667 | </a> |
| 668 | 668 | </li>'; |
@@ -670,7 +670,7 @@ discard block |
||
| 670 | 670 | $dl_invoice_lnk = ''; |
| 671 | 671 | } |
| 672 | 672 | |
| 673 | - return $this->_action_string( $view_lnk . $edit_lnk . $resend_reg_lnk . $view_txn_lnk . $dl_invoice_lnk, $item, 'ul', 'reg-overview-actions-ul' ); |
|
| 673 | + return $this->_action_string($view_lnk.$edit_lnk.$resend_reg_lnk.$view_txn_lnk.$dl_invoice_lnk, $item, 'ul', 'reg-overview-actions-ul'); |
|
| 674 | 674 | } |
| 675 | 675 | |
| 676 | 676 | } |
@@ -214,7 +214,7 @@ |
||
| 214 | 214 | /** |
| 215 | 215 | * _get_table_filters |
| 216 | 216 | * @access protected |
| 217 | - * @return array |
|
| 217 | + * @return string[] |
|
| 218 | 218 | */ |
| 219 | 219 | protected function _get_table_filters() { |
| 220 | 220 | $filters = array(); |
@@ -21,7 +21,7 @@ discard block |
||
| 21 | 21 | * |
| 22 | 22 | * ------------------------------------------------------------------------ |
| 23 | 23 | */ |
| 24 | -class Registrations_Admin_Page_Init extends EE_Admin_Page_CPT_Init { |
|
| 24 | +class Registrations_Admin_Page_Init extends EE_Admin_Page_CPT_Init { |
|
| 25 | 25 | |
| 26 | 26 | |
| 27 | 27 | |
@@ -34,16 +34,16 @@ discard block |
||
| 34 | 34 | * @return void |
| 35 | 35 | */ |
| 36 | 36 | public function __construct() { |
| 37 | - do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' ); |
|
| 38 | - if ( ! defined( 'REG_PG_SLUG' ) ) { |
|
| 39 | - define( 'REG_PG_SLUG', 'espresso_registrations' ); |
|
| 40 | - define( 'REG_PG_NAME', ucwords( str_replace( '_', '', REG_PG_SLUG ))); |
|
| 41 | - define( 'REG_ADMIN', EE_ADMIN_PAGES . 'registrations' . DS ); |
|
| 42 | - define( 'REG_ADMIN_URL', admin_url( 'admin.php?page=' . REG_PG_SLUG )); |
|
| 43 | - define( 'REG_ASSETS_PATH', REG_ADMIN . 'assets' . DS ); |
|
| 44 | - define( 'REG_ASSETS_URL', EE_ADMIN_PAGES_URL . 'registrations/assets/' ); |
|
| 45 | - define( 'REG_TEMPLATE_PATH', REG_ADMIN . 'templates' . DS ); |
|
| 46 | - define( 'REG_TEMPLATE_URL', EE_ADMIN_PAGES_URL . 'registrations/templates/' ); |
|
| 37 | + do_action('AHEE_log', __FILE__, __FUNCTION__, ''); |
|
| 38 | + if ( ! defined('REG_PG_SLUG')) { |
|
| 39 | + define('REG_PG_SLUG', 'espresso_registrations'); |
|
| 40 | + define('REG_PG_NAME', ucwords(str_replace('_', '', REG_PG_SLUG))); |
|
| 41 | + define('REG_ADMIN', EE_ADMIN_PAGES.'registrations'.DS); |
|
| 42 | + define('REG_ADMIN_URL', admin_url('admin.php?page='.REG_PG_SLUG)); |
|
| 43 | + define('REG_ASSETS_PATH', REG_ADMIN.'assets'.DS); |
|
| 44 | + define('REG_ASSETS_URL', EE_ADMIN_PAGES_URL.'registrations/assets/'); |
|
| 45 | + define('REG_TEMPLATE_PATH', REG_ADMIN.'templates'.DS); |
|
| 46 | + define('REG_TEMPLATE_URL', EE_ADMIN_PAGES_URL.'registrations/templates/'); |
|
| 47 | 47 | } |
| 48 | 48 | |
| 49 | 49 | parent::__construct(); |
@@ -59,7 +59,7 @@ discard block |
||
| 59 | 59 | |
| 60 | 60 | |
| 61 | 61 | protected function _set_menu_map() { |
| 62 | - $this->_menu_map = new EE_Admin_Page_Sub_Menu( array( |
|
| 62 | + $this->_menu_map = new EE_Admin_Page_Sub_Menu(array( |
|
| 63 | 63 | 'menu_group' => 'main', |
| 64 | 64 | 'menu_order' => 40, |
| 65 | 65 | '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 | * |