@@ -4,14 +4,14 @@ discard block |
||
4 | 4 | */ |
5 | 5 | ?> |
6 | 6 | <h3> |
7 | - <?php _e( 'Reset/Delete Data for Event Espresso', 'event_espresso' );?> |
|
7 | + <?php _e('Reset/Delete Data for Event Espresso', 'event_espresso'); ?> |
|
8 | 8 | </h3> |
9 | 9 | <br /> |
10 | 10 | |
11 | 11 | <!-- reset DB url is here. Just need to make it look pretty and unhide it--> |
12 | 12 | <div class="padding"> |
13 | - <h4 class="espresso-header"><span class="dashicons dashicons-update ee-icon-size-22"></span><?php _e('Reset Event Espresso Capabilities', 'event_espresso');?></h4> |
|
14 | - <p><?php _e('Use this to reset the capabilities on WP roles to the defaults as defined via EE_Capabilities. Note this reset does not REMOVE any existing capabilities, it just ensures that all the defaults are ADDED to the roles.', 'event_espresso');?></p> |
|
13 | + <h4 class="espresso-header"><span class="dashicons dashicons-update ee-icon-size-22"></span><?php _e('Reset Event Espresso Capabilities', 'event_espresso'); ?></h4> |
|
14 | + <p><?php _e('Use this to reset the capabilities on WP roles to the defaults as defined via EE_Capabilities. Note this reset does not REMOVE any existing capabilities, it just ensures that all the defaults are ADDED to the roles.', 'event_espresso'); ?></p> |
|
15 | 15 | <div class="float-right"><?php echo $reset_capabilities_button; ?></div> |
16 | 16 | <div class="clear"></div> |
17 | 17 | </div> |
@@ -19,24 +19,24 @@ discard block |
||
19 | 19 | <br /> |
20 | 20 | |
21 | 21 | <div class="padding"> |
22 | - <h4 class="espresso-header"><span class="dashicons dashicons-update ee-icon-size-22"></span><?php _e('Reset Event Espresso Tables', 'event_espresso');?></h4> |
|
23 | - <p><?php _e('Use this to reset Event Espresso Data and return your site to how it was just after first activating Event Espresso.', 'event_espresso');?></p> |
|
24 | - <div class="float-right"><a class="button button-primary" href="<?php echo $reset_db_url;?>"><?php _e('Reset Event Espresso Tables', 'event_espresso');?></a></div> |
|
22 | + <h4 class="espresso-header"><span class="dashicons dashicons-update ee-icon-size-22"></span><?php _e('Reset Event Espresso Tables', 'event_espresso'); ?></h4> |
|
23 | + <p><?php _e('Use this to reset Event Espresso Data and return your site to how it was just after first activating Event Espresso.', 'event_espresso'); ?></p> |
|
24 | + <div class="float-right"><a class="button button-primary" href="<?php echo $reset_db_url; ?>"><?php _e('Reset Event Espresso Tables', 'event_espresso'); ?></a></div> |
|
25 | 25 | <div class="clear"></div> |
26 | 26 | </div> |
27 | 27 | <br /> |
28 | 28 | <br /> |
29 | 29 | |
30 | 30 | <div class="padding"> |
31 | - <h4 class="espresso-header"><span class="dashicons dashicons-post-trash ee-icon-size-22"></span><?php _e('Permanently Delete ALL Event Espresso Tables and Data', 'event_espresso');?></h4> |
|
32 | - <p><?php _e('If you know for certain that you will no longer be using Event Espresso and you wish to remove ALL traces of the plugin from your system, then perform the following steps.', 'event_espresso');?></p> |
|
33 | - <p class="important-notice"><?php printf( __('Please note: %sThis is permanent and can NOT be undone.%s', 'event_espresso'), '<strong>', '</strong>' ); ?><br/></p> |
|
31 | + <h4 class="espresso-header"><span class="dashicons dashicons-post-trash ee-icon-size-22"></span><?php _e('Permanently Delete ALL Event Espresso Tables and Data', 'event_espresso'); ?></h4> |
|
32 | + <p><?php _e('If you know for certain that you will no longer be using Event Espresso and you wish to remove ALL traces of the plugin from your system, then perform the following steps.', 'event_espresso'); ?></p> |
|
33 | + <p class="important-notice"><?php printf(__('Please note: %sThis is permanent and can NOT be undone.%s', 'event_espresso'), '<strong>', '</strong>'); ?><br/></p> |
|
34 | 34 | <ol> |
35 | - <li><?php printf( __('First, click the button below to permanently delete all Event Espresso tables, records, and options from your WordPress database . If you receive a "500 Internal Server Error" or a blank white screen, it means the server has timed out due to the large number of records being migrated. This is not a cause for concern. Simply %1$srefresh the page%2$s and the migration will continue where it left off.', 'event_espresso'), '<strong>', '</strong>' );?></li> |
|
36 | - <li><?php printf( __('Then, locate Event Espresso on the WordPress Plugins page, and click on %sDelete%s', 'event_espresso'), '<strong>', '</strong>' ); ?></li> |
|
37 | - <li><?php printf( __('Once you are on the Delete Plugin page, click on %sYes, Delete these files and data%s', 'event_espresso'), '<strong>', '</strong>' ); ?></li> |
|
35 | + <li><?php printf(__('First, click the button below to permanently delete all Event Espresso tables, records, and options from your WordPress database . If you receive a "500 Internal Server Error" or a blank white screen, it means the server has timed out due to the large number of records being migrated. This is not a cause for concern. Simply %1$srefresh the page%2$s and the migration will continue where it left off.', 'event_espresso'), '<strong>', '</strong>'); ?></li> |
|
36 | + <li><?php printf(__('Then, locate Event Espresso on the WordPress Plugins page, and click on %sDelete%s', 'event_espresso'), '<strong>', '</strong>'); ?></li> |
|
37 | + <li><?php printf(__('Once you are on the Delete Plugin page, click on %sYes, Delete these files and data%s', 'event_espresso'), '<strong>', '</strong>'); ?></li> |
|
38 | 38 | </ol> |
39 | - <div class="float-right"><a href="<?php echo $delete_db_url; ?>" id="delete-all-data-btn" class="button-primary"><?php _e('Permanently Delete All Event Espresso Data', 'event_espresso');?></a></div> |
|
39 | + <div class="float-right"><a href="<?php echo $delete_db_url; ?>" id="delete-all-data-btn" class="button-primary"><?php _e('Permanently Delete All Event Espresso Data', 'event_espresso'); ?></a></div> |
|
40 | 40 | <div class="clear"></div> |
41 | 41 | </div> |
42 | 42 | <br/> |
@@ -1,11 +1,11 @@ discard block |
||
1 | -<p><strong><?php _e( 'Mijireh', 'event_espresso' ); ?></strong></p> |
|
1 | +<p><strong><?php _e('Mijireh', 'event_espresso'); ?></strong></p> |
|
2 | 2 | <p> |
3 | - <?php _e( 'Adjust the settings for the Mijireh payment gateway.', 'event_espresso' ); ?> |
|
3 | + <?php _e('Adjust the settings for the Mijireh payment gateway.', 'event_espresso'); ?> |
|
4 | 4 | </p> |
5 | 5 | <p> |
6 | 6 | <?php |
7 | 7 | printf( |
8 | - __( 'Mijireh is basically a middle-man between Event Espresso and over 90 payment gateways. Most of the configuration occurs on %1$sMijireh\' website%2$s, where you configure your Mijireh store with the %3$spayment gateway of your choice%4$s.', 'event_espresso' ), |
|
8 | + __('Mijireh is basically a middle-man between Event Espresso and over 90 payment gateways. Most of the configuration occurs on %1$sMijireh\' website%2$s, where you configure your Mijireh store with the %3$spayment gateway of your choice%4$s.', 'event_espresso'), |
|
9 | 9 | '<a href="http://www.mijireh.com/" target="_blank">', |
10 | 10 | '</a>', |
11 | 11 | '<a href="http://www.mijireh.com/docs/payment-gateways/" target="_blank">', |
@@ -14,26 +14,26 @@ discard block |
||
14 | 14 | ?> |
15 | 15 | </p> |
16 | 16 | <p> |
17 | - <?php _e( 'For information on what currencies you can use with Mijireh, please consult the payment gateway Mijireh is setup to use.', 'event_espresso' ) ?> |
|
17 | + <?php _e('For information on what currencies you can use with Mijireh, please consult the payment gateway Mijireh is setup to use.', 'event_espresso') ?> |
|
18 | 18 | </p> |
19 | 19 | <ul> |
20 | 20 | <li> |
21 | - <strong><?php _e( 'Mijireh Access Key', 'event_espresso' ); ?></strong><br/> |
|
21 | + <strong><?php _e('Mijireh Access Key', 'event_espresso'); ?></strong><br/> |
|
22 | 22 | <?php |
23 | 23 | printf( |
24 | - __( 'Enter your Access Key for Mijireh. Your Access Key can be found in your %1$sMijireh account dashboard%2$s.', 'event_espresso' ), |
|
24 | + __('Enter your Access Key for Mijireh. Your Access Key can be found in your %1$sMijireh account dashboard%2$s.', 'event_espresso'), |
|
25 | 25 | '<a href="https://secure.mijireh.com/login" target="_blank">', |
26 | 26 | '</a>' |
27 | 27 | ); |
28 | 28 | ?> |
29 | 29 | </li> |
30 | 30 | <li> |
31 | - <strong><?php _e( 'Button Image URL', 'event_espresso' ); ?></strong><br/> |
|
32 | - <?php _e( 'Change the image that is used for this payment gateway.', 'event_espresso' ); ?> |
|
31 | + <strong><?php _e('Button Image URL', 'event_espresso'); ?></strong><br/> |
|
32 | + <?php _e('Change the image that is used for this payment gateway.', 'event_espresso'); ?> |
|
33 | 33 | </li> |
34 | 34 | </ul> |
35 | -<p><strong><?php _e( 'Mijireh Checkout Page Design', 'event_espresso' ); ?></strong></p> |
|
35 | +<p><strong><?php _e('Mijireh Checkout Page Design', 'event_espresso'); ?></strong></p> |
|
36 | 36 | <p> |
37 | - <?php _e( "As you are probably aware, when users pay with Mijireh Payment Method, they are taken to a secure offsite page, hosted by Mijireh. This page can easily be made to have the look-and-feel of your website through a process called 'slurping', where Mijireh 'slurps' up your website's design and uses it on their checkout page.", 'event_espresso' ); ?> |
|
38 | - <?php printf( __( "In order to do this, we automatically create a new WordPress page which is designed to be slurped by Mijireh. You can customize the page like any other, but the page must contain Mijireh's special '{{mijireh-checkout-form}}' shortcode. Once you have finished designing the page, publish it, and %s then click the special 'slurp now' button%s. Mijireh may take several minutes to slurp the page. Once Mijireh is finished slurping, you can delete the page, or mark it as a draft.", 'event_espresso' ), '<a href="http://ee-screenshots.s3.amazonaws.com/ee4/event-espresso-mijireh-slurp-page-example.jpg" target="_blank">', '</a>' ); ?> |
|
37 | + <?php _e("As you are probably aware, when users pay with Mijireh Payment Method, they are taken to a secure offsite page, hosted by Mijireh. This page can easily be made to have the look-and-feel of your website through a process called 'slurping', where Mijireh 'slurps' up your website's design and uses it on their checkout page.", 'event_espresso'); ?> |
|
38 | + <?php printf(__("In order to do this, we automatically create a new WordPress page which is designed to be slurped by Mijireh. You can customize the page like any other, but the page must contain Mijireh's special '{{mijireh-checkout-form}}' shortcode. Once you have finished designing the page, publish it, and %s then click the special 'slurp now' button%s. Mijireh may take several minutes to slurp the page. Once Mijireh is finished slurping, you can delete the page, or mark it as a draft.", 'event_espresso'), '<a href="http://ee-screenshots.s3.amazonaws.com/ee4/event-espresso-mijireh-slurp-page-example.jpg" target="_blank">', '</a>'); ?> |
|
39 | 39 | </p> |
40 | 40 | \ No newline at end of file |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
2 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) |
|
3 | 3 | exit('NO direct script access allowed'); |
4 | 4 | |
5 | 5 | /** |
@@ -36,25 +36,25 @@ discard block |
||
36 | 36 | |
37 | 37 | |
38 | 38 | private function _do_hooks() { |
39 | - add_filter('FHEE_show_sponsors_meta_box', '__return_false', 10 ); |
|
40 | - add_filter('FHEE_show_ratings_request_meta_box', '__return_false', 10 ); |
|
41 | - add_filter('FHEE__EE_Admin_Page_Core__load_global_scripts_styles__loader_containers', array( $this, 'forums_lazy_loading'), 10 ); |
|
42 | - add_action('AHEE__EE_Admin_Page__espresso_news_post_box__after_content', array( $this, 'extra_news_box_content' ), 10 ); |
|
39 | + add_filter('FHEE_show_sponsors_meta_box', '__return_false', 10); |
|
40 | + add_filter('FHEE_show_ratings_request_meta_box', '__return_false', 10); |
|
41 | + add_filter('FHEE__EE_Admin_Page_Core__load_global_scripts_styles__loader_containers', array($this, 'forums_lazy_loading'), 10); |
|
42 | + add_action('AHEE__EE_Admin_Page__espresso_news_post_box__after_content', array($this, 'extra_news_box_content'), 10); |
|
43 | 43 | } |
44 | 44 | |
45 | 45 | |
46 | 46 | |
47 | 47 | |
48 | - public function extra_news_box_content( $content ) { |
|
49 | - echo '<h3 style="margin:0">' . __('From the Forums', 'event_espresso') . '</h3>'; |
|
48 | + public function extra_news_box_content($content) { |
|
49 | + echo '<h3 style="margin:0">'.__('From the Forums', 'event_espresso').'</h3>'; |
|
50 | 50 | echo '<div id="ee_forum_posts_content">'; |
51 | 51 | $url = 'http://eventespresso.com/forum/event-espresso-support/feed/'; |
52 | - EE_Admin_Page::cached_rss_display( 'ee_forum_posts_content', $url); |
|
52 | + EE_Admin_Page::cached_rss_display('ee_forum_posts_content', $url); |
|
53 | 53 | echo '</div>'; |
54 | 54 | } |
55 | 55 | |
56 | 56 | |
57 | - public function forums_lazy_loading( $ids ) { |
|
57 | + public function forums_lazy_loading($ids) { |
|
58 | 58 | $ids[] = 'ee_forum_posts_content'; |
59 | 59 | return $ids; |
60 | 60 | } |
@@ -1,6 +1,7 @@ |
||
1 | 1 | <?php |
2 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
2 | +if (!defined('EVENT_ESPRESSO_VERSION') ) { |
|
3 | 3 | exit('NO direct script access allowed'); |
4 | +} |
|
4 | 5 | |
5 | 6 | /** |
6 | 7 | * Event Espresso |
@@ -2,18 +2,18 @@ |
||
2 | 2 | <p> |
3 | 3 | <?php _e('The importer can be used to import event information into Event Espresso using a CSV file.', 'event_espresso'); ?> |
4 | 4 | </p> |
5 | -<p><strong><?php _e("Importing from other Event Espresso 4 Sites", 'event_espresso');?></strong></p> |
|
5 | +<p><strong><?php _e("Importing from other Event Espresso 4 Sites", 'event_espresso'); ?></strong></p> |
|
6 | 6 | <p> |
7 | 7 | <?php _e('To import Event Espresso data from another Event Espresso 4 install, export a CSV file from the admin Events overview page, or anywhere you can generate a CSV export file from. Then upload that file here (regardless of what type of information was exported).', 'event_espresso'); ?> |
8 | 8 | </p> |
9 | 9 | <p> |
10 | 10 | <?php _e('Note: its possible that data from the other site have the same IDs as data in this site. The importer recognizes that this data is from a different database and inserts new items for each item in the CSV file, regardless of whether its ID matches that of an item in this site\'s database or not. However, the importer also remembers the mapping from the old site\'s database to this site\'s database, and on subsequent CSV importers from that site, the data in this database will be updated instead of re-inserting new items.', 'event_espresso'); ?> |
11 | 11 | </p> |
12 | -<p><strong><?php _e("Importing from this Site", 'event_espresso');?></strong></p> |
|
13 | -<p><?php _e("You may want to export data from this site, modify it (or modify the database), and re-import it. When this is done, the importer recognizes that the data is from this site\'s database and updates the records (instead of inserting new items like it would have, had the CSV data been from a different site).", 'event_espresso');?></p> |
|
12 | +<p><strong><?php _e("Importing from this Site", 'event_espresso'); ?></strong></p> |
|
13 | +<p><?php _e("You may want to export data from this site, modify it (or modify the database), and re-import it. When this is done, the importer recognizes that the data is from this site\'s database and updates the records (instead of inserting new items like it would have, had the CSV data been from a different site).", 'event_espresso'); ?></p> |
|
14 | 14 | |
15 | - <p><strong><?php _e("Notes about Generating your own CSV Import Files", "event_espresso");?></strong></p> |
|
16 | - <p><?php _e("If you think you could save time entering data into a CSV file, you can use the sample import file below. Note that creating your own CSV file is more complicated than in Event Espresso 3.1 because of the more advanced data structure, and so we recommend creating/editing your events using the normal web-interface.", "event_espresso");?></p> |
|
17 | - <p><?php _e("The export file is just an export of an event, or if you do not have any events in your system, it will only contain column headers. Do not change those column headers. Add as many rows as you like. ", "event_espresso");?></p> |
|
18 | - <p><?php _e("In the ID columns (columns ending in '_ID'), you should enter 'temporary IDs', which are unique numbers/words that identify that item, which can be used later when you want to refer to that item. (For example, if you assign an event's EVT_ID to be a temporary id of 'my-event-1', then use that same phrase 'my-event-1' to refer to that event in the Datetime model's EVT_ID column)", "event_espresso");?></p> |
|
19 | - <p><?php _e("Also note, you do NOT have to enter info in for each model. (You can, for example, only enter in Term_Taxonomies and Term model data)", "event_espresso");?></p> |
|
20 | 15 | \ No newline at end of file |
16 | + <p><strong><?php _e("Notes about Generating your own CSV Import Files", "event_espresso"); ?></strong></p> |
|
17 | + <p><?php _e("If you think you could save time entering data into a CSV file, you can use the sample import file below. Note that creating your own CSV file is more complicated than in Event Espresso 3.1 because of the more advanced data structure, and so we recommend creating/editing your events using the normal web-interface.", "event_espresso"); ?></p> |
|
18 | + <p><?php _e("The export file is just an export of an event, or if you do not have any events in your system, it will only contain column headers. Do not change those column headers. Add as many rows as you like. ", "event_espresso"); ?></p> |
|
19 | + <p><?php _e("In the ID columns (columns ending in '_ID'), you should enter 'temporary IDs', which are unique numbers/words that identify that item, which can be used later when you want to refer to that item. (For example, if you assign an event's EVT_ID to be a temporary id of 'my-event-1', then use that same phrase 'my-event-1' to refer to that event in the Datetime model's EVT_ID column)", "event_espresso"); ?></p> |
|
20 | + <p><?php _e("Also note, you do NOT have to enter info in for each model. (You can, for example, only enter in Term_Taxonomies and Term model data)", "event_espresso"); ?></p> |
|
21 | 21 | \ No newline at end of file |
@@ -17,13 +17,13 @@ discard block |
||
17 | 17 | * @since 4.8.30.rc.007 |
18 | 18 | * |
19 | 19 | */ |
20 | -if( !defined( 'EVENT_ESPRESSO_VERSION' ) ) { |
|
21 | - exit( 'No direct script access allowed' ); |
|
20 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
21 | + exit('No direct script access allowed'); |
|
22 | 22 | } |
23 | 23 | |
24 | -define( 'BATCH_URL', plugin_dir_url( __FILE__ ) ); |
|
24 | +define('BATCH_URL', plugin_dir_url(__FILE__)); |
|
25 | 25 | |
26 | -class EED_Batch extends EED_Module{ |
|
26 | +class EED_Batch extends EED_Module { |
|
27 | 27 | |
28 | 28 | /** |
29 | 29 | * Possibly value for $_REQUEST[ 'batch' ]. Indicates to run a job that |
@@ -70,9 +70,9 @@ discard block |
||
70 | 70 | public static function set_hooks() { |
71 | 71 | //because this is a possibel attack vector, let's have this disabled until |
72 | 72 | //we at least have a real use for it on the frontend |
73 | - if( apply_filters( 'FHEE__EED_Batch__set_hooks__enable_frontend_batch', false ) ) { |
|
74 | - add_action( 'wp_enqueue_scripts', array( self::instance(), 'enqueue_scripts' ) ); |
|
75 | - add_filter( 'template_include', array( self::instance(), 'override_template' ), 99 ); |
|
73 | + if (apply_filters('FHEE__EED_Batch__set_hooks__enable_frontend_batch', false)) { |
|
74 | + add_action('wp_enqueue_scripts', array(self::instance(), 'enqueue_scripts')); |
|
75 | + add_filter('template_include', array(self::instance(), 'override_template'), 99); |
|
76 | 76 | } |
77 | 77 | } |
78 | 78 | |
@@ -80,28 +80,28 @@ discard block |
||
80 | 80 | * Initializes some hooks for the admin in order to run batch jobs |
81 | 81 | */ |
82 | 82 | public static function set_hooks_admin() { |
83 | - add_action( 'admin_menu', array( self::instance(), 'register_admin_pages' ) ); |
|
84 | - add_action( 'admin_enqueue_scripts', array( self::instance(), 'enqueue_scripts' ) ); |
|
83 | + add_action('admin_menu', array(self::instance(), 'register_admin_pages')); |
|
84 | + add_action('admin_enqueue_scripts', array(self::instance(), 'enqueue_scripts')); |
|
85 | 85 | |
86 | 86 | //ajax |
87 | - add_action('wp_ajax_espresso_batch_continue',array(self::instance(),'batch_continue')); |
|
88 | - add_action('wp_ajax_espresso_batch_cleanup',array(self::instance(),'batch_cleanup')); |
|
89 | - add_action('wp_ajax_nopriv_espresso_batch_continue',array(self::instance(),'batch_continue')); |
|
90 | - add_action('wp_ajax_nopriv_espresso_batch_cleanup',array(self::instance(),'batch_cleanup')); |
|
87 | + add_action('wp_ajax_espresso_batch_continue', array(self::instance(), 'batch_continue')); |
|
88 | + add_action('wp_ajax_espresso_batch_cleanup', array(self::instance(), 'batch_cleanup')); |
|
89 | + add_action('wp_ajax_nopriv_espresso_batch_continue', array(self::instance(), 'batch_continue')); |
|
90 | + add_action('wp_ajax_nopriv_espresso_batch_cleanup', array(self::instance(), 'batch_cleanup')); |
|
91 | 91 | } |
92 | 92 | |
93 | 93 | /** |
94 | 94 | * Enqueues batch scripts on the frontend or admin, and creates a job |
95 | 95 | */ |
96 | 96 | public function enqueue_scripts() { |
97 | - if( isset( $_REQUEST[ 'espresso_batch' ] ) |
|
97 | + if (isset($_REQUEST['espresso_batch']) |
|
98 | 98 | || |
99 | 99 | ( |
100 | - isset( $_REQUEST[ 'page' ] ) |
|
101 | - && $_REQUEST[ 'page' ] == 'espresso_batch' |
|
100 | + isset($_REQUEST['page']) |
|
101 | + && $_REQUEST['page'] == 'espresso_batch' |
|
102 | 102 | ) |
103 | 103 | ) { |
104 | - switch( $this->batch_request_type() ) { |
|
104 | + switch ($this->batch_request_type()) { |
|
105 | 105 | case self::batch_job: |
106 | 106 | $this->enqueue_scripts_styles_batch_create(); |
107 | 107 | break; |
@@ -117,11 +117,11 @@ discard block |
||
117 | 117 | */ |
118 | 118 | public function enqueue_scripts_styles_batch_create() { |
119 | 119 | $job_response = $this->_enqueue_batch_job_scripts_and_styles_and_start_job(); |
120 | - wp_enqueue_script( 'batch_runner_init', BATCH_URL . '/assets/batch_runner_init.js', array( 'batch_runner' ), EVENT_ESPRESSO_VERSION, true ); |
|
121 | - wp_localize_script( 'batch_runner_init', 'ee_job_response', $job_response->to_array() ); |
|
122 | - wp_localize_script( 'batch_runner_init', 'ee_job_i18n', |
|
120 | + wp_enqueue_script('batch_runner_init', BATCH_URL.'/assets/batch_runner_init.js', array('batch_runner'), EVENT_ESPRESSO_VERSION, true); |
|
121 | + wp_localize_script('batch_runner_init', 'ee_job_response', $job_response->to_array()); |
|
122 | + wp_localize_script('batch_runner_init', 'ee_job_i18n', |
|
123 | 123 | array( |
124 | - 'return_url' => $_REQUEST['return_url' ], |
|
124 | + 'return_url' => $_REQUEST['return_url'], |
|
125 | 125 | )); |
126 | 126 | } |
127 | 127 | |
@@ -131,15 +131,15 @@ discard block |
||
131 | 131 | public function enqueue_scripts_styles_batch_file_create() { |
132 | 132 | //creates a job based on the request variable |
133 | 133 | $job_response = $this->_enqueue_batch_job_scripts_and_styles_and_start_job(); |
134 | - wp_enqueue_script( 'batch_file_runner_init', BATCH_URL . '/assets/batch_file_runner_init.js', array( 'batch_runner' ), EVENT_ESPRESSO_VERSION, true ); |
|
135 | - wp_localize_script( 'batch_file_runner_init', 'ee_job_response', $job_response->to_array() ); |
|
136 | - wp_localize_script( 'batch_file_runner_init', 'ee_job_i18n', |
|
134 | + wp_enqueue_script('batch_file_runner_init', BATCH_URL.'/assets/batch_file_runner_init.js', array('batch_runner'), EVENT_ESPRESSO_VERSION, true); |
|
135 | + wp_localize_script('batch_file_runner_init', 'ee_job_response', $job_response->to_array()); |
|
136 | + wp_localize_script('batch_file_runner_init', 'ee_job_i18n', |
|
137 | 137 | array( |
138 | 138 | 'download_and_redirecting' => sprintf( |
139 | 139 | __('File Generation complete. Downloading, and %1$sredirecting%2$s...', 'event_espresso'), |
140 | - '<a href="' . $_REQUEST['return_url' ] .'">', |
|
140 | + '<a href="'.$_REQUEST['return_url'].'">', |
|
141 | 141 | '</a>' ), |
142 | - 'return_url' => $_REQUEST['return_url' ], |
|
142 | + 'return_url' => $_REQUEST['return_url'], |
|
143 | 143 | )); |
144 | 144 | } |
145 | 145 | |
@@ -150,18 +150,18 @@ discard block |
||
150 | 150 | * @return \EventEspressoBatchRequest\Helpers\JobStepResponse |
151 | 151 | */ |
152 | 152 | protected function _enqueue_batch_job_scripts_and_styles_and_start_job() { |
153 | - wp_register_script( 'progress_bar', EE_PLUGIN_DIR_URL . 'core/libraries/batch/Assets/progress_bar.js', array( 'jquery' ) ); |
|
154 | - wp_enqueue_style( 'progress_bar', EE_PLUGIN_DIR_URL . 'core/libraries/batch/Assets/progress_bar.css', array(), EVENT_ESPRESSO_VERSION ); |
|
155 | - wp_enqueue_script( 'batch_runner', EE_PLUGIN_DIR_URL . 'core/libraries/batch/Assets/batch_runner.js', array( 'progress_bar' )); |
|
153 | + wp_register_script('progress_bar', EE_PLUGIN_DIR_URL.'core/libraries/batch/Assets/progress_bar.js', array('jquery')); |
|
154 | + wp_enqueue_style('progress_bar', EE_PLUGIN_DIR_URL.'core/libraries/batch/Assets/progress_bar.css', array(), EVENT_ESPRESSO_VERSION); |
|
155 | + wp_enqueue_script('batch_runner', EE_PLUGIN_DIR_URL.'core/libraries/batch/Assets/batch_runner.js', array('progress_bar')); |
|
156 | 156 | //just copy the bits of EE admin's eei18n that we need in the JS |
157 | - wp_localize_script( 'batch_runner', 'eei18n', array( 'ajax_url' => WP_AJAX_URL, 'is_admin' => (bool)is_admin() ) ); |
|
158 | - $job_handler_classname = stripslashes( $_GET[ 'job_handler' ] ); |
|
157 | + wp_localize_script('batch_runner', 'eei18n', array('ajax_url' => WP_AJAX_URL, 'is_admin' => (bool) is_admin())); |
|
158 | + $job_handler_classname = stripslashes($_GET['job_handler']); |
|
159 | 159 | $request_data = array_diff_key( |
160 | 160 | $_REQUEST, |
161 | - array_flip( array( 'action', 'page', 'ee', 'batch' ) ) ); |
|
161 | + array_flip(array('action', 'page', 'ee', 'batch')) ); |
|
162 | 162 | $batch_runner = new EventEspressoBatchRequest\BatchRequestProcessor(); |
163 | 163 | //eg 'EventEspressoBatchRequest\JobHandlers\RegistrationsReport' |
164 | - $job_response = $batch_runner->create_job( $job_handler_classname, $request_data ); |
|
164 | + $job_response = $batch_runner->create_job($job_handler_classname, $request_data); |
|
165 | 165 | //remember the response for later. We need it to display the page body |
166 | 166 | $this->_job_step_response = $job_response; |
167 | 167 | return $job_response; |
@@ -172,9 +172,9 @@ discard block |
||
172 | 172 | * @param string $template |
173 | 173 | * @return string |
174 | 174 | */ |
175 | - public function override_template( $template ) { |
|
176 | - if( isset( $_REQUEST[ 'espresso_batch' ] ) && isset( $_REQUEST[ 'batch' ] ) ) { |
|
177 | - return EE_MODULES . 'batch' . DS . 'templates' . DS . 'batch_frontend_wrapper.template.html'; |
|
175 | + public function override_template($template) { |
|
176 | + if (isset($_REQUEST['espresso_batch']) && isset($_REQUEST['batch'])) { |
|
177 | + return EE_MODULES.'batch'.DS.'templates'.DS.'batch_frontend_wrapper.template.html'; |
|
178 | 178 | } |
179 | 179 | return $template; |
180 | 180 | } |
@@ -185,11 +185,11 @@ discard block |
||
185 | 185 | public function register_admin_pages() { |
186 | 186 | add_submenu_page( |
187 | 187 | '', //parent slug. we don't want this to actually appear in the menu |
188 | - __( 'Batch Job', 'event_espresso' ), //page title |
|
188 | + __('Batch Job', 'event_espresso'), //page title |
|
189 | 189 | 'n/a', //menu title |
190 | 190 | 'read', //we want this page to actually be accessible to anyone, |
191 | 191 | 'espresso_batch', //menu slug |
192 | - array( self::instance(), 'show_admin_page' ) |
|
192 | + array(self::instance(), 'show_admin_page') |
|
193 | 193 | ); |
194 | 194 | } |
195 | 195 | |
@@ -199,8 +199,8 @@ discard block |
||
199 | 199 | */ |
200 | 200 | public function show_admin_page() { |
201 | 201 | echo EEH_Template::locate_template( |
202 | - EE_MODULES . 'batch' . DS . 'templates' . DS . 'batch_wrapper.template.html', |
|
203 | - array( 'batch_request_type' => $this->batch_request_type() ) |
|
202 | + EE_MODULES.'batch'.DS.'templates'.DS.'batch_wrapper.template.html', |
|
203 | + array('batch_request_type' => $this->batch_request_type()) |
|
204 | 204 | ); |
205 | 205 | } |
206 | 206 | |
@@ -208,10 +208,10 @@ discard block |
||
208 | 208 | * Receives ajax calls for continuing a job |
209 | 209 | */ |
210 | 210 | public function batch_continue() { |
211 | - $job_id = sanitize_text_field( $_REQUEST[ 'job_id' ] ); |
|
211 | + $job_id = sanitize_text_field($_REQUEST['job_id']); |
|
212 | 212 | $batch_runner = new EventEspressoBatchRequest\BatchRequestProcessor(); |
213 | - $response_obj = $batch_runner->continue_job( $job_id); |
|
214 | - $this->_return_json( $response_obj->to_array() ); |
|
213 | + $response_obj = $batch_runner->continue_job($job_id); |
|
214 | + $this->_return_json($response_obj->to_array()); |
|
215 | 215 | } |
216 | 216 | |
217 | 217 | /** |
@@ -219,10 +219,10 @@ discard block |
||
219 | 219 | * @return type |
220 | 220 | */ |
221 | 221 | public function batch_cleanup() { |
222 | - $job_id = sanitize_text_field( $_REQUEST[ 'job_id' ] ); |
|
222 | + $job_id = sanitize_text_field($_REQUEST['job_id']); |
|
223 | 223 | $batch_runner = new EventEspressoBatchRequest\BatchRequestProcessor(); |
224 | - $response_obj = $batch_runner->cleanup_job( $job_id ); |
|
225 | - $this->_return_json( $response_obj->to_array() ); |
|
224 | + $response_obj = $batch_runner->cleanup_job($job_id); |
|
225 | + $this->_return_json($response_obj->to_array()); |
|
226 | 226 | } |
227 | 227 | |
228 | 228 | |
@@ -238,7 +238,7 @@ discard block |
||
238 | 238 | * 'isEEajax' => true,//indicates this is a response from EE |
239 | 239 | * ) |
240 | 240 | */ |
241 | - protected function _return_json( $data ) { |
|
241 | + protected function _return_json($data) { |
|
242 | 242 | $json = array( |
243 | 243 | 'notices' => EE_Error::get_notices(), |
244 | 244 | 'data' => $data, |
@@ -247,13 +247,13 @@ discard block |
||
247 | 247 | |
248 | 248 | |
249 | 249 | // make sure there are no php errors or headers_sent. Then we can set correct json header. |
250 | - if ( NULL === error_get_last() || ! headers_sent() ) { |
|
250 | + if (NULL === error_get_last() || ! headers_sent()) { |
|
251 | 251 | header('Content-Type: application/json; charset=UTF-8'); |
252 | 252 | } |
253 | - if( function_exists( 'wp_json_encode' ) ) { |
|
254 | - echo wp_json_encode( $json ); |
|
253 | + if (function_exists('wp_json_encode')) { |
|
254 | + echo wp_json_encode($json); |
|
255 | 255 | } else { |
256 | - echo json_encode( $json ); |
|
256 | + echo json_encode($json); |
|
257 | 257 | } |
258 | 258 | exit(); |
259 | 259 | } |
@@ -270,16 +270,16 @@ discard block |
||
270 | 270 | * @return string: EED_Batch::batch_job, EED_Batch::batch_file_job, EED_Batch::batch_not_job |
271 | 271 | */ |
272 | 272 | public function batch_request_type() { |
273 | - if( $this->_batch_request_type === null ) { |
|
274 | - if( isset( $_GET[ 'batch' ] ) ) { |
|
275 | - if( $_GET[ 'batch' ] == self::batch_job ) { |
|
273 | + if ($this->_batch_request_type === null) { |
|
274 | + if (isset($_GET['batch'])) { |
|
275 | + if ($_GET['batch'] == self::batch_job) { |
|
276 | 276 | $this->_batch_request_type = self::batch_job; |
277 | - } elseif( $_GET[ 'batch' ] == self::batch_file_job ) { |
|
277 | + } elseif ($_GET['batch'] == self::batch_file_job) { |
|
278 | 278 | $this->_batch_request_type = self::batch_file_job; |
279 | 279 | } |
280 | 280 | } |
281 | 281 | //if we didn't find that it was a batch request, indicate it wasn't |
282 | - if( $this->_batch_request_type === null ) { |
|
282 | + if ($this->_batch_request_type === null) { |
|
283 | 283 | $this->_batch_request_type = self::batch_not_job; |
284 | 284 | } |
285 | 285 | } |
@@ -290,7 +290,7 @@ discard block |
||
290 | 290 | * Unnecessary |
291 | 291 | * @param type $WP |
292 | 292 | */ |
293 | - public function run( $WP ) { |
|
293 | + public function run($WP) { |
|
294 | 294 | |
295 | 295 | } |
296 | 296 |
@@ -503,7 +503,7 @@ discard block |
||
503 | 503 | /** |
504 | 504 | * @param $message_types |
505 | 505 | * @param array $extra |
506 | - * @return mixed|string |
|
506 | + * @return string |
|
507 | 507 | */ |
508 | 508 | protected function _get_admin_content_events_edit( $message_types, $extra ) { |
509 | 509 | //defaults |
@@ -771,7 +771,7 @@ discard block |
||
771 | 771 | * All this does is set the existing test settings (in the db) for the messenger |
772 | 772 | * |
773 | 773 | * @access public |
774 | - * @param $settings |
|
774 | + * @param string $settings |
|
775 | 775 | * @return bool success/fail |
776 | 776 | */ |
777 | 777 | public function set_existing_test_settings( $settings ) { |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
2 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) |
|
3 | 3 | exit('NO direct script access allowed'); |
4 | 4 | |
5 | 5 | /** |
@@ -289,7 +289,7 @@ discard block |
||
289 | 289 | * @return void |
290 | 290 | */ |
291 | 291 | public function enqueue_scripts_styles() { |
292 | - do_action( 'AHEE__EE_messenger__enqueue_scripts_styles'); |
|
292 | + do_action('AHEE__EE_messenger__enqueue_scripts_styles'); |
|
293 | 293 | } |
294 | 294 | |
295 | 295 | |
@@ -359,7 +359,7 @@ discard block |
||
359 | 359 | |
360 | 360 | $this->_supports_labels->template_variation_description = __('These are different styles to choose from for the selected template structure. Usually these affect things like font style, color, borders etc. In some cases the styles will also make minor layout changes.'); |
361 | 361 | |
362 | - $this->_supports_labels = apply_filters( 'FHEE__EE_messenger___set_supports_labels_defaults___supports_labels', $this->_supports_labels, $this ); |
|
362 | + $this->_supports_labels = apply_filters('FHEE__EE_messenger___set_supports_labels_defaults___supports_labels', $this->_supports_labels, $this); |
|
363 | 363 | } |
364 | 364 | |
365 | 365 | |
@@ -374,10 +374,10 @@ discard block |
||
374 | 374 | * @return stdClass |
375 | 375 | */ |
376 | 376 | public function get_supports_labels() { |
377 | - if ( empty( $this->_supports_labels->template_pack ) || empty( $this->_supports_labels->template_variation) ) { |
|
377 | + if (empty($this->_supports_labels->template_pack) || empty($this->_supports_labels->template_variation)) { |
|
378 | 378 | $this->_set_supports_labels_defaults(); |
379 | 379 | } |
380 | - return apply_filters( 'FHEE__EE_messenger__get_supports_labels', $this->_supports_labels, $this ); |
|
380 | + return apply_filters('FHEE__EE_messenger__get_supports_labels', $this->_supports_labels, $this); |
|
381 | 381 | } |
382 | 382 | |
383 | 383 | |
@@ -397,10 +397,10 @@ discard block |
||
397 | 397 | * |
398 | 398 | * @return string path or url for the requested variation. |
399 | 399 | */ |
400 | - public function get_variation( EE_Messages_Template_Pack $pack, $message_type_name, $url = FALSE, $type = 'main', $variation = 'default', $skip_filters = FALSE ) { |
|
400 | + public function get_variation(EE_Messages_Template_Pack $pack, $message_type_name, $url = FALSE, $type = 'main', $variation = 'default', $skip_filters = FALSE) { |
|
401 | 401 | $this->_tmp_pack = $pack; |
402 | - $variation_path = apply_filters( 'EE_messenger__get_variation__variation', false, $pack, $this->name, $message_type_name, $url, $type, $variation, $skip_filters ); |
|
403 | - $variation_path = empty( $variation_path ) ? $this->_tmp_pack->get_variation( $this->name, $message_type_name, $type, $variation, $url, '.css', $skip_filters ) : $variation_path; |
|
402 | + $variation_path = apply_filters('EE_messenger__get_variation__variation', false, $pack, $this->name, $message_type_name, $url, $type, $variation, $skip_filters); |
|
403 | + $variation_path = empty($variation_path) ? $this->_tmp_pack->get_variation($this->name, $message_type_name, $type, $variation, $url, '.css', $skip_filters) : $variation_path; |
|
404 | 404 | return $variation_path; |
405 | 405 | |
406 | 406 | } |
@@ -418,13 +418,13 @@ discard block |
||
418 | 418 | * @return array |
419 | 419 | */ |
420 | 420 | public function get_default_message_types() { |
421 | - $class = get_class( $this ); |
|
421 | + $class = get_class($this); |
|
422 | 422 | |
423 | 423 | //messenger specific filter |
424 | - $default_types = apply_filters( 'FHEE__' . $class . '__get_default_message_types__default_types', $this->_default_message_types, $this ); |
|
424 | + $default_types = apply_filters('FHEE__'.$class.'__get_default_message_types__default_types', $this->_default_message_types, $this); |
|
425 | 425 | |
426 | 426 | //all messengers filter |
427 | - $default_types = apply_filters( 'FHEE__EE_messenger__get_default_message_types__default_types', $default_types, $this ); |
|
427 | + $default_types = apply_filters('FHEE__EE_messenger__get_default_message_types__default_types', $default_types, $this); |
|
428 | 428 | return $default_types; |
429 | 429 | } |
430 | 430 | |
@@ -439,14 +439,14 @@ discard block |
||
439 | 439 | * @return array |
440 | 440 | */ |
441 | 441 | public function get_valid_message_types() { |
442 | - $class = get_class( $this ); |
|
442 | + $class = get_class($this); |
|
443 | 443 | |
444 | 444 | //messenger specific filter |
445 | 445 | //messenger specific filter |
446 | - $valid_types = apply_filters( 'FHEE__' . $class . '__get_valid_message_types__valid_types', $this->_valid_message_types, $this ); |
|
446 | + $valid_types = apply_filters('FHEE__'.$class.'__get_valid_message_types__valid_types', $this->_valid_message_types, $this); |
|
447 | 447 | |
448 | 448 | //all messengers filter |
449 | - $valid_types = apply_filters( 'FHEE__EE_messenger__get_valid_message_types__valid_types', $valid_types, $this ); |
|
449 | + $valid_types = apply_filters('FHEE__EE_messenger__get_valid_message_types__valid_types', $valid_types, $this); |
|
450 | 450 | return $valid_types; |
451 | 451 | } |
452 | 452 | |
@@ -460,7 +460,7 @@ discard block |
||
460 | 460 | * @access public |
461 | 461 | * @param array $new_config Whatever is put in here will reset the _validator_config property |
462 | 462 | */ |
463 | - public function set_validator_config( $new_config ) { |
|
463 | + public function set_validator_config($new_config) { |
|
464 | 464 | $this->_validator_config = $new_config; |
465 | 465 | } |
466 | 466 | |
@@ -476,8 +476,8 @@ discard block |
||
476 | 476 | public function get_validator_config() { |
477 | 477 | $class = get_class($this); |
478 | 478 | |
479 | - $config = apply_filters( 'FHEE__' . $class . '__get_validator_config', $this->_validator_config, $this ); |
|
480 | - $config = apply_filters( 'FHEE__EE_messenger__get_validator_config', $config, $this ); |
|
479 | + $config = apply_filters('FHEE__'.$class.'__get_validator_config', $this->_validator_config, $this); |
|
480 | + $config = apply_filters('FHEE__EE_messenger__get_validator_config', $config, $this); |
|
481 | 481 | return $config; |
482 | 482 | } |
483 | 483 | |
@@ -494,8 +494,8 @@ discard block |
||
494 | 494 | * @access public |
495 | 495 | * @return string content for page |
496 | 496 | */ |
497 | - public function get_messenger_admin_page_content( $page, $action = null, $extra = array(), $message_types = array() ) { |
|
498 | - return $this->_get_admin_page_content( $page, $action, $extra, $message_types ); |
|
497 | + public function get_messenger_admin_page_content($page, $action = null, $extra = array(), $message_types = array()) { |
|
498 | + return $this->_get_admin_page_content($page, $action, $extra, $message_types); |
|
499 | 499 | } |
500 | 500 | |
501 | 501 | |
@@ -505,20 +505,20 @@ discard block |
||
505 | 505 | * @param array $extra |
506 | 506 | * @return mixed|string |
507 | 507 | */ |
508 | - protected function _get_admin_content_events_edit( $message_types, $extra ) { |
|
508 | + protected function _get_admin_content_events_edit($message_types, $extra) { |
|
509 | 509 | //defaults |
510 | 510 | $template_args = array(); |
511 | 511 | $selector_rows = ''; |
512 | 512 | |
513 | 513 | //we don't need message types here so we're just going to ignore. we do, however, expect the event id here. The event id is needed to provide a link to setup a custom template for this event. |
514 | - $event_id = isset( $extra['event'] ) ? $extra['event'] : NULL; |
|
514 | + $event_id = isset($extra['event']) ? $extra['event'] : NULL; |
|
515 | 515 | |
516 | - $template_wrapper_path = EE_LIBRARIES . 'messages/messenger/admin_templates/event_switcher_wrapper.template.php'; |
|
517 | - $template_row_path = EE_LIBRARIES . 'messages/messenger/admin_templates/event_switcher_row.template.php'; |
|
516 | + $template_wrapper_path = EE_LIBRARIES.'messages/messenger/admin_templates/event_switcher_wrapper.template.php'; |
|
517 | + $template_row_path = EE_LIBRARIES.'messages/messenger/admin_templates/event_switcher_row.template.php'; |
|
518 | 518 | |
519 | 519 | //array of template objects for global and custom (non-trashed) (but remember just for this messenger!) |
520 | 520 | $global_templates = EEM_Message_Template_Group::instance()->get_all( |
521 | - array( array( 'MTP_messenger' => $this->name, 'MTP_is_global' => true, 'MTP_is_active' => true ) ) |
|
521 | + array(array('MTP_messenger' => $this->name, 'MTP_is_global' => true, 'MTP_is_active' => true)) |
|
522 | 522 | ); |
523 | 523 | $templates_for_event = EEM_Message_Template_Group::instance()->get_all_custom_templates_by_event( |
524 | 524 | $event_id, |
@@ -527,55 +527,55 @@ discard block |
||
527 | 527 | 'MTP_is_active' => true |
528 | 528 | ) |
529 | 529 | ); |
530 | - $templates_for_event = !empty( $templates_for_event ) ? $templates_for_event : array(); |
|
530 | + $templates_for_event = ! empty($templates_for_event) ? $templates_for_event : array(); |
|
531 | 531 | |
532 | 532 | //so we need to setup the rows for the selectors and we use the global mtpgs (cause those will the active message template groups) |
533 | - foreach ( $global_templates as $mtpgID => $mtpg ) { |
|
534 | - if ( $mtpg instanceof EE_Message_Template_Group ) { |
|
533 | + foreach ($global_templates as $mtpgID => $mtpg) { |
|
534 | + if ($mtpg instanceof EE_Message_Template_Group) { |
|
535 | 535 | //verify this message type is supposed to show on this page |
536 | 536 | $mtp_obj = $mtpg->message_type_obj(); |
537 | - if ( ! $mtp_obj instanceof EE_message_type ) { |
|
537 | + if ( ! $mtp_obj instanceof EE_message_type) { |
|
538 | 538 | continue; |
539 | 539 | } |
540 | - $mtp_obj->admin_registered_pages = (array)$mtp_obj->admin_registered_pages; |
|
541 | - if ( ! in_array( 'events_edit', $mtp_obj->admin_registered_pages ) ) { |
|
540 | + $mtp_obj->admin_registered_pages = (array) $mtp_obj->admin_registered_pages; |
|
541 | + if ( ! in_array('events_edit', $mtp_obj->admin_registered_pages)) { |
|
542 | 542 | continue; |
543 | 543 | } |
544 | 544 | $select_values = array(); |
545 | - $select_values[ $mtpgID ] = __( 'Global', 'event_espresso' ); |
|
546 | - $default_value = array_key_exists( $mtpgID, $templates_for_event ) && ! $mtpg->get( 'MTP_is_override' ) ? $mtpgID : null; |
|
545 | + $select_values[$mtpgID] = __('Global', 'event_espresso'); |
|
546 | + $default_value = array_key_exists($mtpgID, $templates_for_event) && ! $mtpg->get('MTP_is_override') ? $mtpgID : null; |
|
547 | 547 | //if the override has been set for the global template, then that means even if there are custom templates already created we ignore them because of the set override. |
548 | - if ( ! $mtpg->get( 'MTP_is_override' ) ) { |
|
548 | + if ( ! $mtpg->get('MTP_is_override')) { |
|
549 | 549 | //any custom templates for this message type? |
550 | - $custom_templates = EEM_Message_Template_Group::instance()->get_custom_message_template_by_m_and_mt( $this->name, $mtpg->message_type() ); |
|
551 | - foreach ( $custom_templates as $cmtpgID => $cmtpg ) { |
|
552 | - $select_values[ $cmtpgID ] = $cmtpg->name(); |
|
553 | - $default_value = array_key_exists( $cmtpgID, $templates_for_event ) ? $cmtpgID : $default_value; |
|
550 | + $custom_templates = EEM_Message_Template_Group::instance()->get_custom_message_template_by_m_and_mt($this->name, $mtpg->message_type()); |
|
551 | + foreach ($custom_templates as $cmtpgID => $cmtpg) { |
|
552 | + $select_values[$cmtpgID] = $cmtpg->name(); |
|
553 | + $default_value = array_key_exists($cmtpgID, $templates_for_event) ? $cmtpgID : $default_value; |
|
554 | 554 | } |
555 | 555 | } |
556 | 556 | //if there is no $default_value then we set it as the global |
557 | - $default_value = empty( $default_value ) ? $mtpgID : $default_value; |
|
558 | - $edit_url = EEH_URL::add_query_args_and_nonce( array( 'page' => 'espresso_messages', 'action' => 'edit_message_template', 'id' => $default_value ), admin_url( 'admin.php' ) ); |
|
559 | - $create_url = EEH_URL::add_query_args_and_nonce( array( 'page' => 'espresso_messages', 'action' => 'add_new_message_template', 'GRP_ID' => $default_value ), admin_url( 'admin.php' ) ); |
|
560 | - $st_args[ 'mt_name' ] = ucwords( $mtp_obj->label[ 'singular' ] ); |
|
561 | - $st_args[ 'mt_slug' ] = $mtpg->message_type(); |
|
562 | - $st_args[ 'messenger_slug' ] = $this->name; |
|
563 | - $st_args[ 'selector' ] = EEH_Form_Fields::select_input( 'event_message_templates_relation[' . $mtpgID . ']', $select_values, $default_value, 'data-messenger="' . $this->name . '" data-messagetype="' . $mtpg->message_type() . '"', 'message-template-selector' ); |
|
557 | + $default_value = empty($default_value) ? $mtpgID : $default_value; |
|
558 | + $edit_url = EEH_URL::add_query_args_and_nonce(array('page' => 'espresso_messages', 'action' => 'edit_message_template', 'id' => $default_value), admin_url('admin.php')); |
|
559 | + $create_url = EEH_URL::add_query_args_and_nonce(array('page' => 'espresso_messages', 'action' => 'add_new_message_template', 'GRP_ID' => $default_value), admin_url('admin.php')); |
|
560 | + $st_args['mt_name'] = ucwords($mtp_obj->label['singular']); |
|
561 | + $st_args['mt_slug'] = $mtpg->message_type(); |
|
562 | + $st_args['messenger_slug'] = $this->name; |
|
563 | + $st_args['selector'] = EEH_Form_Fields::select_input('event_message_templates_relation['.$mtpgID.']', $select_values, $default_value, 'data-messenger="'.$this->name.'" data-messagetype="'.$mtpg->message_type().'"', 'message-template-selector'); |
|
564 | 564 | //note that message template group that has override_all_custom set will remove the ability to set a custom message template based off of the global (and that also in turn overrides any other custom templates). |
565 | - $st_args[ 'create_button' ] = $mtpg->get( 'MTP_is_override' ) ? '' : '<a data-messenger="' . $this->name . '" data-messagetype="' . $mtpg->message_type() . '" data-grpid="' . $default_value . '" target="_blank" href="' . $create_url . '" class="button button-small create-mtpg-button">' . __( 'Create New Custom', 'event_espresso' ) . '</a>'; |
|
566 | - $st_args[ 'create_button' ] = EE_Registry::instance()->CAP->current_user_can( 'ee_edit_messages', 'espresso_messages_add_new_message_template' ) ? $st_args[ 'create_button' ] : ''; |
|
567 | - $st_args[ 'edit_button' ] = EE_Registry::instance()->CAP->current_user_can( 'ee_edit_message', 'espresso_messages_edit_message_template', $mtpgID ) ? '<a data-messagetype="' . $mtpg->message_type() . '" data-grpid="' . $default_value . '" target="_blank" href="' . $edit_url . '" class="button button-small edit-mtpg-button">' . __( 'Edit', 'event_espresso' ) . '</a>' : ''; |
|
568 | - $selector_rows .= EEH_Template::display_template( $template_row_path, $st_args, true ); |
|
565 | + $st_args['create_button'] = $mtpg->get('MTP_is_override') ? '' : '<a data-messenger="'.$this->name.'" data-messagetype="'.$mtpg->message_type().'" data-grpid="'.$default_value.'" target="_blank" href="'.$create_url.'" class="button button-small create-mtpg-button">'.__('Create New Custom', 'event_espresso').'</a>'; |
|
566 | + $st_args['create_button'] = EE_Registry::instance()->CAP->current_user_can('ee_edit_messages', 'espresso_messages_add_new_message_template') ? $st_args['create_button'] : ''; |
|
567 | + $st_args['edit_button'] = EE_Registry::instance()->CAP->current_user_can('ee_edit_message', 'espresso_messages_edit_message_template', $mtpgID) ? '<a data-messagetype="'.$mtpg->message_type().'" data-grpid="'.$default_value.'" target="_blank" href="'.$edit_url.'" class="button button-small edit-mtpg-button">'.__('Edit', 'event_espresso').'</a>' : ''; |
|
568 | + $selector_rows .= EEH_Template::display_template($template_row_path, $st_args, true); |
|
569 | 569 | } |
570 | 570 | } |
571 | 571 | |
572 | 572 | //if no selectors present then get out. |
573 | - if ( empty( $selector_rows ) ) { |
|
573 | + if (empty($selector_rows)) { |
|
574 | 574 | return ''; |
575 | 575 | } |
576 | 576 | |
577 | 577 | $template_args['selector_rows'] = $selector_rows; |
578 | - return EEH_Template::display_template( $template_wrapper_path, $template_args, TRUE ); |
|
578 | + return EEH_Template::display_template($template_wrapper_path, $template_args, TRUE); |
|
579 | 579 | } |
580 | 580 | |
581 | 581 | |
@@ -590,8 +590,8 @@ discard block |
||
590 | 590 | * @return array $this->_template_fields |
591 | 591 | */ |
592 | 592 | public function get_template_fields() { |
593 | - $template_fields = apply_filters( 'FHEE__' . get_class($this) . '__get_template_fields', $this->_template_fields, $this ); |
|
594 | - $template_fields = apply_filters( 'FHEE__EE_messenger__get_template_fields', $template_fields, $this ); |
|
593 | + $template_fields = apply_filters('FHEE__'.get_class($this).'__get_template_fields', $this->_template_fields, $this); |
|
594 | + $template_fields = apply_filters('FHEE__EE_messenger__get_template_fields', $template_fields, $this); |
|
595 | 595 | return $template_fields; |
596 | 596 | } |
597 | 597 | |
@@ -605,9 +605,9 @@ discard block |
||
605 | 605 | * @param mixed $value |
606 | 606 | */ |
607 | 607 | protected function _set_template_value($item, $value) { |
608 | - if ( array_key_exists($item, $this->_template_fields) ) { |
|
609 | - $prop = '_' . $item; |
|
610 | - $this->{$prop}= $value; |
|
608 | + if (array_key_exists($item, $this->_template_fields)) { |
|
609 | + $prop = '_'.$item; |
|
610 | + $this->{$prop} = $value; |
|
611 | 611 | } |
612 | 612 | } |
613 | 613 | |
@@ -618,8 +618,8 @@ discard block |
||
618 | 618 | * @return bool Very important that all messengers return bool for successful send or not. Error messages can be |
619 | 619 | * added to EE_Error. |
620 | 620 | */ |
621 | - public function send_message( $message, EE_message_type $message_type ) { |
|
622 | - $this->_validate_and_setup( $message ); |
|
621 | + public function send_message($message, EE_message_type $message_type) { |
|
622 | + $this->_validate_and_setup($message); |
|
623 | 623 | $this->_incoming_message_type = $message_type; |
624 | 624 | return $this->_send_message(); |
625 | 625 | } |
@@ -633,28 +633,28 @@ discard block |
||
633 | 633 | * @param bool $send true we will actually use the _send method (for test sends). FALSE we just return preview |
634 | 634 | * @return string return the message html content |
635 | 635 | */ |
636 | - public function get_preview( EE_Message $message, EE_message_type $message_type, $send = false ) { |
|
637 | - $this->_validate_and_setup( $message ); |
|
636 | + public function get_preview(EE_Message $message, EE_message_type $message_type, $send = false) { |
|
637 | + $this->_validate_and_setup($message); |
|
638 | 638 | |
639 | 639 | $this->_incoming_message_type = $message_type; |
640 | 640 | |
641 | - if ( $send ) { |
|
641 | + if ($send) { |
|
642 | 642 | //are we overriding any existing template fields? |
643 | 643 | $settings = $this->get_existing_test_settings(); |
644 | - if ( ! empty( $settings ) ) { |
|
645 | - foreach ( $settings as $field => $value ) { |
|
646 | - $this->_set_template_value( $field, $value ); |
|
644 | + if ( ! empty($settings)) { |
|
645 | + foreach ($settings as $field => $value) { |
|
646 | + $this->_set_template_value($field, $value); |
|
647 | 647 | } |
648 | 648 | } |
649 | 649 | } |
650 | 650 | |
651 | 651 | //enqueue preview js so that any links/buttons on the page are disabled. |
652 | - if ( ! $send ) { |
|
652 | + if ( ! $send) { |
|
653 | 653 | // the below may seem like duplication. However, typically if a messenger enqueues scripts/styles, |
654 | 654 | // it deregisters all existing wp scripts and styles first. So the second hook ensures our previewer still gets setup. |
655 | - add_action( 'admin_enqueue_scripts', array( $this, 'add_preview_script' ), 10 ); |
|
656 | - add_action( 'wp_enqueue_scripts', array( $this, 'add_preview_script' ), 10 ); |
|
657 | - add_action( 'AHEE__EE_messenger__enqueue_scripts_styles', array( $this, 'add_preview_script' ), 10 ); |
|
655 | + add_action('admin_enqueue_scripts', array($this, 'add_preview_script'), 10); |
|
656 | + add_action('wp_enqueue_scripts', array($this, 'add_preview_script'), 10); |
|
657 | + add_action('AHEE__EE_messenger__enqueue_scripts_styles', array($this, 'add_preview_script'), 10); |
|
658 | 658 | } |
659 | 659 | |
660 | 660 | return $send ? $this->_send_message() : $this->_preview(); |
@@ -672,10 +672,10 @@ discard block |
||
672 | 672 | */ |
673 | 673 | public function add_preview_script() { |
674 | 674 | //error message |
675 | - EE_Registry::$i18n_js_strings[ 'links_disabled' ] = __( 'All the links on this page have been disabled because this is a generated preview message for the purpose of ensuring layout, style, and content setup. To test generated links, you must trigger an actual message notification.', 'event_espresso' ); |
|
676 | - wp_register_script( 'ee-messages-preview-js', EE_LIBRARIES_URL . 'messages/messenger/assets/js/ee-messages-preview.js', array( 'jquery' ), EVENT_ESPRESSO_VERSION, true ); |
|
677 | - wp_localize_script( 'ee-messages-preview-js', 'eei18n', EE_Registry::$i18n_js_strings ); |
|
678 | - wp_enqueue_script( 'ee-messages-preview-js' ); |
|
675 | + EE_Registry::$i18n_js_strings['links_disabled'] = __('All the links on this page have been disabled because this is a generated preview message for the purpose of ensuring layout, style, and content setup. To test generated links, you must trigger an actual message notification.', 'event_espresso'); |
|
676 | + wp_register_script('ee-messages-preview-js', EE_LIBRARIES_URL.'messages/messenger/assets/js/ee-messages-preview.js', array('jquery'), EVENT_ESPRESSO_VERSION, true); |
|
677 | + wp_localize_script('ee-messages-preview-js', 'eei18n', EE_Registry::$i18n_js_strings); |
|
678 | + wp_enqueue_script('ee-messages-preview-js'); |
|
679 | 679 | } |
680 | 680 | |
681 | 681 | |
@@ -686,13 +686,13 @@ discard block |
||
686 | 686 | * @param EE_Message $message |
687 | 687 | * @throws EE_Error |
688 | 688 | */ |
689 | - protected function _validate_and_setup( EE_Message $message ) { |
|
689 | + protected function _validate_and_setup(EE_Message $message) { |
|
690 | 690 | $template_pack = $message->get_template_pack(); |
691 | 691 | $variation = $message->get_template_pack_variation(); |
692 | 692 | |
693 | 693 | //verify we have the required template pack value on the $message object. |
694 | - if ( ! $template_pack instanceof EE_Messages_Template_Pack ) { |
|
695 | - throw new EE_Error( __('Incoming $message object must have an EE_Messages_Template_Pack object available.', 'event_espresso' ) ); |
|
694 | + if ( ! $template_pack instanceof EE_Messages_Template_Pack) { |
|
695 | + throw new EE_Error(__('Incoming $message object must have an EE_Messages_Template_Pack object available.', 'event_espresso')); |
|
696 | 696 | } |
697 | 697 | |
698 | 698 | $this->_tmp_pack = $template_pack; |
@@ -701,11 +701,11 @@ discard block |
||
701 | 701 | |
702 | 702 | $template_fields = $this->get_template_fields(); |
703 | 703 | |
704 | - foreach ( $template_fields as $template => $value ) { |
|
705 | - if ( $template !== 'extra' ) { |
|
706 | - $column_value = $message->get_field_or_extra_meta( 'MSG_' . $template ); |
|
704 | + foreach ($template_fields as $template => $value) { |
|
705 | + if ($template !== 'extra') { |
|
706 | + $column_value = $message->get_field_or_extra_meta('MSG_'.$template); |
|
707 | 707 | $message_template_value = $column_value ? $column_value : null; |
708 | - $this->_set_template_value( $template, $message_template_value ); |
|
708 | + $this->_set_template_value($template, $message_template_value); |
|
709 | 709 | } |
710 | 710 | } |
711 | 711 | } |
@@ -720,19 +720,19 @@ discard block |
||
720 | 720 | * @return string |
721 | 721 | * @throws \EE_Error |
722 | 722 | */ |
723 | - protected function _get_main_template( $preview = FALSE ) { |
|
723 | + protected function _get_main_template($preview = FALSE) { |
|
724 | 724 | $type = $preview ? 'preview' : 'main'; |
725 | 725 | |
726 | - $wrapper_template = $this->_tmp_pack->get_wrapper( $this->name, $type ); |
|
726 | + $wrapper_template = $this->_tmp_pack->get_wrapper($this->name, $type); |
|
727 | 727 | |
728 | 728 | //check file exists and is readable |
729 | - if ( !is_readable( $wrapper_template ) ) |
|
730 | - throw new EE_Error( sprintf( __('Unable to access the template file for the %s messenger main content wrapper. The location being attempted is %s.', 'event_espresso' ), ucwords($this->label['singular']) , $wrapper_template ) ); |
|
729 | + if ( ! is_readable($wrapper_template)) |
|
730 | + throw new EE_Error(sprintf(__('Unable to access the template file for the %s messenger main content wrapper. The location being attempted is %s.', 'event_espresso'), ucwords($this->label['singular']), $wrapper_template)); |
|
731 | 731 | |
732 | 732 | //add message type to template args |
733 | 733 | $this->_template_args['message_type'] = $this->_incoming_message_type; |
734 | 734 | |
735 | - return EEH_Template::display_template( $wrapper_template, $this->_template_args, TRUE ); |
|
735 | + return EEH_Template::display_template($wrapper_template, $this->_template_args, TRUE); |
|
736 | 736 | } |
737 | 737 | |
738 | 738 | |
@@ -768,9 +768,9 @@ discard block |
||
768 | 768 | */ |
769 | 769 | public function get_existing_test_settings() { |
770 | 770 | /** @var EE_Message_Resource_Manager $Message_Resource_Manager */ |
771 | - $Message_Resource_Manager = EE_Registry::instance()->load_lib( 'Message_Resource_Manager' ); |
|
771 | + $Message_Resource_Manager = EE_Registry::instance()->load_lib('Message_Resource_Manager'); |
|
772 | 772 | $settings = $Message_Resource_Manager->get_active_messengers_option(); |
773 | - return isset( $settings[ $this->name ]['test_settings'] ) ? $settings[ $this->name ]['test_settings'] : array(); |
|
773 | + return isset($settings[$this->name]['test_settings']) ? $settings[$this->name]['test_settings'] : array(); |
|
774 | 774 | } |
775 | 775 | |
776 | 776 | |
@@ -782,12 +782,12 @@ discard block |
||
782 | 782 | * @param $settings |
783 | 783 | * @return bool success/fail |
784 | 784 | */ |
785 | - public function set_existing_test_settings( $settings ) { |
|
785 | + public function set_existing_test_settings($settings) { |
|
786 | 786 | /** @var EE_Message_Resource_Manager $Message_Resource_Manager */ |
787 | - $Message_Resource_Manager = EE_Registry::instance()->load_lib( 'Message_Resource_Manager' ); |
|
787 | + $Message_Resource_Manager = EE_Registry::instance()->load_lib('Message_Resource_Manager'); |
|
788 | 788 | $existing = $Message_Resource_Manager->get_active_messengers_option(); |
789 | - $existing[ $this->name ]['test_settings'] = $settings; |
|
790 | - return $Message_Resource_Manager->update_active_messengers_option( $existing ); |
|
789 | + $existing[$this->name]['test_settings'] = $settings; |
|
790 | + return $Message_Resource_Manager->update_active_messengers_option($existing); |
|
791 | 791 | } |
792 | 792 | |
793 | 793 | |
@@ -800,21 +800,21 @@ discard block |
||
800 | 800 | * @param string $field The field to retrieve the label for |
801 | 801 | * @return string The label |
802 | 802 | */ |
803 | - public function get_field_label( $field ) { |
|
803 | + public function get_field_label($field) { |
|
804 | 804 | //first let's see if the field requests is in the top level array. |
805 | - if ( isset( $this->_template_fields[$field] ) && !empty( $this->_template_fields[$field]['label'] ) ) |
|
805 | + if (isset($this->_template_fields[$field]) && ! empty($this->_template_fields[$field]['label'])) |
|
806 | 806 | return $this->_template[$field]['label']; |
807 | 807 | |
808 | 808 | //nope so let's look in the extra array to see if it's there HOWEVER if the field exists as a top level index in the extra array then we know the label is in the 'main' index. |
809 | - if ( isset( $this->_template_fields['extra'] ) && !empty( $this->_template_fields['extra'][$field] ) && !empty( $this->_template_fields['extra'][$field]['main']['label'] ) ) |
|
809 | + if (isset($this->_template_fields['extra']) && ! empty($this->_template_fields['extra'][$field]) && ! empty($this->_template_fields['extra'][$field]['main']['label'])) |
|
810 | 810 | return $this->_template_fields['extra'][$field]['main']['label']; |
811 | 811 | |
812 | 812 | //now it's possible this field may just be existing in any of the extra array items. |
813 | - if ( !empty( $this->_template_fields['extra'] ) && is_array( $this->_template_fields['extra'] ) ) { |
|
814 | - foreach ( $this->_template_fields['extra'] as $main_field => $subfields ) { |
|
815 | - if ( !is_array( $subfields ) ) |
|
813 | + if ( ! empty($this->_template_fields['extra']) && is_array($this->_template_fields['extra'])) { |
|
814 | + foreach ($this->_template_fields['extra'] as $main_field => $subfields) { |
|
815 | + if ( ! is_array($subfields)) |
|
816 | 816 | continue; |
817 | - if ( isset( $subfields[$field] ) && !empty( $subfields[$field]['label'] ) ) |
|
817 | + if (isset($subfields[$field]) && ! empty($subfields[$field]['label'])) |
|
818 | 818 | return $subfields[$field]['label']; |
819 | 819 | } |
820 | 820 | } |
@@ -835,7 +835,7 @@ discard block |
||
835 | 835 | * |
836 | 836 | * @return void |
837 | 837 | */ |
838 | - public function do_secondary_messenger_hooks( $sending_messenger_name ) { |
|
838 | + public function do_secondary_messenger_hooks($sending_messenger_name) { |
|
839 | 839 | return; |
840 | 840 | } |
841 | 841 |
@@ -1,6 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
2 | +if (!defined('EVENT_ESPRESSO_VERSION') ) { |
|
3 | 3 | exit('NO direct script access allowed'); |
4 | +} |
|
4 | 5 | |
5 | 6 | /** |
6 | 7 | * Event Espresso |
@@ -726,8 +727,9 @@ discard block |
||
726 | 727 | $wrapper_template = $this->_tmp_pack->get_wrapper( $this->name, $type ); |
727 | 728 | |
728 | 729 | //check file exists and is readable |
729 | - if ( !is_readable( $wrapper_template ) ) |
|
730 | - throw new EE_Error( sprintf( __('Unable to access the template file for the %s messenger main content wrapper. The location being attempted is %s.', 'event_espresso' ), ucwords($this->label['singular']) , $wrapper_template ) ); |
|
730 | + if ( !is_readable( $wrapper_template ) ) { |
|
731 | + throw new EE_Error( sprintf( __('Unable to access the template file for the %s messenger main content wrapper. The location being attempted is %s.', 'event_espresso' ), ucwords($this->label['singular']) , $wrapper_template ) ); |
|
732 | + } |
|
731 | 733 | |
732 | 734 | //add message type to template args |
733 | 735 | $this->_template_args['message_type'] = $this->_incoming_message_type; |
@@ -802,20 +804,24 @@ discard block |
||
802 | 804 | */ |
803 | 805 | public function get_field_label( $field ) { |
804 | 806 | //first let's see if the field requests is in the top level array. |
805 | - if ( isset( $this->_template_fields[$field] ) && !empty( $this->_template_fields[$field]['label'] ) ) |
|
806 | - return $this->_template[$field]['label']; |
|
807 | + if ( isset( $this->_template_fields[$field] ) && !empty( $this->_template_fields[$field]['label'] ) ) { |
|
808 | + return $this->_template[$field]['label']; |
|
809 | + } |
|
807 | 810 | |
808 | 811 | //nope so let's look in the extra array to see if it's there HOWEVER if the field exists as a top level index in the extra array then we know the label is in the 'main' index. |
809 | - if ( isset( $this->_template_fields['extra'] ) && !empty( $this->_template_fields['extra'][$field] ) && !empty( $this->_template_fields['extra'][$field]['main']['label'] ) ) |
|
810 | - return $this->_template_fields['extra'][$field]['main']['label']; |
|
812 | + if ( isset( $this->_template_fields['extra'] ) && !empty( $this->_template_fields['extra'][$field] ) && !empty( $this->_template_fields['extra'][$field]['main']['label'] ) ) { |
|
813 | + return $this->_template_fields['extra'][$field]['main']['label']; |
|
814 | + } |
|
811 | 815 | |
812 | 816 | //now it's possible this field may just be existing in any of the extra array items. |
813 | 817 | if ( !empty( $this->_template_fields['extra'] ) && is_array( $this->_template_fields['extra'] ) ) { |
814 | 818 | foreach ( $this->_template_fields['extra'] as $main_field => $subfields ) { |
815 | - if ( !is_array( $subfields ) ) |
|
816 | - continue; |
|
817 | - if ( isset( $subfields[$field] ) && !empty( $subfields[$field]['label'] ) ) |
|
818 | - return $subfields[$field]['label']; |
|
819 | + if ( !is_array( $subfields ) ) { |
|
820 | + continue; |
|
821 | + } |
|
822 | + if ( isset( $subfields[$field] ) && !empty( $subfields[$field]['label'] ) ) { |
|
823 | + return $subfields[$field]['label']; |
|
824 | + } |
|
819 | 825 | } |
820 | 826 | } |
821 | 827 |
@@ -631,8 +631,6 @@ |
||
631 | 631 | /** |
632 | 632 | * handles toggleing the checkin status for the registration, |
633 | 633 | * @access protected |
634 | - * @param boolean $check_in |
|
635 | - * @return void |
|
636 | 634 | */ |
637 | 635 | protected function _toggle_checkin_status() { |
638 | 636 | //first let's get the query args out of the way for the redirect |
@@ -453,9 +453,9 @@ discard block |
||
453 | 453 | |
454 | 454 | /** |
455 | 455 | * generates Business Reports regarding Registrations |
456 | - * @access protected |
|
457 | - * @return void |
|
458 | - */ |
|
456 | + * @access protected |
|
457 | + * @return void |
|
458 | + */ |
|
459 | 459 | protected function _registration_reports() { |
460 | 460 | $template_path = EE_ADMIN_TEMPLATE . 'admin_reports.template.php'; |
461 | 461 | $this->_template_args['admin_page_content'] = EEH_Template::display_template( $template_path, $this->_reports_template_data, true ); |
@@ -630,10 +630,10 @@ discard block |
||
630 | 630 | |
631 | 631 | /** |
632 | 632 | * handles toggleing the checkin status for the registration, |
633 | - * @access protected |
|
634 | - * @param boolean $check_in |
|
635 | - * @return void |
|
636 | - */ |
|
633 | + * @access protected |
|
634 | + * @param boolean $check_in |
|
635 | + * @return void |
|
636 | + */ |
|
637 | 637 | protected function _toggle_checkin_status() { |
638 | 638 | //first let's get the query args out of the way for the redirect |
639 | 639 | $query_args = array( |
@@ -754,9 +754,9 @@ discard block |
||
754 | 754 | |
755 | 755 | /** |
756 | 756 | * generates HTML for the Event Registrations List Table |
757 | - * @access protected |
|
758 | - * @return void |
|
759 | - */ |
|
757 | + * @access protected |
|
758 | + * @return void |
|
759 | + */ |
|
760 | 760 | protected function _event_registrations_list_table() { |
761 | 761 | do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' ); |
762 | 762 | $this->_admin_page_title .= isset( $this->_req_data['event_id'] ) ? $this->get_action_link_or_button('new_registration', 'add-registrant', array('event_id' => $this->_req_data['event_id']), 'add-new-h2') : ''; |
@@ -786,11 +786,11 @@ discard block |
||
786 | 786 | 'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_approved, |
787 | 787 | 'desc' => EEH_Template::pretty_status( EEM_Registration::status_id_approved, FALSE, 'sentence' ) |
788 | 788 | ), |
789 | - 'cancelled_status' => array( |
|
789 | + 'cancelled_status' => array( |
|
790 | 790 | 'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_cancelled, |
791 | 791 | 'desc' => EEH_Template::pretty_status( EEM_Registration::status_id_cancelled, FALSE, 'sentence' ) |
792 | 792 | ), |
793 | - 'declined_status' => array( |
|
793 | + 'declined_status' => array( |
|
794 | 794 | 'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_declined, |
795 | 795 | 'desc' => EEH_Template::pretty_status( EEM_Registration::status_id_declined, FALSE, 'sentence' ) |
796 | 796 | ), |
@@ -818,9 +818,9 @@ discard block |
||
818 | 818 | /** |
819 | 819 | * get_attendees |
820 | 820 | * @param bool $count whether to return count or data. |
821 | - * @access public |
|
822 | - * @return array |
|
823 | - */ |
|
821 | + * @access public |
|
822 | + * @return array |
|
823 | + */ |
|
824 | 824 | public function get_event_attendees( $per_page = 10, $count = FALSE, $trash = FALSE, $orderby = '' ) { |
825 | 825 | |
826 | 826 | do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' ); |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
2 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) |
|
3 | 3 | exit('NO direct script access allowed'); |
4 | 4 | |
5 | 5 | /** |
@@ -37,20 +37,20 @@ discard block |
||
37 | 37 | protected $_reports_template_data = array(); |
38 | 38 | |
39 | 39 | |
40 | - public function __construct( $routing = TRUE ) { |
|
41 | - parent::__construct( $routing ); |
|
42 | - define( 'REG_CAF_TEMPLATE_PATH', EE_CORE_CAF_ADMIN_EXTEND . 'registrations/templates/'); |
|
43 | - define( 'REG_CAF_ASSETS', EE_CORE_CAF_ADMIN_EXTEND . 'registrations/assets/'); |
|
44 | - define( 'REG_CAF_ASSETS_URL', EE_CORE_CAF_ADMIN_EXTEND_URL . 'registrations/assets/'); |
|
40 | + public function __construct($routing = TRUE) { |
|
41 | + parent::__construct($routing); |
|
42 | + define('REG_CAF_TEMPLATE_PATH', EE_CORE_CAF_ADMIN_EXTEND.'registrations/templates/'); |
|
43 | + define('REG_CAF_ASSETS', EE_CORE_CAF_ADMIN_EXTEND.'registrations/assets/'); |
|
44 | + define('REG_CAF_ASSETS_URL', EE_CORE_CAF_ADMIN_EXTEND_URL.'registrations/assets/'); |
|
45 | 45 | } |
46 | 46 | |
47 | 47 | |
48 | 48 | protected function _extend_page_config() { |
49 | - $this->_admin_base_path = EE_CORE_CAF_ADMIN_EXTEND . 'registrations'; |
|
49 | + $this->_admin_base_path = EE_CORE_CAF_ADMIN_EXTEND.'registrations'; |
|
50 | 50 | |
51 | - $reg_id = ! empty( $this->_req_data['_REG_ID'] ) && ! is_array( $this->_req_data['_REG_ID'] ) ? $this->_req_data['_REG_ID'] : 0; |
|
52 | - $att_id = ! empty( $this->_req_data[ 'ATT_ID' ] ) ? ! is_array( $this->_req_data['ATT_ID'] ) : 0; |
|
53 | - $att_id = ! empty( $this->_req_data['post'] ) && ! is_array( $this->_req_data['post'] ) ? $this->_req_data['post'] : $att_id; |
|
51 | + $reg_id = ! empty($this->_req_data['_REG_ID']) && ! is_array($this->_req_data['_REG_ID']) ? $this->_req_data['_REG_ID'] : 0; |
|
52 | + $att_id = ! empty($this->_req_data['ATT_ID']) ? ! is_array($this->_req_data['ATT_ID']) : 0; |
|
53 | + $att_id = ! empty($this->_req_data['post']) && ! is_array($this->_req_data['post']) ? $this->_req_data['post'] : $att_id; |
|
54 | 54 | |
55 | 55 | $new_page_routes = array( |
56 | 56 | 'reports' => array( |
@@ -89,7 +89,7 @@ discard block |
||
89 | 89 | ) |
90 | 90 | ); |
91 | 91 | |
92 | - $this->_page_routes = array_merge( $this->_page_routes, $new_page_routes ); |
|
92 | + $this->_page_routes = array_merge($this->_page_routes, $new_page_routes); |
|
93 | 93 | |
94 | 94 | $new_page_config = array( |
95 | 95 | 'reports' => array( |
@@ -134,8 +134,8 @@ discard block |
||
134 | 134 | 'filename' => 'registrations_event_checkin_other' |
135 | 135 | ) |
136 | 136 | ), |
137 | - 'help_tour' => array( 'Event_Checkin_Help_Tour' ), |
|
138 | - 'qtips' => array('Registration_List_Table_Tips' ), |
|
137 | + 'help_tour' => array('Event_Checkin_Help_Tour'), |
|
138 | + 'qtips' => array('Registration_List_Table_Tips'), |
|
139 | 139 | 'list_table' => 'EE_Event_Registrations_List_Table', |
140 | 140 | 'metaboxes' => array(), |
141 | 141 | 'require_nonce' => FALSE |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | ), |
154 | 154 | ); |
155 | 155 | |
156 | - $this->_page_config = array_merge( $this->_page_config, $new_page_config ); |
|
156 | + $this->_page_config = array_merge($this->_page_config, $new_page_config); |
|
157 | 157 | $this->_page_config['contact_list']['list_table'] = 'Extend_EE_Attendee_Contact_List_Table'; |
158 | 158 | $this->_page_config['default']['list_table'] = 'Extend_EE_Registrations_List_Table'; |
159 | 159 | } |
@@ -162,7 +162,7 @@ discard block |
||
162 | 162 | |
163 | 163 | protected function _ajax_hooks() { |
164 | 164 | parent::_ajax_hooks(); |
165 | - add_action( 'wp_ajax_get_newsletter_form_content', array( $this, 'get_newsletter_form_content' ) ); |
|
165 | + add_action('wp_ajax_get_newsletter_form_content', array($this, 'get_newsletter_form_content')); |
|
166 | 166 | } |
167 | 167 | |
168 | 168 | |
@@ -171,20 +171,20 @@ discard block |
||
171 | 171 | parent::load_scripts_styles(); |
172 | 172 | |
173 | 173 | //if newsletter message type is active then let's add filter and load js for it. |
174 | - if ( EEH_MSG_Template::is_mt_active('newsletter') ) { |
|
174 | + if (EEH_MSG_Template::is_mt_active('newsletter')) { |
|
175 | 175 | //enqueue newsletter js |
176 | - wp_enqueue_script( 'ee-newsletter-trigger', REG_CAF_ASSETS_URL . 'ee-newsletter-trigger.js', array( 'ee-dialog' ), EVENT_ESPRESSO_VERSION, TRUE ); |
|
177 | - wp_enqueue_style( 'ee-newsletter-trigger-css', REG_CAF_ASSETS_URL . 'ee-newsletter-trigger.css', array(), EVENT_ESPRESSO_VERSION ); |
|
176 | + wp_enqueue_script('ee-newsletter-trigger', REG_CAF_ASSETS_URL.'ee-newsletter-trigger.js', array('ee-dialog'), EVENT_ESPRESSO_VERSION, TRUE); |
|
177 | + wp_enqueue_style('ee-newsletter-trigger-css', REG_CAF_ASSETS_URL.'ee-newsletter-trigger.css', array(), EVENT_ESPRESSO_VERSION); |
|
178 | 178 | //hook in buttons for newsletter message type trigger. |
179 | - add_action('AHEE__EE_Admin_List_Table__extra_tablenav__after_bottom_buttons', array( $this, 'add_newsletter_action_buttons'), 10 ); |
|
179 | + add_action('AHEE__EE_Admin_List_Table__extra_tablenav__after_bottom_buttons', array($this, 'add_newsletter_action_buttons'), 10); |
|
180 | 180 | } |
181 | 181 | } |
182 | 182 | |
183 | 183 | |
184 | 184 | |
185 | 185 | public function load_scripts_styles_reports() { |
186 | - wp_register_script( 'ee-reg-reports-js', REG_CAF_ASSETS_URL . 'ee-registration-admin-reports.js', array( 'google-charts' ), EVENT_ESPRESSO_VERSION, true ); |
|
187 | - wp_enqueue_script( 'ee-reg-reports-js' ); |
|
186 | + wp_register_script('ee-reg-reports-js', REG_CAF_ASSETS_URL.'ee-registration-admin-reports.js', array('google-charts'), EVENT_ESPRESSO_VERSION, true); |
|
187 | + wp_enqueue_script('ee-reg-reports-js'); |
|
188 | 188 | $this->_registration_reports_js_setup(); |
189 | 189 | } |
190 | 190 | |
@@ -216,7 +216,7 @@ discard block |
||
216 | 216 | 'slug' => 'all', |
217 | 217 | 'label' => __('All', 'event_espresso'), |
218 | 218 | 'count' => 0, |
219 | - 'bulk_action' => !isset( $this->_req_data['event_id'] ) ? array() : array( |
|
219 | + 'bulk_action' => ! isset($this->_req_data['event_id']) ? array() : array( |
|
220 | 220 | 'toggle_checkin_status' => __('Toggle Check-In', 'event_espresso'), |
221 | 221 | //'trash_registrations' => __('Trash Registrations', 'event_espresso') |
222 | 222 | ) |
@@ -234,7 +234,7 @@ discard block |
||
234 | 234 | 'slug' => 'all', |
235 | 235 | 'label' => __('All', 'event_espresso'), |
236 | 236 | 'count' => 0, |
237 | - 'bulk_action' => array( 'delete_checkin_rows' => __('Delete Check-In Rows', 'event_espresso') ) |
|
237 | + 'bulk_action' => array('delete_checkin_rows' => __('Delete Check-In Rows', 'event_espresso')) |
|
238 | 238 | ), |
239 | 239 | ); |
240 | 240 | } |
@@ -250,20 +250,20 @@ discard block |
||
250 | 250 | */ |
251 | 251 | public function get_newsletter_form_content() { |
252 | 252 | //do a nonce check cause we're not coming in from an normal route here. |
253 | - $nonce = isset( $this->_req_data['get_newsletter_form_content_nonce'] ) ? sanitize_text_field( $this->_req_data['get_newsletter_form_content_nonce'] ) : ''; |
|
253 | + $nonce = isset($this->_req_data['get_newsletter_form_content_nonce']) ? sanitize_text_field($this->_req_data['get_newsletter_form_content_nonce']) : ''; |
|
254 | 254 | $nonce_ref = 'get_newsletter_form_content_nonce'; |
255 | 255 | |
256 | - $this->_verify_nonce( $nonce, $nonce_ref ); |
|
256 | + $this->_verify_nonce($nonce, $nonce_ref); |
|
257 | 257 | //let's get the mtp for the incoming MTP_ ID |
258 | - if ( !isset( $this->_req_data['GRP_ID'] ) ) { |
|
259 | - EE_Error::add_error( __('There must be something broken with the js or html structure because the required data for getting a message template group is not present (need an GRP_ID).', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ ); |
|
258 | + if ( ! isset($this->_req_data['GRP_ID'])) { |
|
259 | + EE_Error::add_error(__('There must be something broken with the js or html structure because the required data for getting a message template group is not present (need an GRP_ID).', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__); |
|
260 | 260 | $this->_template_args['success'] = FALSE; |
261 | 261 | $this->_template_args['error'] = TRUE; |
262 | 262 | $this->_return_json(); |
263 | 263 | } |
264 | - $MTPG = EEM_Message_Template_Group::instance()->get_one_by_ID( $this->_req_data['GRP_ID'] ); |
|
265 | - if ( ! $MTPG instanceof EE_Message_Template_Group ) { |
|
266 | - EE_Error::add_error( sprintf( __('The GRP_ID given (%d) does not appear to have a corresponding row in the database.', 'event_espresso'), $this->_req_data['GRP_ID'] ), __FILE__, __FUNCTION__, __LINE__ ); |
|
264 | + $MTPG = EEM_Message_Template_Group::instance()->get_one_by_ID($this->_req_data['GRP_ID']); |
|
265 | + if ( ! $MTPG instanceof EE_Message_Template_Group) { |
|
266 | + EE_Error::add_error(sprintf(__('The GRP_ID given (%d) does not appear to have a corresponding row in the database.', 'event_espresso'), $this->_req_data['GRP_ID']), __FILE__, __FUNCTION__, __LINE__); |
|
267 | 267 | $this->_template_args['success'] = FALSE; |
268 | 268 | $this->_template_args['error'] = TRUE; |
269 | 269 | $this->_return_json(); |
@@ -272,11 +272,11 @@ discard block |
||
272 | 272 | $MTPs = $MTPG->context_templates(); |
273 | 273 | $MTPs = $MTPs['attendee']; |
274 | 274 | $template_fields = array(); |
275 | - foreach ( $MTPs as $MTP ) { |
|
275 | + foreach ($MTPs as $MTP) { |
|
276 | 276 | $field = $MTP->get('MTP_template_field'); |
277 | - if ( $field == 'content' ) { |
|
277 | + if ($field == 'content') { |
|
278 | 278 | $content = $MTP->get('MTP_content'); |
279 | - if ( !empty( $content['newsletter_content'] ) ) { |
|
279 | + if ( ! empty($content['newsletter_content'])) { |
|
280 | 280 | $template_fields['newsletter_content'] = $content['newsletter_content']; |
281 | 281 | } |
282 | 282 | continue; |
@@ -289,7 +289,7 @@ discard block |
||
289 | 289 | $this->_template_args['data'] = array( |
290 | 290 | 'batch_message_from' => isset($template_fields['from']) ? $template_fields['from'] : '', |
291 | 291 | 'batch_message_subject' => isset($template_fields['subject']) ? $template_fields['subject'] : '', |
292 | - 'batch_message_content' => isset( $template_fields['newsletter_content'] ) ? $template_fields['newsletter_content'] : '' |
|
292 | + 'batch_message_content' => isset($template_fields['newsletter_content']) ? $template_fields['newsletter_content'] : '' |
|
293 | 293 | ); |
294 | 294 | $this->_return_json(); |
295 | 295 | } |
@@ -305,8 +305,8 @@ discard block |
||
305 | 305 | * @param EE_Admin_List_Table $list_table |
306 | 306 | * @return string html string for extra buttons |
307 | 307 | */ |
308 | - public function add_newsletter_action_buttons( EE_Admin_List_Table $list_table ) { |
|
309 | - if ( ! EE_Registry::instance()->CAP->current_user_can( 'ee_send_message', 'espresso_registrations_newsletter_selected_send' ) ) { |
|
308 | + public function add_newsletter_action_buttons(EE_Admin_List_Table $list_table) { |
|
309 | + if ( ! EE_Registry::instance()->CAP->current_user_can('ee_send_message', 'espresso_registrations_newsletter_selected_send')) { |
|
310 | 310 | return ''; |
311 | 311 | } |
312 | 312 | |
@@ -315,13 +315,13 @@ discard block |
||
315 | 315 | 'event_registrations', |
316 | 316 | 'default' |
317 | 317 | ); |
318 | - if ( $this->_current_page == 'espresso_registrations' && in_array( $this->_req_action, $routes_to_add_to ) ) { |
|
319 | - if ( ( $this->_req_action == 'event_registrations' && empty( $this->_req_data['event_id'] ) ) || ( isset( $this->_req_data['status'] ) && $this->_req_data['status'] == 'trash' ) ) { |
|
318 | + if ($this->_current_page == 'espresso_registrations' && in_array($this->_req_action, $routes_to_add_to)) { |
|
319 | + if (($this->_req_action == 'event_registrations' && empty($this->_req_data['event_id'])) || (isset($this->_req_data['status']) && $this->_req_data['status'] == 'trash')) { |
|
320 | 320 | echo ''; |
321 | 321 | } else { |
322 | - $button_text = sprintf( __('Send Batch Message (%s selected)', 'event_espresso'), '<span class="send-selected-newsletter-count">0</span>' ); |
|
323 | - echo '<button id="selected-batch-send-trigger" class="button secondary-button"><span class="dashicons dashicons-email "></span>' . $button_text . '</button>'; |
|
324 | - add_action('admin_footer', array( $this, 'newsletter_send_form_skeleton') ); |
|
322 | + $button_text = sprintf(__('Send Batch Message (%s selected)', 'event_espresso'), '<span class="send-selected-newsletter-count">0</span>'); |
|
323 | + echo '<button id="selected-batch-send-trigger" class="button secondary-button"><span class="dashicons dashicons-email "></span>'.$button_text.'</button>'; |
|
324 | + add_action('admin_footer', array($this, 'newsletter_send_form_skeleton')); |
|
325 | 325 | } |
326 | 326 | } |
327 | 327 | } |
@@ -333,37 +333,37 @@ discard block |
||
333 | 333 | $list_table = $this->_list_table_object; |
334 | 334 | $codes = array(); |
335 | 335 | //need to templates for the newsletter message type for the template selector. |
336 | - $values[] = array( 'text' => __('Select Template to Use', 'event_espresso'), 'id' => 0 ); |
|
337 | - $mtps = EEM_Message_Template_Group::instance()->get_all( array( array( 'MTP_message_type' => 'newsletter', 'MTP_messenger' => 'email' ) ) ); |
|
338 | - foreach ( $mtps as $mtp ) { |
|
336 | + $values[] = array('text' => __('Select Template to Use', 'event_espresso'), 'id' => 0); |
|
337 | + $mtps = EEM_Message_Template_Group::instance()->get_all(array(array('MTP_message_type' => 'newsletter', 'MTP_messenger' => 'email'))); |
|
338 | + foreach ($mtps as $mtp) { |
|
339 | 339 | $name = $mtp->name(); |
340 | 340 | $values[] = array( |
341 | - 'text' => empty( $name ) ? __('Global', 'event_espresso') : $name, |
|
341 | + 'text' => empty($name) ? __('Global', 'event_espresso') : $name, |
|
342 | 342 | 'id' => $mtp->ID() |
343 | 343 | ); |
344 | 344 | } |
345 | 345 | |
346 | 346 | //need to get a list of shortcodes that are available for the newsletter message type. |
347 | - $shortcodes = EEH_MSG_Template::get_shortcodes( 'newsletter', 'email', array(), 'attendee', FALSE ); |
|
348 | - foreach ( $shortcodes as $field => $shortcode_array ) { |
|
349 | - $codes[$field] = implode(', ', array_keys($shortcode_array ) ); |
|
347 | + $shortcodes = EEH_MSG_Template::get_shortcodes('newsletter', 'email', array(), 'attendee', FALSE); |
|
348 | + foreach ($shortcodes as $field => $shortcode_array) { |
|
349 | + $codes[$field] = implode(', ', array_keys($shortcode_array)); |
|
350 | 350 | } |
351 | 351 | |
352 | 352 | $shortcodes = $codes; |
353 | 353 | |
354 | - $form_template = REG_CAF_TEMPLATE_PATH . 'newsletter-send-form.template.php'; |
|
354 | + $form_template = REG_CAF_TEMPLATE_PATH.'newsletter-send-form.template.php'; |
|
355 | 355 | $form_template_args = array( |
356 | 356 | 'form_action' => admin_url('admin.php?page=espresso_registrations'), |
357 | 357 | 'form_route' => 'newsletter_selected_send', |
358 | 358 | 'form_nonce_name' => 'newsletter_selected_send_nonce', |
359 | - 'form_nonce' => wp_create_nonce( 'newsletter_selected_send_nonce' ), |
|
359 | + 'form_nonce' => wp_create_nonce('newsletter_selected_send_nonce'), |
|
360 | 360 | 'redirect_back_to' => $this->_req_action, |
361 | - 'ajax_nonce' => wp_create_nonce( 'get_newsletter_form_content_nonce'), |
|
362 | - 'template_selector' => EEH_Form_Fields::select_input('newsletter_mtp_selected', $values ), |
|
361 | + 'ajax_nonce' => wp_create_nonce('get_newsletter_form_content_nonce'), |
|
362 | + 'template_selector' => EEH_Form_Fields::select_input('newsletter_mtp_selected', $values), |
|
363 | 363 | 'shortcodes' => $shortcodes, |
364 | 364 | 'id_type' => $list_table instanceof EE_Attendee_Contact_List_Table ? 'contact' : 'registration' |
365 | 365 | ); |
366 | - EEH_Template::display_template( $form_template, $form_template_args ); |
|
366 | + EEH_Template::display_template($form_template, $form_template_args); |
|
367 | 367 | } |
368 | 368 | |
369 | 369 | |
@@ -378,7 +378,7 @@ discard block |
||
378 | 378 | protected function _newsletter_selected_send() { |
379 | 379 | $success = TRUE; |
380 | 380 | //first we need to make sure we have a GRP_ID so we know what template we're sending and updating! |
381 | - if ( empty( $this->_req_data['newsletter_mtp_selected'] ) ) { |
|
381 | + if (empty($this->_req_data['newsletter_mtp_selected'])) { |
|
382 | 382 | EE_Error::add_error( |
383 | 383 | __( |
384 | 384 | 'In order to send a message, a Message Template GRP_ID is needed. It was not provided so messages were not sent.', |
@@ -389,7 +389,7 @@ discard block |
||
389 | 389 | $success = FALSE; |
390 | 390 | } |
391 | 391 | |
392 | - if ( $success ) { |
|
392 | + if ($success) { |
|
393 | 393 | //update Message template in case there are any changes |
394 | 394 | $Message_Template_Group = EEM_Message_Template_Group::instance()->get_one_by_ID( |
395 | 395 | $this->_req_data['newsletter_mtp_selected'] |
@@ -397,7 +397,7 @@ discard block |
||
397 | 397 | $Message_Templates = $Message_Template_Group instanceof EE_Message_Template_Group |
398 | 398 | ? $Message_Template_Group->context_templates() |
399 | 399 | : array(); |
400 | - if ( empty( $Message_Templates ) ) { |
|
400 | + if (empty($Message_Templates)) { |
|
401 | 401 | EE_Error::add_error( |
402 | 402 | __( |
403 | 403 | 'Unable to retrieve message template fields from the db. Messages not sent.', |
@@ -408,25 +408,25 @@ discard block |
||
408 | 408 | } |
409 | 409 | |
410 | 410 | //let's just update the specific fields |
411 | - foreach ( $Message_Templates['attendee'] as $Message_Template ) { |
|
412 | - if ( $Message_Template instanceof EE_Message_Template ) { |
|
413 | - $field = $Message_Template->get( 'MTP_template_field' ); |
|
414 | - $content = $Message_Template->get( 'MTP_content' ); |
|
411 | + foreach ($Message_Templates['attendee'] as $Message_Template) { |
|
412 | + if ($Message_Template instanceof EE_Message_Template) { |
|
413 | + $field = $Message_Template->get('MTP_template_field'); |
|
414 | + $content = $Message_Template->get('MTP_content'); |
|
415 | 415 | $new_content = $content; |
416 | - switch ( $field ) { |
|
416 | + switch ($field) { |
|
417 | 417 | case 'from' : |
418 | - $new_content = ! empty( $this->_req_data['batch_message']['from'] ) |
|
418 | + $new_content = ! empty($this->_req_data['batch_message']['from']) |
|
419 | 419 | ? $this->_req_data['batch_message']['from'] |
420 | 420 | : $content; |
421 | 421 | break; |
422 | 422 | case 'subject' : |
423 | - $new_content = ! empty( $this->_req_data['batch_message']['subject'] ) |
|
423 | + $new_content = ! empty($this->_req_data['batch_message']['subject']) |
|
424 | 424 | ? $this->_req_data['batch_message']['subject'] |
425 | 425 | : $content; |
426 | 426 | break; |
427 | 427 | case 'content' : |
428 | 428 | $new_content = $content; |
429 | - $new_content['newsletter_content'] = ! empty( $this->_req_data['batch_message']['content'] ) |
|
429 | + $new_content['newsletter_content'] = ! empty($this->_req_data['batch_message']['content']) |
|
430 | 430 | ? $this->_req_data['batch_message']['content'] |
431 | 431 | : $content['newsletter_content']; |
432 | 432 | break; |
@@ -434,35 +434,35 @@ discard block |
||
434 | 434 | continue; |
435 | 435 | break; |
436 | 436 | } |
437 | - $Message_Template->set( 'MTP_content', $new_content ); |
|
437 | + $Message_Template->set('MTP_content', $new_content); |
|
438 | 438 | $Message_Template->save(); |
439 | 439 | } |
440 | 440 | } |
441 | 441 | |
442 | 442 | //great fields are updated! now let's make sure we just have contact objects (EE_Attendee). |
443 | - $id_type = ! empty( $this->_req_data['batch_message']['id_type'] ) |
|
443 | + $id_type = ! empty($this->_req_data['batch_message']['id_type']) |
|
444 | 444 | ? $this->_req_data['batch_message']['id_type'] |
445 | 445 | : 'registration'; |
446 | 446 | |
447 | 447 | //id_type will affect how we assemble the ids. |
448 | - $ids = ! empty( $this->_req_data['batch_message']['ids'] ) |
|
449 | - ? json_decode( stripslashes($this->_req_data['batch_message']['ids']) ) |
|
448 | + $ids = ! empty($this->_req_data['batch_message']['ids']) |
|
449 | + ? json_decode(stripslashes($this->_req_data['batch_message']['ids'])) |
|
450 | 450 | : array(); |
451 | 451 | |
452 | 452 | $registrations_used_for_contact_data = array(); |
453 | 453 | //using switch because eventually we'll have other contexts that will be used for generating messages. |
454 | - switch ( $id_type ) { |
|
454 | + switch ($id_type) { |
|
455 | 455 | case 'registration' : |
456 | 456 | $registrations_used_for_contact_data = EEM_Registration::instance()->get_all( |
457 | 457 | array( |
458 | 458 | array( |
459 | - 'REG_ID' => array( 'IN', $ids ) |
|
459 | + 'REG_ID' => array('IN', $ids) |
|
460 | 460 | ) |
461 | 461 | ) |
462 | 462 | ); |
463 | 463 | break; |
464 | 464 | case 'contact' : |
465 | - $registrations_used_for_contact_data = EEM_Registration::instance()->get_latest_registration_for_each_of_given_contacts( $ids ); |
|
465 | + $registrations_used_for_contact_data = EEM_Registration::instance()->get_latest_registration_for_each_of_given_contacts($ids); |
|
466 | 466 | break; |
467 | 467 | } |
468 | 468 | do_action( |
@@ -473,8 +473,8 @@ discard block |
||
473 | 473 | //kept for backward compat, internally we no longer use this action. |
474 | 474 | //@deprecated 4.8.36.rc.002 |
475 | 475 | $contacts = $id_type == 'registration' |
476 | - ? EEM_Attendee::instance()->get_array_of_contacts_from_reg_ids( $ids ) |
|
477 | - : EEM_Attendee::instance()->get_all( array( array( 'ATT_ID' => array('in', $ids ) ) ) ); |
|
476 | + ? EEM_Attendee::instance()->get_array_of_contacts_from_reg_ids($ids) |
|
477 | + : EEM_Attendee::instance()->get_all(array(array('ATT_ID' => array('in', $ids)))); |
|
478 | 478 | do_action( |
479 | 479 | 'AHEE__Extend_Registrations_Admin_Page___newsletter_selected_send', |
480 | 480 | $contacts, |
@@ -482,11 +482,11 @@ discard block |
||
482 | 482 | ); |
483 | 483 | } |
484 | 484 | $query_args = array( |
485 | - 'action' => !empty( $this->_req_data['redirect_back_to'] ) |
|
485 | + 'action' => ! empty($this->_req_data['redirect_back_to']) |
|
486 | 486 | ? $this->_req_data['redirect_back_to'] |
487 | 487 | : 'default' |
488 | 488 | ); |
489 | - $this->_redirect_after_action( FALSE, '', '', $query_args, TRUE ); |
|
489 | + $this->_redirect_after_action(FALSE, '', '', $query_args, TRUE); |
|
490 | 490 | } |
491 | 491 | |
492 | 492 | |
@@ -508,8 +508,8 @@ discard block |
||
508 | 508 | * @return void |
509 | 509 | */ |
510 | 510 | protected function _registration_reports() { |
511 | - $template_path = EE_ADMIN_TEMPLATE . 'admin_reports.template.php'; |
|
512 | - $this->_template_args['admin_page_content'] = EEH_Template::display_template( $template_path, $this->_reports_template_data, true ); |
|
511 | + $template_path = EE_ADMIN_TEMPLATE.'admin_reports.template.php'; |
|
512 | + $this->_template_args['admin_page_content'] = EEH_Template::display_template($template_path, $this->_reports_template_data, true); |
|
513 | 513 | // the final template wrapper |
514 | 514 | $this->display_admin_page_with_no_sidebar(); |
515 | 515 | |
@@ -522,28 +522,28 @@ discard block |
||
522 | 522 | * |
523 | 523 | * @return string |
524 | 524 | */ |
525 | - private function _registrations_per_day_report( $period = '-1 month' ) { |
|
525 | + private function _registrations_per_day_report($period = '-1 month') { |
|
526 | 526 | $report_ID = 'reg-admin-registrations-per-day-report-dv'; |
527 | 527 | |
528 | - $results = EEM_Registration::instance()->get_registrations_per_day_and_per_status_report( $period ); |
|
528 | + $results = EEM_Registration::instance()->get_registrations_per_day_and_per_status_report($period); |
|
529 | 529 | |
530 | 530 | $results = (array) $results; |
531 | 531 | $regs = array(); |
532 | 532 | $subtitle = ''; |
533 | 533 | |
534 | - if( $results ) { |
|
534 | + if ($results) { |
|
535 | 535 | $column_titles = array(); |
536 | 536 | $tracker = 0; |
537 | - foreach ( $results as $result ) { |
|
537 | + foreach ($results as $result) { |
|
538 | 538 | $report_column_values = array(); |
539 | - foreach( $result as $property_name => $property_value ) { |
|
539 | + foreach ($result as $property_name => $property_value) { |
|
540 | 540 | $property_value = $property_name == 'Registration_REG_date' ? $property_value : (int) $property_value; |
541 | 541 | $report_column_values[] = $property_value; |
542 | - if ( $tracker === 0 ) { |
|
543 | - if ( $property_name == 'Registration_REG_date' ) { |
|
544 | - $column_titles[] = __( 'Date (only days with registrations are shown)', 'event_espresso' ); |
|
542 | + if ($tracker === 0) { |
|
543 | + if ($property_name == 'Registration_REG_date') { |
|
544 | + $column_titles[] = __('Date (only days with registrations are shown)', 'event_espresso'); |
|
545 | 545 | } else { |
546 | - $column_titles[] = EEH_Template::pretty_status( $property_name, false, 'sentence' ); |
|
546 | + $column_titles[] = EEH_Template::pretty_status($property_name, false, 'sentence'); |
|
547 | 547 | } |
548 | 548 | } |
549 | 549 | } |
@@ -552,36 +552,36 @@ discard block |
||
552 | 552 | } |
553 | 553 | |
554 | 554 | //make sure the column_titles is pushed to the beginning of the array |
555 | - array_unshift( $regs, $column_titles ); |
|
555 | + array_unshift($regs, $column_titles); |
|
556 | 556 | //setup the date range. |
557 | - $DateTimeZone = new DateTimeZone( EEH_DTT_Helper::get_timezone() ); |
|
558 | - $beginning_date = new DateTime( "now " . $period, $DateTimeZone ); |
|
559 | - $ending_date = new DateTime( "now", $DateTimeZone ); |
|
557 | + $DateTimeZone = new DateTimeZone(EEH_DTT_Helper::get_timezone()); |
|
558 | + $beginning_date = new DateTime("now ".$period, $DateTimeZone); |
|
559 | + $ending_date = new DateTime("now", $DateTimeZone); |
|
560 | 560 | $subtitle = sprintf( |
561 | - _x( 'For the period: %1$s to %2$s', 'Used to give date range', 'event_espresso' ), |
|
562 | - $beginning_date->format( 'Y-m-d' ), |
|
563 | - $ending_date->format( 'Y-m-d' ) |
|
561 | + _x('For the period: %1$s to %2$s', 'Used to give date range', 'event_espresso'), |
|
562 | + $beginning_date->format('Y-m-d'), |
|
563 | + $ending_date->format('Y-m-d') |
|
564 | 564 | ); |
565 | 565 | } |
566 | 566 | |
567 | - $report_title = __( 'Total Registrations per Day', 'event_espresso' ); |
|
567 | + $report_title = __('Total Registrations per Day', 'event_espresso'); |
|
568 | 568 | |
569 | 569 | $report_params = array( |
570 | 570 | 'title' => $report_title, |
571 | 571 | 'subtitle' => $subtitle, |
572 | 572 | 'id' => $report_ID, |
573 | 573 | 'regs' => $regs, |
574 | - 'noResults' => empty( $regs ), |
|
574 | + 'noResults' => empty($regs), |
|
575 | 575 | 'noRegsMsg' => sprintf( |
576 | 576 | __( |
577 | 577 | '%sThere are currently no registration records in the last month for this report.%s', |
578 | 578 | 'event_espresso' |
579 | 579 | ), |
580 | - '<h2>' . $report_title . '</h2><p>', |
|
580 | + '<h2>'.$report_title.'</h2><p>', |
|
581 | 581 | '</p>' |
582 | 582 | ), |
583 | 583 | ); |
584 | - wp_localize_script( 'ee-reg-reports-js', 'regPerDay', $report_params ); |
|
584 | + wp_localize_script('ee-reg-reports-js', 'regPerDay', $report_params); |
|
585 | 585 | |
586 | 586 | return $report_ID; |
587 | 587 | } |
@@ -593,29 +593,29 @@ discard block |
||
593 | 593 | * |
594 | 594 | * @return string |
595 | 595 | */ |
596 | - private function _registrations_per_event_report( $period = '-1 month' ) { |
|
596 | + private function _registrations_per_event_report($period = '-1 month') { |
|
597 | 597 | |
598 | 598 | $report_ID = 'reg-admin-registrations-per-event-report-dv'; |
599 | 599 | |
600 | - $results = EEM_Registration::instance()->get_registrations_per_event_and_per_status_report( $period ); |
|
600 | + $results = EEM_Registration::instance()->get_registrations_per_event_and_per_status_report($period); |
|
601 | 601 | |
602 | 602 | $results = (array) $results; |
603 | 603 | $regs = array(); |
604 | 604 | $subtitle = ''; |
605 | 605 | |
606 | - if ( $results ) { |
|
606 | + if ($results) { |
|
607 | 607 | $column_titles = array(); |
608 | 608 | $tracker = 0; |
609 | - foreach ( $results as $result ) { |
|
609 | + foreach ($results as $result) { |
|
610 | 610 | $report_column_values = array(); |
611 | - foreach( $result as $property_name => $property_value ) { |
|
612 | - $property_value = $property_name == 'Registration_Event' ? wp_trim_words( $property_value, 4, '...' ) : (int) $property_value; |
|
611 | + foreach ($result as $property_name => $property_value) { |
|
612 | + $property_value = $property_name == 'Registration_Event' ? wp_trim_words($property_value, 4, '...') : (int) $property_value; |
|
613 | 613 | $report_column_values[] = $property_value; |
614 | - if ( $tracker === 0 ) { |
|
615 | - if ( $property_name == 'Registration_Event' ) { |
|
616 | - $column_titles[] = __( 'Event', 'event_espresso' ); |
|
614 | + if ($tracker === 0) { |
|
615 | + if ($property_name == 'Registration_Event') { |
|
616 | + $column_titles[] = __('Event', 'event_espresso'); |
|
617 | 617 | } else { |
618 | - $column_titles[] = EEH_Template::pretty_status( $property_name, false, 'sentence' ); |
|
618 | + $column_titles[] = EEH_Template::pretty_status($property_name, false, 'sentence'); |
|
619 | 619 | } |
620 | 620 | } |
621 | 621 | } |
@@ -624,37 +624,37 @@ discard block |
||
624 | 624 | } |
625 | 625 | |
626 | 626 | //make sure the column_titles is pushed to the beginning of the array |
627 | - array_unshift( $regs, $column_titles ); |
|
627 | + array_unshift($regs, $column_titles); |
|
628 | 628 | |
629 | 629 | //setup the date range. |
630 | - $DateTimeZone = new DateTimeZone( EEH_DTT_Helper::get_timezone() ); |
|
631 | - $beginning_date = new DateTime( "now " . $period, $DateTimeZone ); |
|
632 | - $ending_date = new DateTime( "now", $DateTimeZone ); |
|
630 | + $DateTimeZone = new DateTimeZone(EEH_DTT_Helper::get_timezone()); |
|
631 | + $beginning_date = new DateTime("now ".$period, $DateTimeZone); |
|
632 | + $ending_date = new DateTime("now", $DateTimeZone); |
|
633 | 633 | $subtitle = sprintf( |
634 | - _x( 'For the period: %1$s to %2$s', 'Used to give date range', 'event_espresso' ), |
|
635 | - $beginning_date->format( 'Y-m-d' ), |
|
636 | - $ending_date->format( 'Y-m-d' ) |
|
634 | + _x('For the period: %1$s to %2$s', 'Used to give date range', 'event_espresso'), |
|
635 | + $beginning_date->format('Y-m-d'), |
|
636 | + $ending_date->format('Y-m-d') |
|
637 | 637 | ); |
638 | 638 | } |
639 | 639 | |
640 | - $report_title = __( 'Total Registrations per Event', 'event_espresso' ); |
|
640 | + $report_title = __('Total Registrations per Event', 'event_espresso'); |
|
641 | 641 | |
642 | 642 | $report_params = array( |
643 | 643 | 'title' => $report_title, |
644 | 644 | 'subtitle' => $subtitle, |
645 | 645 | 'id' => $report_ID, |
646 | 646 | 'regs' => $regs, |
647 | - 'noResults' => empty( $regs ), |
|
647 | + 'noResults' => empty($regs), |
|
648 | 648 | 'noRegsMsg' => sprintf( |
649 | 649 | __( |
650 | 650 | '%sThere are currently no registration records in the last month for this report.%s', |
651 | 651 | 'event_espresso' |
652 | 652 | ), |
653 | - '<h2>' . $report_title . '</h2><p>', |
|
653 | + '<h2>'.$report_title.'</h2><p>', |
|
654 | 654 | '</p>' |
655 | 655 | ), |
656 | 656 | ); |
657 | - wp_localize_script( 'ee-reg-reports-js', 'regPerEvent', $report_params ); |
|
657 | + wp_localize_script('ee-reg-reports-js', 'regPerEvent', $report_params); |
|
658 | 658 | |
659 | 659 | return $report_ID; |
660 | 660 | } |
@@ -668,8 +668,8 @@ discard block |
||
668 | 668 | * @return void |
669 | 669 | */ |
670 | 670 | protected function _registration_checkin_list_table() { |
671 | - do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' ); |
|
672 | - $reg_id = isset( $this->_req_data['_REGID'] ) ? $this->_req_data['_REGID'] : null; |
|
671 | + do_action('AHEE_log', __FILE__, __FUNCTION__, ''); |
|
672 | + $reg_id = isset($this->_req_data['_REGID']) ? $this->_req_data['_REGID'] : null; |
|
673 | 673 | $reg = EEM_Registration::instance()->get_one_by_ID($reg_id); |
674 | 674 | $this->_admin_page_title .= $this->get_action_link_or_button('new_registration', 'add-registrant', array('event_id' => $reg->event_ID()), 'add-new-h2'); |
675 | 675 | |
@@ -683,15 +683,15 @@ discard block |
||
683 | 683 | 'desc' => __('This indicates the attendee has been checked out', 'event_espresso') |
684 | 684 | ) |
685 | 685 | ); |
686 | - $this->_template_args['after_list_table'] = $this->_display_legend( $legend_items ); |
|
686 | + $this->_template_args['after_list_table'] = $this->_display_legend($legend_items); |
|
687 | 687 | |
688 | 688 | |
689 | - $dtt_id = isset( $this->_req_data['DTT_ID'] ) ? $this->_req_data['DTT_ID'] : NULL; |
|
690 | - $go_back_url = !empty( $reg_id ) ? EE_Admin_Page::add_query_args_and_nonce(array('action' => 'event_registrations', 'event_id' => EEM_Registration::instance()->get_one_by_ID($reg_id)->get_first_related('Event')->ID(), 'DTT_ID' => $dtt_id ), $this->_admin_base_url ) : ''; |
|
689 | + $dtt_id = isset($this->_req_data['DTT_ID']) ? $this->_req_data['DTT_ID'] : NULL; |
|
690 | + $go_back_url = ! empty($reg_id) ? EE_Admin_Page::add_query_args_and_nonce(array('action' => 'event_registrations', 'event_id' => EEM_Registration::instance()->get_one_by_ID($reg_id)->get_first_related('Event')->ID(), 'DTT_ID' => $dtt_id), $this->_admin_base_url) : ''; |
|
691 | 691 | |
692 | - $this->_template_args['before_list_table'] = !empty( $reg_id ) && !empty( $dtt_id ) ? '<h2>' . sprintf(__("%s's check in records for %s at the event, %s", 'event_espresso'), '<span id="checkin-attendee-name">' . EEM_Registration::instance()->get_one_by_ID($reg_id)->get_first_related('Attendee')->full_name() . '</span>', '<span id="checkin-dtt"><a href="' . $go_back_url . '">' . EEM_Datetime::instance()->get_one_by_ID($dtt_id)->start_date_and_time() . ' - ' . EEM_Datetime::instance()->get_one_by_ID($dtt_id)->end_date_and_time() . '</a></span>', '<span id="checkin-event-name">' . EEM_Datetime::instance()->get_one_by_ID($dtt_id)->get_first_related('Event')->get('EVT_name') . '</span>' ) . '</h2>' : ''; |
|
693 | - $this->_template_args['list_table_hidden_fields'] = !empty( $reg_id ) ? '<input type="hidden" name="_REGID" value="' . $reg_id . '">' : ''; |
|
694 | - $this->_template_args['list_table_hidden_fields'] .= !empty( $dtt_id ) ? '<input type="hidden" name="DTT_ID" value="' . $dtt_id . '">' : ''; |
|
692 | + $this->_template_args['before_list_table'] = ! empty($reg_id) && ! empty($dtt_id) ? '<h2>'.sprintf(__("%s's check in records for %s at the event, %s", 'event_espresso'), '<span id="checkin-attendee-name">'.EEM_Registration::instance()->get_one_by_ID($reg_id)->get_first_related('Attendee')->full_name().'</span>', '<span id="checkin-dtt"><a href="'.$go_back_url.'">'.EEM_Datetime::instance()->get_one_by_ID($dtt_id)->start_date_and_time().' - '.EEM_Datetime::instance()->get_one_by_ID($dtt_id)->end_date_and_time().'</a></span>', '<span id="checkin-event-name">'.EEM_Datetime::instance()->get_one_by_ID($dtt_id)->get_first_related('Event')->get('EVT_name').'</span>').'</h2>' : ''; |
|
693 | + $this->_template_args['list_table_hidden_fields'] = ! empty($reg_id) ? '<input type="hidden" name="_REGID" value="'.$reg_id.'">' : ''; |
|
694 | + $this->_template_args['list_table_hidden_fields'] .= ! empty($dtt_id) ? '<input type="hidden" name="DTT_ID" value="'.$dtt_id.'">' : ''; |
|
695 | 695 | |
696 | 696 | $this->display_admin_list_table_page_with_no_sidebar(); |
697 | 697 | } |
@@ -704,24 +704,24 @@ discard block |
||
704 | 704 | */ |
705 | 705 | public function toggle_checkin_status() { |
706 | 706 | //first make sure we have the necessary data |
707 | - if ( !isset( $this->_req_data['_regid'] ) ) { |
|
708 | - EE_Error::add_error( __('There must be something broken with the html structure because the required data for toggling the Check-in status is not being sent via ajax', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ ); |
|
707 | + if ( ! isset($this->_req_data['_regid'])) { |
|
708 | + EE_Error::add_error(__('There must be something broken with the html structure because the required data for toggling the Check-in status is not being sent via ajax', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__); |
|
709 | 709 | $this->_template_args['success'] = FALSE; |
710 | 710 | $this->_template_args['error'] = TRUE; |
711 | 711 | $this->_return_json(); |
712 | 712 | }; |
713 | 713 | |
714 | 714 | //do a nonce check cause we're not coming in from an normal route here. |
715 | - $nonce = isset( $this->_req_data['checkinnonce'] ) ? sanitize_text_field( $this->_req_data['checkinnonce'] ) : ''; |
|
715 | + $nonce = isset($this->_req_data['checkinnonce']) ? sanitize_text_field($this->_req_data['checkinnonce']) : ''; |
|
716 | 716 | $nonce_ref = 'checkin_nonce'; |
717 | 717 | |
718 | - $this->_verify_nonce( $nonce, $nonce_ref ); |
|
718 | + $this->_verify_nonce($nonce, $nonce_ref); |
|
719 | 719 | |
720 | 720 | //beautiful! Made it this far so let's get the status. |
721 | 721 | $new_status = $this->_toggle_checkin_status(); |
722 | 722 | |
723 | 723 | //setup new class to return via ajax |
724 | - $this->_template_args['admin_page_content'] = 'clickable trigger-checkin checkin-icons checkedin-status-' . $new_status; |
|
724 | + $this->_template_args['admin_page_content'] = 'clickable trigger-checkin checkin-icons checkedin-status-'.$new_status; |
|
725 | 725 | $this->_template_args['success'] = TRUE; |
726 | 726 | $this->_return_json(); |
727 | 727 | } |
@@ -741,32 +741,32 @@ discard block |
||
741 | 741 | //first let's get the query args out of the way for the redirect |
742 | 742 | $query_args = array( |
743 | 743 | 'action' => 'event_registrations', |
744 | - 'event_id' => isset( $this->_req_data['event_id'] ) ? $this->_req_data['event_id'] : NULL, |
|
745 | - 'DTT_ID' => isset( $this->_req_data['DTT_ID'] ) ? $this->_req_data['DTT_ID'] : NULL |
|
744 | + 'event_id' => isset($this->_req_data['event_id']) ? $this->_req_data['event_id'] : NULL, |
|
745 | + 'DTT_ID' => isset($this->_req_data['DTT_ID']) ? $this->_req_data['DTT_ID'] : NULL |
|
746 | 746 | ); |
747 | 747 | $new_status = FALSE; |
748 | 748 | |
749 | 749 | // bulk action check in toggle |
750 | - if ( ! empty( $this->_req_data['checkbox'] ) && is_array( $this->_req_data['checkbox'] )) { |
|
750 | + if ( ! empty($this->_req_data['checkbox']) && is_array($this->_req_data['checkbox'])) { |
|
751 | 751 | // cycle thru checkboxes |
752 | - while ( list( $REG_ID, $value ) = each($this->_req_data['checkbox'])) { |
|
753 | - $DTT_ID = isset( $this->_req_data['DTT_ID'] ) ? $this->_req_data['DTT_ID'] : NULL; |
|
752 | + while (list($REG_ID, $value) = each($this->_req_data['checkbox'])) { |
|
753 | + $DTT_ID = isset($this->_req_data['DTT_ID']) ? $this->_req_data['DTT_ID'] : NULL; |
|
754 | 754 | $new_status = $this->_toggle_checkin($REG_ID, $DTT_ID); |
755 | 755 | } |
756 | 756 | |
757 | - } elseif ( isset( $this->_req_data['_regid'] ) ) { |
|
757 | + } elseif (isset($this->_req_data['_regid'])) { |
|
758 | 758 | //coming from ajax request |
759 | - $DTT_ID = isset( $this->_req_data['dttid'] ) ? $this->_req_data['dttid'] : NULL; |
|
759 | + $DTT_ID = isset($this->_req_data['dttid']) ? $this->_req_data['dttid'] : NULL; |
|
760 | 760 | $query_args['DTT_ID'] = $DTT_ID; |
761 | 761 | $new_status = $this->_toggle_checkin($this->_req_data['_regid'], $DTT_ID); |
762 | 762 | } else { |
763 | - EE_Error::add_error(__('Missing some required data to toggle the Check-in', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ ); |
|
763 | + EE_Error::add_error(__('Missing some required data to toggle the Check-in', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__); |
|
764 | 764 | } |
765 | 765 | |
766 | - if ( defined('DOING_AJAX' ) ) |
|
766 | + if (defined('DOING_AJAX')) |
|
767 | 767 | return $new_status; |
768 | 768 | |
769 | - $this->_redirect_after_action( FALSE,'', '', $query_args, TRUE ); |
|
769 | + $this->_redirect_after_action(FALSE, '', '', $query_args, TRUE); |
|
770 | 770 | |
771 | 771 | } |
772 | 772 | |
@@ -782,11 +782,11 @@ discard block |
||
782 | 782 | */ |
783 | 783 | private function _toggle_checkin($REG_ID, $DTT_ID) { |
784 | 784 | $REG = EEM_Registration::instance()->get_one_by_ID($REG_ID); |
785 | - $new_status = $REG->toggle_checkin_status( $DTT_ID ); |
|
786 | - if ( $new_status !== FALSE ) { |
|
787 | - EE_Error::add_success($REG->get_checkin_msg($DTT_ID) ); |
|
785 | + $new_status = $REG->toggle_checkin_status($DTT_ID); |
|
786 | + if ($new_status !== FALSE) { |
|
787 | + EE_Error::add_success($REG->get_checkin_msg($DTT_ID)); |
|
788 | 788 | } else { |
789 | - EE_Error::add_error($REG->get_checkin_msg($DTT_ID, TRUE), __FILE__, __FUNCTION__, __LINE__ ); |
|
789 | + EE_Error::add_error($REG->get_checkin_msg($DTT_ID, TRUE), __FILE__, __FUNCTION__, __LINE__); |
|
790 | 790 | $new_status = FALSE; |
791 | 791 | } |
792 | 792 | return $new_status; |
@@ -802,28 +802,28 @@ discard block |
||
802 | 802 | protected function _delete_checkin_rows() { |
803 | 803 | $query_args = array( |
804 | 804 | 'action' => 'registration_checkins', |
805 | - 'DTT_ID' => isset( $this->_req_data['DTT_ID'] ) ? $this->_req_data['DTT_ID'] : 0, |
|
806 | - '_REGID' => isset( $this->_req_data['_REGID'] ) ? $this->_req_data['_REGID'] : 0 |
|
805 | + 'DTT_ID' => isset($this->_req_data['DTT_ID']) ? $this->_req_data['DTT_ID'] : 0, |
|
806 | + '_REGID' => isset($this->_req_data['_REGID']) ? $this->_req_data['_REGID'] : 0 |
|
807 | 807 | ); |
808 | - if ( !empty( $this->_req_data['checkbox'] ) && is_array( $this->_req_data['checkbox'] ) ) { |
|
809 | - while ( list( $CHK_ID, $value ) = each( $this->_req_data['checkbox'] ) ) { |
|
808 | + if ( ! empty($this->_req_data['checkbox']) && is_array($this->_req_data['checkbox'])) { |
|
809 | + while (list($CHK_ID, $value) = each($this->_req_data['checkbox'])) { |
|
810 | 810 | $errors = 0; |
811 | - if ( ! EEM_Checkin::instance()->delete_by_ID($CHK_ID ) ) { |
|
811 | + if ( ! EEM_Checkin::instance()->delete_by_ID($CHK_ID)) { |
|
812 | 812 | $errors++; |
813 | 813 | } |
814 | 814 | } |
815 | 815 | } else { |
816 | - EE_Error::add_error(__('So, something went wrong with the bulk delete because there was no data received for instructions on WHAT to delete!', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ ); |
|
817 | - $this->_redirect_after_action( FALSE, '', '', $query_args, TRUE ); |
|
816 | + EE_Error::add_error(__('So, something went wrong with the bulk delete because there was no data received for instructions on WHAT to delete!', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__); |
|
817 | + $this->_redirect_after_action(FALSE, '', '', $query_args, TRUE); |
|
818 | 818 | } |
819 | 819 | |
820 | - if ( $errors > 0 ) { |
|
821 | - EE_Error::add_error( sprintf( __('There were %d records that did not delete successfully', 'event_espresso'), $errors ), __FILE__, __FUNCTION__, __LINE__ ); |
|
820 | + if ($errors > 0) { |
|
821 | + EE_Error::add_error(sprintf(__('There were %d records that did not delete successfully', 'event_espresso'), $errors), __FILE__, __FUNCTION__, __LINE__); |
|
822 | 822 | } else { |
823 | - EE_Error::add_success( __('Records were successfully deleted', 'event_espresso') ); |
|
823 | + EE_Error::add_success(__('Records were successfully deleted', 'event_espresso')); |
|
824 | 824 | } |
825 | 825 | |
826 | - $this->_redirect_after_action( FALSE, '', '', $query_args, TRUE ); |
|
826 | + $this->_redirect_after_action(FALSE, '', '', $query_args, TRUE); |
|
827 | 827 | } |
828 | 828 | |
829 | 829 | |
@@ -835,20 +835,20 @@ discard block |
||
835 | 835 | protected function _delete_checkin_row() { |
836 | 836 | $query_args = array( |
837 | 837 | 'action' => 'registration_checkins', |
838 | - 'DTT_ID' => isset( $this->_req_data['DTT_ID'] ) ? $this->_req_data['DTT_ID'] : 0, |
|
839 | - '_REGID' => isset( $this->_req_data['_REGID'] ) ? $this->_req_data['_REGID'] : 0 |
|
838 | + 'DTT_ID' => isset($this->_req_data['DTT_ID']) ? $this->_req_data['DTT_ID'] : 0, |
|
839 | + '_REGID' => isset($this->_req_data['_REGID']) ? $this->_req_data['_REGID'] : 0 |
|
840 | 840 | ); |
841 | 841 | |
842 | - if ( !empty( $this->_req_data['CHK_ID'] ) ) { |
|
843 | - if ( ! EEM_Checkin::instance()->delete_by_ID($this->_req_data['CHK_ID'] ) ) { |
|
844 | - EE_Error::add_error(__('Something went wrong and this check-in record was not deleted', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ ); |
|
842 | + if ( ! empty($this->_req_data['CHK_ID'])) { |
|
843 | + if ( ! EEM_Checkin::instance()->delete_by_ID($this->_req_data['CHK_ID'])) { |
|
844 | + EE_Error::add_error(__('Something went wrong and this check-in record was not deleted', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__); |
|
845 | 845 | } else { |
846 | - EE_Error::add_success( __('Check-In record successfully deleted', 'event_espresso') ); |
|
846 | + EE_Error::add_success(__('Check-In record successfully deleted', 'event_espresso')); |
|
847 | 847 | } |
848 | 848 | } else { |
849 | - EE_Error::add_error(__('In order to delete a Check-in record, there must be a Check-In ID available. There is not. It is not your fault, there is just a gremlin living in the code', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ ); |
|
849 | + EE_Error::add_error(__('In order to delete a Check-in record, there must be a Check-In ID available. There is not. It is not your fault, there is just a gremlin living in the code', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__); |
|
850 | 850 | } |
851 | - $this->_redirect_after_action( FALSE, '', '', $query_args, TRUE ); |
|
851 | + $this->_redirect_after_action(FALSE, '', '', $query_args, TRUE); |
|
852 | 852 | } |
853 | 853 | |
854 | 854 | |
@@ -861,8 +861,8 @@ discard block |
||
861 | 861 | * @return void |
862 | 862 | */ |
863 | 863 | protected function _event_registrations_list_table() { |
864 | - do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' ); |
|
865 | - $this->_admin_page_title .= isset( $this->_req_data['event_id'] ) ? $this->get_action_link_or_button('new_registration', 'add-registrant', array('event_id' => $this->_req_data['event_id']), 'add-new-h2') : ''; |
|
864 | + do_action('AHEE_log', __FILE__, __FUNCTION__, ''); |
|
865 | + $this->_admin_page_title .= isset($this->_req_data['event_id']) ? $this->get_action_link_or_button('new_registration', 'add-registrant', array('event_id' => $this->_req_data['event_id']), 'add-new-h2') : ''; |
|
866 | 866 | |
867 | 867 | $legend_items = array( |
868 | 868 | 'star-icon' => array( |
@@ -886,31 +886,31 @@ discard block |
||
886 | 886 | 'desc' => __('View All Check-in Records for this Registrant', 'event_espresso') |
887 | 887 | ), |
888 | 888 | 'approved_status' => array( |
889 | - 'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_approved, |
|
890 | - 'desc' => EEH_Template::pretty_status( EEM_Registration::status_id_approved, FALSE, 'sentence' ) |
|
889 | + 'class' => 'ee-status-legend ee-status-legend-'.EEM_Registration::status_id_approved, |
|
890 | + 'desc' => EEH_Template::pretty_status(EEM_Registration::status_id_approved, FALSE, 'sentence') |
|
891 | 891 | ), |
892 | 892 | 'cancelled_status' => array( |
893 | - 'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_cancelled, |
|
894 | - 'desc' => EEH_Template::pretty_status( EEM_Registration::status_id_cancelled, FALSE, 'sentence' ) |
|
893 | + 'class' => 'ee-status-legend ee-status-legend-'.EEM_Registration::status_id_cancelled, |
|
894 | + 'desc' => EEH_Template::pretty_status(EEM_Registration::status_id_cancelled, FALSE, 'sentence') |
|
895 | 895 | ), |
896 | 896 | 'declined_status' => array( |
897 | - 'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_declined, |
|
898 | - 'desc' => EEH_Template::pretty_status( EEM_Registration::status_id_declined, FALSE, 'sentence' ) |
|
897 | + 'class' => 'ee-status-legend ee-status-legend-'.EEM_Registration::status_id_declined, |
|
898 | + 'desc' => EEH_Template::pretty_status(EEM_Registration::status_id_declined, FALSE, 'sentence') |
|
899 | 899 | ), |
900 | 900 | 'not_approved' => array( |
901 | - 'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_not_approved, |
|
902 | - 'desc' => EEH_Template::pretty_status( EEM_Registration::status_id_not_approved, FALSE, 'sentence' ) |
|
901 | + 'class' => 'ee-status-legend ee-status-legend-'.EEM_Registration::status_id_not_approved, |
|
902 | + 'desc' => EEH_Template::pretty_status(EEM_Registration::status_id_not_approved, FALSE, 'sentence') |
|
903 | 903 | ), |
904 | 904 | 'pending_status' => array( |
905 | - 'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_pending_payment, |
|
906 | - 'desc' => EEH_Template::pretty_status( EEM_Registration::status_id_pending_payment, FALSE, 'sentence' ) |
|
905 | + 'class' => 'ee-status-legend ee-status-legend-'.EEM_Registration::status_id_pending_payment, |
|
906 | + 'desc' => EEH_Template::pretty_status(EEM_Registration::status_id_pending_payment, FALSE, 'sentence') |
|
907 | 907 | )/**/ |
908 | 908 | ); |
909 | - $this->_template_args['after_list_table'] = $this->_display_legend( $legend_items ); |
|
909 | + $this->_template_args['after_list_table'] = $this->_display_legend($legend_items); |
|
910 | 910 | |
911 | - $event_id = isset( $this->_req_data['event_id'] ) ? $this->_req_data['event_id'] : null; |
|
912 | - $this->_template_args['before_list_table'] = !empty( $event_id ) ? '<h2>' . sprintf(__('Viewing Registrations for Event: %s', 'event_espresso'), EEM_Event::instance()->get_one_by_ID($event_id)->get('EVT_name') ) . '</h2>' : ''; |
|
913 | - $this->_template_args['list_table_hidden_fields'] = !empty( $event_id ) ? '<input type="hidden" name="event_id" value="' . $event_id . '">' : ''; |
|
911 | + $event_id = isset($this->_req_data['event_id']) ? $this->_req_data['event_id'] : null; |
|
912 | + $this->_template_args['before_list_table'] = ! empty($event_id) ? '<h2>'.sprintf(__('Viewing Registrations for Event: %s', 'event_espresso'), EEM_Event::instance()->get_one_by_ID($event_id)->get('EVT_name')).'</h2>' : ''; |
|
913 | + $this->_template_args['list_table_hidden_fields'] = ! empty($event_id) ? '<input type="hidden" name="event_id" value="'.$event_id.'">' : ''; |
|
914 | 914 | |
915 | 915 | $this->display_admin_list_table_page_with_no_sidebar(); |
916 | 916 | } |
@@ -924,15 +924,15 @@ discard block |
||
924 | 924 | * @access public |
925 | 925 | * @return array |
926 | 926 | */ |
927 | - public function get_event_attendees( $per_page = 10, $count = FALSE, $trash = FALSE, $orderby = '' ) { |
|
927 | + public function get_event_attendees($per_page = 10, $count = FALSE, $trash = FALSE, $orderby = '') { |
|
928 | 928 | |
929 | - do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' ); |
|
930 | - require_once(EE_MODELS . 'EEM_Attendee.model.php'); |
|
929 | + do_action('AHEE_log', __FILE__, __FUNCTION__, ''); |
|
930 | + require_once(EE_MODELS.'EEM_Attendee.model.php'); |
|
931 | 931 | //$ATT_MDL = EEM_Attendee::instance(); |
932 | 932 | |
933 | - $EVT_ID = isset($this->_req_data['event_id']) ? absint( $this->_req_data['event_id'] ) : FALSE; |
|
934 | - $CAT_ID = isset($this->_req_data['category_id']) ? absint( $this->_req_data['category_id'] ) : FALSE; |
|
935 | - $DTT_ID = isset( $this->_req_data['DTT_ID'] ) ? $this->_req_data['DTT_ID'] : NULL; |
|
933 | + $EVT_ID = isset($this->_req_data['event_id']) ? absint($this->_req_data['event_id']) : FALSE; |
|
934 | + $CAT_ID = isset($this->_req_data['category_id']) ? absint($this->_req_data['category_id']) : FALSE; |
|
935 | + $DTT_ID = isset($this->_req_data['DTT_ID']) ? $this->_req_data['DTT_ID'] : NULL; |
|
936 | 936 | |
937 | 937 | $this->_req_data['orderby'] = ! empty($this->_req_data['orderby']) ? $this->_req_data['orderby'] : $orderby; |
938 | 938 | |
@@ -945,94 +945,94 @@ discard block |
||
945 | 945 | // $orderby = 'reg.REG_final_price'; |
946 | 946 | } |
947 | 947 | |
948 | - $sort = ( isset( $this->_req_data['order'] ) && ! empty( $this->_req_data['order'] )) ? $this->_req_data['order'] : 'ASC'; |
|
948 | + $sort = (isset($this->_req_data['order']) && ! empty($this->_req_data['order'])) ? $this->_req_data['order'] : 'ASC'; |
|
949 | 949 | |
950 | - $current_page = isset( $this->_req_data['paged'] ) && !empty( $this->_req_data['paged'] ) ? $this->_req_data['paged'] : 1; |
|
951 | - $per_page = isset( $this->_req_data['perpage'] ) && !empty( $this->_req_data['perpage'] ) ? $this->_req_data['perpage'] : $per_page; |
|
950 | + $current_page = isset($this->_req_data['paged']) && ! empty($this->_req_data['paged']) ? $this->_req_data['paged'] : 1; |
|
951 | + $per_page = isset($this->_req_data['perpage']) && ! empty($this->_req_data['perpage']) ? $this->_req_data['perpage'] : $per_page; |
|
952 | 952 | |
953 | 953 | |
954 | - $offset = ($current_page-1)*$per_page; |
|
955 | - $limit = $count ? NULL : array( $offset, $per_page ); |
|
956 | - $query_params = array(array('Event.status'=>array('IN', array_keys(EEM_Event::instance()->get_status_array())))); |
|
957 | - if ($EVT_ID){ |
|
958 | - $query_params[0]['EVT_ID']=$EVT_ID; |
|
954 | + $offset = ($current_page - 1) * $per_page; |
|
955 | + $limit = $count ? NULL : array($offset, $per_page); |
|
956 | + $query_params = array(array('Event.status'=>array('IN', array_keys(EEM_Event::instance()->get_status_array())))); |
|
957 | + if ($EVT_ID) { |
|
958 | + $query_params[0]['EVT_ID'] = $EVT_ID; |
|
959 | 959 | } |
960 | - if($CAT_ID){ |
|
960 | + if ($CAT_ID) { |
|
961 | 961 | throw new EE_Error("You specified a Category Id for this query. Thats odd because we are now using terms and taxonomies. So did you mean the term taxonomy id o rthe term id?"); |
962 | 962 | } |
963 | 963 | |
964 | 964 | //if DTT is included we do multiple datetimes. |
965 | - if ( $DTT_ID ) { |
|
965 | + if ($DTT_ID) { |
|
966 | 966 | $query_params[0]['Ticket.Datetime.DTT_ID'] = $DTT_ID; |
967 | 967 | } |
968 | 968 | |
969 | 969 | //make sure we only have default where on the current regs |
970 | 970 | $query_params['default_where_conditions'] = 'this_model_only'; |
971 | 971 | |
972 | - $status_ids_array = apply_filters( 'FHEE__Extend_Registrations_Admin_Page__get_event_attendees__status_ids_array', array( EEM_Registration::status_id_pending_payment, EEM_Registration::status_id_approved ) ); |
|
972 | + $status_ids_array = apply_filters('FHEE__Extend_Registrations_Admin_Page__get_event_attendees__status_ids_array', array(EEM_Registration::status_id_pending_payment, EEM_Registration::status_id_approved)); |
|
973 | 973 | |
974 | - $query_params[0]['STS_ID']= array('IN', $status_ids_array ); |
|
974 | + $query_params[0]['STS_ID'] = array('IN', $status_ids_array); |
|
975 | 975 | |
976 | - if($trash){ |
|
977 | - $query_params[0]['Attendee.status']= EEM_CPT_Base::post_status_trashed; |
|
976 | + if ($trash) { |
|
977 | + $query_params[0]['Attendee.status'] = EEM_CPT_Base::post_status_trashed; |
|
978 | 978 | } |
979 | 979 | |
980 | - if ( isset( $this->_req_data['s'] ) ) { |
|
981 | - $sstr = '%' . $this->_req_data['s'] . '%'; |
|
980 | + if (isset($this->_req_data['s'])) { |
|
981 | + $sstr = '%'.$this->_req_data['s'].'%'; |
|
982 | 982 | $query_params[0]['OR'] = array( |
983 | - 'Event.EVT_name' => array( 'LIKE', $sstr), |
|
984 | - 'Event.EVT_desc' => array( 'LIKE', $sstr ), |
|
985 | - 'Event.EVT_short_desc' => array( 'LIKE' , $sstr ), |
|
986 | - 'Attendee.ATT_fname' => array( 'LIKE', $sstr ), |
|
987 | - 'Attendee.ATT_lname' => array( 'LIKE', $sstr ), |
|
988 | - 'Attendee.ATT_short_bio' => array( 'LIKE', $sstr ), |
|
989 | - 'Attendee.ATT_email' => array('LIKE', $sstr ), |
|
990 | - 'Attendee.ATT_address' => array( 'LIKE', $sstr ), |
|
991 | - 'Attendee.ATT_address2' => array( 'LIKE', $sstr ), |
|
992 | - 'Attendee.ATT_city' => array( 'LIKE', $sstr ), |
|
993 | - 'REG_final_price' => array( 'LIKE', $sstr ), |
|
994 | - 'REG_code' => array( 'LIKE', $sstr ), |
|
995 | - 'REG_count' => array( 'LIKE' , $sstr ), |
|
996 | - 'REG_group_size' => array( 'LIKE' , $sstr ), |
|
997 | - 'Ticket.TKT_name' => array( 'LIKE', $sstr ), |
|
998 | - 'Ticket.TKT_description' => array( 'LIKE', $sstr ) |
|
983 | + 'Event.EVT_name' => array('LIKE', $sstr), |
|
984 | + 'Event.EVT_desc' => array('LIKE', $sstr), |
|
985 | + 'Event.EVT_short_desc' => array('LIKE', $sstr), |
|
986 | + 'Attendee.ATT_fname' => array('LIKE', $sstr), |
|
987 | + 'Attendee.ATT_lname' => array('LIKE', $sstr), |
|
988 | + 'Attendee.ATT_short_bio' => array('LIKE', $sstr), |
|
989 | + 'Attendee.ATT_email' => array('LIKE', $sstr), |
|
990 | + 'Attendee.ATT_address' => array('LIKE', $sstr), |
|
991 | + 'Attendee.ATT_address2' => array('LIKE', $sstr), |
|
992 | + 'Attendee.ATT_city' => array('LIKE', $sstr), |
|
993 | + 'REG_final_price' => array('LIKE', $sstr), |
|
994 | + 'REG_code' => array('LIKE', $sstr), |
|
995 | + 'REG_count' => array('LIKE', $sstr), |
|
996 | + 'REG_group_size' => array('LIKE', $sstr), |
|
997 | + 'Ticket.TKT_name' => array('LIKE', $sstr), |
|
998 | + 'Ticket.TKT_description' => array('LIKE', $sstr) |
|
999 | 999 | ); |
1000 | 1000 | } |
1001 | 1001 | |
1002 | 1002 | $query_params['order_by'][$orderby] = $sort; |
1003 | 1003 | $query_params['limit'] = $limit; |
1004 | - $query_params['force_join'] = array('Attendee');//force join to attendee model so that it gets cached, because we're going to need the attendee for each registration |
|
1005 | - if($count){ |
|
1006 | - $registrations = EEM_Registration::instance()->count(array($query_params[0], 'default_where_conditions' => 'this_model_only' )); |
|
1007 | - }else{ |
|
1004 | + $query_params['force_join'] = array('Attendee'); //force join to attendee model so that it gets cached, because we're going to need the attendee for each registration |
|
1005 | + if ($count) { |
|
1006 | + $registrations = EEM_Registration::instance()->count(array($query_params[0], 'default_where_conditions' => 'this_model_only')); |
|
1007 | + } else { |
|
1008 | 1008 | $registrations = EEM_Registration::instance()->get_all($query_params); |
1009 | 1009 | |
1010 | 1010 | |
1011 | 1011 | // $registrations = EEM_Registration::instance(); |
1012 | 1012 | // $all_attendees = EEM_Attendee::instance()->get_event_attendees( $EVT_ID, $CAT_ID, $reg_status, $trash, $orderby, $sort, $limit, $output ); |
1013 | - if ( isset( $registrations[0] ) && $registrations[0] instanceof EE_Registration ) { |
|
1013 | + if (isset($registrations[0]) && $registrations[0] instanceof EE_Registration) { |
|
1014 | 1014 | //EEH_Debug_Tools::printr( $all_attendees[0], '$all_attendees[0] <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' ); |
1015 | 1015 | // name |
1016 | 1016 | $first_registration = $registrations[0]; |
1017 | 1017 | $event_obj = $first_registration->event_obj(); |
1018 | - if($event_obj){ |
|
1018 | + if ($event_obj) { |
|
1019 | 1019 | $event_name = $first_registration->event_obj()->name(); |
1020 | - $event_date = 'TODO: we need to get date from earliest price date or should this be the actual event date?';//$first_registration->date_obj()->reg_start_date_and_time('l F j, Y,', ' g:i:s a');// isset( $registrations[0]->DTT_EVT_start ) ? date( 'l F j, Y, g:i:s a', $registrations[0]->DTT_EVT_start ) : ''; |
|
1020 | + $event_date = 'TODO: we need to get date from earliest price date or should this be the actual event date?'; //$first_registration->date_obj()->reg_start_date_and_time('l F j, Y,', ' g:i:s a');// isset( $registrations[0]->DTT_EVT_start ) ? date( 'l F j, Y, g:i:s a', $registrations[0]->DTT_EVT_start ) : ''; |
|
1021 | 1021 | // edit event link |
1022 | - if ( $event_name != '' ) { |
|
1023 | - $edit_event_url = self::add_query_args_and_nonce( array( 'action'=>'edit_event', 'EVT_ID'=>$EVT_ID ), EVENTS_ADMIN_URL ); |
|
1024 | - $edit_event_lnk = '<a href="'.$edit_event_url.'" title="' . esc_attr__( 'Edit ', 'event_espresso' ) . $event_name . '">' . __( 'Edit Event', 'event_espresso' ) . '</a>'; |
|
1025 | - $event_name .= ' <span class="admin-page-header-edit-lnk not-bold">' . $edit_event_lnk . '</span>' ; |
|
1022 | + if ($event_name != '') { |
|
1023 | + $edit_event_url = self::add_query_args_and_nonce(array('action'=>'edit_event', 'EVT_ID'=>$EVT_ID), EVENTS_ADMIN_URL); |
|
1024 | + $edit_event_lnk = '<a href="'.$edit_event_url.'" title="'.esc_attr__('Edit ', 'event_espresso').$event_name.'">'.__('Edit Event', 'event_espresso').'</a>'; |
|
1025 | + $event_name .= ' <span class="admin-page-header-edit-lnk not-bold">'.$edit_event_lnk.'</span>'; |
|
1026 | 1026 | } |
1027 | 1027 | |
1028 | - $back_2_reg_url = self::add_query_args_and_nonce( array( 'action'=>'default' ), REG_ADMIN_URL ); |
|
1029 | - $back_2_reg_lnk = '<a href="'.$back_2_reg_url.'" title="' . esc_attr__( 'click to return to viewing all registrations ', 'event_espresso' ) . '">« ' . __( 'Back to All Registrations', 'event_espresso' ) . '</a>'; |
|
1028 | + $back_2_reg_url = self::add_query_args_and_nonce(array('action'=>'default'), REG_ADMIN_URL); |
|
1029 | + $back_2_reg_lnk = '<a href="'.$back_2_reg_url.'" title="'.esc_attr__('click to return to viewing all registrations ', 'event_espresso').'">« '.__('Back to All Registrations', 'event_espresso').'</a>'; |
|
1030 | 1030 | |
1031 | 1031 | $this->_template_args['before_admin_page_content'] = ' |
1032 | 1032 | <div id="admin-page-header"> |
1033 | - <h1><span class="small-text not-bold">'.__( 'Event: ', 'event_espresso' ).'</span>'. $event_name .'</h1> |
|
1034 | - <h3><span class="small-text not-bold">'.__( 'Date: ', 'event_espresso' ). '</span>'. $event_date .'</h3> |
|
1035 | - <span class="admin-page-header-go-back-lnk not-bold">' . $back_2_reg_lnk . '</span> |
|
1033 | + <h1><span class="small-text not-bold">'.__('Event: ', 'event_espresso').'</span>'.$event_name.'</h1> |
|
1034 | + <h3><span class="small-text not-bold">'.__('Date: ', 'event_espresso').'</span>'.$event_date.'</h3> |
|
1035 | + <span class="admin-page-header-go-back-lnk not-bold">' . $back_2_reg_lnk.'</span> |
|
1036 | 1036 | </div> |
1037 | 1037 | '; |
1038 | 1038 | } |
@@ -1,6 +1,7 @@ discard block |
||
1 | 1 | <?php |
2 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
2 | +if (!defined('EVENT_ESPRESSO_VERSION') ) { |
|
3 | 3 | exit('NO direct script access allowed'); |
4 | +} |
|
4 | 5 | |
5 | 6 | /** |
6 | 7 | * Event Espresso |
@@ -763,8 +764,9 @@ discard block |
||
763 | 764 | EE_Error::add_error(__('Missing some required data to toggle the Check-in', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ ); |
764 | 765 | } |
765 | 766 | |
766 | - if ( defined('DOING_AJAX' ) ) |
|
767 | - return $new_status; |
|
767 | + if ( defined('DOING_AJAX' ) ) { |
|
768 | + return $new_status; |
|
769 | + } |
|
768 | 770 | |
769 | 771 | $this->_redirect_after_action( FALSE,'', '', $query_args, TRUE ); |
770 | 772 | |
@@ -1004,7 +1006,7 @@ discard block |
||
1004 | 1006 | $query_params['force_join'] = array('Attendee');//force join to attendee model so that it gets cached, because we're going to need the attendee for each registration |
1005 | 1007 | if($count){ |
1006 | 1008 | $registrations = EEM_Registration::instance()->count(array($query_params[0], 'default_where_conditions' => 'this_model_only' )); |
1007 | - }else{ |
|
1009 | + } else{ |
|
1008 | 1010 | $registrations = EEM_Registration::instance()->get_all($query_params); |
1009 | 1011 | |
1010 | 1012 |
@@ -191,7 +191,7 @@ |
||
191 | 191 | * generates Business Report showing total revenue per event. |
192 | 192 | * |
193 | 193 | * @param string $period The period (acceptable by PHP Datetime constructor) for which the report is generated. |
194 | - * @return int |
|
194 | + * @return string |
|
195 | 195 | */ |
196 | 196 | private function _revenue_per_event_report( $period = '-1 month' ) { |
197 | 197 |
@@ -122,9 +122,9 @@ |
||
122 | 122 | /** |
123 | 123 | * _transaction_reports |
124 | 124 | * generates Business Reports regarding Transactions |
125 | - * |
|
126 | - * @return void |
|
127 | - */ |
|
125 | + * |
|
126 | + * @return void |
|
127 | + */ |
|
128 | 128 | protected function _transaction_reports() { |
129 | 129 | $template_path = EE_ADMIN_TEMPLATE . 'admin_reports.template.php'; |
130 | 130 | $this->_admin_page_title = __('Transactions', 'event_espresso'); |
@@ -1,5 +1,5 @@ discard block |
||
1 | 1 | <?php |
2 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
2 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) |
|
3 | 3 | exit('NO direct script access allowed'); |
4 | 4 | |
5 | 5 | /** |
@@ -42,11 +42,11 @@ discard block |
||
42 | 42 | * @param bool $routing |
43 | 43 | * @return \Extend_Transactions_Admin_Page |
44 | 44 | */ |
45 | - public function __construct( $routing = TRUE ) { |
|
46 | - parent::__construct( $routing ); |
|
47 | - define( 'TXN_CAF_TEMPLATE_PATH', EE_CORE_CAF_ADMIN_EXTEND . 'transactions/templates/'); |
|
48 | - define( 'TXN_CAF_ASSETS', EE_CORE_CAF_ADMIN_EXTEND . 'transactions/assets/'); |
|
49 | - define( 'TXN_CAF_ASSETS_URL', EE_CORE_CAF_ADMIN_EXTEND_URL . 'transactions/assets/'); |
|
45 | + public function __construct($routing = TRUE) { |
|
46 | + parent::__construct($routing); |
|
47 | + define('TXN_CAF_TEMPLATE_PATH', EE_CORE_CAF_ADMIN_EXTEND.'transactions/templates/'); |
|
48 | + define('TXN_CAF_ASSETS', EE_CORE_CAF_ADMIN_EXTEND.'transactions/assets/'); |
|
49 | + define('TXN_CAF_ASSETS_URL', EE_CORE_CAF_ADMIN_EXTEND_URL.'transactions/assets/'); |
|
50 | 50 | } |
51 | 51 | |
52 | 52 | |
@@ -58,7 +58,7 @@ discard block |
||
58 | 58 | * @return void |
59 | 59 | */ |
60 | 60 | protected function _extend_page_config() { |
61 | - $this->_admin_base_path = EE_CORE_CAF_ADMIN_EXTEND . 'transactions'; |
|
61 | + $this->_admin_base_path = EE_CORE_CAF_ADMIN_EXTEND.'transactions'; |
|
62 | 62 | |
63 | 63 | $new_page_routes = array( |
64 | 64 | 'reports' => array( |
@@ -67,7 +67,7 @@ discard block |
||
67 | 67 | ) |
68 | 68 | ); |
69 | 69 | |
70 | - $this->_page_routes = array_merge( $this->_page_routes, $new_page_routes ); |
|
70 | + $this->_page_routes = array_merge($this->_page_routes, $new_page_routes); |
|
71 | 71 | |
72 | 72 | $new_page_config = array( |
73 | 73 | 'reports' => array( |
@@ -85,7 +85,7 @@ discard block |
||
85 | 85 | 'require_nonce' => FALSE |
86 | 86 | ) |
87 | 87 | ); |
88 | - $this->_page_config = array_merge( $this->_page_config, $new_page_config ); |
|
88 | + $this->_page_config = array_merge($this->_page_config, $new_page_config); |
|
89 | 89 | } |
90 | 90 | |
91 | 91 | |
@@ -97,8 +97,8 @@ discard block |
||
97 | 97 | * @return void |
98 | 98 | */ |
99 | 99 | public function load_scripts_styles_reports() { |
100 | - wp_register_script( 'ee-txn-reports-js', TXN_CAF_ASSETS_URL . 'ee-transaction-admin-reports.js', array( 'google-charts' ), EVENT_ESPRESSO_VERSION, true ); |
|
101 | - wp_enqueue_script( 'ee-txn-reports-js' ); |
|
100 | + wp_register_script('ee-txn-reports-js', TXN_CAF_ASSETS_URL.'ee-transaction-admin-reports.js', array('google-charts'), EVENT_ESPRESSO_VERSION, true); |
|
101 | + wp_enqueue_script('ee-txn-reports-js'); |
|
102 | 102 | $this->_transaction_reports_js_setup(); |
103 | 103 | EE_Registry::$i18n_js_strings['currency_format'] = EEH_Money::get_format_for_google_charts(); |
104 | 104 | } |
@@ -125,9 +125,9 @@ discard block |
||
125 | 125 | * @return void |
126 | 126 | */ |
127 | 127 | protected function _transaction_reports() { |
128 | - $template_path = EE_ADMIN_TEMPLATE . 'admin_reports.template.php'; |
|
128 | + $template_path = EE_ADMIN_TEMPLATE.'admin_reports.template.php'; |
|
129 | 129 | $this->_admin_page_title = __('Transactions', 'event_espresso'); |
130 | - $this->_template_args['admin_page_content'] = EEH_Template::display_template( $template_path, $this->_reports_template_data, TRUE ); |
|
130 | + $this->_template_args['admin_page_content'] = EEH_Template::display_template($template_path, $this->_reports_template_data, TRUE); |
|
131 | 131 | |
132 | 132 | // the final template wrapper |
133 | 133 | $this->display_admin_page_with_no_sidebar(); |
@@ -142,42 +142,42 @@ discard block |
||
142 | 142 | * @param string $period The period (acceptable by PHP Datetime constructor) for which the report is generated. |
143 | 143 | * @return string |
144 | 144 | */ |
145 | - private function _revenue_per_day_report( $period = '-1 month' ) { |
|
145 | + private function _revenue_per_day_report($period = '-1 month') { |
|
146 | 146 | |
147 | 147 | $report_ID = 'txn-admin-revenue-per-day-report-dv'; |
148 | 148 | |
149 | 149 | $TXN = EEM_Transaction::instance(); |
150 | 150 | |
151 | - $results = $TXN->get_revenue_per_day_report( $period ); |
|
151 | + $results = $TXN->get_revenue_per_day_report($period); |
|
152 | 152 | $results = (array) $results; |
153 | 153 | $revenue = array(); |
154 | 154 | $subtitle = ''; |
155 | 155 | |
156 | - if ( $results ) { |
|
157 | - $revenue[] = array( __( 'Date (only shows dates that have a revenue greater than 1)', 'event_espresso' ), __( 'Total Revenue', 'event_espresso' ) ); |
|
158 | - foreach ( $results as $result ) { |
|
159 | - if ( $result->revenue > 1 ) { |
|
160 | - $revenue[] = array( $result->txnDate, (float) $result->revenue ); |
|
156 | + if ($results) { |
|
157 | + $revenue[] = array(__('Date (only shows dates that have a revenue greater than 1)', 'event_espresso'), __('Total Revenue', 'event_espresso')); |
|
158 | + foreach ($results as $result) { |
|
159 | + if ($result->revenue > 1) { |
|
160 | + $revenue[] = array($result->txnDate, (float) $result->revenue); |
|
161 | 161 | } |
162 | 162 | } |
163 | 163 | |
164 | 164 | //setup the date range. |
165 | - $beginning_date = new DateTime( 'now' . $period, new DateTimeZone( EEH_DTT_Helper::get_timezone() ) ); |
|
166 | - $ending_date = new DateTime( 'now', new DateTimeZone( EEH_DTT_Helper::get_timezone() ) ); |
|
167 | - $subtitle = sprintf( _x( 'For the period: %s to %s', 'Used to give date range', 'event_espresso' ), $beginning_date->format( 'Y-m-d' ), $ending_date->format( 'Y-m-d' ) ); |
|
165 | + $beginning_date = new DateTime('now'.$period, new DateTimeZone(EEH_DTT_Helper::get_timezone())); |
|
166 | + $ending_date = new DateTime('now', new DateTimeZone(EEH_DTT_Helper::get_timezone())); |
|
167 | + $subtitle = sprintf(_x('For the period: %s to %s', 'Used to give date range', 'event_espresso'), $beginning_date->format('Y-m-d'), $ending_date->format('Y-m-d')); |
|
168 | 168 | } |
169 | 169 | |
170 | - $report_title = esc_html__( 'Total Revenue per Day', 'event_espresso' ); |
|
170 | + $report_title = esc_html__('Total Revenue per Day', 'event_espresso'); |
|
171 | 171 | |
172 | 172 | $report_params = array( |
173 | 173 | 'title' => $report_title, |
174 | 174 | 'subtitle' => $subtitle, |
175 | 175 | 'id' => $report_ID, |
176 | 176 | 'revenue' => $revenue, |
177 | - 'noResults' => empty( $revenue ), |
|
178 | - 'noTxnMsg' => sprintf( __( '%sThere are currently no transaction records in the last month for this report.%s', 'event_espresso' ), '<h2>' . $report_title . '</h2><p>', '</p>' ) |
|
177 | + 'noResults' => empty($revenue), |
|
178 | + 'noTxnMsg' => sprintf(__('%sThere are currently no transaction records in the last month for this report.%s', 'event_espresso'), '<h2>'.$report_title.'</h2><p>', '</p>') |
|
179 | 179 | ); |
180 | - wp_localize_script( 'ee-txn-reports-js', 'txnRevPerDay', $report_params ); |
|
180 | + wp_localize_script('ee-txn-reports-js', 'txnRevPerDay', $report_params); |
|
181 | 181 | |
182 | 182 | return $report_ID; |
183 | 183 | } |
@@ -191,43 +191,43 @@ discard block |
||
191 | 191 | * @param string $period The period (acceptable by PHP Datetime constructor) for which the report is generated. |
192 | 192 | * @return int |
193 | 193 | */ |
194 | - private function _revenue_per_event_report( $period = '-1 month' ) { |
|
194 | + private function _revenue_per_event_report($period = '-1 month') { |
|
195 | 195 | |
196 | 196 | $report_ID = 'txn-admin-revenue-per-event-report-dv'; |
197 | 197 | |
198 | 198 | $TXN = EEM_Transaction::instance(); |
199 | - $results = $TXN->get_revenue_per_event_report( $period ); |
|
199 | + $results = $TXN->get_revenue_per_event_report($period); |
|
200 | 200 | $results = (array) $results; |
201 | 201 | $revenue = array(); |
202 | 202 | $subtitle = ''; |
203 | 203 | |
204 | - if ( $results ) { |
|
205 | - $revenue[] = array( __( 'Event (only events that have a revenue greater than 1 are shown)', 'event_espresso' ), __( 'Total Revenue', 'event_espresso' ) ); |
|
206 | - foreach ( $results as $result ) { |
|
207 | - if ( $result->revenue > 1 ) { |
|
208 | - $event_name = stripslashes( html_entity_decode( $result->event_name, ENT_QUOTES, 'UTF-8' ) ); |
|
209 | - $event_name = wp_trim_words( $event_name, 5, '...' ); |
|
210 | - $revenue[] = array( $event_name, (float) $result->revenue ); |
|
204 | + if ($results) { |
|
205 | + $revenue[] = array(__('Event (only events that have a revenue greater than 1 are shown)', 'event_espresso'), __('Total Revenue', 'event_espresso')); |
|
206 | + foreach ($results as $result) { |
|
207 | + if ($result->revenue > 1) { |
|
208 | + $event_name = stripslashes(html_entity_decode($result->event_name, ENT_QUOTES, 'UTF-8')); |
|
209 | + $event_name = wp_trim_words($event_name, 5, '...'); |
|
210 | + $revenue[] = array($event_name, (float) $result->revenue); |
|
211 | 211 | } |
212 | 212 | } |
213 | 213 | |
214 | 214 | //setup the date range. |
215 | - $beginning_date = new DateTime( 'now' . $period, new DateTimeZone( EEH_DTT_Helper::get_timezone() ) ); |
|
216 | - $ending_date = new DateTime( 'now', new DateTimeZone( EEH_DTT_Helper::get_timezone() ) ); |
|
217 | - $subtitle = sprintf( _x( 'For the period: %s to %s', 'Used to give date range', 'event_espresso' ), $beginning_date->format( 'Y-m-d' ), $ending_date->format( 'Y-m-d' ) ); |
|
215 | + $beginning_date = new DateTime('now'.$period, new DateTimeZone(EEH_DTT_Helper::get_timezone())); |
|
216 | + $ending_date = new DateTime('now', new DateTimeZone(EEH_DTT_Helper::get_timezone())); |
|
217 | + $subtitle = sprintf(_x('For the period: %s to %s', 'Used to give date range', 'event_espresso'), $beginning_date->format('Y-m-d'), $ending_date->format('Y-m-d')); |
|
218 | 218 | } |
219 | 219 | |
220 | - $report_title = esc_html__( 'Total Revenue per Event', 'event_espresso' ); |
|
220 | + $report_title = esc_html__('Total Revenue per Event', 'event_espresso'); |
|
221 | 221 | |
222 | 222 | $report_params = array( |
223 | 223 | 'title' => $report_title, |
224 | 224 | 'subtitle' => $subtitle, |
225 | 225 | 'id' => $report_ID, |
226 | 226 | 'revenue' => $revenue, |
227 | - 'noResults' => empty( $revenue ), |
|
228 | - 'noTxnMsg' => sprintf( __( '%sThere are currently no transaction records in the last month for this report.%s', 'event_espresso' ), '<h2>' . $report_title . '</h2><p>', '</p>' ) |
|
227 | + 'noResults' => empty($revenue), |
|
228 | + 'noTxnMsg' => sprintf(__('%sThere are currently no transaction records in the last month for this report.%s', 'event_espresso'), '<h2>'.$report_title.'</h2><p>', '</p>') |
|
229 | 229 | ); |
230 | - wp_localize_script( 'ee-txn-reports-js', 'txnRevPerEvent', $report_params ); |
|
230 | + wp_localize_script('ee-txn-reports-js', 'txnRevPerEvent', $report_params); |
|
231 | 231 | |
232 | 232 | return $report_ID; |
233 | 233 | } |
@@ -1,6 +1,7 @@ |
||
1 | 1 | <?php |
2 | -if (!defined('EVENT_ESPRESSO_VERSION') ) |
|
2 | +if (!defined('EVENT_ESPRESSO_VERSION') ) { |
|
3 | 3 | exit('NO direct script access allowed'); |
4 | +} |
|
4 | 5 | |
5 | 6 | /** |
6 | 7 | * Event Espresso |
@@ -1,6 +1,6 @@ discard block |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if (!defined('EVENT_ESPRESSO_VERSION')) |
|
3 | +if ( ! defined('EVENT_ESPRESSO_VERSION')) |
|
4 | 4 | exit('No direct script access allowed'); |
5 | 5 | /** |
6 | 6 | * Event Espresso |
@@ -26,9 +26,9 @@ discard block |
||
26 | 26 | */ |
27 | 27 | ?> |
28 | 28 | <tr> |
29 | - <th><h3><?php _e("Invoice Gateway Settings", 'event_espresso');?></h3></th> |
|
29 | + <th><h3><?php _e("Invoice Gateway Settings", 'event_espresso'); ?></h3></th> |
|
30 | 30 | <td> |
31 | - <span class="description"><?php _e("The following settings affect the functioning of the Invoice gateway.", 'event_espresso');?></span> |
|
31 | + <span class="description"><?php _e("The following settings affect the functioning of the Invoice gateway.", 'event_espresso'); ?></span> |
|
32 | 32 | </td> |
33 | 33 | </tr> |
34 | 34 | <?php |
@@ -3,27 +3,27 @@ |
||
3 | 3 | if (!defined('EVENT_ESPRESSO_VERSION')) |
4 | 4 | exit('No direct script access allowed'); |
5 | 5 | /** |
6 | - * Event Espresso |
|
7 | - * |
|
8 | - * Event Registration and Management Plugin for WordPress |
|
9 | - * |
|
10 | - * @ package Event Espresso |
|
11 | - * @ author Seth Shoultes |
|
12 | - * @ copyright (c) 2008-2011 Event Espresso All Rights Reserved. |
|
13 | - * @ license http://eventespresso.com/support/terms-conditions/ * see Plugin Licensing * |
|
14 | - * @ link http://www.eventespresso.com |
|
15 | - * @ version 4.3 |
|
16 | - * |
|
17 | - * ------------------------------------------------------------------------ |
|
18 | - * |
|
19 | - * invoice_settings_header_gateway |
|
20 | - * |
|
21 | - * @package Event Espresso |
|
22 | - * @subpackage |
|
23 | - * @author Mike Nelson |
|
24 | - * |
|
25 | - * ------------------------------------------------------------------------ |
|
26 | - */ |
|
6 | + * Event Espresso |
|
7 | + * |
|
8 | + * Event Registration and Management Plugin for WordPress |
|
9 | + * |
|
10 | + * @ package Event Espresso |
|
11 | + * @ author Seth Shoultes |
|
12 | + * @ copyright (c) 2008-2011 Event Espresso All Rights Reserved. |
|
13 | + * @ license http://eventespresso.com/support/terms-conditions/ * see Plugin Licensing * |
|
14 | + * @ link http://www.eventespresso.com |
|
15 | + * @ version 4.3 |
|
16 | + * |
|
17 | + * ------------------------------------------------------------------------ |
|
18 | + * |
|
19 | + * invoice_settings_header_gateway |
|
20 | + * |
|
21 | + * @package Event Espresso |
|
22 | + * @subpackage |
|
23 | + * @author Mike Nelson |
|
24 | + * |
|
25 | + * ------------------------------------------------------------------------ |
|
26 | + */ |
|
27 | 27 | ?> |
28 | 28 | <tr> |
29 | 29 | <th><h3><?php _e("Invoice Gateway Settings", 'event_espresso');?></h3></th> |
@@ -1,7 +1,8 @@ |
||
1 | 1 | <?php |
2 | 2 | |
3 | -if (!defined('EVENT_ESPRESSO_VERSION')) |
|
3 | +if (!defined('EVENT_ESPRESSO_VERSION')) { |
|
4 | 4 | exit('No direct script access allowed'); |
5 | +} |
|
5 | 6 | /** |
6 | 7 | * Event Espresso |
7 | 8 | * |