Skip to content

Commit

Permalink
Merge pull request #1595 from WordImpress/issue/1571
Browse files Browse the repository at this point in the history
Removed give_export_all_customers() and code cleanup
  • Loading branch information
Devin Walker committed Mar 30, 2017
2 parents 4d3209a + 6866344 commit 170e3e1
Show file tree
Hide file tree
Showing 7 changed files with 9 additions and 31 deletions.
3 changes: 2 additions & 1 deletion includes/admin/class-admin-settings.php
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,8 @@ public static function save() {
$current_tab = give_get_current_setting_tab();

if ( empty( $_REQUEST['_give-save-settings'] ) || ! wp_verify_nonce( $_REQUEST['_give-save-settings'], 'give-save-settings' ) ) {
die( __( 'Action failed. Please refresh the page and retry.', 'give' ) );
echo '<div class="notice error"><p>' . __( 'Action failed. Please refresh the page and retry.', 'give' ) . '</p></div>';
die();
}

/**
Expand Down
1 change: 0 additions & 1 deletion includes/admin/payments/view-order-details.php
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
$payment_date = strtotime( $payment->date );
$user_info = give_get_payment_meta_user_info( $payment_id );
$address = $payment->address;
$gateway = $payment->gateway;
$currency_code = $payment->currency;
$gateway = $payment->gateway;
$currency_code = $payment->currency;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public function set_properties( $request ) {
}
}

$this->price_id = ! empty( $request['give_price_option'] ) && 0 !== $request['give_price_option'] ? absint( $request['give_price_option'] ) : null;
$this->price_id = ! empty( $request['give_price_option'] ) && 'all' !== $request['give_price_option'] ? absint( $request['give_price_option'] ) : null;

}

Expand All @@ -94,8 +94,6 @@ public function set_properties( $request ) {
*/
public function csv_cols() {

$cols = array();

$columns = isset( $this->data['give_export_option'] ) ? $this->data['give_export_option'] : array();

// We need columns.
Expand Down Expand Up @@ -215,7 +213,7 @@ public function get_data() {
}
} else {

// Export all customers
// Export all donors.
$offset = 30 * ( $this->step - 1 );
$donors = Give()->customers->get_customers( array( 'number' => 30, 'offset' => $offset ) );

Expand Down
23 changes: 3 additions & 20 deletions includes/admin/reporting/export/export-actions.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,25 +63,6 @@ function give_export_earnings() {
add_action( 'give_earnings_export', 'give_export_earnings' );


/**
* Export all the customers to a CSV file.
*
* Note: The WordPress Database API is being used directly for performance
* reasons (workaround of calling all posts and fetch data respectively)
*
* @since 1.5
* @return void
*/
function give_export_all_customers() {
require_once GIVE_PLUGIN_DIR . 'includes/admin/reporting/class-export-customers.php';

$customer_export = new Give_Donors_Export();

$customer_export->export();
}

add_action( 'give_email_export', 'give_export_all_customers' );

/**
* Add a hook allowing extensions to register a hook on the batch export process
*
Expand All @@ -107,6 +88,7 @@ function give_register_batch_exporters() {

/**
* Register the payments batch exporter
*
* @since 1.5
*/
function give_register_payments_batch_export() {
Expand Down Expand Up @@ -134,6 +116,7 @@ function give_include_payments_batch_processor( $class ) {

/**
* Register the customers batch exporter
*
* @since 1.5.2
*/
function give_register_customers_batch_export() {
Expand Down Expand Up @@ -185,4 +168,4 @@ function give_include_forms_batch_processor( $class ) {
require_once GIVE_PLUGIN_DIR . 'includes/admin/reporting/export/class-batch-export-forms.php';
}

}
}
3 changes: 0 additions & 3 deletions includes/admin/reporting/reports.php
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,6 @@ function give_reports_tab_export() {
'placeholder' => __( 'Choose one or more from categories', 'give' ),
)
);
$add_break = true;
}

if ( give_is_setting_enabled( give_get_option( 'tags' ) ) ) {
Expand All @@ -462,7 +461,6 @@ function give_reports_tab_export() {
'placeholder' => __( 'Choose one or more from tags', 'give' ),
)
);
$add_break = true;
}

wp_nonce_field( 'give_ajax_export', 'give_ajax_export' );
Expand Down Expand Up @@ -529,7 +527,6 @@ function give_reports_tab_export() {
<?php wp_nonce_field( 'give_ajax_export', 'give_ajax_export' ); ?>
<input type="hidden" name="give-export-class" value="Give_Batch_Customers_Export"/>
<input type="hidden" name="give_export_option[query_id]" value="<?php echo uniqid( 'give_' ); ?>"/>
<input type="hidden" name="give_action" value="email_export"/>
</form>
</td>
</tr>
Expand Down
2 changes: 1 addition & 1 deletion includes/ajax-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -386,7 +386,7 @@ function give_check_for_form_price_variations() {
$ajax_response = '<select class="give_price_options_select give-select give-select" name="give_price_option">';

if ( isset( $_POST['all_prices'] ) ) {
$ajax_response .= '<option value="">' . esc_html__( 'All Levels', 'give' ) . '</option>';
$ajax_response .= '<option value="all">' . esc_html__( 'All Levels', 'give' ) . '</option>';
}

foreach ( $variable_prices as $key => $price ) {
Expand Down
2 changes: 1 addition & 1 deletion includes/payments/class-payments-query.php
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,7 @@ public function init() {
* @since 1.0
* @access public
*
* @return object
* @return array
*/
public function get_payments() {

Expand Down

0 comments on commit 170e3e1

Please sign in to comment.