From 6d0c2f61db56c061dad13066d2abfb2056ba0bff Mon Sep 17 00:00:00 2001 From: raftaar1191 Date: Fri, 16 Mar 2018 02:14:32 +0530 Subject: [PATCH 01/67] feat(admin-setting): Add company name fields setting #2453 --- .../admin/settings/class-settings-display.php | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/includes/admin/settings/class-settings-display.php b/includes/admin/settings/class-settings-display.php index 1f466beeea..894574abef 100644 --- a/includes/admin/settings/class-settings-display.php +++ b/includes/admin/settings/class-settings-display.php @@ -286,6 +286,30 @@ public function get_settings() { ), ); break; + case 'form-settings': + $settings = array( + array( + 'id' => 'give_title_display_settings_5', + 'type' => 'title', + ), + array( + 'name' => __( 'Company Donations', 'give' ), + 'desc' => __( 'Do you want a Company field to appear after First Name and Last Name?', 'give' ), + 'id' => 'company_donation', + 'type' => 'radio_inline', + 'default' => 'disabled', + 'options' => array( + 'disabled' => __( 'Disabled', 'give' ), + 'required' => __( 'Required', 'give' ), + 'optional' => __( 'Optional', 'give' ), + ), + ), + array( + 'id' => 'give_title_display_settings_5', + 'type' => 'sectionend', + ), + ); + break; } /** @@ -319,6 +343,7 @@ public function get_sections() { 'post-types' => __( 'Post Types', 'give' ), 'taxonomies' => __( 'Taxonomies', 'give' ), 'term-and-conditions' => __( 'Terms and Conditions', 'give' ), + 'form-settings' => __( 'Forms', 'give' ), ); return apply_filters( 'give_get_sections_' . $this->id, $sections ); From c38025ae0846d5ee64a668c6fe75e09ee6481ef2 Mon Sep 17 00:00:00 2001 From: raftaar1191 Date: Fri, 16 Mar 2018 03:00:50 +0530 Subject: [PATCH 02/67] feat(admin-donation): Add company name fields setting in donation page #2453 --- includes/admin/forms/class-metabox-form-data.php | 14 ++++++++++++++ includes/admin/settings/class-settings-display.php | 6 +++--- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/includes/admin/forms/class-metabox-form-data.php b/includes/admin/forms/class-metabox-form-data.php index d891cc906d..49df805f2f 100644 --- a/includes/admin/forms/class-metabox-form-data.php +++ b/includes/admin/forms/class-metabox-form-data.php @@ -274,6 +274,20 @@ function get_settings() { 'id' => $prefix . 'default_gateway', 'type' => 'default_gateway', ), + array( + 'name' => __( 'Company Donations', 'give' ), + 'desc' => __( 'Do you want a Company field to appear after First Name and Last Name?', 'give' ), + 'id' => $prefix . 'company_field', + 'type' => 'radio_inline', + 'default' => 'global', + 'options' => array( + 'global' => __( 'Global Option', 'give' ), + 'required' => __( 'Required', 'give' ), + 'optional' => __( 'Optional', 'give' ), + 'disabled' => __( 'Disabled', 'give' ), + + ), + ), array( 'name' => __( 'Guest Donations', 'give' ), 'desc' => __( 'Do you want to allow non-logged-in users to make donations?', 'give' ), diff --git a/includes/admin/settings/class-settings-display.php b/includes/admin/settings/class-settings-display.php index 894574abef..33a67b5b07 100644 --- a/includes/admin/settings/class-settings-display.php +++ b/includes/admin/settings/class-settings-display.php @@ -286,7 +286,7 @@ public function get_settings() { ), ); break; - case 'form-settings': + case 'form-display': $settings = array( array( 'id' => 'give_title_display_settings_5', @@ -295,7 +295,7 @@ public function get_settings() { array( 'name' => __( 'Company Donations', 'give' ), 'desc' => __( 'Do you want a Company field to appear after First Name and Last Name?', 'give' ), - 'id' => 'company_donation', + 'id' => 'company_field', 'type' => 'radio_inline', 'default' => 'disabled', 'options' => array( @@ -343,7 +343,7 @@ public function get_sections() { 'post-types' => __( 'Post Types', 'give' ), 'taxonomies' => __( 'Taxonomies', 'give' ), 'term-and-conditions' => __( 'Terms and Conditions', 'give' ), - 'form-settings' => __( 'Forms', 'give' ), + 'form-display' => __( 'Form Display', 'give' ), ); return apply_filters( 'give_get_sections_' . $this->id, $sections ); From c4dca2d64d583143418b4ba9793e04f4342f909d Mon Sep 17 00:00:00 2001 From: raftaar1191 Date: Fri, 16 Mar 2018 04:48:00 +0530 Subject: [PATCH 03/67] feat(donation): Add company name fields in donation page #2453 --- includes/forms/functions.php | 37 ++++++++++++++++++++++++ includes/misc-functions.php | 54 +++++++++++++++++++++++++++++++++-- includes/process-donation.php | 7 +++++ 3 files changed, 96 insertions(+), 2 deletions(-) diff --git a/includes/forms/functions.php b/includes/forms/functions.php index 1f6b71d377..3bd7198e90 100644 --- a/includes/forms/functions.php +++ b/includes/forms/functions.php @@ -1037,3 +1037,40 @@ function _give_get_prefill_form_field_values( $form_id ) { // Output. return wp_parse_args( $give_donor_info_in_session, $logged_in_donor_info ); } + +/** + * Add Company Name fileds in Donation Form. + * + * @since 2.0.7 + * + * @param int $form_id Donation Form ID. + */ +function give_donation_form_company_fields( $form_id ) { + if ( give_is_company_donation_show( $form_id ) ) { + $give_company = give_field_is_required( 'give_company', $form_id ); + ?> +

+ + + + /> + +

