Plugin Directory

Changeset 1887989


Ignore:
Timestamp:
06/06/2018 08:29:38 AM (8 years ago)
Author:
prontotools
Message:

Release 1.4.0

Location:
connectwise-forms-integration/trunk
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • connectwise-forms-integration/trunk/README.md

    r1725908 r1887989  
    1818Changelog
    1919----------
     20
     21= 1.4.0 =
     22* Change default state of company to `CA`
     23
     24= 1.3.0 =
     25* Enable async feed processing. Feed processing is delayed until after the confirmation has been displayed instead of occurring just after the entry is saved.
    2026
    2127= 1.2.13 =
  • connectwise-forms-integration/trunk/VERSION

    r1725908 r1887989  
    1 1.2.13
     11.4.0
  • connectwise-forms-integration/trunk/class-cw-connection-version.php

    r1470466 r1887989  
    66    protected $_title                    = "Gravity Forms ConnectWise Add-On";
    77    protected $_short_title              = "ConnectWise";
    8     protected $_version                  = "1.1";
    9     protected $_min_gravityforms_version = "1.9.16";
     8    protected $_version                  = "1.4.0";
     9    protected $_min_gravityforms_version = "2.0";
    1010    protected $_slug                     = "connectwise";
    1111    protected $_path                     = "connectwise-forms-integration/gravityformsconnectwise.php";
  • connectwise-forms-integration/trunk/class-gf-connectwise.php

    r1725908 r1887989  
    44
    55class GFConnectWise extends GFFeedAddOn {
     6    protected $_async_feed_processing    = true;
    67    protected $_title                    = "Gravity Forms ConnectWise Add-On";
    78    protected $_short_title              = "ConnectWise";
    8     protected $_version                  = "1.1";
    9     protected $_min_gravityforms_version = "1.9.16";
     9    protected $_version                  = "1.4.0";
     10    protected $_min_gravityforms_version = "2.0";
    1011    protected $_slug                     = "connectwise";
    1112    protected $_path                     = "connectwise-forms-integration/gravityformsconnectwise.php";
     
    105106            }
    106107            if ( NULL == $state or "" == $state ) {
    107                 $state = "-";
     108                $state = "CA";
    108109            }
    109110            if ( NULL == $zip or "" == $zip ) {
     
    145146            $exist_company   = json_decode( $response["body"]);
    146147
    147             if ( empty( $exist_company ) ) {
     148            if ( empty( $exist_company ) and empty( $contact_data ) ) {
    148149                $is_company_created = true;
    149150            } else {
  • connectwise-forms-integration/trunk/gravityformsconnectwise.php

    r1725908 r1887989  
    44 * Plugin URI: http://www.prontotools.io
    55 * Description: Integrates Gravity Forms with ConnectWise, allowing form submissions to be automatically sent to your ConnectWise account.
    6  * Version: 1.2.13
     6 * Version: 1.4.0
    77 * Author: Pronto Tools
    88 * Author URI: http://www.prontotools.io
     
    1111 */
    1212
    13 add_action( "gform_loaded", array( "GFConnectWiseBootstrap", "load" ), 5 );
    14 require_once WP_PLUGIN_DIR . "/connectwise-forms-integration/class-cw-connection-version.php";
     13if ( class_exists( "GFForms" ) ) {
     14    add_action( "gform_loaded", array( "GFConnectWiseBootstrap", "load" ), 5 );
     15    require_once WP_PLUGIN_DIR . "/connectwise-forms-integration/class-cw-connection-version.php";
    1516
    16 class GFConnectWiseBootstrap {
     17    class GFConnectWiseBootstrap {
     18        public static function load() {
     19            $cw_api = new ConnectWiseVersion();
     20            $version = $cw_api->get();
    1721
    18     public static function load(){
    19         $cw_api = new ConnectWiseVersion();
    20         $version = $cw_api->get();
     22            if ( "2016.4" <= $version ) {
     23                require_once( "class-gf-connectwise-v4.php" );
     24                GFAddOn::register( "GFConnectWiseV4" );
     25            } else {
     26                require_once( "class-gf-connectwise.php" );
     27                GFAddOn::register( "GFConnectWise" );
     28            }
     29        }
     30    }
    2131
    22         if ( "2016.4" <= $version ) {
    23             require_once( "class-gf-connectwise-v4.php" );
    24             GFAddOn::register( "GFConnectWiseV4" );
    25         } else {
    26             require_once( "class-gf-connectwise.php" );
    27             GFAddOn::register( "GFConnectWise" );
    28         }
    29     }
     32    function gf_connectwise() {
     33        $cw_api = new ConnectWiseApi();
     34        $version = $cw_api->get_connectwise_version();
     35        if ( "2016.4" <= $version ) {
     36            require_once( "class-gf-connectwise-v4.php" );
     37            return GFConnectWiseV4::get_instance();
     38        } else {
     39            require_once( "class-gf-connectwise.php" );
     40            return GFConnectWise::get_instance();
     41        }
     42    }
    3043}
    31 function gf_connectwise() {
    32     $cw_api = new ConnectWiseApi();
    33     $version = $cw_api->get_connectwise_version();
    34     if ( "2016.4" <= $version ) {
    35         require_once( "class-gf-connectwise-v4.php" );
    36         return GFConnectWiseV4::get_instance();
    37     } else {
    38         require_once( "class-gf-connectwise.php" );
    39         return GFConnectWise::get_instance();
    40     }
    41 }
  • connectwise-forms-integration/trunk/readme.txt

    r1725908 r1887989  
    33Tags: connectwise, gravity forms, add-on, contact form, integration, psa, lead, marketing automation
    44Requires at least: 4.0
    5 Tested up to: 4.5.1
    6 Stable tag: 1.2.13
     5Tested up to: 4.9.6
     6Stable tag: 1.4.0
    77Copyright: © 2016 Pronto Tools
    88License: GNU General Public License v3.0
     
    7272
    7373== Changelog ==
     74
     75= 1.4.0 =
     76* Change default state of company to `CA`
     77
     78= 1.3.1 =
     79* Fix bug for set primary contact when submit existing contact with different company.
     80
     81= 1.3.0 =
     82* Enable async feed processing. Feed processing is delayed until after the confirmation has been displayed instead of occurring just after the entry is saved.
    7483
    7584= 1.2.13 =
  • connectwise-forms-integration/trunk/tests/GravityFormsConnectWiseTest.php

    r1725908 r1887989  
    942942            "addressLine2" => "-",
    943943            "city"         => "-",
    944             "state"        => "-",
     944            "state"        => "CA",
    945945            "zip"          => "-",
    946946            "phoneNumber"  => NULL,
     
    14341434            "addressLine2" => "-",
    14351435            "city"         => "-",
    1436             "state"        => "-",
     1436            "state"        => "CA",
    14371437            "zip"          => "-",
    14381438            "phoneNumber"  => NULL,
     
    16971697            "addressLine2" => "-",
    16981698            "city"         => "-",
    1699             "state"        => "-",
     1699            "state"        => "CA",
    17001700            "zip"          => "-",
    17011701            "phoneNumber"  => NULL,
     
    18061806            "addressLine2" => "-",
    18071807            "city"         => "-",
    1808             "state"        => "-",
     1808            "state"        => "CA",
    18091809            "zip"          => "-",
    18101810            "phoneNumber"  => null,
     
    18731873        $GF_ConnectWise->process_feed( $feed, $lead, NULL );
    18741874    }
    1875 
     1875   
     1876    function test_submit_existing_contact_with_new_company_should_not_update_to_be_primary_contact() {
     1877        $feed = array(
     1878            "id"        => "1",
     1879            "form_id"   => "1",
     1880            "is_active" => "1",
     1881            "meta"      => array(
     1882                "contact_map_fields_first_name" => "2.3",
     1883                "contact_map_fields_last_name"  => "2.6",
     1884                "contact_map_fields_email"      => "3",
     1885                "contact_type"                  => "1",
     1886                "contact_department"            => "2",
     1887                "company_type"                  => "1",
     1888                "company_status"                => "1",
     1889                "company_map_fields"            => array(
     1890                    array(
     1891                        "key"        => "company",
     1892                        "value"      => "2",
     1893                        "custom_key" => ""
     1894                    )
     1895                )
     1896            )
     1897        );
     1898
     1899        $lead = array(
     1900            "2.3" => "Test Firstname",
     1901            "2.6" => "Test Lastname",
     1902            "3"   => "test@test.com",
     1903            "2"   => "New Company",
     1904            "2.2" => "",
     1905            "2.4" => "",
     1906            "2.8" => ""
     1907        );
     1908
     1909        $comunication_types = array(
     1910            "value"             => "test@test.com",
     1911            "communicationType" => "Email",
     1912            "type"              => array(
     1913                "id"   => 1,
     1914                "name" => "Email"
     1915            ),
     1916            "defaultFlag"       => true
     1917        );
     1918
     1919        $contact_data = array(
     1920            "firstName"          => "Test Firstname",
     1921            "lastName"           => "Test Lastname",
     1922            "company"            => array(
     1923                "identifier" => "TestCompany",
     1924            ),
     1925            "department"         => array(
     1926                "id"         => "1"
     1927            ),
     1928            "communicationItems" => $communication_types
     1929        );
     1930
     1931        $GF_ConnectWise = $this->getMockBuilder( "GFConnectWise" )
     1932            ->setMethods( array( "send_request", "get_existing_contact", "is_valid_settings" ) )
     1933            ->getMock();
     1934
     1935        $GF_ConnectWise->expects( $this->exactly( 1 ) )
     1936            ->method( "is_valid_settings" )
     1937            ->willReturn( true );
     1938
     1939        $mock_contact_data = '{"id": "1", "firstName": "FirstName", "communicationItems": [{"communicationType": "Email", "value": "test@test.com"}], "company": {"identifier": "TestCompany"}}';
     1940        $mock_contact_response = json_decode( $mock_contact_data );
     1941
     1942        $mock_company_response = array(
     1943            "body" => '[{"id": "1"}]'
     1944        );
     1945
     1946        $company_data = array(
     1947            "id"           => 0,
     1948            "identifier"   => "NewCompany",
     1949            "name"         => "New Company",
     1950            "addressLine1" => "-",
     1951            "addressLine2" => "-",
     1952            "city"         => "-",
     1953            "state"        => "CA",
     1954            "zip"          => "-",
     1955            "phoneNumber"  => NULL,
     1956            "faxNumber"    => NULL,
     1957            "website"      => NULL,
     1958            "type"         => array(
     1959                "id" => "1"
     1960            ),
     1961            "status"       => array(
     1962                "id" => "1"
     1963            )
     1964        );
     1965
     1966        $GF_ConnectWise->expects( $this->at( 1 ) )
     1967            ->method( "get_existing_contact" )
     1968            ->will( $this->returnValue( $mock_contact_response ) );
     1969
     1970        $GF_ConnectWise->expects( $this->at( 2 ) )
     1971            ->method( "send_request" )
     1972            ->with(
     1973                "company/companies?conditions=identifier='NewCompany'",
     1974                "GET",
     1975                NULL
     1976            )
     1977            ->will( $this->returnValue( array() ) );
     1978
     1979        $GF_ConnectWise->expects( $this->at( 3 ) )
     1980            ->method( "send_request" )
     1981            ->with(
     1982                "company/companies?conditions=identifier='TestCompany'",
     1983                "GET",
     1984                NULL
     1985            )
     1986            ->will( $this->returnValue( $mock_company_response ) );
     1987
     1988        $GF_ConnectWise->expects( $this->exactly( 2 ) )
     1989            ->method( "send_request" );
     1990
     1991        $GF_ConnectWise->process_feed( $feed, $lead, NULL );
     1992    }
     1993   
    18761994    function test_process_feed_without_company_data_should_create_contact_to_catchall() {
    18771995        $feed = array(
     
    21932311            "addressLine2" => "-",
    21942312            "city"         => "-",
    2195             "state"        => "-",
     2313            "state"        => "CA",
    21962314            "zip"          => "-",
    21972315            "phoneNumber"  => NULL,
     
    23012419            "addressLine2" => "-",
    23022420            "city"         => "-",
    2303             "state"        => "-",
     2421            "state"        => "CA",
    23042422            "zip"          => "-",
    23052423            "phoneNumber"  => NULL,
     
    24612579            "addressLine2" => "-",
    24622580            "city"         => "-",
    2463             "state"        => "-",
     2581            "state"        => "CA",
    24642582            "zip"          => "-",
    24652583            "phoneNumber"  => NULL,
     
    35063624            "addressLine2" => "-",
    35073625            "city"         => "-",
    3508             "state"        => "-",
     3626            "state"        => "CA",
    35093627            "zip"          => "-",
    35103628            "phoneNumber"  => NULL,
     
    37293847            "addressLine2" => "-",
    37303848            "city"         => "-",
    3731             "state"        => "-",
     3849            "state"        => "CA",
    37323850            "zip"          => "-",
    37333851            "phoneNumber"  => NULL,
     
    39724090            "addressLine2" => "-",
    39734091            "city"         => "-",
    3974             "state"        => "-",
     4092            "state"        => "CA",
    39754093            "zip"          => "-",
    39764094            "phoneNumber"  => NULL,
     
    44304548            "handle"    => "pronto_ads_js",
    44314549            "src"       => "http://example.org/wp-content/plugins/connectwise-forms-integration/js/pronto-ads.js",
    4432             "version"   => "1.1",
     4550            "version"   => "1.3.0",
    44334551            "deps"      => array( "jquery" ),
    44344552            "enqueue"   =>
     
    44494567            "handle"    => "pronto_ads_js",
    44504568            "src"       => "http://example.org/wp-content/plugins/connectwise-forms-integration/js/pronto-ads.js",
    4451             "version"   => "1.1",
     4569            "version"   => "1.4.0",
    44524570            "deps"      => array( "jquery" ),
    4453             "strings" => array(
     4571            "strings"   => array(
    44544572                "path" => 'http://example.org/wp-content/plugins/connectwise-forms-integration/images/connectwise-banner.jpg'
    44554573            ),
Note: See TracChangeset for help on using the changeset viewer.