Mage_Laposta_Connect - Version 1.0.17

Version Notes

- Use basic date formatting for compatibility with magento-1.5.0.1

Download this release

Release Info

Developer Merten van Gerven
Extension Mage_Laposta_Connect
Version 1.0.17
Comparing to
See all releases


Code changes from version 1.0.16 to 1.0.17

app/code/community/Laposta/Connect/Helper/Subscribe.php CHANGED
@@ -26,7 +26,7 @@ class Laposta_Connect_Helper_Subscribe extends Mage_Core_Helper_Abstract
26
  $subscriber->setListId($listId);
27
  $subscriber->setCustomerId($customerId);
28
  $subscriber->setNewsletterSubscriberId($nativeSubscriberId);
29
- $subscriber->setUpdatedTime($subscriberCollection->formatDate(time()));
30
  $subscriber->save();
31
  }
32
  }
26
  $subscriber->setListId($listId);
27
  $subscriber->setCustomerId($customerId);
28
  $subscriber->setNewsletterSubscriberId($nativeSubscriberId);
29
+ $subscriber->setUpdatedTime(date('Y-m-d H:i:s'));
30
  $subscriber->save();
31
  }
32
  }
app/code/community/Laposta/Connect/Helper/Sync.php CHANGED
@@ -83,21 +83,27 @@ class Laposta_Connect_Helper_Sync extends Mage_Core_Helper_Abstract
83
  if (empty($listName)) {
84
  $listName = '(Empty List Name - Magento)';
85
 
 
 
86
  $list->setListName($listName);
87
  }
88
 
89
  if (empty($lapostaId)) {
 
 
90
  $lapostaId = $laposta->addGroup($listName);
91
 
92
  $list->setLapostaId($lapostaId);
93
  }
94
  else {
 
 
95
  $laposta->updateGroup($lapostaId, $listName);
96
  }
97
 
98
  $this->resetWebhooks($list);
99
 
100
- $list->setSyncTime(Mage::getModel('lapostaconnect/list')->getCollection()->formatDate(time()));
101
 
102
  return $this;
103
  }
@@ -216,7 +222,7 @@ class Laposta_Connect_Helper_Sync extends Mage_Core_Helper_Abstract
216
  }
217
 
218
  $field->setLapostaTag(trim($lapostaFieldTag, '{}'));
219
- $field->setSyncTime($fields->formatDate(time()));
220
  }
221
 
222
  $remove = array_diff($current, $synchronised);
@@ -383,7 +389,7 @@ class Laposta_Connect_Helper_Sync extends Mage_Core_Helper_Abstract
383
  $laposta->updateContact($lapostaListId, $lapostaMemberId, '', $email, $data, $subscribed);
384
  }
385
 
386
- $subscriber->setSyncTime($subscribers->formatDate(time()));
387
  $subscriber->save();
388
  }
389
 
83
  if (empty($listName)) {
84
  $listName = '(Empty List Name - Magento)';
85
 
86
+ $this->log('Creating new list', $listName);
87
+
88
  $list->setListName($listName);
89
  }
90
 
91
  if (empty($lapostaId)) {
92
+ $this->log("Creating new list", $listName);
93
+
94
  $lapostaId = $laposta->addGroup($listName);
95
 
96
  $list->setLapostaId($lapostaId);
97
  }
98
  else {
99
+ $this->log('Updating list', array('listName' => $listName, 'lapostId' => $lapostaId));
100
+
101
  $laposta->updateGroup($lapostaId, $listName);
102
  }
103
 
104
  $this->resetWebhooks($list);
105
 
106
+ $list->setSyncTime(date('Y-m-d H:i:s'));
107
 
108
  return $this;
109
  }
222
  }
223
 
224
  $field->setLapostaTag(trim($lapostaFieldTag, '{}'));
225
+ $field->setSyncTime(date('Y-m-d H:i:s'));
226
  }
227
 
228
  $remove = array_diff($current, $synchronised);
