Official_Ongage_Integration_For_Magento - Version 1.0.2

Version Notes

* Ongage Magento Extension
* Version 1.0.2
* Released May, 2014
* Credits: Jaldip Upadhyay, Krunal Patel, Pratik Patel, Dharmesh Vasani
* Terms of Service: http://www.ongage.com/legal-terms/terms-of-service
* Copyright (C) Ongage

Download this release

Release Info

Developer Stepin team
Extension Official_Ongage_Integration_For_Magento
Version 1.0.2
Comparing to
See all releases


Version 1.0.2

Files changed (23) hide show
  1. app/code/community/Ongage/MageGage/Block/Adminhtml/System/Config/Form/Field/Mapfields.php +26 -0
  2. app/code/community/Ongage/MageGage/Block/Adminhtml/System/Config/OauthWizard.php +51 -0
  3. app/code/community/Ongage/MageGage/Block/Form/Register.php +29 -0
  4. app/code/community/Ongage/MageGage/Helper/Data.php +53 -0
  5. app/code/community/Ongage/MageGage/Model/Api.php +159 -0
  6. app/code/community/Ongage/MageGage/Model/Gage.php +12 -0
  7. app/code/community/Ongage/MageGage/Model/Observer.php +318 -0
  8. app/code/community/Ongage/MageGage/Model/System/Config/Source/List.php +53 -0
  9. app/code/community/Ongage/MageGage/controllers/AccountController.php +211 -0
  10. app/code/community/Ongage/MageGage/controllers/Adminhtml/OngagemailController.php +17 -0
  11. app/code/community/Ongage/MageGage/controllers/SubscriberController.php +32 -0
  12. app/code/community/Ongage/MageGage/etc/adminhtml.xml +30 -0
  13. app/code/community/Ongage/MageGage/etc/config.xml +178 -0
  14. app/code/community/Ongage/MageGage/etc/system.xml +129 -0
  15. app/design/adminhtml/default/default/layout/magegage.xml +16 -0
  16. app/design/adminhtml/default/default/template/magegage/system/config/oauth_wizard.phtml +19 -0
  17. app/design/frontend/base/default/layout/magegage.xml +16 -0
  18. app/design/frontend/base/default/template/magegage/form.phtml +85 -0
  19. app/etc/modules/Ongage_MageGage.xml +17 -0
  20. media/ongagefile/samplefile.csv +3 -0
  21. package.xml +28 -0
  22. skin/adminhtml/default/default/ongage/ongage.css +35 -0
  23. skin/adminhtml/default/default/ongage/ongage.jpg +0 -0
