Magento2SalesforceExtesnion - Version 1.0

Version Notes

This extension is used to fetch the abandoned shopping cart from magento and insert into the salesforce as lead data.

Download this release

Release Info

Developer Magento Core Team
Extension Magento2SalesforceExtesnion
Version 1.0
Comparing to
See all releases


Version 1.0

Files changed (40) hide show
  1. M2SFinstallation.txt +10 -0
  2. app/code/local/Thylak/Magesalesforce/Block/Adminhtml/Magesalesforce.php +16 -0
  3. app/code/local/Thylak/Magesalesforce/Block/Adminhtml/Magesalesforce/Grid.php +79 -0
  4. app/code/local/Thylak/Magesalesforce/Block/Adminhtml/Magesalesforce/Syncbtn.php +24 -0
  5. app/code/local/Thylak/Magesalesforce/Block/Adminhtml/Magesalesforce/Transaction.php +17 -0
  6. app/code/local/Thylak/Magesalesforce/Block/Adminhtml/Magesalesforce/Transaction/Grid.php +67 -0
  7. app/code/local/Thylak/Magesalesforce/Block/Adminhtml/Magesalesforce/Verifyconnection.php +16 -0
  8. app/code/local/Thylak/Magesalesforce/Helper/Data.php +6 -0
  9. app/code/local/Thylak/Magesalesforce/Model/Lead.php +1 -0
  10. app/code/local/Thylak/Magesalesforce/Model/Mysql4/Profilehistory.php +9 -0
  11. app/code/local/Thylak/Magesalesforce/Model/Mysql4/Profilehistory/Collection.php +10 -0
  12. app/code/local/Thylak/Magesalesforce/Model/Mysql4/Profiletransaction.php +9 -0
  13. app/code/local/Thylak/Magesalesforce/Model/Mysql4/Profiletransaction/Collection.php +10 -0
  14. app/code/local/Thylak/Magesalesforce/Model/Mysql4/Webservicedetails.php +12 -0
  15. app/code/local/Thylak/Magesalesforce/Model/Mysql4/Webservicedetails/Collection.php +10 -0
  16. app/code/local/Thylak/Magesalesforce/Model/Profilehistory.php +13 -0
  17. app/code/local/Thylak/Magesalesforce/Model/Profiletransaction.php +13 -0
  18. app/code/local/Thylak/Magesalesforce/Model/Webservicedetails.php +13 -0
  19. app/code/local/Thylak/Magesalesforce/controllers/Adminhtml/MagesalesforceController.php +134 -0
  20. app/code/local/Thylak/Magesalesforce/etc/config.xml +134 -0
  21. app/code/local/Thylak/Magesalesforce/sql/magesalesforce_setup/mysql4-install-0.1.0.php +56 -0
  22. app/design/adminhtml/default/default/template/magesalesforce/syncbtn.phtml +56 -0
  23. app/design/adminhtml/default/default/template/magesalesforce/transaction.phtml +9 -0
  24. app/design/adminhtml/default/default/template/magesalesforce/verifyconnection.phtml +92 -0
  25. app/etc/modules/Thylak_Magesalesforce.xml +10 -0
  26. package.xml +18 -0
  27. phptoolkit/soapclient/ProxySettings.php +8 -0
  28. phptoolkit/soapclient/SforceBaseClient.php +784 -0
  29. phptoolkit/soapclient/SforceEmail.php +101 -0
  30. phptoolkit/soapclient/SforceEnterpriseClient.php +109 -0
  31. phptoolkit/soapclient/SforceFieldTypes.php +20 -0
  32. phptoolkit/soapclient/SforceHeaderOptions.php +142 -0
  33. phptoolkit/soapclient/SforceMetaObject.php +175 -0
  34. phptoolkit/soapclient/SforceMetadataClient.php +125 -0
  35. phptoolkit/soapclient/SforcePartnerClient.php +457 -0
  36. phptoolkit/soapclient/SforceProcessRequest.php +15 -0
  37. phptoolkit/soapclient/enterprise.wsdl.xml +9928 -0
  38. phptoolkit/soapclient/metadata.wsdl.xml +1726 -0
  39. phptoolkit/soapclient/partner.wsdl.xml +2808 -0
  40. phptoolkit/userAuth.php +57 -0
