diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c96b395 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +node_modules/ +Infusionsoft/examples/ +Infusionsoft/utilities/ +Infusionsoft/admin/ \ No newline at end of file diff --git a/Infusionsoft/admin/API_Field_Access.xml b/Infusionsoft/admin/API_Field_Access.xml deleted file mode 100644 index b21932a..0000000 --- a/Infusionsoft/admin/API_Field_Access.xml +++ /dev/null @@ -1,1290 +0,0 @@ - - - - - - Contact data - Contact - LEFT JOIN LeadSource ON Contact.LeadSourceId=LeadSource.Id - - Contact.IsUser - 0 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - User data - Contact - LEFT JOIN User ON Contact.Id=User.Id - - IsUser - 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - -
- - - - - - - - -
- - - Which campaigns - Campaignee - INNER JOIN Campaign ON Campaign.Id=Campaignee.CampaignId - - - - - - - - - - - - - - - -
- - - MarketingPiece - - - - - - - -
- - - - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- - - Lead data - Opportunity - - - - - - - - - - - - - - - - - - -
- - - Lead Stages - - - - - - -
- - - Lead Statuses - - - - - - -
- - - Product/Subscription Interests - - - - - - - - - - - - - -
- - - Product/Subscription Interest Bundles - - - - - -
- - - Continuity Programs - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - Products - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - Credit Card - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - Recurring Order - JobRecurring - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - Recurring Order With Basic Contact Info (no custom fields) - JobRecurring - INNER JOIN Contact ON Contact.Id=JobRecurring.ContactId - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - Contact.IsUser - 0 - - - INNER JOIN ContactGroup ON ContactGroupAssign.GroupId=ContactGroup.Id - INNER JOIN Contact ON Contact.Id=ContactGroupAssign.ContactId - LEFT JOIN LeadSource ON Contact.LeadSourceId=LeadSource.Id - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - Contact Groups - - - - - - -
- - - Contact Group Categories - - - - - -
- - - Lead Sources in the system - - - - - - - - - - - -
- - - Campaigns in the system - - - - - - - -
- - - An invoice for a client - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - -
- - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - -
- - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - -
- - - LEFT JOIN Address ON Job.ShippingAddressId=Address.Id - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - - - - -
- - - ContactTemplate - - - - -
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - ServiceCall - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
- - - - - - -
- - - - - - - -
- - - - - - - -
- - - - - - - -
- - - - - - - - - - - - - - - - - - - -
- - - - - - - - - - -
- - - - - - - - - - -
- -
diff --git a/Infusionsoft/admin/generate_broken_field_files.php b/Infusionsoft/admin/generate_broken_field_files.php deleted file mode 100644 index d3dd449..0000000 --- a/Infusionsoft/admin/generate_broken_field_files.php +++ /dev/null @@ -1,24 +0,0 @@ - array( - ), - '0.9.13' => array( - ), - '0.9.12' => array( - 'Infusionsoft_CProgram' => array('SubCategory') - ), -); - -//We want a cascading effect. If in version 0.9.6 we remove a field, we want to add it to all previous files, so we -//start with the latest version, and work our way backwards, always adding any removed fields from a later date to the earlier versions. -?>
 $fields){
-    if(!empty($previous_fields)) $fields = array_merge($fields, $previous_fields);
-    $file = fopen('remove_field_files/' . $version . "_remove_fields.txt", "w");
-    fwrite($file, serialize($fields));
-    echo $version . " - " . print_r($fields, true) . "
"; - $previous_fields = $fields; -} -?>
- - -load($filePath); - foreach($dom->getElementsByTagName('table') as $table) - { - $this->fields[$table->getAttribute('name')] = array(); - foreach($table->getElementsByTagName('field') as $field) - { - $this->fields[$table->getAttribute('name')][] = $field->getAttribute('name'); - } - } - - } -} - -class StubGenerator{ - protected $fields = array(); - protected $table; - - public function __construct($table, $fields){ - $this->table = $table; - $this->fields = $fields; - } - - public function write($templatePath, $filePath){ - ?>Writing source for table class: table; ?>
fields as $field){ - if($addedAField){ - $source .= ', '; - } - $source .= "'" . $field . "'"; - $addedAField = true; - } - $source .= ')'; - return $source; - } -} - -$filePath = dirname(__FILE__) . '/API_Field_Access.xml'; -$fields = new DataServiceTableFields(); -$fields->parseApiFieldAccessXML($filePath); - -$tables = array(); - -foreach($fields->fields as $table=>$fields){ - $stubGenerator = new StubGenerator($table, $fields); - $stubGenerator->write(dirname(dirname(__FILE__)) . '/generated/a_template_base_class.php', dirname(dirname(__FILE__)) . '/generated/' . $table . '.php'); - - - if(!file_exists(dirname(dirname(__FILE__)) . '/' . $table . '.php') || isset($_GET['overwriteUserEditable'])){ - $stubGenerator = new StubGenerator($table, array()); - $stubGenerator->write(dirname(dirname(__FILE__)) . '/generated/a_template_class.php', dirname(dirname(__FILE__)) . '/' . $table . '.php'); - } - - $tables[] = $table; -} - -$handle = fopen(dirname(dirname(__FILE__)) . "/examples/object_editor_all_tables.php", "w"); -fwrite($handle, " - -Overwrite User Editable Classes (THIS IS FOR SDK DEVELOPERS ONLY!) -
-
- - - - \ No newline at end of file diff --git a/Infusionsoft/admin/remove_field_files/0.9.12_remove_fields.txt b/Infusionsoft/admin/remove_field_files/0.9.12_remove_fields.txt deleted file mode 100644 index d1f23cc..0000000 --- a/Infusionsoft/admin/remove_field_files/0.9.12_remove_fields.txt +++ /dev/null @@ -1 +0,0 @@ -a:1:{s:21:"Infusionsoft_CProgram";a:1:{i:0;s:11:"SubCategory";}} \ No newline at end of file diff --git a/Infusionsoft/admin/remove_field_files/0.9.13_remove_fields.txt b/Infusionsoft/admin/remove_field_files/0.9.13_remove_fields.txt deleted file mode 100644 index c856afc..0000000 --- a/Infusionsoft/admin/remove_field_files/0.9.13_remove_fields.txt +++ /dev/null @@ -1 +0,0 @@ -a:0:{} \ No newline at end of file diff --git a/Infusionsoft/admin/remove_field_files/0.9.14_remove_fields.txt b/Infusionsoft/admin/remove_field_files/0.9.14_remove_fields.txt deleted file mode 100644 index c856afc..0000000 --- a/Infusionsoft/admin/remove_field_files/0.9.14_remove_fields.txt +++ /dev/null @@ -1 +0,0 @@ -a:0:{} \ No newline at end of file diff --git a/Infusionsoft/cache/remove_fields.cache b/Infusionsoft/cache/remove_fields.cache index 935209b..99739ee 100644 --- a/Infusionsoft/cache/remove_fields.cache +++ b/Infusionsoft/cache/remove_fields.cache @@ -1 +1 @@ -a:1:{s:10:"expiration";i:1400226862;} \ No newline at end of file +a:1:{s:10:"expiration";i:1460875210;} \ No newline at end of file diff --git a/Infusionsoft/examples/contact_tree.php b/Infusionsoft/examples/contact_tree.php deleted file mode 100644 index a112115..0000000 --- a/Infusionsoft/examples/contact_tree.php +++ /dev/null @@ -1,95 +0,0 @@ -Depending upon the number of purchases, emails, tags, and follow-up sequences this contact has, this may take a while (even as long as 5 minutes).
$contact->Id)); - $order_items = array(); - $invoices = array(); - foreach ($orders as $order) { - $order_items[$order->Id] = Infusionsoft_DataService::query(new Infusionsoft_OrderItem(), array('OrderId' => $order->Id)); - $invoices[$order->Id] = Infusionsoft_DataService::query(new Infusionsoft_Invoice(), array('JobId' => $order->Id)); - if (is_array($invoices[$order->Id]) && count($invoices[$order->Id]) > 0) { - $invoice_items[$order->Id] = Infusionsoft_DataService::query(new Infusionsoft_InvoiceItem(), array('InvoiceId' => $invoices[$order->Id][0]->Id)); - $invoice_payments[$order->Id] = Infusionsoft_DataService::query(new Infusionsoft_InvoicePayment(), array('InvoiceId' => $invoices[$order->Id][0]->Id)); - if(count($invoice_payments[$order->Id] > 0)){ - foreach ($invoice_payments[$order->Id] as $invoice_payment) { - $invoice_payment_payments[$invoice_payment->Id] = new Infusionsoft_Payment($invoice_payment->PaymentId); - } - } - } - } - - ?>