app/code/community/Ongage/MageGage/Block/Adminhtml/System/Config/Form/Field/Mapfields.php ADDED
@@ -0,0 +1,26 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * Ongage Magento Plug-in
4
+ * Version 1.0
5
+ * Released March, 2014
6
+ * Credits: Jaldip Upadhyay, Krunal Patel, Pratik Patel, Dharmesh Vasani
7
+ * Terms of Service: http://www.ongage.com/legal-terms/terms-of-service
8
+ * Copyright (C) Ongage
9
+ */
10
+ class Ongage_MageGage_Block_Adminhtml_System_Config_Form_Field_Mapfields extends Mage_Adminhtml_Block_System_Config_Form_Field_Array_Abstract
11
+ {
12
+ public function __construct()
13
+ {
14
+ $this->addColumn('magento', array(
15
+ 'label' => Mage::helper('gage')->__('Customer'),
16
+ 'style' => 'width:120px',
17
+ ));
18
+ $this->addColumn('ongage', array(
19
+ 'label' => Mage::helper('gage')->__('OnGage'),
20
+ 'style' => 'width:120px',
21
+ ));
22
+ $this->_addAfter = false;
23
+ $this->_addButtonLabel = Mage::helper('gage')->__('Add Custom Field');
24
+ parent::__construct();
25
+ }
26
+ }
app/code/community/Ongage/MageGage/Block/Adminhtml/System/Config/OauthWizard.php ADDED
@@ -0,0 +1,51 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * Ongage Magento Plug-in
4
+ * Version 1.0
5
+ * Released March, 2014
6
+ * Credits: Jaldip Upadhyay, Krunal Patel, Pratik Patel, Dharmesh Vasani
7
+ * Terms of Service: http://www.ongage.com/legal-terms/terms-of-service
8
+ * Copyright (C) Ongage
9
+ */
10
+ class Ongage_MageGage_Block_Adminhtml_System_Config_OauthWizard extends Mage_Adminhtml_Block_System_Config_Form_Field {
11
+
12
+ /**
13
+ * Set template to itself
14
+ */
15
+ protected function _prepareLayout() {
16
+ parent::_prepareLayout();
17
+ if (!$this->getTemplate()) {
18
+ $this->setTemplate('magegage/system/config/oauth_wizard.phtml');
19
+ }
20
+ return $this;
21
+ }
22
+
23
+ /**
24
+ * Unset some non-related element parameters
25
+ *
26
+ * @param Varien_Data_Form_Element_Abstract $element
27
+ * @return string
28
+ */
29
+ public function render(Varien_Data_Form_Element_Abstract $element) {
30
+ $element->unsScope()->unsCanUseWebsiteValue()->unsCanUseDefaultValue();
31
+ return parent::render($element);
32
+ }
33
+
34
+ /**
35
+ * Get the button and scripts contents
36
+ *
37
+ * @param Varien_Data_Form_Element_Abstract $element
38
+ * @return string
39
+ */
40
+ protected function _getElementHtml(Varien_Data_Form_Element_Abstract $element) {
41
+ $originalData = $element->getOriginalData();
42
+ $sCsvFilePath = Mage::getBaseUrl('media');
43
+ $sFilePath=$sCsvFilePath.'ongagefile/samplefile.csv';
44
+ $label = $originalData['button_label'];
45
+ $this->addData(array(
46
+ 'button_label' => $this->helper('gage')->__($label),
47
+ 'button_url' => $sFilePath,
48
+ ));
49
+ return $this->_toHtml();
50
+ }
51
+ }
app/code/community/Ongage/MageGage/Block/Form/Register.php ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * Ongage Magento Plug-in
4
+ * Version 1.0
5
+ * Released March, 2014
6
+ * Credits: Jaldip Upadhyay, Krunal Patel, Pratik Patel, Dharmesh Vasani
7
+ * Terms of Service: http://www.ongage.com/legal-terms/terms-of-service
8
+ * Copyright (C) Ongage
9
+ */
10
+ class Ongage_MageGage_Block_Form_Register extends Mage_Customer_Block_Form_Register
11
+ {
12
+ /**
13
+ * Newsletter module availability
14
+ *
15
+ * @return boolean
16
+ */
17
+ public function isNewsletterEnabled()
18
+ {
19
+ $aConfigration = Mage::helper('gage')->getUserDetails();
20
+ if($aConfigration['letter_subscription'])
21
+ {
22
+ return false;
23
+ }
24
+ else
25
+ {
26
+ return Mage::helper('core')->isModuleOutputEnabled('Mage_Newsletter');
27
+ }
28
+ }
29
+ }
app/code/community/Ongage/MageGage/Helper/Data.php ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * Ongage Magento Plug-in
4
+ * Version 1.0
5
+ * Released March, 2014
6
+ * Credits: Jaldip Upadhyay, Krunal Patel, Pratik Patel, Dharmesh Vasani
7
+ * Terms of Service: http://www.ongage.com/legal-terms/terms-of-service
8
+ * Copyright (C) Ongage
9
+ */
10
+ class Ongage_MageGage_Helper_Data extends Mage_Core_Helper_Abstract
11
+ {
12
+ public function getUserDetails($sStore = null)
13
+ {
14
+ $aUserDetail['ENABLED'] = $this->config('ENABLED');
15
+ if($aUserDetail['ENABLED']==1)
16
+ {
17
+ if(is_null($sStore))
18
+ {
19
+ $aUserDetail['user_name'] = $this->config('user_name');
20
+ $aUserDetail['password'] = $this->config('password');
21
+ $aUserDetail['account_id'] = $this->config('account_id');
22
+ $aUserDetail['letter_subscription'] = $this->config('letter_subscription');
23
+ $aUserDetail['attach_list'] = $this->config('attach_list');
24
+ $aUserDetail['ENABLED'] = $this->config('ENABLED');
25
+ $aUserDetail['map_fields'] = $this->config('map_fields');
26
+ $aUserDetail['uploadcsv_file'] = $this->config('uploadcsv_file');
27
+
28
+ }
29
+ return $aUserDetail;
30
+ }
31
+ }
32
+ /**
33
+ * Get module configuration value
34
+ *
35
+ * @param string $value
36
+ * @param string $sStore
37
+ * @return mixed Configuration setting
38
+ */
39
+ public function config($value, $sStore = null)
40
+ {
41
+ $sStore = is_null($sStore) ? Mage::app()->getStore() : $sStore;
42
+ $oConfigscope = Mage::app()->getRequest()->getParam('store');
43
+ if( $oConfigscope && ($oConfigscope !== 'undefined') )
44
+ {
45
+ $sStore = $oConfigscope;
46
+ }
47
+ return Mage::getStoreConfig("gage/general/$value", $sStore);
48
+ }
49
+ public function canCheckoutSubscribe()
50
+ {
51
+ return $this->config('letter_subscription');
52
+ }
53
+ }
app/code/community/Ongage/MageGage/Model/Api.php ADDED
@@ -0,0 +1,159 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * Ongage Magento Plug-in
4
+ * Version 1.0
5
+ * Released March, 2014
6
+ * Credits: Jaldip Upadhyay, Krunal Patel, Pratik Patel, Dharmesh Vasani
7
+ * Terms of Service: http://www.ongage.com/legal-terms/terms-of-service
8
+ * Copyright (C) Ongage
9
+ */
10
+ class Ongage_MageGage_Model_Api
11
+ {
12
+ var $apiUrl;
13
+ var $sUserName;
14
+ var $sPassword;
15
+ var $sAccountId;
16
+ var $sListId;
17
+ /**
18
+ * Initialize API
19
+ *
20
+ * @param array $args
21
+ * @return void
22
+ */
23
+ public function __construct($args)
24
+ {
25
+ if(!isset($args['userDetails']))
26
+ {
27
+ $args['userDetails'] = Mage::helper('gage')->getUserDetails();
28
+ }
29
+ $this->sUserName = $args['userDetails']['user_name'];
30
+ $this->sPassword = $args['userDetails']['password'];
31
+ $this->sAccountId = $args['userDetails']['account_id'];
32
+ $this->sListId = $args['userDetails']['attach_list'];
33
+
34
+ define('USERNAME', $this->sUserName);
35
+ define('PASSWORD', $this->sPassword);
36
+ define('ACCOUNT', $this->sAccountId);
37
+ define('LIST_ID', $this->sListId);
38
+ define('URL', 'http://connect.ongage.net/api/');
39
+ }
40
+ public function getLists($aRequest = array(),$sMethod = 'get')
41
+ {
42
+ return $this->post_request($aRequest, URL.'lists', $sMethod);
43
+ }
44
+ public function post_request($request, $link, $method)
45
+ {
46
+ $sListId = $this->sListId;
47
+ $request['list_id'] = $sListId;
48
+
49
+ $request_json = json_encode($request);
50
+ $c = curl_init();
51
+ $link = $link;
52
+ switch($method)
53
+ {
54
+ case "post":
55
+ curl_setopt($c, CURLOPT_URL, $link);
56
+ curl_setopt($c, CURLOPT_POST, TRUE);
57
+ curl_setopt($c, CURLOPT_POSTFIELDS,$request_json );
58
+ break;
59
+ case "put":
60
+ curl_setopt($c, CURLOPT_URL, $link);
61
+ curl_setopt($c, CURLOPT_PUT, TRUE);
62
+ $temp = tmpfile();
63
+ fwrite($temp, $request_json);
64
+ fseek($temp, 0);
65
+ curl_setopt($c, CURLOPT_INFILE, $temp);
66
+ curl_setopt($c, CURLOPT_INFILESIZE, strlen($request_json));
67
+ break;
68
+ case "get":
69
+ if ( ! empty($request))
70
+ {
71
+ $link .= '?' . http_build_query($request);
72
+ }
73
+ curl_setopt($c, CURLOPT_URL, $link);
74
+ break;
75
+ }
76
+ $headers = array(
77
+ 'X_USERNAME: ' . USERNAME,
78
+ 'X_PASSWORD: ' . PASSWORD,
79
+ 'X_ACCOUNT_CODE: ' . ACCOUNT,
80
+ );
81
+
82
+ curl_setopt($c, CURLOPT_HTTPHEADER, array_merge(array(
83
+ // Overcoming POST size larger than 1k wierd behaviour
84
+ // @link http://www.php.net/manual/en/function.curl-setopt.php#82418
85
+ 'Expect:'), $headers
86
+ ));
87
+
88
+ curl_setopt($c, CURLOPT_RETURNTRANSFER, 1);
89
+ $response_raw = curl_exec($c);
90
+
91
+ if ($method == 'put')
92
+ {
93
+ fclose($temp); // this removes the file
94
+ }
95
+
96
+ $errno = curl_errno ( $c );
97
+ $result = json_decode($response_raw);
98
+
99
+ return $result;
100
+ }
101
+ //below code for when register user then ongage entry
102
+ public function get_regisrationdata($aRegistrationData)
103
+ {
104
+ $aConfigration = Mage::helper('gage')->getUserDetails();
105
+ $aRequest = array();
106
+ $aRequest['fields'] = $aRegistrationData;
107
+ $nNewsSubscribe = isset($aRegistrationData['is_subscribed'])?$aRegistrationData['is_subscribed']:'';
108
+ if($aConfigration['letter_subscription'] || $nNewsSubscribe )
109
+ {
110
+ return $this->post_request($aRequest, URL.'contacts', 'post');
111
+ }
112
+ }
113
+ //below code for checkout time register in ongage
114
+ public function getguest_regisrationdata($aCustomer_Info)
115
+ {
116
+ $aRequest = array();
117
+ $_customerId = Mage::getSingleton('customer/session')->getCustomerId();
118
+ $customer = Mage::getSingleton('customer/session')->getCustomer();
119
+ $lastOrderId = Mage::getSingleton('checkout/session')->getLastOrderId();
120
+ $order = Mage::getSingleton('sales/order');
121
+ $order->load($lastOrderId);
122
+ $_totalData = $order->getData();
123
+ $_details = $customer->getData();
124
+
125
+ $sEmail = $_totalData['customer_email'];
126
+ $aCustomer_Info['email'] = $sEmail;
127
+ return $this->post_request($aCustomer_Info, URL.'contacts', 'post');
128
+ }
129
+ //below code for homepage subscriber guest user
130
+ public function guest_subscription($sGuestUserEmailId)
131
+ {
132
+ $aRequest = array();
133
+ $aRequest['email'] = $sGuestUserEmailId;
134
+ return $this->post_request($aRequest, URL.'contacts', 'post');
135
+ }
136
+ //below code for delete subscriber user in magento as well as ongage
137
+ public function delete_subscriber($sEmailId)
138
+ {
139
+ $aRequest = array();
140
+ $aRequest['change_to'] = 'remove';
141
+ $aRequest['emails'] = array($sEmailId);
142
+ return $this->post_request($aRequest, URL.'contacts/remove', 'post');
143
+ }
144
+ //below code for unsubscribe user subscriber user in magento as well as ongage
145
+ public function unsubscribe_subscriber($sEmailId)
146
+ {
147
+ $aRequest = array();
148
+ $aRequest['change_to'] = 'unsubscribe';
149
+ $aRequest['emails'] = array($sEmailId);
150
+ return $this->post_request($aRequest, URL.'contacts/remove', 'post');
151
+ }
152
+ //below code for when first time load list at that time entry in ongage
153
+ public function firsttime_ongageentry($aAllEmailId)
154
+ {
155
+ $aRequest = array();
156
+ $aRequest['email'] = $aAllEmailId;
157
+ return $this->post_request($aRequest, URL.'contacts', 'post');
158
+ }
159
+ }
app/code/community/Ongage/MageGage/Model/Gage.php ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * Ongage Magento Plug-in
4
+ * Version 1.0
5
+ * Released March, 2014
6
+ * Credits: Jaldip Upadhyay, Krunal Patel, Pratik Patel, Dharmesh Vasani
7
+ * Terms of Service: http://www.ongage.com/legal-terms/terms-of-service
8
+ * Copyright (C) Ongage
9
+ */
10
+ class Ongage_MageGage_Model_Gage
11
+ {
12
+ }
app/code/community/Ongage/MageGage/Model/Observer.php ADDED
@@ -0,0 +1,318 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * Ongage Magento Plug-in
4
+ * Version 1.0
5
+ * Released March, 2014
6
+ * Credits: Jaldip Upadhyay, Krunal Patel, Pratik Patel, Dharmesh Vasani
7
+ * Terms of Service: http://www.ongage.com/legal-terms/terms-of-service
8
+ * Copyright (C) Ongage
9
+ */
10
+ class Ongage_MageGage_Model_Observer
11
+ {
12
+ /**
13
+ * Handle save of System -> Configuration, section <gage>
14
+ *
15
+ * @param Varien_Event_Observer $observer
16
+ * @return void|Varien_Event_Observer
17
+ */
18
+ public function saveConfig(Varien_Event_Observer $observer)
19
+ {
20
+ $aConfigration = Mage::helper('gage')->getUserDetails();
21
+ $sCsvFilePath = Mage::getBaseUrl('media');
22
+ //below code is for upload csv
23
+ $aEmail = array();
24
+ if (($sHandle = fopen($sCsvFilePath.'ongage/'.$aConfigration['uploadcsv_file'], "r")) !== FALSE)
25
+ {
26
+ while (($sFileData = fgetcsv($sHandle, 1000, ",")) !== FALSE)
27
+ {
28
+ $nNumber = count($sFileData);
29
+ for ($nCountRecord=0; $nCountRecord < $nNumber; $nCountRecord++)
30
+ {
31
+ if($sFileData[0] != 'email' && $nCountRecord == 0)
32
+ {
33
+ array_push($aEmail,$sFileData[0]);
34
+ Mage::getModel('newsletter/subscriber')->setImportMode(true)->subscribe($sFileData[0]);
35
+ $subscriber = Mage::getModel('newsletter/subscriber')->loadByEmail($sFileData[0]);
36
+ if($sFileData[1] == 'Unsubscribed' )
37
+ {
38
+ $subscriber->setStatus(Mage_Newsletter_Model_Subscriber::STATUS_UNSUBSCRIBED);
39
+ }
40
+ else
41
+ {
42
+ $subscriber->setStatus(Mage_Newsletter_Model_Subscriber::STATUS_SUBSCRIBED);
43
+ }
44
+ $subscriber->save();
45
+ }
46
+ }
47
+ }
48
+ fclose($sHandle);
49
+ }
50
+
51
+ //below code is for get records from "newsletter_subscriber" table
52
+ $oModelSubscriber = Mage::getModel('newsletter/subscriber');
53
+ $oCollectionRecord = $oModelSubscriber->getCollection();
54
+ $aId_Email = array();
55
+ foreach($oCollectionRecord as $oSubscriberDetails)
56
+ {
57
+ $aData = $oSubscriberDetails->getData();
58
+ $aId_Email[$aData['subscriber_id']] = $aData['subscriber_email'];
59
+ }
60
+ if (!empty($aEmail))
61
+ {
62
+ foreach($aId_Email as $nIdRecord => $sEmail)
63
+ {
64
+ if(in_array($sEmail, $aEmail))
65
+ {
66
+ '<br/>';
67
+ }
68
+ else
69
+ {
70
+ $oModelSubscriber = Mage::getModel('newsletter/subscriber');
71
+ try
72
+ {
73
+ $oModelSubscriber->setId($nIdRecord)->delete();
74
+ }
75
+ catch (Exception $e)
76
+ {
77
+ echo $e->getMessage();
78
+ }
79
+ }
80
+ }
81
+ }
82
+ //Below code for when first time load list all magento subscriber attach in Ongage
83
+ $aConfigration = Mage::helper('gage')->getUserDetails();
84
+ $sListValue=$aConfigration['attach_list'];
85
+ if($sListValue != "")
86
+ {
87
+ foreach($oCollectionRecord as $oSubscriberDetails)
88
+ {
89
+ $aData = $oSubscriberDetails->getData();
90
+ $aAllEmailId = $aData['subscriber_email'];
91
+ $oApiObject = new Ongage_MageGage_Model_Api();
92
+ $oApiObject->firsttime_ongageentry($aAllEmailId);
93
+ }
94
+ }
95
+ //below code for delete import file
96
+ $relativefilepath = './media/ongage/';
97
+ $absolutefilepath = realpath($relativefilepath);
98
+ $sAddFullPath=$absolutefilepath.'/*';
99
+ $sFilesPath = glob($sAddFullPath);
100
+ foreach($sFilesPath as $sFilename)
101
+ {
102
+ if(is_file($sFilename))
103
+ unlink($sFilename);
104
+ }
105
+ $sScope = is_null($observer->getEvent()->getStore()) ? Mage::app()->getDefaultStoreView()->getCode(): $observer->getEvent()->getStore();
106
+ $sPost = Mage::app()->getRequest()->getPost();
107
+ $sRequest = Mage::app()->getRequest();
108
+ }
109
+ //This function is call when customer registration form is submited
110
+ public function customerAddInOngage(Varien_Event_Observer $p_oObserver)
111
+ {
112
+ $aConfigration = Mage::helper('gage')->getUserDetails();
113
+ $aMappingField = $this->getMergeMaps(1);
114
+ $aCustomer_Info = array();
115
+ foreach($aMappingField as $aMappingList)
116
+ {
117
+ $sMagentoField = $aMappingList['magento'];
118
+ $sOngageField = $aMappingList['ongage'];
119
+ if($sOngageField && $sMagentoField)
120
+ {
121
+ $sKey = $sOngageField;
122
+ switch ($sMagentoField)
123
+ {
124
+ case 'firstname':
125
+ $aCustomer_Info[$sKey] = $_POST['firstname'];
126
+ break;
127
+
128
+ case 'lastname':
129
+ $aCustomer_Info[$sKey] = $_POST['lastname'];
130
+ break;
131
+ default:
132
+ break;
133
+ }
134
+ }
135
+ }
136
+ $aCustomer_Info['is_subscribed'] = $_POST['is_subscribed'];
137
+ $aCustomer_Info['email'] = $_POST['email'];
138
+ $aCustomer_Info['list_id'] = $aConfigration['attach_list'];
139
+
140
+ $aConfigration = Mage::helper('gage')->getUserDetails();
141
+ if($aConfigration['letter_subscription'] == 1)
142
+ {
143
+ $aCustomer_Info['is_subscribed'] = '1';
144
+ Mage::getModel('newsletter/subscriber')->subscribe($_POST['email']);
145
+ }
146
+ $oApiObject = new Ongage_MageGage_Model_Api();
147
+ $oApiObject->get_regisrationdata($aCustomer_Info);
148
+ }
149
+ //This function is call when customer checkout form is submited and Make entry in Magento table or Ongage table
150
+ public function registerCheckoutSubscribe(Varien_Event_Observer $observer)
151
+ {
152
+ $nCheckBoxValue=Mage::app()->getRequest()->getPost();
153
+ if($nCheckBoxValue['ongage_subscribe'] == 1)
154
+ {
155
+ $_customerId = Mage::getSingleton('customer/session')->getCustomerId();
156
+ $oCustomer = Mage::getSingleton('customer/session')->getCustomer();
157
+ $nLastOrderId = Mage::getSingleton('checkout/session')->getLastOrderId();
158
+ $oOrder = Mage::getSingleton('sales/order');
159
+ $oOrder->load($nLastOrderId);
160
+ $_totalData = $oOrder->getData();
161
+ $_details = $oCustomer->getData();
162
+
163
+ $sSession = Mage::getSingleton('core/session');
164
+ $sCustomerSession = Mage::getSingleton('customer/session');
165
+
166
+ $aCustomer_Info = array();
167
+ $orderId = (int)current($observer->getEvent()->getOrderIds());
168
+ $oOrder = Mage::getModel('sales/order')->load($nLastOrderId);
169
+
170
+ $oCustomer = new Varien_Object;
171
+ $oCustomer->setId('guest' . time());
172
+ $oCustomer->setEmail($oOrder->getBillingAddress()->getEmail());
173
+ $oCustomer->setStoreId($oOrder->getStoreId());
174
+ $oCustomer->setFirstname($oOrder->getBillingAddress()->getFirstname());
175
+ $oCustomer->setLastname($oOrder->getBillingAddress()->getLastname());
176
+ $oCustomer->setPrimaryBillingAddress($oOrder->getBillingAddress());
177
+ $oCustomer->setPrimaryShippingAddress($oOrder->getShippingAddress());
178
+
179
+ Mage::register('og_guest_customer', $oCustomer, TRUE);
180
+ $aMappingField = $this->getMergeMaps($oCustomer->getStoreId());
181
+ foreach($aMappingField as $sMapList)
182
+ {
183
+ $sMagetoField = $sMapList['magento'];
184
+ $sOngageField = $sMapList['ongage'];
185
+ if($sOngageField && $sMagetoField)
186
+ {
187
+ $sKey = $sOngageField;
188
+ $sAddress = $oCustomer->{'getPrimary'.ucfirst('shipping').'Address'}();
189
+ switch ($sMagetoField)
190
+ {
191
+ case 'firstname':
192
+ $sFirstName = (string)$oCustomer->getData(strtolower($sMagetoField));
193
+ $aCustomer_Info[$sKey] = $sFirstName;
194
+ break;
195
+ case 'lastname':
196
+ $sLastName = (string)$oCustomer->getData(strtolower($sMagetoField));
197
+ $aCustomer_Info[$sKey] = $sLastName;
198
+ break;
199
+ case 'billing_address':
200
+ case 'shipping_address':
201
+ $sAddressField = explode('_', $sMagetoField);
202
+ if(!$sAddress)
203
+ {
204
+ if($oCustomer->{'getDefault' .ucfirst($sAddressField[0])}())
205
+ {
206
+ $sAddress = Mage::getModel('customer/address')->load($oCustomer->{'getDefault' .ucfirst($sAddressField[0])}());
207
+ }
208
+ }
209
+ if($sAddress)
210
+ {
211
+ $aCustomer_Info[$sKey] = $sAddress->getStreet(1).",".$sAddress->getStreet(2);
212
+ }
213
+ break;
214
+ case 'telephone':
215
+ $aCustomer_Info[$sKey] = $sAddress->getTelephone();
216
+ break;
217
+ case 'country':
218
+ $aCustomer_Info[$sKey] = $sAddress->getCountryId();
219
+ break;
220
+ case 'company':
221
+ $aCustomer_Info[$sKey] = $sAddress->getCompany();
222
+ break;
223
+ case 'date_of_purchase':
224
+ $nLast_Order = Mage::getResourceModel('sales/order_collection')
225
+ ->addFieldToFilter('customer_email', $oCustomer->getEmail())
226
+ ->addFieldToFilter('state', array('in' => Mage::getSingleton('sales/order_config')->getVisibleOnFrontStates()))
227
+ ->setOrder('created_at', 'desc')
228
+ ->getFirstItem();
229
+ if ( $nLast_Order->getId() )
230
+ {
231
+ $aCustomer_Info[$sKey] = Mage::helper('core')->formatDate($nLast_Order->getCreatedAt());
232
+ }
233
+ break;
234
+ case 'group_id':
235
+ $nGroup_Id = (int)$oCustomer->getData(strtolower($sMagetoField));
236
+ $sCustomerGroup = Mage::helper('customer')->getGroups()->toOptionHash();
237
+ if($nGroup_Id == 0)
238
+ {
239
+ $aCustomer_Info[$sKey] = 'NOT LOGGED IN';
240
+ }
241
+ else
242
+ {
243
+ $aCustomer_Info[$sKey] = $sCustomerGroup[$nGroup_Id];
244
+ }
245
+ break;
246
+ case 'ee_customer_balance':
247
+ $aCustomer_Info[$sKey] = '';
248
+ if($this->isEnterprise() && $oCustomer->getId())
249
+ {
250
+ $_customer = Mage::getModel('customer/customer')->load($oCustomer->getId());
251
+ if($_customer->getId())
252
+ {
253
+ if (Mage::app()->getStore()->isAdmin())
254
+ {
255
+ $websiteId = is_null($websiteId) ? Mage::app()->getStore()->getWebsiteId() : $websiteId;
256
+ }
257
+ $balance = Mage::getModel('enterprise_customerbalance/balance')
258
+ ->setWebsiteId($websiteId)
259
+ ->setCustomerId($_customer->getId())
260
+ ->loadByCustomer();
261
+ $aCustomer_Info[$sKey] = $balance->getAmount();
262
+ }
263
+ }
264
+ break;
265
+ default:
266
+ break;
267
+ }
268
+ }
269
+ }
270
+ $sEmail = (string) $_totalData['customer_email'];
271
+ Mage::getModel('newsletter/subscriber')->setImportMode(true)->subscribe($sEmail);
272
+ $oApiObjectCheckout = new Ongage_MageGage_Model_Api();
273
+ $oApiObjectCheckout->getguest_regisrationdata($aCustomer_Info);
274
+ }
275
+ }
276
+ /**
277
+ * Get config setting <map_field>
278
+ *
279
+ * @return array|FALSE
280
+ */
281
+ public function getMergeMaps($nStoreId)
282
+ {
283
+ return unserialize( Mage::helper('gage')->config('map_fields', $nStoreId) );
284
+ }
285
+ /**
286
+ * Check if Magento is EE
287
+ *
288
+ * @return bool
289
+ */
290
+ public function isEnterprise()
291
+ {
292
+ return is_object(Mage::getConfig()->getNode('global/models/enterprise_enterprise'));
293
+ }
294
+ //below code for delete subscriber user in magento as well as ongage
295
+ public function subscriberDeletion(Varien_Event_Observer $observer)
296
+ {
297
+ $subscriber = $observer->getEvent()->getSubscriber();
298
+ $subscriber->setImportMode(TRUE);
299
+ $sEmailId = $subscriber['subscriber_email'];
300
+ $oApiObjectCheckout = new Ongage_MageGage_Model_Api();
301
+ $oApiObjectCheckout->delete_subscriber($sEmailId);
302
+ }
303
+ //below code for unsubscribe user subscriber user in magento as well as ongage
304
+ public function handleSubscriber(Varien_Event_Observer $observer)
305
+ {
306
+ if($_POST['form_key']=='')
307
+ {
308
+ }
309
+ else
310
+ {
311
+ $subscriber = $observer->getEvent()->getSubscriber();
312
+ $subscriber->setImportMode(TRUE);
313
+ $sEmailId = $subscriber['subscriber_email'];
314
+ $oApiObjectCheckout = new Ongage_MageGage_Model_Api();
315
+ $oApiObjectCheckout->unsubscribe_subscriber($sEmailId);
316
+ }
317
+ }
318
+ }
app/code/community/Ongage/MageGage/Model/System/Config/Source/List.php ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * Ongage Magento Plug-in
4
+ * Version 1.0
5
+ * Released March, 2014
6
+ * Credits: Jaldip Upadhyay, Krunal Patel, Pratik Patel, Dharmesh Vasani
7
+ * Terms of Service: http://www.ongage.com/legal-terms/terms-of-service
8
+ * Copyright (C) Ongage
9
+ */
10
+ class Ongage_MageGage_Model_System_Config_Source_List
11
+ {
12
+ /**
13
+ * Lists for API key will be stored here
14
+ *
15
+ * @access protected
16
+ * @var array Email lists for given API key
17
+ */
18
+ protected $_lists = null;
19
+ /**
20
+ * Load lists and store on class property
21
+ *
22
+ * @return void
23
+ */
24
+ public function __construct()
25
+ {
26
+ if( is_null($this->_lists) )
27
+ {
28
+ $this->_lists = Mage::getSingleton('gage/api')
29
+ ->getLists();
30
+ }
31
+ }
32
+ /**
33
+ * Options getter
34
+ *
35
+ * @return array
36
+ */
37
+ public function toOptionArray()
38
+ {
39
+ $aLists = array();
40
+ if(!empty($this->_lists))
41
+ {
42
+ foreach($this->_lists->payload as $aListData)
43
+ {
44
+ $aLists []= array('value' => $aListData->id, 'label' => $aListData->name . ' (' . $aListData->last_active_count. ' members )');
45
+ }
46
+ }
47
+ else
48
+ {
49
+ $aLists []= array('value' => '', 'label' => 'No List Avalable');
50
+ }
51
+ return $aLists;
52
+ }
53
+ }
app/code/community/Ongage/MageGage/controllers/AccountController.php ADDED
@@ -0,0 +1,211 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ include_once('Mage/Customer/controllers/AccountController.php');
3
+ /*
4
+ * Ongage Magento Plug-in
5
+ * Version 1.0
6
+ * Released March, 2014
7
+ * Credits: Jaldip Upadhyay, Krunal Patel, Pratik Patel, Dharmesh Vasani
8
+ * Terms of Service: http://www.ongage.com/legal-terms/terms-of-service
9
+ * Copyright (C) Ongage
10
+ */
11
+ class Ongage_MageGage_AccountController extends Mage_Core_Controller_Front_Action
12
+ {
13
+ /**
14
+ * Action list where need check enabled cookie
15
+ *
16
+ * @var array
17
+ */
18
+ protected $_cookieCheckActions = array('loginPost', 'createpost');
19
+
20
+ /**
21
+ * Retrieve customer session model object
22
+ *
23
+ * @return Mage_Customer_Model_Session
24
+ */
25
+ protected function _getSession()
26
+ {
27
+ return Mage::getSingleton('customer/session');
28
+ }
29
+
30
+ /**
31
+ * Action predispatch
32
+ *
33
+ * Check customer authentication for some actions
34
+ */
35
+ public function preDispatch()
36
+ {
37
+ parent::preDispatch();
38
+ if (!$this->getRequest()->isDispatched())
39
+ {
40
+ return;
41
+ }
42
+ $action = $this->getRequest()->getActionName();
43
+ $aOpenActions = array(
44
+ 'create',
45
+ 'login',
46
+ 'logoutsuccess',
47
+ 'forgotpassword',
48
+ 'forgotpasswordpost',
49
+ 'resetpassword',
50
+ 'resetpasswordpost',
51
+ 'confirm',
52
+ 'confirmation'
53
+ );
54
+ $sPattern = '/^(' . implode('|', $aOpenActions) . ')/i';
55
+
56
+ if (!preg_match($sPattern, $action))
57
+ {
58
+ if (!$this->_getSession()->authenticate($this))
59
+ {
60
+ $this->setFlag('', 'no-dispatch', true);
61
+ }
62
+ }
63
+ else
64
+ {
65
+ $this->_getSession()->setNoReferer(true);
66
+ }
67
+ }
68
+ /**
69
+ * Action postdispatch
70
+ *
71
+ * Remove No-referer flag from customer session after each action
72
+ */
73
+ public function postDispatch()
74
+ {
75
+ parent::postDispatch();
76
+ $this->_getSession()->unsNoReferer(false);
77
+ }
78
+ /**
79
+ * Default customer account page
80
+ */
81
+ public function indexAction()
82
+ {
83
+ $this->loadLayout();
84
+ $this->_initLayoutMessages('customer/session');
85
+ $this->_initLayoutMessages('catalog/session');
86
+
87
+ $this->getLayout()->getBlock('content')->append(
88
+ $this->getLayout()->createBlock('customer/account_dashboard')
89
+ );
90
+ $this->getLayout()->getBlock('head')->setTitle($this->__('My Account'));
91
+ $this->renderLayout();
92
+ }
93
+ /**
94
+ * Create customer account action
95
+ */
96
+ public function createPostAction()
97
+ {
98
+ /** @var $sSession Mage_Customer_Model_Session */
99
+
100
+ $aConfigration = Mage::helper('gage')->getUserDetails();
101
+ if($aConfigration['letter_subscription'])
102
+ {
103
+ $_POST['is_subscribed']=1;
104
+ $sSession = $this->_getSession();
105
+ if ($sSession->isLoggedIn())
106
+ {
107
+ $this->_redirect('*/*/');
108
+ return;
109
+ }
110
+ $sSession->setEscapeMessages(true); // prevent XSS injection in user input
111
+ if (!$this->getRequest()->isPost())
112
+ {
113
+ $sErrUrl = $this->_getUrl('*/*/create', array('_secure' => true));
114
+ $this->_redirectError($sErrUrl);
115
+ return;
116
+ }
117
+ $aCustomer = $this->_getCustomer();
118
+ try
119
+ {
120
+ $aErrors = $this->_getCustomerErrors($aCustomer);
121
+ if (empty($aErrors))
122
+ {
123
+ $aCustomer->save();
124
+ $this->_dispatchRegisterSuccess($aCustomer);
125
+ $this->_successProcessRegistration($aCustomer);
126
+ return;
127
+ }
128
+ else
129
+ {
130
+ $this->_addSessionError($aErrors);
131
+ }
132
+ }
133
+ catch (Mage_Core_Exception $e)
134
+ {
135
+ $sSession->setCustomerFormData($this->getRequest()->getPost());
136
+ if ($e->getCode() === Mage_Customer_Model_Customer::EXCEPTION_EMAIL_EXISTS)
137
+ {
138
+ $sUrl = $this->_getUrl('customer/account/forgotpassword');
139
+ $sMessage = $this->__('There is already an account with this email address. If you are sure that it is your email address, <a href="%s">click here</a> to get your password and access your account.', $sUrl);
140
+ $sSession->setEscapeMessages(false);
141
+ }
142
+ else
143
+ {
144
+ $sMessage = $e->getMessage();
145
+ }
146
+ $sSession->addError($sMessage);
147
+ }
148
+ catch (Exception $e)
149
+ {
150
+ $sSession->setCustomerFormData($this->getRequest()->getPost())
151
+ ->addException($e, $this->__('Cannot save the customer.'));
152
+ }
153
+ $sErrUrl = $this->_getUrl('*/*/create', array('_secure' => true));
154
+ $this->_redirectError($sErrUrl);
155
+ }
156
+ else
157
+ {
158
+ $sSession = $this->_getSession();
159
+ if ($sSession->isLoggedIn())
160
+ {
161
+ $this->_redirect('*/*/');
162
+ return;
163
+ }
164
+ $sSession->setEscapeMessages(true); // prevent XSS injection in user input
165
+ if (!$this->getRequest()->isPost())
166
+ {
167
+ $sErrUrl = $this->_getUrl('*/*/create', array('_secure' => true));
168
+ $this->_redirectError($sErrUrl);
169
+ return;
170
+ }
171
+ $aCustomer = $this->_getCustomer();
172
+ try
173
+ {
174
+ $aErrors = $this->_getCustomerErrors($aCustomer);
175
+ if (empty($aErrors))
176
+ {
177
+ $aCustomer->save();
178
+ $this->_dispatchRegisterSuccess($aCustomer);
179
+ $this->_successProcessRegistration($aCustomer);
180
+ return;
181
+ }
182
+ else
183
+ {
184
+ $this->_addSessionError($aErrors);
185
+ }
186
+ }
187
+ catch (Mage_Core_Exception $e)
188
+ {
189
+ $sSession->setCustomerFormData($this->getRequest()->getPost());
190
+ if ($e->getCode() === Mage_Customer_Model_Customer::EXCEPTION_EMAIL_EXISTS)
191
+ {
192
+ $sUrl = $this->_getUrl('customer/account/forgotpassword');
193
+ $sMessage = $this->__('There is already an account with this email address. If you are sure that it is your email address, <a href="%s">click here</a> to get your password and access your account.', $sUrl);
194
+ $sSession->setEscapeMessages(false);
195
+ }
196
+ else
197
+ {
198
+ $sMessage = $e->getMessage();
199
+ }
200
+ $sSession->addError($sMessage);
201
+ }
202
+ catch (Exception $e)
203
+ {
204
+ $sSession->setCustomerFormData($this->getRequest()->getPost())
205
+ ->addException($e, $this->__('Cannot save the customer.'));
206
+ }
207
+ $sErrUrl = $this->_getUrl('*/*/create', array('_secure' => true));
208
+ $this->_redirectError($sErrUrl);
209
+ }
210
+ }
211
+ }
app/code/community/Ongage/MageGage/controllers/Adminhtml/OngagemailController.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * Ongage Magento Plug-in
4
+ * Version 1.0
5
+ * Released March, 2014
6
+ * Credits: Jaldip Upadhyay, Krunal Patel, Pratik Patel, Dharmesh Vasani
7
+ * Terms of Service: http://www.ongage.com/legal-terms/terms-of-service
8
+ * Copyright (C) Ongage
9
+ */
10
+ class Ongage_MageGage_Adminhtml_OngagemailController extends Mage_Adminhtml_Controller_Action
11
+ {
12
+ public function indexAction()
13
+ {
14
+ $this->loadLayout();
15
+ $this->renderLayout();
16
+ }
17
+ }
app/code/community/Ongage/MageGage/controllers/SubscriberController.php ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ include_once('Mage/Newsletter/controllers/SubscriberController.php');
3
+ /*
4
+ * Ongage Magento Plug-in
5
+ * Version 1.0
6
+ * Released March, 2014
7
+ * Credits: Jaldip Upadhyay, Krunal Patel, Pratik Patel, Dharmesh Vasani
8
+ * Terms of Service: http://www.ongage.com/legal-terms/terms-of-service
9
+ * Copyright (C) Ongage
10
+ */
11
+ class Ongage_MageGage_SubscriberController extends Mage_Core_Controller_Front_Action
12
+ {
13
+ /**
14
+ * New subscription action
15
+ */
16
+ public function newAction()
17
+ {
18
+ if ($this->getRequest()->isPost() && $this->getRequest()->getPost('email'))
19
+ {
20
+ $session = Mage::getSingleton('core/session');
21
+ $customerSession = Mage::getSingleton('customer/session');
22
+ $email = (string) $this->getRequest()->getPost('email');
23
+ Mage::getModel('newsletter/subscriber')->subscribe($email);
24
+ }
25
+ $this->_redirectReferer();
26
+ //below code for guest user subscriber in home page
27
+ $sGuestUserEmailId = $this->getRequest()->getPost('email');
28
+ $oApiObject = new Ongage_MageGage_Model_Api();
29
+ $oApiObject->guest_subscription($sGuestUserEmailId);
30
+ }
31
+
32
+ }
app/code/community/Ongage/MageGage/etc/adminhtml.xml ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ * Ongage Magento Plug-in
4
+ * Version 1.0
5
+ * Released March, 2014
6
+ * Credits: Jaldip Upadhyay, Krunal Patel, Pratik Patel, Dharmesh Vasani
7
+ * Terms of Service: http://www.ongage.com/legal-terms/terms-of-service
8
+ * Copyright (C) Ongage
9
+ -->
10
+ <config>
11
+ <acl>
12
+ <resources>
13
+ <admin>
14
+ <children>
15
+ <system>
16
+ <children>
17
+ <config>
18
+ <children>
19
+ <gage translate="title" module="gage">
20
+ <title>Ongage Configuration</title>
21
+ </gage>
22
+ </children>
23
+ </config>
24
+ </children>
25
+ </system>
26
+ </children>
27
+ </admin>
28
+ </resources>
29
+ </acl>
30
+ </config>
app/code/community/Ongage/MageGage/etc/config.xml ADDED
@@ -0,0 +1,178 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ * Ongage Magento Plug-in
4
+ * Version 1.0
5
+ * Released March, 2014
6
+ * Credits: Jaldip Upadhyay, Krunal Patel, Pratik Patel, Dharmesh Vasani
7
+ * Terms of Service: http://www.ongage.com/legal-terms/terms-of-service
8
+ * Copyright (C) Ongage
9
+ -->
10
+ <config>
11
+ <modules>
12
+ <Ongage_MageGage>
13
+ <version>1.0.0</version>
14
+ </Ongage_MageGage>
15
+ </modules>
16
+ <global>
17
+ <models>
18
+ <gage>
19
+ <class>Ongage_MageGage_Model</class>
20
+ </gage>
21
+ </models>
22
+ <resources>
23
+ <gage_setup>
24
+ <setup>
25
+ <module>Ongage_MageGage</module>
26
+ </setup>
27
+ <connection>
28
+ <use>core_setup</use>
29
+ </connection>
30
+ </gage_setup>
31
+ <gage_write>
32
+ <connection>
33
+ <use>core_write</use>
34
+ </connection>
35
+ </gage_write>
36
+ <gage_read>
37
+ <connection>
38
+ <use>core_read</use>
39
+ </connection>
40
+ </gage_read>
41
+ </resources>
42
+ <blocks>
43
+ <gage>
44
+ <class>Ongage_MageGage_Block</class>
45
+ </gage>
46
+ <customer>
47
+ <rewrite>
48
+ <form_register>Ongage_MageGage_Block_Form_Register</form_register>
49
+ </rewrite>
50
+ </customer>
51
+ </blocks>
52
+ <helpers>
53
+ <gage>
54
+ <class>Ongage_MageGage_Helper</class>
55
+ </gage>
56
+ </helpers>
57
+ <!--=========================================================================-->
58
+ <!-- Below code for Subscriber delete her record on table -->
59
+ <!--=========================================================================-->
60
+ <events>
61
+ <newsletter_subscriber_save_before>
62
+ <observers>
63
+ <ongage_magegage_observer>
64
+ <class>gage/observer</class>
65
+ <method>handleSubscriber</method>
66
+ </ongage_magegage_observer>
67
+ </observers>
68
+ </newsletter_subscriber_save_before>
69
+ <newsletter_subscriber_delete_after>
70
+ <observers>
71
+ <ongage_magegage_delete_observer>
72
+ <class>gage/observer</class>
73
+ <method>subscriberDeletion</method>
74
+ </ongage_magegage_delete_observer>
75
+ </observers>
76
+ </newsletter_subscriber_delete_after>
77
+ </events>
78
+ <!--=========================================================================-->
79
+ </global>
80
+ <admin>
81
+ <routers>
82
+ <adminhtml>
83
+ <args>
84
+ <modules>
85
+ <gage after="Mage_Adminhtml">Ongage_MageGage</gage>
86
+ </modules>
87
+ </args>
88
+ </adminhtml>
89
+ </routers>
90
+ </admin>
91
+ <adminhtml>
92
+ <layout>
93
+ <updates>
94
+ <ongage_magegage>
95
+ <file>magegage.xml</file>
96
+ </ongage_magegage>
97
+ </updates>
98
+ </layout>
99
+ <events>
100
+ <admin_system_config_changed_section_gage>
101
+ <observers>
102
+ <gage_save_config>
103
+ <class>gage/observer</class>
104
+ <method>saveConfig</method>
105
+ </gage_save_config>
106
+ </observers>
107
+ </admin_system_config_changed_section_gage>
108
+ </events>
109
+ </adminhtml>
110
+ <frontend>
111
+ <layout>
112
+ <updates>
113
+ <ongage_magegage>
114
+ <file>magegage.xml</file>
115
+ </ongage_magegage>
116
+ </updates>
117
+ </layout>
118
+ <events>
119
+ <!--=========================================================================-->
120
+ <!-- Below code for Registration submit button -->
121
+ <!--=========================================================================-->
122
+ <customer_save_commit_after>
123
+ <observers>
124
+ <ongage_magegage>
125
+ <class>gage/observer</class>
126
+ <method>customerAddInOngage</method>
127
+ </ongage_magegage>
128
+ </observers>
129
+ </customer_save_commit_after>
130
+ <!--=========================================================================-->
131
+
132
+ <!--=========================================================================-->
133
+ <!-- Below code for place order button -->
134
+ <!--=========================================================================-->
135
+ <controller_action_predispatch_onestepcheckout_index_index>
136
+ <observers>
137
+ <ongage_magegage_checkout>
138
+ <class>gage/observer</class>
139
+ <method>registerCheckoutSubscribe</method>
140
+ </ongage_magegage_checkout>
141
+ </observers>
142
+ </controller_action_predispatch_onestepcheckout_index_index>
143
+ <controller_action_postdispatch_checkout_onepage_saveOrder>
144
+ <observers>
145
+ <ongage_magegage_checkout>
146
+ <class>gage/observer</class>
147
+ <method>registerCheckoutSubscribe</method>
148
+ </ongage_magegage_checkout>
149
+ </observers>
150
+ </controller_action_postdispatch_checkout_onepage_saveOrder>
151
+ <!--=========================================================================-->
152
+ </events>
153
+ <!--=========================================================================-->
154
+ <!-- Below code for Controller file call -->
155
+ <!--=========================================================================-->
156
+ <routers>
157
+ <newsletter>
158
+ <args>
159
+ <modules>
160
+ <Ongage_MageGage before="Mage_Newsletter">Ongage_MageGage</Ongage_MageGage>
161
+ </modules>
162
+ </args>
163
+ </newsletter>
164
+ </routers>
165
+ <!--=========================================================================-->
166
+ </frontend>
167
+ <!--=========================================================================-->
168
+ <!-- Below code for Customer field mapping -->
169
+ <!--=========================================================================-->
170
+ <default>
171
+ <gage>
172
+ <general>
173
+ <map_fields><![CDATA[a:15:{i:0;a:2:{s:7:"magento";s:9:"firstname";s:6:"ongage";s:10:"first_name";}i:1;a:2:{s:7:"magento";s:8:"lastname";s:6:"ongage";s:9:"last_name";}i:2;a:2:{s:7:"magento";s:15:"billing_address";s:6:"ongage";s:7:"address";}i:3;a:2:{s:7:"magento";s:16:"shipping_address";s:6:"ongage";s:7:"address";}i:4;a:2:{s:7:"magento";s:6:"gender";s:6:"ongage";s:6:"gender";}i:5;a:2:{s:7:"magento";s:3:"dob";s:6:"ongage";s:3:"dob";}i:6;a:2:{s:7:"magento";s:6:"prefix";s:6:"ongage";s:6:"prefix";}i:7;a:2:{s:7:"magento";s:9:"telephone";s:6:"ongage";s:5:"phone";}i:8;a:2:{s:7:"magento";s:7:"company";s:6:"ongage";s:7:"company";}i:9;a:2:{s:7:"magento";s:8:"store_id";s:6:"ongage";s:7:"storeid";}i:10;a:2:{s:7:"magento";s:10:"website_id";s:6:"ongage";s:9:"websiteid";}i:11;a:2:{s:7:"magento";s:16:"date_of_purchase";s:6:"ongage";s:15:"dateof_purchase";}i:12;a:2:{s:7:"magento";s:19:"ee_customer_balance";s:6:"ongage";s:18:"ee_customerbalance";}i:13;a:2:{s:7:"magento";s:8:"group_id";s:6:"ongage";s:7:"groupid";}i:14;a:2:{s:7:"magento";s:7:"country";s:6:"ongage";s:7:"country";}}]]></map_fields>
174
+ </general>
175
+ </gage>
176
+ </default>
177
+ <!--=========================================================================-->
178
+ </config>
app/code/community/Ongage/MageGage/etc/system.xml ADDED
@@ -0,0 +1,129 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ * Ongage Magento Plug-in
4
+ * Version 1.0
5
+ * Released March, 2014
6
+ * Credits: Jaldip Upadhyay, Krunal Patel, Pratik Patel, Dharmesh Vasani
7
+ * Terms of Service: http://www.ongage.com/legal-terms/terms-of-service
8
+ * Copyright (C) Ongage
9
+ -->
10
+ <config>
11
+ <tabs>
12
+ <gage translate="label" module="gage">
13
+ <label>Ongage Plugin</label>
14
+ <sort_order>400</sort_order>
15
+ </gage>
16
+ </tabs>
17
+ <sections>
18
+ <gage translate="label" module="gage">
19
+ <class>ongage-section</class>
20
+ <header_css>ongage-header</header_css>
21
+ <label>Ongage Configuration</label>
22
+ <tab>gage</tab>
23
+ <sort_order>100</sort_order>
24
+ <show_in_default>1</show_in_default>
25
+ <show_in_website>1</show_in_website>
26
+ <show_in_store>1</show_in_store>
27
+ <groups>
28
+ <general translate="label">
29
+ <label>Ongage Configuration</label>
30
+ <frontend_type>text</frontend_type>
31
+ <sort_order>0</sort_order>
32
+ <show_in_default>1</show_in_default>
33
+ <show_in_website>1</show_in_website>
34
+ <show_in_store>1</show_in_store>
35
+ <fields>
36
+ <ENABLED translate="label comment">
37
+ <label>Enabled</label>
38
+ <comment>Enable Ongage module</comment>
39
+ <frontend_type>select</frontend_type>
40
+ <source_model>adminhtml/system_config_source_yesno</source_model>
41
+ <sort_order>10</sort_order>
42
+ <show_in_default>1</show_in_default>
43
+ <show_in_website>1</show_in_website>
44
+ <show_in_store>1</show_in_store>
45
+ </ENABLED>
46
+ <user_name tranlate="label comment">
47
+ <label>User Name</label>
48
+ <comment>Enter Ongage Username</comment>
49
+ <front_type>text</front_type>
50
+ <sort_order>20</sort_order>
51
+ <show_in_default>1</show_in_default>
52
+ <show_in_website>1</show_in_website>
53
+ <show_in_store>1</show_in_store>
54
+ </user_name>
55
+ <password tranlate="label comment">
56
+ <label>Password</label>
57
+ <comment>Enter Ongage Password</comment>
58
+ <front_type>text</front_type>
59
+ <sort_order>30</sort_order>
60
+ <show_in_default>1</show_in_default>
61
+ <show_in_website>1</show_in_website>
62
+ <show_in_store>1</show_in_store>
63
+ </password>
64
+ <account_id tranlate="label comment">
65
+ <label>Account Id</label>
66
+ <comment>Enter Ongage Acount Id</comment>
67
+ <front_type>text</front_type>
68
+ <sort_order>40</sort_order>
69
+ <show_in_default>1</show_in_default>
70
+ <show_in_website>1</show_in_website>
71
+ <show_in_store>1</show_in_store>
72
+ </account_id>
73
+ <attach_list translate="label comment">
74
+ <label>Attach Lists</label>
75
+ <frontend_type>select</frontend_type>
76
+ <source_model>gage/system_config_source_list</source_model>
77
+ <sort_order>50</sort_order>
78
+ <show_in_default>1</show_in_default>
79
+ <show_in_website>0</show_in_website>
80
+ <show_in_store>1</show_in_store>
81
+ <can_be_empty>1</can_be_empty>
82
+ <comment>All Lists that has been created on Ongage account. if no list is listed here, then create a list in Ongage account which you want to sync with Magento. </comment>
83
+ </attach_list>
84
+ <letter_subscription translate="label comment">
85
+ <label>Force For Newsletter Subscription</label>
86
+ <comment></comment>
87
+ <frontend_type>select</frontend_type>
88
+ <source_model>adminhtml/system_config_source_yesno</source_model>
89
+ <sort_order>60</sort_order>
90
+ <show_in_default>1</show_in_default>
91
+ <show_in_website>1</show_in_website>
92
+ <show_in_store>1</show_in_store>
93
+ </letter_subscription>
94
+ <map_fields translate="label">
95
+ <label>Customer Fields Mapping</label>
96
+ <frontend_model>gage/adminhtml_system_config_form_field_mapfields</frontend_model>
97
+ <backend_model>adminhtml/system_config_backend_serialized_array</backend_model>
98
+ <sort_order>70</sort_order>
99
+ <show_in_default>1</show_in_default>
100
+ <show_in_website>0</show_in_website>
101
+ <show_in_store>1</show_in_store>
102
+ </map_fields>
103
+ <uploadcsv_file translate="label comment">
104
+ <label>Upload .csv File</label>
105
+ <comment>Selcet .csv file and click [Save Config] button</comment>
106
+ <frontend_type>file</frontend_type>
107
+ <backend_model>adminhtml/system_config_backend_file</backend_model>
108
+ <upload_dir>media/ongage</upload_dir>
109
+ <sort_order>80</sort_order>
110
+ <show_in_default>1</show_in_default>
111
+ <show_in_website>1</show_in_website>
112
+ <show_in_store>1</show_in_store>
113
+ </uploadcsv_file>
114
+ <oauth_wizard translate="button_label comment">
115
+ <label>Download Sample File</label>
116
+ <comment>Click above button to download sample .csv file</comment>
117
+ <button_label>Sample Download</button_label>
118
+ <frontend_model>gage/adminhtml_system_config_oauthWizard</frontend_model>
119
+ <sort_order>100</sort_order>
120
+ <show_in_default>1</show_in_default>
121
+ <show_in_website>0</show_in_website>
122
+ <show_in_store>1</show_in_store>
123
+ </oauth_wizard>
124
+ </fields>
125
+ </general>
126
+ </groups>
127
+ </gage>
128
+ </sections>
129
+ </config>
app/design/adminhtml/default/default/layout/magegage.xml ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ * Ongage Magento Plug-in
4
+ * Version 1.0
5
+ * Released March, 2014
6
+ * Credits: Jaldip Upadhyay, Krunal Patel, Pratik Patel, Dharmesh Vasani
7
+ * Terms of Service: http://www.ongage.com/legal-terms/terms-of-service
8
+ * Copyright (C) Ongage
9
+ -->
10
+ <layout>
11
+ <adminhtml_system_config_edit>
12
+ <reference name="head">
13
+ <action method="addCss"><stylesheet>ongage/ongage.css</stylesheet></action>
14
+ </reference>
15
+ </adminhtml_system_config_edit>
16
+ </layout>
app/design/adminhtml/default/default/template/magegage/system/config/oauth_wizard.phtml ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * Ongage Magento Plug-in
4
+ * Version 1.0
5
+ * Released March, 2014
6
+ * Credits: Jaldip Upadhyay, Krunal Patel, Pratik Patel, Dharmesh Vasani
7
+ * Terms of Service: http://www.ongage.com/legal-terms/terms-of-service
8
+ * Copyright (C) Ongage
9
+ */
10
+ ?>
11
+ <table>
12
+ <tr>
13
+ <td>
14
+ <button style="" onclick="javascript:window.open('<?php echo $this->getButtonUrl()?>', 'apiwizard'); return false;" class="scalable" type="button" id="none">
15
+ <span><?php echo $this->escapeHtml($this->getButtonLabel()); ?></span>
16
+ </button>
17
+ </td>
18
+ </tr>
19
+ </table>
app/design/frontend/base/default/layout/magegage.xml ADDED
@@ -0,0 +1,16 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <!--
3
+ * Ongage Magento Plug-in
4
+ * Version 1.0
5
+ * Released March, 2014
6
+ * Credits: Jaldip Upadhyay, Krunal Patel, Pratik Patel, Dharmesh Vasani
7
+ * Terms of Service: http://www.ongage.com/legal-terms/terms-of-service
8
+ * Copyright (C) Ongage
9
+ -->
10
+ <layout version="0.1.0">
11
+ <checkout_onepage_review>
12
+ <reference name="checkout.onepage.review.info.items.after">
13
+ <block type="core/template" name="gage.subscribe" template="magegage/form.phtml"></block>
14
+ </reference>
15
+ </checkout_onepage_review>
16
+ </layout>
app/design/frontend/base/default/template/magegage/form.phtml ADDED
@@ -0,0 +1,85 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /*
3
+ * Ongage Magento Plug-in
4
+ * Version 1.0
5
+ * Released March, 2014
6
+ * Credits: Jaldip Upadhyay, Krunal Patel, Pratik Patel, Dharmesh Vasani
7
+ * Terms of Service: http://www.ongage.com/legal-terms/terms-of-service
8
+ * Copyright (C) Ongage
9
+ */
10
+ ?>
11
+ <script type="text/javascript">
12
+ subscribeLetter = function (element)
13
+ {
14
+ if( $('ongage-subscribe') )
15
+ {
16
+ $('ongage-subscribe').remove();
17
+ }
18
+ if(element.checked)
19
+ {
20
+ var sInputCheckboxValue = new Element('input', { name: "ongage_subscribe", id: "ongage-subscribe", value: "1", type: "hidden" });
21
+ var sListValue = new Element('input', { name: element.readAttribute('name'), id: "subscribe", value: element.getValue(), type: "hidden" });
22
+ try
23
+ {
24
+ Element.insert(Form.findFirstElement(payment.form), sInputCheckboxValue);
25
+ Element.insert(Form.findFirstElement(payment.form), sListValue);
26
+ }
27
+ catch(notelement)
28
+ {
29
+ $("co-payment-form").insert(sInputCheckboxValue);
30
+ $("co-payment-form").insert(sListValue);
31
+ }
32
+ }
33
+ }
34
+
35
+ subscribeLetterForce = function ()
36
+ {
37
+ var element=document.getElementById('lettersubscription');
38
+ if( $('ongage-subscribe') )
39
+ {
40
+ $('ongage-subscribe').remove();
41
+ }
42
+ if(element.checked)
43
+ {
44
+ var sInputCheckboxValue = new Element('input', { name: "ongage_subscribe", id: "ongage-subscribe", value: "1", type: "hidden" });
45
+ var sListValue = new Element('input', { name: element.readAttribute('name'), id: "subscribe", value: element.getValue(), type: "hidden" });
46
+ try
47
+ {
48
+ Element.insert(Form.findFirstElement(payment.form), sInputCheckboxValue);
49
+ Element.insert(Form.findFirstElement(payment.form), sListValue);
50
+ }
51
+ catch(notelement)
52
+ {
53
+ $("co-payment-form").insert(sInputCheckboxValue);
54
+ $("co-payment-form").insert(sListValue);
55
+ }
56
+ }
57
+ }
58
+ </script>
59
+ <?php
60
+ $aConfigration = Mage::helper('gage')->getUserDetails();
61
+ if($aConfigration['letter_subscription'])
62
+ {
63
+ echo "<input type='hidden' name='is_letter' id='lettersubscription' class='checkbox' value='1' checked />";
64
+ ?>
65
+ <script type="text/javascript">
66
+ subscribeLetterForce();
67
+ </script>
68
+ <?php
69
+ }
70
+ else
71
+ {
72
+ ?>
73
+ <div class="fieldset">
74
+ <ul class="form-list">
75
+ <li class="control">
76
+ <input type="checkbox" name="is_letter" onchange="subscribeLetter(this)"; id="lettersubscription" value="1" title="<?php echo $this->__('Ongage Newsletter Subscription') ?>" class="checkbox" />
77
+ <label for="subscription">
78
+ <?php echo $this->__('Ongage Newsletter Subscription') ?>
79
+ </label>
80
+ </li>
81
+ </ul>
82
+ </div>
83
+ <?php
84
+ }
85
+ ?>
app/etc/modules/Ongage_MageGage.xml ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version = "1.0"?>
2
+ <!--
3
+ * Ongage Magento Plug-in
4
+ * Version 1.0
5
+ * Released March, 2014
6
+ * Credits: Jaldip Upadhyay, Krunal Patel, Pratik Patel, Dharmesh Vasani
7
+ * Terms of Service: http://www.ongage.com/legal-terms/terms-of-service
8
+ * Copyright (C) Ongage
9
+ -->
10
+ <config>
11
+ <modules>
12
+ <Ongage_MageGage>
13
+ <active>true</active>
14
+ <codePool>community</codePool>
15
+ </Ongage_MageGage>
16
+ </modules>
17
+ </config>
media/ongagefile/samplefile.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
1
+ email,ongage_status
2
+ email1@example.com,Active
3
+ email2@example.com,Unsubscribed
package.xml ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <package>
3
+ <name>Official_Ongage_Integration_For_Magento</name>
4
+ <version>1.0.2</version>
5
+ <stability>stable</stability>
6
+ <license uri="https://connect.ongage.net">OSL v3.0</license>
7
+ <channel>community</channel>
8
+ <extends/>
9
+ <summary>Send Emails from Magento using Ongage&#x2019;s revolutionary multi-ESP and multi-SMTP email marketing platform.</summary>
10
+ <description> * Ongage Magento Extension&#xD;
11
+ * Version 1.0.2&#xD;
12
+ * Released May, 2014&#xD;
13
+ * Credits: Jaldip Upadhyay, Krunal Patel, Pratik Patel, Dharmesh Vasani&#xD;
14
+ * Terms of Service: http://www.ongage.com/legal-terms/terms-of-service&#xD;
15
+ * Copyright (C) Ongage</description>
16
+ <notes> * Ongage Magento Extension&#xD;
17
+ * Version 1.0.2&#xD;
18
+ * Released May, 2014&#xD;
19
+ * Credits: Jaldip Upadhyay, Krunal Patel, Pratik Patel, Dharmesh Vasani&#xD;
20
+ * Terms of Service: http://www.ongage.com/legal-terms/terms-of-service&#xD;
21
+ * Copyright (C) Ongage</notes>
22
+ <authors><author><name>Stepin</name><user>stepinsolutions</user><email>hello@stepinsolutions.in</email></author><author><name>Ongage</name><user>OngageMagento</user><email>noam.r@ongage.com</email></author></authors>
23
+ <date>2014-06-12</date>
24
+ <time>12:40:59</time>
25
+ <contents><target name="mageetc"><dir name="modules"><file name="Ongage_MageGage.xml" hash="5ecdfa992fa305fd8887f7a575a37018"/></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="magegage.xml" hash="295346ac4d0b6e642a8956e3621e21ec"/></dir><dir name="template"><dir name="magegage"><file name="form.phtml" hash="d750cfc7fc84491756a00ea9dbb1687b"/></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="layout"><file name="magegage.xml" hash="94a34de81ea4153326ac849e0bbf9697"/></dir><dir name="template"><dir name="magegage"><dir name="system"><dir name="config"><file name="oauth_wizard.phtml" hash="d312e04ea02d43c847dff20ffca2f223"/></dir></dir></dir></dir></dir></dir></dir></target><target name="magecommunity"><dir name="Ongage"><dir name="MageGage"><dir name="Block"><dir name="Form"><file name="Register.php" hash="2393144b39f5870516e189adab7fa49a"/></dir><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Form"><dir name="Field"><file name="Mapfields.php" hash="36750db50f6f87f08054d1340e48e300"/></dir></dir><file name="OauthWizard.php" hash="296e5ced72c9eacb9fbb7bbcc6d6cc66"/></dir></dir></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="OngagemailController.php" hash="6989421ba128e79e44ec672c706ac89c"/></dir><file name="AccountController.php" hash="74ea4cce2ef943ba8e060df9e8901479"/><file name="SubscriberController.php" hash="4ca6edc4697e141cb2eb6df84690e687"/></dir><dir name="etc"><file name="adminhtml.xml" hash="96d1828639542d4be39b40ab14c94d36"/><file name="config.xml" hash="925974c3dbbfdfe053354e512b4a7228"/><file name="system.xml" hash="24c48626dab3661c0fb1bde0d0ed1c2e"/></dir><dir name="Helper"><file name="Data.php" hash="08cd14dfb859bb5f0a777c6aa2682ee0"/></dir><dir name="Model"><file name="Api.php" hash="5f68df7c9a37c09cf5cbe8a063a192e0"/><file name="Gage.php" hash="907e02ca0d2cf9739d6930c681423fd5"/><file name="Observer.php" hash="7e381bdf90545a0007bcff84e26b3572"/><dir name="System"><dir name="Config"><dir name="Source"><file name="List.php" hash="f5ca53d36984bad9f967d09d9a013552"/></dir></dir></dir></dir></dir></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="ongage"><file name="ongage.css" hash="622f0efa3837289842a864adda513081"/><file name="ongage.jpg" hash="7eb304565e7dd974f6fd90a2c9a19acd"/></dir></dir></dir></dir></target><target name="magemedia"><dir name="ongagefile"><file name="samplefile.csv" hash="cb90cf47524c0323d00790a6d57ac9b9"/></dir></target></contents>
26
+ <compatible/>
27
+ <dependencies><required><php><min>5.1.0</min><max>6.0.0</max></php><package><name>Mage_Core_Modules</name><channel>community</channel><min>1.6.0.0</min><max>1.7</max></package><extension><name>gd</name><min>2.0.28</min><max>3.0</max></extension></required></dependencies>
28
+ </package>
skin/adminhtml/default/default/ongage/ongage.css ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ul.tabs a.ongage-section:hover
2
+ {
3
+ background-color:#D8E6E6; background-image:url(images/tabs_link_over_bg.gif);
4
+ }
5
+ ul.tabs a.ongage-section
6
+ {
7
+ border-bottom: 1px; border-bottom-style: dotted;
8
+ }
9
+ ul.tabs a.ongage-section:hover
10
+ {
11
+ border-bottom: 1px; border-bottom-style: dotted;
12
+ }
13
+ ul.tabs a.ongage-section span,
14
+ ul.tabs a.ongage-section:hover span
15
+ {
16
+ background:url(ongage.jpg) no-repeat 17px 3px; overflow:hidden; padding:0; padding-left:43px; width:150px; height:24px; line-height:25px;
17
+ }
18
+ ul.tabs a.ongage-section.active, ul.tabs a.ongage-section.active:hover
19
+ {
20
+ background-color: white;border-bottom-color: #8BA5A5;
21
+ }
22
+
23
+ small
24
+ {
25
+ font-size: 9px;
26
+ }
27
+ h3.ongage-header
28
+ {
29
+ background: url("ongage.jpg") no-repeat scroll 0 0 transparent;
30
+ height: 22px;
31
+ overflow: hidden;
32
+ padding: 0;
33
+ text-indent: -9999px;
34
+ width: 120px;
35
+ }
skin/adminhtml/default/default/ongage/ongage.jpg ADDED
Binary file