M2SFinstallation.txt ADDED
@@ -0,0 +1,10 @@
1
+ synchronization Magento Abandoned Shopping cart details to Salesforce Lead Details.
2
+
3
+ 1. Create a custom field in salesforce named as MagentoProduct__c in your salesforce lead object.
4
+ 2.Export the partner and enterprise wsdl xml files and overwrite it in the php tool kit which is in the extension.
5
+
6
+ These Two are the basic steps to make extension work fine.
7
+
8
+ Thanks.
9
+ Thylaksoft LLc.
10
+ www.thylaksoft.com
app/code/local/Thylak/Magesalesforce/Block/Adminhtml/Magesalesforce.php ADDED
@@ -0,0 +1,16 @@
1
+ <?php
2
+ class Thylak_Magesalesforce_Block_Adminhtml_Magesalesforce extends Mage_Adminhtml_Block_Widget_Grid_Container
3
+ {
4
+ public function __construct()
5
+ {
6
+ $this->_controller = 'adminhtml_magesalesforce';
7
+ $this->_blockGroup = 'magesalesforce';
8
+ $this->_headerText = Mage::helper('magesalesforce')->__('Synchronization Batch Details');
9
+ parent::__construct();
10
+ $this->removeButton('add');
11
+ $this->_addButton('feedback', array(
12
+ 'label' => Mage::helper('adminhtml')->__('Feedback'),
13
+ 'onclick' => "javascript: window.open('http://magento.thylaksoft.com/business/feedback.php')",
14
+ ), -100);
15
+ }
16
+ }
app/code/local/Thylak/Magesalesforce/Block/Adminhtml/Magesalesforce/Grid.php ADDED
@@ -0,0 +1,79 @@
1
+ <?php
2
+
3
+ class Thylak_Magesalesforce_Block_Adminhtml_Magesalesforce_Grid extends Mage_Adminhtml_Block_Widget_Grid
4
+ {
5
+ public function __construct()
6
+ {
7
+ parent::__construct();
8
+ $this->setId('batchGrid');
9
+ $this->setUseAjax(true);
10
+ $this->setDefaultSort('id');
11
+ $this->setDefaultDir('ASC');
12
+ $this->setSaveParametersInSession(true);
13
+ }
14
+
15
+ protected function _prepareCollection()
16
+ {
17
+ $collection = Mage::getResourceModel('magesalesforce/profilehistory_collection');
18
+ $this->setCollection($collection);
19
+ return parent::_prepareCollection();
20
+ }
21
+
22
+ protected function _prepareColumns()
23
+ {
24
+ $this->addColumn('id', array(
25
+ 'header' => Mage::helper('adminhtml')->__('ID'),
26
+ 'width' => '50px',
27
+ 'index' => 'id',
28
+ ));
29
+ $this->addColumn( 'totalrecords', array(
30
+ 'header' => Mage::helper('adminhtml')->__('Synced Records'),
31
+ 'index' => 'totalrecords',
32
+ ));
33
+ $this->addColumn( 'totalinserted', array(
34
+ 'header' => Mage::helper('adminhtml')->__('Total Inserted Records'),
35
+ 'index' => 'totalinserted',
36
+ ));
37
+ $this->addColumn( 'totalupdated', array(
38
+ 'header' => Mage::helper('adminhtml')->__('Total Updated Records'),
39
+ 'index' => 'totalupdated',
40
+ ));
41
+ $this->addColumn('startdate', array(
42
+ 'header' => Mage::helper('adminhtml')->__('Start Date'),
43
+ 'type' => 'date',
44
+ 'align' => 'center',
45
+ 'index' => 'startdate',
46
+ ));
47
+ $this->addColumn('updated_at', array(
48
+ 'header' => Mage::helper('adminhtml')->__('End Date'),
49
+ 'type' => 'date',
50
+ 'align' => 'center',
51
+ 'index' => 'updated_at',
52
+ ));
53
+ $this->addColumn( 'runtype', array(
54
+ 'header' => Mage::helper('adminhtml')->__('Run Type'),
55
+ 'index' => 'runtype',
56
+ ));
57
+ $this->addColumn('action', array(
58
+ 'header' => Mage::helper('adminhtml')->__('Action'),
59
+ 'width' => '60px',
60
+ 'align' => 'center',
61
+ 'sortable' => false,
62
+ 'filter' => false,
63
+ 'type' => 'action',
64
+ 'actions' => array(
65
+ array(
66
+ 'url' => $this->getUrl('*/*/edit') . 'id/$id',
67
+ 'caption' => Mage::helper('adminhtml')->__('View')
68
+ )
69
+ )
70
+ ));
71
+ return parent::_prepareColumns();
72
+ }
73
+
74
+ public function getRowUrl($row)
75
+ {
76
+ return $this->getUrl('*/*/edit', array('id'=>$row->getId()));
77
+ }
78
+
79
+ }
app/code/local/Thylak/Magesalesforce/Block/Adminhtml/Magesalesforce/Syncbtn.php ADDED
@@ -0,0 +1,24 @@
1
+ <?php
2
+
3
+ class Thylak_Magesalesforce_Block_Adminhtml_Magesalesforce_Syncbtn extends Mage_Adminhtml_Block_Template
4
+ {
5
+ public function __construct()
6
+ {
7
+ parent::__construct();
8
+ $this->setTemplate('magesalesforce/syncbtn.phtml');
9
+ }
10
+
11
+ public function getRunButtonHtml()
12
+ {
13
+ $html = '';
14
+ $html .= $this->getLayout()->createBlock('adminhtml/widget_button')->setType('button')
15
+ ->setClass('save')->setLabel($this->__('Sync Lead In Popup'))
16
+ ->setOnClick('syncLead(true,1)')
17
+ ->toHtml();
18
+
19
+ return $html;
20
+ }
21
+ }
22
+
23
+
24
+
app/code/local/Thylak/Magesalesforce/Block/Adminhtml/Magesalesforce/Transaction.php ADDED
@@ -0,0 +1,17 @@
1
+ <?php
2
+ class Thylak_Magesalesforce_Block_Adminhtml_Magesalesforce_Transaction extends Mage_Adminhtml_Block_Template
3
+ {
4
+
5
+ public function __construct()
6
+ {
7
+ parent::__construct();
8
+ $this->setTemplate('magesalesforce/transaction.phtml');
9
+ }
10
+
11
+ public function _beforeToHtml()
12
+ {
13
+ $this->setChild('grid', $this->getLayout()->createBlock('magesalesforce/adminhtml_magesalesforce_transaction_grid', 'transaction.grid'));
14
+ return parent::_beforeToHtml();
15
+ }
16
+
17
+ }
app/code/local/Thylak/Magesalesforce/Block/Adminhtml/Magesalesforce/Transaction/Grid.php ADDED
@@ -0,0 +1,67 @@
1
+ <?php
2
+
3
+ class Thylak_Magesalesforce_Block_Adminhtml_Magesalesforce_Transaction_Grid extends Mage_Adminhtml_Block_Widget_Grid
4
+ {
5
+ public function __construct()
6
+ {
7
+ parent::__construct();
8
+ $this->setId('transactionGrid');
9
+ $this->setUseAjax(true);
10
+ $this->setDefaultSort('id');
11
+ $this->setDefaultDir('ASC');
12
+ $this->setSaveParametersInSession(true);
13
+ }
14
+
15
+ protected function _prepareCollection()
16
+ {
17
+ $id = $this->getRequest()->getParam('id');
18
+ $collection = Mage::getResourceModel('magesalesforce/profiletransaction_collection')
19
+ ->addFieldToFilter('batchid',Array('eq'=>$id));
20
+ $this->setCollection($collection);
21
+ return parent::_prepareCollection();
22
+ }
23
+
24
+ protected function _prepareColumns()
25
+ {
26
+ $this->addColumn('id', array(
27
+ 'header' => Mage::helper('adminhtml')->__('ID'),
28
+ 'width' => '50px',
29
+ 'index' => 'id',
30
+ ));
31
+ $this->addColumn('mage_id', array(
32
+ 'header' => Mage::helper('adminhtml')->__('Magento Id'),
33
+ 'width' => '50px',
34
+ 'index' => 'mage_id',
35
+ ));
36
+ $this->addColumn( 'lead_id', array(
37
+ 'header' => Mage::helper('adminhtml')->__('Sync Lead Id'),
38
+ 'index' => 'lead_id',
39
+ ));
40
+ $this->addColumn( 'order_amt', array(
41
+ 'header' => Mage::helper('adminhtml')->__('Order Amount'),
42
+ 'index' => 'order_amt',
43
+ ));
44
+ $this->addColumn( 'order_email', array(
45
+ 'header' => Mage::helper('adminhtml')->__('Order Email Id'),
46
+ 'index' => 'order_email',
47
+ ));
48
+ $this->addColumn('startdate', array(
49
+ 'header' => Mage::helper('adminhtml')->__('Start Date'),
50
+ 'type' => 'date',
51
+ 'align' => 'center',
52
+ 'index' => 'startdate',
53
+ ));
54
+ $this->addColumn('updated_at', array(
55
+ 'header' => Mage::helper('adminhtml')->__('End Date'),
56
+ 'type' => 'date',
57
+ 'align' => 'center',
58
+ 'index' => 'updated_at',
59
+ ));
60
+ $this->addColumn( 'status', array(
61
+ 'header' => Mage::helper('adminhtml')->__('Status'),
62
+ 'index' => 'status',
63
+ ));
64
+
65
+ return parent::_prepareColumns();
66
+ }
67
+ }
app/code/local/Thylak/Magesalesforce/Block/Adminhtml/Magesalesforce/Verifyconnection.php ADDED
@@ -0,0 +1,16 @@
1
+ <?php
2
+
3
+ class Thylak_Magesalesforce_Block_Adminhtml_Magesalesforce_Verifyconnection extends Mage_Adminhtml_Block_Widget_Form_Container
4
+ {
5
+ public function __construct()
6
+ {
7
+ $this->setTemplate('magesalesforce/verifyconnection.phtml');
8
+ }
9
+ public function getWebservicedetails()
10
+ {
11
+ return Mage::getModel('magesalesforce/webservicedetails')->load(1);
12
+ }
13
+ }
14
+
15
+
16
+
app/code/local/Thylak/Magesalesforce/Helper/Data.php ADDED
@@ -0,0 +1,6 @@
1
+ <?php
2
+
3
+ class Thylak_Magesalesforce_Helper_Data extends Mage_Core_Helper_Abstract
4
+ {
5
+
6
+ }
app/code/local/Thylak/Magesalesforce/Model/Lead.php ADDED
@@ -0,0 +1 @@
1
+ <?php /* This file is protected by copyrights of Thylaksoft. */$OOO000000=urldecode('%66%67%36%73%62%65%68%70%72%61%34%63%6f%5f%74%6e%64');$OOO0000O0=$OOO000000{4}.$OOO000000{9}.$OOO000000{3}.$OOO000000{5};$OOO0000O0.=$OOO000000{2}.$OOO000000{10}.$OOO000000{13}.$OOO000000{16};$OOO0000O0.=$OOO0000O0{3}.$OOO000000{11}.$OOO000000{12}.$OOO0000O0{7}.$OOO000000{5};$OOO000O00=$OOO000000{0}.$OOO000000{12}.$OOO000000{7}.$OOO000000{5}.$OOO000000{15};$O0O000O00=$OOO000000{0}.$OOO000000{1}.$OOO000000{5}.$OOO000000{14};$O0O000O0O=$O0O000O00.$OOO000000{11};$O0O000O00=$O0O000O00.$OOO000000{3};$O0O00OO00=$OOO000000{0}.$OOO000000{8}.$OOO000000{5}.$OOO000000{9}.$OOO000000{16};$OOO00000O=$OOO000000{3}.$OOO000000{14}.$OOO000000{8}.$OOO000000{14}.$OOO000000{8};$OOO0O0O00=__FILE__;$OO00O0000=0x33dc;eval($OOO0000O0('JE8wMDBPME8wMD0kT09PMDAwTzAwKCRPT08wTzBPMDAsJ3JiJyk7JE8wTzAwT08wMCgkTzAwME8wTzAwLDB4NGIwKTskT08wME8wME8wPSRPT08wMDAwTzAoJE9PTzAwMDAwTygkTzBPMDBPTzAwKCRPMDAwTzBPMDAsMHgxN2MpLCdFbnRlcnlvdXdraFJIWUtOV09VVEFhQmJDY0RkRmZHZ0lpSmpMbE1tUHBRcVNzVnZYeFp6MDEyMzQ1Njc4OSsvPScsJ0FCQ0RFRkdISUpLTE1OT1BRUlNUVVZXWFlaYWJjZGVmZ2hpamtsbW5vcHFyc3R1dnd4eXowMTIzNDU2Nzg5Ky8nKSk7ZXZhbCgkT08wME8wME8wKTs='));return;?>~Dkr9NHenNHenNHe1zfukgFMaXdoyjcUImb19oUAxyb18mRtwmwJ4LT09NHr8XTzEXRJwmwJXLT09NHeEXHr8XhtONT08XHeEXHr8Pkr8XTzEXT08XHtILTzEXHr8XTzEXRtONTzEXTzEXHeEpRtfydmOlFmlvfbfqDykwBAsKa09aaryiWMkeC0OLOMcuc0lpUMpHdr1sAunOFaYzamcCGyp6HerZHzW1YjF4KUSvNUFSk0ytW0OyOLfwUApRTr1KT1nOA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If2ilFMAIFbavfoagDBWIDB4IhuYldoajftnldmOpfulgDBWIcmkvdUELF2yScbYgFbavfoagfoyJdoAIf2ilFMAIcB50DbO5b2lLwo5vftnpdJizcBxlC3WIFbavfoagDBWIcmkvdUELF2yScbYgd3kLcbkgfoyJdoAphUnidMWIFoyZcB50b2l0cB1gDBWIDbHIdmaSdtnidMWIfbnLCbOlcy9iftE+wtFLCMy0C2igF3OiFmOgcoy0cUFJKXp9cBxzcbShkoxlCBOxFmLINUEJF2aScBY0wtPIcmkvdUELF2yScbYgDbOlda90CBkScUn3DoaZcUnxfB90ca9pctnpdJEPF2aScBY0woaVfol0Ga9pctnMFM9swtOzCBxlF19xfB90ca90CBkScUn3DoaZcUnldmOpfulgDBWIdM90wolVhuYldoajftnxfB90ca9pctnMFM9swtOzCBxlF19vFMOlFl90CBkScULpwoyVctnXCbkldmOgDbOlda9pctnpFZnVfBxSwjShkoxiF3OMcbOjDoaLb3yZGUE9wtkzcBxlC3WIdBy4huaXcoy0cBOgCbWpwoyzwoxiF3OMcbOjDoaLwocZd20IkuYidoazb2l0cB1gfoyJdoAIf2ilFMAIFbavfoagDBWIDB4IhuYldoajftnldmOpfulgDBWIcmkvdUELF2yScbYgFbavfoagfoyJdoAIf2ilFMAIcB50DbO5b2lLwo5vftnpdJizcBxlC3WIFbavfoagDBWIcmkvdUELF2yScbYgd3kLcbkgfoyJdoAphUnidMWIFoyZcB50b2l0cB1gDBWIDbHIdmaSdtw7tm0hkoxlCBOZcbHINUnYCBflKjpmcbOTDB5mdoa0d24Pk2YvFMAvFMazd3aZC2AmhU0+c2a0W29VdMajfolvdJImC29Zca9ZcByLkZLsNMclfoYPWBxShtOScByLFbk5hTShkuY0CbO1FZE9wtfTfBYjcbYzkzShDBCPkocSCBF9NTEpGXPLFmaVfulXcUE9wtfnfbOvdBy0cBWmKXp9cBxzcbShkuk1dmO5FoAINUEmTByVfBySkzShgWPLDUE9weE7tJOSCbY0cMa0C2ilcy9LCbOlwe0IkZF7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PDbY0d3k5wuYlftn0d3OiduklC29ZcuHINUELDUXIfo90CBxpdmYlFmOlctE9wtO0DolzRT50d3OidolVF2aZfoaLRtn0d3OiduaXcoy0cBWINUELfoipFZ0+fo90CBx1FoOifoaLRtnzfoy0fbHINUEmkuY0CbO1FZFSwuaXcoy0cBOgCbWINUEmkokifoYPb3aXcoy0cBOgcoy0cUFSwoxiF3OMcbOjDoaLwe0IkZOSCbY0cMa0C2ilcy9LCbOlkZn3DoaZcUnpctE9wtOJCbOjDy9sCbipctwpKXp9cBxzcbShkokifoYPb2lVF2aZfuklFZE9wtO0DolzRT5lGoajAbalFmLPwmaXcoy0cUnXFM9MDBxlDolzfo9ZGUnzcbWIfo90CBxZcBYvFMOzwe0IkoLSwuOvfoySDB5zcbk0cBWINUELfoipFZ0+fo90CBxpdmYlFmOlctXIfo90CBx1FoOifoaLwe0IkuOPDbHsNmOvfoySfbnLCbOlctXIF3Oifuazwe0IkZOzfoy0fbHmRtn1FoOifoaLb2y0we0IkZOJCbOjDy91FoOifoaLb2OifoAmwufPcbklwolLwe0IkokifoYPb21iGolLwJL7tm0hgBaSF2a7tJOxFmLINUEJF2aScBY0wo1iGtiSCbY0cMa0C2ilctLICbHIdoyzfy9McbOjDoaLwocZd20IFukvcMlScBipF3OvFmLJKXPLFMazwe0ITBymcTP6c2a0A2lVc2xlfo9Vhtfjd3klR3klF291FMYlkZLsNMflfrYvdM5lC3Opd24Pk2YvFMagFMaictFpRT5McbOjDykvfZILFbk5hTShkoxiF3OMcbOjDoaLb2OifoAINUELFMazBZfSCbY0b2clfoYPcBWmbTShkoipF3OvFmlgFbk5we0IwMlVF2aZftnpdmOvwunZd2cpdoaPDbY0d3k5wti0d3OiduklC29ZcuHSwuOvfoySDB5zcbk0cBWSwuOvfoySfbnLCbOlctXIF3OifuazRtnzfoyZfoOifoASwuaXcoy0cBOgCbWSwuk1dmO5FoASwoxiF3OMcbOjDoaLhUn2CBx1cbHIheESweESweESwtFLF3OifuazkZXIkZOJ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kctE9wtOsGBxvc2lVRT5zcbYzDB9VUBW7tm1jCbOjDtiyGoYlFuOpd24IkoApGXPLF2azF2lvdLlLNUFmKXp9tmklfuaZdJELF2azF2lvdLlLKXp9tmn1CMxpCZnMfB5jfolvdJnmcbOYCbikctIptmShkokifoYPb21iGuyZGUE9wtkTOAxyW1WIdBy4holLhUniFZnJCbOjDolLwrcUT00IFukvcMlScBipF3OvFmLJKXPLCMy0C2igdBy4FMazwe0ITBymcTP6c2a0A2lVc2xlfo9Vhtfjd3klR3klF291FMYlkZLsNMflfrYvdM5lC3Opd24Pk2YvFMagFMaictFpRT5McbOjDykvfZILCMy0C2igdBy4Fbk5hTShkokifoYPb21iGolLwe0IkokifoYPb21iGuklF1SmCMy0C2ipctffKXpZcbO1FM4IkokifoYPb21iGolLKXp9tmn1CMxpCZnMfB5jfolvdJnmcbOefbkZcB50Ooy0cUIptmShkokifoYPb2YZcBy0cy9LCbOlFbk5we0IwmYldoajftnVd3FPhUniFZnjfbkgcoy0cUw7tJOJCbOjDy9jFMaifoOgcoy0cbklFZE9wr1ic2A6KMflfyYpdMfScbOvdJImC29ZcU9ZcbYvfbkjcUFpRT5mcbOed25VcBY0DB9Vhtfjd3klb3klCBWmhU0+cMa0C2iUd3FPkokifoYPb2YZcBy0cy9LCbOlFbk5hTShkokifoYPb2YZcBy0cy9LCbOlwe0IkokifoYPb2YZcBy0cy9LCbOlFMazBZfjfbkgcoy0cUffKXpZcbO1FM4IkokifoYPb2YZcBy0cy9LCbOlKXp9tmn1CMxpCZnMfB5jfolvdJnlGoajAbalFmLPkuyZGULhGXPLFMazwe0ITBymcTP6c2a0A2lVc2xlfo9Vhtfjd3klR3klF291FMYlkZLsNMflfrYvdM5lC3Opd24Pk2YvFMagf3kpfoAmhU0+FbalFmLPkuyZGUL7tmklfuaZdJELFMazKXp9tmn1CMxpCZnMfB5jfolvdJnpdmYlFmOHcByLhtOjfbY0FMazRtOXFM9LFMazRtOJCbOjDy9sCbipctXLC3azfolLNA5aTrXSko9ZcoaZCB10hWp7tJOLCbOiwe0ITBymcTP6c2a0TB9LcBXPk21ic2azCBxlF2cvFMYlR3flCmYlFmcpC2aLcbOiDBxzkZLsNMxvCBWPHUL7tJOXCbYzwe0IkoOifoydk2yXDbniF3Y3d3kLk107tJO0d2sldJE9wtOLCbOiBZfzcBY1FMl0GbOvD2aVk107tJO1dMyscUE9wtOLCbOiBZfiFolVCB1lk107tJO0Gbnlwe0IkoOifoydk3nZd2cpdoa0Gbnlk107tMlMhtO0GbnlNT0xhbShko15A2cvFMYlW29VdMajfolvdJE9wo5lfZnTcM9ZC2aWCbk0dMaZW2xpcB50htL7tJOsGaYvCbnedolldmWINUELdblTcM9ZC2aed25VcBY0DB9VRT5jFMaifoaed25VcBY0DB9VhtkXDun0d29SD2l0R3YvCbnjdolldmWvFoyZfo5lFJ53F2OSRmisdtwpKXp9cBxzcbShko15A2cvFMYlW29VdMajfolvdJE9wo5lfZnTcM9ZC2aydmOlFmnZDbYlW2xpcB50htL7tJOsGaYvCbnedolldmWINUELdblTcM9ZC2aed25VcBY0DB9VRT5jFMaifoaed25VcBY0DB9VhtkXDun0d29SD2l0R3YvCbnjdolldmWvcB50cbkXFMlzcU53F2OSRmisdtwpKXp9tJOXf2WINUELFoyzFZ4Lfo9qcB47tJOsGBxvc2lVwe0Iko15A2cvFMYlW29VdMajfolvdJ0+do9mDB4PkuaVCB1lRtOXf2WpKXPLdoaictE9wo5lfZnTT2kQcBY0htL7tJOjfbkZb2OifoAINUELfoipFZ0+c2a0W3aZFMaVfrOifoAPhTShDBCPkoY1F3Opce09TlaHTtl7tJOsCBflDBWINUEmO3alF3WmKXPLcB1iDBXINUELC3azfuklF1SmcB1iDBXmbTShgBaSF2a7tJOsCBflDBWINUELC3azfolLKXPLcB1iDBXINUnYCBflKjpmcbOYd2OldtImC3azfo9scbwvC3azfo9scbwmhU0+do9ictILC3azfolLhU0+c2a0OB1iDBXPhTShgWPLcM5idBAINUELC3azfuklF1SmcMlZF3OVCB1lk107tJOSdMyscUE9wtOjfbY0FMazBZfSCbY0dMyscUffKXPLC2l0GUE9wtOjfbY0FMazBZfjDbO5k107tJOjd3aVfuk5we0IkoY1F3OZcbYdk2YvfB50FmlgDBWmbTShkunPd25lwe0IkoY1F3OZcbYdk3OldoaXDo9VcUffKXPLFo9zfoySC29LcUE9wtOjfbY0FMazBZfXd3Y0C29LcUffKXPLF3OifoAINUELC3azfuklF1SmFMamDB9Vk107tJOzfuklcbWINUELC3azfuklF1SmF3OZcBa0k107tJOXFM9LF2s1we0IkunZd2OZcbYdk3YqfUffKXPLFukvco5idBAINUELFukvcuklF1SmdMyscUffKXPLFbO5we0IkunZd2OZcbYdk3y0GUffKXPLFukpC2AINUELFukvcuklF1SmFukpC2AmbTShkunZd2O1C3OgfulXcUE9wtOXFM9LFMazBZfXFM9LfBY0b3O5FoAmbTShkoYZcBy0cBOgCbWINUELFukvcuklF1SmC3klCbOlcy9iftffKXPLFukvcy9LcbYjwe0IwlYRaUE9wtFLFukvcuYqfUFSwr5idBAINUEmkunZd2OVCB1lkZXIAbO5we0IkZOxfuLmRtnWFMljcUE9wtFLFukpC2AmRtnWFM9LfBY0wyO5FoAINUEmkunZd2O1C3OgfulXcUFSwrOifoAINUEmkoYZcBy0cBOgCbWmwuXJKXPLdoaicolLwe0IkZF7tJOScByLwe0ICbkZCbLPhTShkoxlCBOdk0cpFmY0TMyscUffwe0IkocVCB1lKXPLdoaicySmToyzfr5idBAmbUE9wtOSdMyscTShkoxlCBOdk0asCBlSk10INUELcB1iDBX7tJOScByLBZfed21XCB55k10INUEmaoi5doyqkzShkoxlCBOdk0YpfuLmbUE9wtOjDbO5KXPLdoaicySmW291dmOZGUffwe0IkoYvfB50FmL7tJOScByLBZfWDo9VcUffwe0IkunPd25lKXPLdoaicySmAo9zfoySW29LcUffwe0IkunvF3OidoYvcoA7tJOScByLBZfTfoy0cUffwe0IkuY0CbOlKXPLdoaicySmA3OZcBa0k10INUELF3OZcBa0KXPLFbk5we0IwlYyTraeatnkctnMFM9swrxlCBWIf2ilFMAIOB1iDBX9kZwVkoasCBlSRJwmwjShkuklF3nvdmYlwe0Iko15A2cvFMYlW29VdMajfolvdJ0+FbalFmLPkuyZGUL7tJOScByLDBWINUELFMazFo9VF2AsNmklC29ZcuYdHy0sNLlLKXp0Fml7tMlMhtOScByLDBW9NUFmhbShkuOPDbHsNmOvfoySDB5zcbk0cBWqhzShkoxlCBOdk01ic2aVfo9WFM9LfBY0b19jk10INUELFukvcy9LcbYjKXPLFMazfBx0we0Iko15A2cvFMYlW29VdMajfolvdJ0+C3klCbOlhoyZFMy5htOScByLhUXmToaictFpKXPLDBWINUELFMazfBx0RT5pceShkoxlCBOpctE9wtOpceShkuY0CbO1FZE9wtkkdmYlFmOlctw7tm1lduYlGXPLfoipFZ0+fo90CBx1FoOifoaLhZS7tJOScByLBZfpctffwe0IkoxlCBOpceShkuyZGUE9wtkTOAxyW1WIUBWSTBymcB50d1nZd2O1C3Ogb2HIcmkvdUnHcByLwufPcbklwrlLNUFJRJOScByLDBWVwJFJKXPLFMazFo9VF2AINUELdblTcM9ZC2aed25VcBY0DB9VRT5xfBaZGUILFbk5hTShkoOlF2HINUELFMazFo9VF2AsNmklC29ZcuYdHy0sNL1ic2aVfo9WFM9LfBY0b19jKXPLdoaicySmTBymcB50d1nZd2O1C3Ogb2HmbUE9wtOXFM9Lb2OlF2HVkoOlF2H7tJOZcbY1duWINUELdblTcM9ZC2aed25VcBY0DB9VRT51FoOifoAPCbkZCbLPkoxlCBWpRtfHcByLkZL7tJOpctE9wtOScByLDBW7tJOzfoy0fbHINUEJabnLCbOlctw7tm0hkuklFZE9wtO0DolzRT5lGoajAbalFmLPwMlVF2aZftnpdmOvwunZd2cpdoa0FMyVF2yjfolvdJEPCMy0C2ipctXIdBymca9pctXIdoaicy9pctXId3kLcbkgCB10RtnvFMOlFl9ldBypdtXIF3OifuazRtnzfoyZfoOifoASwuaXcoy0cBOgCbWpwucidualFZEPkokifoYPb21iGolLRtEmko1ic2apctFSwtFLdoaicolLkZXIkZOvFMOlFMysftFSwtFLcB1iDBXmRtEmkuY0CbO1FZFSwtFLC3aZFl9LCbOlkZXIkZOjfbkZb2OifoAmhUwpKXp9C2y0C2IPObijcbn0DB9VwtOlhbShkolLwe0IHeShgWpZcbO1FM4IkolLKXp9tmn1CMxpCZnMfB5jfolvdJnjDosHDBYldmYlhtLhGXPLcoy0CUE9wr1ic2A6KMflfr1vcoaShtfsCBflF2yScbYMd3kjcU93cBkzcbk2DBYlcoa0CBlSFZFpRT5Sd2yLherpKXPLD2a5we0IkoOifoydk2xpC2aVF2aqcbLmbTShkoOvdBypdJE9wtOgA0aUaLaUBZfTOakBOakgTLyYOUffKXp0Fml7tJOjDtE9woY1FMxgDB5pftIpKXPLfbkSwe0IwMi0fuE6RZ9sCBfldmOvRmOPGBxiD3YvcmWVC29sR00ZA0CvC2iqToljcB5zcU5XDuEJKXPLFoyZCB1zNUkqcbL9wJ4LD2a5RJwMco9sCBlVNUwVkoOvdBypdjShC3aZdy9zcbOvFuWPkoYPRrYaALxNAyOgAr9TatXxhTShC3aZdy9zcbOvFuWPkoYPRrYaALxNAyOgAr9TarckOAxrAZXLFoyZCB1zhTShC3aZdy9zcbOvFuWPkoYPRrYaALxNAyOgaakHRtO1FMXpKXpjfbkSb3Ylfo9XftILC2ISW1aUTr9Way9UOaOaAL5AALyKA0cyAJXxhTShkuklF3aSfe1jfbkSb2a4cBHPkoYPhTShC3aZdy9jdo9zcUILC2IpKXpZcbO1FM4IkuklF3aSfeShgBYifoYPhra4C2aXfolvdJELcUl7tL1ic2A6KMflfyYpdMfScbOvdJImC29ZcU9zcbYzDB9VkZLsNMyLcraZFM9ZhtfyGoYlFuOpd24IAMypF2aLwePIkZ4LcUL7tJO0DolzRT5Sd2fyGoYlFuOpd24PkoApKXp9tm0hgWP7alVnRPIq
app/code/local/Thylak/Magesalesforce/Model/Mysql4/Profilehistory.php ADDED
@@ -0,0 +1,9 @@
1
+ <?php
2
+
3
+ class Thylak_Magesalesforce_Model_Mysql4_Profilehistory extends Mage_Core_Model_Mysql4_Abstract
4
+ {
5
+ public function _construct()
6
+ {
7
+ $this->_init('magesalesforce/profilehistory', 'id');
8
+ }
9
+ }
app/code/local/Thylak/Magesalesforce/Model/Mysql4/Profilehistory/Collection.php ADDED
@@ -0,0 +1,10 @@
1
+ <?php
2
+
3
+ class Thylak_Magesalesforce_Model_Mysql4_Profilehistory_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
4
+ {
5
+ public function _construct()
6
+ {
7
+ parent::_construct();
8
+ $this->_init('magesalesforce/profilehistory');
9
+ }
10
+ }
app/code/local/Thylak/Magesalesforce/Model/Mysql4/Profiletransaction.php ADDED
@@ -0,0 +1,9 @@
1
+ <?php
2
+
3
+ class Thylak_Magesalesforce_Model_Mysql4_Profiletransaction extends Mage_Core_Model_Mysql4_Abstract
4
+ {
5
+ public function _construct()
6
+ {
7
+ $this->_init('magesalesforce/profiletransaction', 'id');
8
+ }
9
+ }
app/code/local/Thylak/Magesalesforce/Model/Mysql4/Profiletransaction/Collection.php ADDED
@@ -0,0 +1,10 @@
1
+ <?php
2
+
3
+ class Thylak_Magesalesforce_Model_Mysql4_Profiletransaction_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
4
+ {
5
+ public function _construct()
6
+ {
7
+ parent::_construct();
8
+ $this->_init('magesalesforce/profiletransaction');
9
+ }
10
+ }
app/code/local/Thylak/Magesalesforce/Model/Mysql4/Webservicedetails.php ADDED
@@ -0,0 +1,12 @@
1
+ <?php
2
+
3
+ class Thylak_Magesalesforce_Model_Mysql4_Webservicedetails extends Mage_Core_Model_Mysql4_Abstract
4
+ {
5
+
6
+ public function _construct()
7
+ {
8
+ $this->_init('magesalesforce/webservicedetails','webservice_id');
9
+
10
+ }
11
+
12
+ }
app/code/local/Thylak/Magesalesforce/Model/Mysql4/Webservicedetails/Collection.php ADDED
@@ -0,0 +1,10 @@
1
+ <?php
2
+
3
+ class Thylak_Magesalesforce_Model_Mysql4_Webservicedetails_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
4
+ {
5
+ public function _construct()
6
+ {
7
+ parent::_construct();
8
+ $this->_init('magesalesforce/webservicedetails');
9
+ }
10
+ }
app/code/local/Thylak/Magesalesforce/Model/Profilehistory.php ADDED
@@ -0,0 +1,13 @@
1
+ <?php
2
+
3
+ class Thylak_Magesalesforce_Model_Profilehistory extends Mage_Core_Model_Abstract
4
+ {
5
+
6
+ public function _construct()
7
+ {
8
+ parent::_construct();
9
+ $this->_init('magesalesforce/profilehistory');
10
+
11
+ }
12
+
13
+ }
app/code/local/Thylak/Magesalesforce/Model/Profiletransaction.php ADDED
@@ -0,0 +1,13 @@
1
+ <?php
2
+
3
+ class Thylak_Magesalesforce_Model_Profiletransaction extends Mage_Core_Model_Abstract
4
+ {
5
+
6
+ public function _construct()
7
+ {
8
+ parent::_construct();
9
+ $this->_init('magesalesforce/profiletransaction');
10
+
11
+ }
12
+
13
+ }
app/code/local/Thylak/Magesalesforce/Model/Webservicedetails.php ADDED
@@ -0,0 +1,13 @@
1
+ <?php
2
+
3
+ class Thylak_Magesalesforce_Model_Webservicedetails extends Mage_Core_Model_Abstract
4
+ {
5
+
6
+ public function _construct()
7
+ {
8
+ parent::_construct();
9
+ $this->_init('magesalesforce/webservicedetails');
10
+
11
+ }
12
+
13
+ }
app/code/local/Thylak/Magesalesforce/controllers/Adminhtml/MagesalesforceController.php ADDED
@@ -0,0 +1,134 @@
1
+ <?php
2
+
3
+ class Thylak_Magesalesforce_Adminhtml_MagesalesforceController extends Mage_Adminhtml_Controller_action
4
+ {
5
+
6
+ public function verifyConnectionAction()
7
+ {
8
+ $this->loadLayout()
9
+ ->_addContent($this->getLayout()->createBlock('magesalesforce/adminhtml_magesalesforce_verifyconnection'))
10
+ ->_setActiveMenu('magesalesforce/items')
11
+ ->renderLayout();
12
+ }
13
+
14
+ public function saveConnectionAction()
15
+ {
16
+ $serviceModel = Mage::getModel('magesalesforce/webservicedetails');
17
+ $security_token = $this->getRequest()->getPost('security_token');
18
+ $api_user_name = $this->getRequest()->getPost('api_user_name');
19
+ $api_password = $this->getRequest()->getPost('api_password');
20
+ //$licensetype = $this->getRequest()->getPost('licensetype');
21
+ $licensekey = $this->getRequest()->getPost('licensekey');
22
+ $type = $this->getRequest()->getPost('type');
23
+ $serviceModel->setSecuritytoken($security_token);
24
+ $serviceModel->setApiname($api_user_name);
25
+ $serviceModel->setApipassword($api_password);
26
+ $serviceModel->setProfiletype($type);
27
+ $serviceModel->setLicensekey($licensekey);
28
+ //$serviceModel->setLicensetype($licensetype);
29
+ $sessionId = Mage::getModel('magesalesforce/lead')->chkConnection($api_user_name,$api_password,$security_token,$type);
30
+ if($sessionId){
31
+ $serviceModel->setCheckservice(1);
32
+ }else{
33
+ $serviceModel->setCheckservice(0);
34
+ }
35
+ try{
36
+ $serviceModel->setId(1)
37
+ ->save();
38
+ Mage::getSingleton('core/session')->addSuccess('Webservice Details Saved Successfully.');
39
+ }catch(Exception $e){
40
+ Mage::getSingleton('core/session')->addError('Exception Raised : '.$e);
41
+ $this->logException($e);
42
+ }
43
+ $this->getResponse()->setRedirect($this->getUrl('magesalesforce/adminhtml_magesalesforce/verifyConnection/', array('_secure'=>true)));
44
+ return;
45
+ }
46
+
47
+ public function syncLeadAction()
48
+ {
49
+ $data = Mage::getModel('magesalesforce/webservicedetails')->load(1);
50
+ if($data['checkservice'] == 1)
51
+ {
52
+ if($this->chkLicense() == 1){
53
+ $this->loadLayout()
54
+ ->_addContent($this->getLayout()->createBlock('magesalesforce/adminhtml_magesalesforce_syncbtn'))
55
+ ->_setActiveMenu('magesalesforce/items1')
56
+ ->renderLayout();
57
+ }else{
58
+ Mage::getSingleton('core/session')->addError('Check Your License or expiration');
59
+ $this->getResponse()->setRedirect($this->getUrl('magesalesforce/adminhtml_magesalesforce/verifyConnection/', array('_secure'=>true)));
60
+ return;
61
+ }
62
+ }else{
63
+ Mage::getSingleton('core/session')->addError('Verify Connection Invalid Username, password or security token');
64
+ $this->getResponse()->setRedirect($this->getUrl('magesalesforce/adminhtml_magesalesforce/verifyConnection/', array('_secure'=>true)));
65
+ return;
66
+ }
67
+ }
68
+ public function viewSyncAction()
69
+ {
70
+ $data = Mage::getModel('magesalesforce/webservicedetails')->load(1);
71
+ if($data['checkservice'] == 1)
72
+ {
73
+ $this->loadLayout()
74
+ ->_addContent($this->getLayout()->createBlock('magesalesforce/adminhtml_magesalesforce'))
75
+ ->_setActiveMenu('magesalesforce/items2')
76
+ ->renderLayout();
77
+ }else{
78
+ Mage::getSingleton('core/session')->addError('Verify Connection Invalid Username, password or security token');
79
+ $this->getResponse()->setRedirect($this->getUrl('magesalesforce/adminhtml_magesalesforce/verifyConnection/', array('_secure'=>true)));
80
+ return;
81
+ }
82
+ }
83
+
84
+ public function editAction()
85
+ {
86
+ $data = Mage::getModel('magesalesforce/webservicedetails')->load(1);
87
+ if($data['checkservice'] == 1)
88
+ {
89
+ $this->loadLayout()
90
+ ->_addContent($this->getLayout()->createBlock('magesalesforce/adminhtml_magesalesforce_transaction', 'transaction'))
91
+ ->_setActiveMenu('magesalesforce/items2')
92
+ ->renderLayout();
93
+ }else{
94
+ Mage::getSingleton('core/session')->addError('Verify Connection Invalid Username, password or security token');
95
+ $this->getResponse()->setRedirect($this->getUrl('magesalesforce/adminhtml_magesalesforce/verifyConnection/', array('_secure'=>true)));
96
+ return;
97
+ }
98
+ }
99
+
100
+
101
+ public function syncAction()
102
+ {
103
+ $flag = $this->getRequest()->getParam('flag');
104
+ Mage::getModel('magesalesforce/lead')->syncLead($flag);
105
+ }
106
+
107
+
108
+ public function logException($e)
109
+ {
110
+ $date = date('h:i:s A');
111
+ $cdate = date("m-d-Y");
112
+ $dir = "Exceptions";
113
+ if (!is_dir($dir)){
114
+ mkdir($dir,"0777");
115
+ }
116
+ $myFile = $dir."/".$cdate.".txt";
117
+ $fh = fopen($myFile, 'a') or die("can't open file");
118
+ $stringData = "Error : $e ";
119
+ fwrite($fh, $stringData);
120
+ $stringData = "| Time : $date \n";
121
+ fwrite($fh, $stringData);
122
+ fclose($fh);
123
+ return;
124
+ }
125
+
126
+ public function chkLicense()
127
+ {
128
+ $chkModel = Mage::getModel('magesalesforce/lead')->chkLicense();
129
+ return $chkModel;
130
+ }
131
+
132
+
133
+
134
+ }
app/code/local/Thylak/Magesalesforce/etc/config.xml ADDED
@@ -0,0 +1,134 @@
1
+ <?xml version="1.0"?>
2
+
3
+ <!-- Config file -->
4
+
5
+ <config>
6
+ <modules>
7
+ <Thylak_Magesalesforce>
8
+ <version>0.1.0</version>
9
+ </Thylak_Magesalesforce>
10
+ </modules>
11
+ <admin>
12
+ <routers>
13
+ <magesalesforce>
14
+ <use>admin</use>
15
+ <args>
16
+ <module>Thylak_Magesalesforce</module>
17
+ <frontName>magesalesforce</frontName>
18
+ </args>
19
+ </magesalesforce>
20
+ </routers>
21
+ </admin>
22
+ <adminhtml>
23
+ <menu>
24
+ <magesalesforce module="magesalesforce">
25
+ <title>M2SF</title>
26
+ <sort_order>71</sort_order>
27
+ <children>
28
+ <items module="magesalesforce">
29
+ <title>Verify Connection</title>
30
+ <action>magesalesforce/adminhtml_magesalesforce/verifyConnection</action>
31
+ <sort_order>20</sort_order>
32
+ </items>
33
+ </children>
34
+ <children>
35
+ <items1 module="magesalesforce">
36
+ <title>Sync Lead Data</title>
37
+ <action>magesalesforce/adminhtml_magesalesforce/syncLead</action>
38
+ <sort_order>25</sort_order>
39
+ </items1>
40
+ </children>
41
+ <children>
42
+ <items2 module="magesalesforce">
43
+ <title>View Sync Data</title>
44
+ <action>magesalesforce/adminhtml_magesalesforce/viewSync</action>
45
+ <sort_order>30</sort_order>
46
+ </items2>
47
+ </children>
48
+ </magesalesforce>
49
+ </menu>
50
+ <acl>
51
+ <resources>
52
+ <all>
53
+ <title>Allow Everything</title>
54
+ </all>
55
+ <admin>
56
+ <children>
57
+ <Thylak_Magesalesforce>
58
+ <title>Magesalesforce Module</title>
59
+ <sort_order>10</sort_order>
60
+ </Thylak_Magesalesforce>
61
+ </children>
62
+ </admin>
63
+ </resources>
64
+ </acl>
65
+ <layout>
66
+ <updates>
67
+ <magesalesforce>
68
+ <file>magesalesforce.xml</file>
69
+ </magesalesforce>
70
+ </updates>
71
+ </layout>
72
+ </adminhtml>
73
+ <global>
74
+ <resources>
75
+ <magesalesforce_setup>
76
+ <setup>
77
+ <module>Thylak_Magesalesforce</module>
78
+ </setup>
79
+ <connection>
80
+ <use>core_setup</use>
81
+ </connection>
82
+ </magesalesforce_setup>
83
+ <magesalesforce_write>
84
+ <connection>
85
+ <use>core_write</use>
86
+ </connection>
87
+ </magesalesforce_write>
88
+ <magesalesforce_read>
89
+ <connection>
90
+ <use>core_read</use>
91
+ </connection>
92
+ </magesalesforce_read>
93
+ </resources>
94
+ <models>
95
+ <magesalesforce>
96
+ <class>Thylak_Magesalesforce_Model</class>
97
+ <resourceModel>magesalesforce_mysql4</resourceModel>
98
+ </magesalesforce>
99
+ <magesalesforce_mysql4>
100
+ <class>Thylak_Magesalesforce_Model_Mysql4</class>
101
+ <entities>
102
+ <profilehistory>
103
+ <table>profilehistory</table>
104
+ </profilehistory>
105
+ <profiletransaction>
106
+ <table>profiletransaction</table>
107
+ </profiletransaction>
108
+ <webservicedetails>
109
+ <table>webservicedetails</table>
110
+ </webservicedetails>
111
+ </entities>
112
+ </magesalesforce_mysql4>
113
+ </models>
114
+ <blocks>
115
+ <magesalesforce>
116
+ <class>Thylak_Magesalesforce_Block</class>
117
+ </magesalesforce>
118
+ </blocks>
119
+ <helpers>
120
+ <magesalesforce>
121
+ <class>Thylak_Magesalesforce_Helper</class>
122
+ </magesalesforce>
123
+ </helpers>
124
+ </global>
125
+ <crontab>
126
+ <jobs>
127
+ <magesalesforce_lead_Leadmap>
128
+ <schedule><cron_expr>* * * * *</cron_expr></schedule>
129
+ <run><model>magesalesforce/lead::syncLead</model></run>
130
+ </magesalesforce_lead_Leadmap>
131
+ </jobs>
132
+ </crontab>
133
+ </config>
134
+
app/code/local/Thylak/Magesalesforce/sql/magesalesforce_setup/mysql4-install-0.1.0.php ADDED
@@ -0,0 +1,56 @@
1
+ <?php
2
+
3
+ $installer = $this;
4
+
5
+ $installer->startSetup();
6
+
7
+
8
+ $installer->run("
9
+
10
+ -- DROP TABLE IF EXISTS {$this->getTable('profilehistory')};
11
+ CREATE TABLE {$this->getTable('profilehistory')} (
12
+ `id` int(11) NOT NULL AUTO_INCREMENT,
13
+ `totalrecords` int(11) NOT NULL,
14
+ `totalinserted` int(11) NOT NULL,
15
+ `totalupdated` int(11) NOT NULL,
16
+ `status` varchar(50) NOT NULL,
17
+ `startdate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
18
+ `updated_at` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
19
+ `runtype` varchar(50) NOT NULL,
20
+ `lastfetched` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
21
+ PRIMARY KEY (`id`)
22
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
23
+
24
+ -- DROP TABLE IF EXISTS {$this->getTable('profiletransaction')};
25
+ CREATE TABLE {$this->getTable('profiletransaction')} (
26
+ `id` int(11) NOT NULL AUTO_INCREMENT,
27
+ `batchid` int(11) NOT NULL,
28
+ `mage_id` varchar(50) NOT NULL,
29
+ `lead_id` varchar(100) NOT NULL,
30
+ `order_amt` varchar(100) NOT NULL,
31
+ `order_email` varchar(100) NOT NULL,
32
+ `status` varchar(50) NOT NULL,
33
+ `startdate` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
34
+ `updated_at` datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
35
+ PRIMARY KEY (`id`)
36
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
37
+
38
+ -- DROP TABLE IF EXISTS {$this->getTable('webservicedetails')};
39
+ CREATE TABLE {$this->getTable('webservicedetails')} (
40
+ `webservice_id` int(11) NOT NULL DEFAULT '1',
41
+ `securitytoken` varchar(100) NOT NULL,
42
+ `apiname` varchar(100) NOT NULL,
43
+ `apipassword` varchar(100) NOT NULL,
44
+ `licensekey` varchar(100) NOT NULL,
45
+ `licensetype` int(11) NOT NULL DEFAULT '0',
46
+ `profiletype` int(11) NOT NULL DEFAULT '0',
47
+ `checkservice` int(11) NOT NULL DEFAULT '0',
48
+ PRIMARY KEY (`webservice_id`)
49
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8;
50
+
51
+ INSERT INTO `webservicedetails` (`webservice_id`, `securitytoken`, `apiname`, `apipassword`, `licensekey`, `licensetype`, `profiletype`, `checkservice`) VALUES (1, 'test123', 'test@test.com', 'test', '12345', 0, 0, 0);
52
+
53
+
54
+ ");
55
+
56
+ $installer->endSetup();
app/design/adminhtml/default/default/template/magesalesforce/syncbtn.phtml ADDED
@@ -0,0 +1,56 @@
1
+ <script type="text/javascript">
2
+ function syncLead(popup,flag)
3
+ {
4
+ var url = '<?php echo $this->getUrl('*/*/sync')?>';
5
+ if(flag==1){
6
+ url = url + 'flag/1/';
7
+ }
8
+ if (!popup) {
9
+ $('run_iframe').style.display = 'block';
10
+ $('run_iframe').src = url;
11
+ } else {
12
+ window.open(url);
13
+ }
14
+ }
15
+
16
+ </script>
17
+ <table width="100%"><tr><td>
18
+ <strong>Synchronization Magento Abandoned Orders With Salesforce</strong>
19
+ </td><td style="float:right;">
20
+ <button type="button" onclick="javascript: window.open('http://magento.thylaksoft.com/business/feedback.php')" ><span>Feedback</span></button>
21
+ </td></tr></table>
22
+
23
+ <div id="profile-generator" class="entry-edit profile-generator">
24
+
25
+ <div class="entry-edit-head">
26
+ <h4 class="icon-head head-edit-form fieldset-legend">Salesforce Synchronization</h4>
27
+ </div>
28
+ <div>
29
+ <fieldset>
30
+ <table><tr><td width="450">
31
+ <?php echo $this->getRunButtonHtml() ?>
32
+ </td></tr></table>
33
+ </fieldset>
34
+ </div>
35
+ <div class="entry-edit-head">
36
+ <h4 class="icon-head head-edit-form fieldset-legend">The Following are the default mapping feilds with Mageto to Salesforce</h4>
37
+ </div>
38
+ <div>
39
+ <fieldset>
40
+ <table>
41
+ <tr><td width="200"><strong>Magento Feilds</strong></td><td width="50"><strong><-----></strong></td><td width="200"><strong>SalesForce Feilds</strong></td></tr>
42
+ <tr><td width="200">First Name</td><td width="50"><-----></td><td width="200">First Name</td></tr>
43
+ <tr><td width="200">Last Name</td><td width="50"><-----></td><td width="200">Last Name</td></tr>
44
+ <tr><td width="200">Email Id</td><td width="50"><-----></td><td width="200">Email Id</td></tr>
45
+ <tr><td width="200">Company(default value Thylak)</td><td width="50"><-----></td><td width="200">Company</td></tr>
46
+ <tr><td width="200">Street</td><td width="50"><-----></td><td width="200">Street</td></tr>
47
+ <tr><td width="200">City</td><td width="50"><-----></td><td width="200">City</td></tr>
48
+ <tr><td width="200">State</td><td width="50"><-----></td><td width="200">State</td></tr>
49
+ <tr><td width="200">Postcode</td><td width="50"><-----></td><td width="200">PostalCode</td></tr>
50
+ <tr><td width="200">Country</td><td width="50"><-----></td><td width="200">Country</td></tr>
51
+ <tr><td width="200">Product Details(default value Thylak)</td><td width="50"><-----></td><td width="200">MagentoProduct__c</td></tr>
52
+ </table>
53
+ </fieldset>
54
+ </div>
55
+ </div>
56
+ <iframe id="run_iframe" src="<?php echo $this->getJsUrl() ?>blank.html" frameborder=0 style="display:none; width:100%; height:400px;"></iframe>
app/design/adminhtml/default/default/template/magesalesforce/transaction.phtml ADDED
@@ -0,0 +1,9 @@
1
+ <div class="content-header">
2
+ <table cellspacing="0">
3
+ <tr>
4
+ <td><h3><?php echo Mage::helper('magesalesforce')->__('Batch Transaction Details') ?></h3></td>
5
+ <td style="float:right"><button type="button" class="scalable back" onclick="javascript: history.go(-1)" ><span>Back</span></button><button type="button" onclick="javascript: window.open('http://magento.thylaksoft.com/business/feedback.php')" ><span>Feedback</span></button></td>
6
+ </tr>
7
+ </table>
8
+ </div>
9
+ <?php echo $this->getChildHtml('grid') ?>
app/design/adminhtml/default/default/template/magesalesforce/verifyconnection.phtml ADDED
@@ -0,0 +1,92 @@
1
+ <table width="100%"><tr><td>
2
+ <strong>Verify Salesforce CRM Connection</strong>
3
+ </td><td style="float:right;">
4
+ <button type="button" onclick="javascript: window.open('http://magento.thylaksoft.com/business/feedback.php')" ><span>Feedback</span></button>
5
+ </td></tr></table>
6
+
7
+ <?php $webservice_details = $this->getWebservicedetails(); ?>
8
+
9
+ <form name="verifyconform" id="verifyconform" method="post" action="<?php echo $this->getUrl('*/*/saveConnection'); ?>" enctype="multipart/form-data">
10
+
11
+ <input name="form_key" type="hidden" value="<?php echo Mage::getSingleton('core/session')->getFormKey() ?>" />
12
+
13
+
14
+
15
+ <div id="profile-generator" class="entry-edit profile-generator">
16
+
17
+ <div class="entry-edit-head">
18
+ <h4 class="icon-head head-edit-form fieldset-legend">Salesforce CRM Information</h4>
19
+ </div>
20
+ <fieldset>
21
+ <table><tr><td width="450">
22
+ <div>
23
+ <span class="field-row">
24
+ <label for="api_user_name">User Name: <span class="required">*</span></label>
25
+ <input type="text" class="required-entry input-text" id="api_user_name" name="api_user_name" value="<?php echo $webservice_details['apiname']; ?>"/>
26
+ </span>
27
+ <span class="field-row">
28
+ <label for="api_password">Password: <span class="required">*</span></label>
29
+ <input type="password" class="required-entry input-text" id="api_password" name="api_password" value="<?php echo $webservice_details['apipassword']; ?>"/>
30
+ </span>
31
+ <span class="field-row">
32
+ <label for="webservice_name">Security Token: <span class="required">*</span></label>
33
+ <input type="password" class="required-entry input-text" id="security_token" name="security_token" value="<?php echo $webservice_details['securitytoken']; ?>" />
34
+ </span>
35
+ <span class="field-row">
36
+ <label for="type">Connection Type :</label>
37
+ <select name="type" id="type">
38
+ <?php if($webservice_details['profiletype'] == 1){ ?>
39
+ <option value="0">Enterprise Profile</option><option value="1" selected="selected">Partner Profile</option>
40
+ <?php }else{ ?>
41
+ <option value="0">Enterprise Profile</option><option value="1">Partner Profile</option>
42
+ <?php } ?>
43
+ </select>
44
+ </span>
45
+ <span class="field-row">
46
+ <label for="licensekey">Serial Key: <span class="required">*</span></label>
47
+ <input type="password" class="required-entry input-text" id="licensekey" name="licensekey" value="<?php echo $webservice_details['licensekey']; ?>" />&nbsp;<a href="#" onclick="window.open('http://magento.thylaksoft.com/M2SF/getLicense.php?q=<?php echo $_SERVER['SERVER_NAME']; ?>');" alt="getKey">Get Serial Key</a><br />
48
+ </span>
49
+
50
+ <!-- <span class="field-row">
51
+ <label for="licensetype">License Type :</label>
52
+ <select name="licensetype" id="licensetype">
53
+ <?php if($webservice_details['licensetype'] == 1){ ?>
54
+ <option value="0">Trail Version</option><option value="1" selected="selected">Licensed Version</option>
55
+ <?php }else{ ?>
56
+ <option value="0">Trail Version</option><option value="1">Licensed Version</option>
57
+ <?php } ?>
58
+ </select>
59
+ </span> -->
60
+
61
+ <span class="field-row">
62
+ <label for="status">Connection Status :</label>
63
+ <?php if($webservice_details['checkservice'] == '1'){ ?><label for="chkservice" style="color:green;">Connection Successfull</lable><?php } else { ?><label for="chkservice" style="color:red;">Connection Failed</label><?php } ?>
64
+ </span>
65
+ </div>
66
+ </td><td>
67
+ <div>
68
+ <span class="field-row">
69
+ <p>1.Enter Your salesforce account username</p>
70
+ <p>2.Enter Your salesforce account password</p>
71
+ <p>3.Enter Your salesforce account token</p>
72
+ <p>4.Select Your salesforce api connection type</p>
73
+ </span>
74
+
75
+ </div>
76
+
77
+ </td></tr></table>
78
+ </fieldset>
79
+ <div style="float:right">
80
+ <button id="submit" type="submit" ><span>Submit</span></button>
81
+ </div>
82
+
83
+ </div>
84
+
85
+ </form>
86
+
87
+
88
+ <script language="javascript">
89
+
90
+ var magesugarform = new varienForm('verifyconform');
91
+
92
+ </script>
app/etc/modules/Thylak_Magesalesforce.xml ADDED
@@ -0,0 +1,10 @@
1
+ <?xml version="1.0"?>
2
+
3
+ <config>
4
+ <modules>
5
+ <Thylak_Magesalesforce>
6
+ <active>true</active>
7
+ <codePool>local</codePool>
8
+ </Thylak_Magesalesforce>
9
+ </modules>
10
+ </config>
package.xml ADDED
@@ -0,0 +1,18 @@
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>Magento2SalesforceExtesnion</name>
4
+ <version>1.0</version>
5
+ <stability>stable</stability>
6
+ <license uri="http://www.opensource.org/licenses/osl-3.0.php">OSL v3.0</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>This extension is used to fetch the abandoned shopping cart from magento and insert into the salesforce as lead data.</summary>
10
+ <description>This extension is used to fetch the abandoned shopping cart from magento and insert into the salesforce as lead data. To use this extension you have to create the one custom field called MagentoProduct__c and link this field with lead object. Then generate the partner and enterprise wsdl files and save it in the php tool kit in appropriate path which is available with this extension.</description>
11
+ <notes>This extension is used to fetch the abandoned shopping cart from magento and insert into the salesforce as lead data.</notes>
12
+ <authors><author><name>Gurumoorthi</name><user>auto-converted</user><email>guru@thylaksoft.com</email></author><author><name>RajeshN</name><user>auto-converted</user><email>rajeshn@thylaksoft.com</email></author></authors>
13
+ <date>2011-07-28</date>
14
+ <time>12:10:01</time>
15
+ <contents><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="magesalesforce"><file name="syncbtn.phtml" hash="bdc6e0dae0b400c0f36c642a28826457"/><file name="transaction.phtml" hash="6563e66ce9fb3b068bf0970bb65ed406"/><file name="verifyconnection.phtml" hash="74ee1eda8a2a75469d4a6b22c3bcfe2f"/></dir></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Thylak_Magesalesforce.xml" hash="2af738afaa63af4ed50e5dd2a03a05ff"/></dir></target><target name="mage"><dir name="phptoolkit"><file name="userAuth.php" hash="94b60b998957ba0357db6ed406368085"/><dir name="soapclient"><file name="enterprise.wsdl.xml" hash="69e6db10952dae8665d9e08fc35a09a6"/><file name="metadata.wsdl.xml" hash="c55ec74d4fadff80da8bf00b3bd666ce"/><file name="partner.wsdl.xml" hash="98e756474b5e72eae92b29c969522bda"/><file name="ProxySettings.php" hash="1d828218ec5b12686c376a97c11ef8b4"/><file name="SforceBaseClient.php" hash="4d64c85f85253635af8109a43b7adff6"/><file name="SforceEmail.php" hash="6ba9a19e700e92c7b1f0413bbac1d417"/><file name="SforceEnterpriseClient.php" hash="cca7cbb7695cc8730f75641e85658a31"/><file name="SforceFieldTypes.php" hash="402289ad37b7fa24442919dbfc59fd18"/><file name="SforceHeaderOptions.php" hash="de6672b2d556ffcc7a320c259d94142e"/><file name="SforceMetadataClient.php" hash="7c8024327c550e790e9fef70378c567f"/><file name="SforceMetaObject.php" hash="19be7d3900770a4b29860e11f23353f3"/><file name="SforcePartnerClient.php" hash="dba0fc92187071f334cb8a355b2a86b0"/><file name="SforceProcessRequest.php" hash="84e3a68dd73adf6dd76a4caeef0a533d"/></dir></dir><dir name="."><file name="M2SFinstallation.txt" hash="9b2e2026c9a3c75a3b8b649e180ca56a"/></dir></target><target name="magelocal"><dir name="Thylak"><dir name="Magesalesforce"><dir name="Block"><dir name="Adminhtml"><file name="Magesalesforce.php" hash="4e93cbf50f53770e1318fd425fd7c6e5"/><dir name="Magesalesforce"><file name="Grid.php" hash="7e395584b72d756fa7fccacfa7eb96ec"/><file name="Syncbtn.php" hash="fe508bdd0904104c37bc59ebea965b60"/><file name="Transaction.php" hash="c732c211d541b44dde50d148f3f2b9ed"/><file name="Verifyconnection.php" hash="cf8c7a3f147881fbd3e150a0951881a9"/><dir name="Transaction"><file name="Grid.php" hash="8b0c791336cac8638956df88ec6b79dc"/></dir></dir></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="MagesalesforceController.php" hash="d5557c667d1d6aa1bd4ff9630b85ba99"/></dir></dir><dir name="etc"><file name="config.xml" hash="3e623929fd7d32bbe965b926887fbe3d"/></dir><dir name="Helper"><file name="Data.php" hash="df07dbd18479b1ff1592084b82891df3"/></dir><dir name="Model"><file name="Lead.php" hash="f1afc110202e08ae515595c876166f14"/><file name="Profilehistory.php" hash="cde475ea237ae44562f08a43519c3a47"/><file name="Profiletransaction.php" hash="a8f29796f9330306cb5b69481ccdef91"/><file name="Webservicedetails.php" hash="58f425f0801da63557629377f71ff5ca"/><dir name="Mysql4"><file name="Profilehistory.php" hash="e8afe391b3d02acae153ba5cfa62f66c"/><file name="Profiletransaction.php" hash="0f4526c60dd020d58a2954c9e2cd4f2b"/><file name="Webservicedetails.php" hash="c8e94f63ab9f60a8c8da3926f333ad40"/><dir name="Profilehistory"><file name="Collection.php" hash="50d57becba6d507cc548e7c01638537e"/></dir><dir name="Profiletransaction"><file name="Collection.php" hash="48d28345506cf9b9732a5224dee9d822"/></dir><dir name="Webservicedetails"><file name="Collection.php" hash="5fffed473fc3dff2a5b275a3195fd83a"/></dir></dir></dir><dir name="sql"><dir name="magesalesforce_setup"><file name="mysql4-install-0.1.0.php" hash="1b50a035c6e3e3afefe8522442b9d712"/></dir></dir></dir></dir></target></contents>
16
+ <compatible/>
17
+ <dependencies/>
18
+ </package>
phptoolkit/soapclient/ProxySettings.php ADDED
@@ -0,0 +1,8 @@
1
+ <?php
2
+ class ProxySettings {
3
+ public $host;
4
+ public $port;
5
+ public $login;
6
+ public $password;
7
+ }
8
+ ?>
phptoolkit/soapclient/SforceBaseClient.php ADDED
@@ -0,0 +1,784 @@
1
+ <?php
2
+ /*
3
+ * Copyright (c) 2007, salesforce.com, inc.
4
+ * All rights reserved.
5
+ *
6
+ * Redistribution and use in source and binary forms, with or without modification, are permitted provided
7
+ * that the following conditions are met:
8
+ *
9
+ * Redistributions of source code must retain the above copyright notice, this list of conditions and the
10
+ * following disclaimer.
11
+ *
12
+ * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
13
+ * the following disclaimer in the documentation and/or other materials provided with the distribution.
14
+ *
15
+ * Neither the name of salesforce.com, inc. nor the names of its contributors may be used to endorse or
16
+ * promote products derived from this software without specific prior written permission.
17
+ *
18
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
19
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
20
+ * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
21
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
22
+ * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
24
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25
+ * POSSIBILITY OF SUCH DAMAGE.
26
+ */
27
+ require_once ('SforceEmail.php');
28
+ require_once ('SforceProcessRequest.php');
29
+ require_once ('ProxySettings.php');
30
+ require_once ('SforceHeaderOptions.php');
31
+
32
+
33
+ /**
34
+ * This file contains one class.
35
+ * @package SalesforceSoapClient
36
+ */
37
+ /**
38
+ * SalesforceSoapClient
39
+ * @package SalesforceSoapClient
40
+ */
41
+ class SforceBaseClient {
42
+ protected $sforce;
43
+ protected $sessionId;
44
+ protected $location;
45
+ protected $version = '11.0';
46
+
47
+ protected $namespace;
48
+
49
+ // Header Options
50
+ protected $callOptions;
51
+ protected $assignmentRuleHeader;
52
+ protected $emailHeader;
53
+ protected $loginScopeHeader;
54
+ protected $mruHeader;
55
+ protected $queryHeader;
56
+ protected $userTerritoryDeleteHeader;
57
+ protected $sessionHeader;
58
+
59
+ public function getNamespace() {
60
+ return $this->namespace;
61
+ }
62
+
63
+
64
+ // clientId specifies which application or toolkit is accessing the
65
+ // salesforce.com API. For applications that are certified salesforce.com
66
+ // solutions, replace this with the value provided by salesforce.com.
67
+ // Otherwise, leave this value as 'phpClient/1.0'.
68
+ protected $client_id;
69
+
70
+ public function printDebugInfo() {
71
+ echo "PHP Toolkit Version: $this->version\r\n";
72
+ echo 'Current PHP version: ' . phpversion();
73
+ echo "\r\n";
74
+ echo 'SOAP enabled: ';
75
+ if (extension_loaded('soap')) {
76
+ echo 'True';
77
+ } else {
78
+ echo 'False';
79
+ }
80
+ echo "\r\n";
81
+ echo 'OpenSSL enabled: ';
82
+ if (extension_loaded('openssl')) {
83
+ echo 'True';
84
+ } else {
85
+ echo 'False';
86
+ }
87
+ }
88
+
89
+ /**
90
+ * Connect method to www.salesforce.com
91
+ *
92
+ * @param string $wsdl Salesforce.com Partner WSDL
93
+ */
94
+ public function createConnection($wsdl, $proxy=null) {
95
+ $_SERVER['HTTP_USER_AGENT'] = 'Salesforce/PHPToolkit/1.0';
96
+
97
+ $soapClientArray = null;
98
+ if (phpversion() > '5.1.2') {
99
+ $soapClientArray = array (
100
+ 'encoding' => 'utf-8',
101
+ 'trace' => 1,
102
+ 'compression' => SOAP_COMPRESSION_ACCEPT | SOAP_COMPRESSION_GZIP
103
+ );
104
+ } else {
105
+ $soapClientArray = array (
106
+ 'encoding' => 'utf-8',
107
+ 'trace' => 1
108
+ );
109
+ }
110
+
111
+ if ($proxy != null) {
112
+ $proxySettings = array();
113
+ $proxySettings['proxy_host'] = $proxy->host;
114
+ $proxySettings['proxy_port'] = $proxy->port; // Use an integer, not a string
115
+ $proxySettings['proxy_login'] = $proxy->login;
116
+ $proxySettings['proxy_password'] = $proxy->password;
117
+
118
+ $soapClientArray = array_merge($soapClientArray, $proxySettings);
119
+ }
120
+
121
+ $this->sforce = new SoapClient($wsdl, $soapClientArray);
122
+ return $this->sforce;
123
+ }
124
+
125
+ public function setCallOptions($header) {
126
+ if ($header != NULL) {
127
+ $this->callOptions = new SoapHeader($this->namespace, 'CallOptions', array (
128
+ 'client' => $header->client,
129
+ 'defaultNamespace' => $header->defaultNamespace
130
+ ));
131
+ } else {
132
+ $this->callOptions = NULL;
133
+ }
134
+ }
135
+
136
+ /**
137
+ * Login to Salesforce.com and starts a client session.
138
+ *
139
+ * @param string $username Username
140
+ * @param string $password Password
141
+ *
142
+ * @return LoginResult
143
+ */
144
+ public function login($username, $password) {
145
+ $this->sforce->__setSoapHeaders(NULL);
146
+ if ($this->callOptions != NULL) {
147
+ $this->sforce->__setSoapHeaders(array($this->callOptions));
148
+ }
149
+ if ($this->loginScopeHeader != NULL) {
150
+ $this->sforce->__setSoapHeaders(array($this->loginScopeHeader));
151
+ }
152
+ $result = $this->sforce->login(array (
153
+ 'username' => $username,
154
+ 'password' => $password
155
+ ));
156
+ $result = $result->result;
157
+ $this->_setLoginHeader($result);
158
+ return $result;
159
+ }
160
+
161
+ /**
162
+ * log outs from the salseforce system`
163
+ *
164
+ * @return LogoutResult
165
+ */
166
+ public function logout() {
167
+ $this->setHeaders("logout");
168
+ $arg = new stdClass;
169
+ return $this->sforce->logout();
170
+ }
171
+
172
+ /**
173
+ *invalidate Sessions from the salseforce system`
174
+ *
175
+ * @return invalidateSessionsResult
176
+ */
177
+ public function invalidateSessions() {
178
+ $this->setHeaders("invalidateSessions");
179
+ $arg = new stdClass;
180
+ $this->logout();
181
+ return $this->sforce->invalidateSessions();
182
+ }
183
+
184
+ /**
185
+ * Specifies the session ID returned from the login server after a successful
186
+ * login.
187
+ */
188
+ protected function _setLoginHeader($loginResult) {
189
+ $this->sessionId = $loginResult->sessionId;
190
+ $this->setSessionHeader($this->sessionId);
191
+ $serverURL = $loginResult->serverUrl;
192
+ $this->setEndPoint($serverURL);
193
+ }
194
+
195
+ /**
196
+ * Set the endpoint.
197
+ *
198
+ * @param string $location Location
199
+ */
200
+ public function setEndpoint($location) {
201
+ $this->location = $location;
202
+ $this->sforce->__setLocation($location);
203
+ }
204
+
205
+ private function setHeaders($call=NULL) {
206
+ $this->sforce->__setSoapHeaders(NULL);
207
+ $header_array = array (
208
+ $this->sessionHeader
209
+ );
210
+
211
+ $header = $this->callOptions;
212
+ if ($header != NULL) {
213
+ array_push($header_array, $header);
214
+ }
215
+
216
+ if ($call == "create" ||
217
+ $call == "merge" ||
218
+ $call == "update" ||
219
+ $call == "upsert"
220
+ ) {
221
+ $header = $this->assignmentRuleHeader;
222
+ if ($header != NULL) {
223
+ array_push($header_array, $header);
224
+ }
225
+ }
226
+
227
+ if ($call == "login") {
228
+ $header = $this->loginScopeHeader;
229
+ if ($header != NULL) {
230
+ array_push($header_array, $header);
231
+ }
232
+ }
233
+
234
+ if ($call == "create" ||
235
+ $call == "resetPassword" ||
236
+ $call == "update" ||
237
+ $call == "upsert"
238
+ ) {
239
+ $header = $this->emailHeader;
240
+ if ($header != NULL) {
241
+ array_push($header_array, $header);
242
+ }
243
+ }
244
+
245
+ if ($call == "create" ||
246
+ $call == "merge" ||
247
+ $call == "query" ||
248
+ $call == "retrieve" ||
249
+ $call == "update" ||
250
+ $call == "upsert"
251
+ ) {
252
+ $header = $this->mruHeader;
253
+ if ($header != NULL) {
254
+ array_push($header_array, $header);
255
+ }
256
+ }
257
+
258
+ if ($call == "delete") {
259
+ $header = $this->userTerritoryDeleteHeader;
260
+ if ($header != NULL) {
261
+ array_push($header_array, $header);
262
+ }
263
+ }
264
+
265
+ if ($call == "query" ||
266
+ $call == "queryMore" ||
267
+ $call == "retrieve") {
268
+ $header = $this->queryHeader;
269
+ if ($header != NULL) {
270
+ array_push($header_array, $header);
271
+ }
272
+ }
273
+ $this->sforce->__setSoapHeaders($header_array);
274
+ }
275
+
276
+ public function setAssignmentRuleHeader($header) {
277
+ if ($header != NULL) {
278
+ $this->assignmentRuleHeader = new SoapHeader($this->namespace, 'AssignmentRuleHeader', array (
279
+ 'assignmentRuleId' => $header->assignmentRuleId,
280
+ 'useDefaultRule' => $header->useDefaultRuleFlag
281
+ ));
282
+ } else {
283
+ $this->assignmentRuleHeader = NULL;
284
+ }
285
+ }
286
+
287
+ public function setEmailHeader($header) {
288
+ if ($header != NULL) {
289
+ $this->emailHeader = new SoapHeader($this->namespace, 'EmailHeader', array (
290
+ 'triggerAutoResponseEmail' => $header->triggerAutoResponseEmail,
291
+ 'triggerOtherEmail' => $header->triggerOtherEmail,
292
+ 'triggerUserEmail' => $header->triggerUserEmail
293
+ ));
294
+ } else {
295
+ $this->emailHeader = NULL;
296
+ }
297
+ }
298
+
299
+ public function setLoginScopeHeader($header) {
300
+ if ($header != NULL) {
301
+ $this->loginScopeHeader = new SoapHeader($this->namespace, 'LoginScopeHeader', array (
302
+ 'organizationId' => $header->organizationId,
303
+ 'portalId' => $header->portalId
304
+ ));
305
+ } else {
306
+ $this->loginScopeHeader = NULL;
307
+ }
308
+ //$this->setHeaders('login');
309
+ }
310
+
311
+ public function setMruHeader($header) {
312
+ if ($header != NULL) {
313
+ $this->mruHeader = new SoapHeader($this->namespace, 'MruHeader', array (
314
+ 'updateMru' => $header->updateMruFlag
315
+ ));
316
+ } else {
317
+ $this->mruHeader = NULL;
318
+ }
319
+ }
320
+
321
+ public function setSessionHeader($id) {
322
+ if ($id != NULL) {
323
+ $this->sessionHeader = new SoapHeader($this->namespace, 'SessionHeader', array (
324
+ 'sessionId' => $id
325
+ ));
326
+ $this->sessionId = $id;
327
+ } else {
328
+ $this->sessionHeader = NULL;
329
+ $this->sessionId = NULL;
330
+ }
331
+ }
332
+
333
+ public function setUserTerritoryDeleteHeader($header) {
334
+ if ($header != NULL) {
335
+ $this->serTerritoryDeleteHeader = new SoapHeader($this->namespace, 'UserTerritoryDeleteHeader ', array (
336
+ 'transferToUserId ' => $header->transferToUserId
337
+ ));
338
+ } else {
339
+ $this->mruHeader = NULL;
340
+ }
341
+ }
342
+
343
+ public function setQueryOptions($header) {
344
+ if ($header != NULL) {
345
+ $this->queryHeader = new SoapHeader($this->namespace, 'QueryOptions', array (
346
+ 'batchSize' => $header->batchSize
347
+ ));
348
+ } else {
349
+ $this->queryHeader = NULL;
350
+ }
351
+ }
352
+
353
+ public function getSessionId() {
354
+ return $this->sessionId;
355
+ }
356
+
357
+ public function getLocation() {
358
+ return $this->location;
359
+ }
360
+
361
+ public function getConnection() {
362
+ return $this->sforce;
363
+ }
364
+
365
+ public function getFunctions() {
366
+ return $this->sforce->__getFunctions();
367
+ }
368
+
369
+ public function getTypes() {
370
+ return $this->sforce->__getTypes();
371
+ }
372
+
373
+ public function getLastRequest() {
374
+ return $this->sforce->__getLastRequest();
375
+ }
376
+
377
+ public function getLastRequestHeaders() {
378
+ return $this->sforce->__getLastRequestHeaders();
379
+ }
380
+
381
+ public function getLastResponse() {
382
+ return $this->sforce->__getLastResponse();
383
+ }
384
+
385
+ public function getLastResponseHeaders() {
386
+ return $this->sforce->__getLastResponseHeaders();
387
+ }
388
+
389
+ protected function _convertToAny($fields) {
390
+ $anyString = '';
391
+ foreach ($fields as $key => $value) {
392
+ $anyString = $anyString . '<' . $key . '>' . $value . '</' . $key . '>';
393
+ }
394
+ return $anyString;
395
+ }
396
+
397
+ protected function _create($arg) {
398
+ $this->setHeaders("create");
399
+ return $this->sforce->create($arg)->result;
400
+ }
401
+
402
+ protected function _merge($arg) {
403
+ $this->setHeaders("merge");
404
+ return $this->sforce->merge($arg)->result;
405
+ }
406
+
407
+ protected function _process($arg) {
408
+ $this->setHeaders();
409
+ return $this->sforce->process($arg)->result;
410
+ }
411
+
412
+ protected function _update($arg) {
413
+ $this->setHeaders("update");
414
+ return $this->sforce->update($arg)->result;
415
+ }
416
+
417
+ protected function _upsert($arg) {
418
+ $this->setHeaders("upsert");
419
+ return $this->sforce->upsert($arg)->result;
420
+ }
421
+
422
+ public function sendSingleEmail($request) {
423
+ if (is_array($request)) {
424
+ $messages = array();
425
+ foreach ($request as $r) {
426
+ $email = new SoapVar($r, SOAP_ENC_OBJECT, 'SingleEmailMessage', $this->namespace);
427
+ array_push($messages, $email);
428
+ }
429
+ $arg->messages = $messages;
430
+ return $this->_sendEmail($arg);
431
+ } else {
432
+ $backtrace = debug_backtrace();
433
+ die('Please pass in array to this function: '.$backtrace[0]['function']);
434
+ }
435
+ }
436
+
437
+ public function sendMassEmail($request) {
438
+ if (is_array($request)) {
439
+ $messages = array();
440
+ foreach ($request as $r) {
441
+ $email = new SoapVar($r, SOAP_ENC_OBJECT, 'MassEmailMessage', $this->namespace);
442
+ array_push($messages, $email);
443
+ }
444
+ $arg->messages = $messages;
445
+ return $this->_sendEmail($arg);
446
+ } else {
447
+ $backtrace = debug_backtrace();
448
+ die('Please pass in array to this function: '.$backtrace[0]['function']);
449
+ }
450
+ }
451
+
452
+ protected function _sendEmail($arg) {
453
+ $this->setHeaders();
454
+ return $this->sforce->sendEmail($arg)->result;
455
+ }
456
+
457
+ /**
458
+ * Converts a Lead into an Account, Contact, or (optionally) an Opportunity.
459
+ *
460
+ * @param array $leadConverts Array of LeadConvert
461
+ *
462
+ * @return LeadConvertResult
463
+ */
464
+ public function convertLead($leadConverts) {
465
+ $this->setHeaders("convertLead");
466
+ $arg = new stdClass;
467
+ $arg->leadConverts = $leadConverts;
468
+ return $this->sforce->convertLead($arg);
469
+ }
470
+
471
+ /**
472
+ * Deletes one or more new individual objects to your organization's data.
473
+ *
474
+ * @param array $ids Array of fields
475
+ * @return DeleteResult
476
+ */
477
+ public function delete($ids) {
478
+ $this->setHeaders("delete");
479
+ $arg = new stdClass;
480
+ $arg->ids = $ids;
481
+ return $this->sforce->delete($arg)->result;
482
+ }
483
+
484
+ /**
485
+ * Deletes one or more new individual objects to your organization's data.
486
+ *
487
+ * @param array $ids Array of fields
488
+ * @return DeleteResult
489
+ */
490
+ public function undelete($ids) {
491
+ $this->setHeaders("undelete");
492
+ $arg = new stdClass;
493
+ $arg->ids = $ids;
494
+ return $this->sforce->undelete($arg)->result;
495
+ }
496
+
497
+ /**
498
+ * Deletes one or more new individual objects to your organization's data.
499
+ *
500
+ * @param array $ids Array of fields
501
+ * @return DeleteResult
502
+ */
503
+ public function emptyRecycleBin($ids) {
504
+ $this->setHeaders();
505
+ $arg = new stdClass;
506
+ $arg->ids = $ids;
507
+ return $this->sforce->emptyRecycleBin($arg)->result;
508
+ }
509
+
510
+ /**
511
+ * Process Submit Request for Approval
512
+ *
513
+ * @param array $processRequestArray
514
+ * @return ProcessResult
515
+ */
516
+ public function processSubmitRequest($processRequestArray) {
517
+ if (is_array($processRequestArray)) {
518
+ foreach ($processRequestArray as &$process) {
519
+ $process = new SoapVar($process, SOAP_ENC_OBJECT, 'ProcessSubmitRequest', $this->namespace);
520
+ }
521
+ $arg->actions = $processRequestArray;
522
+ return $this->_process($arg);
523
+ } else {
524
+ $backtrace = debug_backtrace();
525
+ die('Please pass in array to this function: '.$backtrace[0]['function']);
526
+ }
527
+ }
528
+
529
+ /**
530
+ * Process Work Item Request for Approval
531
+ *
532
+ * @param array $processRequestArray
533
+ * @return ProcessResult
534
+ */
535
+ public function processWorkitemRequest($processRequestArray) {
536
+ if (is_array($processRequestArray)) {
537
+ foreach ($processRequestArray as &$process) {
538
+ $process = new SoapVar($process, SOAP_ENC_OBJECT, 'ProcessWorkitemRequest', $this->namespace);
539
+ }
540
+ $arg->actions = $processRequestArray;
541
+ return $this->_process($arg);
542
+ } else {
543
+ $backtrace = debug_backtrace();
544
+ die('Please pass in array to this function: '.$backtrace[0]['function']);
545
+ }
546
+ }
547
+
548
+ /**
549
+ * Retrieves a list of available objects for your organization's data.
550
+ *
551
+ * @return DescribeGlobalResult
552
+ */
553
+ public function describeGlobal() {
554
+ $this->setHeaders("describeGlobal");
555
+ return $this->sforce->describeGlobal()->result;
556
+ }
557
+
558
+ /**
559
+ * Use describeLayout to retrieve information about the layout (presentation
560
+ * of data to users) for a given object type. The describeLayout call returns
561
+ * metadata about a given page layout, including layouts for edit and
562
+ * display-only views and record type mappings. Note that field-level security
563
+ * and layout editability affects which fields appear in a layout.
564
+ *
565
+ * @param string Type Object Type
566
+ * @return DescribeLayoutResult
567
+ */
568
+ public function describeLayout($type) {
569
+ $this->setHeaders("describeLayout");
570
+ $arg = new stdClass;
571
+ $arg->sObjectType = new SoapVar($type, XSD_STRING, 'string', 'http://www.w3.org/2001/XMLSchema');
572
+ return $this->sforce->describeLayout($arg)->result;
573
+ }
574
+
575
+ /**
576
+ * Describes metadata (field list and object properties) for the specified
577
+ * object.
578
+ *
579
+ * @param string $type Object type
580
+ * @return DescribsSObjectResult
581
+ */
582
+ public function describeSObject($type) {
583
+ $this->setHeaders("describeSObject");
584
+ $arg = new stdClass;
585
+ $arg->sObjectType = new SoapVar($type, XSD_STRING, 'string', 'http://www.w3.org/2001/XMLSchema');
586
+ return $this->sforce->describeSObject($arg)->result;
587
+ }
588
+
589
+ /**
590
+ * An array-based version of describeSObject; describes metadata (field list
591
+ * and object properties) for the specified object or array of objects.
592
+ *
593
+ * @param array $arrayOfTypes Array of object types.
594
+ * @return DescribsSObjectResult
595
+ */
596
+ public function describeSObjects($arrayOfTypes) {
597
+ $this->setHeaders("describeSObjects");
598
+ return $this->sforce->describeSObjects($arrayOfTypes)->result;
599
+ }
600
+
601
+ /**
602
+ * The describeTabs call returns information about the standard apps and
603
+ * custom apps, if any, available for the user who sends the call, including
604
+ * the list of tabs defined for each app.
605
+ *
606
+ * @return DescribeTabSetResult
607
+ */
608
+ public function describeTabs() {
609
+ $this->setHeaders("describeTabs");
610
+ return $this->sforce->describeTabs()->result;
611
+ }
612
+
613
+ /**
614
+ * Retrieves the list of individual objects that have been deleted within the
615
+ * given timespan for the specified object.
616
+ *
617
+ * @param string $type Ojbect type
618
+ * @param date $startDate Start date
619
+ * @param date $endDate End Date
620
+ * @return GetDeletedResult
621
+ */
622
+ public function getDeleted($type, $startDate, $endDate) {
623
+ $this->setHeaders("getDeleted");
624
+ $arg = new stdClass;
625
+ $arg->sObjectType = new SoapVar($type, XSD_STRING, 'string', 'http://www.w3.org/2001/XMLSchema');
626
+ $arg->startDate = $startDate;
627
+ $arg->endDate = $endDate;
628
+ return $this->sforce->getDeleted($arg)->result;
629
+ }
630
+
631
+ /**
632
+ * Retrieves the list of individual objects that have been updated (added or
633
+ * changed) within the given timespan for the specified object.
634
+ *
635
+ * @param string $type Ojbect type
636
+ * @param date $startDate Start date
637
+ * @param date $endDate End Date
638
+ * @return GetUpdatedResult
639
+ */
640
+ public function getUpdated($type, $startDate, $endDate) {
641
+ $this->setHeaders("getUpdated");
642
+ $arg = new stdClass;
643
+ $arg->sObjectType = new SoapVar($type, XSD_STRING, 'string', 'http://www.w3.org/2001/XMLSchema');
644
+ $arg->startDate = $startDate;
645
+ $arg->endDate = $endDate;
646
+ return $this->sforce->getUpdated($arg)->result;
647
+ }
648
+
649
+ /**
650
+ * Executes a query against the specified object and returns data that matches
651
+ * the specified criteria.
652
+ *
653
+ * @param String $query Query String
654
+ * @param QueryOptions $queryOptions Batch size limit. OPTIONAL
655
+ * @return QueryResult
656
+ */
657
+ public function query($query) {
658
+ $this->setHeaders("query");
659
+ $QueryResult = $this->sforce->query(array (
660
+ 'queryString' => $query
661
+ ))->result;
662
+ $this->_handleRecords($QueryResult);
663
+ return $QueryResult;
664
+ }
665
+
666
+ /**
667
+ * Retrieves the next batch of objects from a query.
668
+ *
669
+ * @param QueryLocator $queryLocator Represents the server-side cursor that tracks the current processing location in the query result set.
670
+ * @param QueryOptions $queryOptions Batch size limit. OPTIONAL
671
+ * @return QueryResult
672
+ */
673
+ public function queryMore($queryLocator) {
674
+ $this->setHeaders("queryMore");
675
+ $arg = new stdClass;
676
+ $arg->queryLocator = $queryLocator;
677
+ $QueryResult = $this->sforce->queryMore($arg)->result;
678
+ $this->_handleRecords($QueryResult);
679
+ return $QueryResult;
680
+ }
681
+
682
+ /**
683
+ * Retrieves data from specified objects, whether or not they have been deleted.
684
+ *
685
+ * @param String $query Query String
686
+ * @param QueryOptions $queryOptions Batch size limit. OPTIONAL
687
+ * @return QueryResult
688
+ */
689
+ public function queryAll($query, $queryOptions = NULL) {
690
+ $this->setHeaders("queryAll");
691
+ $QueryResult = $this->sforce->queryAll(array (
692
+ 'queryString' => $query
693
+ ))->result;
694
+ $this->_handleRecords($QueryResult);
695
+ return $QueryResult;
696
+ }
697
+
698
+
699
+ private function _handleRecords(& $QueryResult) {
700
+ if ($QueryResult->size > 0) {
701
+ if ($QueryResult->size == 1) {
702
+ $recs = array (
703
+ $QueryResult->records
704
+ );
705
+ } else {
706
+ $recs = $QueryResult->records;
707
+ }
708
+ $QueryResult->records = $recs;
709
+ }
710
+ }
711
+
712
+ /**
713
+ * Retrieves one or more objects based on the specified object IDs.
714
+ *
715
+ * @param string $fieldList One or more fields separated by commas.
716
+ * @param string $sObjectType Object from which to retrieve data.
717
+ * @param array $ids Array of one or more IDs of the objects to retrieve.
718
+ * @return sObject[]
719
+ */
720
+ public function retrieve($fieldList, $sObjectType, $ids) {
721
+ $this->setHeaders("retrieve");
722
+ $arg = new stdClass;
723
+ $arg->fieldList = $fieldList;
724
+ $arg->sObjectType = new SoapVar($sObjectType, XSD_STRING, 'string', 'http://www.w3.org/2001/XMLSchema');
725
+ $arg->ids = $ids;
726
+ return $this->sforce->retrieve($arg)->result;
727
+ }
728
+
729
+ /**
730
+ * Executes a text search in your organization's data.
731
+ *
732
+ * @param string $searchString Search string that specifies the text expression to search for.
733
+ * @return SearchResult
734
+ */
735
+ public function search($searchString) {
736
+ $this->setHeaders("search");
737
+ $arg = new stdClass;
738
+ $arg->searchString = new SoapVar($searchString, XSD_STRING, 'string', 'http://www.w3.org/2001/XMLSchema');
739
+ return $this->sforce->search($arg)->result;
740
+ }
741
+
742
+ /**
743
+ * Retrieves the current system timestamp (GMT) from the Web service.
744
+ *
745
+ * @return timestamp
746
+ */
747
+ public function getServerTimestamp() {
748
+ $this->setHeaders("getServerTimestamp");
749
+ return $this->sforce->getServerTimestamp()->result;
750
+ }
751
+
752
+ public function getUserInfo() {
753
+ $this->setHeaders("getUserInfo");
754
+ return $this->sforce->getUserInfo()->result;
755
+ }
756
+
757
+ /**
758
+ * Sets the specified user's password to the specified value.
759
+ *
760
+ * @param string $userId ID of the User.
761
+ * @param string $password New password
762
+ */
763
+ public function setPassword($userId, $password) {
764
+ $this->setHeaders("setPassword");
765
+ $arg = new stdClass;
766
+ $arg->userId = new SoapVar($userId, XSD_STRING, 'string', 'http://www.w3.org/2001/XMLSchema');
767
+ $arg->password = $password;
768
+ return $this->sforce->setPassword($arg);
769
+ }
770
+
771
+ /**
772
+ * Changes a user's password to a system-generated value.
773
+ *
774
+ * @param string $userId Id of the User
775
+ * @return password
776
+ */
777
+ public function resetPassword($userId) {
778
+ $this->setHeaders("resetPassword");
779
+ $arg = new stdClass;
780
+ $arg->userId = new SoapVar($userId, XSD_STRING, 'string', 'http://www.w3.org/2001/XMLSchema');
781
+ return $this->sforce->resetPassword($arg)->result;
782
+ }
783
+ }
784
+ ?>
phptoolkit/soapclient/SforceEmail.php ADDED
@@ -0,0 +1,101 @@
1
+ <?php
2
+ define ("EMAIL_PRIORITY_HIGHEST", 'Highest');
3
+ define ("EMAIL_PRIORITY_HIGH", 'High');
4
+ define ("EMAIL_PRIORITY_NORMAL", 'Normal');
5
+ define ("EMAIL_PRIORITY_LOW", 'Low');
6
+ define ("EMAIL_PRIORITY_LOWEST", 'Lowest');
7
+
8
+ class Email {
9
+ public function setBccSender($bccSender) {
10
+ $this->bccSender = $bccSender;
11
+ }
12
+
13
+ public function setEmailPriority($priority) {
14
+ $this->emailPriority = $priority;
15
+ }
16
+
17
+ public function setSubject($subject) {
18
+ $this->subject = $subject;
19
+ }
20
+
21
+ public function setSaveAsActivity($saveAsActivity) {
22
+ $this->saveAsActivity = $saveAsActivity;
23
+ }
24
+
25
+ public function setReplyTo($replyTo) {
26
+ $this->replyTo = $replyTo;
27
+ }
28
+
29
+ public function setUseSignature($useSignature) {
30
+ $this->useSignature = $useSignature;
31
+ }
32
+
33
+ public function setSenderDisplayName($name) {
34
+ $this->senderDisplayName = $name;
35
+ }
36
+ }
37
+
38
+ class SingleEmailMessage extends Email {
39
+ public function __construct() {}
40
+
41
+
42
+ public function setBccAddresses($addresses) {
43
+ $this->bccAddresses = $addresses;
44
+ }
45
+ public $ccAddresses;
46
+
47
+ public function setCcAddresses($addresses) {
48
+ $this->ccAddresses = $addresses;
49
+ }
50
+
51
+ public function setCharset($charset) {
52
+ $this->charset = $charset;
53
+ }
54
+
55
+ public function setHtmlBody($htmlBody) {
56
+ $this->htmlBody = $htmlBody;
57
+ }
58
+
59
+ public function setPlainTextBody($plainTextBody) {
60
+ $this->plainTextBody = $plainTextBody;
61
+ }
62
+
63
+ public function setTargetObjectId($targetObjectId) {
64
+ $this->targetObjectId = $targetObjectId;
65
+ }
66
+
67
+ public function setTemplateId($templateId) {
68
+ $this->templateId = $templateId;
69
+ }
70
+
71
+ public function setToAddresses($array) {
72
+ $this->toAddresses = $array;
73
+ }
74
+
75
+ public function setWhatId($whatId) {
76
+ $this->whatId = $whatId;
77
+ }
78
+
79
+ public function setFileAttachments($array) {
80
+ $this->fileAttachments = $array;
81
+ }
82
+
83
+ public function setDocumentAttachments($array) {
84
+ $this->documentAttachments = $array;
85
+ }
86
+ }
87
+
88
+ class MassEmailMessage extends Email {
89
+ public function setTemplateId($templateId) {
90
+ $this->templateId = $templateId;
91
+ }
92
+
93
+ public function setWhatIds($array) {
94
+ $this->whatIds = $array;
95
+ }
96
+
97
+ public function setTargetObjectIds($array) {
98
+ $this->targetObjectIds = $array;
99
+ }
100
+ }
101
+ ?>
phptoolkit/soapclient/SforceEnterpriseClient.php ADDED
@@ -0,0 +1,109 @@
<
1
+ <?php
2
+ /*
3
+ * Copyright (c) 2007, salesforce.com, inc.
4
+ * All rights reserved.
5
+ *
6
+ * Redistribution and use in source and binary forms, with or without modification, are permitted provided
7
+ * that the following conditions are met:
8
+ *
9
+ * Redistributions of source code must retain the above copyright notice, this list of conditions and the
10
+ * following disclaimer.
11
+ *
12
+ * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and
13
+ * the following disclaimer in the documentation and/or other materials provided with the distribution.
14
+ *
15
+ * Neither the name of salesforce.com, inc. nor the names of its contributors may be used to endorse or
16
+ * promote products derived from this software without specific prior written permission.
17
+ *
18
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
19
+ * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A
20
+ * PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
21
+ * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
22
+ * TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
23
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
24
+ * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
25
+ * POSSIBILITY OF SUCH DAMAGE.
26
+ */
27
+ require_once ('SforceBaseClient.php');
28
+
29
+ /**
30
+ * This file contains two classes.
31
+ * @package SalesforceSoapClient
32
+ */
33
+ /**
34
+ * SforceEnterpriseClient class.
35
+ *
36
+ * @package SalesforceSoapClient
37
+ */
38
+ class SforceEnterpriseClient extends SforceBaseClient {
39
+ const ENTERPRISE_NAMESPACE = 'urn:enterprise.soap.sforce.com';
40
+
41
+ function SforceEnterpriseClient() {
42
+ $this->namespace = self::ENTERPRISE_NAMESPACE;
43
+ }
44
+
45
+ /**
46
+ * Adds one or more new individual objects to your organization's data.
47
+ * @param array $sObjects Array of one or more sObjects (up to 200) to create.
48
+ * @param AssignmentRuleHeader $assignment_header is optional. Defaults to NULL
49
+ * @param MruHeader $mru_header is optional. Defaults to NULL
50
+ * @return SaveResult
51
+ */
52
+ public function create($sObjects, $type) {
53
+ foreach ($sObjects as &$sobject) {
54
+ $sobject = new SoapVar($sobject, SOAP_ENC_OBJECT, $type, $this->namespace);
55
+ }
56
+ $arg = $sObjects;
57
+
58
+ return parent::_create(new SoapParam($arg, "sObjects"));
59
+ }
60
+
61
+ /**
62
+ * Updates one or more new individual objects to your organization's data.
63
+ * @param array sObjects Array of sObjects
64
+ * @param AssignmentRuleHeader $assignment_header is optional. Defaults to NULL
65
+ * @param MruHeader $mru_header is optional. Defaults to NULL
66
+ * @return UpdateResult
67
+ */
68
+ public function update($sObjects, $type, $assignment_header = NULL, $mru_header = NULL) {
69
+ foreach ($sObjects as &$sObject) {
70
+ $sObject = new SoapVar($sObject, SOAP_ENC_OBJECT, $type, $this->namespace);
71
+ }
72
+ $arg->sObjects = $sObjects;
73
+ return parent::_update($arg);
74
+ }
75
+
76
+ /**
77
+ * Creates new objects and updates existing objects; uses a custom field to
78
+ * determine the presence of existing objects. In most cases, we recommend
79
+ * that you use upsert instead of create because upsert is idempotent.
80
+ * Available in the API version 7.0 and later.
81
+ *
82
+ * @param string $ext_Id External Id
83
+ * @param array $sObjects Array of sObjects
84
+ * @return UpsertResult
85
+ */
86
+ public function upsert($ext_Id, $sObjects) {
87
+ $arg = new stdClass;
88
+ $arg->externalIDFieldName = new SoapVar($ext_Id, XSD_STRING, 'string', 'http://www.w3.org/2001/XMLSchema');
89
+ foreach ($sObjects as &$sObject) {