389
  $laposta->updateContact($lapostaListId, $lapostaMemberId, '', $email, $data, $subscribed);
390
  }
391
 
392
+ $subscriber->setSyncTime(date('Y-m-d H:i:s'));
393
  $subscriber->save();
394
  }
395
 
app/code/community/Laposta/Connect/Model/Observer.php CHANGED
@@ -38,7 +38,7 @@ class Laposta_Connect_Model_Observer
38
  }
39
 
40
  if ($subscriber->getData('customer_id') != '') {
41
- $subscriber->setUpdatedTime($collection->formatDate(time()));
42
  $subscriber->save();
43
  }
44
  }
@@ -121,7 +121,7 @@ class Laposta_Connect_Model_Observer
121
  $subscriber->setListId($list->getListId());
122
  $subscriber->setCustomerId($customerId);
123
  $subscriber->setNewsletterSubscriberId($nativeSubscriber->getId());
124
- $subscriber->setUpdatedTime($collection->formatDate(time()));
125
  $subscriber->save();
126
  }
127
  }
@@ -170,7 +170,7 @@ class Laposta_Connect_Model_Observer
170
 
171
  $subscriber->setCustomerId('');
172
  $subscriber->setNewsletterSubscriberId('');
173
- $subscriber->setUpdatedTime($collection->formatDate(time()));
174
  $subscriber->save();
175
  }
176
 
@@ -237,7 +237,7 @@ class Laposta_Connect_Model_Observer
237
  }
238
 
239
  $list->setListName($listName);
240
- $list->setUpdatedTime($lists->formatDate(time()));
241
 
