Changeset 676185
- Timestamp:
- 03/04/2013 07:33:44 PM (13 years ago)
- Location:
- dnd-gravity-forms-to-office-autopilot-contact-builder
- Files:
-
- 4 edited
-
assets/screenshot-1.png (modified) (previous)
-
trunk/gravity-to-officeAP.php (modified) (12 diffs)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/screenshot-1.png (modified) (previous)
Legend:
- Unmodified
- Added
- Removed
-
dnd-gravity-forms-to-office-autopilot-contact-builder/trunk/gravity-to-officeAP.php
r668734 r676185 5 5 Plugin URI: http://www.progo.com 6 6 Description: This plugin allows you to connect a single Gravity form to an Office AutoPilot Contact insert or update. 7 Version: 1. 07 Version: 1.1 8 8 Author: Eric DuRose 9 9 Author URI: http://www.danddcompany.com … … 74 74 add_settings_field('gvty_oap_State', 'State', 'gvty_oap_State_setting_string', 'my_gvty_to_oap_plugin', 'gvty_to_oap_settings'); 75 75 add_settings_field('gvty_oap_Zip', 'Zip', 'gvty_oap_Zip_setting_string', 'my_gvty_to_oap_plugin', 'gvty_to_oap_settings'); 76 add_settings_field('gvty_oap_Phone', 'Phone', 'gvty_oap_Phone_setting_string', 'my_gvty_to_oap_plugin', 'gvty_to_oap_settings'); 76 add_settings_field('gvty_oap_Phone', 'Cell Phone', 'gvty_oap_Phone_setting_string', 'my_gvty_to_oap_plugin', 'gvty_to_oap_settings'); 77 add_settings_field('gvty_oap_hPhone', 'Home Phone', 'gvty_oap_hPhone_setting_string', 'my_gvty_to_oap_plugin', 'gvty_to_oap_settings'); 78 add_settings_field('gvty_oap_oPhone', 'Office Phone', 'gvty_oap_oPhone_setting_string', 'my_gvty_to_oap_plugin', 'gvty_to_oap_settings'); 79 add_settings_field('gvty_oap_Fax', 'Fax #', 'gvty_oap_fax_setting_string', 'my_gvty_to_oap_plugin', 'gvty_to_oap_settings'); 80 add_settings_field('gvty_oap_Company', 'Company', 'gvty_oap_company_setting_string', 'my_gvty_to_oap_plugin', 'gvty_to_oap_settings'); 81 add_settings_field('gvty_oap_Title', 'Title', 'gvty_oap_title_setting_string', 'my_gvty_to_oap_plugin', 'gvty_to_oap_settings'); 82 add_settings_field('gvty_oap_Website', 'Website', 'gvty_oap_website_setting_string', 'my_gvty_to_oap_plugin', 'gvty_to_oap_settings'); 83 add_settings_field('gvty_oap_Country', 'Country', 'gvty_oap_country_setting_string', 'my_gvty_to_oap_plugin', 'gvty_to_oap_settings'); 84 add_settings_field('gvty_oap_Birthday', 'Birthday', 'gvty_oap_birthday_setting_string', 'my_gvty_to_oap_plugin', 'gvty_to_oap_settings'); 85 add_settings_field('gvty_oap_LeadSource', 'Lead Source', 'gvty_oap_leadsource_setting_string', 'my_gvty_to_oap_plugin', 'gvty_to_oap_settings'); 86 add_settings_field('gvty_oap_Question', 'Question', 'gvty_oap_question_setting_string', 'my_gvty_to_oap_plugin', 'gvty_to_oap_settings'); 77 87 } 78 88 … … 96 106 $valid['zip_id'] = $input['zip_id']; 97 107 $valid['phone_id'] = $input['phone_id']; 98 108 $valid['hphone_id'] = $input['hphone_id']; 109 $valid['ophone_id'] = $input['ophone_id']; 110 $valid['fax_id'] = $input['fax_id']; 111 $valid['company_id'] = $input['company_id']; 112 $valid['title_id'] = $input['title_id']; 113 $valid['website_id'] = $input['website_id']; 114 $valid['country_id'] = $input['country_id']; 115 $valid['birthday_id'] = $input['birthday_id']; 116 $valid['leadsource_id'] = $input['leadsource_id']; 117 $valid['question_id'] = $input['question_id']; 99 118 return $valid; 119 100 120 101 121 } … … 352 372 353 373 354 // Map Phone374 // Map Cell Phone 355 375 function gvty_oap_Phone_setting_string(){ 356 376 //get option 'Gravity Form Address Id - email_id' from the DB … … 368 388 369 389 <option value="<?php echo $field["id"] ?>" <?php selected( $options['phone_id'], $field["id"] )?> ><?php echo GFCommon::get_label($field) ?></option> 390 <?php 391 392 } 393 } 394 395 396 // Map Home Phone 397 function gvty_oap_hPhone_setting_string(){ 398 399 $options = get_option('gvty_oap_options'); 400 $form_id = $options['form_id']; 401 402 $form = RGFormsModel::get_form_meta($form_id); 403 $fields = array(); 404 ?> 405 <div id="select_gravity_form_entity"> 406 <select id="add_hphone_id" name="gvty_oap_options[hphone_id]"> 407 <option value=""> <?php _e("Select One", "gravityforms"); ?> </option> 408 <?php 409 foreach($form["fields"] as $field){?> 410 411 <option value="<?php echo $field["id"] ?>" <?php selected( $options['hphone_id'], $field["id"] )?> ><?php echo GFCommon::get_label($field) ?></option> 412 <?php 413 414 } 415 } 416 417 // Map Office Phone 418 function gvty_oap_oPhone_setting_string(){ 419 420 $options = get_option('gvty_oap_options'); 421 $form_id = $options['form_id']; 422 423 $form = RGFormsModel::get_form_meta($form_id); 424 $fields = array(); 425 ?> 426 <div id="select_gravity_form_entity"> 427 <select id="add_ophone_id" name="gvty_oap_options[ophone_id]"> 428 <option value=""> <?php _e("Select One", "gravityforms"); ?> </option> 429 <?php 430 foreach($form["fields"] as $field){?> 431 432 <option value="<?php echo $field["id"] ?>" <?php selected( $options['ophone_id'], $field["id"] )?> ><?php echo GFCommon::get_label($field) ?></option> 433 <?php 434 435 } 436 } 437 438 // Map Fax Number 439 function gvty_oap_fax_setting_string(){ 440 441 $options = get_option('gvty_oap_options'); 442 $form_id = $options['form_id']; 443 444 $form = RGFormsModel::get_form_meta($form_id); 445 $fields = array(); 446 ?> 447 <div id="select_gravity_form_entity"> 448 <select id="add_fax_id" name="gvty_oap_options[fax_id]"> 449 <option value=""> <?php _e("Select One", "gravityforms"); ?> </option> 450 <?php 451 foreach($form["fields"] as $field){?> 452 453 <option value="<?php echo $field["id"] ?>" <?php selected( $options['fax_id'], $field["id"] )?> ><?php echo GFCommon::get_label($field) ?></option> 454 <?php 455 456 } 457 } 458 459 // Map Company 460 function gvty_oap_company_setting_string(){ 461 462 $options = get_option('gvty_oap_options'); 463 $form_id = $options['form_id']; 464 465 $form = RGFormsModel::get_form_meta($form_id); 466 $fields = array(); 467 ?> 468 <div id="select_gravity_form_entity"> 469 <select id="add_company_id" name="gvty_oap_options[company_id]"> 470 <option value=""> <?php _e("Select One", "gravityforms"); ?> </option> 471 <?php 472 foreach($form["fields"] as $field){?> 473 474 <option value="<?php echo $field["id"] ?>" <?php selected( $options['company_id'], $field["id"] )?> ><?php echo GFCommon::get_label($field) ?></option> 475 <?php 476 477 } 478 } 479 480 481 // Map Title 482 function gvty_oap_title_setting_string(){ 483 484 $options = get_option('gvty_oap_options'); 485 $form_id = $options['form_id']; 486 487 $form = RGFormsModel::get_form_meta($form_id); 488 $fields = array(); 489 ?> 490 <div id="select_gravity_form_entity"> 491 <select id="add_title_id" name="gvty_oap_options[title_id]"> 492 <option value=""> <?php _e("Select One", "gravityforms"); ?> </option> 493 <?php 494 foreach($form["fields"] as $field){?> 495 496 <option value="<?php echo $field["id"] ?>" <?php selected( $options['title_id'], $field["id"] )?> ><?php echo GFCommon::get_label($field) ?></option> 497 <?php 498 499 } 500 } 501 502 // Map Website 503 function gvty_oap_website_setting_string(){ 504 505 $options = get_option('gvty_oap_options'); 506 $form_id = $options['form_id']; 507 508 $form = RGFormsModel::get_form_meta($form_id); 509 $fields = array(); 510 ?> 511 <div id="select_gravity_form_entity"> 512 <select id="add_website_id" name="gvty_oap_options[website_id]"> 513 <option value=""> <?php _e("Select One", "gravityforms"); ?> </option> 514 <?php 515 foreach($form["fields"] as $field){?> 516 517 <option value="<?php echo $field["id"] ?>" <?php selected( $options['website_id'], $field["id"] )?> ><?php echo GFCommon::get_label($field) ?></option> 518 <?php 519 520 } 521 } 522 523 // Map Country 524 function gvty_oap_country_setting_string(){ 525 526 $options = get_option('gvty_oap_options'); 527 $form_id = $options['form_id']; 528 529 $form = RGFormsModel::get_form_meta($form_id); 530 $fields = array(); 531 ?> 532 <div id="select_gravity_form_entity"> 533 <select id="add_country_id" name="gvty_oap_options[country_id]"> 534 <option value=""> <?php _e("Select One", "gravityforms"); ?> </option> 535 <?php 536 foreach($form["fields"] as $field){?> 537 538 <option value="<?php echo $field["id"] ?>" <?php selected( $options['country_id'], $field["id"] )?> ><?php echo GFCommon::get_label($field) ?></option> 539 <?php 540 541 } 542 } 543 544 545 546 // Map Birthday 547 function gvty_oap_birthday_setting_string(){ 548 549 $options = get_option('gvty_oap_options'); 550 $form_id = $options['form_id']; 551 552 $form = RGFormsModel::get_form_meta($form_id); 553 $fields = array(); 554 ?> 555 <div id="select_gravity_form_entity"> 556 <select id="add_birthday_id" name="gvty_oap_options[birthday_id]"> 557 <option value=""> <?php _e("Select One", "gravityforms"); ?> </option> 558 <?php 559 foreach($form["fields"] as $field){?> 560 561 <option value="<?php echo $field["id"] ?>" <?php selected( $options['birthday_id'], $field["id"] )?> ><?php echo GFCommon::get_label($field) ?></option> 562 <?php 563 564 } 565 } 566 567 // Map Lead Source 568 function gvty_oap_leadsource_setting_string(){ 569 570 $options = get_option('gvty_oap_options'); 571 $form_id = $options['form_id']; 572 573 $form = RGFormsModel::get_form_meta($form_id); 574 $fields = array(); 575 ?> 576 <div id="select_gravity_form_entity"> 577 <select id="add_leadsource_id" name="gvty_oap_options[leadsource_id]"> 578 <option value=""> <?php _e("Select One", "gravityforms"); ?> </option> 579 <?php 580 foreach($form["fields"] as $field){?> 581 582 <option value="<?php echo $field["id"] ?>" <?php selected( $options['leadsource_id'], $field["id"] )?> ><?php echo GFCommon::get_label($field) ?></option> 583 <?php 584 585 } 586 } 587 588 // Map Question 589 function gvty_oap_question_setting_string(){ 590 591 $options = get_option('gvty_oap_options'); 592 $form_id = $options['form_id']; 593 594 $form = RGFormsModel::get_form_meta($form_id); 595 $fields = array(); 596 ?> 597 <div id="select_gravity_form_entity"> 598 <select id="add_question_id" name="gvty_oap_options[question_id]"> 599 <option value=""> <?php _e("Select One", "gravityforms"); ?> </option> 600 <?php 601 foreach($form["fields"] as $field){?> 602 603 <option value="<?php echo $field["id"] ?>" <?php selected( $options['question_id'], $field["id"] )?> ><?php echo GFCommon::get_label($field) ?></option> 370 604 <?php 371 605 … … 395 629 $zip = $entry[$options['zip_id']]; 396 630 $phone = $entry[$options['phone_id']]; 631 $hphone = $entry[$options['hphone_id']]; 632 $ophone = $entry[$options['ophone_id']]; 633 $fax = $entry[$options['fax_id']]; 634 $company = $entry[$options['company_id']]; 635 $title = $entry[$options['title_id']]; 636 $website = $entry[$options['website_id']]; 637 $country = $entry[$options['country_id']]; 638 $birthday = $entry[$options['birthday_id']]; 639 $leadsource = $entry[$options['leadsource_id']]; 397 640 $contactTag = $options['oap_tag_name']; 398 641 $sequence = $options['oap_seq_id']; 399 400 642 $question = $entry[$options['question_id']]; 643 644 645 //echo "the state is: " . $state . "<br />"; 646 //print_r($entry); 401 647 402 648 //search for users using email address … … 413 659 414 660 update_oap_contact($cID, $contactTag, $sequence); 415 661 //echo "update!!!"; 662 //echo $cID; 416 663 417 664 } else { 418 665 419 add_new_oap_contact($fname, $lname, $email, $address, $city, $state, $zip, $phone, $contactTag, $sequence); 420 666 add_new_oap_contact($fname, $lname, $email, $address, $city, $state, $zip, $phone, $hphone, $ophone, $fax, $company, $title, $website, $country, $birthday, $leadsource, $contactTag, $sequence, $question); 667 //echo "add new!!!"; 668 //echo $cID; 421 669 422 670 } … … 459 707 $response = curl_exec($session); 460 708 curl_close($session); 461 709 //header("Content-Type: text/xml"); 710 711 712 //print_r($response); 713 //die(); 462 714 463 715 if ($response != "<result></result>"){ … … 478 730 function update_oap_contact ($cID, $contactTag, $sequence){ 479 731 480 $data ='<contact id="'.$cID.'"><Group_Tag name="Sequences and Tags"><field name="Contact Tags"> '.$contactTag.'</field><field name="Sequences">'.$sequence.'</field></Group_Tag></contact>';732 $data ='<contact id="'.$cID.'"><Group_Tag name="Sequences and Tags"><field name="Contact Tags">gtsr</field><field name="Sequences" action="remove">2</field></Group_Tag></contact>'; 481 733 482 734 $data = urlencode(urlencode($data)); … … 499 751 $response = curl_exec($session); 500 752 curl_close($session); 501 753 //header("Content-Type: text/xml"); 754 //echo $response; 502 755 503 756 } 504 757 505 758 //ADD NEW CONTACT 506 function add_new_oap_contact($fname, $lname, $email, $address, $city, $state, $zip, $phone, $ contactTag, $sequence){759 function add_new_oap_contact($fname, $lname, $email, $address, $city, $state, $zip, $phone, $hphone, $ophone, $fax, $company, $title, $website, $country, $birthday, $leadsource, $contactTag, $sequence, $question){ 507 760 508 761 $data = ' … … 517 770 <field name="Zip Code">' . $zip . '</field> 518 771 <field name="Cell Phone">' . $phone . '</field> 772 <field name="Home Phone">' . $hphone . '</field> 773 <field name="Office Phone">' . $ophone . '</field> 774 <field name="Fax">' . $fax . '</field> 775 <field name="Company">' . $company . '</field> 776 <field name="Title">' . $title . '</field> 777 <field name="Website ">'.$website.'</field> 778 <field name="Country">'.$country.'</field> 779 <field name="Birthday">' . $birthday . '</field> 780 </Group_Tag> 781 <Group_Tag name="Lead Information"> 782 <field name="Lead Source">'.$leadsource.'</field> 519 783 </Group_Tag> 520 784 <Group_Tag name="Sequences and Tags"> 521 785 <field name="Contact Tags">'. $contactTag . '</field> 522 786 <field name="Sequences">'. $sequence . '</field> 787 </Group_Tag> 788 <Group_Tag name="Contact Us"> 789 <field name="Question">'.$question.'</field> 523 790 </Group_Tag> 524 791 </contact> … … 543 810 $response = curl_exec($session); 544 811 curl_close($session); 545 812 //header("Content-Type: text/xml"); 813 //echo $response; 546 814 547 815 } -
dnd-gravity-forms-to-office-autopilot-contact-builder/trunk/readme.txt
r670556 r676185 1 === Gravity Forms To Office Autopilot===1 === ProGo Gravity Forms To Office AutoPilot Contact Builder === 2 2 Contributors: Eric DuRose, ProGo, D&D Company 3 3 Tags: Gravity Forms Add-on, Office AutoPilot, Contact builder 4 4 Requires at least: 3.0 5 5 Tested up to: 3.4.2 6 Stable tag: 1. 06 Stable tag: 1.1 7 7 License: GPLv3 or later 8 8 9 Gravity Form + Office Autopilot. Yeah, We ProGo'd That.9 This plugin allows you to connect a single Gravity form (http://www.gravityforms.com/) to a Office AutoPilot (http://officeautopilot.com/) Contact insert or update. 10 10 11 11 == Description == 12 12 13 This plugin is an add-on for the Gravity Forms plugin (http://www.gravityforms.com/). It give syou the ability to map a gravity form to your Office AutoPilot (http://officeautopilot.com/) account. This plugin will create a new contact record if the email address in the gravity form submission is unique. If the contact exists the record is updated.13 This plugin is an add-on for the Gravity Forms plugin (http://www.gravityforms.com/). It give you the ability to map a gravity form to your Office AutoPilot (http://officeautopilot.com/) account. This plugin will create a new contact record if the email address in the gravity form submission is unique. If the contact exists the record is updated. 14 14 15 15 Major features in ProGo Gravity Forms To Office AutoPilot Contact Builder 1.0 include: … … 44 44 = 1.0 = 45 45 * Stable Release 46 47 = 1.1 = 48 * Added Additional Contact Fields 49 * Home Phone, Office Phone, Fax, Company, Title, Website, Country, Birthday, Lead Source, Question 50 * Country and Lead Source data must match option selections available in your OAP account. 51 * Birthday must be a valid date.
Note: See TracChangeset
for help on using the changeset viewer.