Plugin Directory

Changeset 3387360


Ignore:
Timestamp:
10/31/2025 12:45:21 AM (6 weeks ago)
Author:
anthonyeden
Message:

Version 2.7.1

Location:
profiler-donations-gravityforms
Files:
11 edited
11 copied

Legend:

Unmodified
Added
Removed
  • profiler-donations-gravityforms/tags/2.7.1/cardprocess.php

    r1881378 r3387360  
    11<?php
     2// This is a legacy file to support credit card field processing in Gravity Forms for Profiler Donations.
     3// It works around some historic issues with how Gravity Forms's JS sends the credit card number field.
     4// Now days, this shouldn't be used - we recommend using Stripe or another modern gateway that handles card processing client-side.
    25
    36function profilerdonation_creditcardfilter($field_content, $field) {
     
    1013
    1114function profilerdonation_cardprocessscript($form) {
    12     wp_enqueue_script('profilerdonation_cardprocessscript', plugin_dir_url(__FILE__).'/cardprocess.js');
     15    // If Gravity Forms has a 'creditcard' field, we need to enqueue our card processing script
     16    $has_creditcard = false;
     17    foreach($form['fields'] as $field) {
     18        if($field->type == 'creditcard') {
     19            $has_creditcard = true;
     20            break;
     21        }
     22    }
     23
     24    if(!$has_creditcard) {
     25        return;
     26    }
     27
     28    wp_enqueue_script('profilerdonation_cardprocessscript', trailingslashit(plugin_dir_url(__FILE__)).'cardprocess.js');
    1329}
    1430
  • profiler-donations-gravityforms/tags/2.7.1/class-profilercommon.php

    r3362220 r3387360  
    527527                    $field_settings = array();
    528528                    $field_settings['value'] = $inputvalue['id'];
    529                     $field_settings['label'] = $preface . $inputvalue['label'];
     529                    $field_settings['label'] = $preface . (!empty($field['label']) ? ' ' . $field['label'] . ': ' : '') . $inputvalue['label'];
    530530                    $formfields[] = $field_settings;
    531531                }
     532            } elseif ($field['type'] == 'hidden') {
     533                $formfields[] = array(
     534                    "value" => $field['id'],
     535                    "label" => (!empty($field['label']) ? $field['label'] : 'Hidden Field #' . $field['id'])
     536                );
     537            } elseif ($field['type'] == 'select') {
     538                $formfields[] = array(
     539                    "value" => $field['id'],
     540                    "label" => (!empty($field['label']) ? $field['label'] : 'Select Field #' . $field['id'])
     541                );
    532542            } elseif($field["type"] != "creditcard") {
    533543                // Process all fields except credit cards - we don't want them in the list
     
    566576                $formfields[] = array(
    567577                    "value" => $field['id'],
    568                     "label" => $field['label']
     578                    "label" => (!empty($field['label']) ? $field['label'] : 'Hidden Field #' . $field['id'])
    569579                );
    570580            }
     
    682692                $formfields[] = array(
    683693                    "value" => $field['id'],
    684                     "label" => $field['label']
     694                    "label" => (!empty($field['label']) ? $field['label'] : 'Select Field #' . $field['id'])
    685695                );
    686696            }
     
    717727                $formfields[] = array(
    718728                    "value" => $field['id'],
    719                     "label" => $field['label']
     729                    "label" => (!empty($field['label']) ? $field['label'] : 'Product Field #' . $field['id'])
    720730                );
    721731            }
  • profiler-donations-gravityforms/tags/2.7.1/class-profilerdonate-gfaddon.php

    r3362220 r3387360  
    336336            "required" => false,
    337337            "class" => "merge-tag-support",
    338             "tooltip" => "This is extra text to be sent to Profiler in the Comments field. Youc an include Gravity Forms Merge Fields in this textarea to accept additional user input.",
     338            "tooltip" => "This is extra text to be sent to Profiler in the Comments field. You can include Gravity Forms Merge Fields in this textarea to accept additional user input.",
    339339        );
    340340
     
    470470            "choices" => $field_settings
    471471        );
     472
     473        $fields[] = array(
     474            "label" => 'Client Tags',
     475            "type" => "text",
     476            "name" => "profilerdonation_clienttags",
     477            "required" => false,
     478            "class" => "merge-tag-support",
     479            "tooltip" => "This field's value should match the Client Tags setup within Profiler. This list can be comma-separated for multiple tags. Use merge fields here to dynamically set tags.",
     480        );
    472481       
    473482        $fields[] = array(
     
    477486            "required" => false,
    478487            "tooltip" => "This field's value should match the Purpose Codes setup within Profiler.",
    479             "choices" => $field_settings
     488            "choices" => $field_settings,
    480489        );
    481490
     
    660669            $postData['clientAcquiredReason'] = $this->getDonationCode($feed, 'clientacquisitioncode', $form);
    661670        }
    662        
     671
     672        // Client Tags
     673        if(!empty($feed['meta']['profilerdonation_clienttags'])) {
     674            // Comma separated tags. Can be merge fields.
     675            $postData['clientTag'] = trim(GFCommon::replace_variables($feed['meta']['profilerdonation_clienttags'], $form, $entry, false, true, false, 'text'));
     676        }
     677
    663678        if($feed['meta']['profilerdonation_donationpurposecode'] !== "") {
    664679            $postData['paymentPupose'] = $this->get_field_value($form, $entry, $feed['meta']['profilerdonation_donationpurposecode']);
     
    702717        if(!empty($feed['meta']['profilerdonation_commentsextra'])) {
    703718            // Extra text to append to comments field
    704             $comments .= GFCommon::replace_variables($feed['meta']['profilerdonation_commentsextra'], $form, $entry, false, true, false, 'text');
     719            $comments .= " " . GFCommon::replace_variables($feed['meta']['profilerdonation_commentsextra'], $form, $entry, false, true, false, 'text');
    705720        }
    706721
     
    712727
    713728        // Comments
    714         $postData['comments'] = $comments;
     729        $postData['comments'] = trim($comments);
    715730
    716731        if($this->get_field_value($form, $entry, $feed['meta']['profilerdonation_donationtype']) == "regular") {
  • profiler-donations-gravityforms/tags/2.7.1/class-profilerinteraction-gfaddon.php

    r3368177 r3387360  
    198198
    199199        $fields[] = array(
     200            "label" => 'Client Acquisition Field',
     201            "type" => "select",
     202            "name" => "profilerinteraction_clientacquisitioncode",
     203            "required" => false,
     204            "tooltip" => "This field's value should match the Client Acquisition Codes setup within Profiler.",
     205            "choices" => $field_settings,
     206            "pf_apifield" => "clientAcquiredReason",
     207        );
     208
     209        $fields[] = array(
     210            "label" => 'Client Tags',
     211            "type" => "text",
     212            "name" => "profilerinteraction_clienttags",
     213            "required" => false,
     214            "class" => "merge-tag-support",
     215            "tooltip" => "This field's value should match the Client Tags setup within Profiler. This list can be comma-separated for multiple tags. Use merge fields here to dynamically set tags.",
     216        );
     217
     218        $fields[] = array(
    200219            "label" => 'Interaction Text',
    201220            "type" => "textarea",
     
    288307        $postData['interactionAlert'] = $alert;
    289308
     309        // Client Tags
     310        if(!empty($feed['meta']['profilerinteraction_clienttags'])) {
     311            // Comma separated tags. Can be merge fields.
     312            $postData['clientTag'] = trim(GFCommon::replace_variables($feed['meta']['profilerinteraction_clienttags'], $form, $entry, false, true, false, 'text'));
     313        }
     314
    290315        return $postData;
    291316    }
  • profiler-donations-gravityforms/tags/2.7.1/class-profilerlists-gfaddon.php

    r3362220 r3387360  
    187187            "choices" => $field_settings,
    188188            "pf_apifield" => "website",
     189        );
     190
     191        $fields[] = array(
     192            "label" => 'Client Acquisition Field',
     193            "type" => "select",
     194            "name" => "profilerdonation_clientacquisitioncode",
     195            "required" => false,
     196            "tooltip" => "This field's value should match the Client Acquisition Codes setup within Profiler.",
     197            "choices" => $field_settings,
     198            "pf_apifield" => "clientAcquiredReason",
    189199        );
    190200
  • profiler-donations-gravityforms/tags/2.7.1/class-profilerlistsbasic-gfaddon.php

    r3335722 r3387360  
    11<?php
    2    
     2
    33class GFProfilerListsBasic extends GFProfilerCommon {
    44    protected $_slug = "profiler-listsbasic-gf";
  • profiler-donations-gravityforms/tags/2.7.1/class-profilerpostdonate-gfaddon.php

    r3211366 r3387360  
    106106        $comments = $this->get_field_value($form, $entry, $feed['meta']['profilerdonation_comments']);
    107107
    108         $comments .= GFCommon::replace_variables($feed['meta']['profilerdonation_commentsextra'], $form, $entry, false, true, false, 'text');
     108        $comments .= " " . GFCommon::replace_variables($feed['meta']['profilerdonation_commentsextra'], $form, $entry, false, true, false, 'text');
    109109        $comments = html_entity_decode($comments);
    110110
     
    114114
    115115        // Comments
    116         $postData['comments'] = $comments;
     116        $postData['comments'] = trim($comments);
    117117
    118118        $gfEntryId = $this->get_field_value($form, $entry, $feed['meta']['profilerdonation_gfentryid']);
  • profiler-donations-gravityforms/tags/2.7.1/index.php

    r3368177 r3387360  
    44Plugin URI: https://mediarealm.com.au/
    55Description: Integrates Gravity Forms with Profiler, enabling donation data and more to be sent directly to Profiler.
    6 Version: 2.7.0
     6Version: 2.7.1
    77
    88Author: Media Realm
  • profiler-donations-gravityforms/tags/2.7.1/readme.txt

    r3368177 r3387360  
    33Tags: gravity-forms, fundraising, crm, donation, profiler
    44Requires at least: 6.0
    5 Tested up to: 6.7.1
     5Tested up to: 6.8.3
    66Stable tag: trunk
    77Requires PHP: 7.4.0
     
    2222
    2323== Changelog ==
     24
     25= 2.7.1 =
     26
     27* Extra Comments Fields: Add space between this and normal comments field
     28* Donate & Interactions: Client Tags field
     29* Mailing List Advanced: Add 'Client Acquisition' field
     30* Interaction: Add Client Acquisition field
     31* Field Select Drop-down Labels: Add parent field name to complex fields, and substitute some blank field names with the field ID
     32* Card Processing (Legacy): Only include JS if a legacy card field is used on the form (note: Gravity Forms have deprecated this field and it may be removed in a future version - https://docs.gravityforms.com/deprecation-of-the-gravity-forms-credit-card-field/. If you use the Stripe field or other modern gateway, there will be no impact.)
    2433
    2534= 2.7.0 =
  • profiler-donations-gravityforms/trunk/cardprocess.php

    r1881378 r3387360  
    11<?php
     2// This is a legacy file to support credit card field processing in Gravity Forms for Profiler Donations.
     3// It works around some historic issues with how Gravity Forms's JS sends the credit card number field.
     4// Now days, this shouldn't be used - we recommend using Stripe or another modern gateway that handles card processing client-side.
    25
    36function profilerdonation_creditcardfilter($field_content, $field) {
     
    1013
    1114function profilerdonation_cardprocessscript($form) {
    12     wp_enqueue_script('profilerdonation_cardprocessscript', plugin_dir_url(__FILE__).'/cardprocess.js');
     15    // If Gravity Forms has a 'creditcard' field, we need to enqueue our card processing script
     16    $has_creditcard = false;
     17    foreach($form['fields'] as $field) {
     18        if($field->type == 'creditcard') {
     19            $has_creditcard = true;
     20            break;
     21        }
     22    }
     23
     24    if(!$has_creditcard) {
     25        return;
     26    }
     27
     28    wp_enqueue_script('profilerdonation_cardprocessscript', trailingslashit(plugin_dir_url(__FILE__)).'cardprocess.js');
    1329}
    1430
  • profiler-donations-gravityforms/trunk/class-profilercommon.php

    r3362220 r3387360  
    527527                    $field_settings = array();
    528528                    $field_settings['value'] = $inputvalue['id'];
    529                     $field_settings['label'] = $preface . $inputvalue['label'];
     529                    $field_settings['label'] = $preface . (!empty($field['label']) ? ' ' . $field['label'] . ': ' : '') . $inputvalue['label'];
    530530                    $formfields[] = $field_settings;
    531531                }
     532            } elseif ($field['type'] == 'hidden') {
     533                $formfields[] = array(
     534                    "value" => $field['id'],
     535                    "label" => (!empty($field['label']) ? $field['label'] : 'Hidden Field #' . $field['id'])
     536                );
     537            } elseif ($field['type'] == 'select') {
     538                $formfields[] = array(
     539                    "value" => $field['id'],
     540                    "label" => (!empty($field['label']) ? $field['label'] : 'Select Field #' . $field['id'])
     541                );
    532542            } elseif($field["type"] != "creditcard") {
    533543                // Process all fields except credit cards - we don't want them in the list
     
    566576                $formfields[] = array(
    567577                    "value" => $field['id'],
    568                     "label" => $field['label']
     578                    "label" => (!empty($field['label']) ? $field['label'] : 'Hidden Field #' . $field['id'])
    569579                );
    570580            }
     
    682692                $formfields[] = array(
    683693                    "value" => $field['id'],
    684                     "label" => $field['label']
     694                    "label" => (!empty($field['label']) ? $field['label'] : 'Select Field #' . $field['id'])
    685695                );
    686696            }
     
    717727                $formfields[] = array(
    718728                    "value" => $field['id'],
    719                     "label" => $field['label']
     729                    "label" => (!empty($field['label']) ? $field['label'] : 'Product Field #' . $field['id'])
    720730                );
    721731            }
  • profiler-donations-gravityforms/trunk/class-profilerdonate-gfaddon.php

    r3362220 r3387360  
    336336            "required" => false,
    337337            "class" => "merge-tag-support",
    338             "tooltip" => "This is extra text to be sent to Profiler in the Comments field. Youc an include Gravity Forms Merge Fields in this textarea to accept additional user input.",
     338            "tooltip" => "This is extra text to be sent to Profiler in the Comments field. You can include Gravity Forms Merge Fields in this textarea to accept additional user input.",
    339339        );
    340340
     
    470470            "choices" => $field_settings
    471471        );
     472
     473        $fields[] = array(
     474            "label" => 'Client Tags',
     475            "type" => "text",
     476            "name" => "profilerdonation_clienttags",
     477            "required" => false,
     478            "class" => "merge-tag-support",
     479            "tooltip" => "This field's value should match the Client Tags setup within Profiler. This list can be comma-separated for multiple tags. Use merge fields here to dynamically set tags.",
     480        );
    472481       
    473482        $fields[] = array(
     
    477486            "required" => false,
    478487            "tooltip" => "This field's value should match the Purpose Codes setup within Profiler.",
    479             "choices" => $field_settings
     488            "choices" => $field_settings,
    480489        );
    481490
     
    660669            $postData['clientAcquiredReason'] = $this->getDonationCode($feed, 'clientacquisitioncode', $form);
    661670        }
    662        
     671
     672        // Client Tags
     673        if(!empty($feed['meta']['profilerdonation_clienttags'])) {
     674            // Comma separated tags. Can be merge fields.
     675            $postData['clientTag'] = trim(GFCommon::replace_variables($feed['meta']['profilerdonation_clienttags'], $form, $entry, false, true, false, 'text'));
     676        }
     677
    663678        if($feed['meta']['profilerdonation_donationpurposecode'] !== "") {
    664679            $postData['paymentPupose'] = $this->get_field_value($form, $entry, $feed['meta']['profilerdonation_donationpurposecode']);
     
    702717        if(!empty($feed['meta']['profilerdonation_commentsextra'])) {
    703718            // Extra text to append to comments field
    704             $comments .= GFCommon::replace_variables($feed['meta']['profilerdonation_commentsextra'], $form, $entry, false, true, false, 'text');
     719            $comments .= " " . GFCommon::replace_variables($feed['meta']['profilerdonation_commentsextra'], $form, $entry, false, true, false, 'text');
    705720        }
    706721
     
    712727
    713728        // Comments
    714         $postData['comments'] = $comments;
     729        $postData['comments'] = trim($comments);
    715730
    716731        if($this->get_field_value($form, $entry, $feed['meta']['profilerdonation_donationtype']) == "regular") {
  • profiler-donations-gravityforms/trunk/class-profilerinteraction-gfaddon.php

    r3368177 r3387360  
    198198
    199199        $fields[] = array(
     200            "label" => 'Client Acquisition Field',
     201            "type" => "select",
     202            "name" => "profilerinteraction_clientacquisitioncode",
     203            "required" => false,
     204            "tooltip" => "This field's value should match the Client Acquisition Codes setup within Profiler.",
     205            "choices" => $field_settings,
     206            "pf_apifield" => "clientAcquiredReason",
     207        );
     208
     209        $fields[] = array(
     210            "label" => 'Client Tags',
     211            "type" => "text",
     212            "name" => "profilerinteraction_clienttags",
     213            "required" => false,
     214            "class" => "merge-tag-support",
     215            "tooltip" => "This field's value should match the Client Tags setup within Profiler. This list can be comma-separated for multiple tags. Use merge fields here to dynamically set tags.",
     216        );
     217
     218        $fields[] = array(
    200219            "label" => 'Interaction Text',
    201220            "type" => "textarea",
     
    288307        $postData['interactionAlert'] = $alert;
    289308
     309        // Client Tags
     310        if(!empty($feed['meta']['profilerinteraction_clienttags'])) {
     311            // Comma separated tags. Can be merge fields.
     312            $postData['clientTag'] = trim(GFCommon::replace_variables($feed['meta']['profilerinteraction_clienttags'], $form, $entry, false, true, false, 'text'));
     313        }
     314
    290315        return $postData;
    291316    }
  • profiler-donations-gravityforms/trunk/class-profilerlists-gfaddon.php

    r3362220 r3387360  
    187187            "choices" => $field_settings,
    188188            "pf_apifield" => "website",
     189        );
     190
     191        $fields[] = array(
     192            "label" => 'Client Acquisition Field',
     193            "type" => "select",
     194            "name" => "profilerdonation_clientacquisitioncode",
     195            "required" => false,
     196            "tooltip" => "This field's value should match the Client Acquisition Codes setup within Profiler.",
     197            "choices" => $field_settings,
     198            "pf_apifield" => "clientAcquiredReason",
    189199        );
    190200
  • profiler-donations-gravityforms/trunk/class-profilerlistsbasic-gfaddon.php

    r3335722 r3387360  
    11<?php
    2    
     2
    33class GFProfilerListsBasic extends GFProfilerCommon {
    44    protected $_slug = "profiler-listsbasic-gf";
  • profiler-donations-gravityforms/trunk/class-profilerpostdonate-gfaddon.php

    r3211366 r3387360  
    106106        $comments = $this->get_field_value($form, $entry, $feed['meta']['profilerdonation_comments']);
    107107
    108         $comments .= GFCommon::replace_variables($feed['meta']['profilerdonation_commentsextra'], $form, $entry, false, true, false, 'text');
     108        $comments .= " " . GFCommon::replace_variables($feed['meta']['profilerdonation_commentsextra'], $form, $entry, false, true, false, 'text');
    109109        $comments = html_entity_decode($comments);
    110110
     
    114114
    115115        // Comments
    116         $postData['comments'] = $comments;
     116        $postData['comments'] = trim($comments);
    117117
    118118        $gfEntryId = $this->get_field_value($form, $entry, $feed['meta']['profilerdonation_gfentryid']);
  • profiler-donations-gravityforms/trunk/index.php

    r3368177 r3387360  
    44Plugin URI: https://mediarealm.com.au/
    55Description: Integrates Gravity Forms with Profiler, enabling donation data and more to be sent directly to Profiler.
    6 Version: 2.7.0
     6Version: 2.7.1
    77
    88Author: Media Realm
  • profiler-donations-gravityforms/trunk/readme.txt

    r3368177 r3387360  
    33Tags: gravity-forms, fundraising, crm, donation, profiler
    44Requires at least: 6.0
    5 Tested up to: 6.7.1
     5Tested up to: 6.8.3
    66Stable tag: trunk
    77Requires PHP: 7.4.0
     
    2222
    2323== Changelog ==
     24
     25= 2.7.1 =
     26
     27* Extra Comments Fields: Add space between this and normal comments field
     28* Donate & Interactions: Client Tags field
     29* Mailing List Advanced: Add 'Client Acquisition' field
     30* Interaction: Add Client Acquisition field
     31* Field Select Drop-down Labels: Add parent field name to complex fields, and substitute some blank field names with the field ID
     32* Card Processing (Legacy): Only include JS if a legacy card field is used on the form (note: Gravity Forms have deprecated this field and it may be removed in a future version - https://docs.gravityforms.com/deprecation-of-the-gravity-forms-credit-card-field/. If you use the Stripe field or other modern gateway, there will be no impact.)
    2433
    2534= 2.7.0 =
Note: See TracChangeset for help on using the changeset viewer.