Contact

Order

Order Items

Id] as $order_item){ - dumpObject($order_item, 2); - } - if(isset($invoices[$order->Id][0])){ - ?>

Invoice

Id][0], 2); - ?>

Invoice Items

Id] as $invoice_item){ - dumpObject($invoice_item, 3); - } - foreach ($invoice_payments[$order->Id] as $invoice_payment) { - dumpObject($invoice_payment, 3); - dumpObject($invoice_payment_payments[$invoice_payment->Id], 4); - } - } - } -} - - -function dumpObject($object, $indent = 0) -{ - if(!is_object($object)){ - die(); - } - $data = $object->toArray(); - - ?> -
- - - - - getFields() as $field) { - ?> - - - - - getFields() as $field) { - ?> - - -
-
-
- Contact Id: - -
- StartDate = date('Y-m-d H:i:s', strtotime("-1 month")); - $recurringOrder->PaidThruDate = date('Y-m-d H:i:s', strtotime("-1 month")); - $recurringOrder->save(); - echo "

Subscription Created: $recurring_order_id

"; -} - -?> -

Create Subscription

-
- Contact Id:
- SubscriptionPlanId:
- -
diff --git a/Infusionsoft/examples/events.php b/Infusionsoft/examples/events.php deleted file mode 100644 index edea198..0000000 --- a/Infusionsoft/examples/events.php +++ /dev/null @@ -1,31 +0,0 @@ -FirstName = 'TEST'; - $contact->save(); - $contact2 = new Infusionsoft_Contact($contact->Id); - $contact2->delete(); - - function loaded($event){ - echo 'Loaded!
'; - } - - function deleted(Infusionsoft_SdkEvent $event){ - echo 'Deleted!
'; - } - - function saved(Infusionsoft_SdkEvent $event){ - echo 'Saved!
'; - } - - function saved2(Infusionsoft_SdkEvent $event){ - echo 'Saved2!
'; - } \ No newline at end of file diff --git a/Infusionsoft/examples/explore_custom_fields.php b/Infusionsoft/examples/explore_custom_fields.php deleted file mode 100644 index 73e7eda..0000000 --- a/Infusionsoft/examples/explore_custom_fields.php +++ /dev/null @@ -1,19 +0,0 @@ -Name == 'Test'){ - $customFieldValues = $customField->getCustomFieldValues(); - $customFieldValues[] = rand(1, 100) . ' Value'; - $customField->setCustomFieldValues($customFieldValues); - //$customField->save(); - } - } - - $customField = Infusionsoft_CustomFieldService::getCustomField(new Infusionsoft_Contact(), 'Test'); - var_dump($customField); diff --git a/Infusionsoft/examples/exporter.php b/Infusionsoft/examples/exporter.php deleted file mode 100644 index 283495a..0000000 --- a/Infusionsoft/examples/exporter.php +++ /dev/null @@ -1,113 +0,0 @@ -hasProperty('customFieldFormId')){ - echo 'Adding all custom fields available to object' . '
'; - $custom_fields = Infusionsoft_DataService::getCustomFields(new $class_name()); - $class_name::addCustomFields(array_keys($custom_fields)); - } - - $object = new $class_name(); - - if(!file_exists("../exports")){ - mkdir("../exports/"); - } - - - $file_name = "../exports/" . $_GET['object'] . '_export_' . date('Ymd-h.i.s') . '.csv'; - echo 'Creating csv file: ' . $file_name . '
'; - $csv_file = fopen($file_name, 'w'); - - fputcsv($csv_file, $object->getFields(), ",", "\""); - $page = 0; - do{ - echo 'Fetching page ' . $page . '
'; - flush(); - $object_fields = $object->getFields(); - - if(in_array('Id', $object_fields)){ - $results = Infusionsoft_DataService::queryWithOrderBy(new $class_name(), array('Id' => '%'), 'Id', true, 100, $page ); - }else { - $results = Infusionsoft_DataService::queryWithOrderBy(new $class_name(), array($object_fields[0] => '%'), $object_fields[0], true, 100, $page ); - } - - foreach($results as $result){ - fputcsv($csv_file, $result->toArray(), ",", "\""); - } - $page++; - }while(count($results) > 0); - - echo 'Closing csv file.
'; - fclose($csv_file); - ?>

"; - $page = 0; - do{ - echo 'Fetching page ' . $page . '
'; - flush(); - $object_fields = $object->getFields(); - - if(in_array('Id', $object_fields)){ - $results = Infusionsoft_DataService::queryWithOrderBy(new $class_name(), array('Id' => '%'), 'Id', true, 100, $page ); - }else { - $results = Infusionsoft_DataService::queryWithOrderBy(new $class_name(), array($object_fields[0] => '%'), $object_fields[0], true, 100, $page ); - } - - foreach($results as $result){ - if($result->PieceType == 'Email' && substr($result->PieceTitle, 0, 14) != 'An email draft' && substr($result->PieceTitle, 0, 12) != 'API Template' && $result->Categories != 'Product Fulfillment'){ - try{ - $template = Infusionsoft_APIEmailService::getEmailTemplate($result->Id); - - $file_name = "../exports/" . $_GET['object'] . '_' . $result->Id . '_' . date('Ymd-h.i.s') . '.txt'; - echo 'Creating file: ' . $file_name . '
'; - $file = fopen($file_name, 'w'); - fwrite($file, 'Title: ' . $template['pieceTitle'] . "\n"); - fwrite($file, 'Categories: ' . $template['categories'] . "\n"); - fwrite($file, 'From: ' . $template['fromAddress'] . "\n"); - fwrite($file, 'To: ' . $template['toAddress'] . "\n"); - fwrite($file, 'Cc: ' . $template['ccAddress'] . "\n"); - fwrite($file, 'Bcc: ' . $template['bccAddress'] . "\n"); - fwrite($file, 'Subject: ' . $template['subject'] . "\n\n"); - fwrite($file, 'Text Body: ' . $template['textBody'] . "\n\n\n"); - fwrite($file, 'Html Body: ' . $template['htmlBody'] . "\n"); - fclose($file); - } catch(Exception $e){ - echo "Could not export template: " . $result->Id . "
"; - } - } - } - $page++; - }while(count($results) > 0); - - } - } -?> - -
- Table To Export: -
- - -
- - - -
- ContactId:
- -
- -
No Invoices Found - - getFields() as $field){ - ?> - - - - -
New Invoice
$field; ?>
- - \ No newline at end of file diff --git a/Infusionsoft/examples/leadscoring.php b/Infusionsoft/examples/leadscoring.php deleted file mode 100644 index 6d92a5a..0000000 --- a/Infusionsoft/examples/leadscoring.php +++ /dev/null @@ -1,16 +0,0 @@ -
- ContactId: - -

-_LeadScore = $contact->_LeadScore + 1; - $contact->save(); - - echo 'Lead Score for Contact: ' . $contact->FirstName . ' ' . $contact->LastName . ' is now: ' . $contact->_LeadScore; -} - diff --git a/Infusionsoft/examples/list_objects.php b/Infusionsoft/examples/list_objects.php deleted file mode 100644 index 91d5e3e..0000000 --- a/Infusionsoft/examples/list_objects.php +++ /dev/null @@ -1,53 +0,0 @@ - -
- Table:
-
- -
- '%')); - ?> - - - - getFields() as $field){ - ?> - - - - toArray() as $data){ - ?> - -
- getMessage(); - renderLoadForm(); - return; - } - foreach($object->getFields() as $fieldName){ - $object->$fieldName = $_POST[$fieldName]; - } - $object->save(); - - echo 'Object Saved!'; - renderObjectForm($object); - } - else{ - $class_name = "Infusionsoft_" . $_GET['object']; - $object = null; - - echo 'I am loading an object...'; - try{ - $object = new $class_name($_GET['Id']); - } - catch(Exception $e){ - echo $e->getMessage(); - renderLoadForm(); - return; - } - renderObjectForm($object); - } - - function renderLoadForm(){ - ?> -
- Table:
-
- Id:
-
- -
- -
- - toArray() as $field=>$value){ - ?> -
-
- - -
- 'Contact', - 1 => 'User', - 2 => 'UserGroup', - 3 => 'GroupAssign', - 4 => 'Campaignee', - 5 => 'Template', - 6 => 'CampaignStep', - 7 => 'MtgLead', - 8 => 'Lead', - 9 => 'Stage', - 47 => 'StageMove', - 10 => 'Status', - 11 => 'ProductInterest', - 12 => 'ProductInterestBundle', - 46 => 'ProductCategoryAssign', - 57 => 'ProductCategory', - 13 => 'CProgram', - 14 => 'Product', - 15 => 'CreditCard', - 16 => 'RecurringOrder', - 17 => 'RecurringOrderWithContact', - 18 => 'ContactGroupAssign', - 19 => 'ContactGroup', - 20 => 'ContactGroupCategory', - 21 => 'LeadSource', - 22 => 'Campaign', - 23 => 'Invoice', - 24 => 'Affiliate', - 25 => 'Referral', - 26 => 'InvoiceItem', - 27 => 'InvoicePayment', - 28 => 'PayPlan', - 29 => 'PayPlanItem', - 30 => 'Payment', - 31 => 'CCharge', - 32 => 'Job', - 33 => 'JobRecurringInstance', - 34 => 'OrderItem', - 35 => 'ActionSequence', - 36 => 'ContactAction', - 37 => 'Ticket', - 38 => 'TicketStage', - 39 => 'TicketType', - 40 => 'DataFormTab', - 41 => 'DataFormGroup', - 42 => 'DataFormField', - 43 => 'Expense', - 44 => 'FileBox', - 45 => 'SavedFilter', - 46 => 'Company', - 48 => 'SubscriptionPlan', - -); \ No newline at end of file diff --git a/Infusionsoft/examples/subscription_tree.php b/Infusionsoft/examples/subscription_tree.php deleted file mode 100644 index 69aae35..0000000 --- a/Infusionsoft/examples/subscription_tree.php +++ /dev/null @@ -1,101 +0,0 @@ -
OrderId); - $subscription = new Infusionsoft_RecurringOrder($order->JobRecurringId); - - $orders = Infusionsoft_DataService::queryWithOrderBy(new Infusionsoft_Job(), array('JobRecurringId' => $subscription->Id), 'StartDate'); - - $order_items = array(); - $invoices = array(); - foreach ($orders as $order) { - $order_items[$order->Id] = Infusionsoft_DataService::query(new Infusionsoft_OrderItem(), array('OrderId' => $order->Id)); - $invoices[$order->Id] = Infusionsoft_DataService::query(new Infusionsoft_Invoice(), array('JobId' => $order->Id)); - if (is_array($invoices[$order->Id]) && count($invoices[$order->Id]) > 0) { - $invoice_items[$order->Id] = Infusionsoft_DataService::query(new Infusionsoft_InvoiceItem(), array('InvoiceId' => $invoices[$order->Id][0]->Id)); - $invoice_payments[$order->Id] = Infusionsoft_DataService::query(new Infusionsoft_InvoicePayment(), array('InvoiceId' => $invoices[$order->Id][0]->Id)); - if(count($invoice_payments[$order->Id] > 0)){ - foreach ($invoice_payments[$order->Id] as $invoice_payment) { - $invoice_payment_payments[$invoice_payment->Id] = new Infusionsoft_Payment($invoice_payment->PaymentId); - } - } - } - } - - $contact = new Infusionsoft_Contact($order->ContactId); - - ?>

