@@ -38,216 +38,216 @@ |
||
| 38 | 38 | * @since 4.0 |
| 39 | 39 | */ |
| 40 | 40 | if (function_exists('espresso_version')) { |
| 41 | - if (! function_exists('espresso_duplicate_plugin_error')) { |
|
| 42 | - /** |
|
| 43 | - * espresso_duplicate_plugin_error |
|
| 44 | - * displays if more than one version of EE is activated at the same time |
|
| 45 | - */ |
|
| 46 | - function espresso_duplicate_plugin_error() |
|
| 47 | - { |
|
| 48 | - ?> |
|
| 41 | + if (! function_exists('espresso_duplicate_plugin_error')) { |
|
| 42 | + /** |
|
| 43 | + * espresso_duplicate_plugin_error |
|
| 44 | + * displays if more than one version of EE is activated at the same time |
|
| 45 | + */ |
|
| 46 | + function espresso_duplicate_plugin_error() |
|
| 47 | + { |
|
| 48 | + ?> |
|
| 49 | 49 | <div class="error"> |
| 50 | 50 | <p> |
| 51 | 51 | <?php |
| 52 | - echo esc_html__( |
|
| 53 | - 'Can not run multiple versions of Event Espresso! One version has been automatically deactivated. Please verify that you have the correct version you want still active.', |
|
| 54 | - 'event_espresso' |
|
| 55 | - ); ?> |
|
| 52 | + echo esc_html__( |
|
| 53 | + 'Can not run multiple versions of Event Espresso! One version has been automatically deactivated. Please verify that you have the correct version you want still active.', |
|
| 54 | + 'event_espresso' |
|
| 55 | + ); ?> |
|
| 56 | 56 | </p> |
| 57 | 57 | </div> |
| 58 | 58 | <?php |
| 59 | - espresso_deactivate_plugin(plugin_basename(__FILE__)); |
|
| 60 | - } |
|
| 61 | - } |
|
| 62 | - add_action('admin_notices', 'espresso_duplicate_plugin_error', 1); |
|
| 59 | + espresso_deactivate_plugin(plugin_basename(__FILE__)); |
|
| 60 | + } |
|
| 61 | + } |
|
| 62 | + add_action('admin_notices', 'espresso_duplicate_plugin_error', 1); |
|
| 63 | 63 | |
| 64 | 64 | } else { |
| 65 | - define('EE_MIN_PHP_VER_REQUIRED', '5.3.9'); |
|
| 66 | - if (! version_compare(PHP_VERSION, EE_MIN_PHP_VER_REQUIRED, '>=')) { |
|
| 67 | - /** |
|
| 68 | - * espresso_minimum_php_version_error |
|
| 69 | - * @return void |
|
| 70 | - */ |
|
| 71 | - function espresso_minimum_php_version_error() |
|
| 72 | - { |
|
| 73 | - ?> |
|
| 65 | + define('EE_MIN_PHP_VER_REQUIRED', '5.3.9'); |
|
| 66 | + if (! version_compare(PHP_VERSION, EE_MIN_PHP_VER_REQUIRED, '>=')) { |
|
| 67 | + /** |
|
| 68 | + * espresso_minimum_php_version_error |
|
| 69 | + * @return void |
|
| 70 | + */ |
|
| 71 | + function espresso_minimum_php_version_error() |
|
| 72 | + { |
|
| 73 | + ?> |
|
| 74 | 74 | <div class="error"> |
| 75 | 75 | <p> |
| 76 | 76 | <?php |
| 77 | - printf( |
|
| 78 | - esc_html__( |
|
| 79 | - 'We\'re sorry, but Event Espresso requires PHP version %1$s or greater in order to operate. You are currently running version %2$s.%3$sIn order to update your version of PHP, you will need to contact your current hosting provider.%3$sFor information on stable PHP versions, please go to %4$s.', |
|
| 80 | - 'event_espresso' |
|
| 81 | - ), |
|
| 82 | - EE_MIN_PHP_VER_REQUIRED, |
|
| 83 | - PHP_VERSION, |
|
| 84 | - '<br/>', |
|
| 85 | - '<a href="http://php.net/downloads.php">http://php.net/downloads.php</a>' |
|
| 86 | - ); |
|
| 87 | - ?> |
|
| 77 | + printf( |
|
| 78 | + esc_html__( |
|
| 79 | + 'We\'re sorry, but Event Espresso requires PHP version %1$s or greater in order to operate. You are currently running version %2$s.%3$sIn order to update your version of PHP, you will need to contact your current hosting provider.%3$sFor information on stable PHP versions, please go to %4$s.', |
|
| 80 | + 'event_espresso' |
|
| 81 | + ), |
|
| 82 | + EE_MIN_PHP_VER_REQUIRED, |
|
| 83 | + PHP_VERSION, |
|
| 84 | + '<br/>', |
|
| 85 | + '<a href="http://php.net/downloads.php">http://php.net/downloads.php</a>' |
|
| 86 | + ); |
|
| 87 | + ?> |
|
| 88 | 88 | </p> |
| 89 | 89 | </div> |
| 90 | 90 | <?php |
| 91 | - espresso_deactivate_plugin(plugin_basename(__FILE__)); |
|
| 92 | - } |
|
| 91 | + espresso_deactivate_plugin(plugin_basename(__FILE__)); |
|
| 92 | + } |
|
| 93 | 93 | |
| 94 | - add_action('admin_notices', 'espresso_minimum_php_version_error', 1); |
|
| 95 | - } else { |
|
| 96 | - define('EVENT_ESPRESSO_MAIN_FILE', __FILE__); |
|
| 97 | - /** |
|
| 98 | - * espresso_version |
|
| 99 | - * Returns the plugin version |
|
| 100 | - * |
|
| 101 | - * @return string |
|
| 102 | - */ |
|
| 103 | - function espresso_version() |
|
| 104 | - { |
|
| 105 | - return apply_filters('FHEE__espresso__espresso_version', '4.9.58.rc.020'); |
|
| 106 | - } |
|
| 94 | + add_action('admin_notices', 'espresso_minimum_php_version_error', 1); |
|
| 95 | + } else { |
|
| 96 | + define('EVENT_ESPRESSO_MAIN_FILE', __FILE__); |
|
| 97 | + /** |
|
| 98 | + * espresso_version |
|
| 99 | + * Returns the plugin version |
|
| 100 | + * |
|
| 101 | + * @return string |
|
| 102 | + */ |
|
| 103 | + function espresso_version() |
|
| 104 | + { |
|
| 105 | + return apply_filters('FHEE__espresso__espresso_version', '4.9.58.rc.020'); |
|
| 106 | + } |
|
| 107 | 107 | |
| 108 | - /** |
|
| 109 | - * espresso_plugin_activation |
|
| 110 | - * adds a wp-option to indicate that EE has been activated via the WP admin plugins page |
|
| 111 | - */ |
|
| 112 | - function espresso_plugin_activation() |
|
| 113 | - { |
|
| 114 | - update_option('ee_espresso_activation', true); |
|
| 115 | - } |
|
| 108 | + /** |
|
| 109 | + * espresso_plugin_activation |
|
| 110 | + * adds a wp-option to indicate that EE has been activated via the WP admin plugins page |
|
| 111 | + */ |
|
| 112 | + function espresso_plugin_activation() |
|
| 113 | + { |
|
| 114 | + update_option('ee_espresso_activation', true); |
|
| 115 | + } |
|
| 116 | 116 | |
| 117 | - register_activation_hook(EVENT_ESPRESSO_MAIN_FILE, 'espresso_plugin_activation'); |
|
| 118 | - /** |
|
| 119 | - * espresso_load_error_handling |
|
| 120 | - * this function loads EE's class for handling exceptions and errors |
|
| 121 | - */ |
|
| 122 | - function espresso_load_error_handling() |
|
| 123 | - { |
|
| 124 | - static $error_handling_loaded = false; |
|
| 125 | - if ($error_handling_loaded) { |
|
| 126 | - return; |
|
| 127 | - } |
|
| 128 | - // load debugging tools |
|
| 129 | - if (WP_DEBUG === true && is_readable(EE_HELPERS . 'EEH_Debug_Tools.helper.php')) { |
|
| 130 | - require_once EE_HELPERS . 'EEH_Debug_Tools.helper.php'; |
|
| 131 | - \EEH_Debug_Tools::instance(); |
|
| 132 | - } |
|
| 133 | - // load error handling |
|
| 134 | - if (is_readable(EE_CORE . 'EE_Error.core.php')) { |
|
| 135 | - require_once EE_CORE . 'EE_Error.core.php'; |
|
| 136 | - } else { |
|
| 137 | - wp_die(esc_html__('The EE_Error core class could not be loaded.', 'event_espresso')); |
|
| 138 | - } |
|
| 139 | - $error_handling_loaded = true; |
|
| 140 | - } |
|
| 117 | + register_activation_hook(EVENT_ESPRESSO_MAIN_FILE, 'espresso_plugin_activation'); |
|
| 118 | + /** |
|
| 119 | + * espresso_load_error_handling |
|
| 120 | + * this function loads EE's class for handling exceptions and errors |
|
| 121 | + */ |
|
| 122 | + function espresso_load_error_handling() |
|
| 123 | + { |
|
| 124 | + static $error_handling_loaded = false; |
|
| 125 | + if ($error_handling_loaded) { |
|
| 126 | + return; |
|
| 127 | + } |
|
| 128 | + // load debugging tools |
|
| 129 | + if (WP_DEBUG === true && is_readable(EE_HELPERS . 'EEH_Debug_Tools.helper.php')) { |
|
| 130 | + require_once EE_HELPERS . 'EEH_Debug_Tools.helper.php'; |
|
| 131 | + \EEH_Debug_Tools::instance(); |
|
| 132 | + } |
|
| 133 | + // load error handling |
|
| 134 | + if (is_readable(EE_CORE . 'EE_Error.core.php')) { |
|
| 135 | + require_once EE_CORE . 'EE_Error.core.php'; |
|
| 136 | + } else { |
|
| 137 | + wp_die(esc_html__('The EE_Error core class could not be loaded.', 'event_espresso')); |
|
| 138 | + } |
|
| 139 | + $error_handling_loaded = true; |
|
| 140 | + } |
|
| 141 | 141 | |
| 142 | - /** |
|
| 143 | - * espresso_load_required |
|
| 144 | - * given a class name and path, this function will load that file or throw an exception |
|
| 145 | - * |
|
| 146 | - * @param string $classname |
|
| 147 | - * @param string $full_path_to_file |
|
| 148 | - * @throws EE_Error |
|
| 149 | - */ |
|
| 150 | - function espresso_load_required($classname, $full_path_to_file) |
|
| 151 | - { |
|
| 152 | - if (is_readable($full_path_to_file)) { |
|
| 153 | - require_once $full_path_to_file; |
|
| 154 | - } else { |
|
| 155 | - throw new \EE_Error ( |
|
| 156 | - sprintf( |
|
| 157 | - esc_html__( |
|
| 158 | - 'The %s class file could not be located or is not readable due to file permissions.', |
|
| 159 | - 'event_espresso' |
|
| 160 | - ), |
|
| 161 | - $classname |
|
| 162 | - ) |
|
| 163 | - ); |
|
| 164 | - } |
|
| 165 | - } |
|
| 142 | + /** |
|
| 143 | + * espresso_load_required |
|
| 144 | + * given a class name and path, this function will load that file or throw an exception |
|
| 145 | + * |
|
| 146 | + * @param string $classname |
|
| 147 | + * @param string $full_path_to_file |
|
| 148 | + * @throws EE_Error |
|
| 149 | + */ |
|
| 150 | + function espresso_load_required($classname, $full_path_to_file) |
|
| 151 | + { |
|
| 152 | + if (is_readable($full_path_to_file)) { |
|
| 153 | + require_once $full_path_to_file; |
|
| 154 | + } else { |
|
| 155 | + throw new \EE_Error ( |
|
| 156 | + sprintf( |
|
| 157 | + esc_html__( |
|
| 158 | + 'The %s class file could not be located or is not readable due to file permissions.', |
|
| 159 | + 'event_espresso' |
|
| 160 | + ), |
|
| 161 | + $classname |
|
| 162 | + ) |
|
| 163 | + ); |
|
| 164 | + } |
|
| 165 | + } |
|
| 166 | 166 | |
| 167 | - /** |
|
| 168 | - * @since 4.9.27 |
|
| 169 | - * @throws \EE_Error |
|
| 170 | - * @throws \EventEspresso\core\exceptions\InvalidInterfaceException |
|
| 171 | - * @throws \EventEspresso\core\exceptions\InvalidEntityException |
|
| 172 | - * @throws \EventEspresso\core\exceptions\InvalidIdentifierException |
|
| 173 | - * @throws \EventEspresso\core\exceptions\InvalidClassException |
|
| 174 | - * @throws \EventEspresso\core\exceptions\InvalidDataTypeException |
|
| 175 | - * @throws \EventEspresso\core\services\container\exceptions\ServiceExistsException |
|
| 176 | - * @throws \EventEspresso\core\services\container\exceptions\ServiceNotFoundException |
|
| 177 | - * @throws \OutOfBoundsException |
|
| 178 | - */ |
|
| 179 | - function bootstrap_espresso() |
|
| 180 | - { |
|
| 181 | - require_once __DIR__ . '/core/espresso_definitions.php'; |
|
| 182 | - try { |
|
| 183 | - espresso_load_error_handling(); |
|
| 184 | - espresso_load_required( |
|
| 185 | - 'EEH_Base', |
|
| 186 | - EE_CORE . 'helpers' . DS . 'EEH_Base.helper.php' |
|
| 187 | - ); |
|
| 188 | - espresso_load_required( |
|
| 189 | - 'EEH_File', |
|
| 190 | - EE_CORE . 'interfaces' . DS . 'EEHI_File.interface.php' |
|
| 191 | - ); |
|
| 192 | - espresso_load_required( |
|
| 193 | - 'EEH_File', |
|
| 194 | - EE_CORE . 'helpers' . DS . 'EEH_File.helper.php' |
|
| 195 | - ); |
|
| 196 | - espresso_load_required( |
|
| 197 | - 'EEH_Array', |
|
| 198 | - EE_CORE . 'helpers' . DS . 'EEH_Array.helper.php' |
|
| 199 | - ); |
|
| 200 | - // instantiate and configure PSR4 autoloader |
|
| 201 | - espresso_load_required( |
|
| 202 | - 'Psr4Autoloader', |
|
| 203 | - EE_CORE . 'Psr4Autoloader.php' |
|
| 204 | - ); |
|
| 205 | - espresso_load_required( |
|
| 206 | - 'EE_Psr4AutoloaderInit', |
|
| 207 | - EE_CORE . 'EE_Psr4AutoloaderInit.core.php' |
|
| 208 | - ); |
|
| 209 | - $AutoloaderInit = new EE_Psr4AutoloaderInit(); |
|
| 210 | - $AutoloaderInit->initializeAutoloader(); |
|
| 211 | - espresso_load_required( |
|
| 212 | - 'EE_Request', |
|
| 213 | - EE_CORE . 'request_stack' . DS . 'EE_Request.core.php' |
|
| 214 | - ); |
|
| 215 | - espresso_load_required( |
|
| 216 | - 'EE_Response', |
|
| 217 | - EE_CORE . 'request_stack' . DS . 'EE_Response.core.php' |
|
| 218 | - ); |
|
| 219 | - espresso_load_required( |
|
| 220 | - 'EE_Bootstrap', |
|
| 221 | - EE_CORE . 'EE_Bootstrap.core.php' |
|
| 222 | - ); |
|
| 223 | - // bootstrap EE and the request stack |
|
| 224 | - new EE_Bootstrap( |
|
| 225 | - new EE_Request($_GET, $_POST, $_COOKIE), |
|
| 226 | - new EE_Response() |
|
| 227 | - ); |
|
| 228 | - } catch (Exception $e) { |
|
| 229 | - require_once EE_CORE . 'exceptions' . DS . 'ExceptionStackTraceDisplay.php'; |
|
| 230 | - new EventEspresso\core\exceptions\ExceptionStackTraceDisplay($e); |
|
| 231 | - } |
|
| 232 | - } |
|
| 233 | - bootstrap_espresso(); |
|
| 234 | - } |
|
| 167 | + /** |
|
| 168 | + * @since 4.9.27 |
|
| 169 | + * @throws \EE_Error |
|
| 170 | + * @throws \EventEspresso\core\exceptions\InvalidInterfaceException |
|
| 171 | + * @throws \EventEspresso\core\exceptions\InvalidEntityException |
|
| 172 | + * @throws \EventEspresso\core\exceptions\InvalidIdentifierException |
|
| 173 | + * @throws \EventEspresso\core\exceptions\InvalidClassException |
|
| 174 | + * @throws \EventEspresso\core\exceptions\InvalidDataTypeException |
|
| 175 | + * @throws \EventEspresso\core\services\container\exceptions\ServiceExistsException |
|
| 176 | + * @throws \EventEspresso\core\services\container\exceptions\ServiceNotFoundException |
|
| 177 | + * @throws \OutOfBoundsException |
|
| 178 | + */ |
|
| 179 | + function bootstrap_espresso() |
|
| 180 | + { |
|
| 181 | + require_once __DIR__ . '/core/espresso_definitions.php'; |
|
| 182 | + try { |
|
| 183 | + espresso_load_error_handling(); |
|
| 184 | + espresso_load_required( |
|
| 185 | + 'EEH_Base', |
|
| 186 | + EE_CORE . 'helpers' . DS . 'EEH_Base.helper.php' |
|
| 187 | + ); |
|
| 188 | + espresso_load_required( |
|
| 189 | + 'EEH_File', |
|
| 190 | + EE_CORE . 'interfaces' . DS . 'EEHI_File.interface.php' |
|
| 191 | + ); |
|
| 192 | + espresso_load_required( |
|
| 193 | + 'EEH_File', |
|
| 194 | + EE_CORE . 'helpers' . DS . 'EEH_File.helper.php' |
|
| 195 | + ); |
|
| 196 | + espresso_load_required( |
|
| 197 | + 'EEH_Array', |
|
| 198 | + EE_CORE . 'helpers' . DS . 'EEH_Array.helper.php' |
|
| 199 | + ); |
|
| 200 | + // instantiate and configure PSR4 autoloader |
|
| 201 | + espresso_load_required( |
|
| 202 | + 'Psr4Autoloader', |
|
| 203 | + EE_CORE . 'Psr4Autoloader.php' |
|
| 204 | + ); |
|
| 205 | + espresso_load_required( |
|
| 206 | + 'EE_Psr4AutoloaderInit', |
|
| 207 | + EE_CORE . 'EE_Psr4AutoloaderInit.core.php' |
|
| 208 | + ); |
|
| 209 | + $AutoloaderInit = new EE_Psr4AutoloaderInit(); |
|
| 210 | + $AutoloaderInit->initializeAutoloader(); |
|
| 211 | + espresso_load_required( |
|
| 212 | + 'EE_Request', |
|
| 213 | + EE_CORE . 'request_stack' . DS . 'EE_Request.core.php' |
|
| 214 | + ); |
|
| 215 | + espresso_load_required( |
|
| 216 | + 'EE_Response', |
|
| 217 | + EE_CORE . 'request_stack' . DS . 'EE_Response.core.php' |
|
| 218 | + ); |
|
| 219 | + espresso_load_required( |
|
| 220 | + 'EE_Bootstrap', |
|
| 221 | + EE_CORE . 'EE_Bootstrap.core.php' |
|
| 222 | + ); |
|
| 223 | + // bootstrap EE and the request stack |
|
| 224 | + new EE_Bootstrap( |
|
| 225 | + new EE_Request($_GET, $_POST, $_COOKIE), |
|
| 226 | + new EE_Response() |
|
| 227 | + ); |
|
| 228 | + } catch (Exception $e) { |
|
| 229 | + require_once EE_CORE . 'exceptions' . DS . 'ExceptionStackTraceDisplay.php'; |
|
| 230 | + new EventEspresso\core\exceptions\ExceptionStackTraceDisplay($e); |
|
| 231 | + } |
|
| 232 | + } |
|
| 233 | + bootstrap_espresso(); |
|
| 234 | + } |
|
| 235 | 235 | } |
| 236 | 236 | if (! function_exists('espresso_deactivate_plugin')) { |
| 237 | - /** |
|
| 238 | - * deactivate_plugin |
|
| 239 | - * usage: espresso_deactivate_plugin( plugin_basename( __FILE__ )); |
|
| 240 | - * |
|
| 241 | - * @access public |
|
| 242 | - * @param string $plugin_basename - the results of plugin_basename( __FILE__ ) for the plugin's main file |
|
| 243 | - * @return void |
|
| 244 | - */ |
|
| 245 | - function espresso_deactivate_plugin($plugin_basename = '') |
|
| 246 | - { |
|
| 247 | - if (! function_exists('deactivate_plugins')) { |
|
| 248 | - require_once ABSPATH . 'wp-admin/includes/plugin.php'; |
|
| 249 | - } |
|
| 250 | - unset($_GET['activate'], $_REQUEST['activate']); |
|
| 251 | - deactivate_plugins($plugin_basename); |
|
| 252 | - } |
|
| 237 | + /** |
|
| 238 | + * deactivate_plugin |
|
| 239 | + * usage: espresso_deactivate_plugin( plugin_basename( __FILE__ )); |
|
| 240 | + * |
|
| 241 | + * @access public |
|
| 242 | + * @param string $plugin_basename - the results of plugin_basename( __FILE__ ) for the plugin's main file |
|
| 243 | + * @return void |
|
| 244 | + */ |
|
| 245 | + function espresso_deactivate_plugin($plugin_basename = '') |
|
| 246 | + { |
|
| 247 | + if (! function_exists('deactivate_plugins')) { |
|
| 248 | + require_once ABSPATH . 'wp-admin/includes/plugin.php'; |
|
| 249 | + } |
|
| 250 | + unset($_GET['activate'], $_REQUEST['activate']); |
|
| 251 | + deactivate_plugins($plugin_basename); |
|
| 252 | + } |
|
| 253 | 253 | } |
@@ -15,115 +15,115 @@ |
||
| 15 | 15 | class Extend_EE_Registrations_List_Table extends EE_Registrations_List_Table |
| 16 | 16 | { |
| 17 | 17 | |
| 18 | - /** |
|
| 19 | - * @param EE_Registration $item |
|
| 20 | - * @return string |
|
| 21 | - * @throws EE_Error |
|
| 22 | - * @throws InvalidArgumentException |
|
| 23 | - * @throws ReflectionException |
|
| 24 | - * @throws InvalidDataTypeException |
|
| 25 | - * @throws InvalidInterfaceException |
|
| 26 | - */ |
|
| 27 | - function column__REG_date(EE_Registration $item) |
|
| 28 | - { |
|
| 29 | - $date_linked = parent::column__REG_date($item); |
|
| 30 | - $actions = array(); |
|
| 31 | - //Build row actions |
|
| 32 | - $check_in_url = EE_Admin_Page::add_query_args_and_nonce(array( |
|
| 33 | - 'action' => 'event_registrations', |
|
| 34 | - 'event_id' => $item->event_ID(), |
|
| 35 | - ), REG_ADMIN_URL); |
|
| 36 | - $actions['check_in'] = EE_Registry::instance()->CAP->current_user_can( |
|
| 37 | - 'ee_read_registration', |
|
| 38 | - 'espresso_registrations_registration_checkins', |
|
| 39 | - $item->ID() |
|
| 40 | - ) && EE_Registry::instance()->CAP->current_user_can( |
|
| 41 | - 'ee_read_checkins', |
|
| 42 | - 'espresso_registrations_registration_checkins' |
|
| 43 | - ) |
|
| 44 | - ? '<a href="' . $check_in_url . '"' |
|
| 45 | - . ' title="' . esc_attr__( |
|
| 46 | - 'The Check-In List allows you to easily toggle check-in status for this event', |
|
| 47 | - 'event_espresso' |
|
| 48 | - ) |
|
| 49 | - . '">' . esc_html__('View Check-ins', 'event_espresso') . '</a>' |
|
| 50 | - : esc_html__('View Check-ins', 'event_espresso'); |
|
| 18 | + /** |
|
| 19 | + * @param EE_Registration $item |
|
| 20 | + * @return string |
|
| 21 | + * @throws EE_Error |
|
| 22 | + * @throws InvalidArgumentException |
|
| 23 | + * @throws ReflectionException |
|
| 24 | + * @throws InvalidDataTypeException |
|
| 25 | + * @throws InvalidInterfaceException |
|
| 26 | + */ |
|
| 27 | + function column__REG_date(EE_Registration $item) |
|
| 28 | + { |
|
| 29 | + $date_linked = parent::column__REG_date($item); |
|
| 30 | + $actions = array(); |
|
| 31 | + //Build row actions |
|
| 32 | + $check_in_url = EE_Admin_Page::add_query_args_and_nonce(array( |
|
| 33 | + 'action' => 'event_registrations', |
|
| 34 | + 'event_id' => $item->event_ID(), |
|
| 35 | + ), REG_ADMIN_URL); |
|
| 36 | + $actions['check_in'] = EE_Registry::instance()->CAP->current_user_can( |
|
| 37 | + 'ee_read_registration', |
|
| 38 | + 'espresso_registrations_registration_checkins', |
|
| 39 | + $item->ID() |
|
| 40 | + ) && EE_Registry::instance()->CAP->current_user_can( |
|
| 41 | + 'ee_read_checkins', |
|
| 42 | + 'espresso_registrations_registration_checkins' |
|
| 43 | + ) |
|
| 44 | + ? '<a href="' . $check_in_url . '"' |
|
| 45 | + . ' title="' . esc_attr__( |
|
| 46 | + 'The Check-In List allows you to easily toggle check-in status for this event', |
|
| 47 | + 'event_espresso' |
|
| 48 | + ) |
|
| 49 | + . '">' . esc_html__('View Check-ins', 'event_espresso') . '</a>' |
|
| 50 | + : esc_html__('View Check-ins', 'event_espresso'); |
|
| 51 | 51 | |
| 52 | - return sprintf('%1$s %2$s', $date_linked, $this->row_actions($actions)); |
|
| 53 | - } |
|
| 52 | + return sprintf('%1$s %2$s', $date_linked, $this->row_actions($actions)); |
|
| 53 | + } |
|
| 54 | 54 | |
| 55 | 55 | |
| 56 | - /** |
|
| 57 | - * column_default |
|
| 58 | - * |
|
| 59 | - * @param \EE_Registration $item |
|
| 60 | - * @return string |
|
| 61 | - * @throws EE_Error |
|
| 62 | - * @throws InvalidArgumentException |
|
| 63 | - * @throws InvalidDataTypeException |
|
| 64 | - * @throws InvalidInterfaceException |
|
| 65 | - * @throws ReflectionException |
|
| 66 | - */ |
|
| 67 | - public function column_DTT_EVT_start(EE_Registration $item) |
|
| 68 | - { |
|
| 69 | - $remove_defaults = array('default_where_conditions' => 'none'); |
|
| 70 | - $ticket = $item->ticket(); |
|
| 71 | - $datetimes = $ticket instanceof EE_Ticket ? $ticket->datetimes($remove_defaults) : array(); |
|
| 72 | - $EVT_ID = $item->event_ID(); |
|
| 73 | - $datetimes_for_display = array(); |
|
| 74 | - foreach ($datetimes as $datetime) { |
|
| 75 | - $datetime_string = ''; |
|
| 76 | - if (EE_Registry::instance()->CAP->current_user_can( |
|
| 77 | - 'ee_read_checkin', |
|
| 78 | - 'espresso_registrations_registration_checkins', |
|
| 79 | - $item->ID() |
|
| 80 | - )) { |
|
| 81 | - // open "a" tag and "href" |
|
| 82 | - $datetime_string .= '<a href="'; |
|
| 83 | - // checkin URL |
|
| 84 | - $datetime_string .= EE_Admin_Page::add_query_args_and_nonce( |
|
| 85 | - array( |
|
| 86 | - 'action' => 'event_registrations', |
|
| 87 | - 'event_id' => $EVT_ID, |
|
| 88 | - 'DTT_ID' => $datetime->ID(), |
|
| 89 | - ), |
|
| 90 | - REG_ADMIN_URL |
|
| 91 | - ); |
|
| 92 | - // close "href" |
|
| 93 | - $datetime_string .= '"'; |
|
| 94 | - // open "title" tag |
|
| 95 | - $datetime_string .= ' title="'; |
|
| 96 | - // link title text |
|
| 97 | - $datetime_string .= esc_attr__('View Checkins for this Event', 'event_espresso'); |
|
| 98 | - // close "title" tag and end of "a" tag opening |
|
| 99 | - $datetime_string .= '">'; |
|
| 100 | - // link text |
|
| 101 | - $datetime_string .= $datetime->get_i18n_datetime('DTT_EVT_start'); |
|
| 102 | - // close "a" tag |
|
| 103 | - $datetime_string .= '</a>'; |
|
| 104 | - } else { |
|
| 105 | - $datetime_string .= $datetime->get_i18n_datetime('DTT_EVT_start'); |
|
| 106 | - } |
|
| 107 | - // add a "View Registrations" link that filters list by event AND datetime |
|
| 108 | - $datetime_string .= $this->row_actions( |
|
| 109 | - array( |
|
| 110 | - 'event_datetime_filter' => '<a href="' . EE_Admin_Page::add_query_args_and_nonce( |
|
| 111 | - array('event_id' => $EVT_ID, 'datetime_id' => $datetime->ID()), |
|
| 112 | - REG_ADMIN_URL |
|
| 113 | - ) |
|
| 114 | - . '" title="' . sprintf( |
|
| 115 | - esc_attr__( |
|
| 116 | - 'Filter this list to only show registrations for this datetime %s', |
|
| 117 | - 'event_espresso' |
|
| 118 | - ), |
|
| 119 | - $datetime->name() |
|
| 120 | - ) . '">' |
|
| 121 | - . esc_html__('View Registrations', 'event_espresso') |
|
| 122 | - . '</a>', |
|
| 123 | - ) |
|
| 124 | - ); |
|
| 125 | - $datetimes_for_display[] = $datetime_string; |
|
| 126 | - } |
|
| 127 | - return $this->generateDisplayForDateTimes($datetimes_for_display); |
|
| 128 | - } |
|
| 56 | + /** |
|
| 57 | + * column_default |
|
| 58 | + * |
|
| 59 | + * @param \EE_Registration $item |
|
| 60 | + * @return string |
|
| 61 | + * @throws EE_Error |
|
| 62 | + * @throws InvalidArgumentException |
|
| 63 | + * @throws InvalidDataTypeException |
|
| 64 | + * @throws InvalidInterfaceException |
|
| 65 | + * @throws ReflectionException |
|
| 66 | + */ |
|
| 67 | + public function column_DTT_EVT_start(EE_Registration $item) |
|
| 68 | + { |
|
| 69 | + $remove_defaults = array('default_where_conditions' => 'none'); |
|
| 70 | + $ticket = $item->ticket(); |
|
| 71 | + $datetimes = $ticket instanceof EE_Ticket ? $ticket->datetimes($remove_defaults) : array(); |
|
| 72 | + $EVT_ID = $item->event_ID(); |
|
| 73 | + $datetimes_for_display = array(); |
|
| 74 | + foreach ($datetimes as $datetime) { |
|
| 75 | + $datetime_string = ''; |
|
| 76 | + if (EE_Registry::instance()->CAP->current_user_can( |
|
| 77 | + 'ee_read_checkin', |
|
| 78 | + 'espresso_registrations_registration_checkins', |
|
| 79 | + $item->ID() |
|
| 80 | + )) { |
|
| 81 | + // open "a" tag and "href" |
|
| 82 | + $datetime_string .= '<a href="'; |
|
| 83 | + // checkin URL |
|
| 84 | + $datetime_string .= EE_Admin_Page::add_query_args_and_nonce( |
|
| 85 | + array( |
|
| 86 | + 'action' => 'event_registrations', |
|
| 87 | + 'event_id' => $EVT_ID, |
|
| 88 | + 'DTT_ID' => $datetime->ID(), |
|
| 89 | + ), |
|
| 90 | + REG_ADMIN_URL |
|
| 91 | + ); |
|
| 92 | + // close "href" |
|
| 93 | + $datetime_string .= '"'; |
|
| 94 | + // open "title" tag |
|
| 95 | + $datetime_string .= ' title="'; |
|
| 96 | + // link title text |
|
| 97 | + $datetime_string .= esc_attr__('View Checkins for this Event', 'event_espresso'); |
|
| 98 | + // close "title" tag and end of "a" tag opening |
|
| 99 | + $datetime_string .= '">'; |
|
| 100 | + // link text |
|
| 101 | + $datetime_string .= $datetime->get_i18n_datetime('DTT_EVT_start'); |
|
| 102 | + // close "a" tag |
|
| 103 | + $datetime_string .= '</a>'; |
|
| 104 | + } else { |
|
| 105 | + $datetime_string .= $datetime->get_i18n_datetime('DTT_EVT_start'); |
|
| 106 | + } |
|
| 107 | + // add a "View Registrations" link that filters list by event AND datetime |
|
| 108 | + $datetime_string .= $this->row_actions( |
|
| 109 | + array( |
|
| 110 | + 'event_datetime_filter' => '<a href="' . EE_Admin_Page::add_query_args_and_nonce( |
|
| 111 | + array('event_id' => $EVT_ID, 'datetime_id' => $datetime->ID()), |
|
| 112 | + REG_ADMIN_URL |
|
| 113 | + ) |
|
| 114 | + . '" title="' . sprintf( |
|
| 115 | + esc_attr__( |
|
| 116 | + 'Filter this list to only show registrations for this datetime %s', |
|
| 117 | + 'event_espresso' |
|
| 118 | + ), |
|
| 119 | + $datetime->name() |
|
| 120 | + ) . '">' |
|
| 121 | + . esc_html__('View Registrations', 'event_espresso') |
|
| 122 | + . '</a>', |
|
| 123 | + ) |
|
| 124 | + ); |
|
| 125 | + $datetimes_for_display[] = $datetime_string; |
|
| 126 | + } |
|
| 127 | + return $this->generateDisplayForDateTimes($datetimes_for_display); |
|
| 128 | + } |
|
| 129 | 129 | } |
@@ -41,12 +41,12 @@ discard block |
||
| 41 | 41 | 'ee_read_checkins', |
| 42 | 42 | 'espresso_registrations_registration_checkins' |
| 43 | 43 | ) |
| 44 | - ? '<a href="' . $check_in_url . '"' |
|
| 45 | - . ' title="' . esc_attr__( |
|
| 44 | + ? '<a href="'.$check_in_url.'"' |
|
| 45 | + . ' title="'.esc_attr__( |
|
| 46 | 46 | 'The Check-In List allows you to easily toggle check-in status for this event', |
| 47 | 47 | 'event_espresso' |
| 48 | 48 | ) |
| 49 | - . '">' . esc_html__('View Check-ins', 'event_espresso') . '</a>' |
|
| 49 | + . '">'.esc_html__('View Check-ins', 'event_espresso').'</a>' |
|
| 50 | 50 | : esc_html__('View Check-ins', 'event_espresso'); |
| 51 | 51 | |
| 52 | 52 | return sprintf('%1$s %2$s', $date_linked, $this->row_actions($actions)); |
@@ -107,17 +107,17 @@ discard block |
||
| 107 | 107 | // add a "View Registrations" link that filters list by event AND datetime |
| 108 | 108 | $datetime_string .= $this->row_actions( |
| 109 | 109 | array( |
| 110 | - 'event_datetime_filter' => '<a href="' . EE_Admin_Page::add_query_args_and_nonce( |
|
| 110 | + 'event_datetime_filter' => '<a href="'.EE_Admin_Page::add_query_args_and_nonce( |
|
| 111 | 111 | array('event_id' => $EVT_ID, 'datetime_id' => $datetime->ID()), |
| 112 | 112 | REG_ADMIN_URL |
| 113 | 113 | ) |
| 114 | - . '" title="' . sprintf( |
|
| 114 | + . '" title="'.sprintf( |
|
| 115 | 115 | esc_attr__( |
| 116 | 116 | 'Filter this list to only show registrations for this datetime %s', |
| 117 | 117 | 'event_espresso' |
| 118 | 118 | ), |
| 119 | 119 | $datetime->name() |
| 120 | - ) . '">' |
|
| 120 | + ).'">' |
|
| 121 | 121 | . esc_html__('View Registrations', 'event_espresso') |
| 122 | 122 | . '</a>', |
| 123 | 123 | ) |
@@ -3,7 +3,7 @@ discard block |
||
| 3 | 3 | use EventEspresso\core\exceptions\InvalidInterfaceException; |
| 4 | 4 | |
| 5 | 5 | if (! defined('EVENT_ESPRESSO_VERSION')) { |
| 6 | - exit('No direct script access allowed'); |
|
| 6 | + exit('No direct script access allowed'); |
|
| 7 | 7 | } |
| 8 | 8 | |
| 9 | 9 | |
@@ -28,1006 +28,1006 @@ discard block |
||
| 28 | 28 | { |
| 29 | 29 | |
| 30 | 30 | |
| 31 | - /** |
|
| 32 | - * @var array |
|
| 33 | - */ |
|
| 34 | - private $_status; |
|
| 31 | + /** |
|
| 32 | + * @var array |
|
| 33 | + */ |
|
| 34 | + private $_status; |
|
| 35 | 35 | |
| 36 | 36 | |
| 37 | - /** |
|
| 38 | - * An array of transaction details for the related transaction to the registration being processed. |
|
| 39 | - * This is set via the _set_related_details method. |
|
| 40 | - * |
|
| 41 | - * @var array |
|
| 42 | - */ |
|
| 43 | - protected $_transaction_details = array(); |
|
| 37 | + /** |
|
| 38 | + * An array of transaction details for the related transaction to the registration being processed. |
|
| 39 | + * This is set via the _set_related_details method. |
|
| 40 | + * |
|
| 41 | + * @var array |
|
| 42 | + */ |
|
| 43 | + protected $_transaction_details = array(); |
|
| 44 | 44 | |
| 45 | 45 | |
| 46 | - /** |
|
| 47 | - * An array of event details for the related event to the registration being processed. |
|
| 48 | - * This is set via the _set_related_details method. |
|
| 49 | - * |
|
| 50 | - * @var array |
|
| 51 | - */ |
|
| 52 | - protected $_event_details = array(); |
|
| 46 | + /** |
|
| 47 | + * An array of event details for the related event to the registration being processed. |
|
| 48 | + * This is set via the _set_related_details method. |
|
| 49 | + * |
|
| 50 | + * @var array |
|
| 51 | + */ |
|
| 52 | + protected $_event_details = array(); |
|
| 53 | 53 | |
| 54 | 54 | |
| 55 | - /** |
|
| 56 | - * @param \Registrations_Admin_Page $admin_page |
|
| 57 | - */ |
|
| 58 | - public function __construct(Registrations_Admin_Page $admin_page) |
|
| 59 | - { |
|
| 60 | - if (! empty($_GET['event_id'])) { |
|
| 61 | - $extra_query_args = array(); |
|
| 62 | - foreach ($admin_page->get_views() as $key => $view_details) { |
|
| 63 | - $extra_query_args[$view_details['slug']] = array('event_id' => $_GET['event_id']); |
|
| 64 | - } |
|
| 65 | - $this->_views = $admin_page->get_list_table_view_RLs($extra_query_args); |
|
| 66 | - } |
|
| 67 | - parent::__construct($admin_page); |
|
| 68 | - $this->_status = $this->_admin_page->get_registration_status_array(); |
|
| 69 | - } |
|
| 55 | + /** |
|
| 56 | + * @param \Registrations_Admin_Page $admin_page |
|
| 57 | + */ |
|
| 58 | + public function __construct(Registrations_Admin_Page $admin_page) |
|
| 59 | + { |
|
| 60 | + if (! empty($_GET['event_id'])) { |
|
| 61 | + $extra_query_args = array(); |
|
| 62 | + foreach ($admin_page->get_views() as $key => $view_details) { |
|
| 63 | + $extra_query_args[$view_details['slug']] = array('event_id' => $_GET['event_id']); |
|
| 64 | + } |
|
| 65 | + $this->_views = $admin_page->get_list_table_view_RLs($extra_query_args); |
|
| 66 | + } |
|
| 67 | + parent::__construct($admin_page); |
|
| 68 | + $this->_status = $this->_admin_page->get_registration_status_array(); |
|
| 69 | + } |
|
| 70 | 70 | |
| 71 | 71 | |
| 72 | - /** |
|
| 73 | - * _setup_data |
|
| 74 | - * |
|
| 75 | - * @access protected |
|
| 76 | - * @return void |
|
| 77 | - */ |
|
| 78 | - protected function _setup_data() |
|
| 79 | - { |
|
| 80 | - $this->_data = $this->_admin_page->get_registrations($this->_per_page); |
|
| 81 | - $this->_all_data_count = $this->_admin_page->get_registrations($this->_per_page, true, false, false); |
|
| 82 | - } |
|
| 72 | + /** |
|
| 73 | + * _setup_data |
|
| 74 | + * |
|
| 75 | + * @access protected |
|
| 76 | + * @return void |
|
| 77 | + */ |
|
| 78 | + protected function _setup_data() |
|
| 79 | + { |
|
| 80 | + $this->_data = $this->_admin_page->get_registrations($this->_per_page); |
|
| 81 | + $this->_all_data_count = $this->_admin_page->get_registrations($this->_per_page, true, false, false); |
|
| 82 | + } |
|
| 83 | 83 | |
| 84 | 84 | |
| 85 | - /** |
|
| 86 | - * _set_properties |
|
| 87 | - * |
|
| 88 | - * @access protected |
|
| 89 | - * @return void |
|
| 90 | - */ |
|
| 91 | - protected function _set_properties() |
|
| 92 | - { |
|
| 93 | - $this->_wp_list_args = array( |
|
| 94 | - 'singular' => __('registration', 'event_espresso'), |
|
| 95 | - 'plural' => __('registrations', 'event_espresso'), |
|
| 96 | - 'ajax' => true, |
|
| 97 | - 'screen' => $this->_admin_page->get_current_screen()->id, |
|
| 98 | - ); |
|
| 99 | - $ID_column_name = __('ID', 'event_espresso'); |
|
| 100 | - $ID_column_name .= ' : <span class="show-on-mobile-view-only" style="float:none">'; |
|
| 101 | - $ID_column_name .= __('Registrant Name', 'event_espresso'); |
|
| 102 | - $ID_column_name .= '</span> '; |
|
| 103 | - if (isset($_GET['event_id'])) { |
|
| 104 | - $this->_columns = array( |
|
| 105 | - 'cb' => '<input type="checkbox" />', //Render a checkbox instead of text |
|
| 106 | - '_REG_ID' => $ID_column_name, |
|
| 107 | - 'ATT_fname' => __('Name', 'event_espresso'), |
|
| 108 | - 'ATT_email' => __('Email', 'event_espresso'), |
|
| 109 | - '_REG_date' => __('Reg Date', 'event_espresso'), |
|
| 110 | - 'PRC_amount' => __('TKT Price', 'event_espresso'), |
|
| 111 | - '_REG_final_price' => __('Final Price', 'event_espresso'), |
|
| 112 | - 'TXN_total' => __('Total Txn', 'event_espresso'), |
|
| 113 | - 'TXN_paid' => __('Paid', 'event_espresso'), |
|
| 114 | - 'actions' => __('Actions', 'event_espresso'), |
|
| 115 | - ); |
|
| 116 | - $this->_bottom_buttons = array( |
|
| 117 | - 'report' => array( |
|
| 118 | - 'route' => 'registrations_report', |
|
| 119 | - 'extra_request' => array( |
|
| 120 | - 'EVT_ID' => isset($this->_req_data['event_id']) ? $this->_req_data['event_id'] : null, |
|
| 121 | - 'return_url' => urlencode("//{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}"), |
|
| 122 | - ), |
|
| 123 | - ), |
|
| 124 | - ); |
|
| 125 | - } else { |
|
| 126 | - $this->_columns = array( |
|
| 127 | - 'cb' => '<input type="checkbox" />', //Render a checkbox instead of text |
|
| 128 | - '_REG_ID' => $ID_column_name, |
|
| 129 | - 'ATT_fname' => __('Name', 'event_espresso'), |
|
| 130 | - '_REG_date' => __('TXN Date', 'event_espresso'), |
|
| 131 | - 'event_name' => __('Event', 'event_espresso'), |
|
| 132 | - 'DTT_EVT_start' => __('Event Date', 'event_espresso'), |
|
| 133 | - '_REG_final_price' => __('Price', 'event_espresso'), |
|
| 134 | - '_REG_paid' => __('Paid', 'event_espresso'), |
|
| 135 | - 'actions' => __('Actions', 'event_espresso'), |
|
| 136 | - ); |
|
| 137 | - $this->_bottom_buttons = array( |
|
| 138 | - 'report_all' => array( |
|
| 139 | - 'route' => 'registrations_report', |
|
| 140 | - 'extra_request' => array( |
|
| 141 | - 'return_url' => urlencode("//{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}"), |
|
| 142 | - ), |
|
| 143 | - ), |
|
| 144 | - ); |
|
| 145 | - } |
|
| 146 | - $this->_bottom_buttons['report_filtered'] = array( |
|
| 147 | - 'route' => 'registrations_report', |
|
| 148 | - 'extra_request' => array( |
|
| 149 | - 'use_filters' => true, |
|
| 150 | - 'filters' => array_diff_key($this->_req_data, array_flip(array( |
|
| 151 | - 'page', |
|
| 152 | - 'action', |
|
| 153 | - 'default_nonce', |
|
| 154 | - ))), |
|
| 155 | - 'return_url' => urlencode("//{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}"), |
|
| 156 | - ), |
|
| 157 | - ); |
|
| 158 | - $this->_primary_column = '_REG_ID'; |
|
| 159 | - $this->_sortable_columns = array( |
|
| 160 | - '_REG_date' => array('_REG_date' => true), //true means its already sorted |
|
| 161 | - /** |
|
| 162 | - * Allows users to change the default sort if they wish. |
|
| 163 | - * Returning a falsey on this filter will result in the default sort to be by firstname rather than last |
|
| 164 | - * name. |
|
| 165 | - */ |
|
| 166 | - 'ATT_fname' => array( |
|
| 167 | - 'FHEE__EE_Registrations_List_Table___set_properties__default_sort_by_registration_last_name', |
|
| 168 | - true, |
|
| 169 | - $this, |
|
| 170 | - ) |
|
| 171 | - ? array('ATT_lname' => false) |
|
| 172 | - : array('ATT_fname' => false), |
|
| 173 | - 'event_name' => array('event_name' => false), |
|
| 174 | - 'DTT_EVT_start' => array('DTT_EVT_start' => false), |
|
| 175 | - '_REG_ID' => array('_REG_ID' => false), |
|
| 176 | - ); |
|
| 177 | - $this->_hidden_columns = array(); |
|
| 178 | - } |
|
| 85 | + /** |
|
| 86 | + * _set_properties |
|
| 87 | + * |
|
| 88 | + * @access protected |
|
| 89 | + * @return void |
|
| 90 | + */ |
|
| 91 | + protected function _set_properties() |
|
| 92 | + { |
|
| 93 | + $this->_wp_list_args = array( |
|
| 94 | + 'singular' => __('registration', 'event_espresso'), |
|
| 95 | + 'plural' => __('registrations', 'event_espresso'), |
|
| 96 | + 'ajax' => true, |
|
| 97 | + 'screen' => $this->_admin_page->get_current_screen()->id, |
|
| 98 | + ); |
|
| 99 | + $ID_column_name = __('ID', 'event_espresso'); |
|
| 100 | + $ID_column_name .= ' : <span class="show-on-mobile-view-only" style="float:none">'; |
|
| 101 | + $ID_column_name .= __('Registrant Name', 'event_espresso'); |
|
| 102 | + $ID_column_name .= '</span> '; |
|
| 103 | + if (isset($_GET['event_id'])) { |
|
| 104 | + $this->_columns = array( |
|
| 105 | + 'cb' => '<input type="checkbox" />', //Render a checkbox instead of text |
|
| 106 | + '_REG_ID' => $ID_column_name, |
|
| 107 | + 'ATT_fname' => __('Name', 'event_espresso'), |
|
| 108 | + 'ATT_email' => __('Email', 'event_espresso'), |
|
| 109 | + '_REG_date' => __('Reg Date', 'event_espresso'), |
|
| 110 | + 'PRC_amount' => __('TKT Price', 'event_espresso'), |
|
| 111 | + '_REG_final_price' => __('Final Price', 'event_espresso'), |
|
| 112 | + 'TXN_total' => __('Total Txn', 'event_espresso'), |
|
| 113 | + 'TXN_paid' => __('Paid', 'event_espresso'), |
|
| 114 | + 'actions' => __('Actions', 'event_espresso'), |
|
| 115 | + ); |
|
| 116 | + $this->_bottom_buttons = array( |
|
| 117 | + 'report' => array( |
|
| 118 | + 'route' => 'registrations_report', |
|
| 119 | + 'extra_request' => array( |
|
| 120 | + 'EVT_ID' => isset($this->_req_data['event_id']) ? $this->_req_data['event_id'] : null, |
|
| 121 | + 'return_url' => urlencode("//{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}"), |
|
| 122 | + ), |
|
| 123 | + ), |
|
| 124 | + ); |
|
| 125 | + } else { |
|
| 126 | + $this->_columns = array( |
|
| 127 | + 'cb' => '<input type="checkbox" />', //Render a checkbox instead of text |
|
| 128 | + '_REG_ID' => $ID_column_name, |
|
| 129 | + 'ATT_fname' => __('Name', 'event_espresso'), |
|
| 130 | + '_REG_date' => __('TXN Date', 'event_espresso'), |
|
| 131 | + 'event_name' => __('Event', 'event_espresso'), |
|
| 132 | + 'DTT_EVT_start' => __('Event Date', 'event_espresso'), |
|
| 133 | + '_REG_final_price' => __('Price', 'event_espresso'), |
|
| 134 | + '_REG_paid' => __('Paid', 'event_espresso'), |
|
| 135 | + 'actions' => __('Actions', 'event_espresso'), |
|
| 136 | + ); |
|
| 137 | + $this->_bottom_buttons = array( |
|
| 138 | + 'report_all' => array( |
|
| 139 | + 'route' => 'registrations_report', |
|
| 140 | + 'extra_request' => array( |
|
| 141 | + 'return_url' => urlencode("//{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}"), |
|
| 142 | + ), |
|
| 143 | + ), |
|
| 144 | + ); |
|
| 145 | + } |
|
| 146 | + $this->_bottom_buttons['report_filtered'] = array( |
|
| 147 | + 'route' => 'registrations_report', |
|
| 148 | + 'extra_request' => array( |
|
| 149 | + 'use_filters' => true, |
|
| 150 | + 'filters' => array_diff_key($this->_req_data, array_flip(array( |
|
| 151 | + 'page', |
|
| 152 | + 'action', |
|
| 153 | + 'default_nonce', |
|
| 154 | + ))), |
|
| 155 | + 'return_url' => urlencode("//{$_SERVER['HTTP_HOST']}{$_SERVER['REQUEST_URI']}"), |
|
| 156 | + ), |
|
| 157 | + ); |
|
| 158 | + $this->_primary_column = '_REG_ID'; |
|
| 159 | + $this->_sortable_columns = array( |
|
| 160 | + '_REG_date' => array('_REG_date' => true), //true means its already sorted |
|
| 161 | + /** |
|
| 162 | + * Allows users to change the default sort if they wish. |
|
| 163 | + * Returning a falsey on this filter will result in the default sort to be by firstname rather than last |
|
| 164 | + * name. |
|
| 165 | + */ |
|
| 166 | + 'ATT_fname' => array( |
|
| 167 | + 'FHEE__EE_Registrations_List_Table___set_properties__default_sort_by_registration_last_name', |
|
| 168 | + true, |
|
| 169 | + $this, |
|
| 170 | + ) |
|
| 171 | + ? array('ATT_lname' => false) |
|
| 172 | + : array('ATT_fname' => false), |
|
| 173 | + 'event_name' => array('event_name' => false), |
|
| 174 | + 'DTT_EVT_start' => array('DTT_EVT_start' => false), |
|
| 175 | + '_REG_ID' => array('_REG_ID' => false), |
|
| 176 | + ); |
|
| 177 | + $this->_hidden_columns = array(); |
|
| 178 | + } |
|
| 179 | 179 | |
| 180 | 180 | |
| 181 | - /** |
|
| 182 | - * This simply sets up the row class for the table rows. |
|
| 183 | - * Allows for easier overriding of child methods for setting up sorting. |
|
| 184 | - * |
|
| 185 | - * @param EE_Registration $item the current item |
|
| 186 | - * @return string |
|
| 187 | - */ |
|
| 188 | - protected function _get_row_class($item) |
|
| 189 | - { |
|
| 190 | - $class = parent::_get_row_class($item); |
|
| 191 | - //add status class |
|
| 192 | - $class .= ' ee-status-strip reg-status-' . $item->status_ID(); |
|
| 193 | - if ($this->_has_checkbox_column) { |
|
| 194 | - $class .= ' has-checkbox-column'; |
|
| 195 | - } |
|
| 196 | - return $class; |
|
| 197 | - } |
|
| 181 | + /** |
|
| 182 | + * This simply sets up the row class for the table rows. |
|
| 183 | + * Allows for easier overriding of child methods for setting up sorting. |
|
| 184 | + * |
|
| 185 | + * @param EE_Registration $item the current item |
|
| 186 | + * @return string |
|
| 187 | + */ |
|
| 188 | + protected function _get_row_class($item) |
|
| 189 | + { |
|
| 190 | + $class = parent::_get_row_class($item); |
|
| 191 | + //add status class |
|
| 192 | + $class .= ' ee-status-strip reg-status-' . $item->status_ID(); |
|
| 193 | + if ($this->_has_checkbox_column) { |
|
| 194 | + $class .= ' has-checkbox-column'; |
|
| 195 | + } |
|
| 196 | + return $class; |
|
| 197 | + } |
|
| 198 | 198 | |
| 199 | 199 | |
| 200 | - /** |
|
| 201 | - * Set the $_transaction_details property if not set yet. |
|
| 202 | - * |
|
| 203 | - * @param EE_Registration $registration |
|
| 204 | - * @throws EE_Error |
|
| 205 | - * @throws InvalidArgumentException |
|
| 206 | - * @throws ReflectionException |
|
| 207 | - * @throws InvalidDataTypeException |
|
| 208 | - * @throws InvalidInterfaceException |
|
| 209 | - */ |
|
| 210 | - protected function _set_related_details(EE_Registration $registration) |
|
| 211 | - { |
|
| 212 | - $transaction = $registration->get_first_related('Transaction'); |
|
| 213 | - $status = $transaction instanceof EE_Transaction ? $transaction->status_ID() |
|
| 214 | - : EEM_Transaction::failed_status_code; |
|
| 215 | - $this->_transaction_details = array( |
|
| 216 | - 'transaction' => $transaction, |
|
| 217 | - 'status' => $status, |
|
| 218 | - 'id' => $transaction instanceof EE_Transaction ? $transaction->ID() : 0, |
|
| 219 | - 'title_attr' => sprintf( |
|
| 220 | - __('View Transaction Details (%s)', 'event_espresso'), |
|
| 221 | - EEH_Template::pretty_status($status, false, 'sentence') |
|
| 222 | - ), |
|
| 223 | - ); |
|
| 224 | - try { |
|
| 225 | - $event = $registration->event(); |
|
| 226 | - } catch (EntityNotFoundException $e) { |
|
| 227 | - $event = null; |
|
| 228 | - } |
|
| 229 | - $status = $event instanceof EE_Event ? $event->get_active_status() : EE_Datetime::inactive; |
|
| 230 | - $this->_event_details = array( |
|
| 231 | - 'event' => $event, |
|
| 232 | - 'status' => $status, |
|
| 233 | - 'id' => $event instanceof EE_Event ? $event->ID() : 0, |
|
| 234 | - 'title_attr' => sprintf( |
|
| 235 | - __('Edit Event (%s)', 'event_espresso'), |
|
| 236 | - EEH_Template::pretty_status($status, false, 'sentence') |
|
| 237 | - ), |
|
| 238 | - ); |
|
| 239 | - } |
|
| 200 | + /** |
|
| 201 | + * Set the $_transaction_details property if not set yet. |
|
| 202 | + * |
|
| 203 | + * @param EE_Registration $registration |
|
| 204 | + * @throws EE_Error |
|
| 205 | + * @throws InvalidArgumentException |
|
| 206 | + * @throws ReflectionException |
|
| 207 | + * @throws InvalidDataTypeException |
|
| 208 | + * @throws InvalidInterfaceException |
|
| 209 | + */ |
|
| 210 | + protected function _set_related_details(EE_Registration $registration) |
|
| 211 | + { |
|
| 212 | + $transaction = $registration->get_first_related('Transaction'); |
|
| 213 | + $status = $transaction instanceof EE_Transaction ? $transaction->status_ID() |
|
| 214 | + : EEM_Transaction::failed_status_code; |
|
| 215 | + $this->_transaction_details = array( |
|
| 216 | + 'transaction' => $transaction, |
|
| 217 | + 'status' => $status, |
|
| 218 | + 'id' => $transaction instanceof EE_Transaction ? $transaction->ID() : 0, |
|
| 219 | + 'title_attr' => sprintf( |
|
| 220 | + __('View Transaction Details (%s)', 'event_espresso'), |
|
| 221 | + EEH_Template::pretty_status($status, false, 'sentence') |
|
| 222 | + ), |
|
| 223 | + ); |
|
| 224 | + try { |
|
| 225 | + $event = $registration->event(); |
|
| 226 | + } catch (EntityNotFoundException $e) { |
|
| 227 | + $event = null; |
|
| 228 | + } |
|
| 229 | + $status = $event instanceof EE_Event ? $event->get_active_status() : EE_Datetime::inactive; |
|
| 230 | + $this->_event_details = array( |
|
| 231 | + 'event' => $event, |
|
| 232 | + 'status' => $status, |
|
| 233 | + 'id' => $event instanceof EE_Event ? $event->ID() : 0, |
|
| 234 | + 'title_attr' => sprintf( |
|
| 235 | + __('Edit Event (%s)', 'event_espresso'), |
|
| 236 | + EEH_Template::pretty_status($status, false, 'sentence') |
|
| 237 | + ), |
|
| 238 | + ); |
|
| 239 | + } |
|
| 240 | 240 | |
| 241 | 241 | |
| 242 | - /** |
|
| 243 | - * _get_table_filters |
|
| 244 | - * |
|
| 245 | - * @access protected |
|
| 246 | - * @return array |
|
| 247 | - */ |
|
| 248 | - protected function _get_table_filters() |
|
| 249 | - { |
|
| 250 | - $filters = array(); |
|
| 251 | - //todo we're currently using old functions here. We need to move things into the Events_Admin_Page() class as |
|
| 252 | - // methods. |
|
| 253 | - $cur_date = isset($this->_req_data['month_range']) ? $this->_req_data['month_range'] : ''; |
|
| 254 | - $cur_category = isset($this->_req_data['EVT_CAT']) ? $this->_req_data['EVT_CAT'] : -1; |
|
| 255 | - $reg_status = isset($this->_req_data['_reg_status']) ? $this->_req_data['_reg_status'] : ''; |
|
| 256 | - $filters[] = EEH_Form_Fields::generate_registration_months_dropdown($cur_date, $reg_status, $cur_category); |
|
| 257 | - $filters[] = EEH_Form_Fields::generate_event_category_dropdown($cur_category); |
|
| 258 | - $status = array(); |
|
| 259 | - $status[] = array('id' => 0, 'text' => __('Select Status', 'event_espresso')); |
|
| 260 | - foreach ($this->_status as $key => $value) { |
|
| 261 | - $status[] = array('id' => $key, 'text' => $value); |
|
| 262 | - } |
|
| 263 | - if ($this->_view !== 'incomplete') { |
|
| 264 | - $filters[] = EEH_Form_Fields::select_input( |
|
| 265 | - '_reg_status', |
|
| 266 | - $status, |
|
| 267 | - isset($this->_req_data['_reg_status']) ? strtoupper(sanitize_key($this->_req_data['_reg_status'])) |
|
| 268 | - : '' |
|
| 269 | - ); |
|
| 270 | - } |
|
| 271 | - if (isset($this->_req_data['event_id'])) { |
|
| 272 | - $filters[] = EEH_Form_Fields::hidden_input('event_id', $this->_req_data['event_id'], 'reg_event_id'); |
|
| 273 | - } |
|
| 274 | - return $filters; |
|
| 275 | - } |
|
| 242 | + /** |
|
| 243 | + * _get_table_filters |
|
| 244 | + * |
|
| 245 | + * @access protected |
|
| 246 | + * @return array |
|
| 247 | + */ |
|
| 248 | + protected function _get_table_filters() |
|
| 249 | + { |
|
| 250 | + $filters = array(); |
|
| 251 | + //todo we're currently using old functions here. We need to move things into the Events_Admin_Page() class as |
|
| 252 | + // methods. |
|
| 253 | + $cur_date = isset($this->_req_data['month_range']) ? $this->_req_data['month_range'] : ''; |
|
| 254 | + $cur_category = isset($this->_req_data['EVT_CAT']) ? $this->_req_data['EVT_CAT'] : -1; |
|
| 255 | + $reg_status = isset($this->_req_data['_reg_status']) ? $this->_req_data['_reg_status'] : ''; |
|
| 256 | + $filters[] = EEH_Form_Fields::generate_registration_months_dropdown($cur_date, $reg_status, $cur_category); |
|
| 257 | + $filters[] = EEH_Form_Fields::generate_event_category_dropdown($cur_category); |
|
| 258 | + $status = array(); |
|
| 259 | + $status[] = array('id' => 0, 'text' => __('Select Status', 'event_espresso')); |
|
| 260 | + foreach ($this->_status as $key => $value) { |
|
| 261 | + $status[] = array('id' => $key, 'text' => $value); |
|
| 262 | + } |
|
| 263 | + if ($this->_view !== 'incomplete') { |
|
| 264 | + $filters[] = EEH_Form_Fields::select_input( |
|
| 265 | + '_reg_status', |
|
| 266 | + $status, |
|
| 267 | + isset($this->_req_data['_reg_status']) ? strtoupper(sanitize_key($this->_req_data['_reg_status'])) |
|
| 268 | + : '' |
|
| 269 | + ); |
|
| 270 | + } |
|
| 271 | + if (isset($this->_req_data['event_id'])) { |
|
| 272 | + $filters[] = EEH_Form_Fields::hidden_input('event_id', $this->_req_data['event_id'], 'reg_event_id'); |
|
| 273 | + } |
|
| 274 | + return $filters; |
|
| 275 | + } |
|
| 276 | 276 | |
| 277 | 277 | |
| 278 | - /** |
|
| 279 | - * _add_view_counts |
|
| 280 | - * |
|
| 281 | - * @access protected |
|
| 282 | - * @return void |
|
| 283 | - * @throws EE_Error |
|
| 284 | - * @throws InvalidArgumentException |
|
| 285 | - * @throws InvalidDataTypeException |
|
| 286 | - * @throws InvalidInterfaceException |
|
| 287 | - */ |
|
| 288 | - protected function _add_view_counts() |
|
| 289 | - { |
|
| 290 | - $this->_views['all']['count'] = $this->_total_registrations(); |
|
| 291 | - $this->_views['month']['count'] = $this->_total_registrations_this_month(); |
|
| 292 | - $this->_views['today']['count'] = $this->_total_registrations_today(); |
|
| 293 | - if (EE_Registry::instance()->CAP->current_user_can( |
|
| 294 | - 'ee_delete_registrations', |
|
| 295 | - 'espresso_registrations_trash_registrations' |
|
| 296 | - )) { |
|
| 297 | - $this->_views['incomplete']['count'] = $this->_total_registrations('incomplete'); |
|
| 298 | - $this->_views['trash']['count'] = $this->_total_registrations('trash'); |
|
| 299 | - } |
|
| 300 | - } |
|
| 278 | + /** |
|
| 279 | + * _add_view_counts |
|
| 280 | + * |
|
| 281 | + * @access protected |
|
| 282 | + * @return void |
|
| 283 | + * @throws EE_Error |
|
| 284 | + * @throws InvalidArgumentException |
|
| 285 | + * @throws InvalidDataTypeException |
|
| 286 | + * @throws InvalidInterfaceException |
|
| 287 | + */ |
|
| 288 | + protected function _add_view_counts() |
|
| 289 | + { |
|
| 290 | + $this->_views['all']['count'] = $this->_total_registrations(); |
|
| 291 | + $this->_views['month']['count'] = $this->_total_registrations_this_month(); |
|
| 292 | + $this->_views['today']['count'] = $this->_total_registrations_today(); |
|
| 293 | + if (EE_Registry::instance()->CAP->current_user_can( |
|
| 294 | + 'ee_delete_registrations', |
|
| 295 | + 'espresso_registrations_trash_registrations' |
|
| 296 | + )) { |
|
| 297 | + $this->_views['incomplete']['count'] = $this->_total_registrations('incomplete'); |
|
| 298 | + $this->_views['trash']['count'] = $this->_total_registrations('trash'); |
|
| 299 | + } |
|
| 300 | + } |
|
| 301 | 301 | |
| 302 | 302 | |
| 303 | - /** |
|
| 304 | - * _total_registrations |
|
| 305 | - * |
|
| 306 | - * @access protected |
|
| 307 | - * @param string $view |
|
| 308 | - * @return int |
|
| 309 | - * @throws EE_Error |
|
| 310 | - * @throws InvalidArgumentException |
|
| 311 | - * @throws InvalidDataTypeException |
|
| 312 | - * @throws InvalidInterfaceException |
|
| 313 | - */ |
|
| 314 | - protected function _total_registrations($view = '') |
|
| 315 | - { |
|
| 316 | - $_where = array(); |
|
| 317 | - $EVT_ID = isset($this->_req_data['event_id']) ? absint($this->_req_data['event_id']) : false; |
|
| 318 | - if ($EVT_ID) { |
|
| 319 | - $_where['EVT_ID'] = $EVT_ID; |
|
| 320 | - } |
|
| 321 | - switch ($view) { |
|
| 322 | - case 'trash': |
|
| 323 | - return EEM_Registration::instance()->count_deleted(array($_where)); |
|
| 324 | - break; |
|
| 325 | - case 'incomplete': |
|
| 326 | - $_where['STS_ID'] = EEM_Registration::status_id_incomplete; |
|
| 327 | - break; |
|
| 328 | - default: |
|
| 329 | - $_where['STS_ID'] = array('!=', EEM_Registration::status_id_incomplete); |
|
| 330 | - } |
|
| 331 | - return EEM_Registration::instance()->count(array($_where)); |
|
| 332 | - } |
|
| 303 | + /** |
|
| 304 | + * _total_registrations |
|
| 305 | + * |
|
| 306 | + * @access protected |
|
| 307 | + * @param string $view |
|
| 308 | + * @return int |
|
| 309 | + * @throws EE_Error |
|
| 310 | + * @throws InvalidArgumentException |
|
| 311 | + * @throws InvalidDataTypeException |
|
| 312 | + * @throws InvalidInterfaceException |
|
| 313 | + */ |
|
| 314 | + protected function _total_registrations($view = '') |
|
| 315 | + { |
|
| 316 | + $_where = array(); |
|
| 317 | + $EVT_ID = isset($this->_req_data['event_id']) ? absint($this->_req_data['event_id']) : false; |
|
| 318 | + if ($EVT_ID) { |
|
| 319 | + $_where['EVT_ID'] = $EVT_ID; |
|
| 320 | + } |
|
| 321 | + switch ($view) { |
|
| 322 | + case 'trash': |
|
| 323 | + return EEM_Registration::instance()->count_deleted(array($_where)); |
|
| 324 | + break; |
|
| 325 | + case 'incomplete': |
|
| 326 | + $_where['STS_ID'] = EEM_Registration::status_id_incomplete; |
|
| 327 | + break; |
|
| 328 | + default: |
|
| 329 | + $_where['STS_ID'] = array('!=', EEM_Registration::status_id_incomplete); |
|
| 330 | + } |
|
| 331 | + return EEM_Registration::instance()->count(array($_where)); |
|
| 332 | + } |
|
| 333 | 333 | |
| 334 | 334 | |
| 335 | - /** |
|
| 336 | - * _total_registrations_this_month |
|
| 337 | - * |
|
| 338 | - * @access protected |
|
| 339 | - * @return int |
|
| 340 | - * @throws EE_Error |
|
| 341 | - * @throws InvalidArgumentException |
|
| 342 | - * @throws InvalidDataTypeException |
|
| 343 | - * @throws InvalidInterfaceException |
|
| 344 | - */ |
|
| 345 | - protected function _total_registrations_this_month() |
|
| 346 | - { |
|
| 347 | - $EVT_ID = isset($this->_req_data['event_id']) ? absint($this->_req_data['event_id']) : false; |
|
| 348 | - $_where = $EVT_ID ? array('EVT_ID' => $EVT_ID) : array(); |
|
| 349 | - $this_year_r = date('Y', current_time('timestamp')); |
|
| 350 | - $time_start = ' 00:00:00'; |
|
| 351 | - $time_end = ' 23:59:59'; |
|
| 352 | - $this_month_r = date('m', current_time('timestamp')); |
|
| 353 | - $days_this_month = date('t', current_time('timestamp')); |
|
| 354 | - //setup date query. |
|
| 355 | - $beginning_string = EEM_Registration::instance()->convert_datetime_for_query( |
|
| 356 | - 'REG_date', |
|
| 357 | - $this_year_r . '-' . $this_month_r . '-01' . ' ' . $time_start, |
|
| 358 | - 'Y-m-d H:i:s' |
|
| 359 | - ); |
|
| 360 | - $end_string = EEM_Registration::instance()->convert_datetime_for_query( |
|
| 361 | - 'REG_date', |
|
| 362 | - $this_year_r . '-' . $this_month_r . '-' . $days_this_month . ' ' . $time_end, |
|
| 363 | - 'Y-m-d H:i:s' |
|
| 364 | - ); |
|
| 365 | - $_where['REG_date'] = array( |
|
| 366 | - 'BETWEEN', |
|
| 367 | - array( |
|
| 368 | - $beginning_string, |
|
| 369 | - $end_string, |
|
| 370 | - ), |
|
| 371 | - ); |
|
| 372 | - $_where['STS_ID'] = array('!=', EEM_Registration::status_id_incomplete); |
|
| 373 | - return EEM_Registration::instance()->count(array($_where)); |
|
| 374 | - } |
|
| 335 | + /** |
|
| 336 | + * _total_registrations_this_month |
|
| 337 | + * |
|
| 338 | + * @access protected |
|
| 339 | + * @return int |
|
| 340 | + * @throws EE_Error |
|
| 341 | + * @throws InvalidArgumentException |
|
| 342 | + * @throws InvalidDataTypeException |
|
| 343 | + * @throws InvalidInterfaceException |
|
| 344 | + */ |
|
| 345 | + protected function _total_registrations_this_month() |
|
| 346 | + { |
|
| 347 | + $EVT_ID = isset($this->_req_data['event_id']) ? absint($this->_req_data['event_id']) : false; |
|
| 348 | + $_where = $EVT_ID ? array('EVT_ID' => $EVT_ID) : array(); |
|
| 349 | + $this_year_r = date('Y', current_time('timestamp')); |
|
| 350 | + $time_start = ' 00:00:00'; |
|
| 351 | + $time_end = ' 23:59:59'; |
|
| 352 | + $this_month_r = date('m', current_time('timestamp')); |
|
| 353 | + $days_this_month = date('t', current_time('timestamp')); |
|
| 354 | + //setup date query. |
|
| 355 | + $beginning_string = EEM_Registration::instance()->convert_datetime_for_query( |
|
| 356 | + 'REG_date', |
|
| 357 | + $this_year_r . '-' . $this_month_r . '-01' . ' ' . $time_start, |
|
| 358 | + 'Y-m-d H:i:s' |
|
| 359 | + ); |
|
| 360 | + $end_string = EEM_Registration::instance()->convert_datetime_for_query( |
|
| 361 | + 'REG_date', |
|
| 362 | + $this_year_r . '-' . $this_month_r . '-' . $days_this_month . ' ' . $time_end, |
|
| 363 | + 'Y-m-d H:i:s' |
|
| 364 | + ); |
|
| 365 | + $_where['REG_date'] = array( |
|
| 366 | + 'BETWEEN', |
|
| 367 | + array( |
|
| 368 | + $beginning_string, |
|
| 369 | + $end_string, |
|
| 370 | + ), |
|
| 371 | + ); |
|
| 372 | + $_where['STS_ID'] = array('!=', EEM_Registration::status_id_incomplete); |
|
| 373 | + return EEM_Registration::instance()->count(array($_where)); |
|
| 374 | + } |
|
| 375 | 375 | |
| 376 | 376 | |
| 377 | - /** |
|
| 378 | - * _total_registrations_today |
|
| 379 | - * |
|
| 380 | - * @access protected |
|
| 381 | - * @return int |
|
| 382 | - * @throws EE_Error |
|
| 383 | - * @throws InvalidArgumentException |
|
| 384 | - * @throws InvalidDataTypeException |
|
| 385 | - * @throws InvalidInterfaceException |
|
| 386 | - */ |
|
| 387 | - protected function _total_registrations_today() |
|
| 388 | - { |
|
| 389 | - $EVT_ID = isset($this->_req_data['event_id']) ? absint($this->_req_data['event_id']) : false; |
|
| 390 | - $_where = $EVT_ID ? array('EVT_ID' => $EVT_ID) : array(); |
|
| 391 | - $current_date = date('Y-m-d', current_time('timestamp')); |
|
| 392 | - $time_start = ' 00:00:00'; |
|
| 393 | - $time_end = ' 23:59:59'; |
|
| 394 | - $_where['REG_date'] = array( |
|
| 395 | - 'BETWEEN', |
|
| 396 | - array( |
|
| 397 | - EEM_Registration::instance()->convert_datetime_for_query( |
|
| 398 | - 'REG_date', |
|
| 399 | - $current_date . $time_start, |
|
| 400 | - 'Y-m-d H:i:s' |
|
| 401 | - ), |
|
| 402 | - EEM_Registration::instance()->convert_datetime_for_query( |
|
| 403 | - 'REG_date', |
|
| 404 | - $current_date . $time_end, |
|
| 405 | - 'Y-m-d H:i:s' |
|
| 406 | - ), |
|
| 407 | - ), |
|
| 408 | - ); |
|
| 409 | - $_where['STS_ID'] = array('!=', EEM_Registration::status_id_incomplete); |
|
| 410 | - return EEM_Registration::instance()->count(array($_where)); |
|
| 411 | - } |
|
| 377 | + /** |
|
| 378 | + * _total_registrations_today |
|
| 379 | + * |
|
| 380 | + * @access protected |
|
| 381 | + * @return int |
|
| 382 | + * @throws EE_Error |
|
| 383 | + * @throws InvalidArgumentException |
|
| 384 | + * @throws InvalidDataTypeException |
|
| 385 | + * @throws InvalidInterfaceException |
|
| 386 | + */ |
|
| 387 | + protected function _total_registrations_today() |
|
| 388 | + { |
|
| 389 | + $EVT_ID = isset($this->_req_data['event_id']) ? absint($this->_req_data['event_id']) : false; |
|
| 390 | + $_where = $EVT_ID ? array('EVT_ID' => $EVT_ID) : array(); |
|
| 391 | + $current_date = date('Y-m-d', current_time('timestamp')); |
|
| 392 | + $time_start = ' 00:00:00'; |
|
| 393 | + $time_end = ' 23:59:59'; |
|
| 394 | + $_where['REG_date'] = array( |
|
| 395 | + 'BETWEEN', |
|
| 396 | + array( |
|
| 397 | + EEM_Registration::instance()->convert_datetime_for_query( |
|
| 398 | + 'REG_date', |
|
| 399 | + $current_date . $time_start, |
|
| 400 | + 'Y-m-d H:i:s' |
|
| 401 | + ), |
|
| 402 | + EEM_Registration::instance()->convert_datetime_for_query( |
|
| 403 | + 'REG_date', |
|
| 404 | + $current_date . $time_end, |
|
| 405 | + 'Y-m-d H:i:s' |
|
| 406 | + ), |
|
| 407 | + ), |
|
| 408 | + ); |
|
| 409 | + $_where['STS_ID'] = array('!=', EEM_Registration::status_id_incomplete); |
|
| 410 | + return EEM_Registration::instance()->count(array($_where)); |
|
| 411 | + } |
|
| 412 | 412 | |
| 413 | 413 | |
| 414 | - /** |
|
| 415 | - * column_cb |
|
| 416 | - * |
|
| 417 | - * @access public |
|
| 418 | - * @param \EE_Registration $item |
|
| 419 | - * @return string |
|
| 420 | - * @throws EE_Error |
|
| 421 | - * @throws InvalidArgumentException |
|
| 422 | - * @throws InvalidDataTypeException |
|
| 423 | - * @throws InvalidInterfaceException |
|
| 424 | - * @throws ReflectionException |
|
| 425 | - */ |
|
| 426 | - public function column_cb($item) |
|
| 427 | - { |
|
| 428 | - /** checkbox/lock **/ |
|
| 429 | - $transaction = $item->get_first_related('Transaction'); |
|
| 430 | - $payment_count = $transaction instanceof EE_Transaction |
|
| 431 | - ? $transaction->count_related('Payment') |
|
| 432 | - : 0; |
|
| 433 | - return $payment_count > 0 |
|
| 434 | - || ! EE_Registry::instance()->CAP->current_user_can( |
|
| 435 | - 'ee_edit_registration', |
|
| 436 | - 'registration_list_table_checkbox_input', |
|
| 437 | - $item->ID() |
|
| 438 | - ) |
|
| 439 | - ? sprintf('<input type="checkbox" name="_REG_ID[]" value="%1$d" />', $item->ID()) |
|
| 440 | - . '<span class="ee-lock-icon"></span>' |
|
| 441 | - : sprintf('<input type="checkbox" name="_REG_ID[]" value="%1$d" />', $item->ID()); |
|
| 442 | - } |
|
| 414 | + /** |
|
| 415 | + * column_cb |
|
| 416 | + * |
|
| 417 | + * @access public |
|
| 418 | + * @param \EE_Registration $item |
|
| 419 | + * @return string |
|
| 420 | + * @throws EE_Error |
|
| 421 | + * @throws InvalidArgumentException |
|
| 422 | + * @throws InvalidDataTypeException |
|
| 423 | + * @throws InvalidInterfaceException |
|
| 424 | + * @throws ReflectionException |
|
| 425 | + */ |
|
| 426 | + public function column_cb($item) |
|
| 427 | + { |
|
| 428 | + /** checkbox/lock **/ |
|
| 429 | + $transaction = $item->get_first_related('Transaction'); |
|
| 430 | + $payment_count = $transaction instanceof EE_Transaction |
|
| 431 | + ? $transaction->count_related('Payment') |
|
| 432 | + : 0; |
|
| 433 | + return $payment_count > 0 |
|
| 434 | + || ! EE_Registry::instance()->CAP->current_user_can( |
|
| 435 | + 'ee_edit_registration', |
|
| 436 | + 'registration_list_table_checkbox_input', |
|
| 437 | + $item->ID() |
|
| 438 | + ) |
|
| 439 | + ? sprintf('<input type="checkbox" name="_REG_ID[]" value="%1$d" />', $item->ID()) |
|
| 440 | + . '<span class="ee-lock-icon"></span>' |
|
| 441 | + : sprintf('<input type="checkbox" name="_REG_ID[]" value="%1$d" />', $item->ID()); |
|
| 442 | + } |
|
| 443 | 443 | |
| 444 | 444 | |
| 445 | - /** |
|
| 446 | - * column__REG_ID |
|
| 447 | - * |
|
| 448 | - * @access public |
|
| 449 | - * @param \EE_Registration $item |
|
| 450 | - * @return string |
|
| 451 | - * @throws EE_Error |
|
| 452 | - * @throws InvalidArgumentException |
|
| 453 | - * @throws InvalidDataTypeException |
|
| 454 | - * @throws InvalidInterfaceException |
|
| 455 | - * @throws ReflectionException |
|
| 456 | - */ |
|
| 457 | - public function column__REG_ID(EE_Registration $item) |
|
| 458 | - { |
|
| 459 | - $attendee = $item->attendee(); |
|
| 460 | - $content = $item->ID(); |
|
| 461 | - $content .= '<div class="show-on-mobile-view-only">'; |
|
| 462 | - $content .= '<br>'; |
|
| 463 | - $content .= $attendee instanceof EE_Attendee ? $attendee->full_name() : ''; |
|
| 464 | - $content .= ' ' . sprintf(__('(%1$s / %2$s)', 'event_espresso'), $item->count(), $item->group_size()); |
|
| 465 | - $content .= '<br>' . sprintf(__('Reg Code: %s', 'event_espresso'), $item->get('REG_code')); |
|
| 466 | - $content .= '</div>'; |
|
| 467 | - return $content; |
|
| 468 | - } |
|
| 445 | + /** |
|
| 446 | + * column__REG_ID |
|
| 447 | + * |
|
| 448 | + * @access public |
|
| 449 | + * @param \EE_Registration $item |
|
| 450 | + * @return string |
|
| 451 | + * @throws EE_Error |
|
| 452 | + * @throws InvalidArgumentException |
|
| 453 | + * @throws InvalidDataTypeException |
|
| 454 | + * @throws InvalidInterfaceException |
|
| 455 | + * @throws ReflectionException |
|
| 456 | + */ |
|
| 457 | + public function column__REG_ID(EE_Registration $item) |
|
| 458 | + { |
|
| 459 | + $attendee = $item->attendee(); |
|
| 460 | + $content = $item->ID(); |
|
| 461 | + $content .= '<div class="show-on-mobile-view-only">'; |
|
| 462 | + $content .= '<br>'; |
|
| 463 | + $content .= $attendee instanceof EE_Attendee ? $attendee->full_name() : ''; |
|
| 464 | + $content .= ' ' . sprintf(__('(%1$s / %2$s)', 'event_espresso'), $item->count(), $item->group_size()); |
|
| 465 | + $content .= '<br>' . sprintf(__('Reg Code: %s', 'event_espresso'), $item->get('REG_code')); |
|
| 466 | + $content .= '</div>'; |
|
| 467 | + return $content; |
|
| 468 | + } |
|
| 469 | 469 | |
| 470 | 470 | |
| 471 | - /** |
|
| 472 | - * column__REG_date |
|
| 473 | - * |
|
| 474 | - * @access public |
|
| 475 | - * @param \EE_Registration $item |
|
| 476 | - * @return string |
|
| 477 | - * @throws EE_Error |
|
| 478 | - * @throws InvalidArgumentException |
|
| 479 | - * @throws InvalidDataTypeException |
|
| 480 | - * @throws InvalidInterfaceException |
|
| 481 | - * @throws ReflectionException |
|
| 482 | - */ |
|
| 483 | - public function column__REG_date(EE_Registration $item) |
|
| 484 | - { |
|
| 485 | - $this->_set_related_details($item); |
|
| 486 | - //Build row actions |
|
| 487 | - $view_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array( |
|
| 488 | - 'action' => 'view_transaction', |
|
| 489 | - 'TXN_ID' => $this->_transaction_details['id'], |
|
| 490 | - ), TXN_ADMIN_URL); |
|
| 491 | - $view_link = EE_Registry::instance()->CAP->current_user_can( |
|
| 492 | - 'ee_read_transaction', |
|
| 493 | - 'espresso_transactions_view_transaction' |
|
| 494 | - ) |
|
| 495 | - ? '<a class="ee-status-color-' |
|
| 496 | - . $this->_transaction_details['status'] |
|
| 497 | - . '" href="' |
|
| 498 | - . $view_lnk_url |
|
| 499 | - . '" title="' |
|
| 500 | - . esc_attr($this->_transaction_details['title_attr']) |
|
| 501 | - . '">' |
|
| 502 | - . $item->get_i18n_datetime('REG_date') |
|
| 503 | - . '</a>' : $item->get_i18n_datetime('REG_date'); |
|
| 504 | - $view_link .= '<br><span class="ee-status-text-small">' |
|
| 505 | - . EEH_Template::pretty_status($this->_transaction_details['status'], false, 'sentence') |
|
| 506 | - . '</span>'; |
|
| 507 | - return $view_link; |
|
| 508 | - } |
|
| 471 | + /** |
|
| 472 | + * column__REG_date |
|
| 473 | + * |
|
| 474 | + * @access public |
|
| 475 | + * @param \EE_Registration $item |
|
| 476 | + * @return string |
|
| 477 | + * @throws EE_Error |
|
| 478 | + * @throws InvalidArgumentException |
|
| 479 | + * @throws InvalidDataTypeException |
|
| 480 | + * @throws InvalidInterfaceException |
|
| 481 | + * @throws ReflectionException |
|
| 482 | + */ |
|
| 483 | + public function column__REG_date(EE_Registration $item) |
|
| 484 | + { |
|
| 485 | + $this->_set_related_details($item); |
|
| 486 | + //Build row actions |
|
| 487 | + $view_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array( |
|
| 488 | + 'action' => 'view_transaction', |
|
| 489 | + 'TXN_ID' => $this->_transaction_details['id'], |
|
| 490 | + ), TXN_ADMIN_URL); |
|
| 491 | + $view_link = EE_Registry::instance()->CAP->current_user_can( |
|
| 492 | + 'ee_read_transaction', |
|
| 493 | + 'espresso_transactions_view_transaction' |
|
| 494 | + ) |
|
| 495 | + ? '<a class="ee-status-color-' |
|
| 496 | + . $this->_transaction_details['status'] |
|
| 497 | + . '" href="' |
|
| 498 | + . $view_lnk_url |
|
| 499 | + . '" title="' |
|
| 500 | + . esc_attr($this->_transaction_details['title_attr']) |
|
| 501 | + . '">' |
|
| 502 | + . $item->get_i18n_datetime('REG_date') |
|
| 503 | + . '</a>' : $item->get_i18n_datetime('REG_date'); |
|
| 504 | + $view_link .= '<br><span class="ee-status-text-small">' |
|
| 505 | + . EEH_Template::pretty_status($this->_transaction_details['status'], false, 'sentence') |
|
| 506 | + . '</span>'; |
|
| 507 | + return $view_link; |
|
| 508 | + } |
|
| 509 | 509 | |
| 510 | 510 | |
| 511 | - /** |
|
| 512 | - * column_event_name |
|
| 513 | - * |
|
| 514 | - * @access public |
|
| 515 | - * @param \EE_Registration $item |
|
| 516 | - * @return string |
|
| 517 | - * @throws EE_Error |
|
| 518 | - * @throws InvalidArgumentException |
|
| 519 | - * @throws InvalidDataTypeException |
|
| 520 | - * @throws InvalidInterfaceException |
|
| 521 | - * @throws ReflectionException |
|
| 522 | - */ |
|
| 523 | - public function column_event_name(EE_Registration $item) |
|
| 524 | - { |
|
| 525 | - $this->_set_related_details($item); |
|
| 526 | - // page=espresso_events&action=edit_event&EVT_ID=2&edit_event_nonce=cf3a7e5b62 |
|
| 527 | - $EVT_ID = $item->event_ID(); |
|
| 528 | - $event_name = $item->event_name(); |
|
| 529 | - $event_name = $event_name ? $event_name : __("No Associated Event", 'event_espresso'); |
|
| 530 | - $event_name = wp_trim_words($event_name, 30, '...'); |
|
| 531 | - if ($EVT_ID) { |
|
| 532 | - $edit_event_url = EE_Admin_Page::add_query_args_and_nonce( |
|
| 533 | - array('action' => 'edit', 'post' => $EVT_ID), |
|
| 534 | - EVENTS_ADMIN_URL |
|
| 535 | - ); |
|
| 536 | - $edit_event = EE_Registry::instance()->CAP->current_user_can('ee_edit_event', 'edit_event', $EVT_ID) |
|
| 537 | - ? '<a class="ee-status-color-' |
|
| 538 | - . $this->_event_details['status'] |
|
| 539 | - . '" href="' |
|
| 540 | - . $edit_event_url |
|
| 541 | - . '" title="' |
|
| 542 | - . esc_attr($this->_event_details['title_attr']) |
|
| 543 | - . '">' |
|
| 544 | - . $event_name |
|
| 545 | - . '</a>' : $event_name; |
|
| 546 | - $edit_event_url = EE_Admin_Page::add_query_args_and_nonce(array('event_id' => $EVT_ID), REG_ADMIN_URL); |
|
| 547 | - $actions['event_filter'] = '<a href="' . $edit_event_url . '" title="'; |
|
| 548 | - $actions['event_filter'] .= sprintf( |
|
| 549 | - esc_attr__('Filter this list to only show registrations for %s', 'event_espresso'), |
|
| 550 | - $event_name |
|
| 551 | - ); |
|
| 552 | - $actions['event_filter'] .= '">' . __('View Registrations', 'event_espresso') . '</a>'; |
|
| 553 | - } else { |
|
| 554 | - $edit_event = $event_name; |
|
| 555 | - $actions['event_filter'] = ''; |
|
| 556 | - } |
|
| 557 | - return sprintf('%1$s %2$s', $edit_event, $this->row_actions($actions)); |
|
| 558 | - } |
|
| 511 | + /** |
|
| 512 | + * column_event_name |
|
| 513 | + * |
|
| 514 | + * @access public |
|
| 515 | + * @param \EE_Registration $item |
|
| 516 | + * @return string |
|
| 517 | + * @throws EE_Error |
|
| 518 | + * @throws InvalidArgumentException |
|
| 519 | + * @throws InvalidDataTypeException |
|
| 520 | + * @throws InvalidInterfaceException |
|
| 521 | + * @throws ReflectionException |
|
| 522 | + */ |
|
| 523 | + public function column_event_name(EE_Registration $item) |
|
| 524 | + { |
|
| 525 | + $this->_set_related_details($item); |
|
| 526 | + // page=espresso_events&action=edit_event&EVT_ID=2&edit_event_nonce=cf3a7e5b62 |
|
| 527 | + $EVT_ID = $item->event_ID(); |
|
| 528 | + $event_name = $item->event_name(); |
|
| 529 | + $event_name = $event_name ? $event_name : __("No Associated Event", 'event_espresso'); |
|
| 530 | + $event_name = wp_trim_words($event_name, 30, '...'); |
|
| 531 | + if ($EVT_ID) { |
|
| 532 | + $edit_event_url = EE_Admin_Page::add_query_args_and_nonce( |
|
| 533 | + array('action' => 'edit', 'post' => $EVT_ID), |
|
| 534 | + EVENTS_ADMIN_URL |
|
| 535 | + ); |
|
| 536 | + $edit_event = EE_Registry::instance()->CAP->current_user_can('ee_edit_event', 'edit_event', $EVT_ID) |
|
| 537 | + ? '<a class="ee-status-color-' |
|
| 538 | + . $this->_event_details['status'] |
|
| 539 | + . '" href="' |
|
| 540 | + . $edit_event_url |
|
| 541 | + . '" title="' |
|
| 542 | + . esc_attr($this->_event_details['title_attr']) |
|
| 543 | + . '">' |
|
| 544 | + . $event_name |
|
| 545 | + . '</a>' : $event_name; |
|
| 546 | + $edit_event_url = EE_Admin_Page::add_query_args_and_nonce(array('event_id' => $EVT_ID), REG_ADMIN_URL); |
|
| 547 | + $actions['event_filter'] = '<a href="' . $edit_event_url . '" title="'; |
|
| 548 | + $actions['event_filter'] .= sprintf( |
|
| 549 | + esc_attr__('Filter this list to only show registrations for %s', 'event_espresso'), |
|
| 550 | + $event_name |
|
| 551 | + ); |
|
| 552 | + $actions['event_filter'] .= '">' . __('View Registrations', 'event_espresso') . '</a>'; |
|
| 553 | + } else { |
|
| 554 | + $edit_event = $event_name; |
|
| 555 | + $actions['event_filter'] = ''; |
|
| 556 | + } |
|
| 557 | + return sprintf('%1$s %2$s', $edit_event, $this->row_actions($actions)); |
|
| 558 | + } |
|
| 559 | 559 | |
| 560 | 560 | |
| 561 | - /** |
|
| 562 | - * column_DTT_EVT_start |
|
| 563 | - * |
|
| 564 | - * @access public |
|
| 565 | - * @param \EE_Registration $item |
|
| 566 | - * @return string |
|
| 567 | - * @throws EE_Error |
|
| 568 | - * @throws InvalidArgumentException |
|
| 569 | - * @throws InvalidDataTypeException |
|
| 570 | - * @throws InvalidInterfaceException |
|
| 571 | - * @throws ReflectionException |
|
| 572 | - */ |
|
| 573 | - public function column_DTT_EVT_start(EE_Registration $item) |
|
| 574 | - { |
|
| 575 | - $datetime_strings = array(); |
|
| 576 | - $ticket = $item->ticket(true); |
|
| 577 | - if ($ticket instanceof EE_Ticket) { |
|
| 578 | - $remove_defaults = array('default_where_conditions' => 'none'); |
|
| 579 | - $datetimes = $ticket->datetimes($remove_defaults); |
|
| 580 | - foreach ($datetimes as $datetime) { |
|
| 581 | - $datetime_strings[] = $datetime->get_i18n_datetime('DTT_EVT_start'); |
|
| 582 | - } |
|
| 583 | - return $this->generateDisplayForDatetimes($datetime_strings); |
|
| 584 | - } |
|
| 585 | - return __('There is no ticket on this registration', 'event_espresso'); |
|
| 586 | - } |
|
| 561 | + /** |
|
| 562 | + * column_DTT_EVT_start |
|
| 563 | + * |
|
| 564 | + * @access public |
|
| 565 | + * @param \EE_Registration $item |
|
| 566 | + * @return string |
|
| 567 | + * @throws EE_Error |
|
| 568 | + * @throws InvalidArgumentException |
|
| 569 | + * @throws InvalidDataTypeException |
|
| 570 | + * @throws InvalidInterfaceException |
|
| 571 | + * @throws ReflectionException |
|
| 572 | + */ |
|
| 573 | + public function column_DTT_EVT_start(EE_Registration $item) |
|
| 574 | + { |
|
| 575 | + $datetime_strings = array(); |
|
| 576 | + $ticket = $item->ticket(true); |
|
| 577 | + if ($ticket instanceof EE_Ticket) { |
|
| 578 | + $remove_defaults = array('default_where_conditions' => 'none'); |
|
| 579 | + $datetimes = $ticket->datetimes($remove_defaults); |
|
| 580 | + foreach ($datetimes as $datetime) { |
|
| 581 | + $datetime_strings[] = $datetime->get_i18n_datetime('DTT_EVT_start'); |
|
| 582 | + } |
|
| 583 | + return $this->generateDisplayForDatetimes($datetime_strings); |
|
| 584 | + } |
|
| 585 | + return __('There is no ticket on this registration', 'event_espresso'); |
|
| 586 | + } |
|
| 587 | 587 | |
| 588 | 588 | |
| 589 | - /** |
|
| 590 | - * Receives an array of datetime strings to display and converts them to the html container for the column. |
|
| 591 | - * |
|
| 592 | - * @param array $datetime_strings |
|
| 593 | - * @return string |
|
| 594 | - */ |
|
| 595 | - public function generateDisplayForDateTimes(array $datetime_strings) |
|
| 596 | - { |
|
| 597 | - $content = '<div class="ee-registration-event-datetimes-container">'; |
|
| 598 | - $expand_toggle = count($datetime_strings) > 1 |
|
| 599 | - ? ' <span title="' . esc_attr__('Click to view all dates', 'event_espresso') |
|
| 600 | - . '" class="ee-js ee-more-datetimes-toggle dashicons dashicons-plus"></span>' |
|
| 601 | - : ''; |
|
| 602 | - //get first item for initial visibility |
|
| 603 | - $content .= '<div class="left">' . array_shift($datetime_strings) . '</div>'; |
|
| 604 | - $content .= $expand_toggle; |
|
| 605 | - if ($datetime_strings) { |
|
| 606 | - $content .= '<div style="clear:both"></div>'; |
|
| 607 | - $content .= '<div class="ee-registration-event-datetimes-container more-items hidden">'; |
|
| 608 | - $content .= implode("<br />", $datetime_strings); |
|
| 609 | - $content .= '</div>'; |
|
| 610 | - } |
|
| 611 | - $content .= '</div>'; |
|
| 612 | - return $content; |
|
| 613 | - } |
|
| 589 | + /** |
|
| 590 | + * Receives an array of datetime strings to display and converts them to the html container for the column. |
|
| 591 | + * |
|
| 592 | + * @param array $datetime_strings |
|
| 593 | + * @return string |
|
| 594 | + */ |
|
| 595 | + public function generateDisplayForDateTimes(array $datetime_strings) |
|
| 596 | + { |
|
| 597 | + $content = '<div class="ee-registration-event-datetimes-container">'; |
|
| 598 | + $expand_toggle = count($datetime_strings) > 1 |
|
| 599 | + ? ' <span title="' . esc_attr__('Click to view all dates', 'event_espresso') |
|
| 600 | + . '" class="ee-js ee-more-datetimes-toggle dashicons dashicons-plus"></span>' |
|
| 601 | + : ''; |
|
| 602 | + //get first item for initial visibility |
|
| 603 | + $content .= '<div class="left">' . array_shift($datetime_strings) . '</div>'; |
|
| 604 | + $content .= $expand_toggle; |
|
| 605 | + if ($datetime_strings) { |
|
| 606 | + $content .= '<div style="clear:both"></div>'; |
|
| 607 | + $content .= '<div class="ee-registration-event-datetimes-container more-items hidden">'; |
|
| 608 | + $content .= implode("<br />", $datetime_strings); |
|
| 609 | + $content .= '</div>'; |
|
| 610 | + } |
|
| 611 | + $content .= '</div>'; |
|
| 612 | + return $content; |
|
| 613 | + } |
|
| 614 | 614 | |
| 615 | 615 | |
| 616 | - /** |
|
| 617 | - * column_ATT_fname |
|
| 618 | - * |
|
| 619 | - * @access public |
|
| 620 | - * @param \EE_Registration $item |
|
| 621 | - * @return string |
|
| 622 | - * @throws EE_Error |
|
| 623 | - * @throws InvalidArgumentException |
|
| 624 | - * @throws InvalidDataTypeException |
|
| 625 | - * @throws InvalidInterfaceException |
|
| 626 | - * @throws ReflectionException |
|
| 627 | - */ |
|
| 628 | - public function column_ATT_fname(EE_Registration $item) |
|
| 629 | - { |
|
| 630 | - $attendee = $item->attendee(); |
|
| 631 | - $edit_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array( |
|
| 632 | - 'action' => 'view_registration', |
|
| 633 | - '_REG_ID' => $item->ID(), |
|
| 634 | - ), REG_ADMIN_URL); |
|
| 635 | - $attendee_name = $attendee instanceof EE_Attendee ? $attendee->full_name() : ''; |
|
| 636 | - $link = EE_Registry::instance()->CAP->current_user_can( |
|
| 637 | - 'ee_read_registration', |
|
| 638 | - 'espresso_registrations_view_registration', |
|
| 639 | - $item->ID() |
|
| 640 | - ) |
|
| 641 | - ? '<a href="' |
|
| 642 | - . $edit_lnk_url |
|
| 643 | - . '" title="' |
|
| 644 | - . esc_attr__('View Registration Details', 'event_espresso') |
|
| 645 | - . '">' |
|
| 646 | - . $attendee_name |
|
| 647 | - . '</a>' : $attendee_name; |
|
| 648 | - $link .= $item->count() === 1 |
|
| 649 | - ? ' <sup><div class="dashicons dashicons-star-filled lt-blue-icon ee-icon-size-8"></div></sup>' : ''; |
|
| 650 | - $t = $item->get_first_related('Transaction'); |
|
| 651 | - $payment_count = $t instanceof EE_Transaction ? $t->count_related('Payment') : 0; |
|
| 652 | - //append group count to name |
|
| 653 | - $link .= ' ' . sprintf(__('(%1$s / %2$s)', 'event_espresso'), $item->count(), $item->group_size()); |
|
| 654 | - //append reg_code |
|
| 655 | - $link .= '<br>' . sprintf(__('Reg Code: %s', 'event_espresso'), $item->get('REG_code')); |
|
| 656 | - //reg status text for accessibility |
|
| 657 | - $link .= '<br><span class="ee-status-text-small">' |
|
| 658 | - . EEH_Template::pretty_status($item->status_ID(), false, 'sentence') |
|
| 659 | - . '</span>'; |
|
| 660 | - //trash/restore/delete actions |
|
| 661 | - $actions = array(); |
|
| 662 | - if ($this->_view !== 'trash' |
|
| 663 | - && $payment_count === 0 |
|
| 664 | - && EE_Registry::instance()->CAP->current_user_can( |
|
| 665 | - 'ee_delete_registration', |
|
| 666 | - 'espresso_registrations_trash_registrations', |
|
| 667 | - $item->ID() |
|
| 668 | - )) { |
|
| 669 | - $trash_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array( |
|
| 670 | - 'action' => 'trash_registrations', |
|
| 671 | - '_REG_ID' => $item->ID(), |
|
| 672 | - ), REG_ADMIN_URL); |
|
| 673 | - $actions['trash'] = '<a href="' |
|
| 674 | - . $trash_lnk_url |
|
| 675 | - . '" title="' |
|
| 676 | - . esc_attr__('Trash Registration', 'event_espresso') |
|
| 677 | - . '">' . __('Trash', 'event_espresso') . '</a>'; |
|
| 678 | - } elseif ($this->_view === 'trash') { |
|
| 679 | - // restore registration link |
|
| 680 | - if (EE_Registry::instance()->CAP->current_user_can( |
|
| 681 | - 'ee_delete_registration', |
|
| 682 | - 'espresso_registrations_restore_registrations', |
|
| 683 | - $item->ID() |
|
| 684 | - )) { |
|
| 685 | - $restore_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array( |
|
| 686 | - 'action' => 'restore_registrations', |
|
| 687 | - '_REG_ID' => $item->ID(), |
|
| 688 | - ), REG_ADMIN_URL); |
|
| 689 | - $actions['restore'] = '<a href="' |
|
| 690 | - . $restore_lnk_url |
|
| 691 | - . '" title="' |
|
| 692 | - . esc_attr__('Restore Registration', 'event_espresso') . '">' |
|
| 693 | - . __('Restore', 'event_espresso') . '</a>'; |
|
| 694 | - } |
|
| 695 | - if (EE_Registry::instance()->CAP->current_user_can( |
|
| 696 | - 'ee_delete_registration', |
|
| 697 | - 'espresso_registrations_ee_delete_registrations', |
|
| 698 | - $item->ID() |
|
| 699 | - )) { |
|
| 700 | - $delete_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array( |
|
| 701 | - 'action' => 'delete_registrations', |
|
| 702 | - '_REG_ID' => $item->ID(), |
|
| 703 | - ), REG_ADMIN_URL); |
|
| 704 | - $actions['delete'] = '<a href="' |
|
| 705 | - . $delete_lnk_url |
|
| 706 | - . '" title="' |
|
| 707 | - . esc_attr__('Delete Registration Permanently', 'event_espresso') |
|
| 708 | - . '">' |
|
| 709 | - . __('Delete', 'event_espresso') |
|
| 710 | - . '</a>'; |
|
| 711 | - } |
|
| 712 | - } |
|
| 713 | - return sprintf('%1$s %2$s', $link, $this->row_actions($actions)); |
|
| 714 | - } |
|
| 616 | + /** |
|
| 617 | + * column_ATT_fname |
|
| 618 | + * |
|
| 619 | + * @access public |
|
| 620 | + * @param \EE_Registration $item |
|
| 621 | + * @return string |
|
| 622 | + * @throws EE_Error |
|
| 623 | + * @throws InvalidArgumentException |
|
| 624 | + * @throws InvalidDataTypeException |
|
| 625 | + * @throws InvalidInterfaceException |
|
| 626 | + * @throws ReflectionException |
|
| 627 | + */ |
|
| 628 | + public function column_ATT_fname(EE_Registration $item) |
|
| 629 | + { |
|
| 630 | + $attendee = $item->attendee(); |
|
| 631 | + $edit_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array( |
|
| 632 | + 'action' => 'view_registration', |
|
| 633 | + '_REG_ID' => $item->ID(), |
|
| 634 | + ), REG_ADMIN_URL); |
|
| 635 | + $attendee_name = $attendee instanceof EE_Attendee ? $attendee->full_name() : ''; |
|
| 636 | + $link = EE_Registry::instance()->CAP->current_user_can( |
|
| 637 | + 'ee_read_registration', |
|
| 638 | + 'espresso_registrations_view_registration', |
|
| 639 | + $item->ID() |
|
| 640 | + ) |
|
| 641 | + ? '<a href="' |
|
| 642 | + . $edit_lnk_url |
|
| 643 | + . '" title="' |
|
| 644 | + . esc_attr__('View Registration Details', 'event_espresso') |
|
| 645 | + . '">' |
|
| 646 | + . $attendee_name |
|
| 647 | + . '</a>' : $attendee_name; |
|
| 648 | + $link .= $item->count() === 1 |
|
| 649 | + ? ' <sup><div class="dashicons dashicons-star-filled lt-blue-icon ee-icon-size-8"></div></sup>' : ''; |
|
| 650 | + $t = $item->get_first_related('Transaction'); |
|
| 651 | + $payment_count = $t instanceof EE_Transaction ? $t->count_related('Payment') : 0; |
|
| 652 | + //append group count to name |
|
| 653 | + $link .= ' ' . sprintf(__('(%1$s / %2$s)', 'event_espresso'), $item->count(), $item->group_size()); |
|
| 654 | + //append reg_code |
|
| 655 | + $link .= '<br>' . sprintf(__('Reg Code: %s', 'event_espresso'), $item->get('REG_code')); |
|
| 656 | + //reg status text for accessibility |
|
| 657 | + $link .= '<br><span class="ee-status-text-small">' |
|
| 658 | + . EEH_Template::pretty_status($item->status_ID(), false, 'sentence') |
|
| 659 | + . '</span>'; |
|
| 660 | + //trash/restore/delete actions |
|
| 661 | + $actions = array(); |
|
| 662 | + if ($this->_view !== 'trash' |
|
| 663 | + && $payment_count === 0 |
|
| 664 | + && EE_Registry::instance()->CAP->current_user_can( |
|
| 665 | + 'ee_delete_registration', |
|
| 666 | + 'espresso_registrations_trash_registrations', |
|
| 667 | + $item->ID() |
|
| 668 | + )) { |
|
| 669 | + $trash_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array( |
|
| 670 | + 'action' => 'trash_registrations', |
|
| 671 | + '_REG_ID' => $item->ID(), |
|
| 672 | + ), REG_ADMIN_URL); |
|
| 673 | + $actions['trash'] = '<a href="' |
|
| 674 | + . $trash_lnk_url |
|
| 675 | + . '" title="' |
|
| 676 | + . esc_attr__('Trash Registration', 'event_espresso') |
|
| 677 | + . '">' . __('Trash', 'event_espresso') . '</a>'; |
|
| 678 | + } elseif ($this->_view === 'trash') { |
|
| 679 | + // restore registration link |
|
| 680 | + if (EE_Registry::instance()->CAP->current_user_can( |
|
| 681 | + 'ee_delete_registration', |
|
| 682 | + 'espresso_registrations_restore_registrations', |
|
| 683 | + $item->ID() |
|
| 684 | + )) { |
|
| 685 | + $restore_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array( |
|
| 686 | + 'action' => 'restore_registrations', |
|
| 687 | + '_REG_ID' => $item->ID(), |
|
| 688 | + ), REG_ADMIN_URL); |
|
| 689 | + $actions['restore'] = '<a href="' |
|
| 690 | + . $restore_lnk_url |
|
| 691 | + . '" title="' |
|
| 692 | + . esc_attr__('Restore Registration', 'event_espresso') . '">' |
|
| 693 | + . __('Restore', 'event_espresso') . '</a>'; |
|
| 694 | + } |
|
| 695 | + if (EE_Registry::instance()->CAP->current_user_can( |
|
| 696 | + 'ee_delete_registration', |
|
| 697 | + 'espresso_registrations_ee_delete_registrations', |
|
| 698 | + $item->ID() |
|
| 699 | + )) { |
|
| 700 | + $delete_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array( |
|
| 701 | + 'action' => 'delete_registrations', |
|
| 702 | + '_REG_ID' => $item->ID(), |
|
| 703 | + ), REG_ADMIN_URL); |
|
| 704 | + $actions['delete'] = '<a href="' |
|
| 705 | + . $delete_lnk_url |
|
| 706 | + . '" title="' |
|
| 707 | + . esc_attr__('Delete Registration Permanently', 'event_espresso') |
|
| 708 | + . '">' |
|
| 709 | + . __('Delete', 'event_espresso') |
|
| 710 | + . '</a>'; |
|
| 711 | + } |
|
| 712 | + } |
|
| 713 | + return sprintf('%1$s %2$s', $link, $this->row_actions($actions)); |
|
| 714 | + } |
|
| 715 | 715 | |
| 716 | 716 | |
| 717 | - /** |
|
| 718 | - * column_ATT_email |
|
| 719 | - * |
|
| 720 | - * @access public |
|
| 721 | - * @param \EE_Registration $item |
|
| 722 | - * @return string |
|
| 723 | - * @throws EE_Error |
|
| 724 | - * @throws InvalidArgumentException |
|
| 725 | - * @throws InvalidDataTypeException |
|
| 726 | - * @throws InvalidInterfaceException |
|
| 727 | - * @throws ReflectionException |
|
| 728 | - */ |
|
| 729 | - public function column_ATT_email(EE_Registration $item) |
|
| 730 | - { |
|
| 731 | - $attendee = $item->get_first_related('Attendee'); |
|
| 732 | - return ! $attendee instanceof EE_Attendee ? __('No attached contact record.', 'event_espresso') |
|
| 733 | - : $attendee->email(); |
|
| 734 | - } |
|
| 717 | + /** |
|
| 718 | + * column_ATT_email |
|
| 719 | + * |
|
| 720 | + * @access public |
|
| 721 | + * @param \EE_Registration $item |
|
| 722 | + * @return string |
|
| 723 | + * @throws EE_Error |
|
| 724 | + * @throws InvalidArgumentException |
|
| 725 | + * @throws InvalidDataTypeException |
|
| 726 | + * @throws InvalidInterfaceException |
|
| 727 | + * @throws ReflectionException |
|
| 728 | + */ |
|
| 729 | + public function column_ATT_email(EE_Registration $item) |
|
| 730 | + { |
|
| 731 | + $attendee = $item->get_first_related('Attendee'); |
|
| 732 | + return ! $attendee instanceof EE_Attendee ? __('No attached contact record.', 'event_espresso') |
|
| 733 | + : $attendee->email(); |
|
| 734 | + } |
|
| 735 | 735 | |
| 736 | 736 | |
| 737 | - /** |
|
| 738 | - * column__REG_count |
|
| 739 | - * |
|
| 740 | - * @access public |
|
| 741 | - * @param \EE_Registration $item |
|
| 742 | - * @return string |
|
| 743 | - */ |
|
| 744 | - public function column__REG_count(EE_Registration $item) |
|
| 745 | - { |
|
| 746 | - return sprintf(__('%1$s / %2$s', 'event_espresso'), $item->count(), $item->group_size()); |
|
| 747 | - } |
|
| 737 | + /** |
|
| 738 | + * column__REG_count |
|
| 739 | + * |
|
| 740 | + * @access public |
|
| 741 | + * @param \EE_Registration $item |
|
| 742 | + * @return string |
|
| 743 | + */ |
|
| 744 | + public function column__REG_count(EE_Registration $item) |
|
| 745 | + { |
|
| 746 | + return sprintf(__('%1$s / %2$s', 'event_espresso'), $item->count(), $item->group_size()); |
|
| 747 | + } |
|
| 748 | 748 | |
| 749 | 749 | |
| 750 | - /** |
|
| 751 | - * column_PRC_amount |
|
| 752 | - * |
|
| 753 | - * @access public |
|
| 754 | - * @param \EE_Registration $item |
|
| 755 | - * @return string |
|
| 756 | - * @throws EE_Error |
|
| 757 | - */ |
|
| 758 | - public function column_PRC_amount(EE_Registration $item) |
|
| 759 | - { |
|
| 760 | - $ticket = $item->ticket(); |
|
| 761 | - $content = isset($_GET['event_id']) && $ticket instanceof EE_Ticket ? '<span class="TKT_name">' |
|
| 762 | - . $ticket->name() |
|
| 763 | - . '</span><br />' : ''; |
|
| 764 | - if ($item->final_price() > 0) { |
|
| 765 | - $content .= '<span class="reg-pad-rght">' . $item->pretty_final_price() . '</span>'; |
|
| 766 | - } else { |
|
| 767 | - // free event |
|
| 768 | - $content .= '<span class="reg-overview-free-event-spn reg-pad-rght">' |
|
| 769 | - . __('free', 'event_espresso') |
|
| 770 | - . '</span>'; |
|
| 771 | - } |
|
| 772 | - return $content; |
|
| 773 | - } |
|
| 750 | + /** |
|
| 751 | + * column_PRC_amount |
|
| 752 | + * |
|
| 753 | + * @access public |
|
| 754 | + * @param \EE_Registration $item |
|
| 755 | + * @return string |
|
| 756 | + * @throws EE_Error |
|
| 757 | + */ |
|
| 758 | + public function column_PRC_amount(EE_Registration $item) |
|
| 759 | + { |
|
| 760 | + $ticket = $item->ticket(); |
|
| 761 | + $content = isset($_GET['event_id']) && $ticket instanceof EE_Ticket ? '<span class="TKT_name">' |
|
| 762 | + . $ticket->name() |
|
| 763 | + . '</span><br />' : ''; |
|
| 764 | + if ($item->final_price() > 0) { |
|
| 765 | + $content .= '<span class="reg-pad-rght">' . $item->pretty_final_price() . '</span>'; |
|
| 766 | + } else { |
|
| 767 | + // free event |
|
| 768 | + $content .= '<span class="reg-overview-free-event-spn reg-pad-rght">' |
|
| 769 | + . __('free', 'event_espresso') |
|
| 770 | + . '</span>'; |
|
| 771 | + } |
|
| 772 | + return $content; |
|
| 773 | + } |
|
| 774 | 774 | |
| 775 | 775 | |
| 776 | - /** |
|
| 777 | - * column__REG_final_price |
|
| 778 | - * |
|
| 779 | - * @access public |
|
| 780 | - * @param \EE_Registration $item |
|
| 781 | - * @return string |
|
| 782 | - * @throws EE_Error |
|
| 783 | - */ |
|
| 784 | - public function column__REG_final_price(EE_Registration $item) |
|
| 785 | - { |
|
| 786 | - $ticket = $item->ticket(); |
|
| 787 | - $content = isset($_GET['event_id']) || ! $ticket instanceof EE_Ticket |
|
| 788 | - ? '' |
|
| 789 | - : '<span class="TKT_name">' |
|
| 790 | - . $ticket->name() |
|
| 791 | - . '</span><br />'; |
|
| 792 | - $content .= '<span class="reg-pad-rght">' . $item->pretty_final_price() . '</span>'; |
|
| 793 | - return $content; |
|
| 794 | - } |
|
| 776 | + /** |
|
| 777 | + * column__REG_final_price |
|
| 778 | + * |
|
| 779 | + * @access public |
|
| 780 | + * @param \EE_Registration $item |
|
| 781 | + * @return string |
|
| 782 | + * @throws EE_Error |
|
| 783 | + */ |
|
| 784 | + public function column__REG_final_price(EE_Registration $item) |
|
| 785 | + { |
|
| 786 | + $ticket = $item->ticket(); |
|
| 787 | + $content = isset($_GET['event_id']) || ! $ticket instanceof EE_Ticket |
|
| 788 | + ? '' |
|
| 789 | + : '<span class="TKT_name">' |
|
| 790 | + . $ticket->name() |
|
| 791 | + . '</span><br />'; |
|
| 792 | + $content .= '<span class="reg-pad-rght">' . $item->pretty_final_price() . '</span>'; |
|
| 793 | + return $content; |
|
| 794 | + } |
|
| 795 | 795 | |
| 796 | 796 | |
| 797 | - /** |
|
| 798 | - * column__REG_paid |
|
| 799 | - * |
|
| 800 | - * @access public |
|
| 801 | - * @param \EE_Registration $item |
|
| 802 | - * @return string |
|
| 803 | - * @throws EE_Error |
|
| 804 | - */ |
|
| 805 | - public function column__REG_paid(EE_Registration $item) |
|
| 806 | - { |
|
| 807 | - $payment_method = $item->payment_method(); |
|
| 808 | - $payment_method_name = $payment_method instanceof EE_Payment_Method ? $payment_method->admin_name() |
|
| 809 | - : __('Unknown', 'event_espresso'); |
|
| 810 | - $content = '<span class="reg-pad-rght">' . $item->pretty_paid() . '</span>'; |
|
| 811 | - if ($item->paid() > 0) { |
|
| 812 | - $content .= '<br><span class="ee-status-text-small">' |
|
| 813 | - . sprintf( |
|
| 814 | - __('...via %s', 'event_espresso'), |
|
| 815 | - $payment_method_name |
|
| 816 | - ) |
|
| 817 | - . '</span>'; |
|
| 818 | - } |
|
| 819 | - return $content; |
|
| 820 | - } |
|
| 797 | + /** |
|
| 798 | + * column__REG_paid |
|
| 799 | + * |
|
| 800 | + * @access public |
|
| 801 | + * @param \EE_Registration $item |
|
| 802 | + * @return string |
|
| 803 | + * @throws EE_Error |
|
| 804 | + */ |
|
| 805 | + public function column__REG_paid(EE_Registration $item) |
|
| 806 | + { |
|
| 807 | + $payment_method = $item->payment_method(); |
|
| 808 | + $payment_method_name = $payment_method instanceof EE_Payment_Method ? $payment_method->admin_name() |
|
| 809 | + : __('Unknown', 'event_espresso'); |
|
| 810 | + $content = '<span class="reg-pad-rght">' . $item->pretty_paid() . '</span>'; |
|
| 811 | + if ($item->paid() > 0) { |
|
| 812 | + $content .= '<br><span class="ee-status-text-small">' |
|
| 813 | + . sprintf( |
|
| 814 | + __('...via %s', 'event_espresso'), |
|
| 815 | + $payment_method_name |
|
| 816 | + ) |
|
| 817 | + . '</span>'; |
|
| 818 | + } |
|
| 819 | + return $content; |
|
| 820 | + } |
|
| 821 | 821 | |
| 822 | 822 | |
| 823 | - /** |
|
| 824 | - * column_TXN_total |
|
| 825 | - * |
|
| 826 | - * @access public |
|
| 827 | - * @param \EE_Registration $item |
|
| 828 | - * @return string |
|
| 829 | - * @throws EE_Error |
|
| 830 | - * @throws EntityNotFoundException |
|
| 831 | - * @throws InvalidArgumentException |
|
| 832 | - * @throws InvalidDataTypeException |
|
| 833 | - * @throws InvalidInterfaceException |
|
| 834 | - */ |
|
| 835 | - public function column_TXN_total(EE_Registration $item) |
|
| 836 | - { |
|
| 837 | - if ($item->transaction()) { |
|
| 838 | - $view_txn_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array( |
|
| 839 | - 'action' => 'view_transaction', |
|
| 840 | - 'TXN_ID' => $item->transaction_ID(), |
|
| 841 | - ), TXN_ADMIN_URL); |
|
| 842 | - return EE_Registry::instance()->CAP->current_user_can( |
|
| 843 | - 'ee_read_transaction', |
|
| 844 | - 'espresso_transactions_view_transaction', |
|
| 845 | - $item->transaction_ID() |
|
| 846 | - ) |
|
| 847 | - ? '<span class="reg-pad-rght"><a class="status-' |
|
| 848 | - . $item->transaction()->status_ID() |
|
| 849 | - . '" href="' |
|
| 850 | - . $view_txn_lnk_url |
|
| 851 | - . '" title="' |
|
| 852 | - . esc_attr__('View Transaction', 'event_espresso') |
|
| 853 | - . '">' |
|
| 854 | - . $item->transaction()->pretty_total() |
|
| 855 | - . '</a></span>' : '<span class="reg-pad-rght">' . $item->transaction()->pretty_total() . '</span>'; |
|
| 856 | - } else { |
|
| 857 | - return __("None", "event_espresso"); |
|
| 858 | - } |
|
| 859 | - } |
|
| 823 | + /** |
|
| 824 | + * column_TXN_total |
|
| 825 | + * |
|
| 826 | + * @access public |
|
| 827 | + * @param \EE_Registration $item |
|
| 828 | + * @return string |
|
| 829 | + * @throws EE_Error |
|
| 830 | + * @throws EntityNotFoundException |
|
| 831 | + * @throws InvalidArgumentException |
|
| 832 | + * @throws InvalidDataTypeException |
|
| 833 | + * @throws InvalidInterfaceException |
|
| 834 | + */ |
|
| 835 | + public function column_TXN_total(EE_Registration $item) |
|
| 836 | + { |
|
| 837 | + if ($item->transaction()) { |
|
| 838 | + $view_txn_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array( |
|
| 839 | + 'action' => 'view_transaction', |
|
| 840 | + 'TXN_ID' => $item->transaction_ID(), |
|
| 841 | + ), TXN_ADMIN_URL); |
|
| 842 | + return EE_Registry::instance()->CAP->current_user_can( |
|
| 843 | + 'ee_read_transaction', |
|
| 844 | + 'espresso_transactions_view_transaction', |
|
| 845 | + $item->transaction_ID() |
|
| 846 | + ) |
|
| 847 | + ? '<span class="reg-pad-rght"><a class="status-' |
|
| 848 | + . $item->transaction()->status_ID() |
|
| 849 | + . '" href="' |
|
| 850 | + . $view_txn_lnk_url |
|
| 851 | + . '" title="' |
|
| 852 | + . esc_attr__('View Transaction', 'event_espresso') |
|
| 853 | + . '">' |
|
| 854 | + . $item->transaction()->pretty_total() |
|
| 855 | + . '</a></span>' : '<span class="reg-pad-rght">' . $item->transaction()->pretty_total() . '</span>'; |
|
| 856 | + } else { |
|
| 857 | + return __("None", "event_espresso"); |
|
| 858 | + } |
|
| 859 | + } |
|
| 860 | 860 | |
| 861 | 861 | |
| 862 | - /** |
|
| 863 | - * column_TXN_paid |
|
| 864 | - * |
|
| 865 | - * @access public |
|
| 866 | - * @param \EE_Registration $item |
|
| 867 | - * @return string |
|
| 868 | - * @throws EE_Error |
|
| 869 | - * @throws EntityNotFoundException |
|
| 870 | - * @throws InvalidArgumentException |
|
| 871 | - * @throws InvalidDataTypeException |
|
| 872 | - * @throws InvalidInterfaceException |
|
| 873 | - */ |
|
| 874 | - public function column_TXN_paid(EE_Registration $item) |
|
| 875 | - { |
|
| 876 | - if ($item->count() === 1) { |
|
| 877 | - $transaction = $item->transaction() ? $item->transaction() : EE_Transaction::new_instance(); |
|
| 878 | - if ($transaction->paid() >= $transaction->total()) { |
|
| 879 | - return '<span class="reg-pad-rght"><div class="dashicons dashicons-yes green-icon"></div></span>'; |
|
| 880 | - } else { |
|
| 881 | - $view_txn_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array( |
|
| 882 | - 'action' => 'view_transaction', |
|
| 883 | - 'TXN_ID' => $item->transaction_ID(), |
|
| 884 | - ), TXN_ADMIN_URL); |
|
| 885 | - return EE_Registry::instance()->CAP->current_user_can( |
|
| 886 | - 'ee_read_transaction', |
|
| 887 | - 'espresso_transactions_view_transaction', |
|
| 888 | - $item->transaction_ID() |
|
| 889 | - ) |
|
| 890 | - ? '<span class="reg-pad-rght"><a class="status-' |
|
| 891 | - . $transaction->status_ID() |
|
| 892 | - . '" href="' |
|
| 893 | - . $view_txn_lnk_url |
|
| 894 | - . '" title="' |
|
| 895 | - . esc_attr__('View Transaction', 'event_espresso') |
|
| 896 | - . '">' |
|
| 897 | - . $item->transaction()->pretty_paid() |
|
| 898 | - . '</a><span>' : '<span class="reg-pad-rght">' . $item->transaction()->pretty_paid() . '</span>'; |
|
| 899 | - } |
|
| 900 | - } |
|
| 901 | - return ' '; |
|
| 902 | - } |
|
| 862 | + /** |
|
| 863 | + * column_TXN_paid |
|
| 864 | + * |
|
| 865 | + * @access public |
|
| 866 | + * @param \EE_Registration $item |
|
| 867 | + * @return string |
|
| 868 | + * @throws EE_Error |
|
| 869 | + * @throws EntityNotFoundException |
|
| 870 | + * @throws InvalidArgumentException |
|
| 871 | + * @throws InvalidDataTypeException |
|
| 872 | + * @throws InvalidInterfaceException |
|
| 873 | + */ |
|
| 874 | + public function column_TXN_paid(EE_Registration $item) |
|
| 875 | + { |
|
| 876 | + if ($item->count() === 1) { |
|
| 877 | + $transaction = $item->transaction() ? $item->transaction() : EE_Transaction::new_instance(); |
|
| 878 | + if ($transaction->paid() >= $transaction->total()) { |
|
| 879 | + return '<span class="reg-pad-rght"><div class="dashicons dashicons-yes green-icon"></div></span>'; |
|
| 880 | + } else { |
|
| 881 | + $view_txn_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array( |
|
| 882 | + 'action' => 'view_transaction', |
|
| 883 | + 'TXN_ID' => $item->transaction_ID(), |
|
| 884 | + ), TXN_ADMIN_URL); |
|
| 885 | + return EE_Registry::instance()->CAP->current_user_can( |
|
| 886 | + 'ee_read_transaction', |
|
| 887 | + 'espresso_transactions_view_transaction', |
|
| 888 | + $item->transaction_ID() |
|
| 889 | + ) |
|
| 890 | + ? '<span class="reg-pad-rght"><a class="status-' |
|
| 891 | + . $transaction->status_ID() |
|
| 892 | + . '" href="' |
|
| 893 | + . $view_txn_lnk_url |
|
| 894 | + . '" title="' |
|
| 895 | + . esc_attr__('View Transaction', 'event_espresso') |
|
| 896 | + . '">' |
|
| 897 | + . $item->transaction()->pretty_paid() |
|
| 898 | + . '</a><span>' : '<span class="reg-pad-rght">' . $item->transaction()->pretty_paid() . '</span>'; |
|
| 899 | + } |
|
| 900 | + } |
|
| 901 | + return ' '; |
|
| 902 | + } |
|
| 903 | 903 | |
| 904 | 904 | |
| 905 | - /** |
|
| 906 | - * column_actions |
|
| 907 | - * |
|
| 908 | - * @access public |
|
| 909 | - * @param \EE_Registration $item |
|
| 910 | - * @return string |
|
| 911 | - * @throws EE_Error |
|
| 912 | - * @throws InvalidArgumentException |
|
| 913 | - * @throws InvalidDataTypeException |
|
| 914 | - * @throws InvalidInterfaceException |
|
| 915 | - * @throws ReflectionException |
|
| 916 | - */ |
|
| 917 | - public function column_actions(EE_Registration $item) |
|
| 918 | - { |
|
| 919 | - $actions = array(); |
|
| 920 | - $attendee = $item->attendee(); |
|
| 921 | - $this->_set_related_details($item); |
|
| 922 | - //Build row actions |
|
| 923 | - $view_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array( |
|
| 924 | - 'action' => 'view_registration', |
|
| 925 | - '_REG_ID' => $item->ID(), |
|
| 926 | - ), REG_ADMIN_URL); |
|
| 927 | - $edit_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array( |
|
| 928 | - 'action' => 'edit_attendee', |
|
| 929 | - 'post' => $item->attendee_ID(), |
|
| 930 | - ), REG_ADMIN_URL); |
|
| 931 | - // page=attendees&event_admin_reports=resend_email®istration_id=43653465634&event_id=2&form_action=resend_email |
|
| 932 | - //$resend_reg_lnk_url_params = array( 'action'=>'resend_registration', '_REG_ID'=>$item->REG_ID ); |
|
| 933 | - $resend_reg_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array( |
|
| 934 | - 'action' => 'resend_registration', |
|
| 935 | - '_REG_ID' => $item->ID(), |
|
| 936 | - ), REG_ADMIN_URL, true); |
|
| 937 | - //Build row actions |
|
| 938 | - $actions['view_lnk'] = EE_Registry::instance()->CAP->current_user_can( |
|
| 939 | - 'ee_read_registration', |
|
| 940 | - 'espresso_registrations_view_registration', |
|
| 941 | - $item->ID() |
|
| 942 | - ) ? '<li><a href="' |
|
| 943 | - . $view_lnk_url |
|
| 944 | - . '" title="' |
|
| 945 | - . esc_attr__('View Registration Details', 'event_espresso') |
|
| 946 | - . '" class="tiny-text"> |
|
| 905 | + /** |
|
| 906 | + * column_actions |
|
| 907 | + * |
|
| 908 | + * @access public |
|
| 909 | + * @param \EE_Registration $item |
|
| 910 | + * @return string |
|
| 911 | + * @throws EE_Error |
|
| 912 | + * @throws InvalidArgumentException |
|
| 913 | + * @throws InvalidDataTypeException |
|
| 914 | + * @throws InvalidInterfaceException |
|
| 915 | + * @throws ReflectionException |
|
| 916 | + */ |
|
| 917 | + public function column_actions(EE_Registration $item) |
|
| 918 | + { |
|
| 919 | + $actions = array(); |
|
| 920 | + $attendee = $item->attendee(); |
|
| 921 | + $this->_set_related_details($item); |
|
| 922 | + //Build row actions |
|
| 923 | + $view_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array( |
|
| 924 | + 'action' => 'view_registration', |
|
| 925 | + '_REG_ID' => $item->ID(), |
|
| 926 | + ), REG_ADMIN_URL); |
|
| 927 | + $edit_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array( |
|
| 928 | + 'action' => 'edit_attendee', |
|
| 929 | + 'post' => $item->attendee_ID(), |
|
| 930 | + ), REG_ADMIN_URL); |
|
| 931 | + // page=attendees&event_admin_reports=resend_email®istration_id=43653465634&event_id=2&form_action=resend_email |
|
| 932 | + //$resend_reg_lnk_url_params = array( 'action'=>'resend_registration', '_REG_ID'=>$item->REG_ID ); |
|
| 933 | + $resend_reg_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array( |
|
| 934 | + 'action' => 'resend_registration', |
|
| 935 | + '_REG_ID' => $item->ID(), |
|
| 936 | + ), REG_ADMIN_URL, true); |
|
| 937 | + //Build row actions |
|
| 938 | + $actions['view_lnk'] = EE_Registry::instance()->CAP->current_user_can( |
|
| 939 | + 'ee_read_registration', |
|
| 940 | + 'espresso_registrations_view_registration', |
|
| 941 | + $item->ID() |
|
| 942 | + ) ? '<li><a href="' |
|
| 943 | + . $view_lnk_url |
|
| 944 | + . '" title="' |
|
| 945 | + . esc_attr__('View Registration Details', 'event_espresso') |
|
| 946 | + . '" class="tiny-text"> |
|
| 947 | 947 | <div class="dashicons dashicons-clipboard"></div> |
| 948 | 948 | </a> |
| 949 | 949 | </li>' |
| 950 | - : ''; |
|
| 951 | - $actions['edit_lnk'] = EE_Registry::instance()->CAP->current_user_can( |
|
| 952 | - 'ee_edit_contacts', |
|
| 953 | - 'espresso_registrations_edit_attendee' |
|
| 954 | - ) |
|
| 955 | - && $attendee instanceof EE_Attendee |
|
| 956 | - ? ' |
|
| 950 | + : ''; |
|
| 951 | + $actions['edit_lnk'] = EE_Registry::instance()->CAP->current_user_can( |
|
| 952 | + 'ee_edit_contacts', |
|
| 953 | + 'espresso_registrations_edit_attendee' |
|
| 954 | + ) |
|
| 955 | + && $attendee instanceof EE_Attendee |
|
| 956 | + ? ' |
|
| 957 | 957 | <li> |
| 958 | 958 | <a href="' . $edit_lnk_url . '" title="' |
| 959 | - . esc_attr__('Edit Contact Details', 'event_espresso') . '" class="tiny-text"> |
|
| 959 | + . esc_attr__('Edit Contact Details', 'event_espresso') . '" class="tiny-text"> |
|
| 960 | 960 | <div class="ee-icon ee-icon-user-edit ee-icon-size-16"></div> |
| 961 | 961 | </a> |
| 962 | 962 | </li>' : ''; |
| 963 | - $actions['resend_reg_lnk'] = $attendee instanceof EE_Attendee |
|
| 964 | - && EE_Registry::instance()->CAP->current_user_can( |
|
| 965 | - 'ee_send_message', |
|
| 966 | - 'espresso_registrations_resend_registration', |
|
| 967 | - $item->ID() |
|
| 968 | - ) |
|
| 969 | - ? ' |
|
| 963 | + $actions['resend_reg_lnk'] = $attendee instanceof EE_Attendee |
|
| 964 | + && EE_Registry::instance()->CAP->current_user_can( |
|
| 965 | + 'ee_send_message', |
|
| 966 | + 'espresso_registrations_resend_registration', |
|
| 967 | + $item->ID() |
|
| 968 | + ) |
|
| 969 | + ? ' |
|
| 970 | 970 | <li> |
| 971 | 971 | <a href="' |
| 972 | - . $resend_reg_lnk_url |
|
| 973 | - . '" title="' |
|
| 974 | - . esc_attr__('Resend Registration Details', 'event_espresso') |
|
| 975 | - . '" class="tiny-text"> |
|
| 972 | + . $resend_reg_lnk_url |
|
| 973 | + . '" title="' |
|
| 974 | + . esc_attr__('Resend Registration Details', 'event_espresso') |
|
| 975 | + . '" class="tiny-text"> |
|
| 976 | 976 | <div class="dashicons dashicons-email-alt"></div> |
| 977 | 977 | </a> |
| 978 | 978 | </li>' : ''; |
| 979 | - // page=transactions&action=view_transaction&txn=256&_wpnonce=6414da4dbb |
|
| 980 | - $view_txn_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array( |
|
| 981 | - 'action' => 'view_transaction', |
|
| 982 | - 'TXN_ID' => $this->_transaction_details['id'], |
|
| 983 | - ), TXN_ADMIN_URL); |
|
| 984 | - $actions['view_txn_lnk'] = EE_Registry::instance()->CAP->current_user_can( |
|
| 985 | - 'ee_read_transaction', |
|
| 986 | - 'espresso_transactions_view_transaction', |
|
| 987 | - $this->_transaction_details['id'] |
|
| 988 | - ) |
|
| 989 | - ? ' |
|
| 979 | + // page=transactions&action=view_transaction&txn=256&_wpnonce=6414da4dbb |
|
| 980 | + $view_txn_lnk_url = EE_Admin_Page::add_query_args_and_nonce(array( |
|
| 981 | + 'action' => 'view_transaction', |
|
| 982 | + 'TXN_ID' => $this->_transaction_details['id'], |
|
| 983 | + ), TXN_ADMIN_URL); |
|
| 984 | + $actions['view_txn_lnk'] = EE_Registry::instance()->CAP->current_user_can( |
|
| 985 | + 'ee_read_transaction', |
|
| 986 | + 'espresso_transactions_view_transaction', |
|
| 987 | + $this->_transaction_details['id'] |
|
| 988 | + ) |
|
| 989 | + ? ' |
|
| 990 | 990 | <li> |
| 991 | 991 | <a class="ee-status-color-' |
| 992 | - . $this->_transaction_details['status'] |
|
| 993 | - . ' tiny-text" href="' |
|
| 994 | - . $view_txn_lnk_url |
|
| 995 | - . '" title="' |
|
| 996 | - . $this->_transaction_details['title_attr'] |
|
| 997 | - . '"> |
|
| 992 | + . $this->_transaction_details['status'] |
|
| 993 | + . ' tiny-text" href="' |
|
| 994 | + . $view_txn_lnk_url |
|
| 995 | + . '" title="' |
|
| 996 | + . $this->_transaction_details['title_attr'] |
|
| 997 | + . '"> |
|
| 998 | 998 | <div class="dashicons dashicons-cart"></div> |
| 999 | 999 | </a> |
| 1000 | 1000 | </li>' : ''; |
| 1001 | - //invoice link |
|
| 1002 | - $actions['dl_invoice_lnk'] = ''; |
|
| 1003 | - $dl_invoice_lnk_url = $item->invoice_url(); |
|
| 1004 | - //only show invoice link if message type is active. |
|
| 1005 | - if ($attendee instanceof EE_Attendee |
|
| 1006 | - && $item->is_primary_registrant() |
|
| 1007 | - && EEH_MSG_Template::is_mt_active('invoice') |
|
| 1008 | - ) { |
|
| 1009 | - $actions['dl_invoice_lnk'] = ' |
|
| 1001 | + //invoice link |
|
| 1002 | + $actions['dl_invoice_lnk'] = ''; |
|
| 1003 | + $dl_invoice_lnk_url = $item->invoice_url(); |
|
| 1004 | + //only show invoice link if message type is active. |
|
| 1005 | + if ($attendee instanceof EE_Attendee |
|
| 1006 | + && $item->is_primary_registrant() |
|
| 1007 | + && EEH_MSG_Template::is_mt_active('invoice') |
|
| 1008 | + ) { |
|
| 1009 | + $actions['dl_invoice_lnk'] = ' |
|
| 1010 | 1010 | <li> |
| 1011 | 1011 | <a title="' |
| 1012 | - . esc_attr__('View Transaction Invoice', 'event_espresso') |
|
| 1013 | - . '" target="_blank" href="' |
|
| 1014 | - . $dl_invoice_lnk_url |
|
| 1015 | - . '" class="tiny-text"> |
|
| 1012 | + . esc_attr__('View Transaction Invoice', 'event_espresso') |
|
| 1013 | + . '" target="_blank" href="' |
|
| 1014 | + . $dl_invoice_lnk_url |
|
| 1015 | + . '" class="tiny-text"> |
|
| 1016 | 1016 | <span class="dashicons dashicons-media-spreadsheet ee-icon-size-18"></span> |
| 1017 | 1017 | </a> |
| 1018 | 1018 | </li>'; |
| 1019 | - } |
|
| 1020 | - $actions['filtered_messages_link'] = ''; |
|
| 1021 | - //message list table link (filtered by REG_ID |
|
| 1022 | - if (EE_Registry::instance()->CAP->current_user_can('ee_read_global_messages', 'view_filtered_messages')) { |
|
| 1023 | - $actions['filtered_messages_link'] = '<li>' |
|
| 1024 | - . EEH_MSG_Template::get_message_action_link( |
|
| 1025 | - 'see_notifications_for', |
|
| 1026 | - null, |
|
| 1027 | - array('_REG_ID' => $item->ID()) |
|
| 1028 | - ) . '</li>'; |
|
| 1029 | - } |
|
| 1030 | - $actions = apply_filters('FHEE__EE_Registrations_List_Table__column_actions__actions', $actions, $item, $this); |
|
| 1031 | - return $this->_action_string(implode('', $actions), $item, 'ul', 'reg-overview-actions-ul'); |
|
| 1032 | - } |
|
| 1019 | + } |
|
| 1020 | + $actions['filtered_messages_link'] = ''; |
|
| 1021 | + //message list table link (filtered by REG_ID |
|
| 1022 | + if (EE_Registry::instance()->CAP->current_user_can('ee_read_global_messages', 'view_filtered_messages')) { |
|
| 1023 | + $actions['filtered_messages_link'] = '<li>' |
|
| 1024 | + . EEH_MSG_Template::get_message_action_link( |
|
| 1025 | + 'see_notifications_for', |
|
| 1026 | + null, |
|
| 1027 | + array('_REG_ID' => $item->ID()) |
|
| 1028 | + ) . '</li>'; |
|
| 1029 | + } |
|
| 1030 | + $actions = apply_filters('FHEE__EE_Registrations_List_Table__column_actions__actions', $actions, $item, $this); |
|
| 1031 | + return $this->_action_string(implode('', $actions), $item, 'ul', 'reg-overview-actions-ul'); |
|
| 1032 | + } |
|
| 1033 | 1033 | } |
@@ -2,7 +2,7 @@ discard block |
||
| 2 | 2 | use EventEspresso\core\exceptions\InvalidDataTypeException; |
| 3 | 3 | use EventEspresso\core\exceptions\InvalidInterfaceException; |
| 4 | 4 | |
| 5 | -if (! defined('EVENT_ESPRESSO_VERSION')) { |
|
| 5 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
| 6 | 6 | exit('No direct script access allowed'); |
| 7 | 7 | } |
| 8 | 8 | |
@@ -57,7 +57,7 @@ discard block |
||
| 57 | 57 | */ |
| 58 | 58 | public function __construct(Registrations_Admin_Page $admin_page) |
| 59 | 59 | { |
| 60 | - if (! empty($_GET['event_id'])) { |
|
| 60 | + if ( ! empty($_GET['event_id'])) { |
|
| 61 | 61 | $extra_query_args = array(); |
| 62 | 62 | foreach ($admin_page->get_views() as $key => $view_details) { |
| 63 | 63 | $extra_query_args[$view_details['slug']] = array('event_id' => $_GET['event_id']); |
@@ -157,7 +157,7 @@ discard block |
||
| 157 | 157 | ); |
| 158 | 158 | $this->_primary_column = '_REG_ID'; |
| 159 | 159 | $this->_sortable_columns = array( |
| 160 | - '_REG_date' => array('_REG_date' => true), //true means its already sorted |
|
| 160 | + '_REG_date' => array('_REG_date' => true), //true means its already sorted |
|
| 161 | 161 | /** |
| 162 | 162 | * Allows users to change the default sort if they wish. |
| 163 | 163 | * Returning a falsey on this filter will result in the default sort to be by firstname rather than last |
@@ -189,7 +189,7 @@ discard block |
||
| 189 | 189 | { |
| 190 | 190 | $class = parent::_get_row_class($item); |
| 191 | 191 | //add status class |
| 192 | - $class .= ' ee-status-strip reg-status-' . $item->status_ID(); |
|
| 192 | + $class .= ' ee-status-strip reg-status-'.$item->status_ID(); |
|
| 193 | 193 | if ($this->_has_checkbox_column) { |
| 194 | 194 | $class .= ' has-checkbox-column'; |
| 195 | 195 | } |
@@ -354,12 +354,12 @@ discard block |
||
| 354 | 354 | //setup date query. |
| 355 | 355 | $beginning_string = EEM_Registration::instance()->convert_datetime_for_query( |
| 356 | 356 | 'REG_date', |
| 357 | - $this_year_r . '-' . $this_month_r . '-01' . ' ' . $time_start, |
|
| 357 | + $this_year_r.'-'.$this_month_r.'-01'.' '.$time_start, |
|
| 358 | 358 | 'Y-m-d H:i:s' |
| 359 | 359 | ); |
| 360 | 360 | $end_string = EEM_Registration::instance()->convert_datetime_for_query( |
| 361 | 361 | 'REG_date', |
| 362 | - $this_year_r . '-' . $this_month_r . '-' . $days_this_month . ' ' . $time_end, |
|
| 362 | + $this_year_r.'-'.$this_month_r.'-'.$days_this_month.' '.$time_end, |
|
| 363 | 363 | 'Y-m-d H:i:s' |
| 364 | 364 | ); |
| 365 | 365 | $_where['REG_date'] = array( |
@@ -396,12 +396,12 @@ discard block |
||
| 396 | 396 | array( |
| 397 | 397 | EEM_Registration::instance()->convert_datetime_for_query( |
| 398 | 398 | 'REG_date', |
| 399 | - $current_date . $time_start, |
|
| 399 | + $current_date.$time_start, |
|
| 400 | 400 | 'Y-m-d H:i:s' |
| 401 | 401 | ), |
| 402 | 402 | EEM_Registration::instance()->convert_datetime_for_query( |
| 403 | 403 | 'REG_date', |
| 404 | - $current_date . $time_end, |
|
| 404 | + $current_date.$time_end, |
|
| 405 | 405 | 'Y-m-d H:i:s' |
| 406 | 406 | ), |
| 407 | 407 | ), |
@@ -461,8 +461,8 @@ discard block |
||
| 461 | 461 | $content .= '<div class="show-on-mobile-view-only">'; |
| 462 | 462 | $content .= '<br>'; |
| 463 | 463 | $content .= $attendee instanceof EE_Attendee ? $attendee->full_name() : ''; |
| 464 | - $content .= ' ' . sprintf(__('(%1$s / %2$s)', 'event_espresso'), $item->count(), $item->group_size()); |
|
| 465 | - $content .= '<br>' . sprintf(__('Reg Code: %s', 'event_espresso'), $item->get('REG_code')); |
|
| 464 | + $content .= ' '.sprintf(__('(%1$s / %2$s)', 'event_espresso'), $item->count(), $item->group_size()); |
|
| 465 | + $content .= '<br>'.sprintf(__('Reg Code: %s', 'event_espresso'), $item->get('REG_code')); |
|
| 466 | 466 | $content .= '</div>'; |
| 467 | 467 | return $content; |
| 468 | 468 | } |
@@ -544,12 +544,12 @@ discard block |
||
| 544 | 544 | . $event_name |
| 545 | 545 | . '</a>' : $event_name; |
| 546 | 546 | $edit_event_url = EE_Admin_Page::add_query_args_and_nonce(array('event_id' => $EVT_ID), REG_ADMIN_URL); |
| 547 | - $actions['event_filter'] = '<a href="' . $edit_event_url . '" title="'; |
|
| 547 | + $actions['event_filter'] = '<a href="'.$edit_event_url.'" title="'; |
|
| 548 | 548 | $actions['event_filter'] .= sprintf( |
| 549 | 549 | esc_attr__('Filter this list to only show registrations for %s', 'event_espresso'), |
| 550 | 550 | $event_name |
| 551 | 551 | ); |
| 552 | - $actions['event_filter'] .= '">' . __('View Registrations', 'event_espresso') . '</a>'; |
|
| 552 | + $actions['event_filter'] .= '">'.__('View Registrations', 'event_espresso').'</a>'; |
|
| 553 | 553 | } else { |
| 554 | 554 | $edit_event = $event_name; |
| 555 | 555 | $actions['event_filter'] = ''; |
@@ -596,11 +596,11 @@ discard block |
||
| 596 | 596 | { |
| 597 | 597 | $content = '<div class="ee-registration-event-datetimes-container">'; |
| 598 | 598 | $expand_toggle = count($datetime_strings) > 1 |
| 599 | - ? ' <span title="' . esc_attr__('Click to view all dates', 'event_espresso') |
|
| 599 | + ? ' <span title="'.esc_attr__('Click to view all dates', 'event_espresso') |
|
| 600 | 600 | . '" class="ee-js ee-more-datetimes-toggle dashicons dashicons-plus"></span>' |
| 601 | 601 | : ''; |
| 602 | 602 | //get first item for initial visibility |
| 603 | - $content .= '<div class="left">' . array_shift($datetime_strings) . '</div>'; |
|
| 603 | + $content .= '<div class="left">'.array_shift($datetime_strings).'</div>'; |
|
| 604 | 604 | $content .= $expand_toggle; |
| 605 | 605 | if ($datetime_strings) { |
| 606 | 606 | $content .= '<div style="clear:both"></div>'; |
@@ -650,9 +650,9 @@ discard block |
||
| 650 | 650 | $t = $item->get_first_related('Transaction'); |
| 651 | 651 | $payment_count = $t instanceof EE_Transaction ? $t->count_related('Payment') : 0; |
| 652 | 652 | //append group count to name |
| 653 | - $link .= ' ' . sprintf(__('(%1$s / %2$s)', 'event_espresso'), $item->count(), $item->group_size()); |
|
| 653 | + $link .= ' '.sprintf(__('(%1$s / %2$s)', 'event_espresso'), $item->count(), $item->group_size()); |
|
| 654 | 654 | //append reg_code |
| 655 | - $link .= '<br>' . sprintf(__('Reg Code: %s', 'event_espresso'), $item->get('REG_code')); |
|
| 655 | + $link .= '<br>'.sprintf(__('Reg Code: %s', 'event_espresso'), $item->get('REG_code')); |
|
| 656 | 656 | //reg status text for accessibility |
| 657 | 657 | $link .= '<br><span class="ee-status-text-small">' |
| 658 | 658 | . EEH_Template::pretty_status($item->status_ID(), false, 'sentence') |
@@ -674,7 +674,7 @@ discard block |
||
| 674 | 674 | . $trash_lnk_url |
| 675 | 675 | . '" title="' |
| 676 | 676 | . esc_attr__('Trash Registration', 'event_espresso') |
| 677 | - . '">' . __('Trash', 'event_espresso') . '</a>'; |
|
| 677 | + . '">'.__('Trash', 'event_espresso').'</a>'; |
|
| 678 | 678 | } elseif ($this->_view === 'trash') { |
| 679 | 679 | // restore registration link |
| 680 | 680 | if (EE_Registry::instance()->CAP->current_user_can( |
@@ -689,8 +689,8 @@ discard block |
||
| 689 | 689 | $actions['restore'] = '<a href="' |
| 690 | 690 | . $restore_lnk_url |
| 691 | 691 | . '" title="' |
| 692 | - . esc_attr__('Restore Registration', 'event_espresso') . '">' |
|
| 693 | - . __('Restore', 'event_espresso') . '</a>'; |
|
| 692 | + . esc_attr__('Restore Registration', 'event_espresso').'">' |
|
| 693 | + . __('Restore', 'event_espresso').'</a>'; |
|
| 694 | 694 | } |
| 695 | 695 | if (EE_Registry::instance()->CAP->current_user_can( |
| 696 | 696 | 'ee_delete_registration', |
@@ -762,7 +762,7 @@ discard block |
||
| 762 | 762 | . $ticket->name() |
| 763 | 763 | . '</span><br />' : ''; |
| 764 | 764 | if ($item->final_price() > 0) { |
| 765 | - $content .= '<span class="reg-pad-rght">' . $item->pretty_final_price() . '</span>'; |
|
| 765 | + $content .= '<span class="reg-pad-rght">'.$item->pretty_final_price().'</span>'; |
|
| 766 | 766 | } else { |
| 767 | 767 | // free event |
| 768 | 768 | $content .= '<span class="reg-overview-free-event-spn reg-pad-rght">' |
@@ -789,7 +789,7 @@ discard block |
||
| 789 | 789 | : '<span class="TKT_name">' |
| 790 | 790 | . $ticket->name() |
| 791 | 791 | . '</span><br />'; |
| 792 | - $content .= '<span class="reg-pad-rght">' . $item->pretty_final_price() . '</span>'; |
|
| 792 | + $content .= '<span class="reg-pad-rght">'.$item->pretty_final_price().'</span>'; |
|
| 793 | 793 | return $content; |
| 794 | 794 | } |
| 795 | 795 | |
@@ -807,7 +807,7 @@ discard block |
||
| 807 | 807 | $payment_method = $item->payment_method(); |
| 808 | 808 | $payment_method_name = $payment_method instanceof EE_Payment_Method ? $payment_method->admin_name() |
| 809 | 809 | : __('Unknown', 'event_espresso'); |
| 810 | - $content = '<span class="reg-pad-rght">' . $item->pretty_paid() . '</span>'; |
|
| 810 | + $content = '<span class="reg-pad-rght">'.$item->pretty_paid().'</span>'; |
|
| 811 | 811 | if ($item->paid() > 0) { |
| 812 | 812 | $content .= '<br><span class="ee-status-text-small">' |
| 813 | 813 | . sprintf( |
@@ -852,7 +852,7 @@ discard block |
||
| 852 | 852 | . esc_attr__('View Transaction', 'event_espresso') |
| 853 | 853 | . '">' |
| 854 | 854 | . $item->transaction()->pretty_total() |
| 855 | - . '</a></span>' : '<span class="reg-pad-rght">' . $item->transaction()->pretty_total() . '</span>'; |
|
| 855 | + . '</a></span>' : '<span class="reg-pad-rght">'.$item->transaction()->pretty_total().'</span>'; |
|
| 856 | 856 | } else { |
| 857 | 857 | return __("None", "event_espresso"); |
| 858 | 858 | } |
@@ -895,7 +895,7 @@ discard block |
||
| 895 | 895 | . esc_attr__('View Transaction', 'event_espresso') |
| 896 | 896 | . '">' |
| 897 | 897 | . $item->transaction()->pretty_paid() |
| 898 | - . '</a><span>' : '<span class="reg-pad-rght">' . $item->transaction()->pretty_paid() . '</span>'; |
|
| 898 | + . '</a><span>' : '<span class="reg-pad-rght">'.$item->transaction()->pretty_paid().'</span>'; |
|
| 899 | 899 | } |
| 900 | 900 | } |
| 901 | 901 | return ' '; |
@@ -955,8 +955,8 @@ discard block |
||
| 955 | 955 | && $attendee instanceof EE_Attendee |
| 956 | 956 | ? ' |
| 957 | 957 | <li> |
| 958 | - <a href="' . $edit_lnk_url . '" title="' |
|
| 959 | - . esc_attr__('Edit Contact Details', 'event_espresso') . '" class="tiny-text"> |
|
| 958 | + <a href="' . $edit_lnk_url.'" title="' |
|
| 959 | + . esc_attr__('Edit Contact Details', 'event_espresso').'" class="tiny-text"> |
|
| 960 | 960 | <div class="ee-icon ee-icon-user-edit ee-icon-size-16"></div> |
| 961 | 961 | </a> |
| 962 | 962 | </li>' : ''; |
@@ -1025,7 +1025,7 @@ discard block |
||
| 1025 | 1025 | 'see_notifications_for', |
| 1026 | 1026 | null, |
| 1027 | 1027 | array('_REG_ID' => $item->ID()) |
| 1028 | - ) . '</li>'; |
|
| 1028 | + ).'</li>'; |
|
| 1029 | 1029 | } |
| 1030 | 1030 | $actions = apply_filters('FHEE__EE_Registrations_List_Table__column_actions__actions', $actions, $item, $this); |
| 1031 | 1031 | return $this->_action_string(implode('', $actions), $item, 'ul', 'reg-overview-actions-ul'); |