Changeset 1887989
- Timestamp:
- 06/06/2018 08:29:38 AM (8 years ago)
- Location:
- connectwise-forms-integration/trunk
- Files:
-
- 7 edited
-
README.md (modified) (1 diff)
-
VERSION (modified) (1 diff)
-
class-cw-connection-version.php (modified) (1 diff)
-
class-gf-connectwise.php (modified) (3 diffs)
-
gravityformsconnectwise.php (modified) (2 diffs)
-
readme.txt (modified) (2 diffs)
-
tests/GravityFormsConnectWiseTest.php (modified) (13 diffs)
Legend:
- Unmodified
- Added
- Removed
-
connectwise-forms-integration/trunk/README.md
r1725908 r1887989 18 18 Changelog 19 19 ---------- 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. 20 26 21 27 = 1.2.13 = -
connectwise-forms-integration/trunk/VERSION
r1725908 r1887989 1 1. 2.131 1.4.0 -
connectwise-forms-integration/trunk/class-cw-connection-version.php
r1470466 r1887989 6 6 protected $_title = "Gravity Forms ConnectWise Add-On"; 7 7 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"; 10 10 protected $_slug = "connectwise"; 11 11 protected $_path = "connectwise-forms-integration/gravityformsconnectwise.php"; -
connectwise-forms-integration/trunk/class-gf-connectwise.php
r1725908 r1887989 4 4 5 5 class GFConnectWise extends GFFeedAddOn { 6 protected $_async_feed_processing = true; 6 7 protected $_title = "Gravity Forms ConnectWise Add-On"; 7 8 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"; 10 11 protected $_slug = "connectwise"; 11 12 protected $_path = "connectwise-forms-integration/gravityformsconnectwise.php"; … … 105 106 } 106 107 if ( NULL == $state or "" == $state ) { 107 $state = " -";108 $state = "CA"; 108 109 } 109 110 if ( NULL == $zip or "" == $zip ) { … … 145 146 $exist_company = json_decode( $response["body"]); 146 147 147 if ( empty( $exist_company ) ) {148 if ( empty( $exist_company ) and empty( $contact_data ) ) { 148 149 $is_company_created = true; 149 150 } else { -
connectwise-forms-integration/trunk/gravityformsconnectwise.php
r1725908 r1887989 4 4 * Plugin URI: http://www.prontotools.io 5 5 * Description: Integrates Gravity Forms with ConnectWise, allowing form submissions to be automatically sent to your ConnectWise account. 6 * Version: 1. 2.136 * Version: 1.4.0 7 7 * Author: Pronto Tools 8 8 * Author URI: http://www.prontotools.io … … 11 11 */ 12 12 13 add_action( "gform_loaded", array( "GFConnectWiseBootstrap", "load" ), 5 ); 14 require_once WP_PLUGIN_DIR . "/connectwise-forms-integration/class-cw-connection-version.php"; 13 if ( 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"; 15 16 16 class GFConnectWiseBootstrap { 17 class GFConnectWiseBootstrap { 18 public static function load() { 19 $cw_api = new ConnectWiseVersion(); 20 $version = $cw_api->get(); 17 21 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 } 21 31 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 } 30 43 } 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 3 3 Tags: connectwise, gravity forms, add-on, contact form, integration, psa, lead, marketing automation 4 4 Requires at least: 4.0 5 Tested up to: 4. 5.16 Stable tag: 1. 2.135 Tested up to: 4.9.6 6 Stable tag: 1.4.0 7 7 Copyright: © 2016 Pronto Tools 8 8 License: GNU General Public License v3.0 … … 72 72 73 73 == 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. 74 83 75 84 = 1.2.13 = -
connectwise-forms-integration/trunk/tests/GravityFormsConnectWiseTest.php
r1725908 r1887989 942 942 "addressLine2" => "-", 943 943 "city" => "-", 944 "state" => " -",944 "state" => "CA", 945 945 "zip" => "-", 946 946 "phoneNumber" => NULL, … … 1434 1434 "addressLine2" => "-", 1435 1435 "city" => "-", 1436 "state" => " -",1436 "state" => "CA", 1437 1437 "zip" => "-", 1438 1438 "phoneNumber" => NULL, … … 1697 1697 "addressLine2" => "-", 1698 1698 "city" => "-", 1699 "state" => " -",1699 "state" => "CA", 1700 1700 "zip" => "-", 1701 1701 "phoneNumber" => NULL, … … 1806 1806 "addressLine2" => "-", 1807 1807 "city" => "-", 1808 "state" => " -",1808 "state" => "CA", 1809 1809 "zip" => "-", 1810 1810 "phoneNumber" => null, … … 1873 1873 $GF_ConnectWise->process_feed( $feed, $lead, NULL ); 1874 1874 } 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 1876 1994 function test_process_feed_without_company_data_should_create_contact_to_catchall() { 1877 1995 $feed = array( … … 2193 2311 "addressLine2" => "-", 2194 2312 "city" => "-", 2195 "state" => " -",2313 "state" => "CA", 2196 2314 "zip" => "-", 2197 2315 "phoneNumber" => NULL, … … 2301 2419 "addressLine2" => "-", 2302 2420 "city" => "-", 2303 "state" => " -",2421 "state" => "CA", 2304 2422 "zip" => "-", 2305 2423 "phoneNumber" => NULL, … … 2461 2579 "addressLine2" => "-", 2462 2580 "city" => "-", 2463 "state" => " -",2581 "state" => "CA", 2464 2582 "zip" => "-", 2465 2583 "phoneNumber" => NULL, … … 3506 3624 "addressLine2" => "-", 3507 3625 "city" => "-", 3508 "state" => " -",3626 "state" => "CA", 3509 3627 "zip" => "-", 3510 3628 "phoneNumber" => NULL, … … 3729 3847 "addressLine2" => "-", 3730 3848 "city" => "-", 3731 "state" => " -",3849 "state" => "CA", 3732 3850 "zip" => "-", 3733 3851 "phoneNumber" => NULL, … … 3972 4090 "addressLine2" => "-", 3973 4091 "city" => "-", 3974 "state" => " -",4092 "state" => "CA", 3975 4093 "zip" => "-", 3976 4094 "phoneNumber" => NULL, … … 4430 4548 "handle" => "pronto_ads_js", 4431 4549 "src" => "http://example.org/wp-content/plugins/connectwise-forms-integration/js/pronto-ads.js", 4432 "version" => "1. 1",4550 "version" => "1.3.0", 4433 4551 "deps" => array( "jquery" ), 4434 4552 "enqueue" => … … 4449 4567 "handle" => "pronto_ads_js", 4450 4568 "src" => "http://example.org/wp-content/plugins/connectwise-forms-integration/js/pronto-ads.js", 4451 "version" => "1. 1",4569 "version" => "1.4.0", 4452 4570 "deps" => array( "jquery" ), 4453 "strings" => array(4571 "strings" => array( 4454 4572 "path" => 'http://example.org/wp-content/plugins/connectwise-forms-integration/images/connectwise-banner.jpg' 4455 4573 ),
Note: See TracChangeset
for help on using the changeset viewer.