Contact

Order

Order Items

Id] as $order_item){ - dumpObject($order_item, 2); - } - if(isset($invoices[$order->Id][0])){ - ?>

Invoice

Id][0], 2); - ?>

Invoice Items

Id] as $invoice_item){ - dumpObject($invoice_item, 3); - } - foreach ($invoice_payments[$order->Id] as $invoice_payment) { - dumpObject($invoice_payment, 3); - dumpObject($invoice_payment_payments[$invoice_payment->Id], 4); - } - } - } -} - - -function dumpObject($object, $indent = 0) -{ - if(!is_object($object)){ - die(); - } - $data = $object->toArray(); - - ?> -
- - - - - getFields() as $field) { - ?> - - - - - getFields() as $field) { - ?> - - -
-
-
- OrderItem Id: - -
- diff --git a/Infusionsoft/utilities/code_generator.php b/Infusionsoft/utilities/code_generator.php deleted file mode 100644 index 18dae91..0000000 --- a/Infusionsoft/utilities/code_generator.php +++ /dev/null @@ -1,43 +0,0 @@ -"; - require_once('../examples/object_editor_all_tables.php'); - foreach($all_tables as $table){ - $file_name = str_replace('~TableName~', $table, $_POST['fileNamePattern']); - file_put_contents($file_name, str_replace("~TableName~", $table, $_POST['fileTemplate'])); - echo "Creating File: $file_name
"; - } - echo "Done Merging Files..
"; -} - -/** - * Created by JetBrains PhpStorm. - * User: Joey - * Date: 8/24/12 - * Time: 2:02 PM - * To change this template use File | Settings | File Templates. - */ -?> -

Code Generator

-

This tool will generate a file based on the information you put in below for each Data Object.

- -
- - - - -
- -
\ No newline at end of file diff --git a/Infusionsoft/utilities/make_phpstorm_property_hints.php b/Infusionsoft/utilities/make_phpstorm_property_hints.php deleted file mode 100644 index e67af28..0000000 --- a/Infusionsoft/utilities/make_phpstorm_property_hints.php +++ /dev/null @@ -1,20 +0,0 @@ -getFields(); - ?> -

-
/**
- */
=0 if(is_active){ img.src = img.src.replace("active1.png", "active0.png"); - jQuery(img).attr('title','').attr('alt', ''); + jQuery(img).attr('title','').attr('alt', ''); } else{ img.src = img.src.replace("active0.png", "active1.png"); - jQuery(img).attr('title','').attr('alt', ''); + jQuery(img).attr('title','').attr('alt', ''); } - var mysack = new sack("" ); + var mysack = new sack("" ); mysack.execute = 1; mysack.method = 'POST'; mysack.setVar( "action", "rg_update_feed_active" ); mysack.setVar( "rg_update_feed_active", "" ); mysack.setVar( "feed_id", feed_id ); mysack.setVar( "is_active", is_active ? 0 : 1 ); - mysack.encVar( "cookie", document.cookie, false ); - mysack.onError = function() { alert('' )}; + mysack.onError = function() { alert('' )}; mysack.runAJAX(); return true; @@ -186,12 +185,12 @@ public static function is_gravity_forms_installed($asd = '', $echo = true) { if(!class_exists('RGForms')) { if(file_exists(WP_PLUGIN_DIR.'/gravityforms/gravityforms.php')) { $installed = 1; - $message .= __(sprintf('%sGravity Forms is installed but not active. %sActivate Gravity Forms%s to use the %s plugin.%s', '

', '', '', $name,'

'), 'gravity-forms-infusionsoft'); + $message .= sprintf( esc_attr__('%sGravity Forms is installed but not active. %sActivate Gravity Forms%s to use the %s plugin.%s', 'gravity-forms-infusionsoft' ), '

', '', '', esc_html( $name ),'

'); } else { $message .= <<Gravity Forms Plugin for WordPress

-

Gravity Forms is required for the $name

-

You do not have the Gravity Forms plugin installed. Get Gravity Forms today.

+

Gravity Forms Plugin for WordPress

+

Gravity Forms is required for the $name

+

You do not have the Gravity Forms plugin installed. Get Gravity Forms today.

EOD; } @@ -206,7 +205,7 @@ public static function is_gravity_forms_installed($asd = '', $echo = true) { public static function plugin_row(){ if(!self::is_gravityforms_supported()){ - $message = sprintf(__("%sGravity Forms%s is required. %sPurchase it today!%s"), "", "", "", ""); + $message = sprintf(esc_html__("%sGravity Forms%s is required. %sPurchase it today!%s", 'gravity-forms-infusionsoft'), "", "", "", ""); self::display_plugin_message($message, true); } } @@ -233,9 +232,9 @@ static function settings_link( $links, $file ) { static $this_plugin; if( ! $this_plugin ) $this_plugin = plugin_basename(__FILE__); if ( $file == $this_plugin ) { - $settings_link = '' . __('Feeds', 'gravity-forms-infusionsoft') . ''; + $settings_link = '' . esc_attr__('Feeds', 'gravity-forms-infusionsoft') . ''; array_unshift( $links, $settings_link ); // before other links - $settings_link = '' . __('Settings', 'gravity-forms-infusionsoft') . ''; + $settings_link = '' . esc_attr__('Settings', 'gravity-forms-infusionsoft') . ''; array_unshift( $links, $settings_link ); // before other links } return $links; @@ -273,12 +272,12 @@ static function setup_tooltips() { //Adds feed tooltips to the list of tooltips public static function tooltips($tooltips){ $infusionsoft_tooltips = array( - "infusionsoft_contact_list" => "
" . __("Infusionsoft List", "gravity-forms-infusionsoft") . "
" . __("Select the Infusionsoft list you would like to add your contacts to.", "gravity-forms-infusionsoft"), - "infusionsoft_gravity_form" => "
" . __("Gravity Form", "gravity-forms-infusionsoft") . "
" . __("Select the Gravity Form you would like to integrate with Infusionsoft. Contacts generated by this form will be automatically added to your Infusionsoft account.", "gravity-forms-infusionsoft"), - "infusionsoft_map_fields" => "
" . __("Map Fields", "gravity-forms-infusionsoft") . "
" . __("Associate your Infusionsoft attributes to the appropriate Gravity Form fields by selecting.", "gravity-forms-infusionsoft"), - "infusionsoft_optin_condition" => "
" . __("Opt-In Condition", "gravity-forms-infusionsoft") . "
" . __("When the opt-in condition is enabled, form submissions will only be exported to Infusionsoft when the condition is met. When disabled all form submissions will be exported.", "gravity-forms-infusionsoft"), - "infusionsoft_tag" => "
" . __("Entry Tags", "gravity-forms-infusionsoft") . "
" . __("Add these tags to every entry (in addition to any conditionally added tags below).", "gravity-forms-infusionsoft"), - "infusionsoft_tag_optin_condition" => "
" . __("Conditionally Added Tags", "gravity-forms-infusionsoft") . "
" . __("Tags will be added to the entry when the conditions specified are met. Does not override the 'Entry Tags' setting above (which are applied to all entries).", "gravity-forms-infusionsoft"), + "infusionsoft_contact_list" => "
" . esc_attr__("Infusionsoft List", "gravity-forms-infusionsoft") . "
" . __("Select the Infusionsoft list you would like to add your contacts to.", "gravity-forms-infusionsoft"), + "infusionsoft_gravity_form" => "
" . esc_attr__("Gravity Form", "gravity-forms-infusionsoft") . "
" . esc_attr__("Select the Gravity Form you would like to integrate with Infusionsoft. Contacts generated by this form will be automatically added to your Infusionsoft account.", "gravity-forms-infusionsoft"), + "infusionsoft_map_fields" => "
" . esc_attr__("Map Fields", "gravity-forms-infusionsoft") . "
" . esc_attr__("Associate your Infusionsoft attributes to the appropriate Gravity Form fields by selecting.", "gravity-forms-infusionsoft"), + "infusionsoft_optin_condition" => "
" . esc_attr__("Opt-In Condition", "gravity-forms-infusionsoft") . "
" . esc_attr__("When the opt-in condition is enabled, form submissions will only be exported to Infusionsoft when the condition is met. When disabled all form submissions will be exported.", "gravity-forms-infusionsoft"), + "infusionsoft_tag" => "
" . esc_attr__("Entry Tags", "gravity-forms-infusionsoft") . "
" . esc_attr__("Add these tags to every entry (in addition to any conditionally added tags below).", "gravity-forms-infusionsoft"), + "infusionsoft_tag_optin_condition" => "
" . esc_attr__("Conditionally Added Tags", "gravity-forms-infusionsoft") . "
" . esc_attr__("Tags will be added to the entry when the conditions specified are met. Does not override the 'Entry Tags' setting above (which are applied to all entries).", "gravity-forms-infusionsoft"), ); return array_merge($tooltips, $infusionsoft_tooltips); @@ -290,7 +289,7 @@ public static function create_menu($menus){ // Adding submenu if user has access $permission = self::has_access("gravityforms_infusionsoft"); if(!empty($permission)) - $menus[] = array("name" => "gf_infusionsoft", "label" => __("Infusionsoft", "gravity-forms-infusionsoft"), "callback" => array("GFInfusionsoft", "infusionsoft_page"), "permission" => $permission); + $menus[] = array("name" => "gf_infusionsoft", "label" => esc_attr__("Infusionsoft", "gravity-forms-infusionsoft"), "callback" => array("GFInfusionsoft", "infusionsoft_page"), "permission" => $permission); return $menus; } @@ -324,7 +323,7 @@ public static function settings_page(){ self::uninstall(); ?> -
",""), "gravity-forms-infusionsoft")?>
+
",""); ?>
- -
+ -

- - - - - - - - - - - - - - - - - - +

+ +
+

+ +
"/>
"/>
/>
" />
+ + + + + + + + + +
" name="gf_infusionsoft_key" size="68" value=""/>
" value=""/>
+ +
+

+ + + + + + + + + + +
/>
" />
+
-

-
+

+
'; + $uninstall_button = ''; echo apply_filters("gform_infusionsoft_uninstall_button", $uninstall_button); ?>
@@ -396,7 +406,7 @@ public static function infusionsoft_page(){ //Displays the Infusionsoft feeds list page private static function list_page(){ if(!self::is_gravityforms_supported()){ - die(__(sprintf("The Infusionsoft Add-On requires Gravity Forms %s. Upgrade automatically on the %sPlugin page%s.", self::$min_gravityforms_version, "", ""), "gravity-forms-infusionsoft")); + die( sprintf( __("The Infusionsoft Add-On requires Gravity Forms %s. Upgrade automatically on the %sPlugin page%s.", "gravity-forms-infusionsoft"), self::$min_gravityforms_version, "", "") ); } if(isset($_POST["action"]) && $_POST["action"] == "delete"){ @@ -405,7 +415,7 @@ private static function list_page(){ $id = absint($_POST["action_argument"]); GFInfusionsoftData::delete_feed($id); ?> -
+
-
+
- <?php _e(" src="/images/infusion-logo.png" style="margin:15px 7px 0 0; display:block;" width="200" height="33" /> -

- + <?php esc_attr_e(" src="/images/infusion-logo.png" style="margin:15px 7px 0 0; display:block;" width="200" height="33" /> +

+

-

Please review it on WordPress.org! Note: You must be logged in to WordPress.org to leave a review!', 'gravity-forms-infusionsoft'); ?>

+

Please review it on WordPress.org! Note: You must be logged in to WordPress.org to leave a review!', 'gravity-forms-infusionsoft'); ?>

    -
  • |
  • -
  • +
  • |
  • +
@@ -445,13 +455,13 @@ private static function list_page(){
- + '; + echo ''; ?>
@@ -460,7 +470,7 @@ private static function list_page(){ - + @@ -468,7 +478,7 @@ private static function list_page(){ - + @@ -481,27 +491,27 @@ private static function list_page(){ ?> "/> - .png" alt="" title="" onclick="ToggleActive(this, ); " /> + .png" alt="" title="" onclick="ToggleActive(this, ); " /> - " title=""> + " title=""> @@ -514,16 +524,16 @@ private static function list_page(){ if(!empty($valid)){ ?> - - ', ""), "gravity-forms-infusionsoft"); ?> + + ', ""); ?> - - ', ""), "gravity-forms-infusionsoft"); ?> + + ', ""); ?> Infusionsoft Logo -

Don\'t have an Infusionsoft account?

- This plugin requires an Infusionsoft account. If you have an Infusionsoft account, fill out the settings form below. Otherwise, you should sign up for an Infusionsoft account and start taking advantage of the world\'s best CRM. - Sign up for Infusionsoft Today! Visit Infusionsoft.com - ', 'gravity-forms-infusionsoft'), self::get_base_url().'/images/infusion-logo.png')); + $message = sprintf( '%s

%s

%s

%s %s

', + 'Infusionsoft Logo', + sprintf( esc_html__('Don\'t have an %sInfusionsoft%s account?', 'gravity-forms-infusionsoft'), '', '' ), + esc_html__('This plugin requires an Infusionsoft account. If you have an Infusionsoft account, fill out the settings form below. Otherwise, you should sign up for an Infusionsoft account and start taking advantage of the world\'s best CRM.', 'gravity-forms-infusionsoft'), + esc_html__('Sign up for Infusionsoft Today!', 'gravity-forms-infusionsoft'), + esc_html__('Visit Infusionsoft.com', 'gravity-forms-infusionsoft') + ); + $works = false; $class = 'updated'; } else if(empty($appname)) { - $message = sprintf( __("Your Account Subdomain (also called \"Application Name\") is required. %sEnter it below%s.", 'gravity-forms-infusionsoft'), "" ); + $message = sprintf( esc_html__("Your Account Subdomain (also called \"Application Name\") is required. %sEnter it below%s.", 'gravity-forms-infusionsoft'), "" ); $message .= ""; - $message .= sprintf( __("If you access your Infusionsoft account from %sexample123%s.infusionsoft.com%s, your Account Subdomain is %sexample123%s", 'gravity-forms-infusionsoft'), "", "", "", "", "" ); + $message .= sprintf( esc_attr__("If you access your Infusionsoft account from %sexample123%s.infusionsoft.com%s, your Account Subdomain is %sexample123%s", 'gravity-forms-infusionsoft'), "", "", "", "", "" ); $message .= ""; $works = false; } elseif(empty($key)) { - $message = wpautop( sprintf( __('Your API Key is required, please %senter your API key below%s.', 'gravity-forms-infusionsoft'), '' ) ); + $message = wpautop( sprintf( esc_attr__('Your API Key is required, please %senter your API key below%s.', 'gravity-forms-infusionsoft'), '' ) ); $works = false; } else { self::get_api(); @@ -587,21 +599,21 @@ private static function test_api($echo = false) { try { Infusionsoft_WebFormService::getMap($app); - $message .= wpautop(sprintf(__("It works: everything is communicating properly and your settings are correct. Now go %sconfigure form integration with Infusionsoft%s!", "gravity-forms-infusionsoft"), '', '')); + $message .= wpautop(sprintf(esc_attr__("It works: everything is communicating properly and your settings are correct. Now go %sconfigure form integration with Infusionsoft%s!", "gravity-forms-infusionsoft"), '', '')); } catch(Exception $e){ $works = false; if(strpos($e->getMessage(), "[InvalidKey]") !== FALSE){ - $message .= wpautop(sprintf(__('Your API Key is not correct, please double check your %sAPI key setting%s.', 'gravity-forms-infusionsoft'), '')); + $message .= wpautop(sprintf(esc_attr__('Your API Key is not correct, please double check your %sAPI key setting%s.', 'gravity-forms-infusionsoft'), '')); } else{ - $message .= wpautop(sprintf(__('Failure to connect: %s', 'gravity-forms-infusionsoft'), $e->error)); + $message .= wpautop(sprintf(esc_attr__('Failure to connect: %s', 'gravity-forms-infusionsoft'), $e->error)); } } } else{ $works = false; - $message .= wpautop(__('Something is wrong. See below for details, check your settings and try again.', 'gravity-forms-infusionsoft')); + $message .= wpautop(esc_attr__('Something is wrong. See below for details, check your settings and try again.', 'gravity-forms-infusionsoft')); } $exceptions = Infusionsoft_AppPool::getApp()->getExceptions(); @@ -609,7 +621,7 @@ private static function test_api($echo = false) { if(!empty($exceptions)) { $message .= '
    '; foreach($exceptions as $exception){ - $messagetext = str_replace('[', __('Error key: [', 'gravity-forms-infusionsoft'), str_replace(']', ']
    Error message: ', $exception->getMessage())); + $messagetext = str_replace('[', esc_attr__('Error key: [', 'gravity-forms-infusionsoft'), str_replace(']', ']
    Error message: ', $exception->getMessage())); $message .= '
  • '.$messagetext.'
  • '; } $message .= '
'; @@ -657,14 +669,14 @@ private static function edit_page(){ #infusionsoft_doubleoptin_warning{padding-left: 5px; padding-bottom:4px; font-size: 10px;}
- <?php _e(" src="/images/infusion-logo.png" style="display:block; margin:15px 7px 0 0;" width="200" height="33"/> -

+ <?php esc_attr_e(" src="/images/infusion-logo.png" style="display:block; margin:15px 7px 0 0;" width="200" height="33"/> +

    -
  • |
  • -
  • +
  • |
  • +
-
", "")); ?>
+
", "")); ?>
-

", "") ?>

+

", "") ?>

-
+
-

+

id == $config["form_id"]) { - echo '

'.sprintf(__('(Currently linked with %s)', "gravity-forms-infusionsoft"), $form->title).'

'; + echo '

'.sprintf(esc_html__('(Currently linked with %s)', "gravity-forms-infusionsoft"), $form->title).'

'; } } } ?> - + - +    - +
>
-

-

- +

+

+
-
- +
+
- +
@@ -855,8 +867,8 @@ private static function edit_page(){ $disabled_text = "disabled='disabled'"; $tags = self::get_tag_list(); $list = ''; - $add_icon = GFCommon::get_base_url() . "/images/add.png"; - $delete_icon = GFCommon::get_base_url() . "/images/remove.png"; + $add_icon = esc_url( GFCommon::get_base_url() . "/images/add.png" ); + $delete_icon = esc_url( GFCommon::get_base_url() . "/images/remove.png" ); foreach($fields as $key => $item) { $odd_even = ($rownum % 2) == 0 ? "even" : "odd"; @@ -866,7 +878,7 @@ private static function edit_page(){ } $list .= " - + "; @@ -930,32 +942,32 @@ private static function edit_page(){
- +
/> - +
If these conditions are met:
", "gravity-forms-infusionsoft"); + $list .= '
' . esc_html__("If these conditions are met:", "gravity-forms-infusionsoft") . '
'; $list .= ' '; - $list .= '

'.__("Assign Entry the following tags: ", "gravity-forms-infusionsoft").'

'; + $list .= '

'.esc_html__("Assign Entry the following tags: ", "gravity-forms-infusionsoft").'

'; $list .= self::get_mapped_field_checkbox("[$key]", (!empty($config['meta']['tag_optin_tags'][$key]) ? $config['meta']['tag_optin_tags'][$key] : array()), $tags, 'tag_optin_tags'); # } $list .= ' @@ -895,9 +907,9 @@ private static function edit_page(){ $list .= !empty($tag_selection_fields) ? "style='display:none'" : ""; $list .= '>'; if(empty($id)) { - $list .= __("Please save the Feed to configure conditional tagging. ", "gravity-forms-infusionsoft"); + $list .= esc_html__("Please save the Feed to configure conditional tagging. ", "gravity-forms-infusionsoft"); } - $list .= __("To create an Opt-In condition, your form must have a drop down, checkbox or multiple choice field.", "gravity-forms-infusionsoft"); + $list .= esc_html__("To create an Opt-In condition, your form must have a drop down, checkbox or multiple choice field.", "gravity-forms-infusionsoft"); $list .= ' @@ -905,8 +917,8 @@ private static function edit_page(){ $list .= "
- " . __("Add a condition", "gravity-forms-infusionsoft") . " - " . __("Remove this condition", "gravity-forms-infusionsoft") . " + " . esc_attr__("Add a condition", "gravity-forms-infusionsoft") . " + " . esc_attr__("Remove this condition", "gravity-forms-infusionsoft") . "
@@ -1010,25 +1022,21 @@ function SetOptinCondition() {
- " class="button-primary"/> + " class="button-primary"/>
-
/> - +
>
> - + - - +
> - +