242
  /*
243
  * Save here to ensure list_id is generated for new list entries
@@ -295,7 +295,7 @@ class Laposta_Connect_Model_Observer
295
  }
296
 
297
  $field->setFieldRelation($fieldsMap[$fieldName]);
298
- $field->setUpdatedTime($fields->formatDate(time()));
299
  $updated[$fieldName] = $field;
300
  }
301
 
@@ -309,7 +309,7 @@ class Laposta_Connect_Model_Observer
309
  $field->setListId($list->getListId());
310
  $field->setFieldName($fieldName);
311
  $field->setFieldRelation($fieldRelation);
312
- $field->setUpdatedTime($fields->formatDate(time()));
313
 
314
  $fields->addItem($field);
315
  $added[$fieldName] = $field;
38
  }
39
 
40
  if ($subscriber->getData('customer_id') != '') {
41
+ $subscriber->setUpdatedTime(date('Y-m-d H:i:s'));
42
  $subscriber->save();
43
  }
44
  }
121
  $subscriber->setListId($list->getListId());
122
  $subscriber->setCustomerId($customerId);
123
  $subscriber->setNewsletterSubscriberId($nativeSubscriber->getId());
124
+ $subscriber->setUpdatedTime(date('Y-m-d H:i:s'));
125
  $subscriber->save();
126
  }
127
  }
170
 
171
  $subscriber->setCustomerId('');
172
  $subscriber->setNewsletterSubscriberId('');
173
+ $subscriber->setUpdatedTime(date('Y-m-d H:i:s'));
174
  $subscriber->save();
175
  }
176
 
237
  }
238
 
239
  $list->setListName($listName);
240
+ $list->setUpdatedTime(date('Y-m-d H:i:s'));
241
 
242
  /*
243
  * Save here to ensure list_id is generated for new list entries
295
  }
296
 
297
  $field->setFieldRelation($fieldsMap[$fieldName]);
298
+ $field->setUpdatedTime(date('Y-m-d H:i:s'));
299
  $updated[$fieldName] = $field;
300
  }
301
 
309
  $field->setListId($list->getListId());
310
  $field->setFieldName($fieldName);
311
  $field->setFieldRelation($fieldRelation);
312
+ $field->setUpdatedTime(date('Y-m-d H:i:s'));
313
 
314
  $fields->addItem($field);
315
  $added[$fieldName] = $field;
app/code/community/Laposta/Connect/lib/Laposta/Laposta/Request.php CHANGED
@@ -16,7 +16,7 @@ class Laposta_Request
16
 
17
  // check for CURL error
18
  if ($response['error']) {
19
- throw new Laposta_Error('Connection error: ' . $response['error_msg'], $response['status'], $response['body']);
20
  }
21
 
22
  // decode JSON
16
 
17
  // check for CURL error
18
  if ($response['error']) {
19
+ throw new Laposta_Error('Connection error: ' . $response['error_msg'] . '(' . json_encode($data) . ')', $response['status'], $response['body']);
20
  }
21
 
22
  // decode JSON
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Mage_Laposta_Connect</name>
4
- <version>1.0.16</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>
@@ -24,11 +24,12 @@
24
  &#xD;
25
  &lt;h2&gt;Questions&lt;/h2&gt;&#xD;
26
  &lt;p&gt;Please see the FAQ section for questions.&lt;/p&gt;</description>
27
- <notes>- Tested for compatibility with Magento CE 1.9.2.0 and 1.9.2.1</notes>
 
28
  <authors><author><name>Merten van Gerven</name><user>mertenvg</user><email>merten@codeblanche.com</email></author></authors>
29
- <date>2015-09-02</date>
30
- <time>05:09:49</time>
31
- <contents><target name="magecommunity"><dir name="Laposta"><dir name="Connect"><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Form"><dir name="Field"><file name="Mapfields.php" hash="2c88b8a08121c09ba5748f631205a282"/></dir></dir></dir></dir></dir></dir><dir name="Helper"><file name="Customer.php" hash="ef0a5dff85fd77de92a0fefe06fddc60"/><file name="Data.php" hash="8f9e28d0f28f9375385432d227ec1d06"/><file name="Fields.php" hash="51bc0aa26167219b038c04b3babb19af"/><file name="Laposta.php" hash="f763f69df1ecc0ace15706bf5b2581b5"/><file name="Subscribe.php" hash="55f128263acb89cd1d9ab7f36e0dec07"/><file name="Sync.php" hash="97dc4aa48a3b0712274a8bbaad80a6c6"/></dir><dir name="Model"><file name="Cron.php" hash="270a2289a1de1bc678dfc4e6264c095b"/><file name="Field.php" hash="42e1857bdb7d90b31be189e2921ac8fd"/><file name="List.php" hash="99f590a5e5ea3b1a14869c641f49eaed"/><dir name="Mysql4"><dir name="Field"><file name="Collection.php" hash="f8133202231937b1ec14d8cdc39903fe"/></dir><file name="Field.php" hash="c49743d6acd1d4ce2b69aadf22838839"/><dir name="List"><file name="Collection.php" hash="fcc556452fff91bb3e9f933c68fff630"/></dir><file name="List.php" hash="6fef1b36f5d3a5560f83bafe205be614"/><dir name="Subscriber"><file name="Collection.php" hash="05db928eb656f132e4fa16ac740ce3c5"/></dir><file name="Subscriber.php" hash="9f73d39e97d4a19f8d8ad3c19f83a699"/></dir><file name="Observer.php" hash="37b4b7ac5e6914e8c1d1d480dfc986b7"/><file name="Subscriber.php" hash="cba5176e53a7dcab9b9014190f13485d"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="LapostaController.php" hash="cc2a0d62caf63469258042e3b29616e4"/></dir><file name="IndexController.php" hash="7577e30abee9624d59901edb5cecd3e9"/><file name="SubscribeAllController.php" hash="160ac8e5229bb1003d7220116a9b06f7"/><file name="WebhookController.php" hash="0526b02b319fc31cd8c8a3e9789ba358"/></dir><dir name="etc"><file name="adminhtml.xml" hash="71f985837d4b79e3db94c529bfee1e47"/><file name="config.xml" hash="72458847e9370acc79614139a38d502d"/><file name="system.xml" hash="6ee7d5de56541573f16a2caf94dc0418"/></dir><dir name="lib"><dir name="Laposta"><dir name="Laposta"><file name="Error.php" hash="46e746b650bbb5df1ec51f4c530d5f35"/><file name="Field.php" hash="99bc22f997692ff648cb660330552a94"/><file name="List.php" hash="f3b8a716c1d9fd11828f980445dd6d5b"/><file name="Login.php" hash="dc11941e5ca3a404005730843c74e8b3"/><file name="Member.php" hash="cae2b3f6b23ee44e9246a8d33d2ddd46"/><file name="Request.php" hash="66bc536b8b9ce443c3ae0917bdd472ed"/><file name="Resource.php" hash="c2ca77821136b798b526b5dc41659054"/><file name="Util.php" hash="d6760d2d5ddb6f4de6aff185fd432a91"/><file name="Webhook.php" hash="e06b2e711c348af1df425b7faaa5c33e"/></dir><file name="Laposta.php" hash="c99f38dcfef24df38a5a921360356381"/></dir></dir><dir name="sql"><dir name="lapostaconnect_setup"><file name="mysql4-install-1.0.0.php" hash="a1b0319b992b9effe6aa2712031e8701"/><file name="mysql4-install-1.0.12.php" hash="aafda6f1342a9e5ca30c3a87886619f8"/><file name="mysql4-upgrade-1.0.11-1.0.12.php" hash="4cb4083f5bbc27dc719bd0a816a33476"/><file name="mysql4-upgrade-1.0.7-1.0.8.php" hash="a1b0319b992b9effe6aa2712031e8701"/></dir></dir></dir></dir></target><target name="magelocal"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="lapostaconnect.xml" hash="d41d8cd98f00b204e9800998ecf8427e"/></dir></dir></dir></dir></target><target name="magelocale"><dir name="en_US"><file name="Laposta_Connect.csv" hash="4f8f28790602cdd01633c0bb00f70585"/></dir></target><target name="mageetc"><dir name="modules"><file name="Laposta_Connect.xml" hash="ab7675e19ea96d39c5980bee835f0e76"/></dir></target></contents>
32
  <compatible/>
33
  <dependencies><required><php><min>5.3.0</min><max>6.0.0</max></php></required></dependencies>
34
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Mage_Laposta_Connect</name>
4
+ <version>1.0.17</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>
24
  &#xD;
25
  &lt;h2&gt;Questions&lt;/h2&gt;&#xD;
26
  &lt;p&gt;Please see the FAQ section for questions.&lt;/p&gt;</description>
27
+ <notes>- Use basic date formatting for compatibility with magento-1.5.0.1&#xD;
28
+ </notes>
29
  <authors><author><name>Merten van Gerven</name><user>mertenvg</user><email>merten@codeblanche.com</email></author></authors>
30
+ <date>2015-09-03</date>
31
+ <time>10:11:09</time>
32
+ <contents><target name="magecommunity"><dir name="Laposta"><dir name="Connect"><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><dir name="Form"><dir name="Field"><file name="Mapfields.php" hash="2c88b8a08121c09ba5748f631205a282"/></dir></dir></dir></dir></dir></dir><dir name="Helper"><file name="Customer.php" hash="ef0a5dff85fd77de92a0fefe06fddc60"/><file name="Data.php" hash="8f9e28d0f28f9375385432d227ec1d06"/><file name="Fields.php" hash="51bc0aa26167219b038c04b3babb19af"/><file name="Laposta.php" hash="f763f69df1ecc0ace15706bf5b2581b5"/><file name="Subscribe.php" hash="e3238729eddd51d0738d611d2f9448b4"/><file name="Sync.php" hash="9ba91bd86edc85b5d75cc704cb9fec69"/></dir><dir name="Model"><file name="Cron.php" hash="270a2289a1de1bc678dfc4e6264c095b"/><file name="Field.php" hash="42e1857bdb7d90b31be189e2921ac8fd"/><file name="List.php" hash="99f590a5e5ea3b1a14869c641f49eaed"/><dir name="Mysql4"><dir name="Field"><file name="Collection.php" hash="f8133202231937b1ec14d8cdc39903fe"/></dir><file name="Field.php" hash="c49743d6acd1d4ce2b69aadf22838839"/><dir name="List"><file name="Collection.php" hash="fcc556452fff91bb3e9f933c68fff630"/></dir><file name="List.php" hash="6fef1b36f5d3a5560f83bafe205be614"/><dir name="Subscriber"><file name="Collection.php" hash="05db928eb656f132e4fa16ac740ce3c5"/></dir><file name="Subscriber.php" hash="9f73d39e97d4a19f8d8ad3c19f83a699"/></dir><file name="Observer.php" hash="3d58c2213ac929f41b4c4756c4a7f7a8"/><file name="Subscriber.php" hash="cba5176e53a7dcab9b9014190f13485d"/></dir><dir name="controllers"><dir name="Adminhtml"><file name="LapostaController.php" hash="cc2a0d62caf63469258042e3b29616e4"/></dir><file name="IndexController.php" hash="7577e30abee9624d59901edb5cecd3e9"/><file name="SubscribeAllController.php" hash="160ac8e5229bb1003d7220116a9b06f7"/><file name="WebhookController.php" hash="0526b02b319fc31cd8c8a3e9789ba358"/></dir><dir name="etc"><file name="adminhtml.xml" hash="71f985837d4b79e3db94c529bfee1e47"/><file name="config.xml" hash="72458847e9370acc79614139a38d502d"/><file name="system.xml" hash="6ee7d5de56541573f16a2caf94dc0418"/></dir><dir name="lib"><dir name="Laposta"><dir name="Laposta"><file name="Error.php" hash="46e746b650bbb5df1ec51f4c530d5f35"/><file name="Field.php" hash="99bc22f997692ff648cb660330552a94"/><file name="List.php" hash="f3b8a716c1d9fd11828f980445dd6d5b"/><file name="Login.php" hash="dc11941e5ca3a404005730843c74e8b3"/><file name="Member.php" hash="cae2b3f6b23ee44e9246a8d33d2ddd46"/><file name="Request.php" hash="57d27e3f8165db905d36d85cf234e86e"/><file name="Resource.php" hash="c2ca77821136b798b526b5dc41659054"/><file name="Util.php" hash="d6760d2d5ddb6f4de6aff185fd432a91"/><file name="Webhook.php" hash="e06b2e711c348af1df425b7faaa5c33e"/></dir><file name="Laposta.php" hash="c99f38dcfef24df38a5a921360356381"/></dir></dir><dir name="sql"><dir name="lapostaconnect_setup"><file name="mysql4-install-1.0.0.php" hash="a1b0319b992b9effe6aa2712031e8701"/><file name="mysql4-install-1.0.12.php" hash="aafda6f1342a9e5ca30c3a87886619f8"/><file name="mysql4-upgrade-1.0.11-1.0.12.php" hash="4cb4083f5bbc27dc719bd0a816a33476"/><file name="mysql4-upgrade-1.0.7-1.0.8.php" hash="a1b0319b992b9effe6aa2712031e8701"/></dir></dir></dir></dir></target><target name="magelocal"><dir name="frontend"><dir name="base"><dir name="default"><dir name="layout"><file name="lapostaconnect.xml" hash="d41d8cd98f00b204e9800998ecf8427e"/></dir></dir></dir></dir></target><target name="magelocale"><dir name="en_US"><file name="Laposta_Connect.csv" hash="4f8f28790602cdd01633c0bb00f70585"/></dir></target><target name="mageetc"><dir name="modules"><file name="Laposta_Connect.xml" hash="ab7675e19ea96d39c5980bee835f0e76"/></dir></target></contents>
33
  <compatible/>
34
  <dependencies><required><php><min>5.3.0</min><max>6.0.0</max></php></required></dependencies>
35
  </package>