+ 'invalid_company', + 'error_message' => __( 'Please enter Company Name.', 'give' ), + ); + } + /** * Filters the donation form required field. * From 1c5d41faea860b1c4e914019f039f1e50a2542cc Mon Sep 17 00:00:00 2001 From: raftaar1191 Date: Fri, 16 Mar 2018 05:38:39 +0530 Subject: [PATCH 04/67] feat(donation): Save company name fields at the time of processing #2453 --- includes/actions.php | 26 ++++++++++++++++++++++++++ includes/forms/functions.php | 2 +- 2 files changed, 27 insertions(+), 1 deletion(-) diff --git a/includes/actions.php b/includes/actions.php index 1bc1632bbc..03e94e73bb 100644 --- a/includes/actions.php +++ b/includes/actions.php @@ -334,4 +334,30 @@ function give_update_log_form_id( $args ) { add_action( 'give_update_log_form_id', 'give_update_log_form_id' ); +/** + * Add meta in payment that store Company Name. + * + * Will add/update when user add click on the checkout page. + * The status of the donation doest not matter as it get change when user had made the payment successfully. + * + * @since 2.0.7 + * + * @param int $payment_id Payment id for which the meta value should be updated. + */ +function give_donation_save_company_name( $payment_id ) { + $give_company = ( ! empty( $_REQUEST['give_company'] ) ? give_clean( $_REQUEST['give_company'] ) : false ); + + // Check $page_url is not empty. + if ( $give_company ) { + give_update_meta( $payment_id, '_give_donation_company', $give_company ); + + $donor_id = (int) give_get_meta( $payment_id, '_give_payment_donor_id', true ); + if ( ! empty( $donor_id ) ) { + $donor = new Give_Donor( $donor_id ); + $donor->update_meta( '_give_donor_company', $give_company ); + } + } +} +// Fire when payment is save. +add_action( 'give_insert_payment', 'give_donation_save_company_name' ); \ No newline at end of file diff --git a/includes/forms/functions.php b/includes/forms/functions.php index 3bd7198e90..2a5d42a161 100644 --- a/includes/forms/functions.php +++ b/includes/forms/functions.php @@ -1073,4 +1073,4 @@ class="give-input required" } } -add_action( 'give_donation_form_before_email', 'give_donation_form_company_fields', 10, 1 ); \ No newline at end of file +add_action( 'give_donation_form_before_email', 'give_donation_form_company_fields', 0, 1 ); \ No newline at end of file From dee1143bdb1a3a6681eebb4d0800965c6430cce7 Mon Sep 17 00:00:00 2001 From: raftaar1191 Date: Fri, 16 Mar 2018 06:10:25 +0530 Subject: [PATCH 05/67] feat(donor): Show save donor company details #2453 --- includes/admin/donors/donors.php | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/includes/admin/donors/donors.php b/includes/admin/donors/donors.php index 4c15c7fcd9..8fe4c6035e 100644 --- a/includes/admin/donors/donors.php +++ b/includes/admin/donors/donors.php @@ -427,6 +427,25 @@ class="button info-item editable donor-edit-link"> + + get_meta( '_give_donor_company', true ); + + if ( ! empty( $donor_company ) ) { + ?> + + + + + + + + + From 6c4a5474274faf1d12caf64b6bda371c5e28e3c2 Mon Sep 17 00:00:00 2001 From: raftaar1191 Date: Fri, 16 Mar 2018 06:20:57 +0530 Subject: [PATCH 06/67] feat(shortcode): Show Company name on donation receipt page #2453 --- templates/shortcode-profile-editor.php | 17 ++++++++++++++++- templates/shortcode-receipt.php | 18 ++++++++++++++++++ 2 files changed, 34 insertions(+), 1 deletion(-) diff --git a/templates/shortcode-profile-editor.php b/templates/shortcode-profile-editor.php index b1ef3beb78..9bdcedb3bb 100644 --- a/templates/shortcode-profile-editor.php +++ b/templates/shortcode-profile-editor.php @@ -10,12 +10,16 @@ $current_user = wp_get_current_user(); if ( is_user_logged_in() ) : - $user_id = get_current_user_id(); + $user_id = get_current_user_id(); $first_name = get_user_meta( $user_id, 'first_name', true ); $last_name = get_user_meta( $user_id, 'last_name', true ); + $last_name = get_user_meta( $user_id, 'last_name', true ); $display_name = $current_user->display_name; $address = give_get_donor_address( $user_id, array( 'address_type' => 'personal' ) ); + $donor = new Give_Donor( $user_id, true ); + $company_name = $donor->get_meta( '_give_donor_company', true ); + if ( isset( $_GET['updated'] ) && 'true' === $_GET['updated'] && ! give_get_errors() ) : if ( isset( $_GET['update_code'] ) ) :?> "/>

+ +

+ + +

+ +

diff --git a/includes/process-donation.php b/includes/process-donation.php index 9f5db63923..999f8280e0 100644 --- a/includes/process-donation.php +++ b/includes/process-donation.php @@ -522,7 +522,7 @@ function give_get_required_fields( $form_id ) { } if ( give_is_company_donation_enabled( $form_id ) ) { - $required_fields['give_company'] = array( + $required_fields['give_company_name'] = array( 'error_id' => 'invalid_company', 'error_message' => __( 'Please enter Company Name.', 'give' ), ); From 90fc35934df7deb55e477a95521c5a8f4b2ec5bf Mon Sep 17 00:00:00 2001 From: Govind Kumar Date: Fri, 16 Mar 2018 18:03:53 +0530 Subject: [PATCH 10/67] feat(activation-banner): moved position of the get_plugin_file method. --- .../admin/class-addon-activation-banner.php | 97 +++++++++---------- 1 file changed, 47 insertions(+), 50 deletions(-) diff --git a/includes/admin/class-addon-activation-banner.php b/includes/admin/class-addon-activation-banner.php index ec26e595f4..17b1aa770a 100644 --- a/includes/admin/class-addon-activation-banner.php +++ b/includes/admin/class-addon-activation-banner.php @@ -94,6 +94,52 @@ public function init() { } } + /** + * Get plugin file name. + * + * @since 1.8 + * @access private + * @return mixed + */ + private function get_plugin_file_name() { + $active_plugins = get_option( 'active_plugins' ); + $file_name = ''; + + try { + + // Check addon file path. + if ( ! empty( $this->banner_details['file'] ) ) { + $file_name = ''; + if ( $file_path = explode( '/plugins/', $this->banner_details['file'] ) ) { + $file_path = array_pop( $file_path ); + $file_name = current( explode( '/', $file_path ) ); + } + + if ( empty( $file_name ) ) { + return false; + } + + foreach ( $active_plugins as $plugin ) { + if ( false !== strpos( $plugin, $file_name ) ) { + $file_name = $plugin; + break; + } + } + } elseif ( WP_DEBUG ) { + throw new Exception( __( "File path must be added within the {$this->banner_details['name']} add-on in the banner details.", 'give' ) ); + } + + // Check plugin path calculated by addon file path. + if ( empty( $file_name ) && WP_DEBUG ) { + throw new Exception( __( "Empty add-on plugin path for {$this->banner_details['name']} add-on.", 'give' ) ); + } + + } catch ( Exception $e ) { + echo $e->getMessage(); + } + + return $file_name; + } /** * Check if current page is plugin page or not. @@ -336,53 +382,4 @@ public function remove_addon_activate_meta() { delete_option( $this->activate_by_meta_key ); } } - - - /** - * Get plugin file name. - * - * @since 1.8 - * @access private - * @return mixed - */ - private function get_plugin_file_name() { - $active_plugins = get_option( 'active_plugins' ); - $file_name = ''; - - try { - - // Check addon file path. - if ( ! empty( $this->banner_details['file'] ) ) { - $file_name = ''; - if ( $file_path = explode( '/plugins/', $this->banner_details['file'] ) ) { - $file_path = array_pop( $file_path ); - $file_name = current( explode( '/', $file_path ) ); - } - - if ( empty( $file_name ) ) { - return false; - } - - foreach ( $active_plugins as $plugin ) { - if ( false !== strpos( $plugin, $file_name ) ) { - $file_name = $plugin; - break; - } - } - } elseif ( WP_DEBUG ) { - throw new Exception( __( "File path must be added within the {$this->banner_details['name']} add-on in the banner details.", 'give' ) ); - } - - // Check plugin path calculated by addon file path. - if ( empty( $file_name ) && WP_DEBUG ) { - throw new Exception( __( "Empty add-on plugin path for {$this->banner_details['name']} add-on.", 'give' ) ); - } - - } catch ( Exception $e ) { - echo $e->getMessage(); - } - - return $file_name; - } - -} +} \ No newline at end of file From 6e288880aa98694b0562a861262da9f4cea607f9 Mon Sep 17 00:00:00 2001 From: Govind Kumar Date: Fri, 16 Mar 2018 18:08:41 +0530 Subject: [PATCH 11/67] fix(activation-banner): check if admin_notice is already hooked or not. --- .../admin/class-addon-activation-banner.php | 163 ++++++++++-------- 1 file changed, 94 insertions(+), 69 deletions(-) diff --git a/includes/admin/class-addon-activation-banner.php b/includes/admin/class-addon-activation-banner.php index 17b1aa770a..0eedec939f 100644 --- a/includes/admin/class-addon-activation-banner.php +++ b/includes/admin/class-addon-activation-banner.php @@ -63,8 +63,11 @@ function __construct( $_banner_details ) { $this->add_addon_activate_meta(); } - // Store user id who activate plugin. - $this->add_addon_activate_meta(); + // Check if notice callback is already hacked. + if ( ! $this->is_banner_notice_hooked() ) { + // If multiple add-on are activated then show activation banner in tab view. + add_action( 'admin_notices', array( $this, 'addon_activation_banner_notices' ), 10 ); + } } /** @@ -154,95 +157,117 @@ private function is_plugin_page() { return ( $screen->parent_file === 'plugins.php' ); } + /** + * Check if the addon_activation_banner_notices function has already been hooked to admin_notice. + * + * @since 2.0.7 + * + * @return bool + */ + public function is_banner_notice_hooked() { + global $wp_filter; + $notice_already_hooked = false; + + if ( isset( $wp_filter['admin_notices']->callbacks[10] ) ) { + + // Get all of the hooks. + $admin_notice_callbacks = array_keys( $wp_filter['admin_notices']->callbacks[10] ); + + foreach ( $admin_notice_callbacks as $key ) { + //If the key is found in your string, set $found to true + if ( false !== strpos( $key, "addon_activation_banner_notices" ) ) { + $notice_already_hooked = true; + } + } + } + + return $notice_already_hooked; + } /** - * Give Addon Activation Banner + * Get the add-on banner notices. * - * @since 1.0 - * @access public + * @since 2.0.7 */ - public function give_addon_activation_admin_notice() { + public function addon_activation_banner_notices() { + global $pagenow, $give_addons; // Bailout. - if ( ! $this->is_plugin_page() || $this->user_id !== $this->plugin_activate_by ) { + if ( 'plugins.php' !== $pagenow || $this->user_id !== $this->plugin_activate_by ) { return; } - // If the user hasn't already dismissed the alert, output activation banner. - if ( ! get_user_meta( $this->user_id, $this->nag_meta_key ) ) { + // If only one add-on activated. + $is_single = 1 === count( $give_addons ) ? true : false; - $this->print_css(); + // If the user hasn't already dismissed the alert, output activation banner. + if ( ! get_user_meta( $this->user_id, $this->get_notice_dismiss_meta_key() ) ) { + ob_start(); // Output inline styles here because there's no reason // to enqueued them after the alert is dismissed. - + $this->print_css_js(); ob_start(); ?> - -

Date: Wed, 21 Mar 2018 14:54:35 -0700 Subject: [PATCH 51/67] refactor(activation-banner): code review improvements --- .../admin/class-addon-activation-banner.php | 17 +++++++---------- 1 file changed, 7 insertions(+), 10 deletions(-) diff --git a/includes/admin/class-addon-activation-banner.php b/includes/admin/class-addon-activation-banner.php index 7cb308a28f..f5e1856fb1 100644 --- a/includes/admin/class-addon-activation-banner.php +++ b/includes/admin/class-addon-activation-banner.php @@ -41,7 +41,7 @@ function __construct( $_banner_details ) { // Append add-on information to the global variable. $give_addons[] = $_banner_details; - // Get the currenct user. + // Get the current user. $current_user = wp_get_current_user(); //Get current user @@ -59,7 +59,7 @@ function __construct( $_banner_details ) { // Set up hooks. $this->init(); - // Store user id who activate plugin. + // Store user id who activated plugin. $this->add_addon_activate_meta(); } @@ -80,12 +80,12 @@ function __construct( $_banner_details ) { */ public function init() { - //Testing? + // Testing? if ( $this->test_mode ) { delete_user_meta( $this->user_id, $this->nag_meta_key ); } - //Get the current page to add the notice to + // Get the current page to add the notice to add_action( 'current_screen', array( $this, 'give_addon_notice_ignore' ) ); // File path of addon must be included in banner detail other addon activate meta will not delete. @@ -253,12 +253,9 @@ public function addon_activation_banner_notices() {
-
+ foreach ( $addon_to_display as $banner ) { ?> +
Date: Wed, 21 Mar 2018 23:35:11 -0700 Subject: [PATCH 52/67] refactor(admin-shortcode): improve fields and description for give_totals shortcode #1472 --- .../shortcodes/shortcode-give-totals.php | 22 ++++++++----------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/includes/admin/shortcodes/shortcode-give-totals.php b/includes/admin/shortcodes/shortcode-give-totals.php index 653052a080..ff2d58b0dd 100644 --- a/includes/admin/shortcodes/shortcode-give-totals.php +++ b/includes/admin/shortcodes/shortcode-give-totals.php @@ -80,14 +80,10 @@ public function define_fields() { 'html' => sprintf( '

%s

', __( 'Shortcode Configuration', 'give' ) ), ), array( - 'type' => 'post', - 'query_args' => array( - 'post_type' => 'give_forms', - ), + 'type' => 'textbox', 'name' => 'ids', - 'label' => __( 'Select a Donation Form:', 'give' ), - 'tooltip' => __( 'Select a Donation Form', 'give' ), - 'placeholder' => '- ' . __( 'Select a Donation Form', 'give' ) . ' -', + 'label' => __( 'Donation Form IDs:', 'give' ), + 'tooltip' => __( 'Enter the IDs separated by commas for the donation forms you would like to combine within the totals.', 'give' ), ), $category_lists, $tag_lists, @@ -95,13 +91,13 @@ public function define_fields() { 'type' => 'textbox', 'name' => 'total_goal', 'label' => __( 'Total Goal:', 'give' ), - 'tooltip' => __( 'Enter the total goal amount.', 'give' ), + 'tooltip' => __( 'Enter the total goal amount that you would like to display.', 'give' ), ), array( 'type' => 'textbox', 'name' => 'message', 'label' => __( 'Message:', 'give' ), - 'tooltip' => __( 'Enter the message.', 'give' ), + 'tooltip' => __( 'Enter a message to display encouraging donors to support the goal.', 'give' ), 'value' => apply_filters( 'give_totals_message', __( 'Hey! We\'ve raised {total} of the {total_goal} we are trying to raise for this campaign!', 'give' ) ), 'multiline' => true, 'minWidth' => 300, @@ -111,20 +107,20 @@ public function define_fields() { 'type' => 'textbox', 'name' => 'link', 'label' => __( 'Link:', 'give' ), - 'tooltip' => __( 'Enter a link of campaign.', 'give' ), + 'tooltip' => __( 'Enter a link to the main campaign donation form.', 'give' ), ), array( 'type' => 'textbox', 'name' => 'link_text', 'label' => __( 'Link Text:', 'give' ), - 'tooltip' => __( 'Enter a text for the Link.', 'give' ), + 'tooltip' => __( 'Enter hyperlink text for the link to the main campaign donation form.', 'give' ), 'value' => __( 'Donate!', 'give' ), ), array( 'type' => 'listbox', 'name' => 'progress_bar', 'label' => __( 'Show Progress Bar:', 'give' ), - 'tooltip' => __( 'Choose Option to show Progress Bar or not with a message.', 'give' ), + 'tooltip' => __( 'Select whether you would like to show a goal progress bar.', 'give' ), 'options' => array( 'true' => __( 'Show', 'give' ), 'false' => __( 'Hide', 'give' ), @@ -136,4 +132,4 @@ public function define_fields() { } } -new Give_Shortcode_Totals; \ No newline at end of file +new Give_Shortcode_Totals; From 486ebddd3492d6ccd78c80486b8c22e1d875b6d7 Mon Sep 17 00:00:00 2001 From: raftaar1191 Date: Thu, 22 Mar 2018 12:51:35 +0530 Subject: [PATCH 53/67] design(admin-setting): move company name setting submenu tab to display menu #2453 --- .../admin/settings/class-settings-display.php | 37 ++++++------------- 1 file changed, 12 insertions(+), 25 deletions(-) diff --git a/includes/admin/settings/class-settings-display.php b/includes/admin/settings/class-settings-display.php index 2641c7e427..f805365cab 100644 --- a/includes/admin/settings/class-settings-display.php +++ b/includes/admin/settings/class-settings-display.php @@ -97,6 +97,18 @@ public function get_settings() { 'disabled' => __( 'Disabled', 'give' ), ), ), + array( + 'name' => __( 'Company Donations', 'give' ), + 'desc' => __( 'Do you want a Company field to appear after First Name and Last Name?', 'give' ), + 'id' => 'company_field', + 'type' => 'radio_inline', + 'default' => 'disabled', + 'options' => array( + 'disabled' => __( 'Disabled', 'give' ), + 'required' => __( 'Required', 'give' ), + 'optional' => __( 'Optional', 'give' ), + ), + ), array( 'name' => __( 'Display Settings Docs Link', 'give' ), 'id' => 'display_settings_docs_link', @@ -286,30 +298,6 @@ public function get_settings() { ), ); break; - case 'form-display': - $settings = array( - array( - 'id' => 'give_title_display_settings_5', - 'type' => 'title', - ), - array( - 'name' => __( 'Company Donations', 'give' ), - 'desc' => __( 'Do you want a Company field to appear after First Name and Last Name?', 'give' ), - 'id' => 'company_field', - 'type' => 'radio_inline', - 'default' => 'disabled', - 'options' => array( - 'disabled' => __( 'Disabled', 'give' ), - 'required' => __( 'Required', 'give' ), - 'optional' => __( 'Optional', 'give' ), - ), - ), - array( - 'id' => 'give_title_display_settings_5', - 'type' => 'sectionend', - ), - ); - break; } /** @@ -343,7 +331,6 @@ public function get_sections() { 'post-types' => __( 'Post Types', 'give' ), 'taxonomies' => __( 'Taxonomies', 'give' ), 'term-and-conditions' => __( 'Terms and Conditions', 'give' ), - 'form-display' => __( 'Form Display', 'give' ), ); return apply_filters( 'give_get_sections_' . $this->id, $sections ); From d620cff2aac8eb229717073210d804de4cf4cf40 Mon Sep 17 00:00:00 2001 From: raftaar1191 Date: Thu, 22 Mar 2018 13:15:04 +0530 Subject: [PATCH 54/67] design(admin-donation): refactor donor details UI #2453 --- .../admin/payments/view-payment-details.php | 20 +++++++------------ 1 file changed, 7 insertions(+), 13 deletions(-) diff --git a/includes/admin/payments/view-payment-details.php b/includes/admin/payments/view-payment-details.php index 67e8bb256a..2856255d9f 100644 --- a/includes/admin/payments/view-payment-details.php +++ b/includes/admin/payments/view-payment-details.php @@ -533,6 +533,7 @@ ); } ?> + ()


@@ -572,7 +573,12 @@ ?>

- + +
+

@@ -606,18 +612,6 @@

- -
- -
-

-
- -

-
- -
- Date: Thu, 22 Mar 2018 13:31:44 +0530 Subject: [PATCH 55/67] feat(admin-tools): Add Company Column in export donation history CSV #2453 --- .../export/class-batch-export-payments.php | 82 ++++++++++--------- 1 file changed, 42 insertions(+), 40 deletions(-) diff --git a/includes/admin/tools/export/class-batch-export-payments.php b/includes/admin/tools/export/class-batch-export-payments.php index 47da618383..519271e6f3 100644 --- a/includes/admin/tools/export/class-batch-export-payments.php +++ b/includes/admin/tools/export/class-batch-export-payments.php @@ -39,26 +39,27 @@ class Give_Batch_Payments_Export extends Give_Batch_Export { */ public function csv_cols() { $cols = array( - 'id' => __( 'ID', 'give' ), // unaltered payment ID (use for querying). - 'seq_id' => __( 'Payment Number', 'give' ), // sequential payment ID. - 'email' => __( 'Email', 'give' ), - 'first' => __( 'First Name', 'give' ), - 'last' => __( 'Last Name', 'give' ), - 'address1' => __( 'Address 1', 'give' ), - 'address2' => __( 'Address 2', 'give' ), - 'city' => __( 'City', 'give' ), - 'state' => __( 'State', 'give' ), - 'country' => __( 'Country', 'give' ), - 'zip' => __( 'Zip / Postal Code', 'give' ), - 'form_id' => __( 'Form ID', 'give' ), - 'form_name' => __( 'Form Name', 'give' ), - 'amount' => __( 'Amount', 'give' ) . ' (' . give_currency_symbol( '', true ) . ')', - 'gateway' => __( 'Payment Method', 'give' ), - 'trans_id' => __( 'Transaction ID', 'give' ), - 'key' => __( 'Key', 'give' ), - 'date' => __( 'Date', 'give' ), - 'user' => __( 'User', 'give' ), - 'status' => __( 'Status', 'give' ) + 'id' => __( 'ID', 'give' ), // unaltered payment ID (use for querying). + 'seq_id' => __( 'Payment Number', 'give' ), // sequential payment ID. + 'email' => __( 'Email', 'give' ), + 'first' => __( 'First Name', 'give' ), + 'last' => __( 'Last Name', 'give' ), + 'company_name' => __( 'Company', 'give' ), + 'address1' => __( 'Address 1', 'give' ), + 'address2' => __( 'Address 2', 'give' ), + 'city' => __( 'City', 'give' ), + 'state' => __( 'State', 'give' ), + 'country' => __( 'Country', 'give' ), + 'zip' => __( 'Zip / Postal Code', 'give' ), + 'form_id' => __( 'Form ID', 'give' ), + 'form_name' => __( 'Form Name', 'give' ), + 'amount' => __( 'Amount', 'give' ) . ' (' . give_currency_symbol( '', true ) . ')', + 'gateway' => __( 'Payment Method', 'give' ), + 'trans_id' => __( 'Transaction ID', 'give' ), + 'key' => __( 'Key', 'give' ), + 'date' => __( 'Date', 'give' ), + 'user' => __( 'User', 'give' ), + 'status' => __( 'Status', 'give' ) ); if ( ! give_get_option( 'enable_sequential' ) ) { @@ -151,26 +152,27 @@ public function get_data() { } $data[] = array( - 'id' => $payment->ID, - 'seq_id' => give_get_payment_number( $payment->ID ), - 'email' => $payment_meta['email'], - 'first' => $user_info['first_name'], - 'last' => $user_info['last_name'], - 'address1' => isset( $user_info['address']['line1'] ) ? $user_info['address']['line1'] : '', - 'address2' => isset( $user_info['address']['line2'] ) ? $user_info['address']['line2'] : '', - 'city' => isset( $user_info['address']['city'] ) ? $user_info['address']['city'] : '', - 'state' => isset( $user_info['address']['state'] ) ? $user_info['address']['state'] : '', - 'country' => isset( $user_info['address']['country'] ) ? $user_info['address']['country'] : '', - 'zip' => isset( $user_info['address']['zip'] ) ? $user_info['address']['zip'] : '', - 'form_id' => isset( $payment_meta['form_id'] ) ? $payment_meta['form_id'] : '', - 'form_name' => isset( $payment_meta['form_title'] ) ? $payment_meta['form_title'] : '', - 'amount' => html_entity_decode( give_format_amount( $total, array( 'sanitize' => false ) ) ), - 'gateway' => give_get_gateway_admin_label( give_get_meta( $payment->ID, '_give_payment_gateway', true ) ), - 'trans_id' => give_get_payment_transaction_id( $payment->ID ), - 'key' => $payment_meta['key'], - 'date' => $payment->post_date, - 'user' => $user ? $user->display_name : __( 'guest', 'give' ), - 'status' => give_get_payment_status( $payment, true ) + 'id' => $payment->ID, + 'seq_id' => give_get_payment_number( $payment->ID ), + 'email' => $payment_meta['email'], + 'first' => $user_info['first_name'], + 'last' => $user_info['last_name'], + 'company_name' => $payment_meta['_give_donation_company'], + 'address1' => isset( $user_info['address']['line1'] ) ? $user_info['address']['line1'] : '', + 'address2' => isset( $user_info['address']['line2'] ) ? $user_info['address']['line2'] : '', + 'city' => isset( $user_info['address']['city'] ) ? $user_info['address']['city'] : '', + 'state' => isset( $user_info['address']['state'] ) ? $user_info['address']['state'] : '', + 'country' => isset( $user_info['address']['country'] ) ? $user_info['address']['country'] : '', + 'zip' => isset( $user_info['address']['zip'] ) ? $user_info['address']['zip'] : '', + 'form_id' => isset( $payment_meta['form_id'] ) ? $payment_meta['form_id'] : '', + 'form_name' => isset( $payment_meta['form_title'] ) ? $payment_meta['form_title'] : '', + 'amount' => html_entity_decode( give_format_amount( $total, array( 'sanitize' => false ) ) ), + 'gateway' => give_get_gateway_admin_label( give_get_meta( $payment->ID, '_give_payment_gateway', true ) ), + 'trans_id' => give_get_payment_transaction_id( $payment->ID ), + 'key' => $payment_meta['key'], + 'date' => $payment->post_date, + 'user' => $user ? $user->display_name : __( 'guest', 'give' ), + 'status' => give_get_payment_status( $payment, true ) ); } From 1f33587df0cd0325db9d1a292ae7f01b8bdbb639 Mon Sep 17 00:00:00 2001 From: raftaar1191 Date: Thu, 22 Mar 2018 19:05:03 +0530 Subject: [PATCH 56/67] feat(admin-email): add Email Recipients section to donor emails 2657 --- .../emails/class-email-setting-field.php | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/includes/admin/emails/class-email-setting-field.php b/includes/admin/emails/class-email-setting-field.php index fcd0ca2a0f..6356d8a375 100755 --- a/includes/admin/emails/class-email-setting-field.php +++ b/includes/admin/emails/class-email-setting-field.php @@ -27,6 +27,8 @@ public static function get_setting_fields( Give_Email_Notification $email, $form // Recipient field. if ( Give_Email_Notification_Util::has_recipient_field( $email ) ) { $setting_fields[] = self::get_recipient_setting_field( $email, $form_id ); + } else { + $setting_fields[] = self::get_disable_recipient_setting_field( $email, $form_id ); } @@ -327,6 +329,35 @@ public static function get_recipient_setting_field( Give_Email_Notification $ema return $recipient; } + /** + * Get recipient setting field that is disable. + * + * @since 2.0.7 + * + * @access static + * @todo check this field in form metabox setting after form api merge. + * + * @param Give_Email_Notification $email + * @param int $form_id + * + * @return array + */ + public static function get_disable_recipient_setting_field( Give_Email_Notification $email, $form_id = null ) { + $recipient = array( + 'id' => self::get_prefix( $email, $form_id ) . 'disable_recipient', + 'name' => esc_html__( 'Email Recipients', 'give' ), + 'desc' => esc_html__( 'This email is sent to the Donor and the recipients cannot be customized.', 'give' ), + 'default' => '{donor_email}', + 'value' => '{donor_email}', + 'type' => 'text', + 'attributes' => array( + 'disabled' => true, + ), + ); + + return $recipient; + } + /** * Get preview setting field. * From d1069f3f5b50c8ee32cc84b9315bbf84007c435c Mon Sep 17 00:00:00 2001 From: Ravinder Kumar Date: Thu, 22 Mar 2018 21:35:54 +0530 Subject: [PATCH 57/67] refactor(emails): code for pr #2942 --- .../emails/class-email-setting-field.php | 66 +++++++------------ 1 file changed, 23 insertions(+), 43 deletions(-) diff --git a/includes/admin/emails/class-email-setting-field.php b/includes/admin/emails/class-email-setting-field.php index 6356d8a375..a4b3e2cc10 100755 --- a/includes/admin/emails/class-email-setting-field.php +++ b/includes/admin/emails/class-email-setting-field.php @@ -25,12 +25,7 @@ public static function get_setting_fields( Give_Email_Notification $email, $form $setting_fields = self::get_default_setting_fields( $email, $form_id ); // Recipient field. - if ( Give_Email_Notification_Util::has_recipient_field( $email ) ) { - $setting_fields[] = self::get_recipient_setting_field( $email, $form_id ); - } else { - $setting_fields[] = self::get_disable_recipient_setting_field( $email, $form_id ); - } - + $setting_fields[] = self::get_recipient_setting_field( $email, $form_id, Give_Email_Notification_Util::has_recipient_field( $email ) ); // Add extra setting field. if ( $extra_setting_field = $email->get_extra_setting_fields( $form_id ) ) { @@ -135,10 +130,10 @@ public static function get_default_setting_fields( Give_Email_Notification $emai $settings[] = self::get_notification_status_field( $email, $form_id ); if ( ! Give_Email_Notification_Util::is_notification_status_editable( $email ) ) { - if( $form_id || give_is_add_new_form_page() ){ + if ( $form_id || give_is_add_new_form_page() ) { // Do not allow admin to disable notification on perform basis. unset( $settings[1]['options']['disabled'] ); - } else{ + } else { // Do not allow admin to edit notification status globally. unset( $settings[1] ); } @@ -147,7 +142,7 @@ public static function get_default_setting_fields( Give_Email_Notification $emai $settings[] = self::get_email_subject_field( $email, $form_id ); $settings[] = self::get_email_message_field( $email, $form_id ); - if( Give_Email_Notification_Util::is_content_type_editable( $email ) ) { + if ( Give_Email_Notification_Util::is_content_type_editable( $email ) ) { $settings[] = self::get_email_content_type_field( $email, $form_id ); } @@ -184,7 +179,7 @@ public static function get_notification_status_field( Give_Email_Notification $e $default_value = 'global'; } - $description = isset($_GET['page']) && 'give-settings' === $_GET['page'] ? __('Choose whether you want this email enabled or not.', 'give') : sprintf( __( 'Global Options are set in Give settings. You may override them for this form here.', 'give' ), admin_url( 'edit.php?post_type=give_forms&page=give-settings&tab=emails' ) ); + $description = isset( $_GET['page'] ) && 'give-settings' === $_GET['page'] ? __( 'Choose whether you want this email enabled or not.', 'give' ) : sprintf( __( 'Global Options are set in Give settings. You may override them for this form here.', 'give' ), admin_url( 'edit.php?post_type=give_forms&page=give-settings&tab=emails' ) ); return array( 'name' => esc_html__( 'Notification', 'give' ), @@ -240,7 +235,7 @@ public static function get_email_message_field( Give_Email_Notification $email, $email_tag_list, sprintf( '
%2$s %3$s', - esc_url('http://docs.givewp.com/meta-email-tags'), + esc_url( 'http://docs.givewp.com/meta-email-tags' ), __( 'See our documentation', 'give' ), __( 'for examples of how to use custom meta email tags to output additional donor or donation information in your Give emails.', 'give' ) ) @@ -288,15 +283,16 @@ public static function get_email_content_type_field( Give_Email_Notification $em * * @since 2.0 * @access static - * @todo check this field in form metabox setting after form api merge. + * @todo check this field in form metabox setting after form api merge. * * @param Give_Email_Notification $email * @param int $form_id + * @param bool $edit_recipient * * @return array */ - public static function get_recipient_setting_field( Give_Email_Notification $email, $form_id = null ) { - $recipient = array( + public static function get_recipient_setting_field( Give_Email_Notification $email, $form_id = null, $edit_recipient = true ) { + $recipient = array( 'id' => self::get_prefix( $email, $form_id ) . 'recipient', 'name' => esc_html__( 'Email Recipients', 'give' ), 'desc' => __( 'Enter the email address(es) that should receive a notification.', 'give' ), @@ -326,34 +322,18 @@ public static function get_recipient_setting_field( Give_Email_Notification $ema ); } - return $recipient; - } + // Disable field if email donor has recipient field. + // @see https://github.com/WordImpress/Give/issues/2657 + if ( ! $edit_recipient ) { + if ( 'group' == $recipient['type'] ) { + $recipient = current( $recipient['fields'] ); + $recipient['type'] = 'text'; + } - /** - * Get recipient setting field that is disable. - * - * @since 2.0.7 - * - * @access static - * @todo check this field in form metabox setting after form api merge. - * - * @param Give_Email_Notification $email - * @param int $form_id - * - * @return array - */ - public static function get_disable_recipient_setting_field( Give_Email_Notification $email, $form_id = null ) { - $recipient = array( - 'id' => self::get_prefix( $email, $form_id ) . 'disable_recipient', - 'name' => esc_html__( 'Email Recipients', 'give' ), - 'desc' => esc_html__( 'This email is sent to the Donor and the recipients cannot be customized.', 'give' ), - 'default' => '{donor_email}', - 'value' => '{donor_email}', - 'type' => 'text', - 'attributes' => array( - 'disabled' => true, - ), - ); + $recipient['attributes']['disabled'] = 'disabled'; + $recipient['value'] = $recipient['default'] = '{donor_email}'; + $recipient['repeat'] = false; + } return $recipient; } @@ -391,10 +371,10 @@ public static function get_preview_setting_field( Give_Email_Notification $email * * @return string */ - public static function get_prefix( Give_Email_Notification $email, $form_id = null ) { + public static function get_prefix( Give_Email_Notification $email, $form_id = null ) { $meta_key = "{$email->config['id']}_"; - if( $form_id || give_is_add_new_form_page() ) { + if ( $form_id || give_is_add_new_form_page() ) { $meta_key = "_give_{$email->config['id']}_"; } From 48d027d7f595f1427c7efafc4ea97f9efb07274b Mon Sep 17 00:00:00 2001 From: Ravinder Kumar Date: Thu, 22 Mar 2018 21:37:24 +0530 Subject: [PATCH 58/67] style(code): fix typo --- includes/admin/emails/class-email-setting-field.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/admin/emails/class-email-setting-field.php b/includes/admin/emails/class-email-setting-field.php index a4b3e2cc10..09bf482e28 100755 --- a/includes/admin/emails/class-email-setting-field.php +++ b/includes/admin/emails/class-email-setting-field.php @@ -282,7 +282,7 @@ public static function get_email_content_type_field( Give_Email_Notification $em * Get recipient setting field. * * @since 2.0 - * @access static + * @access public * @todo check this field in form metabox setting after form api merge. * * @param Give_Email_Notification $email From 604e4782cde0ec9e80533ab2cef1425386c6116e Mon Sep 17 00:00:00 2001 From: raftaar1191 Date: Fri, 23 Mar 2018 16:53:37 +0530 Subject: [PATCH 59/67] feat(admin-email): Update email recipients description #2657 --- includes/admin/emails/class-email-setting-field.php | 1 + 1 file changed, 1 insertion(+) diff --git a/includes/admin/emails/class-email-setting-field.php b/includes/admin/emails/class-email-setting-field.php index 09bf482e28..249295ec65 100755 --- a/includes/admin/emails/class-email-setting-field.php +++ b/includes/admin/emails/class-email-setting-field.php @@ -333,6 +333,7 @@ public static function get_recipient_setting_field( Give_Email_Notification $ema $recipient['attributes']['disabled'] = 'disabled'; $recipient['value'] = $recipient['default'] = '{donor_email}'; $recipient['repeat'] = false; + $recipient['desc'] = __( 'This email is sent to the Donor and the recipients cannot be customized.', 'give' ); } return $recipient; From 626ab7bcb98cf8a63120049284005f0fe324b2f4 Mon Sep 17 00:00:00 2001 From: raftaar1191 Date: Fri, 23 Mar 2018 18:00:42 +0530 Subject: [PATCH 60/67] feat(admin-tools): add company name filed in import donation import CSV #2946 --- includes/import-functions.php | 35 +++++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/includes/import-functions.php b/includes/import-functions.php index dc495ffc25..7c4a8cd968 100644 --- a/includes/import-functions.php +++ b/includes/import-functions.php @@ -397,6 +397,11 @@ function give_import_donations_options() { __( 'Donor Last Name', 'give' ), __( 'Last Name', 'give' ), ), + 'company_name' => array( + __( 'Donor Company Name', 'give' ), + __( 'Company Name', 'give' ), + __( 'Company', 'give' ), + ), 'line1' => array( __( 'Address 1', 'give' ), __( 'Address', 'give' ), @@ -619,6 +624,18 @@ function give_save_import_donation_to_db( $raw_key, $row_data, $main_key = array 'mode' => ( ! empty( $data['mode'] ) ? ( 'true' == (string) $data['mode'] || 'TRUE' == (string) $data['mode'] ? 'test' : 'live' ) : ( isset( $import_setting['mode'] ) ? ( true == (bool) $import_setting['mode'] ? 'test' : 'live' ) : ( give_is_test_mode() ? 'test' : 'live' ) ) ), ); + /** + * Filter to modify payment Data before getting imported. + * + * @since 2.0.7 + * + * @param array $payment_data payment data + * @param array $payment_data donation data + * @param array $donor_data donor data + * @param object $donor_data form object + * + * @return array $payment_data payment data + */ $payment_data = apply_filters( 'give_import_before_import_payment', $payment_data, $data, $donor_data, $form ); // Get the report @@ -650,6 +667,11 @@ function give_save_import_donation_to_db( $raw_key, $row_data, $main_key = array update_post_meta( $payment, '_give_payment_import_id', $import_setting['csv'] ); } + // Insert Company Name. + if ( ! empty( $import_setting['company_name'] ) ) { + update_post_meta( $payment, '_give_donation_company', $import_setting['company_name'] ); + } + // Insert Notes. if ( ! empty( $data['notes'] ) ) { give_insert_payment_note( $payment, $data['notes'] ); @@ -666,6 +688,19 @@ function give_save_import_donation_to_db( $raw_key, $row_data, $main_key = array } else { $report['failed_donation'] = ( ! empty( $report['failed_donation'] ) ? ( absint( $report['failed_donation'] ) + 1 ) : 1 ); } + + /** + * Fire after payment is imported and payment meta is also being imported. + * + * @since 2.0.7 + * + * @param int $payment payment id + * @param array $payment_data payment data + * @param array $payment_data donation data + * @param array $donor_data donor data + * @param object $donor_data form object + */ + do_action( 'give_import_after_import_payment', $payment, $payment_data, $data, $donor_data, $form ); } // update the report From 9e5dea9334bd0e4c193d803270325c87775159a3 Mon Sep 17 00:00:00 2001 From: raftaar1191 Date: Fri, 23 Mar 2018 18:19:23 +0530 Subject: [PATCH 61/67] feat(admin-tools): add company name filed value in donor meta #2946 --- includes/import-functions.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/includes/import-functions.php b/includes/import-functions.php index 7c4a8cd968..18a7d7a947 100644 --- a/includes/import-functions.php +++ b/includes/import-functions.php @@ -668,8 +668,9 @@ function give_save_import_donation_to_db( $raw_key, $row_data, $main_key = array } // Insert Company Name. - if ( ! empty( $import_setting['company_name'] ) ) { - update_post_meta( $payment, '_give_donation_company', $import_setting['company_name'] ); + if ( ! empty( $data['company_name'] ) ) { + update_post_meta( $payment, '_give_donation_company', $data['company_name'] ); + $donor_data->update_meta( '_give_donor_company', $data['company_name'] ); } // Insert Notes. From 9d17f28290210373179ae97148da1797d997c4f7 Mon Sep 17 00:00:00 2001 From: raftaar1191 Date: Fri, 23 Mar 2018 18:22:20 +0530 Subject: [PATCH 62/67] feat(admin-tools): change company name filed name #2946 --- includes/import-functions.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/includes/import-functions.php b/includes/import-functions.php index 18a7d7a947..833c23e958 100644 --- a/includes/import-functions.php +++ b/includes/import-functions.php @@ -398,8 +398,9 @@ function give_import_donations_options() { __( 'Last Name', 'give' ), ), 'company_name' => array( - __( 'Donor Company Name', 'give' ), __( 'Company Name', 'give' ), + __( 'Donor Company Name', 'give' ), + __( 'Donor Company', 'give' ), __( 'Company', 'give' ), ), 'line1' => array( From 7ec6faca744bf0dceeec567b1831d92090c005a0 Mon Sep 17 00:00:00 2001 From: Ravinder Kumar Date: Mon, 26 Mar 2018 08:17:26 +0530 Subject: [PATCH 63/67] fix(cache): remove extra param from wp_delete_cache --- includes/class-give-cache.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/includes/class-give-cache.php b/includes/class-give-cache.php index f53b785d97..3454633c9e 100644 --- a/includes/class-give-cache.php +++ b/includes/class-give-cache.php @@ -543,7 +543,7 @@ public static function delete_group( $ids, $group = '', $expire = 0 ) { // Delete single or multiple cache items from cache. if ( ! is_array( $ids ) ) { - $status = wp_cache_delete( $ids, $group, $expire ); + $status = wp_cache_delete( $ids, $group ); self::$instance->get_incrementer( true ); /** @@ -559,7 +559,7 @@ public static function delete_group( $ids, $group = '', $expire = 0 ) { } else { foreach ( $ids as $id ) { - $status = wp_cache_delete( $id, $group, $expire ); + $status = wp_cache_delete( $id, $group ); self::$instance->get_incrementer( true ); /** From ef3fcfd76da8b04078717362a92924a5980dcfa9 Mon Sep 17 00:00:00 2001 From: Ravinder Kumar Date: Mon, 26 Mar 2018 09:43:26 +0530 Subject: [PATCH 64/67] fix(cache): search of prefix instead of complete string --- includes/class-give-cache.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/class-give-cache.php b/includes/class-give-cache.php index 3454633c9e..135e5c8cc3 100644 --- a/includes/class-give-cache.php +++ b/includes/class-give-cache.php @@ -749,7 +749,7 @@ private function filter_group_name( $group ) { if ( ! empty( $group ) ) { $incrementer = self::$instance->get_incrementer( false, 'give-cache-incrementer' ); - if ( 'give-db-queries' === $group ) { + if ( false !== strpos( $group, 'give-db-queries' ) ) { $incrementer = self::$instance->get_incrementer(); } From 751255367c1c8ad48c75f7ba87816022ca277f8a Mon Sep 17 00:00:00 2001 From: Ravinder Kumar Date: Mon, 26 Mar 2018 13:10:31 +0530 Subject: [PATCH 65/67] style(code): improve code formatting --- includes/admin/emails/class-email-setting-field.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/admin/emails/class-email-setting-field.php b/includes/admin/emails/class-email-setting-field.php index 249295ec65..12229f0d52 100755 --- a/includes/admin/emails/class-email-setting-field.php +++ b/includes/admin/emails/class-email-setting-field.php @@ -333,7 +333,7 @@ public static function get_recipient_setting_field( Give_Email_Notification $ema $recipient['attributes']['disabled'] = 'disabled'; $recipient['value'] = $recipient['default'] = '{donor_email}'; $recipient['repeat'] = false; - $recipient['desc'] = __( 'This email is sent to the Donor and the recipients cannot be customized.', 'give' ); + $recipient['desc'] = __( 'This email is sent to the Donor and the recipients cannot be customized.', 'give' ); } return $recipient; From bcc1e7aa0a945bb0de5d0fbe25cac3059873bd25 Mon Sep 17 00:00:00 2001 From: Ravinder Kumar Date: Mon, 26 Mar 2018 14:08:41 +0530 Subject: [PATCH 66/67] fix(notice): move close icon svg to new directory move close icon svg to new directory and update asset url --- assets/{images/svg => src/images}/close.svg | 0 includes/class-notices.php | 4 ++-- 2 files changed, 2 insertions(+), 2 deletions(-) rename assets/{images/svg => src/images}/close.svg (100%) diff --git a/assets/images/svg/close.svg b/assets/src/images/close.svg similarity index 100% rename from assets/images/svg/close.svg rename to assets/src/images/close.svg diff --git a/includes/class-notices.php b/includes/class-notices.php index 929cb984c7..4df53fbc37 100644 --- a/includes/class-notices.php +++ b/includes/class-notices.php @@ -626,7 +626,7 @@ public static function print_frontend_notice( $message, $echo = true, $notice_ty $close_icon = 'manual' === $notice_args['dismiss_type'] ? sprintf( '', - esc_url( GIVE_PLUGIN_URL . 'assets/images/svg/close.svg' ) + esc_url( GIVE_PLUGIN_URL . 'assets/dist/images/close.svg' ) ) : ''; @@ -699,4 +699,4 @@ public function print_admin_notices( $notice_args = array() ) { echo $output; } -} \ No newline at end of file +} From 9c2a76a022c0a88347050beccb7e676795cd2f6d Mon Sep 17 00:00:00 2001 From: Ravinder Kumar Date: Mon, 26 Mar 2018 14:08:58 +0530 Subject: [PATCH 67/67] fix(notice): update Give icon asset url --- includes/admin/class-addon-activation-banner.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/includes/admin/class-addon-activation-banner.php b/includes/admin/class-addon-activation-banner.php index 4a9f5e6019..7d42bf16af 100644 --- a/includes/admin/class-addon-activation-banner.php +++ b/includes/admin/class-addon-activation-banner.php @@ -610,7 +610,7 @@ private function render_single_addon_banner( $banner_arr, $meta_key = '' ) { // Get the add-on details. $plugin_data = get_plugin_data( $plugin_file ); ?> - +