@@ -1,19 +1,19 @@ |
||
1 | 1 | |
2 | - <h3 class="txn-navigation-strip"><?php echo $previous_transaction . ' '; echo __( 'Transaction # ', 'event_espresso' ) . $txn_nmbr['value']; echo ' ' . $next_transaction; ?></h3> |
|
3 | - <h2 id="txn-date-h2" class="txn-date-h2"><?php echo $txn_datetime['value'];?></h2> |
|
2 | + <h3 class="txn-navigation-strip"><?php echo $previous_transaction.' '; echo __('Transaction # ', 'event_espresso').$txn_nmbr['value']; echo ' '.$next_transaction; ?></h3> |
|
3 | + <h2 id="txn-date-h2" class="txn-date-h2"><?php echo $txn_datetime['value']; ?></h2> |
|
4 | 4 | |
5 | 5 | <?php echo $send_payment_reminder_button; ?> |
6 | 6 | <h2 id="txn-status-h2" class="txn-status-h2"> |
7 | - <?php echo __( 'Transaction Status: ', 'event_espresso' );?><span id="txn-status" class="<?php echo $txn_status['class'];?>"><?php echo $txn_status['value'];?></span> |
|
7 | + <?php echo __('Transaction Status: ', 'event_espresso'); ?><span id="txn-status" class="<?php echo $txn_status['class']; ?>"><?php echo $txn_status['value']; ?></span> |
|
8 | 8 | </h2> |
9 | 9 | |
10 | 10 | <?php $attributes = $amount_due ? 'class="txn-amount-due-h2"' : 'class="txn-amount-due-h2 hidden"'; ?> |
11 | 11 | <h2 id="txn-amount-due-h2" <?php echo $attributes; ?>> |
12 | - <?php echo __( 'Total Amount Due: ', 'event_espresso' );?><span id="txn-admin-total-amount-due" class="<?php echo $amount_due_class;?>"><?php echo $amount_due;?></span> |
|
12 | + <?php echo __('Total Amount Due: ', 'event_espresso'); ?><span id="txn-admin-total-amount-due" class="<?php echo $amount_due_class; ?>"><?php echo $amount_due; ?></span> |
|
13 | 13 | </h2> |
14 | 14 | |
15 | 15 | <h3 id="txn-selected-method-of-payment-h3" class="txn-selected-method-of-payment-h3"> |
16 | - <?php echo __( 'Last Method of Payment: ', 'event_espresso' );?><?php echo $method_of_payment_name;?> |
|
16 | + <?php echo __('Last Method of Payment: ', 'event_espresso'); ?><?php echo $method_of_payment_name; ?> |
|
17 | 17 | </h3> |
18 | 18 | |
19 | 19 |
@@ -2,40 +2,40 @@ |
||
2 | 2 | <p> |
3 | 3 | <?php _e('This page shows all available payment methods for Event Espresso.', 'event_espresso'); ?> |
4 | 4 | </p> |
5 | -<p><strong><?php _e('Common Settings', 'event_espresso' )?></strong></p> |
|
5 | +<p><strong><?php _e('Common Settings', 'event_espresso')?></strong></p> |
|
6 | 6 | <ul> |
7 | 7 | <li> |
8 | - <strong><?php _e( 'Name', 'event_espresso' );?></strong><br> |
|
9 | - <?php _e( 'The name of the payment method as customers see it in the registration form, in emails, in receipts, etc.', 'event_espresso' );?> |
|
8 | + <strong><?php _e('Name', 'event_espresso'); ?></strong><br> |
|
9 | + <?php _e('The name of the payment method as customers see it in the registration form, in emails, in receipts, etc.', 'event_espresso'); ?> |
|
10 | 10 | </li> |
11 | 11 | <li> |
12 | - <strong><?php _e( 'Description', 'event_espresso' );?></strong><br/> |
|
13 | - <?php _e( 'The description of how to use the payment method as customers will see it. This is mostly only seen during registration.', 'event_espresso' );?> |
|
12 | + <strong><?php _e('Description', 'event_espresso'); ?></strong><br/> |
|
13 | + <?php _e('The description of how to use the payment method as customers will see it. This is mostly only seen during registration.', 'event_espresso'); ?> |
|
14 | 14 | </li> |
15 | - <li><strong><?php _e( 'Admin-Only Name', 'event_espresso' );?></strong><br/> |
|
16 | - <?php _e( 'The name of the payment method as seen internally by site administrators and staff.', 'event_espresso' );?> |
|
15 | + <li><strong><?php _e('Admin-Only Name', 'event_espresso'); ?></strong><br/> |
|
16 | + <?php _e('The name of the payment method as seen internally by site administrators and staff.', 'event_espresso'); ?> |
|
17 | 17 | </li> |
18 | 18 | <li> |
19 | - <strong><?php _e( 'Admin-Only Description', 'event_espresso' );?></strong><br/> |
|
20 | - <?php _e( 'The description of the payment method as seen internally by site administrators and staff.', 'event_espresso' );?> |
|
19 | + <strong><?php _e('Admin-Only Description', 'event_espresso'); ?></strong><br/> |
|
20 | + <?php _e('The description of the payment method as seen internally by site administrators and staff.', 'event_espresso'); ?> |
|
21 | 21 | </li> |
22 | 22 | <li> |
23 | - <strong><?php _e( 'Debug (sandbox) Mode', 'event_espresso' );?></strong><br/> |
|
24 | - <?php _e( 'Many payment methods have a debug/sandbox mode where payments are not processed but are only simulated. This is helpful when setup and debugging.', 'event_espresso' );?> |
|
23 | + <strong><?php _e('Debug (sandbox) Mode', 'event_espresso'); ?></strong><br/> |
|
24 | + <?php _e('Many payment methods have a debug/sandbox mode where payments are not processed but are only simulated. This is helpful when setup and debugging.', 'event_espresso'); ?> |
|
25 | 25 | </li> |
26 | 26 | <li> |
27 | - <strong><?php _e( 'Open by Default', 'event_espresso' );?></strong><br/> |
|
28 | - <?php _e( 'If checked, this payment method will be selected by default (assuming no other valid payment methods are also marked as open by default.)', 'event_espresso' );?> |
|
27 | + <strong><?php _e('Open by Default', 'event_espresso'); ?></strong><br/> |
|
28 | + <?php _e('If checked, this payment method will be selected by default (assuming no other valid payment methods are also marked as open by default.)', 'event_espresso'); ?> |
|
29 | 29 | </li> |
30 | 30 | <li> |
31 | - <strong><?php _e( 'Button URL', 'event_espresso' );?></strong><br/> |
|
32 | - <?php printf( __( 'The URL of the button image for this payment method in the registration process. You may use any uploaded image on your website (click %s next to the field to select). If left blank, the default button image will be used.', 'event_espresso' ), '<img src="' . admin_url('images/media-button-image.gif') . '">' );?> |
|
31 | + <strong><?php _e('Button URL', 'event_espresso'); ?></strong><br/> |
|
32 | + <?php printf(__('The URL of the button image for this payment method in the registration process. You may use any uploaded image on your website (click %s next to the field to select). If left blank, the default button image will be used.', 'event_espresso'), '<img src="'.admin_url('images/media-button-image.gif').'">'); ?> |
|
33 | 33 | </li> |
34 | - <li><strong><?php _e( 'Usable From', 'event_espresso' );?></strong><br/> |
|
35 | - <?php _e( 'Where this payment method can be used from.', 'event_espresso' );?> |
|
34 | + <li><strong><?php _e('Usable From', 'event_espresso'); ?></strong><br/> |
|
35 | + <?php _e('Where this payment method can be used from.', 'event_espresso'); ?> |
|
36 | 36 | <ul> |
37 | - <li><?php _e( 'Front-end Registration Page: the payment method will appear as an option during the normal registration process to customers and they can use it to process payments.', 'event_espresso' );?></li> |
|
38 | - <li><?php _e( 'Admin Registration Page: when recording payments made from the transaction admin page, the payment method will appear as an option. Note: currently payments can only be RECORDED from the admin, they cannot be PROCESSED.', 'event_espresso' );?></li> |
|
37 | + <li><?php _e('Front-end Registration Page: the payment method will appear as an option during the normal registration process to customers and they can use it to process payments.', 'event_espresso'); ?></li> |
|
38 | + <li><?php _e('Admin Registration Page: when recording payments made from the transaction admin page, the payment method will appear as an option. Note: currently payments can only be RECORDED from the admin, they cannot be PROCESSED.', 'event_espresso'); ?></li> |
|
39 | 39 | </ul> |
40 | 40 | </li> |
41 | 41 | </ul> |
@@ -4,33 +4,33 @@ discard block |
||
4 | 4 | <?php echo $resend_registration_button; ?> |
5 | 5 | <br/> |
6 | 6 | |
7 | - <h3 class="admin-primary-mbox-h4 hdr-has-icon"><span class="dashicons dashicons-clipboard"></span><?php _e( 'Registration Items', 'event_espresso' );?></h3> |
|
7 | + <h3 class="admin-primary-mbox-h4 hdr-has-icon"><span class="dashicons dashicons-clipboard"></span><?php _e('Registration Items', 'event_espresso'); ?></h3> |
|
8 | 8 | |
9 | 9 | <?php echo $line_item_table; ?> |
10 | 10 | |
11 | 11 | <?php |
12 | - if ( WP_DEBUG ) { |
|
13 | - $delivered_messages = get_option( 'EED_Messages__maybe_registration', array() ); |
|
14 | - if ( isset( $delivered_messages[ $REG_ID ] )) { |
|
12 | + if (WP_DEBUG) { |
|
13 | + $delivered_messages = get_option('EED_Messages__maybe_registration', array()); |
|
14 | + if (isset($delivered_messages[$REG_ID])) { |
|
15 | 15 | ?> |
16 | - <h4 class="admin-primary-mbox-h4 hdr-has-icon"><span class="dashicons dashicons-email-alt"></span><?php _e( 'Messages Sent to Registrant', 'event_espresso' );?></h4> |
|
16 | + <h4 class="admin-primary-mbox-h4 hdr-has-icon"><span class="dashicons dashicons-email-alt"></span><?php _e('Messages Sent to Registrant', 'event_espresso'); ?></h4> |
|
17 | 17 | |
18 | 18 | <div class="admin-primary-mbox-tbl-wrap"> |
19 | 19 | <table class="admin-primary-mbox-tbl"> |
20 | 20 | <thead> |
21 | 21 | <tr> |
22 | - <th class="jst-left"><?php _e( 'Date & Time', 'event_espresso' );?></th> |
|
23 | - <th class="jst-left"><?php _e( 'Message Type', 'event_espresso' );?></th> |
|
24 | - <th class="jst-left"><?php _e( 'REG Status Upon Sending', 'event_espresso' );?></th> |
|
22 | + <th class="jst-left"><?php _e('Date & Time', 'event_espresso'); ?></th> |
|
23 | + <th class="jst-left"><?php _e('Message Type', 'event_espresso'); ?></th> |
|
24 | + <th class="jst-left"><?php _e('REG Status Upon Sending', 'event_espresso'); ?></th> |
|
25 | 25 | </tr> |
26 | 26 | </thead> |
27 | 27 | <tbody> |
28 | - <?php foreach ( $delivered_messages[ $REG_ID ] as $timestamp => $delivered_message ) : |
|
28 | + <?php foreach ($delivered_messages[$REG_ID] as $timestamp => $delivered_message) : |
|
29 | 29 | ?> |
30 | 30 | <tr> |
31 | - <td class="jst-left"><?php echo gmdate( get_option('date_format') . ' ' . get_option('time_format'), ( $timestamp + ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS ) ) );?></td> |
|
32 | - <td class="jst-left"><?php echo isset( $delivered_message['message_type'] ) ? $delivered_message['message_type'] : '';?></td> |
|
33 | - <td class="jst-left"><?php echo isset( $delivered_message['reg_status'] ) ? $delivered_message['reg_status'] : '';?></td> |
|
31 | + <td class="jst-left"><?php echo gmdate(get_option('date_format').' '.get_option('time_format'), ($timestamp + (get_option('gmt_offset') * HOUR_IN_SECONDS))); ?></td> |
|
32 | + <td class="jst-left"><?php echo isset($delivered_message['message_type']) ? $delivered_message['message_type'] : ''; ?></td> |
|
33 | + <td class="jst-left"><?php echo isset($delivered_message['reg_status']) ? $delivered_message['reg_status'] : ''; ?></td> |
|
34 | 34 | </tr> |
35 | 35 | <?php endforeach; // $delivered_messages?> |
36 | 36 | </tbody> |
@@ -42,27 +42,27 @@ discard block |
||
42 | 42 | ?> |
43 | 43 | |
44 | 44 | <a id="display-additional-registration-session-info" class="display-the-hidden smaller-text" rel="additional-registration-session-info"> |
45 | - <span class="dashicons dashicons-plus-alt"></span><?php _e( 'view additional registration session details', 'event_espresso' );?> |
|
45 | + <span class="dashicons dashicons-plus-alt"></span><?php _e('view additional registration session details', 'event_espresso'); ?> |
|
46 | 46 | </a> |
47 | 47 | |
48 | 48 | <div id="additional-registration-session-info-dv" class="hidden"> |
49 | 49 | |
50 | 50 | <a id="hide-additional-registration-session-info" class="hide-the-displayed hidden smaller-text" rel="additional-registration-session-info"> |
51 | - <span class="dashicons dashicons-dismiss"></span><?php _e( 'hide additional registration session details', 'event_espresso' );?> |
|
51 | + <span class="dashicons dashicons-dismiss"></span><?php _e('hide additional registration session details', 'event_espresso'); ?> |
|
52 | 52 | </a> |
53 | 53 | <br class="clear"/> |
54 | 54 | |
55 | - <h3 class="admin-primary-mbox-h4"><?php _e( 'Registration Session Details', 'event_espresso' );?></h3> |
|
55 | + <h3 class="admin-primary-mbox-h4"><?php _e('Registration Session Details', 'event_espresso'); ?></h3> |
|
56 | 56 | |
57 | 57 | <table id="admin-primary-mbox-reg-extra-session-info-tbl" class="form-table skinny-rows"> |
58 | 58 | <tbody> |
59 | - <?php foreach ( $reg_details as $key => $reg_detail ) : ?> |
|
59 | + <?php foreach ($reg_details as $key => $reg_detail) : ?> |
|
60 | 60 | <tr> |
61 | 61 | <th> |
62 | - <label for="<?php echo $key;?>"><?php echo $reg_detail['label'];?></label> |
|
62 | + <label for="<?php echo $key; ?>"><?php echo $reg_detail['label']; ?></label> |
|
63 | 63 | </th> |
64 | 64 | <td> |
65 | - <?php echo $reg_detail['value'];?> |
|
65 | + <?php echo $reg_detail['value']; ?> |
|
66 | 66 | </td> |
67 | 67 | </tr> |
68 | 68 | <?php endforeach; // $reg_details?> |
@@ -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 |
@@ -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 |
@@ -136,9 +136,9 @@ discard block |
||
136 | 136 | |
137 | 137 | /** |
138 | 138 | * grab url requests and route them |
139 | - * @access private |
|
140 | - * @return void |
|
141 | - */ |
|
139 | + * @access private |
|
140 | + * @return void |
|
141 | + */ |
|
142 | 142 | public function _set_page_routes() { |
143 | 143 | |
144 | 144 | $this->_get_registration_status_array(); |
@@ -404,7 +404,7 @@ discard block |
||
404 | 404 | 'title' => __('Registrations Other', 'event_espresso'), |
405 | 405 | 'filename' => 'registrations_overview_other' |
406 | 406 | ) |
407 | - ), |
|
407 | + ), |
|
408 | 408 | 'help_tour' => array( 'Registration_Overview_Help_Tour' ), |
409 | 409 | 'qtips' => array('Registration_List_Table_Tips'), |
410 | 410 | 'list_table' => 'EE_Registrations_List_Table', |
@@ -418,7 +418,7 @@ discard block |
||
418 | 418 | 'url' => isset($this->_req_data['_REG_ID']) ? add_query_arg(array('_REG_ID' => $this->_req_data['_REG_ID'] ), $this->_current_page_view_url ) : $this->_admin_base_url, |
419 | 419 | 'persistent' => FALSE |
420 | 420 | ), |
421 | - 'help_tabs' => array( |
|
421 | + 'help_tabs' => array( |
|
422 | 422 | 'registrations_details_help_tab' => array( |
423 | 423 | 'title' => __('Registration Details', 'event_espresso'), |
424 | 424 | 'filename' => 'registrations_details' |
@@ -482,7 +482,7 @@ discard block |
||
482 | 482 | 'order' => 20 |
483 | 483 | ), |
484 | 484 | 'list_table' => 'EE_Attendee_Contact_List_Table', |
485 | - 'help_tabs' => array( |
|
485 | + 'help_tabs' => array( |
|
486 | 486 | 'registrations_contact_list_help_tab' => array( |
487 | 487 | 'title' => __('Registrations Contact List', 'event_espresso'), |
488 | 488 | 'filename' => 'registrations_contact_list' |
@@ -499,7 +499,7 @@ discard block |
||
499 | 499 | 'title' => __('Contact List Other', 'event_espresso'), |
500 | 500 | 'filename' => 'registrations_contact_list_other' |
501 | 501 | ) |
502 | - ), |
|
502 | + ), |
|
503 | 503 | 'help_tour' => array( 'Contact_List_Help_Tour' ), |
504 | 504 | 'metaboxes' => array(), |
505 | 505 | 'require_nonce' => FALSE |
@@ -533,9 +533,9 @@ discard block |
||
533 | 533 | |
534 | 534 | /** |
535 | 535 | * get list of registration statuses |
536 | - * @access private |
|
537 | - * @return void |
|
538 | - */ |
|
536 | + * @access private |
|
537 | + * @return void |
|
538 | + */ |
|
539 | 539 | private function _get_registration_status_array() { |
540 | 540 | self::$_reg_status = EEM_Registration::reg_status_array( array(), TRUE); |
541 | 541 | } |
@@ -842,7 +842,7 @@ discard block |
||
842 | 842 | return TRUE; |
843 | 843 | } |
844 | 844 | |
845 | - $REG = EEM_Registration::instance(); |
|
845 | + $REG = EEM_Registration::instance(); |
|
846 | 846 | |
847 | 847 | $REG_ID = ( ! empty( $this->_req_data['_REG_ID'] )) ? absint( $this->_req_data['_REG_ID'] ) : FALSE; |
848 | 848 | |
@@ -1065,9 +1065,9 @@ discard block |
||
1065 | 1065 | |
1066 | 1066 | /** |
1067 | 1067 | * generates HTML for the View Registration Details Admin page |
1068 | - * @access protected |
|
1069 | - * @return void |
|
1070 | - */ |
|
1068 | + * @access protected |
|
1069 | + * @return void |
|
1070 | + */ |
|
1071 | 1071 | protected function _registration_details() { |
1072 | 1072 | |
1073 | 1073 | $this->_template_args = array(); |
@@ -1145,9 +1145,9 @@ discard block |
||
1145 | 1145 | |
1146 | 1146 | /** |
1147 | 1147 | * _set_approve_or_decline_reg_status_buttons |
1148 | - * @access protected |
|
1149 | - * @return string |
|
1150 | - */ |
|
1148 | + * @access protected |
|
1149 | + * @return string |
|
1150 | + */ |
|
1151 | 1151 | public function set_reg_status_buttons_metabox() { |
1152 | 1152 | |
1153 | 1153 | //is registration for free event OR for a completed transaction? This will determine whether the set to pending option is shown. |
@@ -1337,10 +1337,10 @@ discard block |
||
1337 | 1337 | |
1338 | 1338 | /** |
1339 | 1339 | * approve_registration |
1340 | - * @access protected |
|
1341 | - * @param bool $notify whether or not to notify the registrant about their approval. |
|
1342 | - * @return void |
|
1343 | - */ |
|
1340 | + * @access protected |
|
1341 | + * @param bool $notify whether or not to notify the registrant about their approval. |
|
1342 | + * @return void |
|
1343 | + */ |
|
1344 | 1344 | protected function approve_registration( $notify = false ) { |
1345 | 1345 | $this->_reg_status_change_return( EEM_Registration::status_id_approved, $notify ); |
1346 | 1346 | } |
@@ -1350,10 +1350,10 @@ discard block |
||
1350 | 1350 | |
1351 | 1351 | /** |
1352 | 1352 | * decline_registration |
1353 | - * @access protected |
|
1354 | - * @param bool $notify whether or not to notify the registrant about their approval. |
|
1355 | - * @return void |
|
1356 | - */ |
|
1353 | + * @access protected |
|
1354 | + * @param bool $notify whether or not to notify the registrant about their approval. |
|
1355 | + * @return void |
|
1356 | + */ |
|
1357 | 1357 | protected function decline_registration( $notify = false ) { |
1358 | 1358 | $this->_reg_status_change_return( EEM_Registration::status_id_declined, $notify ); |
1359 | 1359 | } |
@@ -1363,10 +1363,10 @@ discard block |
||
1363 | 1363 | |
1364 | 1364 | /** |
1365 | 1365 | * cancel_registration |
1366 | - * @access protected |
|
1367 | - * @param bool $notify whether or not to notify the registrant about their approval. |
|
1368 | - * @return void |
|
1369 | - */ |
|
1366 | + * @access protected |
|
1367 | + * @param bool $notify whether or not to notify the registrant about their approval. |
|
1368 | + * @return void |
|
1369 | + */ |
|
1370 | 1370 | protected function cancel_registration( $notify = false ) { |
1371 | 1371 | $this->_reg_status_change_return( EEM_Registration::status_id_cancelled, $notify ); |
1372 | 1372 | } |
@@ -1377,10 +1377,10 @@ discard block |
||
1377 | 1377 | |
1378 | 1378 | /** |
1379 | 1379 | * not_approve_registration |
1380 | - * @access protected |
|
1381 | - * @param bool $notify whether or not to notify the registrant about their approval. |
|
1382 | - * @return void |
|
1383 | - */ |
|
1380 | + * @access protected |
|
1381 | + * @param bool $notify whether or not to notify the registrant about their approval. |
|
1382 | + * @return void |
|
1383 | + */ |
|
1384 | 1384 | protected function not_approve_registration( $notify = false ) { |
1385 | 1385 | $this->_reg_status_change_return( EEM_Registration::status_id_not_approved, $notify ); |
1386 | 1386 | } |
@@ -1389,10 +1389,10 @@ discard block |
||
1389 | 1389 | |
1390 | 1390 | /** |
1391 | 1391 | * decline_registration |
1392 | - * @access protected |
|
1393 | - * @param bool $notify whether or not to notify the registrant about their approval. |
|
1394 | - * @return void |
|
1395 | - */ |
|
1392 | + * @access protected |
|
1393 | + * @param bool $notify whether or not to notify the registrant about their approval. |
|
1394 | + * @return void |
|
1395 | + */ |
|
1396 | 1396 | protected function pending_registration( $notify = false ) { |
1397 | 1397 | $this->_reg_status_change_return( EEM_Registration::status_id_pending_payment, $notify ); |
1398 | 1398 | } |
@@ -1402,9 +1402,9 @@ discard block |
||
1402 | 1402 | |
1403 | 1403 | /** |
1404 | 1404 | * generates HTML for the Registration main meta box |
1405 | - * @access public |
|
1406 | - * @return void |
|
1407 | - */ |
|
1405 | + * @access public |
|
1406 | + * @return void |
|
1407 | + */ |
|
1408 | 1408 | public function _reg_details_meta_box() { |
1409 | 1409 | EEH_Autoloader::register_line_item_display_autoloaders(); |
1410 | 1410 | EEH_Autoloader::register_line_item_filter_autoloaders(); |
@@ -1487,7 +1487,7 @@ discard block |
||
1487 | 1487 | * |
1488 | 1488 | * @access public |
1489 | 1489 | * @return void |
1490 | - */ |
|
1490 | + */ |
|
1491 | 1491 | public function _reg_questions_meta_box() { |
1492 | 1492 | //allow someone to override this method entirely |
1493 | 1493 | if( apply_filters( 'FHEE__Registrations_Admin_Page___reg_questions_meta_box__do_default', true, $this, $this->_registration ) ) { |
@@ -1689,12 +1689,12 @@ discard block |
||
1689 | 1689 | |
1690 | 1690 | /** |
1691 | 1691 | * generates HTML for the Registration main meta box |
1692 | - * @access public |
|
1693 | - * @return void |
|
1694 | - */ |
|
1692 | + * @access public |
|
1693 | + * @return void |
|
1694 | + */ |
|
1695 | 1695 | public function _reg_attendees_meta_box() { |
1696 | 1696 | |
1697 | - $REG = EEM_Registration::instance(); |
|
1697 | + $REG = EEM_Registration::instance(); |
|
1698 | 1698 | //get all other registrations on this transaction, and cache |
1699 | 1699 | //the attendees for them so we don't have to run another query using force_join |
1700 | 1700 | $registrations = $REG->get_all(array( |
@@ -1747,9 +1747,9 @@ discard block |
||
1747 | 1747 | |
1748 | 1748 | /** |
1749 | 1749 | * generates HTML for the Edit Registration side meta box |
1750 | - * @access public |
|
1751 | - * @return void |
|
1752 | - */ |
|
1750 | + * @access public |
|
1751 | + * @return void |
|
1752 | + */ |
|
1753 | 1753 | public function _reg_registrant_side_meta_box() { |
1754 | 1754 | |
1755 | 1755 | /*@var $attendee EE_Attendee */ |
@@ -2095,9 +2095,9 @@ discard block |
||
2095 | 2095 | |
2096 | 2096 | /** |
2097 | 2097 | * set_reg_event |
2098 | - * @access private |
|
2099 | - * @return boolean |
|
2100 | - */ |
|
2098 | + * @access private |
|
2099 | + * @return boolean |
|
2100 | + */ |
|
2101 | 2101 | private function _set_reg_event() { |
2102 | 2102 | if ( is_object( $this->_reg_event )) { |
2103 | 2103 | return TRUE; |
@@ -2204,9 +2204,9 @@ discard block |
||
2204 | 2204 | |
2205 | 2205 | /** |
2206 | 2206 | * generates HTML for the Attendee Contact List |
2207 | - * @access protected |
|
2208 | - * @return void |
|
2209 | - */ |
|
2207 | + * @access protected |
|
2208 | + * @return void |
|
2209 | + */ |
|
2210 | 2210 | protected function _attendee_contact_list_table() { |
2211 | 2211 | do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' ); |
2212 | 2212 | $this->_search_btn_label = __('Contacts', 'event_espresso'); |
@@ -2220,9 +2220,9 @@ discard block |
||
2220 | 2220 | /** |
2221 | 2221 | * get_attendees |
2222 | 2222 | * @param bool $count whether to return count or data. |
2223 | - * @access public |
|
2224 | - * @return array |
|
2225 | - */ |
|
2223 | + * @access public |
|
2224 | + * @return array |
|
2225 | + */ |
|
2226 | 2226 | public function get_attendees( $per_page, $count = FALSE, $trash = FALSE ) { |
2227 | 2227 | |
2228 | 2228 | do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' ); |
@@ -2558,9 +2558,9 @@ discard block |
||
2558 | 2558 | |
2559 | 2559 | /** |
2560 | 2560 | * _attendee_details |
2561 | - * @access protected |
|
2562 | - * @return void |
|
2563 | - */ |
|
2561 | + * @access protected |
|
2562 | + * @return void |
|
2563 | + */ |
|
2564 | 2564 | public function attendee_registrations_meta_box( $post ) { |
2565 | 2565 | |
2566 | 2566 | $this->_template_args['attendee'] = $this->_cpt_model_obj; |
@@ -2593,10 +2593,10 @@ discard block |
||
2593 | 2593 | |
2594 | 2594 | /** |
2595 | 2595 | * _trash_or_restore_attendee |
2596 | - * @param boolean $trash - whether to move item to trash (TRUE) or restore it (FALSE) |
|
2597 | - * @access protected |
|
2598 | - * @return void |
|
2599 | - */ |
|
2596 | + * @param boolean $trash - whether to move item to trash (TRUE) or restore it (FALSE) |
|
2597 | + * @access protected |
|
2598 | + * @return void |
|
2599 | + */ |
|
2600 | 2600 | protected function _trash_or_restore_attendees( $trash = TRUE ) { |
2601 | 2601 | |
2602 | 2602 | do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' ); |
@@ -1,4 +1,6 @@ discard block |
||
1 | -<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed'); |
|
1 | +<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) { |
|
2 | + exit('No direct script access allowed'); |
|
3 | +} |
|
2 | 4 | /** |
3 | 5 | * Event Espresso |
4 | 6 | * |
@@ -118,8 +120,9 @@ discard block |
||
118 | 120 | public function clear_comment_link( $link, $comment, $args ) { |
119 | 121 | //gotta make sure this only happens on this route |
120 | 122 | $post_type = get_post_type( $comment->comment_post_ID); |
121 | - if ( $post_type == 'espresso_attendees' ) |
|
122 | - return '#commentsdiv'; |
|
123 | + if ( $post_type == 'espresso_attendees' ) { |
|
124 | + return '#commentsdiv'; |
|
125 | + } |
|
123 | 126 | return $link; |
124 | 127 | } |
125 | 128 | |
@@ -878,9 +881,9 @@ discard block |
||
878 | 881 | |
879 | 882 | $REG_ID = ( ! empty( $this->_req_data['_REG_ID'] )) ? absint( $this->_req_data['_REG_ID'] ) : FALSE; |
880 | 883 | |
881 | - if ( $this->_registration = $REG->get_one_by_ID( $REG_ID )) |
|
882 | - return TRUE; |
|
883 | - else { |
|
884 | + if ( $this->_registration = $REG->get_one_by_ID( $REG_ID )) { |
|
885 | + return TRUE; |
|
886 | + } else { |
|
884 | 887 | $error_msg = sprintf( __('An error occurred and the details for Registration ID #%s could not be retrieved.', 'event_espresso'), $REG_ID ); |
885 | 888 | EE_Error::add_error( $error_msg, __FILE__, __FUNCTION__, __LINE__ ); |
886 | 889 | $this->_registration = NULL; |
@@ -977,7 +980,7 @@ discard block |
||
977 | 980 | EEM_Registration::instance()->convert_datetime_for_query( 'REG_date', $curdate . $time_start, 'Y-m-d H:i:s' ), |
978 | 981 | EEM_Registration::instance()->convert_datetime_for_query( 'REG_date', $curdate . $time_end, 'Y-m-d H:i:s' ), |
979 | 982 | )); |
980 | - }elseif($this_month_a || $this_month){ |
|
983 | + } elseif($this_month_a || $this_month){ |
|
981 | 984 | $this_month_r = date('m', current_time('timestamp')); |
982 | 985 | $days_this_month = date( 't', current_time('timestamp') ); |
983 | 986 | $_where['REG_date']= array('BETWEEN', |
@@ -985,18 +988,18 @@ discard block |
||
985 | 988 | EEM_Registration::instance()->convert_datetime_for_query( 'REG_date', $this_year_r . '-' . $this_month_r . '-01' . ' ' . $time_start, 'Y-m-d H:i:s' ), |
986 | 989 | EEM_Registration::instance()->convert_datetime_for_query( 'REG_date', $this_year_r . '-' . $this_month_r . '-' . $days_this_month . ' ' . $time_end, 'Y-m-d H:i:s' ) |
987 | 990 | )); |
988 | - }elseif($month_range){ |
|
991 | + } elseif($month_range){ |
|
989 | 992 | $pieces = explode(' ', $this->_req_data['month_range'], 3); |
990 | 993 | $month_r = !empty($pieces[0]) ? date('m', strtotime($pieces[0])) : ''; |
991 | 994 | $year_r = !empty($pieces[1]) ? $pieces[1] : ''; |
992 | 995 | $days_in_month = date('t', strtotime($year_r . '-' . $month_r . '-' . '01') ); |
993 | 996 | $_where['REG_date']= array('BETWEEN', |
994 | 997 | array( EEM_Registration::instance()->convert_datetime_for_query( 'REG_date', $year_r . '-' . $month_r . '-01 00:00:00', 'Y-m-d H:i:s'), EEM_Registration::instance()->convert_datetime_for_query( 'REG_date', $year_r . '-' . $month_r . '-' . $days_in_month . ' 23:59:59', 'Y-m-d H:i:s' ) ) ); |
995 | - }elseif($start_date && $end_date){ |
|
998 | + } elseif($start_date && $end_date){ |
|
996 | 999 | throw new EE_Error("not yet supported"); |
997 | - }elseif($start_date){ |
|
1000 | + } elseif($start_date){ |
|
998 | 1001 | throw new EE_Error("not yet supported"); |
999 | - }elseif($end_date){ |
|
1002 | + } elseif($end_date){ |
|
1000 | 1003 | throw new EE_Error("not yet supported"); |
1001 | 1004 | } |
1002 | 1005 | |
@@ -1931,8 +1934,9 @@ discard block |
||
1931 | 1934 | // cycle thru checkboxes |
1932 | 1935 | while (list( $ind, $REG_ID ) = each($this->_req_data['_REG_ID'])) { |
1933 | 1936 | $REG = $REG_MDL->get_one_by_ID($REG_ID); |
1934 | - if ( ! $REG instanceof EE_Registration ) |
|
1935 | - continue; |
|
1937 | + if ( ! $REG instanceof EE_Registration ) { |
|
1938 | + continue; |
|
1939 | + } |
|
1936 | 1940 | $deleted = $this->_delete_registration($REG); |
1937 | 1941 | if ( !$deleted ) { |
1938 | 1942 | $success = 0; |
@@ -1971,8 +1975,9 @@ discard block |
||
1971 | 1975 | |
1972 | 1976 | $all_trashed = TRUE; |
1973 | 1977 | foreach ( $REGS as $registration ) { |
1974 | - if ( ! $registration->get('REG_deleted') ) |
|
1975 | - $all_trashed = FALSE; |
|
1978 | + if ( ! $registration->get('REG_deleted') ) { |
|
1979 | + $all_trashed = FALSE; |
|
1980 | + } |
|
1976 | 1981 | } |
1977 | 1982 | |
1978 | 1983 | if ( ! $all_trashed ) { |
@@ -1998,8 +2003,10 @@ discard block |
||
1998 | 2003 | //now delete permanently the checkins related to this registration. |
1999 | 2004 | $registration->delete_related_permanently('Checkin'); |
2000 | 2005 | |
2001 | - if ( $registration->ID() === $REG->ID() ) |
|
2002 | - continue; //we don't want to delete permanently the existing registration just yet. |
|
2006 | + if ( $registration->ID() === $REG->ID() ) { |
|
2007 | + continue; |
|
2008 | + } |
|
2009 | + //we don't want to delete permanently the existing registration just yet. |
|
2003 | 2010 | |
2004 | 2011 | //remove relation to transaction for these registrations if NOT the existing registrations |
2005 | 2012 | $registration->_remove_relations('Transaction'); |
@@ -2554,8 +2561,9 @@ discard block |
||
2554 | 2561 | } |
2555 | 2562 | } |
2556 | 2563 | |
2557 | - if ( $success === FALSE ) |
|
2558 | - EE_Error::add_error(__('Something went wrong with updating the meta table data for the registration.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ ); |
|
2564 | + if ( $success === FALSE ) { |
|
2565 | + EE_Error::add_error(__('Something went wrong with updating the meta table data for the registration.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ ); |
|
2566 | + } |
|
2559 | 2567 | |
2560 | 2568 | } |
2561 | 2569 |
@@ -56,26 +56,26 @@ discard block |
||
56 | 56 | * @param bool $routing |
57 | 57 | * @return Registrations_Admin_Page |
58 | 58 | */ |
59 | - public function __construct( $routing = TRUE ) { |
|
60 | - parent::__construct( $routing ); |
|
61 | - add_action( 'wp_loaded', array( $this, 'wp_loaded' )); |
|
59 | + public function __construct($routing = TRUE) { |
|
60 | + parent::__construct($routing); |
|
61 | + add_action('wp_loaded', array($this, 'wp_loaded')); |
|
62 | 62 | } |
63 | 63 | |
64 | 64 | |
65 | 65 | |
66 | 66 | public function wp_loaded() { |
67 | 67 | // when adding a new registration... |
68 | - if ( isset( $this->_req_data[ 'action' ] ) && $this->_req_data[ 'action' ] == 'new_registration' ) { |
|
68 | + if (isset($this->_req_data['action']) && $this->_req_data['action'] == 'new_registration') { |
|
69 | 69 | EE_System::do_not_cache(); |
70 | 70 | if ( |
71 | - ! isset( $this->_req_data[ 'processing_registration' ] ) |
|
72 | - || absint( $this->_req_data[ 'processing_registration' ] ) !== 1 |
|
71 | + ! isset($this->_req_data['processing_registration']) |
|
72 | + || absint($this->_req_data['processing_registration']) !== 1 |
|
73 | 73 | ) { |
74 | 74 | // and it's NOT the attendee information reg step |
75 | 75 | // force cookie expiration by setting time to last week |
76 | - setcookie( 'ee_registration_added', 0, time() - WEEK_IN_SECONDS, '/' ); |
|
76 | + setcookie('ee_registration_added', 0, time() - WEEK_IN_SECONDS, '/'); |
|
77 | 77 | // and update the global |
78 | - $_COOKIE[ 'ee_registration_added' ] = 0; |
|
78 | + $_COOKIE['ee_registration_added'] = 0; |
|
79 | 79 | } |
80 | 80 | } |
81 | 81 | } |
@@ -109,16 +109,16 @@ discard block |
||
109 | 109 | 'trash' => 'post.php' |
110 | 110 | ); |
111 | 111 | |
112 | - add_action('edit_form_after_title', array($this, 'after_title_form_fields'), 10 ); |
|
112 | + add_action('edit_form_after_title', array($this, 'after_title_form_fields'), 10); |
|
113 | 113 | //add filters so that the comment urls don't take users to a confusing 404 page |
114 | - add_filter('get_comment_link', array( $this, 'clear_comment_link' ), 10, 3 ); |
|
114 | + add_filter('get_comment_link', array($this, 'clear_comment_link'), 10, 3); |
|
115 | 115 | } |
116 | 116 | |
117 | 117 | |
118 | - public function clear_comment_link( $link, $comment, $args ) { |
|
118 | + public function clear_comment_link($link, $comment, $args) { |
|
119 | 119 | //gotta make sure this only happens on this route |
120 | - $post_type = get_post_type( $comment->comment_post_ID); |
|
121 | - if ( $post_type == 'espresso_attendees' ) |
|
120 | + $post_type = get_post_type($comment->comment_post_ID); |
|
121 | + if ($post_type == 'espresso_attendees') |
|
122 | 122 | return '#commentsdiv'; |
123 | 123 | return $link; |
124 | 124 | } |
@@ -126,7 +126,7 @@ discard block |
||
126 | 126 | |
127 | 127 | protected function _ajax_hooks() { |
128 | 128 | //todo: all hooks for registrations ajax goes in here |
129 | - add_action( 'wp_ajax_toggle_checkin_status', array( $this, 'toggle_checkin_status' )); |
|
129 | + add_action('wp_ajax_toggle_checkin_status', array($this, 'toggle_checkin_status')); |
|
130 | 130 | } |
131 | 131 | |
132 | 132 | |
@@ -141,8 +141,8 @@ discard block |
||
141 | 141 | 'add-attendee' => __('Add Contact', 'event_espresso'), |
142 | 142 | 'edit' => __('Edit Contact', 'event_espresso'), |
143 | 143 | 'report'=> __("Event Registrations CSV Report", "event_espresso"), |
144 | - 'report_all' => __( 'All Registrations CSV Report', 'event_espresso' ), |
|
145 | - 'contact_list_report' => __( 'Contact List Report', 'event_espresso' ), |
|
144 | + 'report_all' => __('All Registrations CSV Report', 'event_espresso'), |
|
145 | + 'contact_list_report' => __('Contact List Report', 'event_espresso'), |
|
146 | 146 | 'contact_list_export'=> __("Export Data", "event_espresso"), |
147 | 147 | ), |
148 | 148 | 'publishbox' => array( |
@@ -170,9 +170,9 @@ discard block |
||
170 | 170 | |
171 | 171 | $this->_get_registration_status_array(); |
172 | 172 | |
173 | - $reg_id = ! empty( $this->_req_data['_REG_ID'] ) && ! is_array( $this->_req_data['_REG_ID'] ) ? $this->_req_data['_REG_ID'] : 0; |
|
174 | - $att_id = ! empty( $this->_req_data[ 'ATT_ID' ] ) && ! is_array( $this->_req_data['ATT_ID'] ) ? $this->_req_data['ATT_ID'] : 0; |
|
175 | - $att_id = ! empty( $this->_req_data['post'] ) && ! is_array( $this->_req_data['post'] ) ? $this->_req_data['post'] : $att_id; |
|
173 | + $reg_id = ! empty($this->_req_data['_REG_ID']) && ! is_array($this->_req_data['_REG_ID']) ? $this->_req_data['_REG_ID'] : 0; |
|
174 | + $att_id = ! empty($this->_req_data['ATT_ID']) && ! is_array($this->_req_data['ATT_ID']) ? $this->_req_data['ATT_ID'] : 0; |
|
175 | + $att_id = ! empty($this->_req_data['post']) && ! is_array($this->_req_data['post']) ? $this->_req_data['post'] : $att_id; |
|
176 | 176 | |
177 | 177 | $this->_page_routes = array( |
178 | 178 | |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | |
206 | 206 | 'restore_registrations' => array( |
207 | 207 | 'func' => '_trash_or_restore_registrations', |
208 | - 'args' => array( 'trash' => FALSE ), |
|
208 | + 'args' => array('trash' => FALSE), |
|
209 | 209 | 'noheader' => TRUE, |
210 | 210 | 'capability' => 'ee_delete_registrations' |
211 | 211 | ), |
@@ -438,7 +438,7 @@ discard block |
||
438 | 438 | 'filename' => 'registrations_overview_other' |
439 | 439 | ) |
440 | 440 | ), |
441 | - 'help_tour' => array( 'Registration_Overview_Help_Tour' ), |
|
441 | + 'help_tour' => array('Registration_Overview_Help_Tour'), |
|
442 | 442 | 'qtips' => array('Registration_List_Table_Tips'), |
443 | 443 | 'list_table' => 'EE_Registrations_List_Table', |
444 | 444 | 'require_nonce' => FALSE |
@@ -448,7 +448,7 @@ discard block |
||
448 | 448 | 'nav' => array( |
449 | 449 | 'label' => __('REG Details', 'event_espresso'), |
450 | 450 | 'order' => 15, |
451 | - 'url' => isset($this->_req_data['_REG_ID']) ? add_query_arg(array('_REG_ID' => $this->_req_data['_REG_ID'] ), $this->_current_page_view_url ) : $this->_admin_base_url, |
|
451 | + 'url' => isset($this->_req_data['_REG_ID']) ? add_query_arg(array('_REG_ID' => $this->_req_data['_REG_ID']), $this->_current_page_view_url) : $this->_admin_base_url, |
|
452 | 452 | 'persistent' => FALSE |
453 | 453 | ), |
454 | 454 | 'help_tabs' => array( |
@@ -469,8 +469,8 @@ discard block |
||
469 | 469 | 'filename' => 'registrations_details_registrant_details' |
470 | 470 | ) |
471 | 471 | ), |
472 | - 'help_tour' => array( 'Registration_Details_Help_Tour' ), |
|
473 | - 'metaboxes' => array_merge( $this->_default_espresso_metaboxes, array( '_registration_details_metaboxes' ) ), |
|
472 | + 'help_tour' => array('Registration_Details_Help_Tour'), |
|
473 | + 'metaboxes' => array_merge($this->_default_espresso_metaboxes, array('_registration_details_metaboxes')), |
|
474 | 474 | 'require_nonce' => FALSE |
475 | 475 | ), |
476 | 476 | |
@@ -494,7 +494,7 @@ discard block |
||
494 | 494 | 'order' => 15, |
495 | 495 | 'persistent' => FALSE |
496 | 496 | ), |
497 | - 'metaboxes' => array_merge( $this->_default_espresso_metaboxes, array('_publish_post_box', 'attendee_editor_metaboxes' ) ), |
|
497 | + 'metaboxes' => array_merge($this->_default_espresso_metaboxes, array('_publish_post_box', 'attendee_editor_metaboxes')), |
|
498 | 498 | 'require_nonce' => FALSE |
499 | 499 | ), |
500 | 500 | |
@@ -503,7 +503,7 @@ discard block |
||
503 | 503 | 'label' => __('Edit Contact', 'event_espresso'), |
504 | 504 | 'order' => 15, |
505 | 505 | 'persistent' => FALSE, |
506 | - 'url' => isset($this->_req_data['ATT_ID']) ? add_query_arg(array('ATT_ID' => $this->_req_data['ATT_ID'] ), $this->_current_page_view_url ) : $this->_admin_base_url |
|
506 | + 'url' => isset($this->_req_data['ATT_ID']) ? add_query_arg(array('ATT_ID' => $this->_req_data['ATT_ID']), $this->_current_page_view_url) : $this->_admin_base_url |
|
507 | 507 | ), |
508 | 508 | 'metaboxes' => array('attendee_editor_metaboxes'), |
509 | 509 | 'require_nonce' => FALSE |
@@ -533,7 +533,7 @@ discard block |
||
533 | 533 | 'filename' => 'registrations_contact_list_other' |
534 | 534 | ) |
535 | 535 | ), |
536 | - 'help_tour' => array( 'Contact_List_Help_Tour' ), |
|
536 | + 'help_tour' => array('Contact_List_Help_Tour'), |
|
537 | 537 | 'metaboxes' => array(), |
538 | 538 | 'require_nonce' => FALSE |
539 | 539 | ), |
@@ -552,7 +552,7 @@ discard block |
||
552 | 552 | protected function _add_screen_options() {} |
553 | 553 | protected function _add_feature_pointers() {} |
554 | 554 | public function admin_init() { |
555 | - EE_Registry::$i18n_js_strings[ 'update_att_qstns' ] = __( 'click "Update Registration Questions" to save your changes', 'event_espresso' ); |
|
555 | + EE_Registry::$i18n_js_strings['update_att_qstns'] = __('click "Update Registration Questions" to save your changes', 'event_espresso'); |
|
556 | 556 | } |
557 | 557 | public function admin_notices() {} |
558 | 558 | public function admin_footer_scripts() {} |
@@ -570,7 +570,7 @@ discard block |
||
570 | 570 | * @return void |
571 | 571 | */ |
572 | 572 | private function _get_registration_status_array() { |
573 | - self::$_reg_status = EEM_Registration::reg_status_array( array(), TRUE); |
|
573 | + self::$_reg_status = EEM_Registration::reg_status_array(array(), TRUE); |
|
574 | 574 | } |
575 | 575 | |
576 | 576 | |
@@ -593,11 +593,11 @@ discard block |
||
593 | 593 | public function load_scripts_styles() { |
594 | 594 | //style |
595 | 595 | //wp_register_style('espresso_attendees', ATT_ASSETS_URL . 'espresso_attendees_admin.css', array(), EVENT_ESPRESSO_VERSION ); |
596 | - wp_register_style('espresso_reg', REG_ASSETS_URL . 'espresso_registrations_admin.css', array('ee-admin-css'), EVENT_ESPRESSO_VERSION ); |
|
596 | + wp_register_style('espresso_reg', REG_ASSETS_URL.'espresso_registrations_admin.css', array('ee-admin-css'), EVENT_ESPRESSO_VERSION); |
|
597 | 597 | wp_enqueue_style('espresso_reg'); |
598 | 598 | |
599 | 599 | //script |
600 | - wp_register_script('espresso_reg', REG_ASSETS_URL . 'espresso_registrations_admin.js', array('jquery-ui-datepicker', 'jquery-ui-draggable', 'ee_admin_js'), EVENT_ESPRESSO_VERSION, TRUE); |
|
600 | + wp_register_script('espresso_reg', REG_ASSETS_URL.'espresso_registrations_admin.js', array('jquery-ui-datepicker', 'jquery-ui-draggable', 'ee_admin_js'), EVENT_ESPRESSO_VERSION, TRUE); |
|
601 | 601 | wp_enqueue_script('espresso_reg'); |
602 | 602 | } |
603 | 603 | |
@@ -606,9 +606,9 @@ discard block |
||
606 | 606 | public function load_scripts_styles_edit_attendee() { |
607 | 607 | //stuff to only show up on our attendee edit details page. |
608 | 608 | $attendee_details_translations = array( |
609 | - 'att_publish_text' => sprintf( __('Created on: <b>%1$s</b>', 'event_espresso'), $this->_cpt_model_obj->get_datetime('ATT_created') ) |
|
609 | + 'att_publish_text' => sprintf(__('Created on: <b>%1$s</b>', 'event_espresso'), $this->_cpt_model_obj->get_datetime('ATT_created')) |
|
610 | 610 | ); |
611 | - wp_localize_script( 'espresso_reg', 'ATTENDEE_DETAILS', $attendee_details_translations ); |
|
611 | + wp_localize_script('espresso_reg', 'ATTENDEE_DETAILS', $attendee_details_translations); |
|
612 | 612 | wp_enqueue_script('jquery-validate'); |
613 | 613 | } |
614 | 614 | |
@@ -617,8 +617,8 @@ discard block |
||
617 | 617 | //styles |
618 | 618 | wp_enqueue_style('espresso-ui-theme'); |
619 | 619 | //scripts |
620 | - $this->_get_reg_custom_questions_form( $this->_registration->ID() ); |
|
621 | - $this->_reg_custom_questions_form->wp_enqueue_scripts( true ); |
|
620 | + $this->_get_reg_custom_questions_form($this->_registration->ID()); |
|
621 | + $this->_reg_custom_questions_form->wp_enqueue_scripts(true); |
|
622 | 622 | } |
623 | 623 | |
624 | 624 | |
@@ -628,7 +628,7 @@ discard block |
||
628 | 628 | |
629 | 629 | public function load_scripts_styles_contact_list() { |
630 | 630 | wp_deregister_style('espresso_reg'); |
631 | - wp_register_style('espresso_att', REG_ASSETS_URL . 'espresso_attendees_admin.css', array('ee-admin-css'), EVENT_ESPRESSO_VERSION ); |
|
631 | + wp_register_style('espresso_att', REG_ASSETS_URL.'espresso_attendees_admin.css', array('ee-admin-css'), EVENT_ESPRESSO_VERSION); |
|
632 | 632 | wp_enqueue_style('espresso_att'); |
633 | 633 | } |
634 | 634 | |
@@ -637,9 +637,9 @@ discard block |
||
637 | 637 | |
638 | 638 | |
639 | 639 | public function load_scripts_styles_new_registration() { |
640 | - wp_register_script( 'ee-spco-for-admin', REG_ASSETS_URL . 'spco_for_admin.js', array('underscore', 'jquery'), EVENT_ESPRESSO_VERSION, TRUE ); |
|
640 | + wp_register_script('ee-spco-for-admin', REG_ASSETS_URL.'spco_for_admin.js', array('underscore', 'jquery'), EVENT_ESPRESSO_VERSION, TRUE); |
|
641 | 641 | wp_enqueue_script('ee-spco-for-admin'); |
642 | - add_filter('FHEE__EED_Ticket_Selector__load_tckt_slctr_assets', '__return_true' ); |
|
642 | + add_filter('FHEE__EED_Ticket_Selector__load_tckt_slctr_assets', '__return_true'); |
|
643 | 643 | EE_Form_Section_Proper::wp_enqueue_scripts(); |
644 | 644 | EED_Ticket_Selector::load_tckt_slctr_assets(); |
645 | 645 | EE_Datepicker_Input::enqueue_styles_and_scripts(); |
@@ -666,7 +666,7 @@ discard block |
||
666 | 666 | //for notification related bulk actions we need to make sure only active messengers have an option. |
667 | 667 | EED_Messages::set_autoloaders(); |
668 | 668 | /** @type EE_Message_Resource_Manager $message_resource_manager */ |
669 | - $message_resource_manager = EE_Registry::instance()->load_lib( 'Message_Resource_Manager' ); |
|
669 | + $message_resource_manager = EE_Registry::instance()->load_lib('Message_Resource_Manager'); |
|
670 | 670 | $active_mts = $message_resource_manager->list_of_active_message_types(); |
671 | 671 | //key= bulk_action_slug, value= message type. |
672 | 672 | $match_array = array( |
@@ -679,23 +679,23 @@ discard block |
||
679 | 679 | |
680 | 680 | /** setup reg status bulk actions **/ |
681 | 681 | $def_reg_status_actions['approve_registration'] = __('Approve Registrations', 'event_espresso'); |
682 | - if ( in_array( $match_array['approve_registration'], $active_mts ) && EE_Registry::instance()->CAP->current_user_can( 'ee_send_message', 'batch_send_messages' ) ) { |
|
682 | + if (in_array($match_array['approve_registration'], $active_mts) && EE_Registry::instance()->CAP->current_user_can('ee_send_message', 'batch_send_messages')) { |
|
683 | 683 | $def_reg_status_actions['approve_and_notify_registration'] = __('Approve and Notify Registrations', 'event_espresso'); |
684 | 684 | } |
685 | 685 | $def_reg_status_actions['decline_registration'] = __('Decline Registrations', 'event_espresso'); |
686 | - if ( in_array( $match_array['decline_registration'], $active_mts ) && EE_Registry::instance()->CAP->current_user_can( 'ee_send_message', 'batch_send_messages' ) ) { |
|
686 | + if (in_array($match_array['decline_registration'], $active_mts) && EE_Registry::instance()->CAP->current_user_can('ee_send_message', 'batch_send_messages')) { |
|
687 | 687 | $def_reg_status_actions['decline_and_notify_registration'] = __('Decline and Notify Registrations', 'event_espresso'); |
688 | 688 | } |
689 | 689 | $def_reg_status_actions['pending_registration'] = __('Set Registrations to Pending Payment', 'event_espresso'); |
690 | - if ( in_array( $match_array['pending_registration'], $active_mts ) && EE_Registry::instance()->CAP->current_user_can( 'ee_send_message', 'batch_send_messages' ) ) { |
|
690 | + if (in_array($match_array['pending_registration'], $active_mts) && EE_Registry::instance()->CAP->current_user_can('ee_send_message', 'batch_send_messages')) { |
|
691 | 691 | $def_reg_status_actions['pending_and_notify_registration'] = __('Set Registrations to Pending Payment and Notify', 'event_espresso'); |
692 | 692 | } |
693 | 693 | $def_reg_status_actions['no_approve_registration'] = __('Set Registrations to Not Approved', 'event_espresso'); |
694 | - if ( in_array( $match_array['no_approve_registration'], $active_mts ) && EE_Registry::instance()->CAP->current_user_can( 'ee_send_message', 'batch_send_messages' ) ) { |
|
694 | + if (in_array($match_array['no_approve_registration'], $active_mts) && EE_Registry::instance()->CAP->current_user_can('ee_send_message', 'batch_send_messages')) { |
|
695 | 695 | $def_reg_status_actions['no_approve_and_notify_registration'] = __('Set Registrations to Not Approved and Notify', 'event_espresso'); |
696 | 696 | } |
697 | 697 | $def_reg_status_actions['cancel_registration'] = __('Cancel Registrations', 'event_espresso'); |
698 | - if ( in_array( $match_array['cancel_registration'], $active_mts ) && EE_Registry::instance()->CAP->current_user_can( 'ee_send_message', 'batch_send_messages' ) ) { |
|
698 | + if (in_array($match_array['cancel_registration'], $active_mts) && EE_Registry::instance()->CAP->current_user_can('ee_send_message', 'batch_send_messages')) { |
|
699 | 699 | $def_reg_status_actions['cancel_and_notify_registration'] = __('Cancel Registrations and Notify', 'event_espresso'); |
700 | 700 | } |
701 | 701 | |
@@ -704,29 +704,29 @@ discard block |
||
704 | 704 | 'slug' => 'all', |
705 | 705 | 'label' => __('View All Registrations', 'event_espresso'), |
706 | 706 | 'count' => 0, |
707 | - 'bulk_action' => array_merge( $def_reg_status_actions, array( |
|
707 | + 'bulk_action' => array_merge($def_reg_status_actions, array( |
|
708 | 708 | 'trash_registrations' => __('Trash Registrations', 'event_espresso') |
709 | - ) ) |
|
709 | + )) |
|
710 | 710 | ), |
711 | 711 | 'month' => array( |
712 | 712 | 'slug' => 'month', |
713 | 713 | 'label' => __('This Month', 'event_espresso'), |
714 | 714 | 'count' => 0, |
715 | - 'bulk_action' => array_merge( $def_reg_status_actions, array( |
|
715 | + 'bulk_action' => array_merge($def_reg_status_actions, array( |
|
716 | 716 | 'trash_registrations' => __('Trash Registrations', 'event_espresso') |
717 | 717 | )) |
718 | 718 | ), |
719 | 719 | 'today' => array( |
720 | 720 | 'slug' => 'today', |
721 | - 'label' => sprintf( __('Today - %s', 'event_espresso'), date('M d, Y', current_time('timestamp' ) ) ), |
|
721 | + 'label' => sprintf(__('Today - %s', 'event_espresso'), date('M d, Y', current_time('timestamp'))), |
|
722 | 722 | 'count' => 0, |
723 | - 'bulk_action' => array_merge( $def_reg_status_actions, array( |
|
723 | + 'bulk_action' => array_merge($def_reg_status_actions, array( |
|
724 | 724 | 'trash_registrations' => __('Trash Registrations', 'event_espresso') |
725 | 725 | )) |
726 | 726 | ) |
727 | 727 | ); |
728 | 728 | |
729 | - if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_registrations', 'espresso_registrations_delete_registration' ) ) { |
|
729 | + if (EE_Registry::instance()->CAP->current_user_can('ee_delete_registrations', 'espresso_registrations_delete_registration')) { |
|
730 | 730 | $this->_views['incomplete'] = array( |
731 | 731 | 'slug' => 'incomplete', |
732 | 732 | 'label' => __('Incomplete', 'event_espresso'), |
@@ -762,7 +762,7 @@ discard block |
||
762 | 762 | ) |
763 | 763 | ); |
764 | 764 | |
765 | - if ( EE_Registry::instance()->CAP->current_user_can( 'ee_delete_contacts', 'espresso_registrations_trash_attendees' ) ) { |
|
765 | + if (EE_Registry::instance()->CAP->current_user_can('ee_delete_contacts', 'espresso_registrations_trash_attendees')) { |
|
766 | 766 | $this->_views['trash'] = array( |
767 | 767 | 'slug' => 'trash', |
768 | 768 | 'label' => __('Trash', 'event_espresso'), |
@@ -801,18 +801,18 @@ discard block |
||
801 | 801 | 'desc' => __('View Transaction Invoice', 'event_espresso') |
802 | 802 | ), |
803 | 803 | ); |
804 | - if ( EE_Registry::instance()->CAP->current_user_can( 'ee_send_message', 'espresso_registrations_resend_registration' ) ) { |
|
804 | + if (EE_Registry::instance()->CAP->current_user_can('ee_send_message', 'espresso_registrations_resend_registration')) { |
|
805 | 805 | $fc_items['resend_registration'] = array( |
806 | 806 | 'class' => 'dashicons dashicons-email-alt', |
807 | 807 | 'desc' => __('Resend Registration Details', 'event_espresso') |
808 | 808 | ); |
809 | 809 | } else { |
810 | - $fc_items['blank'] = array( 'class' => 'blank', 'desc' => '' ); |
|
810 | + $fc_items['blank'] = array('class' => 'blank', 'desc' => ''); |
|
811 | 811 | } |
812 | 812 | |
813 | - if ( EE_Registry::instance()->CAP->current_user_can( 'ee_read_global_messages', 'view_filtered_messages' ) ) { |
|
814 | - $related_for_icon = EEH_MSG_Template::get_message_action_icon( 'see_notifications_for' ); |
|
815 | - if ( isset( $related_for_icon['css_class']) && isset( $related_for_icon['label'] ) ) { |
|
813 | + if (EE_Registry::instance()->CAP->current_user_can('ee_read_global_messages', 'view_filtered_messages')) { |
|
814 | + $related_for_icon = EEH_MSG_Template::get_message_action_icon('see_notifications_for'); |
|
815 | + if (isset($related_for_icon['css_class']) && isset($related_for_icon['label'])) { |
|
816 | 816 | $fc_items['view_related_messages'] = array( |
817 | 817 | 'class' => $related_for_icon['css_class'], |
818 | 818 | 'desc' => $related_for_icon['label'], |
@@ -822,31 +822,31 @@ discard block |
||
822 | 822 | |
823 | 823 | $sc_items = array( |
824 | 824 | 'approved_status' => array( |
825 | - 'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_approved, |
|
826 | - 'desc' => EEH_Template::pretty_status( EEM_Registration::status_id_approved, FALSE, 'sentence' ) |
|
825 | + 'class' => 'ee-status-legend ee-status-legend-'.EEM_Registration::status_id_approved, |
|
826 | + 'desc' => EEH_Template::pretty_status(EEM_Registration::status_id_approved, FALSE, 'sentence') |
|
827 | 827 | ), |
828 | 828 | 'pending_status' => array( |
829 | - 'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_pending_payment, |
|
830 | - 'desc' => EEH_Template::pretty_status( EEM_Registration::status_id_pending_payment, FALSE, 'sentence' ) |
|
829 | + 'class' => 'ee-status-legend ee-status-legend-'.EEM_Registration::status_id_pending_payment, |
|
830 | + 'desc' => EEH_Template::pretty_status(EEM_Registration::status_id_pending_payment, FALSE, 'sentence') |
|
831 | 831 | ), |
832 | 832 | 'incomplete_status' => array( |
833 | - 'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_incomplete, |
|
834 | - 'desc' => EEH_Template::pretty_status( EEM_Registration::status_id_incomplete, FALSE, 'sentence' ) |
|
833 | + 'class' => 'ee-status-legend ee-status-legend-'.EEM_Registration::status_id_incomplete, |
|
834 | + 'desc' => EEH_Template::pretty_status(EEM_Registration::status_id_incomplete, FALSE, 'sentence') |
|
835 | 835 | ), |
836 | 836 | 'not_approved' => array( |
837 | - 'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_not_approved, |
|
838 | - 'desc' => EEH_Template::pretty_status( EEM_Registration::status_id_not_approved, FALSE, 'sentence' ) |
|
837 | + 'class' => 'ee-status-legend ee-status-legend-'.EEM_Registration::status_id_not_approved, |
|
838 | + 'desc' => EEH_Template::pretty_status(EEM_Registration::status_id_not_approved, FALSE, 'sentence') |
|
839 | 839 | ), |
840 | 840 | 'declined_status' => array( |
841 | - 'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_declined, |
|
842 | - 'desc' => EEH_Template::pretty_status( EEM_Registration::status_id_declined, FALSE, 'sentence' ) |
|
841 | + 'class' => 'ee-status-legend ee-status-legend-'.EEM_Registration::status_id_declined, |
|
842 | + 'desc' => EEH_Template::pretty_status(EEM_Registration::status_id_declined, FALSE, 'sentence') |
|
843 | 843 | ), |
844 | 844 | 'cancelled_status' => array( |
845 | - 'class' => 'ee-status-legend ee-status-legend-' . EEM_Registration::status_id_cancelled, |
|
846 | - 'desc' => EEH_Template::pretty_status( EEM_Registration::status_id_cancelled, FALSE, 'sentence' ) |
|
845 | + 'class' => 'ee-status-legend ee-status-legend-'.EEM_Registration::status_id_cancelled, |
|
846 | + 'desc' => EEH_Template::pretty_status(EEM_Registration::status_id_cancelled, FALSE, 'sentence') |
|
847 | 847 | ) |
848 | 848 | ); |
849 | - return array_merge( $fc_items, $sc_items ); |
|
849 | + return array_merge($fc_items, $sc_items); |
|
850 | 850 | } |
851 | 851 | |
852 | 852 | |
@@ -859,15 +859,15 @@ discard block |
||
859 | 859 | |
860 | 860 | |
861 | 861 | protected function _registrations_overview_list_table() { |
862 | - $EVT_ID = ( ! empty( $this->_req_data['event_id'] )) ? absint( $this->_req_data['event_id'] ) : FALSE; |
|
863 | - if ( $EVT_ID ) { |
|
864 | - if ( EE_Registry::instance()->CAP->current_user_can( 'ee_edit_registrations', 'espresso_registrations_new_registration', $EVT_ID ) ) { |
|
865 | - $this->_admin_page_title .= $this->get_action_link_or_button( 'new_registration', 'add-registrant', array( 'event_id' => $EVT_ID ), 'add-new-h2' ); |
|
862 | + $EVT_ID = ( ! empty($this->_req_data['event_id'])) ? absint($this->_req_data['event_id']) : FALSE; |
|
863 | + if ($EVT_ID) { |
|
864 | + if (EE_Registry::instance()->CAP->current_user_can('ee_edit_registrations', 'espresso_registrations_new_registration', $EVT_ID)) { |
|
865 | + $this->_admin_page_title .= $this->get_action_link_or_button('new_registration', 'add-registrant', array('event_id' => $EVT_ID), 'add-new-h2'); |
|
866 | 866 | } |
867 | - $event = EEM_Event::instance()->get_one_by_ID( $EVT_ID ); |
|
868 | - $this->_template_args['admin_page_header'] = $event instanceof EE_Event ? sprintf( __('%s Viewing registrations for the event: %s%s', 'event_espresso'), '<h2>', '<a href="' . EE_Admin_Page::add_query_args_and_nonce( array('action' => 'edit', 'post' => $event->ID() ), EVENTS_ADMIN_URL ) . '">' . $event->get('EVT_name') . '</a>', '</h2>' ) : ''; |
|
867 | + $event = EEM_Event::instance()->get_one_by_ID($EVT_ID); |
|
868 | + $this->_template_args['admin_page_header'] = $event instanceof EE_Event ? sprintf(__('%s Viewing registrations for the event: %s%s', 'event_espresso'), '<h2>', '<a href="'.EE_Admin_Page::add_query_args_and_nonce(array('action' => 'edit', 'post' => $event->ID()), EVENTS_ADMIN_URL).'">'.$event->get('EVT_name').'</a>', '</h2>') : ''; |
|
869 | 869 | } |
870 | - $this->_template_args['after_list_table'] = $this->_display_legend( $this->_registration_legend_items() ); |
|
870 | + $this->_template_args['after_list_table'] = $this->_display_legend($this->_registration_legend_items()); |
|
871 | 871 | $this->display_admin_list_table_page_with_no_sidebar(); |
872 | 872 | } |
873 | 873 | |
@@ -882,19 +882,19 @@ discard block |
||
882 | 882 | */ |
883 | 883 | private function _set_registration_object() { |
884 | 884 | //get out if we've already set the object |
885 | - if ( is_object( $this->_registration )) { |
|
885 | + if (is_object($this->_registration)) { |
|
886 | 886 | return TRUE; |
887 | 887 | } |
888 | 888 | |
889 | 889 | $REG = EEM_Registration::instance(); |
890 | 890 | |
891 | - $REG_ID = ( ! empty( $this->_req_data['_REG_ID'] )) ? absint( $this->_req_data['_REG_ID'] ) : FALSE; |
|
891 | + $REG_ID = ( ! empty($this->_req_data['_REG_ID'])) ? absint($this->_req_data['_REG_ID']) : FALSE; |
|
892 | 892 | |
893 | - if ( $this->_registration = $REG->get_one_by_ID( $REG_ID )) |
|
893 | + if ($this->_registration = $REG->get_one_by_ID($REG_ID)) |
|
894 | 894 | return TRUE; |
895 | 895 | else { |
896 | - $error_msg = sprintf( __('An error occurred and the details for Registration ID #%s could not be retrieved.', 'event_espresso'), $REG_ID ); |
|
897 | - EE_Error::add_error( $error_msg, __FILE__, __FUNCTION__, __LINE__ ); |
|
896 | + $error_msg = sprintf(__('An error occurred and the details for Registration ID #%s could not be retrieved.', 'event_espresso'), $REG_ID); |
|
897 | + EE_Error::add_error($error_msg, __FILE__, __FUNCTION__, __LINE__); |
|
898 | 898 | $this->_registration = NULL; |
899 | 899 | return FALSE; |
900 | 900 | } |
@@ -912,24 +912,24 @@ discard block |
||
912 | 912 | * @throws \EE_Error |
913 | 913 | * @return mixed (int|array) int = count || array of registration objects |
914 | 914 | */ |
915 | - public function get_registrations( $per_page = 10, $count = FALSE, $this_month = FALSE, $today = FALSE ) { |
|
916 | - $EVT_ID = ! empty( $this->_req_data['event_id'] ) && $this->_req_data['event_id'] > 0 ? absint( $this->_req_data['event_id'] ) : FALSE; |
|
917 | - $CAT_ID = ! empty( $this->_req_data['EVT_CAT'] ) && (int) $this->_req_data['EVT_CAT'] > 0? absint( $this->_req_data['EVT_CAT'] ) : FALSE; |
|
918 | - $reg_status = ! empty( $this->_req_data['_reg_status'] ) ? sanitize_text_field( $this->_req_data['_reg_status'] ) : FALSE; |
|
919 | - $month_range = ! empty( $this->_req_data['month_range'] ) ? sanitize_text_field( $this->_req_data['month_range'] ) : FALSE;//should be like 2013-april |
|
920 | - $today_a = ! empty( $this->_req_data['status'] ) && $this->_req_data['status'] === 'today' ? TRUE : FALSE; |
|
921 | - $this_month_a = ! empty( $this->_req_data['status'] ) && $this->_req_data['status'] === 'month' ? TRUE : FALSE; |
|
915 | + public function get_registrations($per_page = 10, $count = FALSE, $this_month = FALSE, $today = FALSE) { |
|
916 | + $EVT_ID = ! empty($this->_req_data['event_id']) && $this->_req_data['event_id'] > 0 ? absint($this->_req_data['event_id']) : FALSE; |
|
917 | + $CAT_ID = ! empty($this->_req_data['EVT_CAT']) && (int) $this->_req_data['EVT_CAT'] > 0 ? absint($this->_req_data['EVT_CAT']) : FALSE; |
|
918 | + $reg_status = ! empty($this->_req_data['_reg_status']) ? sanitize_text_field($this->_req_data['_reg_status']) : FALSE; |
|
919 | + $month_range = ! empty($this->_req_data['month_range']) ? sanitize_text_field($this->_req_data['month_range']) : FALSE; //should be like 2013-april |
|
920 | + $today_a = ! empty($this->_req_data['status']) && $this->_req_data['status'] === 'today' ? TRUE : FALSE; |
|
921 | + $this_month_a = ! empty($this->_req_data['status']) && $this->_req_data['status'] === 'month' ? TRUE : FALSE; |
|
922 | 922 | $start_date = FALSE; |
923 | 923 | $end_date = FALSE; |
924 | 924 | $_where = array(); |
925 | - $trash = ! empty( $this->_req_data['status'] ) && $this->_req_data['status'] === 'trash' ? TRUE : FALSE; |
|
926 | - $incomplete = ! empty( $this->_req_data['status'] ) && $this->_req_data['status'] === 'incomplete' ? TRUE : FALSE; |
|
925 | + $trash = ! empty($this->_req_data['status']) && $this->_req_data['status'] === 'trash' ? TRUE : FALSE; |
|
926 | + $incomplete = ! empty($this->_req_data['status']) && $this->_req_data['status'] === 'incomplete' ? TRUE : FALSE; |
|
927 | 927 | |
928 | 928 | //set orderby |
929 | 929 | $this->_req_data['orderby'] = ! empty($this->_req_data['orderby']) ? $this->_req_data['orderby'] : ''; |
930 | 930 | |
931 | 931 | |
932 | - switch ( $this->_req_data['orderby'] ) { |
|
932 | + switch ($this->_req_data['orderby']) { |
|
933 | 933 | case '_REG_ID': |
934 | 934 | $orderby = 'REG_ID'; |
935 | 935 | break; |
@@ -949,26 +949,26 @@ discard block |
||
949 | 949 | $orderby = 'REG_date'; |
950 | 950 | } |
951 | 951 | |
952 | - $sort = ( isset( $this->_req_data['order'] ) && ! empty( $this->_req_data['order'] )) ? $this->_req_data['order'] : 'DESC'; |
|
953 | - $current_page = isset( $this->_req_data['paged'] ) && !empty( $this->_req_data['paged'] ) ? $this->_req_data['paged'] : 1; |
|
954 | - $per_page = isset( $this->_req_data['perpage'] ) && !empty( $this->_req_data['perpage'] ) ? $this->_req_data['perpage'] : $per_page; |
|
952 | + $sort = (isset($this->_req_data['order']) && ! empty($this->_req_data['order'])) ? $this->_req_data['order'] : 'DESC'; |
|
953 | + $current_page = isset($this->_req_data['paged']) && ! empty($this->_req_data['paged']) ? $this->_req_data['paged'] : 1; |
|
954 | + $per_page = isset($this->_req_data['perpage']) && ! empty($this->_req_data['perpage']) ? $this->_req_data['perpage'] : $per_page; |
|
955 | 955 | |
956 | 956 | |
957 | - $offset = ($current_page-1)*$per_page; |
|
958 | - $limit = $count ? NULL : array( $offset, $per_page ); |
|
957 | + $offset = ($current_page - 1) * $per_page; |
|
958 | + $limit = $count ? NULL : array($offset, $per_page); |
|
959 | 959 | |
960 | - if($EVT_ID){ |
|
961 | - $_where['EVT_ID']=$EVT_ID; |
|
960 | + if ($EVT_ID) { |
|
961 | + $_where['EVT_ID'] = $EVT_ID; |
|
962 | 962 | } |
963 | - if($CAT_ID){ |
|
963 | + if ($CAT_ID) { |
|
964 | 964 | $_where['Event.Term_Taxonomy.term_id'] = $CAT_ID; |
965 | 965 | } |
966 | - if ( $incomplete ) { |
|
966 | + if ($incomplete) { |
|
967 | 967 | $_where['STS_ID'] = EEM_Registration::status_id_incomplete; |
968 | 968 | } else if ( ! $trash) { |
969 | - $_where['STS_ID'] = array( '!=', EEM_Registration::status_id_incomplete ); |
|
969 | + $_where['STS_ID'] = array('!=', EEM_Registration::status_id_incomplete); |
|
970 | 970 | } |
971 | - if($reg_status){ |
|
971 | + if ($reg_status) { |
|
972 | 972 | $_where['STS_ID'] = $reg_status; |
973 | 973 | } |
974 | 974 | |
@@ -980,105 +980,105 @@ discard block |
||
980 | 980 | $time_start = ' 00:00:00'; |
981 | 981 | $time_end = ' 23:59:59'; |
982 | 982 | |
983 | - if($today_a || $today ){ |
|
983 | + if ($today_a || $today) { |
|
984 | 984 | $curdate = date('Y-m-d', current_time('timestamp')); |
985 | - $_where['REG_date']= array('BETWEEN', |
|
985 | + $_where['REG_date'] = array('BETWEEN', |
|
986 | 986 | array( |
987 | - EEM_Registration::instance()->convert_datetime_for_query( 'REG_date', $curdate . $time_start, 'Y-m-d H:i:s' ), |
|
988 | - EEM_Registration::instance()->convert_datetime_for_query( 'REG_date', $curdate . $time_end, 'Y-m-d H:i:s' ), |
|
987 | + EEM_Registration::instance()->convert_datetime_for_query('REG_date', $curdate.$time_start, 'Y-m-d H:i:s'), |
|
988 | + EEM_Registration::instance()->convert_datetime_for_query('REG_date', $curdate.$time_end, 'Y-m-d H:i:s'), |
|
989 | 989 | )); |
990 | - }elseif($this_month_a || $this_month){ |
|
990 | + }elseif ($this_month_a || $this_month) { |
|
991 | 991 | $this_month_r = date('m', current_time('timestamp')); |
992 | - $days_this_month = date( 't', current_time('timestamp') ); |
|
993 | - $_where['REG_date']= array('BETWEEN', |
|
992 | + $days_this_month = date('t', current_time('timestamp')); |
|
993 | + $_where['REG_date'] = array('BETWEEN', |
|
994 | 994 | array( |
995 | - EEM_Registration::instance()->convert_datetime_for_query( 'REG_date', $this_year_r . '-' . $this_month_r . '-01' . ' ' . $time_start, 'Y-m-d H:i:s' ), |
|
996 | - EEM_Registration::instance()->convert_datetime_for_query( 'REG_date', $this_year_r . '-' . $this_month_r . '-' . $days_this_month . ' ' . $time_end, 'Y-m-d H:i:s' ) |
|
995 | + EEM_Registration::instance()->convert_datetime_for_query('REG_date', $this_year_r.'-'.$this_month_r.'-01'.' '.$time_start, 'Y-m-d H:i:s'), |
|
996 | + EEM_Registration::instance()->convert_datetime_for_query('REG_date', $this_year_r.'-'.$this_month_r.'-'.$days_this_month.' '.$time_end, 'Y-m-d H:i:s') |
|
997 | 997 | )); |
998 | - }elseif($month_range){ |
|
998 | + }elseif ($month_range) { |
|
999 | 999 | $pieces = explode(' ', $this->_req_data['month_range'], 3); |
1000 | - $month_r = !empty($pieces[0]) ? date('m', strtotime( $month_range ) ) : ''; |
|
1001 | - $year_r = !empty($pieces[1]) ? $pieces[1] : ''; |
|
1002 | - $days_in_month = date('t', strtotime($year_r . '-' . $month_r . '-' . '01') ); |
|
1003 | - $_where['REG_date']= array('BETWEEN', |
|
1004 | - array( EEM_Registration::instance()->convert_datetime_for_query( 'REG_date', $year_r . '-' . $month_r . '-01 00:00:00', 'Y-m-d H:i:s'), EEM_Registration::instance()->convert_datetime_for_query( 'REG_date', $year_r . '-' . $month_r . '-' . $days_in_month . ' 23:59:59', 'Y-m-d H:i:s' ) ) ); |
|
1005 | - }elseif($start_date && $end_date){ |
|
1000 | + $month_r = ! empty($pieces[0]) ? date('m', strtotime($month_range)) : ''; |
|
1001 | + $year_r = ! empty($pieces[1]) ? $pieces[1] : ''; |
|
1002 | + $days_in_month = date('t', strtotime($year_r.'-'.$month_r.'-'.'01')); |
|
1003 | + $_where['REG_date'] = array('BETWEEN', |
|
1004 | + array(EEM_Registration::instance()->convert_datetime_for_query('REG_date', $year_r.'-'.$month_r.'-01 00:00:00', 'Y-m-d H:i:s'), EEM_Registration::instance()->convert_datetime_for_query('REG_date', $year_r.'-'.$month_r.'-'.$days_in_month.' 23:59:59', 'Y-m-d H:i:s'))); |
|
1005 | + }elseif ($start_date && $end_date) { |
|
1006 | 1006 | throw new EE_Error("not yet supported"); |
1007 | - }elseif($start_date){ |
|
1007 | + }elseif ($start_date) { |
|
1008 | 1008 | throw new EE_Error("not yet supported"); |
1009 | - }elseif($end_date){ |
|
1009 | + }elseif ($end_date) { |
|
1010 | 1010 | throw new EE_Error("not yet supported"); |
1011 | 1011 | } |
1012 | 1012 | |
1013 | - if ( ! empty( $this->_req_data['s'] ) ) { |
|
1014 | - $sstr = '%' . $this->_req_data['s'] . '%'; |
|
1013 | + if ( ! empty($this->_req_data['s'])) { |
|
1014 | + $sstr = '%'.$this->_req_data['s'].'%'; |
|
1015 | 1015 | $_where['OR'] = array( |
1016 | - 'Event.EVT_name' => array( 'LIKE', $sstr), |
|
1017 | - 'Event.EVT_desc' => array( 'LIKE', $sstr ), |
|
1018 | - 'Event.EVT_short_desc' => array( 'LIKE' , $sstr ), |
|
1019 | - 'Attendee.ATT_full_name' => array( 'LIKE', $sstr ), |
|
1020 | - 'Attendee.ATT_fname' => array( 'LIKE', $sstr ), |
|
1021 | - 'Attendee.ATT_lname' => array( 'LIKE', $sstr ), |
|
1022 | - 'Attendee.ATT_short_bio' => array( 'LIKE', $sstr ), |
|
1023 | - 'Attendee.ATT_email' => array('LIKE', $sstr ), |
|
1024 | - 'Attendee.ATT_address' => array( 'LIKE', $sstr ), |
|
1025 | - 'Attendee.ATT_address2' => array( 'LIKE', $sstr ), |
|
1026 | - 'Attendee.ATT_city' => array( 'LIKE', $sstr ), |
|
1027 | - 'REG_final_price' => array( 'LIKE', $sstr ), |
|
1028 | - 'REG_code' => array( 'LIKE', $sstr ), |
|
1029 | - 'REG_count' => array( 'LIKE' , $sstr ), |
|
1030 | - 'REG_group_size' => array( 'LIKE' , $sstr ), |
|
1031 | - 'Ticket.TKT_name' => array( 'LIKE', $sstr ), |
|
1032 | - 'Ticket.TKT_description' => array( 'LIKE', $sstr ), |
|
1033 | - 'Transaction.Payment.PAY_txn_id_chq_nmbr' => array( 'LIKE', $sstr ) |
|
1016 | + 'Event.EVT_name' => array('LIKE', $sstr), |
|
1017 | + 'Event.EVT_desc' => array('LIKE', $sstr), |
|
1018 | + 'Event.EVT_short_desc' => array('LIKE', $sstr), |
|
1019 | + 'Attendee.ATT_full_name' => array('LIKE', $sstr), |
|
1020 | + 'Attendee.ATT_fname' => array('LIKE', $sstr), |
|
1021 | + 'Attendee.ATT_lname' => array('LIKE', $sstr), |
|
1022 | + 'Attendee.ATT_short_bio' => array('LIKE', $sstr), |
|
1023 | + 'Attendee.ATT_email' => array('LIKE', $sstr), |
|
1024 | + 'Attendee.ATT_address' => array('LIKE', $sstr), |
|
1025 | + 'Attendee.ATT_address2' => array('LIKE', $sstr), |
|
1026 | + 'Attendee.ATT_city' => array('LIKE', $sstr), |
|
1027 | + 'REG_final_price' => array('LIKE', $sstr), |
|
1028 | + 'REG_code' => array('LIKE', $sstr), |
|
1029 | + 'REG_count' => array('LIKE', $sstr), |
|
1030 | + 'REG_group_size' => array('LIKE', $sstr), |
|
1031 | + 'Ticket.TKT_name' => array('LIKE', $sstr), |
|
1032 | + 'Ticket.TKT_description' => array('LIKE', $sstr), |
|
1033 | + 'Transaction.Payment.PAY_txn_id_chq_nmbr' => array('LIKE', $sstr) |
|
1034 | 1034 | ); |
1035 | 1035 | } |
1036 | 1036 | |
1037 | 1037 | //capability checks |
1038 | - if ( ! EE_Registry::instance()->CAP->current_user_can('ee_read_others_registrations', 'get_registrations' ) ) { |
|
1038 | + if ( ! EE_Registry::instance()->CAP->current_user_can('ee_read_others_registrations', 'get_registrations')) { |
|
1039 | 1039 | $_where['AND'] = array( |
1040 | 1040 | 'Event.EVT_wp_user' => get_current_user_id() |
1041 | 1041 | ); |
1042 | 1042 | } |
1043 | 1043 | |
1044 | 1044 | |
1045 | - if( $count ){ |
|
1046 | - if ( $trash ) { |
|
1047 | - return EEM_Registration::instance()->count_deleted( array( $_where )); |
|
1048 | - } else if ( $incomplete ) { |
|
1049 | - return EEM_Registration::instance()->count( array( $_where )); |
|
1045 | + if ($count) { |
|
1046 | + if ($trash) { |
|
1047 | + return EEM_Registration::instance()->count_deleted(array($_where)); |
|
1048 | + } else if ($incomplete) { |
|
1049 | + return EEM_Registration::instance()->count(array($_where)); |
|
1050 | 1050 | } else { |
1051 | - return EEM_Registration::instance()->count( array( $_where, 'default_where_conditions' => 'this_model_only' )); |
|
1051 | + return EEM_Registration::instance()->count(array($_where, 'default_where_conditions' => 'this_model_only')); |
|
1052 | 1052 | } |
1053 | 1053 | } else { |
1054 | 1054 | //make sure we remove default where conditions cause all registrations matching query are returned |
1055 | - $query_params = array( $_where, 'order_by' => array( $orderby => $sort ), 'default_where_conditions' => 'this_model_only' ); |
|
1056 | - if ( $per_page !== -1 ) { |
|
1055 | + $query_params = array($_where, 'order_by' => array($orderby => $sort), 'default_where_conditions' => 'this_model_only'); |
|
1056 | + if ($per_page !== -1) { |
|
1057 | 1057 | $query_params['limit'] = $limit; |
1058 | 1058 | } |
1059 | - $registrations = $trash ? EEM_Registration::instance()->get_all_deleted($query_params) : EEM_Registration::instance()->get_all($query_params); |
|
1059 | + $registrations = $trash ? EEM_Registration::instance()->get_all_deleted($query_params) : EEM_Registration::instance()->get_all($query_params); |
|
1060 | 1060 | |
1061 | 1061 | |
1062 | - if ( $EVT_ID && isset( $registrations[0] ) && $registrations[0] instanceof EE_Registration && $registrations[0]->event_obj()) { |
|
1062 | + if ($EVT_ID && isset($registrations[0]) && $registrations[0] instanceof EE_Registration && $registrations[0]->event_obj()) { |
|
1063 | 1063 | $first_registration = $registrations[0]; |
1064 | 1064 | //EEH_Debug_Tools::printr( $registrations[0], '$registrations <br /><span style="font-size:10px;font-weight:normal;">' . __FILE__ . '<br />line no: ' . __LINE__ . '</span>', 'auto' ); |
1065 | 1065 | $event_name = $first_registration->event_obj()->name(); |
1066 | - $event_date = $first_registration->date_obj()->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 ) : ''; |
|
1066 | + $event_date = $first_registration->date_obj()->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 ) : ''; |
|
1067 | 1067 | // edit event link |
1068 | - if ( $event_name != '' ) { |
|
1069 | - $edit_event_url = self::add_query_args_and_nonce( array( 'action'=>'edit_event', 'EVT_ID'=>$EVT_ID ), EVENTS_ADMIN_URL ); |
|
1070 | - $edit_event_lnk = '<a href="'.$edit_event_url.'" title="' . esc_attr__( 'Edit ', 'event_espresso' ) . $event_name . '">' . __( 'Edit Event', 'event_espresso' ) . '</a>'; |
|
1071 | - $event_name .= ' <span class="admin-page-header-edit-lnk not-bold">' . $edit_event_lnk . '</span>' ; |
|
1068 | + if ($event_name != '') { |
|
1069 | + $edit_event_url = self::add_query_args_and_nonce(array('action'=>'edit_event', 'EVT_ID'=>$EVT_ID), EVENTS_ADMIN_URL); |
|
1070 | + $edit_event_lnk = '<a href="'.$edit_event_url.'" title="'.esc_attr__('Edit ', 'event_espresso').$event_name.'">'.__('Edit Event', 'event_espresso').'</a>'; |
|
1071 | + $event_name .= ' <span class="admin-page-header-edit-lnk not-bold">'.$edit_event_lnk.'</span>'; |
|
1072 | 1072 | } |
1073 | 1073 | |
1074 | - $back_2_reg_url = self::add_query_args_and_nonce( array( 'action'=>'default' ), REG_ADMIN_URL ); |
|
1075 | - $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>'; |
|
1074 | + $back_2_reg_url = self::add_query_args_and_nonce(array('action'=>'default'), REG_ADMIN_URL); |
|
1075 | + $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>'; |
|
1076 | 1076 | |
1077 | 1077 | $this->_template_args['before_admin_page_content'] = ' |
1078 | 1078 | <div id="admin-page-header"> |
1079 | - <h1><span class="small-text not-bold">'.__( 'Event: ', 'event_espresso' ).'</span>'. $event_name .'</h1> |
|
1080 | - <h3><span class="small-text not-bold">'.__( 'Date: ', 'event_espresso' ). '</span>'. $event_date .'</h3> |
|
1081 | - <span class="admin-page-header-go-back-lnk not-bold">' . $back_2_reg_lnk . '</span> |
|
1079 | + <h1><span class="small-text not-bold">'.__('Event: ', 'event_espresso').'</span>'.$event_name.'</h1> |
|
1080 | + <h3><span class="small-text not-bold">'.__('Date: ', 'event_espresso').'</span>'.$event_date.'</h3> |
|
1081 | + <span class="admin-page-header-go-back-lnk not-bold">' . $back_2_reg_lnk.'</span> |
|
1082 | 1082 | </div> |
1083 | 1083 | '; |
1084 | 1084 | |
@@ -1116,7 +1116,7 @@ discard block |
||
1116 | 1116 | |
1117 | 1117 | $this->_set_registration_object(); |
1118 | 1118 | |
1119 | - if ( is_object( $this->_registration )) { |
|
1119 | + if (is_object($this->_registration)) { |
|
1120 | 1120 | $transaction = $this->_registration->transaction() ? $this->_registration->transaction() : EE_Transaction::new_instance(); |
1121 | 1121 | $this->_session = $transaction->session_data(); |
1122 | 1122 | |
@@ -1124,10 +1124,10 @@ discard block |
||
1124 | 1124 | |
1125 | 1125 | |
1126 | 1126 | $this->_template_args['reg_nmbr']['value'] = $this->_registration->ID(); |
1127 | - $this->_template_args['reg_nmbr']['label'] = __( 'Registration Number', 'event_espresso' ); |
|
1127 | + $this->_template_args['reg_nmbr']['label'] = __('Registration Number', 'event_espresso'); |
|
1128 | 1128 | |
1129 | - $this->_template_args['reg_datetime']['value'] = $this->_registration->get_i18n_datetime( 'REG_date' ); |
|
1130 | - $this->_template_args['reg_datetime']['label'] = __( 'Date', 'event_espresso' ); |
|
1129 | + $this->_template_args['reg_datetime']['value'] = $this->_registration->get_i18n_datetime('REG_date'); |
|
1130 | + $this->_template_args['reg_datetime']['label'] = __('Date', 'event_espresso'); |
|
1131 | 1131 | |
1132 | 1132 | $this->_template_args['grand_total'] = $transaction->total(); |
1133 | 1133 | |
@@ -1135,19 +1135,19 @@ discard block |
||
1135 | 1135 | // link back to overview |
1136 | 1136 | $this->_template_args['reg_overview_url'] = REG_ADMIN_URL; |
1137 | 1137 | $this->_template_args['registration'] = $this->_registration; |
1138 | - $this->_template_args['filtered_registrations_link'] = EE_Admin_Page::add_query_args_and_nonce( array( 'action' => 'default', 'event_id' => $event_id ), REG_ADMIN_URL ); |
|
1139 | - $this->_template_args['filtered_transactions_link'] = EE_Admin_Page::add_query_args_and_nonce( array( 'action' => 'default', 'EVT_ID' => $event_id, 'page' => 'espresso_transactions' ), admin_url( 'admin.php' ) ); |
|
1140 | - $this->_template_args['event_link'] = EE_Admin_Page::add_query_args_and_nonce( array( 'page' => 'espresso_events', 'action' => 'edit', 'post' => $event_id ), admin_url( 'admin.php' ) ); |
|
1138 | + $this->_template_args['filtered_registrations_link'] = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'default', 'event_id' => $event_id), REG_ADMIN_URL); |
|
1139 | + $this->_template_args['filtered_transactions_link'] = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'default', 'EVT_ID' => $event_id, 'page' => 'espresso_transactions'), admin_url('admin.php')); |
|
1140 | + $this->_template_args['event_link'] = EE_Admin_Page::add_query_args_and_nonce(array('page' => 'espresso_events', 'action' => 'edit', 'post' => $event_id), admin_url('admin.php')); |
|
1141 | 1141 | |
1142 | 1142 | //next and previous links |
1143 | - $next_reg = $this->_registration->next(null, array(), 'REG_ID' ); |
|
1144 | - $this->_template_args['next_registration'] = $next_reg ? $this->_next_link( EE_Admin_Page::add_query_args_and_nonce( array( 'action' => 'view_registration', '_REG_ID' => $next_reg['REG_ID'] ), REG_ADMIN_URL ), 'dashicons dashicons-arrow-right ee-icon-size-22' ) : ''; |
|
1145 | - $previous_reg = $this->_registration->previous( null, array(), 'REG_ID' ); |
|
1146 | - $this->_template_args['previous_registration'] = $previous_reg ? $this->_previous_link( EE_Admin_Page::add_query_args_and_nonce( array( 'action' => 'view_registration', '_REG_ID' => $previous_reg['REG_ID'] ), REG_ADMIN_URL ), 'dashicons dashicons-arrow-left ee-icon-size-22' ) : ''; |
|
1143 | + $next_reg = $this->_registration->next(null, array(), 'REG_ID'); |
|
1144 | + $this->_template_args['next_registration'] = $next_reg ? $this->_next_link(EE_Admin_Page::add_query_args_and_nonce(array('action' => 'view_registration', '_REG_ID' => $next_reg['REG_ID']), REG_ADMIN_URL), 'dashicons dashicons-arrow-right ee-icon-size-22') : ''; |
|
1145 | + $previous_reg = $this->_registration->previous(null, array(), 'REG_ID'); |
|
1146 | + $this->_template_args['previous_registration'] = $previous_reg ? $this->_previous_link(EE_Admin_Page::add_query_args_and_nonce(array('action' => 'view_registration', '_REG_ID' => $previous_reg['REG_ID']), REG_ADMIN_URL), 'dashicons dashicons-arrow-left ee-icon-size-22') : ''; |
|
1147 | 1147 | |
1148 | 1148 | // grab header |
1149 | - $template_path = REG_TEMPLATE_PATH . 'reg_admin_details_header.template.php'; |
|
1150 | - $this->_template_args['admin_page_header'] = EEH_Template::display_template( $template_path, $this->_template_args, TRUE ); |
|
1149 | + $template_path = REG_TEMPLATE_PATH.'reg_admin_details_header.template.php'; |
|
1150 | + $this->_template_args['admin_page_header'] = EEH_Template::display_template($template_path, $this->_template_args, TRUE); |
|
1151 | 1151 | |
1152 | 1152 | } else { |
1153 | 1153 | |
@@ -1166,17 +1166,17 @@ discard block |
||
1166 | 1166 | |
1167 | 1167 | |
1168 | 1168 | protected function _registration_details_metaboxes() { |
1169 | - do_action( 'AHEE__Registrations_Admin_Page___registration_details_metabox__start', $this ); |
|
1169 | + do_action('AHEE__Registrations_Admin_Page___registration_details_metabox__start', $this); |
|
1170 | 1170 | $this->_set_registration_object(); |
1171 | 1171 | $attendee = $this->_registration instanceof EE_Registration ? $this->_registration->attendee() : null; |
1172 | - add_meta_box( 'edit-reg-status-mbox', __( 'Registration Status', 'event_espresso' ), array( $this, 'set_reg_status_buttons_metabox' ), $this->wp_page_slug, 'normal', 'high' ); |
|
1173 | - add_meta_box( 'edit-reg-details-mbox', __( 'Registration Details', 'event_espresso' ), array( $this, '_reg_details_meta_box' ), $this->wp_page_slug, 'normal', 'high' ); |
|
1174 | - if ( $attendee instanceof EE_Attendee && EE_Registry::instance()->CAP->current_user_can('ee_edit_registration', 'edit-reg-questions-mbox' ) ) { |
|
1175 | - add_meta_box( 'edit-reg-questions-mbox', __( 'Registration Form Answers', 'event_espresso' ), array( $this, '_reg_questions_meta_box' ), $this->wp_page_slug, 'normal', 'high' ); |
|
1172 | + add_meta_box('edit-reg-status-mbox', __('Registration Status', 'event_espresso'), array($this, 'set_reg_status_buttons_metabox'), $this->wp_page_slug, 'normal', 'high'); |
|
1173 | + add_meta_box('edit-reg-details-mbox', __('Registration Details', 'event_espresso'), array($this, '_reg_details_meta_box'), $this->wp_page_slug, 'normal', 'high'); |
|
1174 | + if ($attendee instanceof EE_Attendee && EE_Registry::instance()->CAP->current_user_can('ee_edit_registration', 'edit-reg-questions-mbox')) { |
|
1175 | + add_meta_box('edit-reg-questions-mbox', __('Registration Form Answers', 'event_espresso'), array($this, '_reg_questions_meta_box'), $this->wp_page_slug, 'normal', 'high'); |
|
1176 | 1176 | } |
1177 | - add_meta_box( 'edit-reg-registrant-mbox', __( 'Contact Details', 'event_espresso' ), array( $this, '_reg_registrant_side_meta_box' ), $this->wp_page_slug, 'side', 'high' ); |
|
1178 | - if ( $this->_registration->group_size() > 1 ) { |
|
1179 | - add_meta_box( 'edit-reg-attendees-mbox', __( 'Other Registrations in this Transaction', 'event_espresso' ), array( $this, '_reg_attendees_meta_box' ), $this->wp_page_slug, 'normal', 'high' ); |
|
1177 | + add_meta_box('edit-reg-registrant-mbox', __('Contact Details', 'event_espresso'), array($this, '_reg_registrant_side_meta_box'), $this->wp_page_slug, 'side', 'high'); |
|
1178 | + if ($this->_registration->group_size() > 1) { |
|
1179 | + add_meta_box('edit-reg-attendees-mbox', __('Other Registrations in this Transaction', 'event_espresso'), array($this, '_reg_attendees_meta_box'), $this->wp_page_slug, 'normal', 'high'); |
|
1180 | 1180 | } |
1181 | 1181 | } |
1182 | 1182 | |
@@ -1197,23 +1197,23 @@ discard block |
||
1197 | 1197 | |
1198 | 1198 | //let's get an array of all possible buttons that we can just reference |
1199 | 1199 | $status_buttons = $this->_get_reg_status_buttons(); |
1200 | - $template_args[ 'reg_status_value' ] = $this->_registration->pretty_status(); |
|
1201 | - $template_args[ 'reg_status_class' ] = 'status-' . $this->_registration->status_ID(); |
|
1200 | + $template_args['reg_status_value'] = $this->_registration->pretty_status(); |
|
1201 | + $template_args['reg_status_class'] = 'status-'.$this->_registration->status_ID(); |
|
1202 | 1202 | $template_args['attendee'] = $this->_registration->attendee(); |
1203 | - $template = REG_TEMPLATE_PATH . 'reg_status_change_buttons.template.php'; |
|
1204 | - if ( $this->_set_registration_object() ) { |
|
1203 | + $template = REG_TEMPLATE_PATH.'reg_status_change_buttons.template.php'; |
|
1204 | + if ($this->_set_registration_object()) { |
|
1205 | 1205 | $current_status = $this->_registration->status_ID(); |
1206 | - unset( $status_buttons[$current_status] ); |
|
1207 | - if ( $current_status != EEM_Registration::status_id_pending_payment && $is_complete ) { |
|
1208 | - unset( $status_buttons[EEM_Registration::status_id_pending_payment] ); |
|
1206 | + unset($status_buttons[$current_status]); |
|
1207 | + if ($current_status != EEM_Registration::status_id_pending_payment && $is_complete) { |
|
1208 | + unset($status_buttons[EEM_Registration::status_id_pending_payment]); |
|
1209 | 1209 | } |
1210 | - $template_args['status_buttons'] = implode( "\n", $status_buttons ); |
|
1210 | + $template_args['status_buttons'] = implode("\n", $status_buttons); |
|
1211 | 1211 | } |
1212 | 1212 | $template_args['form_url'] = REG_ADMIN_URL; |
1213 | 1213 | $template_args['REG_ID'] = $this->_registration->ID(); |
1214 | - $template_args['nonce'] = wp_nonce_field( 'change_reg_status_nonce', 'change_reg_status_nonce', FALSE, FALSE ); |
|
1214 | + $template_args['nonce'] = wp_nonce_field('change_reg_status_nonce', 'change_reg_status_nonce', FALSE, FALSE); |
|
1215 | 1215 | |
1216 | - EEH_Template::display_template( $template, $template_args ); |
|
1216 | + EEH_Template::display_template($template, $template_args); |
|
1217 | 1217 | |
1218 | 1218 | } |
1219 | 1219 | |
@@ -1227,11 +1227,11 @@ discard block |
||
1227 | 1227 | private function _get_reg_status_buttons() { |
1228 | 1228 | |
1229 | 1229 | $buttons = array( |
1230 | - EEM_Registration::status_id_approved => '<input type="submit" name="_reg_status_id" class="button-secondary ee-status-strip reg-status-' . EEM_Registration::status_id_approved . '" value="' . EEH_Template::pretty_status( EEM_Registration::status_id_approved, FALSE, 'sentence' ) . '">', |
|
1231 | - EEM_Registration::status_id_pending_payment => '<input type="submit" name="_reg_status_id" class="button-secondary ee-status-strip reg-status-' . EEM_Registration::status_id_pending_payment . '" value="' . EEH_Template::pretty_status( EEM_Registration::status_id_pending_payment, FALSE, 'sentence' ) . '">', |
|
1232 | - EEM_Registration::status_id_not_approved => '<input type="submit" name="_reg_status_id" class="button-secondary ee-status-strip reg-status-' . EEM_Registration::status_id_not_approved . '" value="' . EEH_Template::pretty_status( EEM_Registration::status_id_not_approved, FALSE, 'sentence' ) . '">', |
|
1233 | - EEM_Registration::status_id_declined => '<input type="submit" name="_reg_status_id" class="button-secondary ee-status-strip reg-status-' . EEM_Registration::status_id_declined . '" value="' . EEH_Template::pretty_status( EEM_Registration::status_id_declined, FALSE, 'sentence' ) . '">', |
|
1234 | - EEM_Registration::status_id_cancelled =>'<input type="submit" name="_reg_status_id" class="button-secondary ee-status-strip reg-status-' . EEM_Registration::status_id_cancelled . '" value="' . EEH_Template::pretty_status( EEM_Registration::status_id_cancelled, FALSE, 'sentence' ) . '">', |
|
1230 | + EEM_Registration::status_id_approved => '<input type="submit" name="_reg_status_id" class="button-secondary ee-status-strip reg-status-'.EEM_Registration::status_id_approved.'" value="'.EEH_Template::pretty_status(EEM_Registration::status_id_approved, FALSE, 'sentence').'">', |
|
1231 | + EEM_Registration::status_id_pending_payment => '<input type="submit" name="_reg_status_id" class="button-secondary ee-status-strip reg-status-'.EEM_Registration::status_id_pending_payment.'" value="'.EEH_Template::pretty_status(EEM_Registration::status_id_pending_payment, FALSE, 'sentence').'">', |
|
1232 | + EEM_Registration::status_id_not_approved => '<input type="submit" name="_reg_status_id" class="button-secondary ee-status-strip reg-status-'.EEM_Registration::status_id_not_approved.'" value="'.EEH_Template::pretty_status(EEM_Registration::status_id_not_approved, FALSE, 'sentence').'">', |
|
1233 | + EEM_Registration::status_id_declined => '<input type="submit" name="_reg_status_id" class="button-secondary ee-status-strip reg-status-'.EEM_Registration::status_id_declined.'" value="'.EEH_Template::pretty_status(EEM_Registration::status_id_declined, FALSE, 'sentence').'">', |
|
1234 | + EEM_Registration::status_id_cancelled =>'<input type="submit" name="_reg_status_id" class="button-secondary ee-status-strip reg-status-'.EEM_Registration::status_id_cancelled.'" value="'.EEH_Template::pretty_status(EEM_Registration::status_id_cancelled, FALSE, 'sentence').'">', |
|
1235 | 1235 | ); |
1236 | 1236 | return $buttons; |
1237 | 1237 | } |
@@ -1245,13 +1245,13 @@ discard block |
||
1245 | 1245 | * |
1246 | 1246 | * @return array (array with reg_id(s) updated and whether update was successful. |
1247 | 1247 | */ |
1248 | - protected function _set_registration_status_from_request( $status = false, $notify = false ) { |
|
1249 | - $REG_ID = isset( $this->_req_data['_REG_ID'] ) ? (array) $this->_req_data['_REG_ID'] : array(); |
|
1248 | + protected function _set_registration_status_from_request($status = false, $notify = false) { |
|
1249 | + $REG_ID = isset($this->_req_data['_REG_ID']) ? (array) $this->_req_data['_REG_ID'] : array(); |
|
1250 | 1250 | |
1251 | - $success = $this->_set_registration_status( $REG_ID, $status ); |
|
1251 | + $success = $this->_set_registration_status($REG_ID, $status); |
|
1252 | 1252 | |
1253 | 1253 | //notify? |
1254 | - if ( $success && $notify && EE_Registry::instance()->CAP->current_user_can( 'ee_send_message', 'espresso_registrations_resend_registration' ) ) { |
|
1254 | + if ($success && $notify && EE_Registry::instance()->CAP->current_user_can('ee_send_message', 'espresso_registrations_resend_registration')) { |
|
1255 | 1255 | $this->_process_resend_registration(); |
1256 | 1256 | } |
1257 | 1257 | |
@@ -1269,19 +1269,19 @@ discard block |
||
1269 | 1269 | * @param bool $status |
1270 | 1270 | * @return array (an array with 'success' key representing whether status change was successful, and 'REG_ID' as the array of updated registrations). |
1271 | 1271 | */ |
1272 | - protected function _set_registration_status( $REG_ID, $status = false ) { |
|
1272 | + protected function _set_registration_status($REG_ID, $status = false) { |
|
1273 | 1273 | $success = true; |
1274 | 1274 | // set default status if none is passed |
1275 | 1275 | $status = $status ? $status : EEM_Registration::status_id_pending_payment; |
1276 | 1276 | |
1277 | 1277 | //typecast and sanitize reg_id |
1278 | - $reg_ids = array_filter( (array) $REG_ID, 'absint' ); |
|
1278 | + $reg_ids = array_filter((array) $REG_ID, 'absint'); |
|
1279 | 1279 | |
1280 | 1280 | //loop through REG_ID's and change status |
1281 | - foreach ( $reg_ids as $r_id ) { |
|
1282 | - $registration = EEM_Registration::instance()->get_one_by_ID( $r_id ); |
|
1283 | - if ( $registration instanceof EE_Registration ) { |
|
1284 | - $registration->set_status( $status ); |
|
1281 | + foreach ($reg_ids as $r_id) { |
|
1282 | + $registration = EEM_Registration::instance()->get_one_by_ID($r_id); |
|
1283 | + if ($registration instanceof EE_Registration) { |
|
1284 | + $registration->set_status($status); |
|
1285 | 1285 | $result = $registration->save(); |
1286 | 1286 | |
1287 | 1287 | //verifying explicit fails because update *may* just return 0 for 0 rows affected |
@@ -1293,7 +1293,7 @@ discard block |
||
1293 | 1293 | $this->_req_data['_REG_ID'] = $reg_ids; |
1294 | 1294 | |
1295 | 1295 | //return $success and processed registrations |
1296 | - return array( 'REG_ID' => $reg_ids, 'success' => $success ); |
|
1296 | + return array('REG_ID' => $reg_ids, 'success' => $success); |
|
1297 | 1297 | } |
1298 | 1298 | |
1299 | 1299 | |
@@ -1305,37 +1305,37 @@ discard block |
||
1305 | 1305 | * @param bool $notify indicates whether the _set_registration_status_from_request does notifications or not. |
1306 | 1306 | * @return void |
1307 | 1307 | */ |
1308 | - protected function _reg_status_change_return( $STS_ID, $notify = false ) { |
|
1308 | + protected function _reg_status_change_return($STS_ID, $notify = false) { |
|
1309 | 1309 | |
1310 | - $result = ! empty( $STS_ID ) ? $this->_set_registration_status_from_request( $STS_ID, $notify ) : array( 'success' => false ); |
|
1310 | + $result = ! empty($STS_ID) ? $this->_set_registration_status_from_request($STS_ID, $notify) : array('success' => false); |
|
1311 | 1311 | |
1312 | 1312 | |
1313 | - $success = isset( $result['success'] ) && $result['success']; |
|
1313 | + $success = isset($result['success']) && $result['success']; |
|
1314 | 1314 | |
1315 | 1315 | //setup success message |
1316 | - if ( $success ) { |
|
1317 | - $msg = is_array( $result['REG_ID'] ) && count( $result['REG_ID'] ) > 1 ? sprintf( __('Registration status has been set to %s', 'event_espresso'), EEH_Template::pretty_status($STS_ID, false, 'lower' ) ) : sprintf( __('Registrations have been set to %s.', 'event_espresso'), EEH_Template::pretty_status($STS_ID, false, 'lower' ) ) ; |
|
1318 | - EE_Error::add_success( $msg ); |
|
1316 | + if ($success) { |
|
1317 | + $msg = is_array($result['REG_ID']) && count($result['REG_ID']) > 1 ? sprintf(__('Registration status has been set to %s', 'event_espresso'), EEH_Template::pretty_status($STS_ID, false, 'lower')) : sprintf(__('Registrations have been set to %s.', 'event_espresso'), EEH_Template::pretty_status($STS_ID, false, 'lower')); |
|
1318 | + EE_Error::add_success($msg); |
|
1319 | 1319 | } else { |
1320 | - EE_Error::add_error( __('Something went wrong, and the status was not changed', 'event_espresso' ), __FILE__, __LINE__, __FUNCTION__ ); |
|
1320 | + EE_Error::add_error(__('Something went wrong, and the status was not changed', 'event_espresso'), __FILE__, __LINE__, __FUNCTION__); |
|
1321 | 1321 | } |
1322 | 1322 | |
1323 | - $route = isset( $this->_req_data['return'] ) && $this->_req_data['return'] == 'view_registration' ? array( 'action' => 'view_registration', '_REG_ID' => $result['REG_ID'][0] ) : array( 'action' => 'default' ); |
|
1323 | + $route = isset($this->_req_data['return']) && $this->_req_data['return'] == 'view_registration' ? array('action' => 'view_registration', '_REG_ID' => $result['REG_ID'][0]) : array('action' => 'default'); |
|
1324 | 1324 | //unset nonces |
1325 | - foreach ( $this->_req_data as $ref => $value ) { |
|
1326 | - if ( strpos( $ref, 'nonce' ) !== false ) { |
|
1327 | - unset( $this->_req_data[$ref] ); |
|
1325 | + foreach ($this->_req_data as $ref => $value) { |
|
1326 | + if (strpos($ref, 'nonce') !== false) { |
|
1327 | + unset($this->_req_data[$ref]); |
|
1328 | 1328 | continue; |
1329 | 1329 | } |
1330 | 1330 | |
1331 | - $value = is_array( $value ) ? array_map( 'urlencode', $value ) : urlencode( $value ); |
|
1331 | + $value = is_array($value) ? array_map('urlencode', $value) : urlencode($value); |
|
1332 | 1332 | $this->_req_data[$ref] = $value; |
1333 | 1333 | } |
1334 | 1334 | |
1335 | 1335 | //merge request vars so that the reloaded list table contains any existing filter query params |
1336 | - $route = array_merge( $this->_req_data, $route ); |
|
1336 | + $route = array_merge($this->_req_data, $route); |
|
1337 | 1337 | |
1338 | - $this->_redirect_after_action( false, '', '', $route, true ); |
|
1338 | + $this->_redirect_after_action(false, '', '', $route, true); |
|
1339 | 1339 | } |
1340 | 1340 | |
1341 | 1341 | |
@@ -1347,29 +1347,29 @@ discard block |
||
1347 | 1347 | protected function _change_reg_status() { |
1348 | 1348 | $this->_req_data['return'] = 'view_registration'; |
1349 | 1349 | //set notify based on whether the send notifications toggle is set or not |
1350 | - $notify = ! empty( $this->_req_data['txn_reg_status_change']['send_notifications'] ); |
|
1351 | - $this->_req_data[ '_reg_status_id' ] = isset( $this->_req_data[ '_reg_status_id' ] ) ? $this->_req_data[ '_reg_status_id' ] : ''; |
|
1350 | + $notify = ! empty($this->_req_data['txn_reg_status_change']['send_notifications']); |
|
1351 | + $this->_req_data['_reg_status_id'] = isset($this->_req_data['_reg_status_id']) ? $this->_req_data['_reg_status_id'] : ''; |
|
1352 | 1352 | |
1353 | - switch ( $this->_req_data['_reg_status_id'] ) { |
|
1354 | - case EEH_Template::pretty_status( EEM_Registration::status_id_approved, false, 'sentence' ) : |
|
1355 | - $this->approve_registration( $notify ); |
|
1353 | + switch ($this->_req_data['_reg_status_id']) { |
|
1354 | + case EEH_Template::pretty_status(EEM_Registration::status_id_approved, false, 'sentence') : |
|
1355 | + $this->approve_registration($notify); |
|
1356 | 1356 | break; |
1357 | - case EEH_Template::pretty_status( EEM_Registration::status_id_pending_payment, false, 'sentence' ) : |
|
1358 | - $this->pending_registration( $notify ); |
|
1357 | + case EEH_Template::pretty_status(EEM_Registration::status_id_pending_payment, false, 'sentence') : |
|
1358 | + $this->pending_registration($notify); |
|
1359 | 1359 | break; |
1360 | - case EEH_Template::pretty_status( EEM_Registration::status_id_not_approved, false, 'sentence' ) : |
|
1361 | - $this->not_approve_registration( $notify ); |
|
1360 | + case EEH_Template::pretty_status(EEM_Registration::status_id_not_approved, false, 'sentence') : |
|
1361 | + $this->not_approve_registration($notify); |
|
1362 | 1362 | break; |
1363 | - case EEH_Template::pretty_status( EEM_Registration::status_id_declined, false, 'sentence' ) : |
|
1364 | - $this->decline_registration( $notify ); |
|
1363 | + case EEH_Template::pretty_status(EEM_Registration::status_id_declined, false, 'sentence') : |
|
1364 | + $this->decline_registration($notify); |
|
1365 | 1365 | break; |
1366 | - case EEH_Template::pretty_status( EEM_Registration::status_id_cancelled, false, 'sentence' ) : |
|
1367 | - $this->cancel_registration( $notify ); |
|
1366 | + case EEH_Template::pretty_status(EEM_Registration::status_id_cancelled, false, 'sentence') : |
|
1367 | + $this->cancel_registration($notify); |
|
1368 | 1368 | break; |
1369 | 1369 | default : |
1370 | 1370 | $result['success'] = false; |
1371 | - unset( $this->_req_data['return'] ); |
|
1372 | - $this->_reg_status_change_return( '', false ); |
|
1371 | + unset($this->_req_data['return']); |
|
1372 | + $this->_reg_status_change_return('', false); |
|
1373 | 1373 | break; |
1374 | 1374 | } |
1375 | 1375 | } |
@@ -1382,8 +1382,8 @@ discard block |
||
1382 | 1382 | * @param bool $notify whether or not to notify the registrant about their approval. |
1383 | 1383 | * @return void |
1384 | 1384 | */ |
1385 | - protected function approve_registration( $notify = false ) { |
|
1386 | - $this->_reg_status_change_return( EEM_Registration::status_id_approved, $notify ); |
|
1385 | + protected function approve_registration($notify = false) { |
|
1386 | + $this->_reg_status_change_return(EEM_Registration::status_id_approved, $notify); |
|
1387 | 1387 | } |
1388 | 1388 | |
1389 | 1389 | |
@@ -1395,8 +1395,8 @@ discard block |
||
1395 | 1395 | * @param bool $notify whether or not to notify the registrant about their approval. |
1396 | 1396 | * @return void |
1397 | 1397 | */ |
1398 | - protected function decline_registration( $notify = false ) { |
|
1399 | - $this->_reg_status_change_return( EEM_Registration::status_id_declined, $notify ); |
|
1398 | + protected function decline_registration($notify = false) { |
|
1399 | + $this->_reg_status_change_return(EEM_Registration::status_id_declined, $notify); |
|
1400 | 1400 | } |
1401 | 1401 | |
1402 | 1402 | |
@@ -1408,8 +1408,8 @@ discard block |
||
1408 | 1408 | * @param bool $notify whether or not to notify the registrant about their approval. |
1409 | 1409 | * @return void |
1410 | 1410 | */ |
1411 | - protected function cancel_registration( $notify = false ) { |
|
1412 | - $this->_reg_status_change_return( EEM_Registration::status_id_cancelled, $notify ); |
|
1411 | + protected function cancel_registration($notify = false) { |
|
1412 | + $this->_reg_status_change_return(EEM_Registration::status_id_cancelled, $notify); |
|
1413 | 1413 | } |
1414 | 1414 | |
1415 | 1415 | |
@@ -1422,8 +1422,8 @@ discard block |
||
1422 | 1422 | * @param bool $notify whether or not to notify the registrant about their approval. |
1423 | 1423 | * @return void |
1424 | 1424 | */ |
1425 | - protected function not_approve_registration( $notify = false ) { |
|
1426 | - $this->_reg_status_change_return( EEM_Registration::status_id_not_approved, $notify ); |
|
1425 | + protected function not_approve_registration($notify = false) { |
|
1426 | + $this->_reg_status_change_return(EEM_Registration::status_id_not_approved, $notify); |
|
1427 | 1427 | } |
1428 | 1428 | |
1429 | 1429 | |
@@ -1434,8 +1434,8 @@ discard block |
||
1434 | 1434 | * @param bool $notify whether or not to notify the registrant about their approval. |
1435 | 1435 | * @return void |
1436 | 1436 | */ |
1437 | - protected function pending_registration( $notify = false ) { |
|
1438 | - $this->_reg_status_change_return( EEM_Registration::status_id_pending_payment, $notify ); |
|
1437 | + protected function pending_registration($notify = false) { |
|
1438 | + $this->_reg_status_change_return(EEM_Registration::status_id_pending_payment, $notify); |
|
1439 | 1439 | } |
1440 | 1440 | |
1441 | 1441 | |
@@ -1449,75 +1449,75 @@ discard block |
||
1449 | 1449 | public function _reg_details_meta_box() { |
1450 | 1450 | EEH_Autoloader::register_line_item_display_autoloaders(); |
1451 | 1451 | EEH_Autoloader::register_line_item_filter_autoloaders(); |
1452 | - EE_Registry::instance()->load_Helper( 'Line_Item' ); |
|
1452 | + EE_Registry::instance()->load_Helper('Line_Item'); |
|
1453 | 1453 | $transaction = $this->_registration->transaction() ? $this->_registration->transaction() : EE_Transaction::new_instance(); |
1454 | 1454 | $this->_session = $transaction->session_data(); |
1455 | 1455 | |
1456 | 1456 | $filters = new EE_Line_Item_Filter_Collection(); |
1457 | - $filters->add( new EE_Single_Registration_Line_Item_Filter( $this->_registration ) ); |
|
1458 | - $filters->add( new EE_Non_Zero_Line_Item_Filter() ); |
|
1459 | - $line_item_filter_processor = new EE_Line_Item_Filter_Processor( $filters, $transaction->total_line_item() ); |
|
1457 | + $filters->add(new EE_Single_Registration_Line_Item_Filter($this->_registration)); |
|
1458 | + $filters->add(new EE_Non_Zero_Line_Item_Filter()); |
|
1459 | + $line_item_filter_processor = new EE_Line_Item_Filter_Processor($filters, $transaction->total_line_item()); |
|
1460 | 1460 | $filtered_line_item_tree = $line_item_filter_processor->process(); |
1461 | 1461 | |
1462 | 1462 | $this->_template_args['REG_ID'] = $this->_registration->ID(); |
1463 | - $line_item_display = new EE_Line_Item_Display( 'reg_admin_table', 'EE_Admin_Table_Registration_Line_Item_Display_Strategy' ); |
|
1464 | - $this->_template_args['line_item_table'] = $line_item_display->display_line_item( $filtered_line_item_tree, array( 'EE_Registration' => $this->_registration ) ); |
|
1463 | + $line_item_display = new EE_Line_Item_Display('reg_admin_table', 'EE_Admin_Table_Registration_Line_Item_Display_Strategy'); |
|
1464 | + $this->_template_args['line_item_table'] = $line_item_display->display_line_item($filtered_line_item_tree, array('EE_Registration' => $this->_registration)); |
|
1465 | 1465 | |
1466 | 1466 | |
1467 | 1467 | $attendee = $this->_registration->attendee(); |
1468 | 1468 | |
1469 | 1469 | |
1470 | - $this->_template_args['view_transaction_button'] = EE_Registry::instance()->CAP->current_user_can( 'ee_read_transaction', 'espresso_transactions_view_transaction' ) ?EEH_Template::get_button_or_link( EE_Admin_Page::add_query_args_and_nonce( array('action'=> 'view_transaction', 'TXN_ID' => $transaction->ID() ), TXN_ADMIN_URL ), __(' View Transaction'), 'button secondary-button right', 'dashicons dashicons-cart' ) : ''; |
|
1471 | - $this->_template_args['resend_registration_button'] = $attendee instanceof EE_Attendee && EE_Registry::instance()->CAP->current_user_can( 'ee_send_message', 'espresso_registrations_resend_registration' ) ?EEH_Template::get_button_or_link( EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'resend_registration', '_REG_ID'=>$this->_registration->ID(), 'redirect_to' => 'view_registration' ), REG_ADMIN_URL ), __(' Resend Registration'), 'button secondary-button right', 'dashicons dashicons-email-alt' ) : ''; |
|
1470 | + $this->_template_args['view_transaction_button'] = EE_Registry::instance()->CAP->current_user_can('ee_read_transaction', 'espresso_transactions_view_transaction') ? EEH_Template::get_button_or_link(EE_Admin_Page::add_query_args_and_nonce(array('action'=> 'view_transaction', 'TXN_ID' => $transaction->ID()), TXN_ADMIN_URL), __(' View Transaction'), 'button secondary-button right', 'dashicons dashicons-cart') : ''; |
|
1471 | + $this->_template_args['resend_registration_button'] = $attendee instanceof EE_Attendee && EE_Registry::instance()->CAP->current_user_can('ee_send_message', 'espresso_registrations_resend_registration') ? EEH_Template::get_button_or_link(EE_Admin_Page::add_query_args_and_nonce(array('action'=>'resend_registration', '_REG_ID'=>$this->_registration->ID(), 'redirect_to' => 'view_registration'), REG_ADMIN_URL), __(' Resend Registration'), 'button secondary-button right', 'dashicons dashicons-email-alt') : ''; |
|
1472 | 1472 | |
1473 | 1473 | |
1474 | 1474 | $this->_template_args['currency_sign'] = EE_Registry::instance()->CFG->currency->sign; |
1475 | - $payment = $transaction->get_first_related( 'Payment' ); |
|
1475 | + $payment = $transaction->get_first_related('Payment'); |
|
1476 | 1476 | $payment = ! $payment instanceof EE_Payment ? EE_Payment::new_instance() : $payment; |
1477 | - $payment_method = $payment->get_first_related( 'Payment_Method' ); |
|
1477 | + $payment_method = $payment->get_first_related('Payment_Method'); |
|
1478 | 1478 | $payment_method = ! $payment_method instanceof EE_Payment_Method ? EE_Payment_Method::new_instance() : $payment_method; |
1479 | - $reg_status_class = 'status-' . $this->_registration->status_ID(); |
|
1479 | + $reg_status_class = 'status-'.$this->_registration->status_ID(); |
|
1480 | 1480 | $reg_details = array( |
1481 | 1481 | 'payment_method' => $payment_method->name(), |
1482 | 1482 | 'response_msg' => $payment->gateway_response(), |
1483 | - 'registration_id' => $this->_registration->get( 'REG_code' ), |
|
1483 | + 'registration_id' => $this->_registration->get('REG_code'), |
|
1484 | 1484 | 'registration_session' => $this->_registration->session_ID(), |
1485 | - 'ip_address' => isset( $this->_session['ip_address'] ) ? $this->_session['ip_address'] : '', |
|
1486 | - 'user_agent' => isset( $this->_session['user_agent'] ) ? $this->_session['user_agent'] : '', |
|
1485 | + 'ip_address' => isset($this->_session['ip_address']) ? $this->_session['ip_address'] : '', |
|
1486 | + 'user_agent' => isset($this->_session['user_agent']) ? $this->_session['user_agent'] : '', |
|
1487 | 1487 | ); |
1488 | 1488 | |
1489 | 1489 | |
1490 | - if ( isset( $reg_details['registration_id'] )) { |
|
1490 | + if (isset($reg_details['registration_id'])) { |
|
1491 | 1491 | $this->_template_args['reg_details']['registration_id']['value'] = $reg_details['registration_id']; |
1492 | - $this->_template_args['reg_details']['registration_id']['label'] = __( 'Registration ID', 'event_espresso' ); |
|
1492 | + $this->_template_args['reg_details']['registration_id']['label'] = __('Registration ID', 'event_espresso'); |
|
1493 | 1493 | $this->_template_args['reg_details']['registration_id']['class'] = 'regular-text'; |
1494 | 1494 | } |
1495 | 1495 | |
1496 | - if ( isset( $reg_details['payment_method'] ) ) { |
|
1496 | + if (isset($reg_details['payment_method'])) { |
|
1497 | 1497 | $this->_template_args['reg_details']['payment_method']['value'] = $reg_details['payment_method']; |
1498 | - $this->_template_args['reg_details']['payment_method']['label'] = __( 'Most Recent Payment Method', 'event_espresso' ); |
|
1498 | + $this->_template_args['reg_details']['payment_method']['label'] = __('Most Recent Payment Method', 'event_espresso'); |
|
1499 | 1499 | $this->_template_args['reg_details']['payment_method']['class'] = 'regular-text'; |
1500 | 1500 | $this->_template_args['reg_details']['response_msg']['value'] = $reg_details['response_msg']; |
1501 | - $this->_template_args['reg_details']['response_msg']['label'] = __( 'Payment method response', 'event_espresso' ); |
|
1501 | + $this->_template_args['reg_details']['response_msg']['label'] = __('Payment method response', 'event_espresso'); |
|
1502 | 1502 | $this->_template_args['reg_details']['response_msg']['class'] = 'regular-text'; |
1503 | 1503 | } |
1504 | 1504 | |
1505 | 1505 | $this->_template_args['reg_details']['registration_session']['value'] = $reg_details['registration_session']; |
1506 | - $this->_template_args['reg_details']['registration_session']['label'] = __( 'Registration Session', 'event_espresso' ); |
|
1506 | + $this->_template_args['reg_details']['registration_session']['label'] = __('Registration Session', 'event_espresso'); |
|
1507 | 1507 | $this->_template_args['reg_details']['registration_session']['class'] = 'regular-text'; |
1508 | 1508 | |
1509 | 1509 | $this->_template_args['reg_details']['ip_address']['value'] = $reg_details['ip_address']; |
1510 | - $this->_template_args['reg_details']['ip_address']['label'] = __( 'Registration placed from IP', 'event_espresso' ); |
|
1510 | + $this->_template_args['reg_details']['ip_address']['label'] = __('Registration placed from IP', 'event_espresso'); |
|
1511 | 1511 | $this->_template_args['reg_details']['ip_address']['class'] = 'regular-text'; |
1512 | 1512 | |
1513 | 1513 | $this->_template_args['reg_details']['user_agent']['value'] = $reg_details['user_agent']; |
1514 | - $this->_template_args['reg_details']['user_agent']['label'] = __( 'Registrant User Agent', 'event_espresso' ); |
|
1514 | + $this->_template_args['reg_details']['user_agent']['label'] = __('Registrant User Agent', 'event_espresso'); |
|
1515 | 1515 | $this->_template_args['reg_details']['user_agent']['class'] = 'large-text'; |
1516 | 1516 | |
1517 | - $this->_template_args['event_link'] = EE_Admin_Page::add_query_args_and_nonce( array( 'action' => 'default', 'event_id' => $this->_registration->event_ID()), REG_ADMIN_URL ); |
|
1517 | + $this->_template_args['event_link'] = EE_Admin_Page::add_query_args_and_nonce(array('action' => 'default', 'event_id' => $this->_registration->event_ID()), REG_ADMIN_URL); |
|
1518 | 1518 | |
1519 | - $template_path = REG_TEMPLATE_PATH . 'reg_admin_details_main_meta_box_reg_details.template.php'; |
|
1520 | - echo EEH_Template::display_template( $template_path, $this->_template_args, TRUE ); |
|
1519 | + $template_path = REG_TEMPLATE_PATH.'reg_admin_details_main_meta_box_reg_details.template.php'; |
|
1520 | + echo EEH_Template::display_template($template_path, $this->_template_args, TRUE); |
|
1521 | 1521 | |
1522 | 1522 | } |
1523 | 1523 | |
@@ -1531,14 +1531,14 @@ discard block |
||
1531 | 1531 | */ |
1532 | 1532 | public function _reg_questions_meta_box() { |
1533 | 1533 | //allow someone to override this method entirely |
1534 | - if( apply_filters( 'FHEE__Registrations_Admin_Page___reg_questions_meta_box__do_default', true, $this, $this->_registration ) ) { |
|
1535 | - $form = $this->_get_reg_custom_questions_form( $this->_registration->ID() ); |
|
1536 | - $this->_template_args[ 'att_questions' ] = count( $form->subforms() ) > 0 ? $form->get_html_and_js() : ''; |
|
1534 | + if (apply_filters('FHEE__Registrations_Admin_Page___reg_questions_meta_box__do_default', true, $this, $this->_registration)) { |
|
1535 | + $form = $this->_get_reg_custom_questions_form($this->_registration->ID()); |
|
1536 | + $this->_template_args['att_questions'] = count($form->subforms()) > 0 ? $form->get_html_and_js() : ''; |
|
1537 | 1537 | $this->_template_args['reg_questions_form_action'] = 'edit_registration'; |
1538 | 1538 | $this->_template_args['REG_ID'] = $this->_registration->ID(); |
1539 | 1539 | |
1540 | - $template_path = REG_TEMPLATE_PATH . 'reg_admin_details_main_meta_box_reg_questions.template.php'; |
|
1541 | - echo EEH_Template::display_template( $template_path, $this->_template_args, TRUE ); |
|
1540 | + $template_path = REG_TEMPLATE_PATH.'reg_admin_details_main_meta_box_reg_questions.template.php'; |
|
1541 | + echo EEH_Template::display_template($template_path, $this->_template_args, TRUE); |
|
1542 | 1542 | } |
1543 | 1543 | } |
1544 | 1544 | |
@@ -1552,12 +1552,12 @@ discard block |
||
1552 | 1552 | * @param string $output |
1553 | 1553 | * @return string |
1554 | 1554 | */ |
1555 | - public function form_before_question_group( $output ) { |
|
1555 | + public function form_before_question_group($output) { |
|
1556 | 1556 | EE_Error::doing_it_wrong( |
1557 | - __CLASS__ . '::' . __FUNCTION__, |
|
1558 | - __( 'This method would have been protected but was used on a filter callback' |
|
1557 | + __CLASS__.'::'.__FUNCTION__, |
|
1558 | + __('This method would have been protected but was used on a filter callback' |
|
1559 | 1559 | . 'so needed to be public. Please discontinue usage as it will be removed soon.', |
1560 | - 'event_espresso' ), |
|
1560 | + 'event_espresso'), |
|
1561 | 1561 | '4.8.32.rc.000' |
1562 | 1562 | ); |
1563 | 1563 | return ' |
@@ -1576,20 +1576,20 @@ discard block |
||
1576 | 1576 | * @param string $output |
1577 | 1577 | * @return string |
1578 | 1578 | */ |
1579 | - public function form_after_question_group( $output ) { |
|
1579 | + public function form_after_question_group($output) { |
|
1580 | 1580 | EE_Error::doing_it_wrong( |
1581 | - __CLASS__ . '::' . __FUNCTION__, |
|
1582 | - __( 'This method would have been protected but was used on a filter callback' |
|
1581 | + __CLASS__.'::'.__FUNCTION__, |
|
1582 | + __('This method would have been protected but was used on a filter callback' |
|
1583 | 1583 | . 'so needed to be public. Please discontinue usage as it will be removed soon.', |
1584 | - 'event_espresso' ), |
|
1584 | + 'event_espresso'), |
|
1585 | 1585 | '4.8.32.rc.000' |
1586 | 1586 | ); |
1587 | 1587 | return ' |
1588 | 1588 | <tr class="hide-if-no-js"> |
1589 | 1589 | <th> </th> |
1590 | 1590 | <td class="reg-admin-edit-attendee-question-td"> |
1591 | - <a class="reg-admin-edit-attendee-question-lnk" href="#" title="' . esc_attr__( 'click to edit question', 'event_espresso' ) . '"> |
|
1592 | - <span class="reg-admin-edit-question-group-spn lt-grey-txt">' . __( 'edit the above question group', 'event_espresso' ) . '</span> |
|
1591 | + <a class="reg-admin-edit-attendee-question-lnk" href="#" title="' . esc_attr__('click to edit question', 'event_espresso').'"> |
|
1592 | + <span class="reg-admin-edit-question-group-spn lt-grey-txt">' . __('edit the above question group', 'event_espresso').'</span> |
|
1593 | 1593 | <div class="dashicons dashicons-edit"></div> |
1594 | 1594 | </a> |
1595 | 1595 | </td> |
@@ -1609,18 +1609,18 @@ discard block |
||
1609 | 1609 | * @param string $label |
1610 | 1610 | * @return string |
1611 | 1611 | */ |
1612 | - public function form_form_field_label_wrap( $label ) { |
|
1612 | + public function form_form_field_label_wrap($label) { |
|
1613 | 1613 | EE_Error::doing_it_wrong( |
1614 | - __CLASS__ . '::' . __FUNCTION__, |
|
1615 | - __( 'This method would have been protected but was used on a filter callback' |
|
1614 | + __CLASS__.'::'.__FUNCTION__, |
|
1615 | + __('This method would have been protected but was used on a filter callback' |
|
1616 | 1616 | . 'so needed to be public. Please discontinue usage as it will be removed soon.', |
1617 | - 'event_espresso' ), |
|
1617 | + 'event_espresso'), |
|
1618 | 1618 | '4.8.32.rc.000' |
1619 | 1619 | ); |
1620 | 1620 | return ' |
1621 | 1621 | <tr> |
1622 | 1622 | <th> |
1623 | - ' . $label . ' |
|
1623 | + ' . $label.' |
|
1624 | 1624 | </th>'; |
1625 | 1625 | } |
1626 | 1626 | |
@@ -1634,17 +1634,17 @@ discard block |
||
1634 | 1634 | * @param string $input |
1635 | 1635 | * @return string |
1636 | 1636 | */ |
1637 | - public function form_form_field_input__wrap( $input ) { |
|
1637 | + public function form_form_field_input__wrap($input) { |
|
1638 | 1638 | EE_Error::doing_it_wrong( |
1639 | - __CLASS__ . '::' . __FUNCTION__, |
|
1640 | - __( 'This method would have been protected but was used on a filter callback' |
|
1639 | + __CLASS__.'::'.__FUNCTION__, |
|
1640 | + __('This method would have been protected but was used on a filter callback' |
|
1641 | 1641 | . 'so needed to be public. Please discontinue usage as it will be removed soon.', |
1642 | - 'event_espresso' ), |
|
1642 | + 'event_espresso'), |
|
1643 | 1643 | '4.8.32.rc.000' |
1644 | 1644 | ); |
1645 | 1645 | return ' |
1646 | 1646 | <td class="reg-admin-attendee-questions-input-td disabled-input"> |
1647 | - ' . $input . ' |
|
1647 | + ' . $input.' |
|
1648 | 1648 | </td> |
1649 | 1649 | </tr>'; |
1650 | 1650 | } |
@@ -1658,14 +1658,14 @@ discard block |
||
1658 | 1658 | * @return void |
1659 | 1659 | */ |
1660 | 1660 | protected function _update_attendee_registration_form() { |
1661 | - do_action( 'AHEE__Registrations_Admin_Page___update_attendee_registration_form__start', $this ); |
|
1662 | - if( $_SERVER['REQUEST_METHOD'] == 'POST'){ |
|
1663 | - $REG_ID = isset( $this->_req_data['_REG_ID'] ) ? absint( $this->_req_data['_REG_ID'] ) : FALSE; |
|
1664 | - $success = $this->_save_reg_custom_questions_form( $REG_ID ); |
|
1665 | - if( $success ) { |
|
1661 | + do_action('AHEE__Registrations_Admin_Page___update_attendee_registration_form__start', $this); |
|
1662 | + if ($_SERVER['REQUEST_METHOD'] == 'POST') { |
|
1663 | + $REG_ID = isset($this->_req_data['_REG_ID']) ? absint($this->_req_data['_REG_ID']) : FALSE; |
|
1664 | + $success = $this->_save_reg_custom_questions_form($REG_ID); |
|
1665 | + if ($success) { |
|
1666 | 1666 | $what = __('Registration Form', 'event_espresso'); |
1667 | - $route = $REG_ID ? array( 'action' => 'view_registration', '_REG_ID' => $REG_ID ) : array( 'action' => 'default' ); |
|
1668 | - $this->_redirect_after_action( $success, $what, __('updated', 'event_espresso'), $route ); |
|
1667 | + $route = $REG_ID ? array('action' => 'view_registration', '_REG_ID' => $REG_ID) : array('action' => 'default'); |
|
1668 | + $this->_redirect_after_action($success, $what, __('updated', 'event_espresso'), $route); |
|
1669 | 1669 | } |
1670 | 1670 | } |
1671 | 1671 | } |
@@ -1676,11 +1676,11 @@ discard block |
||
1676 | 1676 | * @param int $REG_ID |
1677 | 1677 | * @return EE_Registration_Custom_Questions_Form |
1678 | 1678 | */ |
1679 | - protected function _get_reg_custom_questions_form( $REG_ID ) { |
|
1680 | - if( ! $this->_reg_custom_questions_form ) { |
|
1681 | - require_once( REG_ADMIN . 'form_sections' . DS . 'EE_Registration_Custom_Questions_Form.form.php' ); |
|
1682 | - $this->_reg_custom_questions_form = new EE_Registration_Custom_Questions_Form( EEM_Registration::instance()->get_one_by_ID( $REG_ID ) ); |
|
1683 | - $this->_reg_custom_questions_form->_construct_finalize( null, null ); |
|
1679 | + protected function _get_reg_custom_questions_form($REG_ID) { |
|
1680 | + if ( ! $this->_reg_custom_questions_form) { |
|
1681 | + require_once(REG_ADMIN.'form_sections'.DS.'EE_Registration_Custom_Questions_Form.form.php'); |
|
1682 | + $this->_reg_custom_questions_form = new EE_Registration_Custom_Questions_Form(EEM_Registration::instance()->get_one_by_ID($REG_ID)); |
|
1683 | + $this->_reg_custom_questions_form->_construct_finalize(null, null); |
|
1684 | 1684 | } |
1685 | 1685 | return $this->_reg_custom_questions_form; |
1686 | 1686 | } |
@@ -1693,17 +1693,17 @@ discard block |
||
1693 | 1693 | * @param bool $REG_ID |
1694 | 1694 | * @return bool |
1695 | 1695 | */ |
1696 | - private function _save_reg_custom_questions_form( $REG_ID = FALSE ) { |
|
1696 | + private function _save_reg_custom_questions_form($REG_ID = FALSE) { |
|
1697 | 1697 | |
1698 | 1698 | if ( ! $REG_ID) { |
1699 | - EE_Error::add_error( __('An error occurred. No registration ID was received.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ ); |
|
1699 | + EE_Error::add_error(__('An error occurred. No registration ID was received.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__); |
|
1700 | 1700 | } |
1701 | - $form = $this->_get_reg_custom_questions_form( $REG_ID ); |
|
1702 | - $form->receive_form_submission( $this->_req_data ); |
|
1701 | + $form = $this->_get_reg_custom_questions_form($REG_ID); |
|
1702 | + $form->receive_form_submission($this->_req_data); |
|
1703 | 1703 | $success = false; |
1704 | - if( $form->is_valid() ) { |
|
1705 | - foreach( $form->subforms() as $question_group_id => $question_group_form ) { |
|
1706 | - foreach( $question_group_form->inputs() as $question_id => $input ) { |
|
1704 | + if ($form->is_valid()) { |
|
1705 | + foreach ($form->subforms() as $question_group_id => $question_group_form) { |
|
1706 | + foreach ($question_group_form->inputs() as $question_id => $input) { |
|
1707 | 1707 | $where_conditions = array( |
1708 | 1708 | 'QST_ID' => $question_id, |
1709 | 1709 | 'REG_ID' => $REG_ID |
@@ -1711,19 +1711,19 @@ discard block |
||
1711 | 1711 | $possibly_new_values = array( |
1712 | 1712 | 'ANS_value' => $input->normalized_value() |
1713 | 1713 | ); |
1714 | - $answer = EEM_Answer::instance()->get_one( array( $where_conditions ) ); |
|
1715 | - if( $answer instanceof EE_Answer ) { |
|
1716 | - $success = $answer->save( $possibly_new_values ); |
|
1714 | + $answer = EEM_Answer::instance()->get_one(array($where_conditions)); |
|
1715 | + if ($answer instanceof EE_Answer) { |
|
1716 | + $success = $answer->save($possibly_new_values); |
|
1717 | 1717 | } else { |
1718 | 1718 | //insert it then |
1719 | - $cols_n_vals = array_merge( $where_conditions, $possibly_new_values ); |
|
1720 | - $answer = EE_Answer::new_instance( $cols_n_vals ); |
|
1719 | + $cols_n_vals = array_merge($where_conditions, $possibly_new_values); |
|
1720 | + $answer = EE_Answer::new_instance($cols_n_vals); |
|
1721 | 1721 | $success = $answer->save(); |
1722 | 1722 | } |
1723 | 1723 | } |
1724 | 1724 | } |
1725 | 1725 | } else { |
1726 | - EE_Error::add_error( $form->get_validation_error_string(), __FILE__, __FUNCTION__, __LINE__ ); |
|
1726 | + EE_Error::add_error($form->get_validation_error_string(), __FILE__, __FUNCTION__, __LINE__); |
|
1727 | 1727 | } |
1728 | 1728 | return $success; |
1729 | 1729 | } |
@@ -1741,29 +1741,29 @@ discard block |
||
1741 | 1741 | $registrations = $REG->get_all(array( |
1742 | 1742 | array( |
1743 | 1743 | 'TXN_ID'=>$this->_registration->transaction_ID(), |
1744 | - 'REG_ID'=>array('!=',$this->_registration->ID()) |
|
1744 | + 'REG_ID'=>array('!=', $this->_registration->ID()) |
|
1745 | 1745 | ), |
1746 | 1746 | 'force_join'=>array('Attendee'))); |
1747 | 1747 | |
1748 | 1748 | $this->_template_args['attendees'] = array(); |
1749 | 1749 | $this->_template_args['attendee_notice'] = ''; |
1750 | - if ( empty( $registrations) || ( is_array($registrations) && ! EEH_Array::get_one_item_from_array($registrations) ) ) { |
|
1751 | - EE_Error::add_error( __('There are no records attached to this registration. Something may have gone wrong with the registration', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ ); |
|
1750 | + if (empty($registrations) || (is_array($registrations) && ! EEH_Array::get_one_item_from_array($registrations))) { |
|
1751 | + EE_Error::add_error(__('There are no records attached to this registration. Something may have gone wrong with the registration', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__); |
|
1752 | 1752 | $this->_template_args['attendee_notice'] = EE_Error::get_notices(); |
1753 | 1753 | } else { |
1754 | 1754 | |
1755 | 1755 | $att_nmbr = 1; |
1756 | - foreach ( $registrations as $registration ) { |
|
1756 | + foreach ($registrations as $registration) { |
|
1757 | 1757 | /* @var $registration EE_Registration */ |
1758 | 1758 | $attendee = $registration->attendee() ? $registration->attendee() : EEM_Attendee::instance()->create_default_object(); |
1759 | - $this->_template_args['attendees'][ $att_nmbr ]['fname'] = $attendee->fname();//( isset( $registration->ATT_fname ) & ! empty( $registration->ATT_fname ) ) ? $registration->ATT_fname : ''; |
|
1760 | - $this->_template_args['attendees'][ $att_nmbr ]['lname'] = $attendee->lname();//( isset( $registration->ATT_lname ) & ! empty( $registration->ATT_lname ) ) ? $registration->ATT_lname : ''; |
|
1761 | - $this->_template_args['attendees'][ $att_nmbr ]['email'] = $attendee->email();//( isset( $registration->ATT_email ) & ! empty( $registration->ATT_email ) ) ? $registration->ATT_email : ''; |
|
1762 | - $this->_template_args['attendees'][ $att_nmbr ]['final_price'] = $registration->final_price();//( isset( $registration->REG_final_price ) & ! empty( $registration->REG_final_price ) ) ? $registration->REG_final_price : ''; |
|
1759 | + $this->_template_args['attendees'][$att_nmbr]['fname'] = $attendee->fname(); //( isset( $registration->ATT_fname ) & ! empty( $registration->ATT_fname ) ) ? $registration->ATT_fname : ''; |
|
1760 | + $this->_template_args['attendees'][$att_nmbr]['lname'] = $attendee->lname(); //( isset( $registration->ATT_lname ) & ! empty( $registration->ATT_lname ) ) ? $registration->ATT_lname : ''; |
|
1761 | + $this->_template_args['attendees'][$att_nmbr]['email'] = $attendee->email(); //( isset( $registration->ATT_email ) & ! empty( $registration->ATT_email ) ) ? $registration->ATT_email : ''; |
|
1762 | + $this->_template_args['attendees'][$att_nmbr]['final_price'] = $registration->final_price(); //( isset( $registration->REG_final_price ) & ! empty( $registration->REG_final_price ) ) ? $registration->REG_final_price : ''; |
|
1763 | 1763 | |
1764 | - $this->_template_args['attendees'][ $att_nmbr ]['address'] = implode( ', ', $attendee->full_address_as_array() ); |
|
1764 | + $this->_template_args['attendees'][$att_nmbr]['address'] = implode(', ', $attendee->full_address_as_array()); |
|
1765 | 1765 | |
1766 | - $this->_template_args['attendees'][ $att_nmbr ]['att_link'] = self::add_query_args_and_nonce( array( 'action'=>'edit_attendee', 'post'=>$attendee->ID() ), REG_ADMIN_URL ); |
|
1766 | + $this->_template_args['attendees'][$att_nmbr]['att_link'] = self::add_query_args_and_nonce(array('action'=>'edit_attendee', 'post'=>$attendee->ID()), REG_ADMIN_URL); |
|
1767 | 1767 | |
1768 | 1768 | $att_nmbr++; |
1769 | 1769 | } |
@@ -1775,8 +1775,8 @@ discard block |
||
1775 | 1775 | |
1776 | 1776 | // $this->_template_args['registration_form_url'] = add_query_arg( array( 'action' => 'edit_registration', 'process' => 'attendees' ), REG_ADMIN_URL ); |
1777 | 1777 | } |
1778 | - $template_path = REG_TEMPLATE_PATH . 'reg_admin_details_main_meta_box_attendees.template.php'; |
|
1779 | - echo EEH_Template::display_template( $template_path, $this->_template_args, TRUE ); |
|
1778 | + $template_path = REG_TEMPLATE_PATH.'reg_admin_details_main_meta_box_attendees.template.php'; |
|
1779 | + echo EEH_Template::display_template($template_path, $this->_template_args, TRUE); |
|
1780 | 1780 | |
1781 | 1781 | } |
1782 | 1782 | |
@@ -1797,11 +1797,11 @@ discard block |
||
1797 | 1797 | $attendee = $att_check instanceof EE_Attendee ? $att_check : EEM_Attendee::instance()->create_default_object(); |
1798 | 1798 | |
1799 | 1799 | //now let's determine if this is not the primary registration. If it isn't then we set the primary_registration object for reference BUT ONLY if the Attendee object loaded is not the same as the primary registration object (that way we know if we need to show cereate button or not) |
1800 | - if ( ! $this->_registration->is_primary_registrant() ) { |
|
1800 | + if ( ! $this->_registration->is_primary_registrant()) { |
|
1801 | 1801 | $primary_registration = $this->_registration->get_primary_registration(); |
1802 | 1802 | $primary_attendee = $primary_registration->attendee(); |
1803 | 1803 | |
1804 | - if ( ! $primary_attendee instanceof EE_Attendee || $attendee->ID() !== $primary_attendee->ID() ) { |
|
1804 | + if ( ! $primary_attendee instanceof EE_Attendee || $attendee->ID() !== $primary_attendee->ID()) { |
|
1805 | 1805 | //in here? This means the displayed registration is not the primary registrant but ALREADY HAS its own custom attendee object so let's not worry about the primary reg. |
1806 | 1806 | $primary_registration = NULL; |
1807 | 1807 | } |
@@ -1810,27 +1810,27 @@ discard block |
||
1810 | 1810 | } |
1811 | 1811 | |
1812 | 1812 | $this->_template_args['ATT_ID'] = $attendee->ID(); |
1813 | - $this->_template_args['fname'] = $attendee->fname();//$this->_registration->ATT_fname; |
|
1814 | - $this->_template_args['lname'] = $attendee->lname();//$this->_registration->ATT_lname; |
|
1815 | - $this->_template_args['email'] = $attendee->email();//$this->_registration->ATT_email; |
|
1813 | + $this->_template_args['fname'] = $attendee->fname(); //$this->_registration->ATT_fname; |
|
1814 | + $this->_template_args['lname'] = $attendee->lname(); //$this->_registration->ATT_lname; |
|
1815 | + $this->_template_args['email'] = $attendee->email(); //$this->_registration->ATT_email; |
|
1816 | 1816 | $this->_template_args['phone'] = $attendee->phone(); |
1817 | 1817 | |
1818 | - $this->_template_args[ 'formatted_address' ] = EEH_Address::format( $attendee ); |
|
1818 | + $this->_template_args['formatted_address'] = EEH_Address::format($attendee); |
|
1819 | 1819 | |
1820 | 1820 | |
1821 | 1821 | //edit link |
1822 | - $this->_template_args['att_edit_link'] = EE_Admin_Page::add_query_args_and_nonce( array( 'action'=>'edit_attendee', 'post'=>$attendee->ID() ), REG_ADMIN_URL ); |
|
1822 | + $this->_template_args['att_edit_link'] = EE_Admin_Page::add_query_args_and_nonce(array('action'=>'edit_attendee', 'post'=>$attendee->ID()), REG_ADMIN_URL); |
|
1823 | 1823 | $this->_template_args['att_edit_label'] = __('View/Edit Contact', 'event_espresso'); |
1824 | 1824 | |
1825 | 1825 | //create link |
1826 | - $this->_template_args['create_link'] = $primary_registration instanceof EE_Registration ? EE_Admin_Page::add_query_args_and_nonce( array( 'action' => 'duplicate_attendee', '_REG_ID' => $this->_registration->ID() ), REG_ADMIN_URL ): ''; |
|
1826 | + $this->_template_args['create_link'] = $primary_registration instanceof EE_Registration ? EE_Admin_Page::add_query_args_and_nonce(array('action' => 'duplicate_attendee', '_REG_ID' => $this->_registration->ID()), REG_ADMIN_URL) : ''; |
|
1827 | 1827 | $this->_template_args['create_label'] = __('Create Contact', 'event_espresso'); |
1828 | 1828 | |
1829 | 1829 | $this->_template_args['att_check'] = $att_check; |
1830 | 1830 | |
1831 | 1831 | |
1832 | - $template_path = REG_TEMPLATE_PATH . 'reg_admin_details_side_meta_box_registrant.template.php'; |
|
1833 | - echo EEH_Template::display_template( $template_path, $this->_template_args, TRUE ); |
|
1832 | + $template_path = REG_TEMPLATE_PATH.'reg_admin_details_side_meta_box_registrant.template.php'; |
|
1833 | + echo EEH_Template::display_template($template_path, $this->_template_args, TRUE); |
|
1834 | 1834 | } |
1835 | 1835 | |
1836 | 1836 | |
@@ -1843,7 +1843,7 @@ discard block |
||
1843 | 1843 | * @access protected |
1844 | 1844 | * @return void |
1845 | 1845 | */ |
1846 | - protected function _trash_or_restore_registrations( $trash = TRUE ) { |
|
1846 | + protected function _trash_or_restore_registrations($trash = TRUE) { |
|
1847 | 1847 | $REGM = EEM_Registration::instance(); |
1848 | 1848 | |
1849 | 1849 | $success = 1; |
@@ -1853,26 +1853,26 @@ discard block |
||
1853 | 1853 | $dtts = array(); |
1854 | 1854 | |
1855 | 1855 | //if empty _REG_ID then get out because there's nothing to do |
1856 | - if ( empty( $this->_req_data['_REG_ID'] ) ) { |
|
1856 | + if (empty($this->_req_data['_REG_ID'])) { |
|
1857 | 1857 | $msg = $trash ? __('In order to trash registrations you must select which ones you wish to trash by clicking the checkboxes.', 'event_espresso') : __('In order to restore registrations you must select which ones you wish to restore by clicking the checkboxes.', 'event_espresso'); |
1858 | - EE_Error::add_error( $msg, __FILE__, __LINE__, __FUNCTION__ ); |
|
1859 | - $this->_redirect_after_action(FALSE, '', '', array(), TRUE ); |
|
1858 | + EE_Error::add_error($msg, __FILE__, __LINE__, __FUNCTION__); |
|
1859 | + $this->_redirect_after_action(FALSE, '', '', array(), TRUE); |
|
1860 | 1860 | } |
1861 | 1861 | |
1862 | 1862 | //Checkboxes |
1863 | - if (!empty($this->_req_data['_REG_ID']) && is_array($this->_req_data['_REG_ID'])) { |
|
1863 | + if ( ! empty($this->_req_data['_REG_ID']) && is_array($this->_req_data['_REG_ID'])) { |
|
1864 | 1864 | // if array has more than one element than success message should be plural |
1865 | - $success = count( $this->_req_data['_REG_ID'] ) > 1 ? 2 : 1; |
|
1865 | + $success = count($this->_req_data['_REG_ID']) > 1 ? 2 : 1; |
|
1866 | 1866 | // cycle thru checkboxes |
1867 | - while (list( $ind, $REG_ID ) = each($this->_req_data['_REG_ID'])) { |
|
1867 | + while (list($ind, $REG_ID) = each($this->_req_data['_REG_ID'])) { |
|
1868 | 1868 | |
1869 | 1869 | $REG = $REGM->get_one_by_ID($REG_ID); |
1870 | 1870 | $payment_count = $REG->get_first_related('Transaction')->count_related('Payment'); |
1871 | - if ( $payment_count > 0 ) { |
|
1872 | - $name = $REG->attendee() instanceof EE_Attendee ? $REG->attendee()->full_name() : __( 'Unknown Attendee', 'event_espresso' ); |
|
1871 | + if ($payment_count > 0) { |
|
1872 | + $name = $REG->attendee() instanceof EE_Attendee ? $REG->attendee()->full_name() : __('Unknown Attendee', 'event_espresso'); |
|
1873 | 1873 | $error = 1; |
1874 | 1874 | $success = 0; |
1875 | - EE_Error::add_error( sprintf( __('The registration for %s could not be trashed because it has payments attached to the related transaction. If you wish to trash this registration you must first delete the payments on the related transaction.', 'event_espresso'), $name ), __FILE__, __FUNCTION__, __LINE__ ); |
|
1875 | + EE_Error::add_error(sprintf(__('The registration for %s could not be trashed because it has payments attached to the related transaction. If you wish to trash this registration you must first delete the payments on the related transaction.', 'event_espresso'), $name), __FILE__, __FUNCTION__, __LINE__); |
|
1876 | 1876 | continue; //can't trash this registration because it has payments. |
1877 | 1877 | } |
1878 | 1878 | $ticket = $REG->get_first_related('Ticket'); |
@@ -1881,7 +1881,7 @@ discard block |
||
1881 | 1881 | $dtts = array_merge($dtts, $dtt); |
1882 | 1882 | |
1883 | 1883 | $updated = $trash ? $REG->delete() : $REG->restore(); |
1884 | - if ( !$updated ) { |
|
1884 | + if ( ! $updated) { |
|
1885 | 1885 | $success = 0; |
1886 | 1886 | } else { |
1887 | 1887 | $success = 2; |
@@ -1896,7 +1896,7 @@ discard block |
||
1896 | 1896 | $tickets[$ticket->ID()] = $ticket; |
1897 | 1897 | $dtts = $ticket->get_many_related('Datetime'); |
1898 | 1898 | $updated = $trash ? $REG->delete() : $REG->restore(); |
1899 | - if ( ! $updated ) { |
|
1899 | + if ( ! $updated) { |
|
1900 | 1900 | $success = 0; |
1901 | 1901 | } |
1902 | 1902 | |
@@ -1906,10 +1906,10 @@ discard block |
||
1906 | 1906 | EEM_Ticket::instance()->update_tickets_sold($tickets); |
1907 | 1907 | EEM_Datetime::instance()->update_sold($dtts); |
1908 | 1908 | |
1909 | - $what = $success > 1 ? __( 'Registrations', 'event_espresso' ) : __( 'Registration', 'event_espresso' ); |
|
1910 | - $action_desc = $trash ? __( 'moved to the trash', 'event_espresso' ) : __( 'restored', 'event_espresso' ); |
|
1909 | + $what = $success > 1 ? __('Registrations', 'event_espresso') : __('Registration', 'event_espresso'); |
|
1910 | + $action_desc = $trash ? __('moved to the trash', 'event_espresso') : __('restored', 'event_espresso'); |
|
1911 | 1911 | $overwrite_msgs = $error ? TRUE : FALSE; |
1912 | - $this->_redirect_after_action( $success, $what, $action_desc, array( 'action' => 'default' ), $overwrite_msgs ); |
|
1912 | + $this->_redirect_after_action($success, $what, $action_desc, array('action' => 'default'), $overwrite_msgs); |
|
1913 | 1913 | } |
1914 | 1914 | |
1915 | 1915 | |
@@ -1933,16 +1933,16 @@ discard block |
||
1933 | 1933 | $success = 1; |
1934 | 1934 | |
1935 | 1935 | //Checkboxes |
1936 | - if (!empty($this->_req_data['_REG_ID']) && is_array($this->_req_data['_REG_ID'])) { |
|
1936 | + if ( ! empty($this->_req_data['_REG_ID']) && is_array($this->_req_data['_REG_ID'])) { |
|
1937 | 1937 | // if array has more than one element than success message should be plural |
1938 | - $success = count( $this->_req_data['_REG_ID'] ) > 1 ? 2 : 1; |
|
1938 | + $success = count($this->_req_data['_REG_ID']) > 1 ? 2 : 1; |
|
1939 | 1939 | // cycle thru checkboxes |
1940 | - while (list( $ind, $REG_ID ) = each($this->_req_data['_REG_ID'])) { |
|
1940 | + while (list($ind, $REG_ID) = each($this->_req_data['_REG_ID'])) { |
|
1941 | 1941 | $REG = $REG_MDL->get_one_by_ID($REG_ID); |
1942 | - if ( ! $REG instanceof EE_Registration ) |
|
1942 | + if ( ! $REG instanceof EE_Registration) |
|
1943 | 1943 | continue; |
1944 | 1944 | $deleted = $this->_delete_registration($REG); |
1945 | - if ( !$deleted ) { |
|
1945 | + if ( ! $deleted) { |
|
1946 | 1946 | $success = 0; |
1947 | 1947 | } |
1948 | 1948 | } |
@@ -1952,15 +1952,15 @@ discard block |
||
1952 | 1952 | $REG_ID = $this->_req_data['_REG_ID']; |
1953 | 1953 | $REG = $REG_MDL->get_one_by_ID($REG_ID); |
1954 | 1954 | $deleted = $this->_delete_registration($REG); |
1955 | - if ( ! $deleted ) { |
|
1955 | + if ( ! $deleted) { |
|
1956 | 1956 | $success = 0; |
1957 | 1957 | } |
1958 | 1958 | |
1959 | 1959 | } |
1960 | 1960 | |
1961 | - $what = $success > 1 ? __( 'Registrations', 'event_espresso' ) : __( 'Registration', 'event_espresso' ); |
|
1962 | - $action_desc = __( 'permanently deleted.', 'event_espresso' ); |
|
1963 | - $this->_redirect_after_action( $success, $what, $action_desc, array( 'action' => 'default' ), TRUE ); |
|
1961 | + $what = $success > 1 ? __('Registrations', 'event_espresso') : __('Registration', 'event_espresso'); |
|
1962 | + $action_desc = __('permanently deleted.', 'event_espresso'); |
|
1963 | + $this->_redirect_after_action($success, $what, $action_desc, array('action' => 'default'), TRUE); |
|
1964 | 1964 | } |
1965 | 1965 | |
1966 | 1966 | |
@@ -1972,31 +1972,31 @@ discard block |
||
1972 | 1972 | * @param EE_Registration $REG registration to be deleted permenantly |
1973 | 1973 | * @return boolean true = successful deletion, false = fail. |
1974 | 1974 | */ |
1975 | - protected function _delete_registration( EE_Registration $REG ) { |
|
1975 | + protected function _delete_registration(EE_Registration $REG) { |
|
1976 | 1976 | //first we start with the transaction... ultimately, we WILL not delete permanently if there are any related registrations on the transaction that are NOT trashed. |
1977 | 1977 | $TXN = $REG->get_first_related('Transaction'); |
1978 | 1978 | $REGS = $TXN->get_many_related('Registration'); |
1979 | 1979 | |
1980 | 1980 | $all_trashed = TRUE; |
1981 | - foreach ( $REGS as $registration ) { |
|
1982 | - if ( ! $registration->get('REG_deleted') ) |
|
1981 | + foreach ($REGS as $registration) { |
|
1982 | + if ( ! $registration->get('REG_deleted')) |
|
1983 | 1983 | $all_trashed = FALSE; |
1984 | 1984 | } |
1985 | 1985 | |
1986 | - if ( ! $all_trashed ) { |
|
1987 | - EE_Error::add_error( __('Unable to permanently delete this registration. Before this registration can be permanently deleted, all registrations made in the same transaction must be trashed as well. These registrations will be permanently deleted in the same action.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ ); |
|
1986 | + if ( ! $all_trashed) { |
|
1987 | + EE_Error::add_error(__('Unable to permanently delete this registration. Before this registration can be permanently deleted, all registrations made in the same transaction must be trashed as well. These registrations will be permanently deleted in the same action.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__); |
|
1988 | 1988 | return false; |
1989 | 1989 | } |
1990 | 1990 | |
1991 | 1991 | //k made it here so that means we can delete all the related transactions and their answers (but let's do them separately from THIS one). |
1992 | - foreach ( $REGS as $registration ) { |
|
1992 | + foreach ($REGS as $registration) { |
|
1993 | 1993 | |
1994 | 1994 | //delete related answers |
1995 | 1995 | $registration->delete_related_permanently('Answer'); |
1996 | 1996 | |
1997 | 1997 | //remove relationship to EE_Attendee (but we ALWAYS leave the contact record intact) |
1998 | 1998 | $attendee = $registration->get_first_related('Attendee'); |
1999 | - if ( $attendee instanceof EE_Attendee ) { |
|
1999 | + if ($attendee instanceof EE_Attendee) { |
|
2000 | 2000 | $registration->_remove_relation_to($attendee, 'Attendee'); |
2001 | 2001 | } |
2002 | 2002 | |
@@ -2006,7 +2006,7 @@ discard block |
||
2006 | 2006 | //now delete permanently the checkins related to this registration. |
2007 | 2007 | $registration->delete_related_permanently('Checkin'); |
2008 | 2008 | |
2009 | - if ( $registration->ID() === $REG->ID() ) |
|
2009 | + if ($registration->ID() === $REG->ID()) |
|
2010 | 2010 | continue; //we don't want to delete permanently the existing registration just yet. |
2011 | 2011 | |
2012 | 2012 | //remove relation to transaction for these registrations if NOT the existing registrations |
@@ -2039,35 +2039,35 @@ discard block |
||
2039 | 2039 | * @return void |
2040 | 2040 | */ |
2041 | 2041 | public function new_registration() { |
2042 | - if ( ! $this->_set_reg_event() ) { |
|
2043 | - throw new EE_Error(__('Unable to continue with registering because there is no Event ID in the request', 'event_espresso') ); |
|
2042 | + if ( ! $this->_set_reg_event()) { |
|
2043 | + throw new EE_Error(__('Unable to continue with registering because there is no Event ID in the request', 'event_espresso')); |
|
2044 | 2044 | } |
2045 | - EE_Registry::instance()->REQ->set_espresso_page( TRUE ); |
|
2045 | + EE_Registry::instance()->REQ->set_espresso_page(TRUE); |
|
2046 | 2046 | // gotta start with a clean slate if we're not coming here via ajax |
2047 | 2047 | if ( |
2048 | - ! defined('DOING_AJAX' ) |
|
2049 | - && ( ! isset( $this->_req_data['processing_registration'] ) || isset( $this->_req_data['step_error'] ) ) |
|
2048 | + ! defined('DOING_AJAX') |
|
2049 | + && ( ! isset($this->_req_data['processing_registration']) || isset($this->_req_data['step_error'])) |
|
2050 | 2050 | ) { |
2051 | - EE_Registry::instance()->SSN->clear_session( __CLASS__, __FUNCTION__ ); |
|
2051 | + EE_Registry::instance()->SSN->clear_session(__CLASS__, __FUNCTION__); |
|
2052 | 2052 | } |
2053 | 2053 | |
2054 | - $this->_template_args['event_name'] = '' ; |
|
2054 | + $this->_template_args['event_name'] = ''; |
|
2055 | 2055 | // event name |
2056 | - if ( $this->_reg_event ) { |
|
2056 | + if ($this->_reg_event) { |
|
2057 | 2057 | $this->_template_args['event_name'] = $this->_reg_event->name(); |
2058 | - $edit_event_url = self::add_query_args_and_nonce( array( 'action'=>'edit', 'post'=>$this->_reg_event->ID() ), EVENTS_ADMIN_URL ); |
|
2059 | - $edit_event_lnk = '<a href="'.$edit_event_url.'" title="' . esc_attr__( 'Edit ', 'event_espresso' ) . $this->_reg_event->name() . '">' . __( 'Edit Event', 'event_espresso' ) . '</a>'; |
|
2060 | - $this->_template_args['event_name'] .= ' <span class="admin-page-header-edit-lnk not-bold">' . $edit_event_lnk . '</span>' ; |
|
2058 | + $edit_event_url = self::add_query_args_and_nonce(array('action'=>'edit', 'post'=>$this->_reg_event->ID()), EVENTS_ADMIN_URL); |
|
2059 | + $edit_event_lnk = '<a href="'.$edit_event_url.'" title="'.esc_attr__('Edit ', 'event_espresso').$this->_reg_event->name().'">'.__('Edit Event', 'event_espresso').'</a>'; |
|
2060 | + $this->_template_args['event_name'] .= ' <span class="admin-page-header-edit-lnk not-bold">'.$edit_event_lnk.'</span>'; |
|
2061 | 2061 | } |
2062 | 2062 | |
2063 | 2063 | $this->_template_args['step_content'] = $this->_get_registration_step_content(); |
2064 | 2064 | |
2065 | - if ( defined('DOING_AJAX' ) ) { |
|
2065 | + if (defined('DOING_AJAX')) { |
|
2066 | 2066 | $this->_return_json(); |
2067 | 2067 | } |
2068 | 2068 | // grab header |
2069 | - $template_path = REG_TEMPLATE_PATH . 'reg_admin_register_new_attendee.template.php'; |
|
2070 | - $this->_template_args['admin_page_content'] = EEH_Template::display_template( $template_path, $this->_template_args, TRUE ); |
|
2069 | + $template_path = REG_TEMPLATE_PATH.'reg_admin_register_new_attendee.template.php'; |
|
2070 | + $this->_template_args['admin_page_content'] = EEH_Template::display_template($template_path, $this->_template_args, TRUE); |
|
2071 | 2071 | |
2072 | 2072 | //$this->_set_publish_post_box_vars( NULL, FALSE, FALSE, NULL, FALSE ); |
2073 | 2073 | // the details template wrapper |
@@ -2084,7 +2084,7 @@ discard block |
||
2084 | 2084 | * @return string html |
2085 | 2085 | */ |
2086 | 2086 | protected function _get_registration_step_content() { |
2087 | - if ( isset( $_COOKIE[ 'ee_registration_added' ] ) && $_COOKIE[ 'ee_registration_added' ] ) { |
|
2087 | + if (isset($_COOKIE['ee_registration_added']) && $_COOKIE['ee_registration_added']) { |
|
2088 | 2088 | $warning_msg = sprintf( |
2089 | 2089 | __( |
2090 | 2090 | '%2$sWARNING!!!%3$s%1$sPlease do not use the back button to return to this page for the purpose of adding another registration.%1$sThis can result in lost and/or corrupted data.%1$sIf you wish to add another registration, then please click the%1$s%7$s"Add Another New Registration to Event"%8$s button%1$son the Transaction details page, after you are redirected.%1$s%1$s%4$s redirecting in %5$s seconds %6$s', |
@@ -2100,7 +2100,7 @@ discard block |
||
2100 | 2100 | '</b>' |
2101 | 2101 | ); |
2102 | 2102 | return ' |
2103 | - <div id="ee-add-reg-back-button-dv"><p>' . $warning_msg . '</p></div> |
|
2103 | + <div id="ee-add-reg-back-button-dv"><p>' . $warning_msg.'</p></div> |
|
2104 | 2104 | <script > |
2105 | 2105 | // WHOAH !!! it appears that someone is using the back button from the Transaction admin page |
2106 | 2106 | // after just adding a new registration... we gotta try to put a stop to that !!! |
@@ -2135,16 +2135,16 @@ discard block |
||
2135 | 2135 | $cart = EE_Registry::instance()->SSN->cart(); |
2136 | 2136 | $step = ! $cart instanceof EE_Cart ? 'ticket' : 'questions'; |
2137 | 2137 | |
2138 | - switch ( $step ) { |
|
2138 | + switch ($step) { |
|
2139 | 2139 | case 'ticket' : |
2140 | 2140 | $hidden_fields['processing_registration']['value'] = 1; |
2141 | 2141 | $template_args['title'] = __('Step One: Select the Ticket for this registration', 'event_espresso'); |
2142 | - $template_args['content'] = EED_Ticket_Selector::instance()->display_ticket_selector( $this->_reg_event ); |
|
2142 | + $template_args['content'] = EED_Ticket_Selector::instance()->display_ticket_selector($this->_reg_event); |
|
2143 | 2143 | $template_args['step_button_text'] = __('Add Tickets and Continue to Registrant Details', 'event_espresso'); |
2144 | 2144 | $template_args['show_notification_toggle'] = FALSE; |
2145 | 2145 | break; |
2146 | 2146 | case 'questions' : |
2147 | - $hidden_fields[ 'processing_registration' ][ 'value' ] = 2; |
|
2147 | + $hidden_fields['processing_registration']['value'] = 2; |
|
2148 | 2148 | $template_args['title'] = __('Step Two: Add Registrant Details for this Registration', 'event_espresso'); |
2149 | 2149 | //in theory we should be able to run EED_SPCO at this point because the cart should have been setup properly by the first process_reg_step run. |
2150 | 2150 | $template_args['content'] = EED_Single_Page_Checkout::registration_checkout_for_admin(); |
@@ -2153,10 +2153,10 @@ discard block |
||
2153 | 2153 | break; |
2154 | 2154 | } |
2155 | 2155 | |
2156 | - $this->_set_add_edit_form_tags( 'process_reg_step', $hidden_fields ); //we come back to the process_registration_step route. |
|
2156 | + $this->_set_add_edit_form_tags('process_reg_step', $hidden_fields); //we come back to the process_registration_step route. |
|
2157 | 2157 | |
2158 | 2158 | return EEH_Template::display_template( |
2159 | - REG_TEMPLATE_PATH . 'reg_admin_register_new_attendee_step_content.template.php', $template_args, TRUE |
|
2159 | + REG_TEMPLATE_PATH.'reg_admin_register_new_attendee_step_content.template.php', $template_args, TRUE |
|
2160 | 2160 | ); |
2161 | 2161 | } |
2162 | 2162 | |
@@ -2171,11 +2171,11 @@ discard block |
||
2171 | 2171 | * @return boolean |
2172 | 2172 | */ |
2173 | 2173 | private function _set_reg_event() { |
2174 | - if ( is_object( $this->_reg_event )) { |
|
2174 | + if (is_object($this->_reg_event)) { |
|
2175 | 2175 | return TRUE; |
2176 | 2176 | } |
2177 | - $EVT_ID = ( ! empty( $this->_req_data['event_id'] )) ? absint( $this->_req_data['event_id'] ) : FALSE; |
|
2178 | - if ( ! $EVT_ID ) { |
|
2177 | + $EVT_ID = ( ! empty($this->_req_data['event_id'])) ? absint($this->_req_data['event_id']) : FALSE; |
|
2178 | + if ( ! $EVT_ID) { |
|
2179 | 2179 | return FALSE; |
2180 | 2180 | } |
2181 | 2181 | |
@@ -2196,82 +2196,82 @@ discard block |
||
2196 | 2196 | public function process_reg_step() { |
2197 | 2197 | EE_System::do_not_cache(); |
2198 | 2198 | $this->_set_reg_event(); |
2199 | - EE_Registry::instance()->REQ->set_espresso_page( TRUE ); |
|
2199 | + EE_Registry::instance()->REQ->set_espresso_page(TRUE); |
|
2200 | 2200 | |
2201 | 2201 | //what step are we on? |
2202 | 2202 | $cart = EE_Registry::instance()->SSN->cart(); |
2203 | 2203 | $step = ! $cart instanceof EE_Cart ? 'ticket' : 'questions'; |
2204 | 2204 | |
2205 | 2205 | //if doing ajax then we need to verify the nonce |
2206 | - if ( defined( 'DOING_AJAX' ) ) { |
|
2207 | - $nonce = isset( $this->_req_data[$this->_req_nonce] ) ? sanitize_text_field( $this->_req_data[$this->_req_nonce] ) : ''; |
|
2208 | - $this->_verify_nonce( $nonce, $this->_req_nonce ); |
|
2206 | + if (defined('DOING_AJAX')) { |
|
2207 | + $nonce = isset($this->_req_data[$this->_req_nonce]) ? sanitize_text_field($this->_req_data[$this->_req_nonce]) : ''; |
|
2208 | + $this->_verify_nonce($nonce, $this->_req_nonce); |
|
2209 | 2209 | } |
2210 | 2210 | |
2211 | - switch ( $step ) { |
|
2211 | + switch ($step) { |
|
2212 | 2212 | |
2213 | 2213 | case 'ticket' : |
2214 | 2214 | //process ticket selection |
2215 | 2215 | $success = EED_Ticket_Selector::instance()->process_ticket_selections(); |
2216 | - if ( $success ) { |
|
2217 | - EE_Error::add_success( __('Tickets Selected. Now complete the registration.'), 'event_espresso'); |
|
2216 | + if ($success) { |
|
2217 | + EE_Error::add_success(__('Tickets Selected. Now complete the registration.'), 'event_espresso'); |
|
2218 | 2218 | } else { |
2219 | 2219 | $query_args['step_error'] = $this->_req_data['step_error'] = TRUE; |
2220 | 2220 | } |
2221 | - if ( defined('DOING_AJAX') ) { |
|
2221 | + if (defined('DOING_AJAX')) { |
|
2222 | 2222 | $this->new_registration(); //display next step |
2223 | 2223 | } else { |
2224 | 2224 | $query_args['action'] = 'new_registration'; |
2225 | 2225 | $query_args['processing_registration'] = 1; |
2226 | 2226 | $query_args['event_id'] = $this->_reg_event->ID(); |
2227 | - $this->_redirect_after_action( FALSE, '', '', $query_args, TRUE ); |
|
2227 | + $this->_redirect_after_action(FALSE, '', '', $query_args, TRUE); |
|
2228 | 2228 | } |
2229 | 2229 | break; |
2230 | 2230 | |
2231 | 2231 | case 'questions' : |
2232 | - if( ! isset( $this->_req_data[ 'txn_reg_status_change' ], $this->_req_data[ 'txn_reg_status_change' ][ 'send_notifications' ] ) ) { |
|
2233 | - add_filter( 'FHEE__EED_Messages___maybe_registration__deliver_notifications', '__return_false', 15 ); |
|
2232 | + if ( ! isset($this->_req_data['txn_reg_status_change'], $this->_req_data['txn_reg_status_change']['send_notifications'])) { |
|
2233 | + add_filter('FHEE__EED_Messages___maybe_registration__deliver_notifications', '__return_false', 15); |
|
2234 | 2234 | } |
2235 | 2235 | //process registration |
2236 | 2236 | $transaction = EED_Single_Page_Checkout::instance()->process_registration_from_admin(); |
2237 | - if ( $cart instanceof EE_Cart ) { |
|
2237 | + if ($cart instanceof EE_Cart) { |
|
2238 | 2238 | $grand_total = $cart->get_cart_grand_total(); |
2239 | - if ( $grand_total instanceof EE_Line_Item ) { |
|
2239 | + if ($grand_total instanceof EE_Line_Item) { |
|
2240 | 2240 | $grand_total->save_this_and_descendants_to_txn(); |
2241 | 2241 | } |
2242 | 2242 | } |
2243 | - if ( ! $transaction instanceof EE_Transaction ) { |
|
2243 | + if ( ! $transaction instanceof EE_Transaction) { |
|
2244 | 2244 | $query_args = array( |
2245 | 2245 | 'action' => 'new_registration', |
2246 | 2246 | 'processing_registration' => 2, |
2247 | 2247 | 'event_id' => $this->_reg_event->ID() |
2248 | 2248 | ); |
2249 | 2249 | |
2250 | - if ( defined('DOING_AJAX' )) { |
|
2250 | + if (defined('DOING_AJAX')) { |
|
2251 | 2251 | //display registration form again because there are errors (maybe validation?) |
2252 | 2252 | $this->new_registration(); |
2253 | 2253 | return; |
2254 | 2254 | } else { |
2255 | - $this->_redirect_after_action( FALSE, '', '', $query_args, TRUE ); |
|
2255 | + $this->_redirect_after_action(FALSE, '', '', $query_args, TRUE); |
|
2256 | 2256 | return; |
2257 | 2257 | } |
2258 | 2258 | } |
2259 | 2259 | /** @type EE_Transaction_Payments $transaction_payments */ |
2260 | - $transaction_payments = EE_Registry::instance()->load_class( 'Transaction_Payments' ); |
|
2260 | + $transaction_payments = EE_Registry::instance()->load_class('Transaction_Payments'); |
|
2261 | 2261 | // maybe update status, and make sure to save transaction if not done already |
2262 | - if ( ! $transaction_payments->update_transaction_status_based_on_total_paid( $transaction )) { |
|
2262 | + if ( ! $transaction_payments->update_transaction_status_based_on_total_paid($transaction)) { |
|
2263 | 2263 | $transaction->save(); |
2264 | 2264 | } |
2265 | - EE_Registry::instance()->SSN->clear_session( __CLASS__, __FUNCTION__ ); |
|
2265 | + EE_Registry::instance()->SSN->clear_session(__CLASS__, __FUNCTION__); |
|
2266 | 2266 | $this->_req_data = array(); |
2267 | 2267 | $query_args = array( |
2268 | 2268 | 'action' => 'redirect_to_txn', |
2269 | 2269 | 'TXN_ID' => $transaction->ID(), |
2270 | 2270 | 'EVT_ID' => $this->_reg_event->ID(), |
2271 | - 'event_name' => urlencode( $this->_reg_event->name() ), |
|
2271 | + 'event_name' => urlencode($this->_reg_event->name()), |
|
2272 | 2272 | 'redirect_from' => 'new_registration' |
2273 | 2273 | ); |
2274 | - $this->_redirect_after_action( false, '', '', $query_args, true ); |
|
2274 | + $this->_redirect_after_action(false, '', '', $query_args, true); |
|
2275 | 2275 | break; |
2276 | 2276 | } |
2277 | 2277 | |
@@ -2288,21 +2288,21 @@ discard block |
||
2288 | 2288 | */ |
2289 | 2289 | public function redirect_to_txn() { |
2290 | 2290 | EE_System::do_not_cache(); |
2291 | - EE_Registry::instance()->SSN->clear_session( __CLASS__, __FUNCTION__ ); |
|
2291 | + EE_Registry::instance()->SSN->clear_session(__CLASS__, __FUNCTION__); |
|
2292 | 2292 | $query_args = array( |
2293 | 2293 | 'action' => 'view_transaction', |
2294 | - 'TXN_ID' => isset( $this->_req_data['TXN_ID'] ) ? absint( $this->_req_data[ 'TXN_ID' ] ) : 0, |
|
2294 | + 'TXN_ID' => isset($this->_req_data['TXN_ID']) ? absint($this->_req_data['TXN_ID']) : 0, |
|
2295 | 2295 | 'page' => 'espresso_transactions' |
2296 | 2296 | ); |
2297 | - if ( isset( $this->_req_data[ 'EVT_ID' ], $this->_req_data[ 'redirect_from' ] ) ) { |
|
2298 | - $query_args['EVT_ID'] = $this->_req_data[ 'EVT_ID' ]; |
|
2299 | - $query_args['event_name'] = urlencode( $this->_req_data[ 'event_name' ] ); |
|
2300 | - $query_args['redirect_from'] = $this->_req_data[ 'redirect_from' ]; |
|
2297 | + if (isset($this->_req_data['EVT_ID'], $this->_req_data['redirect_from'])) { |
|
2298 | + $query_args['EVT_ID'] = $this->_req_data['EVT_ID']; |
|
2299 | + $query_args['event_name'] = urlencode($this->_req_data['event_name']); |
|
2300 | + $query_args['redirect_from'] = $this->_req_data['redirect_from']; |
|
2301 | 2301 | } |
2302 | 2302 | EE_Error::add_success( |
2303 | - __( 'Registration Created. Please review the transaction and add any payments as necessary', 'event_espresso' ) |
|
2303 | + __('Registration Created. Please review the transaction and add any payments as necessary', 'event_espresso') |
|
2304 | 2304 | ); |
2305 | - $this->_redirect_after_action( false, '', '', $query_args, true ); |
|
2305 | + $this->_redirect_after_action(false, '', '', $query_args, true); |
|
2306 | 2306 | } |
2307 | 2307 | |
2308 | 2308 | |
@@ -2313,7 +2313,7 @@ discard block |
||
2313 | 2313 | * @return void |
2314 | 2314 | */ |
2315 | 2315 | protected function _attendee_contact_list_table() { |
2316 | - do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' ); |
|
2316 | + do_action('AHEE_log', __FILE__, __FUNCTION__, ''); |
|
2317 | 2317 | $this->_search_btn_label = __('Contacts', 'event_espresso'); |
2318 | 2318 | $this->display_admin_list_table_page_with_no_sidebar(); |
2319 | 2319 | } |
@@ -2328,10 +2328,10 @@ discard block |
||
2328 | 2328 | * @access public |
2329 | 2329 | * @return array |
2330 | 2330 | */ |
2331 | - public function get_attendees( $per_page, $count = FALSE, $trash = FALSE ) { |
|
2331 | + public function get_attendees($per_page, $count = FALSE, $trash = FALSE) { |
|
2332 | 2332 | |
2333 | - do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' ); |
|
2334 | - require_once( REG_ADMIN . 'EE_Attendee_Contact_List_Table.class.php' ); |
|
2333 | + do_action('AHEE_log', __FILE__, __FUNCTION__, ''); |
|
2334 | + require_once(REG_ADMIN.'EE_Attendee_Contact_List_Table.class.php'); |
|
2335 | 2335 | $ATT_MDL = EEM_Attendee::instance(); |
2336 | 2336 | |
2337 | 2337 | $this->_req_data['orderby'] = ! empty($this->_req_data['orderby']) ? $this->_req_data['orderby'] : ''; |
@@ -2359,47 +2359,47 @@ discard block |
||
2359 | 2359 | $orderby = 'ATT_lname'; |
2360 | 2360 | } |
2361 | 2361 | |
2362 | - $sort = ( isset( $this->_req_data['order'] ) && ! empty( $this->_req_data['order'] )) ? $this->_req_data['order'] : 'ASC'; |
|
2362 | + $sort = (isset($this->_req_data['order']) && ! empty($this->_req_data['order'])) ? $this->_req_data['order'] : 'ASC'; |
|
2363 | 2363 | |
2364 | - $current_page = isset( $this->_req_data['paged'] ) && !empty( $this->_req_data['paged'] ) ? $this->_req_data['paged'] : 1; |
|
2365 | - $per_page = isset( $per_page ) && !empty( $per_page ) ? $per_page : 10; |
|
2366 | - $per_page = isset( $this->_req_data['perpage'] ) && !empty( $this->_req_data['perpage'] ) ? $this->_req_data['perpage'] : $per_page; |
|
2364 | + $current_page = isset($this->_req_data['paged']) && ! empty($this->_req_data['paged']) ? $this->_req_data['paged'] : 1; |
|
2365 | + $per_page = isset($per_page) && ! empty($per_page) ? $per_page : 10; |
|
2366 | + $per_page = isset($this->_req_data['perpage']) && ! empty($this->_req_data['perpage']) ? $this->_req_data['perpage'] : $per_page; |
|
2367 | 2367 | |
2368 | 2368 | $_where = array(); |
2369 | 2369 | |
2370 | - if ( isset( $this->_req_data['s'] ) ) { |
|
2371 | - $sstr = '%' . $this->_req_data['s'] . '%'; |
|
2370 | + if (isset($this->_req_data['s'])) { |
|
2371 | + $sstr = '%'.$this->_req_data['s'].'%'; |
|
2372 | 2372 | $_where['OR'] = array( |
2373 | - 'Registration.Event.EVT_name' => array( 'LIKE', $sstr), |
|
2374 | - 'Registration.Event.EVT_desc' => array( 'LIKE', $sstr ), |
|
2375 | - 'Registration.Event.EVT_short_desc' => array( 'LIKE' , $sstr ), |
|
2376 | - 'ATT_fname' => array( 'LIKE', $sstr ), |
|
2377 | - 'ATT_lname' => array( 'LIKE', $sstr ), |
|
2378 | - 'ATT_short_bio' => array( 'LIKE', $sstr ), |
|
2379 | - 'ATT_email' => array('LIKE', $sstr ), |
|
2380 | - 'ATT_address' => array( 'LIKE', $sstr ), |
|
2381 | - 'ATT_address2' => array( 'LIKE', $sstr ), |
|
2382 | - 'ATT_city' => array( 'LIKE', $sstr ), |
|
2383 | - 'Country.CNT_name' => array( 'LIKE', $sstr ), |
|
2384 | - 'State.STA_name' => array('LIKE', $sstr ), |
|
2385 | - 'ATT_phone' => array( 'LIKE', $sstr ), |
|
2386 | - 'Registration.REG_final_price' => array( 'LIKE', $sstr ), |
|
2387 | - 'Registration.REG_code' => array( 'LIKE', $sstr ), |
|
2388 | - 'Registration.REG_count' => array( 'LIKE' , $sstr ), |
|
2389 | - 'Registration.REG_group_size' => array( 'LIKE' , $sstr ) |
|
2373 | + 'Registration.Event.EVT_name' => array('LIKE', $sstr), |
|
2374 | + 'Registration.Event.EVT_desc' => array('LIKE', $sstr), |
|
2375 | + 'Registration.Event.EVT_short_desc' => array('LIKE', $sstr), |
|
2376 | + 'ATT_fname' => array('LIKE', $sstr), |
|
2377 | + 'ATT_lname' => array('LIKE', $sstr), |
|
2378 | + 'ATT_short_bio' => array('LIKE', $sstr), |
|
2379 | + 'ATT_email' => array('LIKE', $sstr), |
|
2380 | + 'ATT_address' => array('LIKE', $sstr), |
|
2381 | + 'ATT_address2' => array('LIKE', $sstr), |
|
2382 | + 'ATT_city' => array('LIKE', $sstr), |
|
2383 | + 'Country.CNT_name' => array('LIKE', $sstr), |
|
2384 | + 'State.STA_name' => array('LIKE', $sstr), |
|
2385 | + 'ATT_phone' => array('LIKE', $sstr), |
|
2386 | + 'Registration.REG_final_price' => array('LIKE', $sstr), |
|
2387 | + 'Registration.REG_code' => array('LIKE', $sstr), |
|
2388 | + 'Registration.REG_count' => array('LIKE', $sstr), |
|
2389 | + 'Registration.REG_group_size' => array('LIKE', $sstr) |
|
2390 | 2390 | ); |
2391 | 2391 | } |
2392 | 2392 | |
2393 | 2393 | |
2394 | - $offset = ($current_page-1)*$per_page; |
|
2395 | - $limit = $count ? NULL : array( $offset, $per_page ); |
|
2394 | + $offset = ($current_page - 1) * $per_page; |
|
2395 | + $limit = $count ? NULL : array($offset, $per_page); |
|
2396 | 2396 | |
2397 | - if ( $trash ) { |
|
2398 | - $_where['status'] = array( '!=', 'publish' ); |
|
2399 | - $all_attendees = $count ? $ATT_MDL->count( array($_where,'order_by'=>array($orderby=>$sort), 'limit'=>$limit)): $ATT_MDL->get_all( array($_where,'order_by'=>array($orderby=>$sort), 'limit'=>$limit)); |
|
2397 | + if ($trash) { |
|
2398 | + $_where['status'] = array('!=', 'publish'); |
|
2399 | + $all_attendees = $count ? $ATT_MDL->count(array($_where, 'order_by'=>array($orderby=>$sort), 'limit'=>$limit)) : $ATT_MDL->get_all(array($_where, 'order_by'=>array($orderby=>$sort), 'limit'=>$limit)); |
|
2400 | 2400 | } else { |
2401 | - $_where['status'] = array( 'IN', array( 'publish' ) ); |
|
2402 | - $all_attendees = $count ? $ATT_MDL->count( array($_where, 'order_by'=>array($orderby=>$sort),'limit'=>$limit)) : $ATT_MDL->get_all( array($_where, 'order_by'=>array($orderby=>$sort), 'limit'=>$limit) ); |
|
2401 | + $_where['status'] = array('IN', array('publish')); |
|
2402 | + $all_attendees = $count ? $ATT_MDL->count(array($_where, 'order_by'=>array($orderby=>$sort), 'limit'=>$limit)) : $ATT_MDL->get_all(array($_where, 'order_by'=>array($orderby=>$sort), 'limit'=>$limit)); |
|
2403 | 2403 | } |
2404 | 2404 | |
2405 | 2405 | return $all_attendees; |
@@ -2416,10 +2416,10 @@ discard block |
||
2416 | 2416 | */ |
2417 | 2417 | protected function _resend_registration() { |
2418 | 2418 | $this->_process_resend_registration(); |
2419 | - $query_args = isset($this->_req_data['redirect_to'] ) ? array('action' => $this->_req_data['redirect_to'], '_REG_ID' => $this->_req_data['_REG_ID'] ) : array( |
|
2419 | + $query_args = isset($this->_req_data['redirect_to']) ? array('action' => $this->_req_data['redirect_to'], '_REG_ID' => $this->_req_data['_REG_ID']) : array( |
|
2420 | 2420 | 'action' => 'default' |
2421 | 2421 | ); |
2422 | - $this->_redirect_after_action(FALSE, '', '', $query_args, TRUE ); |
|
2422 | + $this->_redirect_after_action(FALSE, '', '', $query_args, TRUE); |
|
2423 | 2423 | } |
2424 | 2424 | |
2425 | 2425 | |
@@ -2427,26 +2427,26 @@ discard block |
||
2427 | 2427 | |
2428 | 2428 | |
2429 | 2429 | |
2430 | - public function _registrations_report(){ |
|
2431 | - if( ! defined( 'EE_USE_OLD_CSV_REPORT_CLASS' ) ) { |
|
2432 | - wp_redirect( EE_Admin_Page::add_query_args_and_nonce( |
|
2430 | + public function _registrations_report() { |
|
2431 | + if ( ! defined('EE_USE_OLD_CSV_REPORT_CLASS')) { |
|
2432 | + wp_redirect(EE_Admin_Page::add_query_args_and_nonce( |
|
2433 | 2433 | array( |
2434 | 2434 | 'page' => 'espresso_batch', |
2435 | 2435 | 'batch' => 'file', |
2436 | - 'EVT_ID' => isset( $this->_req_data[ 'EVT_ID'] ) ? $this->_req_data[ 'EVT_ID' ] : NULL, |
|
2437 | - 'job_handler' => urlencode( 'EventEspressoBatchRequest\JobHandlers\RegistrationsReport' ), |
|
2438 | - 'return_url' => urlencode( $this->_req_data[ 'return_url' ] ), |
|
2439 | - )) ); |
|
2436 | + 'EVT_ID' => isset($this->_req_data['EVT_ID']) ? $this->_req_data['EVT_ID'] : NULL, |
|
2437 | + 'job_handler' => urlencode('EventEspressoBatchRequest\JobHandlers\RegistrationsReport'), |
|
2438 | + 'return_url' => urlencode($this->_req_data['return_url']), |
|
2439 | + ))); |
|
2440 | 2440 | } else { |
2441 | 2441 | $new_request_args = array( |
2442 | 2442 | 'export' => 'report', |
2443 | 2443 | 'action' => 'registrations_report_for_event', |
2444 | - 'EVT_ID' => isset( $this->_req_data[ 'EVT_ID'] ) ? $this->_req_data[ 'EVT_ID' ] : NULL, |
|
2444 | + 'EVT_ID' => isset($this->_req_data['EVT_ID']) ? $this->_req_data['EVT_ID'] : NULL, |
|
2445 | 2445 | ); |
2446 | 2446 | $this->_req_data = array_merge($this->_req_data, $new_request_args); |
2447 | 2447 | |
2448 | - if ( is_readable(EE_CLASSES . 'EE_Export.class.php')) { |
|
2449 | - require_once(EE_CLASSES . 'EE_Export.class.php'); |
|
2448 | + if (is_readable(EE_CLASSES.'EE_Export.class.php')) { |
|
2449 | + require_once(EE_CLASSES.'EE_Export.class.php'); |
|
2450 | 2450 | $EE_Export = EE_Export::instance($this->_req_data); |
2451 | 2451 | $EE_Export->export(); |
2452 | 2452 | } |
@@ -2455,26 +2455,26 @@ discard block |
||
2455 | 2455 | |
2456 | 2456 | |
2457 | 2457 | |
2458 | - public function _contact_list_export(){ |
|
2459 | - if ( is_readable(EE_CLASSES . 'EE_Export.class.php')) { |
|
2460 | - require_once(EE_CLASSES . 'EE_Export.class.php'); |
|
2458 | + public function _contact_list_export() { |
|
2459 | + if (is_readable(EE_CLASSES.'EE_Export.class.php')) { |
|
2460 | + require_once(EE_CLASSES.'EE_Export.class.php'); |
|
2461 | 2461 | $EE_Export = EE_Export::instance($this->_req_data); |
2462 | 2462 | $EE_Export->export_attendees(); |
2463 | 2463 | } |
2464 | 2464 | } |
2465 | 2465 | |
2466 | - public function _contact_list_report(){ |
|
2467 | - if( ! defined( 'EE_USE_OLD_CSV_REPORT_CLASS' ) ) { |
|
2468 | - wp_redirect( EE_Admin_Page::add_query_args_and_nonce( |
|
2466 | + public function _contact_list_report() { |
|
2467 | + if ( ! defined('EE_USE_OLD_CSV_REPORT_CLASS')) { |
|
2468 | + wp_redirect(EE_Admin_Page::add_query_args_and_nonce( |
|
2469 | 2469 | array( |
2470 | 2470 | 'page' => 'espresso_batch', |
2471 | 2471 | 'batch' => 'file', |
2472 | - 'job_handler' => urlencode( 'EventEspressoBatchRequest\JobHandlers\AttendeesReport' ), |
|
2473 | - 'return_url' => urlencode( $this->_req_data[ 'return_url' ] ), |
|
2474 | - )) ); |
|
2472 | + 'job_handler' => urlencode('EventEspressoBatchRequest\JobHandlers\AttendeesReport'), |
|
2473 | + 'return_url' => urlencode($this->_req_data['return_url']), |
|
2474 | + ))); |
|
2475 | 2475 | } else { |
2476 | - if ( is_readable(EE_CLASSES . 'EE_Export.class.php')) { |
|
2477 | - require_once(EE_CLASSES . 'EE_Export.class.php'); |
|
2476 | + if (is_readable(EE_CLASSES.'EE_Export.class.php')) { |
|
2477 | + require_once(EE_CLASSES.'EE_Export.class.php'); |
|
2478 | 2478 | $EE_Export = EE_Export::instance($this->_req_data); |
2479 | 2479 | $EE_Export->report_attendees(); |
2480 | 2480 | } |
@@ -2494,73 +2494,73 @@ discard block |
||
2494 | 2494 | * @return void |
2495 | 2495 | */ |
2496 | 2496 | protected function _duplicate_attendee() { |
2497 | - $action = !empty( $this->_req_data['return'] ) ? $this->_req_data['return'] : 'default'; |
|
2497 | + $action = ! empty($this->_req_data['return']) ? $this->_req_data['return'] : 'default'; |
|
2498 | 2498 | //verify we have necessary info |
2499 | - if ( empty($this->_req_data['_REG_ID'] ) ) { |
|
2500 | - EE_Error::add_error( __('Unable to create the contact for the registration because the required paramaters are not present (_REG_ID )', 'event_espresso'), __FILE__, __LINE__, __FUNCTION__ ); |
|
2501 | - $query_args = array( 'action' => $action ); |
|
2499 | + if (empty($this->_req_data['_REG_ID'])) { |
|
2500 | + EE_Error::add_error(__('Unable to create the contact for the registration because the required paramaters are not present (_REG_ID )', 'event_espresso'), __FILE__, __LINE__, __FUNCTION__); |
|
2501 | + $query_args = array('action' => $action); |
|
2502 | 2502 | $this->_redirect_after_action('', '', '', $query_args, TRUE); |
2503 | 2503 | } |
2504 | 2504 | |
2505 | 2505 | //okay necessary deets present... let's dupe the incoming attendee and attach to incoming registration. |
2506 | - $registration = EEM_Registration::instance()->get_one_by_ID( $this->_req_data['_REG_ID'] ); |
|
2506 | + $registration = EEM_Registration::instance()->get_one_by_ID($this->_req_data['_REG_ID']); |
|
2507 | 2507 | $attendee = $registration->attendee(); |
2508 | 2508 | |
2509 | 2509 | //remove relation of existing attendee on registration |
2510 | - $registration->_remove_relation_to($attendee, 'Attendee' ); |
|
2510 | + $registration->_remove_relation_to($attendee, 'Attendee'); |
|
2511 | 2511 | //new attendee |
2512 | 2512 | $new_attendee = clone $attendee; |
2513 | - $new_attendee->set( 'ATT_ID', 0 ); |
|
2513 | + $new_attendee->set('ATT_ID', 0); |
|
2514 | 2514 | $new_attendee->save(); |
2515 | 2515 | |
2516 | 2516 | //add new attendee to reg |
2517 | - $registration->_add_relation_to( $new_attendee, 'Attendee'); |
|
2517 | + $registration->_add_relation_to($new_attendee, 'Attendee'); |
|
2518 | 2518 | |
2519 | - EE_Error::add_success( __('New Contact record created. Now make any edits you wish to make for this contact.', 'event_espresso') ); |
|
2519 | + EE_Error::add_success(__('New Contact record created. Now make any edits you wish to make for this contact.', 'event_espresso')); |
|
2520 | 2520 | |
2521 | 2521 | //redirect to edit page for attendee |
2522 | - $query_args = array( 'post' => $new_attendee->ID(), 'action' => 'edit_attendee' ); |
|
2522 | + $query_args = array('post' => $new_attendee->ID(), 'action' => 'edit_attendee'); |
|
2523 | 2523 | |
2524 | - $this->_redirect_after_action( '', '', '', $query_args, TRUE ); |
|
2524 | + $this->_redirect_after_action('', '', '', $query_args, TRUE); |
|
2525 | 2525 | } |
2526 | 2526 | |
2527 | 2527 | |
2528 | 2528 | //related to cpt routes |
2529 | 2529 | protected function _insert_update_cpt_item($post_id, $post) { |
2530 | 2530 | $success = true; |
2531 | - $attendee = EEM_Attendee::instance()->get_one_by_ID( $post_id ); |
|
2531 | + $attendee = EEM_Attendee::instance()->get_one_by_ID($post_id); |
|
2532 | 2532 | //for attendee updates |
2533 | - if ( $post->post_type = 'espresso_attendees' && !empty( $attendee ) ) { |
|
2533 | + if ($post->post_type = 'espresso_attendees' && ! empty($attendee)) { |
|
2534 | 2534 | //note we should only be UPDATING attendees at this point. |
2535 | 2535 | $updated_fields = array( |
2536 | 2536 | 'ATT_fname' => $this->_req_data['ATT_fname'], |
2537 | 2537 | 'ATT_lname' => $this->_req_data['ATT_lname'], |
2538 | - 'ATT_full_name'=> $this->_req_data['ATT_fname'] . ' ' . $this->_req_data['ATT_lname'], |
|
2538 | + 'ATT_full_name'=> $this->_req_data['ATT_fname'].' '.$this->_req_data['ATT_lname'], |
|
2539 | 2539 | 'ATT_address' => isset($this->_req_data['ATT_address']) ? $this->_req_data['ATT_address'] : '', |
2540 | 2540 | 'ATT_address2' => isset($this->_req_data['ATT_address2']) ? $this->_req_data['ATT_address2'] : '', |
2541 | - 'ATT_city' => isset( $this->_req_data['ATT_city'] ) ? $this->_req_data['ATT_city'] : '', |
|
2542 | - 'STA_ID' => isset( $this->_req_data['STA_ID'] ) ? $this->_req_data['STA_ID'] : '', |
|
2543 | - 'CNT_ISO' => isset( $this->_req_data['CNT_ISO'] ) ? $this->_req_data['CNT_ISO'] : '', |
|
2544 | - 'ATT_zip' => isset( $this->_req_data['ATT_zip'] ) ? $this->_req_data['ATT_zip'] : '', |
|
2545 | - 'ATT_email' => isset( $this->_req_data['ATT_email'] ) ? $this->_req_data['ATT_email'] : '', |
|
2546 | - 'ATT_phone' => isset( $this->_req_data['ATT_phone'] ) ? $this->_req_data['ATT_phone'] : '' |
|
2541 | + 'ATT_city' => isset($this->_req_data['ATT_city']) ? $this->_req_data['ATT_city'] : '', |
|
2542 | + 'STA_ID' => isset($this->_req_data['STA_ID']) ? $this->_req_data['STA_ID'] : '', |
|
2543 | + 'CNT_ISO' => isset($this->_req_data['CNT_ISO']) ? $this->_req_data['CNT_ISO'] : '', |
|
2544 | + 'ATT_zip' => isset($this->_req_data['ATT_zip']) ? $this->_req_data['ATT_zip'] : '', |
|
2545 | + 'ATT_email' => isset($this->_req_data['ATT_email']) ? $this->_req_data['ATT_email'] : '', |
|
2546 | + 'ATT_phone' => isset($this->_req_data['ATT_phone']) ? $this->_req_data['ATT_phone'] : '' |
|
2547 | 2547 | ); |
2548 | - foreach ( $updated_fields as $field => $value ) { |
|
2548 | + foreach ($updated_fields as $field => $value) { |
|
2549 | 2549 | $attendee->set($field, $value); |
2550 | 2550 | } |
2551 | 2551 | |
2552 | 2552 | $success = $attendee->save(); |
2553 | 2553 | |
2554 | - $attendee_update_callbacks = apply_filters( 'FHEE__Registrations_Admin_Page__insert_update_cpt_item__attendee_update', array() ); |
|
2555 | - foreach ( $attendee_update_callbacks as $a_callback ) { |
|
2556 | - if ( FALSE === call_user_func_array( $a_callback, array($attendee, $this->_req_data ) ) ) { |
|
2557 | - throw new EE_Error( sprintf( __('The %s callback given for the "FHEE__Registrations_Admin_Page__insert_update_cpt_item__attendee_update" filter is not a valid callback. Please check the spelling.', 'event_espresso'), $a_callback ) ); |
|
2554 | + $attendee_update_callbacks = apply_filters('FHEE__Registrations_Admin_Page__insert_update_cpt_item__attendee_update', array()); |
|
2555 | + foreach ($attendee_update_callbacks as $a_callback) { |
|
2556 | + if (FALSE === call_user_func_array($a_callback, array($attendee, $this->_req_data))) { |
|
2557 | + throw new EE_Error(sprintf(__('The %s callback given for the "FHEE__Registrations_Admin_Page__insert_update_cpt_item__attendee_update" filter is not a valid callback. Please check the spelling.', 'event_espresso'), $a_callback)); |
|
2558 | 2558 | } |
2559 | 2559 | } |
2560 | 2560 | } |
2561 | 2561 | |
2562 | - if ( $success === FALSE ) |
|
2563 | - EE_Error::add_error(__('Something went wrong with updating the meta table data for the registration.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__ ); |
|
2562 | + if ($success === FALSE) |
|
2563 | + EE_Error::add_error(__('Something went wrong with updating the meta table data for the registration.', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__); |
|
2564 | 2564 | |
2565 | 2565 | } |
2566 | 2566 | |
@@ -2580,17 +2580,17 @@ discard block |
||
2580 | 2580 | remove_meta_box('postexcerpt', __('Excerpt'), 'post_excerpt_meta_box', $this->_cpt_routes[$this->_req_action], 'normal', 'core'); |
2581 | 2581 | remove_meta_box('commentstatusdiv', $this->_cpt_routes[$this->_req_action], 'normal', 'core'); |
2582 | 2582 | |
2583 | - if ( post_type_supports( 'espresso_attendees', 'excerpt') ) { |
|
2584 | - add_meta_box('postexcerpt', __('Short Biography', 'event_espresso'), 'post_excerpt_meta_box', $this->_cpt_routes[$this->_req_action], 'normal' ); |
|
2583 | + if (post_type_supports('espresso_attendees', 'excerpt')) { |
|
2584 | + add_meta_box('postexcerpt', __('Short Biography', 'event_espresso'), 'post_excerpt_meta_box', $this->_cpt_routes[$this->_req_action], 'normal'); |
|
2585 | 2585 | } |
2586 | 2586 | |
2587 | - if ( post_type_supports( 'espresso_attendees', 'comments') ) { |
|
2587 | + if (post_type_supports('espresso_attendees', 'comments')) { |
|
2588 | 2588 | add_meta_box('commentsdiv', __('Notes on the Contact', 'event_espresso'), 'post_comment_meta_box', $this->_cpt_routes[$this->_req_action], 'normal', 'core'); |
2589 | 2589 | } |
2590 | 2590 | |
2591 | - add_meta_box('attendee_contact_info', __('Contact Info', 'event_espresso'), array( $this, 'attendee_contact_info'), $this->_cpt_routes[$this->_req_action], 'side', 'core' ); |
|
2592 | - add_meta_box('attendee_details_address', __('Address Details', 'event_espresso'), array($this, 'attendee_address_details'), $this->_cpt_routes[$this->_req_action], 'normal', 'core' ); |
|
2593 | - add_meta_box('attendee_registrations', __('Registrations for this Contact', 'event_espresso'), array( $this, 'attendee_registrations_meta_box'), $this->_cpt_routes[$this->_req_action], 'normal', 'high'); |
|
2591 | + add_meta_box('attendee_contact_info', __('Contact Info', 'event_espresso'), array($this, 'attendee_contact_info'), $this->_cpt_routes[$this->_req_action], 'side', 'core'); |
|
2592 | + add_meta_box('attendee_details_address', __('Address Details', 'event_espresso'), array($this, 'attendee_address_details'), $this->_cpt_routes[$this->_req_action], 'normal', 'core'); |
|
2593 | + add_meta_box('attendee_registrations', __('Registrations for this Contact', 'event_espresso'), array($this, 'attendee_registrations_meta_box'), $this->_cpt_routes[$this->_req_action], 'normal', 'high'); |
|
2594 | 2594 | } |
2595 | 2595 | |
2596 | 2596 | |
@@ -2599,10 +2599,10 @@ discard block |
||
2599 | 2599 | * @param WP_Post $post wp post object |
2600 | 2600 | * @return string attendee contact info ( and form ) |
2601 | 2601 | */ |
2602 | - public function attendee_contact_info( $post ) { |
|
2602 | + public function attendee_contact_info($post) { |
|
2603 | 2603 | //get attendee object ( should already have it ) |
2604 | 2604 | $this->_template_args['attendee'] = $this->_cpt_model_obj; |
2605 | - $template = REG_TEMPLATE_PATH . 'attendee_contact_info_metabox_content.template.php'; |
|
2605 | + $template = REG_TEMPLATE_PATH.'attendee_contact_info_metabox_content.template.php'; |
|
2606 | 2606 | EEH_Template::display_template($template, $this->_template_args); |
2607 | 2607 | } |
2608 | 2608 | |
@@ -2618,12 +2618,12 @@ discard block |
||
2618 | 2618 | $this->_template_args['attendee'] = $this->_cpt_model_obj; |
2619 | 2619 | $this->_template_args['state_html'] = EEH_Form_Fields::generate_form_input( |
2620 | 2620 | new EE_Question_Form_Input( |
2621 | - EE_Question::new_instance( array( |
|
2621 | + EE_Question::new_instance(array( |
|
2622 | 2622 | 'QST_ID' => 0, |
2623 | 2623 | 'QST_display_text' => __('State/Province', 'event_espresso'), |
2624 | 2624 | 'QST_system' => 'admin-state' |
2625 | 2625 | )), |
2626 | - EE_Answer::new_instance( array( |
|
2626 | + EE_Answer::new_instance(array( |
|
2627 | 2627 | 'ANS_ID' => 0, |
2628 | 2628 | 'ANS_value' => $this->_cpt_model_obj->state_ID() |
2629 | 2629 | )), |
@@ -2636,12 +2636,12 @@ discard block |
||
2636 | 2636 | )); |
2637 | 2637 | $this->_template_args['country_html'] = EEH_Form_Fields::generate_form_input( |
2638 | 2638 | new EE_Question_Form_Input( |
2639 | - EE_Question::new_instance( array( |
|
2639 | + EE_Question::new_instance(array( |
|
2640 | 2640 | 'QST_ID' => 0, |
2641 | 2641 | 'QST_display_text' => __('Country', 'event_espresso'), |
2642 | 2642 | 'QST_system' => 'admin-country' |
2643 | 2643 | )), |
2644 | - EE_Answer::new_instance( array( |
|
2644 | + EE_Answer::new_instance(array( |
|
2645 | 2645 | 'ANS_ID' => 0, |
2646 | 2646 | 'ANS_value' => $this->_cpt_model_obj->country_ID() |
2647 | 2647 | )), |
@@ -2652,8 +2652,8 @@ discard block |
||
2652 | 2652 | 'append_qstn_id' => FALSE |
2653 | 2653 | ) |
2654 | 2654 | )); |
2655 | - $template = REG_TEMPLATE_PATH . 'attendee_address_details_metabox_content.template.php'; |
|
2656 | - EEH_Template::display_template($template, $this->_template_args ); |
|
2655 | + $template = REG_TEMPLATE_PATH.'attendee_address_details_metabox_content.template.php'; |
|
2656 | + EEH_Template::display_template($template, $this->_template_args); |
|
2657 | 2657 | |
2658 | 2658 | } |
2659 | 2659 | |
@@ -2663,11 +2663,11 @@ discard block |
||
2663 | 2663 | * @access protected |
2664 | 2664 | * @return void |
2665 | 2665 | */ |
2666 | - public function attendee_registrations_meta_box( $post ) { |
|
2666 | + public function attendee_registrations_meta_box($post) { |
|
2667 | 2667 | |
2668 | 2668 | $this->_template_args['attendee'] = $this->_cpt_model_obj; |
2669 | 2669 | $this->_template_args['registrations'] = $this->_cpt_model_obj->get_many_related('Registration'); |
2670 | - $template = REG_TEMPLATE_PATH . 'attendee_registrations_main_meta_box.template.php'; |
|
2670 | + $template = REG_TEMPLATE_PATH.'attendee_registrations_main_meta_box.template.php'; |
|
2671 | 2671 | EEH_Template::display_template($template, $this->_template_args); |
2672 | 2672 | |
2673 | 2673 | } |
@@ -2681,8 +2681,8 @@ discard block |
||
2681 | 2681 | * @return string html for new form. |
2682 | 2682 | */ |
2683 | 2683 | public function after_title_form_fields($post) { |
2684 | - if ( $post->post_type == 'espresso_attendees' ) { |
|
2685 | - $template = REG_TEMPLATE_PATH . 'attendee_details_after_title_form_fields.template.php'; |
|
2684 | + if ($post->post_type == 'espresso_attendees') { |
|
2685 | + $template = REG_TEMPLATE_PATH.'attendee_details_after_title_form_fields.template.php'; |
|
2686 | 2686 | $template_args['attendee'] = $this->_cpt_model_obj; |
2687 | 2687 | EEH_Template::display_template($template, $template_args); |
2688 | 2688 | } |
@@ -2699,21 +2699,21 @@ discard block |
||
2699 | 2699 | * @access protected |
2700 | 2700 | * @return void |
2701 | 2701 | */ |
2702 | - protected function _trash_or_restore_attendees( $trash = TRUE ) { |
|
2702 | + protected function _trash_or_restore_attendees($trash = TRUE) { |
|
2703 | 2703 | |
2704 | - do_action( 'AHEE_log', __FILE__, __FUNCTION__, '' ); |
|
2704 | + do_action('AHEE_log', __FILE__, __FUNCTION__, ''); |
|
2705 | 2705 | |
2706 | 2706 | $ATT_MDL = EEM_Attendee::instance(); |
2707 | 2707 | |
2708 | 2708 | $success = 1; |
2709 | 2709 | //Checkboxes |
2710 | - if (!empty($this->_req_data['checkbox']) && is_array($this->_req_data['checkbox'])) { |
|
2710 | + if ( ! empty($this->_req_data['checkbox']) && is_array($this->_req_data['checkbox'])) { |
|
2711 | 2711 | // if array has more than one element than success message should be plural |
2712 | - $success = count( $this->_req_data['checkbox'] ) > 1 ? 2 : 1; |
|
2712 | + $success = count($this->_req_data['checkbox']) > 1 ? 2 : 1; |
|
2713 | 2713 | // cycle thru checkboxes |
2714 | - while (list( $ATT_ID, $value ) = each($this->_req_data['checkbox'])) { |
|
2715 | - $updated = $trash ? $ATT_MDL->update_by_ID(array( 'status' => 'trash' ), $ATT_ID) : $ATT_MDL->update_by_ID( array('status' => 'publish' ), $ATT_ID); |
|
2716 | - if ( !$updated ) { |
|
2714 | + while (list($ATT_ID, $value) = each($this->_req_data['checkbox'])) { |
|
2715 | + $updated = $trash ? $ATT_MDL->update_by_ID(array('status' => 'trash'), $ATT_ID) : $ATT_MDL->update_by_ID(array('status' => 'publish'), $ATT_ID); |
|
2716 | + if ( ! $updated) { |
|
2717 | 2717 | $success = 0; |
2718 | 2718 | } |
2719 | 2719 | } |
@@ -2722,18 +2722,18 @@ discard block |
||
2722 | 2722 | // grab single id and delete |
2723 | 2723 | $ATT_ID = absint($this->_req_data['ATT_ID']); |
2724 | 2724 | //get attendee |
2725 | - $att = $ATT_MDL->get_one_by_ID( $ATT_ID ); |
|
2725 | + $att = $ATT_MDL->get_one_by_ID($ATT_ID); |
|
2726 | 2726 | $updated = $trash ? $att->set_status('trash') : $att->set_status('publish'); |
2727 | 2727 | $updated = $att->save(); |
2728 | - if ( ! $updated ) { |
|
2728 | + if ( ! $updated) { |
|
2729 | 2729 | $success = 0; |
2730 | 2730 | } |
2731 | 2731 | |
2732 | 2732 | } |
2733 | 2733 | |
2734 | - $what = $success > 1 ? __( 'Contacts', 'event_espresso' ) : __( 'Contact', 'event_espresso' ); |
|
2735 | - $action_desc = $trash ? __( 'moved to the trash', 'event_espresso' ) : __( 'restored', 'event_espresso' ); |
|
2736 | - $this->_redirect_after_action( $success, $what, $action_desc, array( 'action' => 'contact_list' ) ); |
|
2734 | + $what = $success > 1 ? __('Contacts', 'event_espresso') : __('Contact', 'event_espresso'); |
|
2735 | + $action_desc = $trash ? __('moved to the trash', 'event_espresso') : __('restored', 'event_espresso'); |
|
2736 | + $this->_redirect_after_action($success, $what, $action_desc, array('action' => 'contact_list')); |
|
2737 | 2737 | |
2738 | 2738 | } |
2739 | 2739 |
@@ -200,7 +200,7 @@ |
||
200 | 200 | * generates an EE_Message using the supplied arguments and some defaults |
201 | 201 | * |
202 | 202 | * @param array $properties |
203 | - * @return string |
|
203 | + * @return EE_Message |
|
204 | 204 | */ |
205 | 205 | protected function _generate_message( $properties = array() ) { |
206 | 206 | $message = EE_Message_Factory::create( |
@@ -105,14 +105,14 @@ discard block |
||
105 | 105 | public function __construct( |
106 | 106 | $messenger_name, |
107 | 107 | $message_type_name, |
108 | - $data = array(), |
|
108 | + $data = array(), |
|
109 | 109 | $context = '', |
110 | 110 | $preview = false, |
111 | 111 | $status = EEM_Message::status_incomplete |
112 | 112 | ) { |
113 | - $this->_messenger_name = $messenger_name; |
|
114 | - $this->_message_type_name = $message_type_name; |
|
115 | - $this->_data = is_array( $data ) ? $data : array( $data ); |
|
113 | + $this->_messenger_name = $messenger_name; |
|
114 | + $this->_message_type_name = $message_type_name; |
|
115 | + $this->_data = is_array($data) ? $data : array($data); |
|
116 | 116 | $this->_context = $context; |
117 | 117 | $this->_preview = $preview; |
118 | 118 | $this->_status = $status; |
@@ -170,8 +170,8 @@ discard block |
||
170 | 170 | /** |
171 | 171 | * @param boolean $preview |
172 | 172 | */ |
173 | - public function set_preview( $preview ) { |
|
174 | - $this->_preview = filter_var( $preview, FILTER_VALIDATE_BOOLEAN ); |
|
173 | + public function set_preview($preview) { |
|
174 | + $this->_preview = filter_var($preview, FILTER_VALIDATE_BOOLEAN); |
|
175 | 175 | } |
176 | 176 | |
177 | 177 | |
@@ -202,7 +202,7 @@ discard block |
||
202 | 202 | * @param array $properties |
203 | 203 | * @return string |
204 | 204 | */ |
205 | - protected function _generate_message( $properties = array() ) { |
|
205 | + protected function _generate_message($properties = array()) { |
|
206 | 206 | $message = EE_Message_Factory::create( |
207 | 207 | array_merge( |
208 | 208 | array( |
@@ -216,12 +216,12 @@ discard block |
||
216 | 216 | ); |
217 | 217 | // validate the message, and if it's good, set some properties |
218 | 218 | try { |
219 | - $message->is_valid_for_sending_or_generation( true ); |
|
219 | + $message->is_valid_for_sending_or_generation(true); |
|
220 | 220 | $this->_valid = true; |
221 | 221 | $this->_messenger = $message->messenger_object(); |
222 | 222 | $this->_message_type = $message->message_type_object(); |
223 | 223 | $this->_send_now = $message->send_now(); |
224 | - } catch ( Exception $e ) { |
|
224 | + } catch (Exception $e) { |
|
225 | 225 | $this->_valid = false; |
226 | 226 | $this->_error_msg[] = $e->getMessage(); |
227 | 227 | } |
@@ -237,7 +237,7 @@ discard block |
||
237 | 237 | */ |
238 | 238 | public function get_EE_Message() { |
239 | 239 | // already set ? |
240 | - if ( $this->_message instanceof EE_Message ) { |
|
240 | + if ($this->_message instanceof EE_Message) { |
|
241 | 241 | return $this->_message; |
242 | 242 | } |
243 | 243 | // no? then let's create one |
@@ -255,15 +255,15 @@ discard block |
||
255 | 255 | * @param bool $preview Used to indicate that the preview data handler is to be returned. |
256 | 256 | * @return string |
257 | 257 | */ |
258 | - public function get_data_handler_class_name( $preview = false ) { |
|
259 | - if ( $this->_data_handler_class_name === '' && $this->valid() ) { |
|
260 | - $ref = $preview ? 'Preview' : $this->_message_type->get_data_handler( $this->_data ); |
|
258 | + public function get_data_handler_class_name($preview = false) { |
|
259 | + if ($this->_data_handler_class_name === '' && $this->valid()) { |
|
260 | + $ref = $preview ? 'Preview' : $this->_message_type->get_data_handler($this->_data); |
|
261 | 261 | //make sure internal data is updated. |
262 | 262 | $this->_data = $this->_message_type->get_data(); |
263 | 263 | |
264 | 264 | //verify |
265 | - $this->_data_handler_class_name = EE_Message_To_Generate::verify_and_retrieve_class_name_for_data_handler_reference( $ref ); |
|
266 | - if ( $this->_data_handler_class_name === '' ) { |
|
265 | + $this->_data_handler_class_name = EE_Message_To_Generate::verify_and_retrieve_class_name_for_data_handler_reference($ref); |
|
266 | + if ($this->_data_handler_class_name === '') { |
|
267 | 267 | $this->_valid = false; |
268 | 268 | } |
269 | 269 | } |
@@ -279,9 +279,9 @@ discard block |
||
279 | 279 | * @param string $data_handler_reference |
280 | 280 | * @return string |
281 | 281 | */ |
282 | - public static function verify_and_retrieve_class_name_for_data_handler_reference( $data_handler_reference ) { |
|
283 | - $class_name = 'EE_Messages_' . $data_handler_reference . '_incoming_data'; |
|
284 | - if ( ! class_exists( $class_name ) ) { |
|
282 | + public static function verify_and_retrieve_class_name_for_data_handler_reference($data_handler_reference) { |
|
283 | + $class_name = 'EE_Messages_'.$data_handler_reference.'_incoming_data'; |
|
284 | + if ( ! class_exists($class_name)) { |
|
285 | 285 | EE_Error::add_error( |
286 | 286 | sprintf( |
287 | 287 | __( |