Copernica_MarketingSoftware - Version 2.1.0

Version Notes

Improvements:
- The Connector does no longer save config values in the Magento Config. Since config values are saved everytime the cronjob started, it also changed the cached config. This is a performance improvement for Magento.
- Added the special price in the product XML.
- The product XML will return the product information from the specified storeview.
- When a customer changes his/her e-mail address it will change the profile in Copernica and not create a new one.
- When createing a database the storeview field in Copernica is automatically set to 100 characters
- Added a header for SOAP requests.

Download this release

Release Info

Developer Cream
Extension Copernica_MarketingSoftware
Version 2.1.0
Comparing to
See all releases


Code changes from version 2.0.1 to 2.1.0

Files changed (72) hide show
  1. app/code/community/Copernica/MarketingSoftware/Block/Adminhtml/Marketingsoftware/Export.php +41 -5
  2. app/code/community/Copernica/MarketingSoftware/Block/Adminhtml/Marketingsoftware/Link.php +42 -6
  3. app/code/community/Copernica/MarketingSoftware/Block/Adminhtml/Marketingsoftware/Settings.php +41 -5
  4. app/code/community/Copernica/MarketingSoftware/Helper/Api.php +81 -19
  5. app/code/community/Copernica/MarketingSoftware/Helper/Config.php +746 -557
  6. app/code/community/Copernica/MarketingSoftware/Helper/Data.php +25 -0
  7. app/code/community/Copernica/MarketingSoftware/Model/Abstraction/Address.php +39 -14
  8. app/code/community/Copernica/MarketingSoftware/Model/Abstraction/Attributes.php +28 -3
  9. app/code/community/Copernica/MarketingSoftware/Model/Abstraction/Customer.php +58 -10
  10. app/code/community/Copernica/MarketingSoftware/Model/Abstraction/Name.php +30 -5
  11. app/code/community/Copernica/MarketingSoftware/Model/Abstraction/Order.php +43 -18
  12. app/code/community/Copernica/MarketingSoftware/Model/Abstraction/Order/Item.php +34 -9
  13. app/code/community/Copernica/MarketingSoftware/Model/Abstraction/Order/Item/Options.php +29 -4
  14. app/code/community/Copernica/MarketingSoftware/Model/Abstraction/Price.php +34 -9
  15. app/code/community/Copernica/MarketingSoftware/Model/Abstraction/Product.php +72 -45
  16. app/code/community/Copernica/MarketingSoftware/Model/Abstraction/Quote.php +40 -15
  17. app/code/community/Copernica/MarketingSoftware/Model/Abstraction/Quote/Item.php +35 -10
  18. app/code/community/Copernica/MarketingSoftware/Model/Abstraction/Quote/Item/Options.php +29 -4
  19. app/code/community/Copernica/MarketingSoftware/Model/Abstraction/Storeview.php +33 -8
  20. app/code/community/Copernica/MarketingSoftware/Model/Abstraction/Subscription.php +31 -6
  21. app/code/community/Copernica/MarketingSoftware/Model/AsyncPomSoapClient.php +41 -8
  22. app/code/community/Copernica/MarketingSoftware/Model/Config.php +57 -0
  23. app/code/community/Copernica/MarketingSoftware/Model/Copernica/Abstract.php +33 -1
  24. app/code/community/Copernica/MarketingSoftware/Model/Copernica/Address/Subprofile.php +25 -0
  25. app/code/community/Copernica/MarketingSoftware/Model/Copernica/Cartitem/Subprofile.php +31 -4
  26. app/code/community/Copernica/MarketingSoftware/Model/Copernica/Order/Subprofile.php +26 -2
  27. app/code/community/Copernica/MarketingSoftware/Model/Copernica/Orderitem/Subprofile.php +30 -3
  28. app/code/community/Copernica/MarketingSoftware/Model/Copernica/Profile.php +25 -0
  29. app/code/community/Copernica/MarketingSoftware/Model/Copernica/Profilecustomer.php +46 -3
  30. app/code/community/Copernica/MarketingSoftware/Model/Copernica/Profileorder.php +37 -1
  31. app/code/community/Copernica/MarketingSoftware/Model/Copernica/Profilequote.php +26 -1
  32. app/code/community/Copernica/MarketingSoftware/Model/Copernica/Profilesubscription.php +43 -6
  33. app/code/community/Copernica/MarketingSoftware/Model/Error.php +25 -0
  34. app/code/community/Copernica/MarketingSoftware/Model/Marketingsoftware.php +25 -0
  35. app/code/community/Copernica/MarketingSoftware/Model/Mysql4/Config.php +33 -0
  36. app/code/community/Copernica/MarketingSoftware/Model/Mysql4/Config/Collection.php +33 -0
  37. app/code/community/Copernica/MarketingSoftware/Model/Mysql4/Queue.php +25 -0
  38. app/code/community/Copernica/MarketingSoftware/Model/Mysql4/Queue/Collection.php +25 -0
  39. app/code/community/Copernica/MarketingSoftware/Model/Observer.php +60 -33
  40. app/code/community/Copernica/MarketingSoftware/Model/PomSoapClient.php +34 -5
  41. app/code/community/Copernica/MarketingSoftware/Model/Queue.php +42 -4
  42. app/code/community/Copernica/MarketingSoftware/Model/QueueEvent/Abstract.php +28 -44
  43. app/code/community/Copernica/MarketingSoftware/Model/QueueEvent/CustomerAdd.php +25 -0
  44. app/code/community/Copernica/MarketingSoftware/Model/QueueEvent/CustomerFull.php +25 -0
  45. app/code/community/Copernica/MarketingSoftware/Model/QueueEvent/CustomerModify.php +25 -0
  46. app/code/community/Copernica/MarketingSoftware/Model/QueueEvent/CustomerRemove.php +14 -14
  47. app/code/community/Copernica/MarketingSoftware/Model/QueueEvent/Factory.php +84 -0
  48. app/code/community/Copernica/MarketingSoftware/Model/QueueEvent/OrderAdd.php +25 -0
  49. app/code/community/Copernica/MarketingSoftware/Model/QueueEvent/OrderModify.php +25 -0
  50. app/code/community/Copernica/MarketingSoftware/Model/QueueEvent/QuoteItem.php +25 -0
  51. app/code/community/Copernica/MarketingSoftware/Model/QueueEvent/QuoteItemAdd.php +25 -0
  52. app/code/community/Copernica/MarketingSoftware/Model/QueueEvent/QuoteItemModify.php +25 -0
  53. app/code/community/Copernica/MarketingSoftware/Model/QueueEvent/QuoteItemRemove.php +25 -0
  54. app/code/community/Copernica/MarketingSoftware/Model/QueueEvent/QuoteModify.php +25 -0
  55. app/code/community/Copernica/MarketingSoftware/Model/QueueEvent/StartSync.php +32 -7
  56. app/code/community/Copernica/MarketingSoftware/Model/QueueEvent/SubscriptionAdd.php +25 -0
  57. app/code/community/Copernica/MarketingSoftware/Model/QueueEvent/SubscriptionModify.php +25 -0
  58. app/code/community/Copernica/MarketingSoftware/Model/QueueEvent/SubscriptionRemove.php +25 -0
  59. app/code/community/Copernica/MarketingSoftware/controllers/Adminhtml/Marketingsoftware/ExportController.php +36 -10
  60. app/code/community/Copernica/MarketingSoftware/controllers/Adminhtml/Marketingsoftware/LinkController.php +29 -5
  61. app/code/community/Copernica/MarketingSoftware/controllers/Adminhtml/Marketingsoftware/SettingsController.php +27 -4
  62. app/code/community/Copernica/MarketingSoftware/controllers/ProductController.php +61 -6
  63. app/code/community/Copernica/MarketingSoftware/controllers/UnsubscribeController.php +30 -0
  64. app/code/community/Copernica/MarketingSoftware/etc/adminhtml.xml +3 -3
  65. app/code/community/Copernica/MarketingSoftware/etc/config.xml +4 -1
  66. app/code/community/Copernica/MarketingSoftware/sql/marketingsoftware_setup/mysql4-install-1.2.0.php +24 -0
  67. app/code/community/Copernica/MarketingSoftware/sql/marketingsoftware_setup/mysql4-upgrade-1.1.5-1.1.6.php +24 -0
  68. app/code/community/Copernica/MarketingSoftware/sql/marketingsoftware_setup/mysql4-upgrade-1.1.6-1.1.7.php +24 -0
  69. app/code/community/Copernica/MarketingSoftware/sql/marketingsoftware_setup/mysql4-upgrade-1.1.7-1.1.8.php +24 -0
  70. app/code/community/Copernica/MarketingSoftware/sql/marketingsoftware_setup/mysql4-upgrade-1.1.8-1.2.0.php +24 -0
  71. app/code/community/Copernica/MarketingSoftware/sql/marketingsoftware_setup/mysql4-upgrade-2.0.1-2.0.2.php +42 -0
  72. package.xml +14 -10
app/code/community/Copernica/MarketingSoftware/Block/Adminhtml/Marketingsoftware/Export.php CHANGED
@@ -1,26 +1,62 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  /**
3
  * Export Block
4
- * Copernica Marketing Software v 1.2.0
5
- * March 2011
6
- * http://www.copernica.com/
7
  */
8
  class Copernica_MarketingSoftware_Block_Adminhtml_Marketingsoftware_Export extends Mage_Core_Block_Template
9
  {
 
 
 
 
10
  public function __construct()
11
  {
12
  parent::__construct();
13
  $this->setTemplate('marketingsoftware/export.phtml');
14
  }
15
 
 
 
 
 
 
16
  public function getIframeUrl()
17
  {
18
  return $this->getUrl('*/*/progress', array('_secure' => true));
19
  }
20
 
 
 
 
 
 
21
  public function getPostUrl()
22
  {
23
  return $this->getUrl('*/*/get', array('_secure' => true));
24
  }
25
- }
26
- ?>
1
  <?php
2
+ /**
3
+ * Copernica Marketing Software
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0).
8
+ * It is available through the world-wide-web at this URL:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to obtain a copy of the license through the
11
+ * world-wide-web, please send an email to copernica@support.cream.nl
12
+ * so we can send you a copy immediately.
13
+ *
14
+ * DISCLAIMER
15
+ *
16
+ * Do not edit or add to this file if you wish to upgrade this software
17
+ * to newer versions in the future. If you wish to customize this module
18
+ * for your needs please refer to http://www.magento.com/ for more
19
+ * information.
20
+ *
21
+ * @category Copernica
22
+ * @package Copernica_MarketingSoftware
23
+ * @copyright Copyright (c) 2011-2012 Copernica & Cream. (http://docs.cream.nl/)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
  /**
28
  * Export Block
29
+ *
 
 
30
  */
31
  class Copernica_MarketingSoftware_Block_Adminhtml_Marketingsoftware_Export extends Mage_Core_Block_Template
32
  {
33
+ /**
34
+ * Constructor
35
+ *
36
+ */
37
  public function __construct()
38
  {
39
  parent::__construct();
40
  $this->setTemplate('marketingsoftware/export.phtml');
41
  }
42
 
43
+ /**
44
+ * Returns the iframe URL
45
+ *
46
+ * @return string
47
+ */
48
  public function getIframeUrl()
49
  {
50
  return $this->getUrl('*/*/progress', array('_secure' => true));
51
  }
52
 
53
+ /**
54
+ * Returns the post URL
55
+ *
56
+ * @return string
57
+ */
58
  public function getPostUrl()
59
  {
60
  return $this->getUrl('*/*/get', array('_secure' => true));
61
  }
62
+ }
 
app/code/community/Copernica/MarketingSoftware/Block/Adminhtml/Marketingsoftware/Link.php CHANGED
@@ -1,26 +1,62 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  /**
3
- * Settings Block
4
- * Copernica Marketing Software v 1.2.0
5
- * March 2011
6
- * http://www.copernica.com/
7
  */
8
  class Copernica_MarketingSoftware_Block_Adminhtml_Marketingsoftware_Link extends Mage_Core_Block_Template
9
  {
 
 
 
 
10
  public function __construct()
11
  {
12
  parent::__construct();
13
  $this->setTemplate('marketingsoftware/link.phtml');
14
  }
15
 
 
 
 
 
 
16
  public function getAjaxUrl()
17
  {
18
  return $this->getUrl('*/*/checkajax', array('_secure' => true));
19
  }
20
 
 
 
 
 
 
21
  public function getPostUrl()
22
  {
23
  return $this->getUrl('*/*/saveProfilesAndCollections', array('_secure' => true));
24
  }
25
- }
26
- ?>
1
  <?php
2
+ /**
3
+ * Copernica Marketing Software
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0).
8
+ * It is available through the world-wide-web at this URL:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to obtain a copy of the license through the
11
+ * world-wide-web, please send an email to copernica@support.cream.nl
12
+ * so we can send you a copy immediately.
13
+ *
14
+ * DISCLAIMER
15
+ *
16
+ * Do not edit or add to this file if you wish to upgrade this software
17
+ * to newer versions in the future. If you wish to customize this module
18
+ * for your needs please refer to http://www.magento.com/ for more
19
+ * information.
20
+ *
21
+ * @category Copernica
22
+ * @package Copernica_MarketingSoftware
23
+ * @copyright Copyright (c) 2011-2012 Copernica & Cream. (http://docs.cream.nl/)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
  /**
28
+ * Link Block
29
+ *
 
 
30
  */
31
  class Copernica_MarketingSoftware_Block_Adminhtml_Marketingsoftware_Link extends Mage_Core_Block_Template
32
  {
33
+ /**
34
+ * Constructor
35
+ *
36
+ */
37
  public function __construct()
38
  {
39
  parent::__construct();
40
  $this->setTemplate('marketingsoftware/link.phtml');
41
  }
42
 
43
+ /**
44
+ * Returns the ajax URL.
45
+ *
46
+ * @return string
47
+ */
48
  public function getAjaxUrl()
49
  {
50
  return $this->getUrl('*/*/checkajax', array('_secure' => true));
51
  }
52
 
53
+ /**
54
+ * Returns the post URL.
55
+ *
56
+ * @return string
57
+ */
58
  public function getPostUrl()
59
  {
60
  return $this->getUrl('*/*/saveProfilesAndCollections', array('_secure' => true));
61
  }
62
+ }
 
app/code/community/Copernica/MarketingSoftware/Block/Adminhtml/Marketingsoftware/Settings.php CHANGED
@@ -1,26 +1,62 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  /**
3
  * Settings Block
4
- * Copernica Marketing Software v 1.2.0
5
- * March 2011
6
- * http://www.copernica.com/
7
  */
8
  class Copernica_MarketingSoftware_Block_Adminhtml_Marketingsoftware_Settings extends Mage_Core_Block_Template
9
  {
 
 
 
 
10
  public function __construct()
11
  {
12
  parent::__construct();
13
  $this->setTemplate('marketingsoftware/settings.phtml');
14
  }
15
 
 
 
 
 
 
16
  public function getCheckSettingsUrl()
17
  {
18
  return $this->getUrl('*/*/checker', array('_secure' => true));
19
  }
20
 
 
 
 
 
 
21
  public function getPostUrl()
22
  {
23
  return $this->getUrl('*/*/send', array('_secure' => true));
24
  }
25
- }
26
- ?>
1
  <?php
2
+ /**
3
+ * Copernica Marketing Software
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0).
8
+ * It is available through the world-wide-web at this URL:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to obtain a copy of the license through the
11
+ * world-wide-web, please send an email to copernica@support.cream.nl
12
+ * so we can send you a copy immediately.
13
+ *
14
+ * DISCLAIMER
15
+ *
16
+ * Do not edit or add to this file if you wish to upgrade this software
17
+ * to newer versions in the future. If you wish to customize this module
18
+ * for your needs please refer to http://www.magento.com/ for more
19
+ * information.
20
+ *
21
+ * @category Copernica
22
+ * @package Copernica_MarketingSoftware
23
+ * @copyright Copyright (c) 2011-2012 Copernica & Cream. (http://docs.cream.nl/)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
  /**
28
  * Settings Block
29
+ *
 
 
30
  */
31
  class Copernica_MarketingSoftware_Block_Adminhtml_Marketingsoftware_Settings extends Mage_Core_Block_Template
32
  {
33
+ /**
34
+ * Constructor
35
+ *
36
+ */
37
  public function __construct()
38
  {
39
  parent::__construct();
40
  $this->setTemplate('marketingsoftware/settings.phtml');
41
  }
42
 
43
+ /**
44
+ * Returns the check settings URL.
45
+ *
46
+ * @return string
47
+ */
48
  public function getCheckSettingsUrl()
49
  {
50
  return $this->getUrl('*/*/checker', array('_secure' => true));
51
  }
52
 
53
+ /**
54
+ * Returns the post URL.
55
+ *
56
+ * @return string
57
+ */
58
  public function getPostUrl()
59
  {
60
  return $this->getUrl('*/*/send', array('_secure' => true));
61
  }
62
+ }
 
app/code/community/Copernica/MarketingSoftware/Helper/Api.php CHANGED
@@ -1,4 +1,29 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  /**
3
  * Copernica_MarketingSoftware_Helper_Api
4
  * This file holds the class that is used to communicate with Copernica
@@ -8,7 +33,7 @@
8
  */
9
 
10
  /** Require some additional file for exceptions */
11
- require_once(dirname(__FILE__).'/../Model/Error.php');
12
 
13
  /**
14
  * CopernicaAPI class
@@ -26,19 +51,19 @@ class Copernica_MarketingSoftware_Helper_Api extends Mage_Core_Helper_Abstract
26
  * The Copernica account name that is sent with the constructor
27
  * @var string
28
  */
29
- private $account;
30
 
31
  /**
32
  * Store the id of the database
33
  * @var integer
34
  */
35
- private $databaseID = false;
36
 
37
  /**
38
  * Store the id of the collection
39
  * @var integer
40
  */
41
- private $collectionID = array();
42
 
43
  /**
44
  * Checks the connection settings and initializes the soap client
@@ -90,7 +115,7 @@ class Copernica_MarketingSoftware_Helper_Api extends Mage_Core_Helper_Abstract
90
 
91
  // check for invalid login
92
  $objarray = get_object_vars($this->soapclient);
93
-
94
  // return API Error
95
  if (isset($objarray['__soap_fault'])) throw new CopernicaError(COPERNICAERROR_LOGINFAILURE);
96
 
@@ -124,11 +149,15 @@ class Copernica_MarketingSoftware_Helper_Api extends Mage_Core_Helper_Abstract
124
  // Get the database name
125
  $identifier = ($databaseName === false) ? Mage::helper('marketingsoftware/config')->getDatabaseName() : $databaseName;
126
 
 
 
127
  // Get the database object
128
  $request = $this->soapclient->Account_Database(array('identifier' => $identifier));
129
 
130
  // Get the response object from the request
131
  $object = $this->soapclient->result($request);
 
 
132
 
133
  // If it not an object, throw an error
134
  if (!is_object($object)) throw (new CopernicaError(COPERNICAERROR_NODATABASE));
@@ -150,6 +179,8 @@ class Copernica_MarketingSoftware_Helper_Api extends Mage_Core_Helper_Abstract
150
  // Did we already have this id, return it
151
  if (isset($this->collectionID[$databaseName.$name])) return $this->collectionID[$databaseName.$name];
152
 
 
 
153
  // Get the soap collection object
154
  $request = $this->soapclient->Database_Collection(array(
155
  'id' => $this->getDatabaseId($databaseName ? $databaseName : false),
@@ -159,6 +190,8 @@ class Copernica_MarketingSoftware_Helper_Api extends Mage_Core_Helper_Abstract
159
  // Get the response object from the request
160
  $object = $this->soapclient->result($request);
161
 
 
 
162
  // no object is returned
163
  if (!is_object($object)) throw (new CopernicaError(COPERNICAERROR_NOCOLLECTION));
164
 
@@ -173,8 +206,10 @@ class Copernica_MarketingSoftware_Helper_Api extends Mage_Core_Helper_Abstract
173
  */
174
  public function searchProfiles($identifier)
175
  {
 
 
176
  // Search the profiles
177
- return $this->soapclient->result(
178
  $this->soapclient->Database_SearchProfiles(array(
179
  'id' => $this->getDatabaseId(),
180
  'requirements' => array(
@@ -186,6 +221,10 @@ class Copernica_MarketingSoftware_Helper_Api extends Mage_Core_Helper_Abstract
186
  )
187
  ))
188
  );
 
 
 
 
189
  }
190
 
191
  /**
@@ -209,6 +248,7 @@ class Copernica_MarketingSoftware_Helper_Api extends Mage_Core_Helper_Abstract
209
  ));
210
  }
211
  }
 
212
  /**
213
  * Update the profiles given a customer and return the found profiles
214
  * @param Copernica_MarketingSoftware_Model_Copernica_ProfileCustomer
@@ -230,6 +270,8 @@ class Copernica_MarketingSoftware_Helper_Api extends Mage_Core_Helper_Abstract
230
  // and get lost
231
  return;
232
  }
 
 
233
 
234
  // Update the profiles and wait for the result because, we want to search for it
235
  $this->soapclient->result($this->soapclient->Database_updateProfiles(array(
@@ -237,13 +279,15 @@ class Copernica_MarketingSoftware_Helper_Api extends Mage_Core_Helper_Abstract
237
  'requirements' => array(
238
  $this->soapclient->toObject(array(
239
  'fieldname' => 'customer_id',
240
- 'value' => $data->id(),
241
  'operator' => '='
242
  ))
243
  ),
244
  'create' => true,
245
  'fields' => $data->toArray()
246
  )));
 
 
247
  }
248
 
249
  /**
@@ -297,6 +341,7 @@ class Copernica_MarketingSoftware_Helper_Api extends Mage_Core_Helper_Abstract
297
 
298
  /**
299
  * Remove the cart items which have been purchased
 
300
  * @param string customer identifier
301
  * @param integer quote item id
302
  */
@@ -306,6 +351,8 @@ class Copernica_MarketingSoftware_Helper_Api extends Mage_Core_Helper_Abstract
306
  $collectionName = Mage::helper('marketingsoftware/config')->getCartItemsCollectionName();
307
  $collectionId = $this->getCollectionId($collectionName);
308
 
 
 
309
  // find the subprofiles
310
  $subprofiles = $this->soapclient->result($this->soapclient->Profile_searchSubProfiles(array(
311
  'id' => $profileID,
@@ -323,6 +370,8 @@ class Copernica_MarketingSoftware_Helper_Api extends Mage_Core_Helper_Abstract
323
  ),
324
  'collection' => $this->soapclient->toObject(array('id' => $collectionId)),
325
  )));
 
 
326
 
327
  // Build an array of ids
328
  $ids = array();
@@ -338,6 +387,7 @@ class Copernica_MarketingSoftware_Helper_Api extends Mage_Core_Helper_Abstract
338
  /**
339
  * Update the subprofiles given, the profile identifier
340
  * the collection name and the data
 
341
  * @param string customer identifier
342
  * @param Copernica_MarketingSoftware_Model_Copernica_Subprofile
343
  */
@@ -366,6 +416,7 @@ class Copernica_MarketingSoftware_Helper_Api extends Mage_Core_Helper_Abstract
366
  /**
367
  * Update the subprofiles given, the profile identifier
368
  * the collection name and the data
 
369
  * @param string customer identifier
370
  * @param Copernica_MarketingSoftware_Model_Copernica_Subprofile
371
  */
@@ -394,6 +445,7 @@ class Copernica_MarketingSoftware_Helper_Api extends Mage_Core_Helper_Abstract
394
  /**
395
  * Update the subprofiles given, the profile identifier
396
  * the collection name and the data
 
397
  * @param string customer identifier
398
  * @param Copernica_MarketingSoftware_Model_Copernica_Subprofile
399
  */
@@ -420,7 +472,8 @@ class Copernica_MarketingSoftware_Helper_Api extends Mage_Core_Helper_Abstract
420
  }
421
 
422
  /**
423
- * Does a database with the given name exist?
 
424
  * @param string
425
  * @return boolean
426
  */
@@ -439,6 +492,7 @@ class Copernica_MarketingSoftware_Helper_Api extends Mage_Core_Helper_Abstract
439
 
440
  /**
441
  * Is the database with the given name valid?
 
442
  * @param string
443
  * @return string 'ok', 'notexists', 'notvalid'
444
  */
@@ -470,6 +524,7 @@ class Copernica_MarketingSoftware_Helper_Api extends Mage_Core_Helper_Abstract
470
 
471
  /**
472
  * Repair the database with the given name valid?
 
473
  * @param string
474
  * @return string 'ok', 'notexists', 'notvalid'
475
  */
@@ -503,6 +558,7 @@ class Copernica_MarketingSoftware_Helper_Api extends Mage_Core_Helper_Abstract
503
  /**
504
  * Is the collection in the given database, with the given type
505
  * and name valid?
 
506
  * @param string $databaseName name of the database
507
  * @param string $collectionType 'cartproducts', 'orders', 'orderproducts', 'addresses'
508
  * @param string $collectionName name of the collection
@@ -561,6 +617,7 @@ class Copernica_MarketingSoftware_Helper_Api extends Mage_Core_Helper_Abstract
561
  /**
562
  * Repair the collection in the given database, with the given type
563
  * and name
 
564
  * @param string $databaseName name of the database
565
  * @param string $collectionType 'cartproducts', 'orders', 'orderproducts', 'addresses'
566
  * @param string $collectionName name of the collection
@@ -617,6 +674,7 @@ class Copernica_MarketingSoftware_Helper_Api extends Mage_Core_Helper_Abstract
617
  /**
618
  * Validate the field, given the collection name.
619
  * When the collection name is empty the check is performed for the database
 
620
  * @param String fieldname in our Magento plug-in
621
  * @param String fieldname in the customers Copernica environment
622
  * @param String name of the database in the customers Copernica environment
@@ -640,12 +698,13 @@ class Copernica_MarketingSoftware_Helper_Api extends Mage_Core_Helper_Abstract
640
 
641
  /**
642
  * Validate the field from the database
 
643
  * @param String name of the database in the customers Copernica environment
644
  * @param String name of the field in our Magento plug-in
645
  * @param String fieldname in the customers Copernica environment
646
  * @return 'ok', 'notexists', 'notvalid'
647
  */
648
- private function validateDatabaseField($databaseName, $magentoFieldName, $copernicaFieldName)
649
  {
650
  // Get the database id
651
  $id = $this->getDatabaseId($databaseName);
@@ -733,7 +792,7 @@ class Copernica_MarketingSoftware_Helper_Api extends Mage_Core_Helper_Abstract
733
  * @param String fieldname in the customers Copernica environment
734
  * @return object SOAP object
735
  */
736
- private function collectionFieldData($database, $collectionName, $fieldName)
737
  {
738
  // Get the id of this collection
739
  $id = $this->getCollectionId($collectionName, $database);
@@ -753,7 +812,7 @@ class Copernica_MarketingSoftware_Helper_Api extends Mage_Core_Helper_Abstract
753
  * @param String fieldname in the customers Copernica environment
754
  * @return 'ok', 'notexists', 'notvalid'
755
  */
756
- private function validateCartProductsField($database, $collectionName, $magentoFieldName, $copernicaFieldName)
757
  {
758
  // Get the id of this collection
759
  $object = $this->collectionFieldData($database, $collectionName, $copernicaFieldName);
@@ -784,7 +843,7 @@ class Copernica_MarketingSoftware_Helper_Api extends Mage_Core_Helper_Abstract
784
  * @param String fieldname in the customers Copernica environment
785
  * @return 'ok', 'notexists', 'notvalid'
786
  */
787
- private function validateOrdersField($database, $collectionName, $magentoFieldName, $copernicaFieldName)
788
  {
789
  // Get the id of this collection
790
  $object = $this->collectionFieldData($database, $collectionName, $copernicaFieldName);
@@ -810,7 +869,7 @@ class Copernica_MarketingSoftware_Helper_Api extends Mage_Core_Helper_Abstract
810
  * @param String fieldname in the customers Copernica environment
811
  * @return 'ok', 'notexists', 'notvalid'
812
  */
813
- private function validateOrderProductsField($database, $collectionName, $magentoFieldName, $copernicaFieldName)
814
  {
815
  // Get the id of this collection
816
  $object = $this->collectionFieldData($database, $collectionName, $copernicaFieldName);
@@ -841,7 +900,7 @@ class Copernica_MarketingSoftware_Helper_Api extends Mage_Core_Helper_Abstract
841
  * @param String fieldname in the customers Copernica environment
842
  * @return 'ok', 'notexists', 'notvalid'
843
  */
844
- private function validateAddressesField($database, $collectionName, $magentoFieldName, $copernicaFieldName)
845
  {
846
  // Get the id of this collection
847
  $object = $this->collectionFieldData($database, $collectionName, $copernicaFieldName);
@@ -883,7 +942,7 @@ class Copernica_MarketingSoftware_Helper_Api extends Mage_Core_Helper_Abstract
883
  * @param String fieldname in the customers Copernica environment
884
  * @return 'ok', 'notexists', 'notvalid'
885
  */
886
- private function repairDatabaseField($databaseName, $magentoFieldName, $copernicaFieldName)
887
  {
888
  $id = $this->getDatabaseId($databaseName);
889
 
@@ -913,7 +972,8 @@ class Copernica_MarketingSoftware_Helper_Api extends Mage_Core_Helper_Abstract
913
  // What field is this?
914
  switch($magentoFieldName)
915
  {
916
- case "email": $definition['type'] = 'email'; break;
 
917
  case "newsletter":
918
  // is the unsubscribe behaviour set?
919
  $database = $this->soapclient->result($this->soapclient->Database_retrieve(array('id' => $id)));
@@ -993,7 +1053,7 @@ class Copernica_MarketingSoftware_Helper_Api extends Mage_Core_Helper_Abstract
993
  * @param String fieldname in the customers Copernica environment
994
  * @return 'ok', 'notexists', 'notvalid'
995
  */
996
- private function repairCollectionField($database, $collectionName, $collection, $magentoFieldName, $copernicaFieldName)
997
  {
998
  // Get the id of this collection
999
  $object = $this->collectionFieldData($database, $collectionName, $copernicaFieldName);
@@ -1017,7 +1077,7 @@ class Copernica_MarketingSoftware_Helper_Api extends Mage_Core_Helper_Abstract
1017
 
1018
  // enrich the definition, given the collection
1019
  $definition = $this->getFieldDefinition($collection, $magentoFieldName, $definition);
1020
-
1021
  // create the field or update the existing field
1022
  if (!is_object($object) || $object->id == 0) $this->soapclient->Collection_createField($definition);
1023
  elseif (count($definition) > 1) $this->soapclient->CollectionField_update($definition);
@@ -1033,7 +1093,7 @@ class Copernica_MarketingSoftware_Helper_Api extends Mage_Core_Helper_Abstract
1033
  * @param array definition
1034
  * @return array with enriched definition
1035
  */
1036
- private function getFieldDefinition($collection, $fieldName, $definition)
1037
  {
1038
  if ($collection == 'cartproducts' || $collection == 'orderproducts')
1039
  {
@@ -1064,6 +1124,8 @@ class Copernica_MarketingSoftware_Helper_Api extends Mage_Core_Helper_Abstract
1064
  case "fax": $definition['type'] = 'phone_fax'; break;
1065
  }
1066
  }
 
 
1067
 
1068
  // return the definition
1069
  return $definition;
1
  <?php
2
+ /**
3
+ * Copernica Marketing Software
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0).
8
+ * It is available through the world-wide-web at this URL:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to obtain a copy of the license through the
11
+ * world-wide-web, please send an email to copernica@support.cream.nl
12
+ * so we can send you a copy immediately.
13
+ *
14
+ * DISCLAIMER
15
+ *
16
+ * Do not edit or add to this file if you wish to upgrade this software
17
+ * to newer versions in the future. If you wish to customize this module
18
+ * for your needs please refer to http://www.magento.com/ for more
19
+ * information.
20
+ *
21
+ * @category Copernica
22
+ * @package Copernica_MarketingSoftware
23
+ * @copyright Copyright (c) 2011-2012 Copernica & Cream. (http://docs.cream.nl/)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
  /**
28
  * Copernica_MarketingSoftware_Helper_Api
29
  * This file holds the class that is used to communicate with Copernica
33
  */
34
 
35
  /** Require some additional file for exceptions */
36
+ require_once dirname(__FILE__).'/../Model/Error.php';
37
 
38
  /**
39
  * CopernicaAPI class
51
  * The Copernica account name that is sent with the constructor
52
  * @var string
53
  */
54
+ protected $account;
55
 
56
  /**
57
  * Store the id of the database
58
  * @var integer
59
  */
60
+ protected $databaseID = false;
61
 
62
  /**
63
  * Store the id of the collection
64
  * @var integer
65
  */
66
+ protected $collectionID = array();
67
 
68
  /**
69
  * Checks the connection settings and initializes the soap client
115
 
116
  // check for invalid login
117
  $objarray = get_object_vars($this->soapclient);
118
+
119
  // return API Error
120
  if (isset($objarray['__soap_fault'])) throw new CopernicaError(COPERNICAERROR_LOGINFAILURE);
121
 
149
  // Get the database name
150
  $identifier = ($databaseName === false) ? Mage::helper('marketingsoftware/config')->getDatabaseName() : $databaseName;
151
 
152
+ Varien_Profiler::start('Copernica SOAP call: Account_Database');
153
+
154
  // Get the database object
155
  $request = $this->soapclient->Account_Database(array('identifier' => $identifier));
156
 
157
  // Get the response object from the request
158
  $object = $this->soapclient->result($request);
159
+
160
+ Varien_Profiler::stop('Copernica SOAP call: Account_Database');
161
 
162
  // If it not an object, throw an error
163
  if (!is_object($object)) throw (new CopernicaError(COPERNICAERROR_NODATABASE));
179
  // Did we already have this id, return it
180
  if (isset($this->collectionID[$databaseName.$name])) return $this->collectionID[$databaseName.$name];
181
 
182
+ Varien_Profiler::start('Copernica SOAP call: Database_Collection');
183
+
184
  // Get the soap collection object
185
  $request = $this->soapclient->Database_Collection(array(
186
  'id' => $this->getDatabaseId($databaseName ? $databaseName : false),
190
  // Get the response object from the request
191
  $object = $this->soapclient->result($request);
192
 
193
+ Varien_Profiler::stop('Copernica SOAP call: Database_Collection');
194
+
195
  // no object is returned
196
  if (!is_object($object)) throw (new CopernicaError(COPERNICAERROR_NOCOLLECTION));
197
 
206
  */
207
  public function searchProfiles($identifier)
208
  {
209
+ Varien_Profiler::start('Copernica SOAP call: Database_SearchProfiles');
210
+
211
  // Search the profiles
212
+ $profiles = $this->soapclient->result(
213
  $this->soapclient->Database_SearchProfiles(array(
214
  'id' => $this->getDatabaseId(),
215
  'requirements' => array(
221
  )
222
  ))
223
  );
224
+
225
+ Varien_Profiler::stop('Copernica SOAP call: Database_SearchProfiles');
226
+
227
+ return $profiles;
228
  }
229
 
230
  /**
248
  ));
249
  }
250
  }
251
+
252
  /**
253
  * Update the profiles given a customer and return the found profiles
254
  * @param Copernica_MarketingSoftware_Model_Copernica_ProfileCustomer
270
  // and get lost
271
  return;
272
  }
273
+
274
+ Varien_Profiler::start('Copernica SOAP call: Database_updateProfiles');
275
 
276
  // Update the profiles and wait for the result because, we want to search for it
277
  $this->soapclient->result($this->soapclient->Database_updateProfiles(array(
279
  'requirements' => array(
280
  $this->soapclient->toObject(array(
281
  'fieldname' => 'customer_id',
282
+ 'value' => $data->originalId(),
283
  'operator' => '='
284
  ))
285
  ),
286
  'create' => true,
287
  'fields' => $data->toArray()
288
  )));
289
+
290
+ Varien_Profiler::stop('Copernica SOAP call: Database_updateProfiles');
291
  }
292
 
293
  /**
341
 
342
  /**
343
  * Remove the cart items which have been purchased
344
+ *
345
  * @param string customer identifier
346
  * @param integer quote item id
347
  */
351
  $collectionName = Mage::helper('marketingsoftware/config')->getCartItemsCollectionName();
352
  $collectionId = $this->getCollectionId($collectionName);
353
 
354
+ Varien_Profiler::start('Copernica SOAP call: Profile_searchSubProfiles');
355
+
356
  // find the subprofiles
357
  $subprofiles = $this->soapclient->result($this->soapclient->Profile_searchSubProfiles(array(
358
  'id' => $profileID,
370
  ),
371
  'collection' => $this->soapclient->toObject(array('id' => $collectionId)),
372
  )));
373
+
374
+ Varien_Profiler::stop('Copernica SOAP call: Profile_searchSubProfiles');
375
 
376
  // Build an array of ids
377
  $ids = array();
387
  /**
388
  * Update the subprofiles given, the profile identifier
389
  * the collection name and the data
390
+ *
391
  * @param string customer identifier
392
  * @param Copernica_MarketingSoftware_Model_Copernica_Subprofile
393
  */
416
  /**
417
  * Update the subprofiles given, the profile identifier
418
  * the collection name and the data
419
+ *
420
  * @param string customer identifier
421
  * @param Copernica_MarketingSoftware_Model_Copernica_Subprofile
422
  */
445
  /**
446
  * Update the subprofiles given, the profile identifier
447
  * the collection name and the data
448
+ *
449
  * @param string customer identifier
450
  * @param Copernica_MarketingSoftware_Model_Copernica_Subprofile
451
  */
472
  }
473
 
474
  /**
475
+ * Does a database with the given name exist?.
476
+ *
477
  * @param string
478
  * @return boolean
479
  */
492
 
493
  /**
494
  * Is the database with the given name valid?
495
+ *
496
  * @param string
497
  * @return string 'ok', 'notexists', 'notvalid'
498
  */
524
 
525
  /**
526
  * Repair the database with the given name valid?
527
+ *
528
  * @param string
529
  * @return string 'ok', 'notexists', 'notvalid'
530
  */
558
  /**
559
  * Is the collection in the given database, with the given type
560
  * and name valid?
561
+ *
562
  * @param string $databaseName name of the database
563
  * @param string $collectionType 'cartproducts', 'orders', 'orderproducts', 'addresses'
564
  * @param string $collectionName name of the collection
617
  /**
618
  * Repair the collection in the given database, with the given type
619
  * and name
620
+ *
621
  * @param string $databaseName name of the database
622
  * @param string $collectionType 'cartproducts', 'orders', 'orderproducts', 'addresses'
623
  * @param string $collectionName name of the collection
674
  /**
675
  * Validate the field, given the collection name.
676
  * When the collection name is empty the check is performed for the database
677
+ *
678
  * @param String fieldname in our Magento plug-in
679
  * @param String fieldname in the customers Copernica environment
680
  * @param String name of the database in the customers Copernica environment
698
 
699
  /**
700
  * Validate the field from the database
701
+ *
702
  * @param String name of the database in the customers Copernica environment
703
  * @param String name of the field in our Magento plug-in
704
  * @param String fieldname in the customers Copernica environment
705
  * @return 'ok', 'notexists', 'notvalid'
706
  */
707
+ protected function validateDatabaseField($databaseName, $magentoFieldName, $copernicaFieldName)
708
  {
709
  // Get the database id
710
  $id = $this->getDatabaseId($databaseName);
792
  * @param String fieldname in the customers Copernica environment
793
  * @return object SOAP object
794
  */
795
+ protected function collectionFieldData($database, $collectionName, $fieldName)
796
  {
797
  // Get the id of this collection
798
  $id = $this->getCollectionId($collectionName, $database);
812
  * @param String fieldname in the customers Copernica environment
813
  * @return 'ok', 'notexists', 'notvalid'
814
  */
815
+ protected function validateCartProductsField($database, $collectionName, $magentoFieldName, $copernicaFieldName)
816
  {
817
  // Get the id of this collection
818
  $object = $this->collectionFieldData($database, $collectionName, $copernicaFieldName);
843
  * @param String fieldname in the customers Copernica environment
844
  * @return 'ok', 'notexists', 'notvalid'
845
  */
846
+ protected function validateOrdersField($database, $collectionName, $magentoFieldName, $copernicaFieldName)
847
  {
848
  // Get the id of this collection
849
  $object = $this->collectionFieldData($database, $collectionName, $copernicaFieldName);
869
  * @param String fieldname in the customers Copernica environment
870
  * @return 'ok', 'notexists', 'notvalid'
871
  */
872
+ protected function validateOrderProductsField($database, $collectionName, $magentoFieldName, $copernicaFieldName)
873
  {
874
  // Get the id of this collection
875
  $object = $this->collectionFieldData($database, $collectionName, $copernicaFieldName);
900
  * @param String fieldname in the customers Copernica environment
901
  * @return 'ok', 'notexists', 'notvalid'
902
  */
903
+ protected function validateAddressesField($database, $collectionName, $magentoFieldName, $copernicaFieldName)
904
  {
905
  // Get the id of this collection
906
  $object = $this->collectionFieldData($database, $collectionName, $copernicaFieldName);
942
  * @param String fieldname in the customers Copernica environment
943
  * @return 'ok', 'notexists', 'notvalid'
944
  */
945
+ protected function repairDatabaseField($databaseName, $magentoFieldName, $copernicaFieldName)
946
  {
947
  $id = $this->getDatabaseId($databaseName);
948
 
972
  // What field is this?
973
  switch($magentoFieldName)
974
  {
975
+ case "email": $definition['type'] = 'email'; break;
976
+ case "store_view": $definition['length'] = 100; break;
977
  case "newsletter":
978
  // is the unsubscribe behaviour set?
979
  $database = $this->soapclient->result($this->soapclient->Database_retrieve(array('id' => $id)));
1053
  * @param String fieldname in the customers Copernica environment
1054
  * @return 'ok', 'notexists', 'notvalid'
1055
  */
1056
+ protected function repairCollectionField($database, $collectionName, $collection, $magentoFieldName, $copernicaFieldName)
1057
  {
1058
  // Get the id of this collection
1059
  $object = $this->collectionFieldData($database, $collectionName, $copernicaFieldName);
1077
 
1078
  // enrich the definition, given the collection
1079
  $definition = $this->getFieldDefinition($collection, $magentoFieldName, $definition);
1080
+
1081
  // create the field or update the existing field
1082
  if (!is_object($object) || $object->id == 0) $this->soapclient->Collection_createField($definition);
1083
  elseif (count($definition) > 1) $this->soapclient->CollectionField_update($definition);
1093
  * @param array definition
1094
  * @return array with enriched definition
1095
  */
1096
+ protected function getFieldDefinition($collection, $fieldName, $definition)
1097
  {
1098
  if ($collection == 'cartproducts' || $collection == 'orderproducts')
1099
  {
1124
  case "fax": $definition['type'] = 'phone_fax'; break;
1125
  }
1126
  }
1127
+
1128
+ if ($fieldName == 'store_view') $definition['length'] = 100;
1129
 
1130
  // return the definition
1131
  return $definition;
app/code/community/Copernica/MarketingSoftware/Helper/Config.php CHANGED
@@ -1,561 +1,750 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  class Copernica_MarketingSoftware_Helper_Config extends Mage_Core_Helper_Abstract
3
  {
4
- /**
5
- * Define a prefix used for the config
6
- * @name CONFIG_BASE a prefix
7
- */
8
- const CONFIG_BASE = 'marketingsoftware/';
9
-
10
- /**
11
- * Get the config item from the basic magento component
12
- * @param string $name Name of the config parameter
13
- */
14
- private function _getConfig($name)
15
- {
16
- // scope is added to the beginning of the path
17
- return (string)Mage::getConfig()->getNode(self::CONFIG_BASE . $name, 'default', 0);
18
- }
19
-
20
- /**
21
- * Set the config item from the basic magento component
22
- * @param string $name Name of the config parameter
23
- * @param string $value Value that should be stored in the config
24
- */
25
- private function _setConfig($name, $value, $cleanCache = false)
26
- {
27
- // is this value new the same as the existing value
28
- if ($value === $this->_getConfig($name)) return;
29
-
30
- // Store the value in the config
31
- Mage::getConfig()->saveConfig(self::CONFIG_BASE . $name, $value);
32
-
33
- if ($cleanCache) {
34
- // We changed something in the settings, clean the cache
35
- Mage::getConfig()->cleanCache();
36
- }
37
-
38
- // some config items are not that interesting
39
- if (in_array($name, array(
40
- 'customer_progress_status',
41
- 'order_progress_status',
42
- 'subscription_progress_status',
43
- 'cronjob_starttime',
44
- 'cronjob_endtime',
45
- 'cronjob_processedtasks',
46
- ))) return;
47
-
48
- // We have to reset the progress status
49
- $this->setCustomerProgressStatus('0');
50
- $this->setOrderProgressStatus('0');
51
- $this->setSubscriptionProgressStatus('0');
52
- }
53
-
54
- /**
55
- * Get the hostname from the config
56
- * @return String
57
- */
58
- public function getHostname()
59
- {
60
- return $this->_getConfig('hostname');
61
- }
62
-
63
- /**
64
- * Set the hostname from the config
65
- * @return String
66
- * @return Copernica_MarketingSoftware_Helper_Config
67
- */
68
- public function setHostname($value)
69
- {
70
- $this->_setConfig('hostname', $value);
71
- return $this;
72
- }
73
-
74
- /**
75
- * Get the username from the config
76
- * @return String
77
- */
78
- public function getUsername()
79
- {
80
- return $this->_getConfig('username');
81
- }
82
-
83
- /**
84
- * Set the username to the config
85
- * @param String
86
- * @return Copernica_MarketingSoftware_Helper_Config
87
- */
88
- public function setUsername($value)
89
- {
90
- $this->_setConfig('username', $value);
91
- return $this;
92
- }
93
-
94
- /**
95
- * Get the accountname from the config
96
- * @return String
97
- */
98
- public function getAccount()
99
- {
100
- return $this->_getConfig('account');
101
- }
102
-
103
- /**
104
- * Store the accountname in the config
105
- * @param String
106
- * @return Copernica_MarketingSoftware_Helper_Config
107
- */
108
- public function setAccount($value)
109
- {
110
- $this->_setConfig('account', $value);
111
- return $this;
112
- }
113
-
114
- /**
115
- * Get the password from the config
116
- * @return String
117
- */
118
- public function getPassword()
119
- {
120
- return $this->_getConfig('password');
121
- }
122
-
123
- /**
124
- * Set the password in the config
125
- * @param String
126
- */
127
- public function setPassword($value)
128
- {
129
- $this->_setConfig('password', $value);
130
- return $this;
131
- }
132
-
133
- /**
134
- * Get the name of the database
135
- * @return String
136
- */
137
- public function getDatabaseName()
138
- {
139
- return $this->_getConfig('database');
140
- }
141
-
142
- /**
143
- * Set the name of the database
144
- * @param String
145
- * @return Copernica_MarketingSoftware_Helper_Config
146
- */
147
- public function setDatabaseName($value)
148
- {
149
- $this->_setConfig('database', $value);
150
- return $this;
151
- }
152
-
153
- /**
154
- * Get the linked customer fields
155
- * @return array assoc array of fields which have been linked
156
- */
157
- public function getLinkedCustomerFields()
158
- {
159
- // Get the value
160
- $value = $this->_getConfig('linked_customer_fields');
161
-
162
- // What value is found?
163
- $value = empty($value) ? array() : json_decode($value, true);
164
-
165
- // is this an old data entry (prior to 1.2.0)
166
- if (!isset($value['customer_email'])) return $value;
167
-
168
- // yes this is old data... time for a small conversion
169
- $oldValues = $value;
170
- $newValues = array();
171
-
172
- // iterate over the data
173
- foreach ($oldValues as $key => $value)
174
- {
175
- $key = str_replace('customer_', '', $key);
176
- $newValues[$key] = $value;
177
- }
178
-
179
- // store the converted values
180
- $this->setLinkedCustomerFields($newValues);
181
-
182
- // return the new Values
183
- return $newValues;
184
- }
185
-
186
- /**
187
- * Set the linked customer fields
188
- * @param array assoc array of fields which have been linked
189
- * @return Copernica_MarketingSoftware_Helper_Config
190
- */
191
- public function setLinkedCustomerFields($value)
192
- {
193
- $this->_setConfig('linked_customer_fields', json_encode($value), true);
194
- return $this;
195
- }
196
-
197
- /**
198
- * Get the name of the not-ordered products collection
199
- * @return string
200
- */
201
- public function getCartItemsCollectionName()
202
- {
203
- return $this->_getConfig('cart_items_collection_name');
204
- }
205
-
206
- /**
207
- * Set the name of the not-ordered products collection
208
- * @param String
209
- * @return Copernica_MarketingSoftware_Helper_Config
210
- */
211
- public function setCartItemsCollectionName($value)
212
- {
213
- $this->_setConfig('cart_items_collection_name', $value);
214
- return $this;
215
- }
216
-
217
- /**
218
- * Get the linked customer fields
219
- * @return array assoc array of fields which have been linked
220
- */
221
- public function getLinkedCartItemFields()
222
- {
223
- $value = $this->_getConfig('linked_cart_item_fields');
224
-
225
- // What value is found?
226
- if (empty($value)) return array();
227
- else return json_decode($value, true);
228
- }
229
-
230
- /**
231
- * Get the linked customer fields
232
- * @param array assoc array of fields which have been linked
233
- * @return Copernica_MarketingSoftware_Helper_Config
234
- */
235
- public function setLinkedCartItemFields($value)
236
- {
237
- $this->_setConfig('linked_cart_item_fields', json_encode($value), true);
238
- return $this;
239
- }
240
-
241
- /**
242
- * Get the name of the orders collection
243
- * @return String
244
- */
245
- public function getOrdersCollectionName()
246
- {
247
- return $this->_getConfig('orders_collection_name');
248
- }
249
-
250
- /**
251
- * Set the name of the orders collection
252
- * @param String
253
- * @return Copernica_MarketingSoftware_Helper_Config
254
- */
255
- public function setOrdersCollectionName($value)
256
- {
257
- $this->_setConfig('orders_collection_name', $value);
258
- return $this;
259
- }
260
-
261
- /**
262
- * Get the linked order fields
263
- * @return array assoc array of fields which have been linked
264
- */
265
- public function getLinkedOrderFields()
266
- {
267
- // Get the value
268
- $value = $this->_getConfig('linked_order_fields');
269
-
270
- // What value is found?
271
- $value = empty($value) ? array() : json_decode($value, true);
272
-
273
- // is this an old data entry (prior to 1.2.0)
274
- if (!isset($value['order_timestamp'])) return $value;
275
-
276
- // yes this is old data... time for a small conversion
277
- $oldValues = $value;
278
- $newValues = array();
279
-
280
- // iterate over the data
281
- foreach ($oldValues as $key => $value)
282
- {
283
- // remove the order prefix and rename the qty field
284
- $key = ($key == 'order_qty') ? 'quantity' : str_replace('order_', '', $key);
285
- $newValues[$key] = $value;
286
- }
287
-
288
- // store the converted values
289
- $this->setLinkedOrderFields($newValues);
290
-
291
- // return the new Values
292
- return $newValues;
293
- }
294
-
295
- /**
296
- * Set the linked order fields
297
- * @param array assoc array of fields which have been linked
298
- * @return Copernica_MarketingSoftware_Helper_Config
299
- */
300
- public function setLinkedOrderFields($value)
301
- {
302
- $this->_setConfig('linked_order_fields', json_encode($value), true);
303
- return $this;
304
- }
305
-
306
- /**
307
- * Get the name of the collection were all the orders are stored
308
- * @return String
309
- * @return Copernica_MarketingSoftware_Helper_Config
310
- */
311
- public function getOrderItemsCollectionName()
312
- {
313
- return $this->_getConfig('order_items_collection_name');
314
- }
315
-
316
- /**
317
- * Get the name of the collection were all the orders are stored
318
- * @param String
319
- */
320
- public function setOrderItemsCollectionName($value)
321
- {
322
- $this->_setConfig('order_items_collection_name', $value);
323
- return $this;
324
- }
325
-
326
- /**
327
- * Get the linked order item fields
328
- * @return array assoc array of fields which have been linked
329
- */
330
- public function getLinkedOrderItemFields()
331
- {
332
- $value = $this->_getConfig('linked_order_item_fields');
333
-
334
- // What value is found?
335
- $value = empty($value) ? array() : json_decode($value, true);
336
-
337
- // is this an old data entry (prior to 1.2.0)
338
- if (!isset($value['product_internal_id'])) return $value;
339
-
340
- // yes this is old data... time for a small conversion
341
- $oldValues = $value;
342
- $newValues = array();
343
-
344
- // iterate over the data
345
- foreach ($oldValues as $key => $value)
346
- {
347
- // remove the order prefix and rename the qty field
348
- if ($key == 'product_qty') $key = 'quantity';
349
- elseif ($key == 'product_base_row_total') $key = 'total_price';
350
- else $key = str_replace('product_', '', $key);
351
-
352
- // assign it to the new values
353
- $newValues[$key] = $value;
354
- }
355
-
356
- // store the converted values
357
- $this->setLinkedOrderItemFields($newValues);
358
-
359
- // return the new Values
360
- return $newValues;
361
- }
362
-
363
- /**
364
- * Set the linked order item fields
365
- * @param array assoc array of fields which have been linked
366
- * @return Copernica_MarketingSoftware_Helper_Config
367
- */
368
- public function setLinkedOrderItemFields($value)
369
- {
370
- $this->_setConfig('linked_order_item_fields', json_encode($value), true);
371
- return $this;
372
- }
373
-
374
- /**
375
- * Get the address collection name
376
- * @return String
377
- */
378
- public function getAddressesCollectionName()
379
- {
380
- return $this->_getConfig('address_collection_name');
381
- }
382
-
383
- /**
384
- * Set the name of the collection with addresses
385
- */
386
- public function setAddressesCollectionName($value)
387
- {
388
- $this->_setConfig('address_collection_name', $value);
389
- return $this;
390
- }
391
-
392
- /**
393
- * Get the linked address fields
394
- * @return array assoc array of fields which have been linked
395
- */
396
- public function getLinkedAddressFields()
397
- {
398
- $value = $this->_getConfig('linked_address_fields');
399
-
400
- // What value is found?
401
- $value = empty($value) ? array() : json_decode($value, true);
402
-
403
- // is this an old data entry (prior to 1.2.0)
404
- if (!isset($value['address_firstname'])) return $value;
405
-
406
- // yes this is old data... time for a small conversion
407
- $oldValues = $value;
408
- $newValues = array();
409
-
410
- // iterate over the data
411
- foreach ($oldValues as $key => $value)
412
- {
413
- // remove the order prefix and rename the qty field
414
- $key = str_replace('address_', '', $key);
415
- $newValues[$key] = $value;
416
- }
417
-
418
- // store the converted values
419
- $this->setLinkedAddressFields($newValues);
420
-
421
- // return the new Values
422
- return $newValues;
423
- }
424
-
425
- /**
426
- * set the linked address fields
427
- * @param array assoc array of fields which have been linked
428
- * @return Copernica_MarketingSoftware_Helper_Config
429
- */
430
- public function setLinkedAddressFields($value)
431
- {
432
- $this->_setConfig('linked_address_fields', json_encode($value), true);
433
- return $this;
434
- }
435
-
436
- /**
437
- * Get the progress status for customers
438
- * This is the created timestamp of the most recent customer which has
439
- * been queued for synchronisation
440
- * @return datetime
441
- */
442
- public function getCustomerProgressStatus()
443
- {
444
- return $this->_getConfig('customer_progress_status');
445
- }
446
-
447
- /**
448
- * Set the progress status for customers
449
- * This is the created timestamp of the most recent customer which has
450
- * been queued for synchronisation
451
- * @param datetime
452
- */
453
- public function setCustomerProgressStatus($value)
454
- {
455
- $this->_setConfig('customer_progress_status', $value);
456
- return $this;
457
- }
458
-
459
- /**
460
- * Get the progress status for orders
461
- * This is the created timestamp of the most recent order which has
462
- * been queued for synchronisation
463
- * @return datetime
464
- */
465
- public function getOrderProgressStatus()
466
- {
467
- return $this->_getConfig('order_progress_status');
468
- }
469
-
470
- /**
471
- * Set the progress status for orders
472
- * This is the created timestamp of the most recent order which has
473
- * been queued for synchronisation
474
- * @param datetime
475
- */
476
- public function setOrderProgressStatus($value)
477
- {
478
- $this->_setConfig('order_progress_status', $value);
479
- return $this;
480
- }
481
-
482
- /**
483
- * Get the progress status for subscriptions
484
- * This is the created timestamp of the most recent subscription which has
485
- * been queued for synchronisation
486
- * @return datetime
487
- */
488
- public function getSubscriptionProgressStatus()
489
- {
490
- return $this->_getConfig('subscription_progress_status');
491
- }
492
-
493
- /**
494
- * Set the progress status for subscriptions
495
- * This is the created timestamp of the most recent subscription which has
496
- * been queued for synchronisation
497
- * @param datetime
498
- */
499
- public function setSubscriptionProgressStatus($value)
500
- {
501
- $this->_setConfig('subscription_progress_status', $value);
502
- return $this;
503
- }
504
-
505
- /**
506
- * Get the last start time of the cronjob.
507
- * @return datetime
508
- */
509
- public function getLastStartTimeCronjob()
510
- {
511
- return $this->_getConfig('cronjob_starttime');
512
- }
513
-
514
- /**
515
- * Set the last start time of the cronjob.
516
- * @param datetime
517
- */
518
- public function setLastStartTimeCronjob($value)
519
- {
520
- $this->_setConfig('cronjob_starttime', $value);
521
- return $this;
522
- }
523
-
524
- /**
525
- * Get the last end time of the cronjob.
526
- * @return datetime
527
- */
528
- public function getLastEndTimeCronjob()
529
- {
530
- return $this->_getConfig('cronjob_endtime');
531
- }
532
-
533
- /**
534
- * Set the last end time of the cronjob.
535
- * @param datetime
536
- */
537
- public function setLastEndTimeCronjob($value)
538
- {
539
- $this->_setConfig('cronjob_endtime', $value, true);
540
- return $this;
541
- }
542
-
543
- /**
544
- * Get the number of processed records of the last cronjob run.
545
- * @return integer
546
- */
547
- public function getLastCronjobProcessedTasks()
548
- {
549
- return (int)$this->_getConfig('cronjob_processedtasks');
550
- }
551
-
552
- /**
553
- * Set the last end time of the cronjob.
554
- * @param integer
555
- */
556
- public function setLastCronjobProcessedTasks($value)
557
- {
558
- $this->_setConfig('cronjob_processedtasks', $value);
559
- return $this;
560
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
561
  }
1
  <?php
2
+ /**
3
+ * Copernica Marketing Software
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0).
8
+ * It is available through the world-wide-web at this URL:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to obtain a copy of the license through the
11
+ * world-wide-web, please send an email to copernica@support.cream.nl
12
+ * so we can send you a copy immediately.
13
+ *
14
+ * DISCLAIMER
15
+ *
16
+ * Do not edit or add to this file if you wish to upgrade this software
17
+ * to newer versions in the future. If you wish to customize this module
18
+ * for your needs please refer to http://www.magento.com/ for more
19
+ * information.
20
+ *
21
+ * @category Copernica
22
+ * @package Copernica_MarketingSoftware
23
+ * @copyright Copyright (c) 2011-2012 Copernica & Cream. (http://docs.cream.nl/)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ /**
28
+ * Copernica config helper
29
+ *
30
+ *
31
+ */
32
  class Copernica_MarketingSoftware_Helper_Config extends Mage_Core_Helper_Abstract
33
  {
34
+ /**
35
+ * Define a prefix used for the config
36
+ * @name CONFIG_BASE a prefix
37
+ */
38
+ const CONFIG_BASE = 'marketingsoftware/';
39
+
40
+ /**
41
+ * Holds a list of previously requested key names
42
+ * @var array
43
+ */
44
+ protected static $_keyNameCache = array();
45
+
46
+ /**
47
+ * List of already requested or used config entries
48
+ *
49
+ * @var array
50
+ */
51
+ protected static $_configEntryCache = array();
52
+
53
+ /**
54
+ * Magic method to get configurations from the database
55
+ * @param string $method
56
+ * @param array $params
57
+ * @return string
58
+ */
59
+ public function __call($method, $params)
60
+ {
61
+ switch (substr($method, 0, 3)) {
62
+
63
+ case 'get':
64
+ $key = $this->_toKeyName(substr($method, 3));
65
+ return $this->_getCustomConfig($key);
66
+
67
+ break;
68
+
69
+ case 'set':
70
+ // Check if the first parameter is set
71
+ if (!isset($params) || !isset($params[0])) return false;
72
+
73
+ $key = $this->_toKeyName(substr($method, 3));
74
+ $this->_setCustomConfig($key, $params[0]);
75
+
76
+ break;
77
+
78
+ case 'has':
79
+ $key = $this->_toKeyName(substr($method, 3));
80
+ return $this->_hasCustomConfig($key);
81
+
82
+ break;
83
+
84
+ case 'uns':
85
+ $key = $this->_toKeyName(substr($method, 3));
86
+ $model = $this->_getModel($key);
87
+
88
+ if ($model !== false) {
89
+ try {
90
+ $model->delete();
91
+
92
+ if (isset(self::$_configEntryCache[$key])) {
93
+ self::$_configEntryCache[$key] = null;
94
+ }
95
+ } catch (Exception $e) {
96
+ Mage::log('Marketingsoftware Config: ' . $e->getMessage());
97
+ }
98
+ }
99
+
100
+ break;
101
+ }
102
+
103
+ return false;
104
+ }
105
+
106
+ /**
107
+ * Tries to get config value from custom config table
108
+ * @param string $key
109
+ * @return string
110
+ */
111
+ protected function _getCustomConfig($key)
112
+ {
113
+ if (isset(self::$_configEntryCache[$key])) {
114
+ return self::$_configEntryCache[$key];
115
+ }
116
+
117
+ $model = $this->_getModel($key);
118
+ if ($model !== false) {
119
+ return $model->getValue();
120
+ }
121
+
122
+ return null;
123
+ }
124
+
125
+ /**
126
+ * Sets a config entry in the custom config tab
127
+ * @param string $key
128
+ * @param string $value
129
+ */
130
+ protected function _setCustomConfig($key, $value)
131
+ {
132
+ $model = $this->_getModel($key);
133
+
134
+ if ($model === false) {
135
+ $model = Mage::getModel('marketingsoftware/config');
136
+ }
137
+
138
+ try {
139
+ $model->setKeyName($key);
140
+ $model->setValue($value);
141
+ $model->save();
142
+
143
+ self::$_configEntryCache[$key] = $model->getValue();
144
+
145
+ return $model->getValue();
146
+
147
+ } catch (Exception $e) {
148
+ Mage::log('Marketingsoftware Config: ' . $e->getMessage());
149
+ }
150
+ }
151
+
152
+ /**
153
+ * Checks if an entry exists in the custom config table
154
+ * @param string $key
155
+ * @return boolean
156
+ */
157
+ protected function _hasCustomConfig($key)
158
+ {
159
+ return ((isset(self::$_configEntryCache[$key]) && !empty(self::$_configEntryCache[$key])) || ($this->_getModel($key) !== false));
160
+ }
161
+
162
+ /**
163
+ * Loads the requested model config object if possible
164
+ *
165
+ * @param string $key
166
+ * @return Copernica_MarketingSoftware_Model_Config
167
+ */
168
+ protected function _getModel($key)
169
+ {
170
+ $model = Mage::getModel('marketingsoftware/config')->loadByKey($key);
171
+
172
+ if ($model && $model->getId()) {
173
+ self::$_configEntryCache[$key] = $model->getValue();
174
+ return $model;
175
+ }
176
+
177
+ return false;
178
+ }
179
+
180
+ /**
181
+ * Prepends uppercase characters with underscores and lowers
182
+ * the whole string
183
+ *
184
+ * @param string $name
185
+ * @return string
186
+ */
187
+ protected function _toKeyName($name)
188
+ {
189
+ if (isset(self::$_keyNameCache[$name])) {
190
+ return self::$_keyNameCache[$name];
191
+ }
192
+
193
+ $result = strtolower(preg_replace('/(.)([A-Z])/', "$1_$2", $name));
194
+
195
+ self::$_keyNameCache[$name] = $result;
196
+ return $result;
197
+ }
198
+
199
+ /**
200
+ * Get the config item from the custom config table, otherwise from
201
+ * the basic magento component.
202
+ * @param string $name Name of the config parameter
203
+ */
204
+ protected function _getConfig($name)
205
+ {
206
+ if ($this->_hasCustomConfig($name)) {
207
+ return $this->_getCustomConfig($name);
208
+ } else {
209
+ // scope is added to the beginning of the path
210
+ return (string) Mage::getConfig()->getNode(self::CONFIG_BASE . $name, 'default', 0);
211
+ }
212
+ }
213
+
214
+ /**
215
+ * Set the config item from the basic magento component
216
+ * @param string $name Name of the config parameter
217
+ * @param string $value Value that should be stored in the config
218
+ */
219
+ protected function _setConfig($name, $value)
220
+ {
221
+ // is this value new the same as the existing value
222
+ if ($value === $this->_getConfig($name)) return;
223
+
224
+ // Store the value in the custom config
225
+ $this->_setCustomConfig($name, $value);
226
+
227
+ // some config items are not that interesting
228
+ if (in_array($name, array(
229
+ 'customer_progress_status',
230
+ 'order_progress_status',
231
+ 'subscription_progress_status',
232
+ 'cronjob_starttime',
233
+ 'cronjob_endtime',
234
+ 'cronjob_processedtasks',
235
+ ))) return;
236
+
237
+ // We have to reset the progress status
238
+ $this->setCustomerProgressStatus('0');
239
+ $this->setOrderProgressStatus('0');
240
+ $this->setSubscriptionProgressStatus('0');
241
+ }
242
+
243
+ /**
244
+ * Get the hostname from the config
245
+ * @return String
246
+ */
247
+ public function getHostname()
248
+ {
249
+ return $this->_getConfig('hostname');
250
+ }
251
+
252
+ /**
253
+ * Set the hostname from the config
254
+ * @return String
255
+ * @return Copernica_MarketingSoftware_Helper_Config
256
+ */
257
+ public function setHostname($value)
258
+ {
259
+ $this->_setConfig('hostname', $value);
260
+ return $this;
261
+ }
262
+
263
+ /**
264
+ * Get the username from the config
265
+ * @return String
266
+ */
267
+ public function getUsername()
268
+ {
269
+ return $this->_getConfig('username');
270
+ }
271
+
272
+ /**
273
+ * Set the username to the config
274
+ * @param String
275
+ * @return Copernica_MarketingSoftware_Helper_Config
276
+ */
277
+ public function setUsername($value)
278
+ {
279
+ $this->_setConfig('username', $value);
280
+ return $this;
281
+ }
282
+
283
+ /**
284
+ * Get the accountname from the config
285
+ * @return String
286
+ */
287
+ public function getAccount()
288
+ {
289
+ return $this->_getConfig('account');
290
+ }
291
+
292
+ /**
293
+ * Store the accountname in the config
294
+ * @param String
295
+ * @return Copernica_MarketingSoftware_Helper_Config
296
+ */
297
+ public function setAccount($value)
298
+ {
299
+ $this->_setConfig('account', $value);
300
+ return $this;
301
+ }
302
+
303
+ /**
304
+ * Get the password from the config
305
+ * @return String
306
+ */
307
+ public function getPassword()
308
+ {
309
+ return $this->_getConfig('password');
310
+ }
311
+
312
+ /**
313
+ * Set the password in the config
314
+ * @param String
315
+ */
316
+ public function setPassword($value)
317
+ {
318
+ $this->_setConfig('password', $value);
319
+ return $this;
320
+ }
321
+
322
+ /**
323
+ * Get the name of the database
324
+ * @return String
325
+ */
326
+ public function getDatabaseName()
327
+ {
328
+ return $this->_getConfig('database');
329
+ }
330
+
331
+ /**
332
+ * Set the name of the database
333
+ * @param String
334
+ * @return Copernica_MarketingSoftware_Helper_Config
335
+ */
336
+ public function setDatabaseName($value)
337
+ {
338
+ $this->_setConfig('database', $value);
339
+ return $this;
340
+ }
341
+
342
+ /**
343
+ * Get the linked customer fields
344
+ * @return array assoc array of fields which have been linked
345
+ */
346
+ public function getLinkedCustomerFields()
347
+ {
348
+ // Get the value
349
+ $value = $this->_getConfig('linked_customer_fields');
350
+
351
+ // What value is found?
352
+ $value = empty($value) ? array() : json_decode($value, true);
353
+
354
+ // is this an old data entry (prior to 1.2.0)
355
+ if (!isset($value['customer_email'])) return $value;
356
+
357
+ // yes this is old data... time for a small conversion
358
+ $oldValues = $value;
359
+ $newValues = array();
360
+
361
+ // iterate over the data
362
+ foreach ($oldValues as $key => $value)
363
+ {
364
+ $key = str_replace('customer_', '', $key);
365
+ $newValues[$key] = $value;
366
+ }
367
+
368
+ // store the converted values
369
+ $this->setLinkedCustomerFields($newValues);
370
+
371
+ // return the new Values
372
+ return $newValues;
373
+ }
374
+
375
+ /**
376
+ * Set the linked customer fields
377
+ * @param array assoc array of fields which have been linked
378
+ * @return Copernica_MarketingSoftware_Helper_Config
379
+ */
380
+ public function setLinkedCustomerFields($value)
381
+ {
382
+ $this->_setConfig('linked_customer_fields', json_encode($value), true);
383
+ return $this;
384
+ }
385
+
386
+ /**
387
+ * Get the name of the not-ordered products collection
388
+ * @return string
389
+ */
390
+ public function getCartItemsCollectionName()
391
+ {
392
+ return $this->_getConfig('cart_items_collection_name');
393
+ }
394
+
395
+ /**
396
+ * Set the name of the not-ordered products collection
397
+ * @param String
398
+ * @return Copernica_MarketingSoftware_Helper_Config
399
+ */
400
+ public function setCartItemsCollectionName($value)
401
+ {
402
+ $this->_setConfig('cart_items_collection_name', $value);
403
+ return $this;
404
+ }
405
+
406
+ /**
407
+ * Get the linked customer fields
408
+ * @return array assoc array of fields which have been linked
409
+ */
410
+ public function getLinkedCartItemFields()
411
+ {
412
+ $value = $this->_getConfig('linked_cart_item_fields');
413
+
414
+ // What value is found?
415
+ if (empty($value)) return array();
416
+ else return json_decode($value, true);
417
+ }
418
+
419
+ /**
420
+ * Get the linked customer fields
421
+ * @param array assoc array of fields which have been linked
422
+ * @return Copernica_MarketingSoftware_Helper_Config
423
+ */
424
+ public function setLinkedCartItemFields($value)
425
+ {
426
+ $this->_setConfig('linked_cart_item_fields', json_encode($value), true);
427
+ return $this;
428
+ }
429
+
430
+ /**
431
+ * Get the name of the orders collection
432
+ * @return String
433
+ */
434
+ public function getOrdersCollectionName()
435
+ {
436
+ return $this->_getConfig('orders_collection_name');
437
+ }
438
+
439
+ /**
440
+ * Set the name of the orders collection
441
+ * @param String
442
+ * @return Copernica_MarketingSoftware_Helper_Config
443
+ */
444
+ public function setOrdersCollectionName($value)
445
+ {
446
+ $this->_setConfig('orders_collection_name', $value);
447
+ return $this;
448
+ }
449
+
450
+ /**
451
+ * Get the linked order fields
452
+ * @return array assoc array of fields which have been linked
453
+ */
454
+ public function getLinkedOrderFields()
455
+ {
456
+ // Get the value
457
+ $value = $this->_getConfig('linked_order_fields');
458
+
459
+ // What value is found?
460
+ $value = empty($value) ? array() : json_decode($value, true);
461
+
462
+ // is this an old data entry (prior to 1.2.0)
463
+ if (!isset($value['order_timestamp'])) return $value;
464
+
465
+ // yes this is old data... time for a small conversion
466
+ $oldValues = $value;
467
+ $newValues = array();
468
+
469
+ // iterate over the data
470
+ foreach ($oldValues as $key => $value)
471
+ {
472
+ // remove the order prefix and rename the qty field
473
+ $key = ($key == 'order_qty') ? 'quantity' : str_replace('order_', '', $key);
474
+ $newValues[$key] = $value;
475
+ }
476
+
477
+ // store the converted values
478
+ $this->setLinkedOrderFields($newValues);
479
+
480
+ // return the new Values
481
+ return $newValues;
482
+ }
483
+
484
+ /**
485
+ * Set the linked order fields
486
+ * @param array assoc array of fields which have been linked
487
+ * @return Copernica_MarketingSoftware_Helper_Config
488
+ */
489
+ public function setLinkedOrderFields($value)
490
+ {
491
+ $this->_setConfig('linked_order_fields', json_encode($value), true);
492
+ return $this;
493
+ }
494
+
495
+ /**
496
+ * Get the name of the collection were all the orders are stored
497
+ * @return String
498
+ * @return Copernica_MarketingSoftware_Helper_Config
499
+ */
500
+ public function getOrderItemsCollectionName()
501
+ {
502
+ return $this->_getConfig('order_items_collection_name');
503
+ }
504
+
505
+ /**
506
+ * Get the name of the collection were all the orders are stored
507
+ * @param String
508
+ */
509
+ public function setOrderItemsCollectionName($value)
510
+ {
511
+ $this->_setConfig('order_items_collection_name', $value);
512
+ return $this;
513
+ }
514
+
515
+ /**
516
+ * Get the linked order item fields
517
+ * @return array assoc array of fields which have been linked
518
+ */
519
+ public function getLinkedOrderItemFields()
520
+ {
521
+ $value = $this->_getConfig('linked_order_item_fields');
522
+
523
+ // What value is found?
524
+ $value = empty($value) ? array() : json_decode($value, true);
525
+
526
+ // is this an old data entry (prior to 1.2.0)
527
+ if (!isset($value['product_internal_id'])) return $value;
528
+
529
+ // yes this is old data... time for a small conversion
530
+ $oldValues = $value;
531
+ $newValues = array();
532
+
533
+ // iterate over the data
534
+ foreach ($oldValues as $key => $value)
535
+ {
536
+ // remove the order prefix and rename the qty field
537
+ if ($key == 'product_qty') $key = 'quantity';
538
+ elseif ($key == 'product_base_row_total') $key = 'total_price';
539
+ else $key = str_replace('product_', '', $key);
540
+
541
+ // assign it to the new values
542
+ $newValues[$key] = $value;
543
+ }
544
+
545
+ // store the converted values
546
+ $this->setLinkedOrderItemFields($newValues);
547
+
548
+ // return the new Values
549
+ return $newValues;
550
+ }
551
+
552
+ /**
553
+ * Set the linked order item fields
554
+ * @param array assoc array of fields which have been linked
555
+ * @return Copernica_MarketingSoftware_Helper_Config
556
+ */
557
+ public function setLinkedOrderItemFields($value)
558
+ {
559
+ $this->_setConfig('linked_order_item_fields', json_encode($value), true);
560
+ return $this;
561
+ }
562
+
563
+ /**
564
+ * Get the address collection name
565
+ * @return String
566
+ */
567
+ public function getAddressesCollectionName()
568
+ {
569
+ return $this->_getConfig('address_collection_name');
570
+ }
571
+
572
+ /**
573
+ * Set the name of the collection with addresses
574
+ */
575
+ public function setAddressesCollectionName($value)
576
+ {
577
+ $this->_setConfig('address_collection_name', $value);
578
+ return $this;
579
+ }
580
+
581
+ /**
582
+ * Get the linked address fields
583
+ * @return array assoc array of fields which have been linked
584
+ */
585
+ public function getLinkedAddressFields()
586
+ {
587
+ $value = $this->_getConfig('linked_address_fields');
588
+
589
+ // What value is found?
590
+ $value = empty($value) ? array() : json_decode($value, true);
591
+
592
+ // is this an old data entry (prior to 1.2.0)
593
+ if (!isset($value['address_firstname'])) return $value;
594
+
595
+ // yes this is old data... time for a small conversion
596
+ $oldValues = $value;
597
+ $newValues = array();
598
+
599
+ // iterate over the data
600
+ foreach ($oldValues as $key => $value)
601
+ {
602
+ // remove the order prefix and rename the qty field
603
+ $key = str_replace('address_', '', $key);
604
+ $newValues[$key] = $value;
605
+ }
606
+
607
+ // store the converted values
608
+ $this->setLinkedAddressFields($newValues);
609
+
610
+ // return the new Values
611
+ return $newValues;
612
+ }
613
+
614
+ /**
615
+ * set the linked address fields
616
+ * @param array assoc array of fields which have been linked
617
+ * @return Copernica_MarketingSoftware_Helper_Config
618
+ */
619
+ public function setLinkedAddressFields($value)
620
+ {
621
+ $this->_setConfig('linked_address_fields', json_encode($value), true);
622
+ return $this;
623
+ }
624
+
625
+ /**
626
+ * Get the progress status for customers
627
+ * This is the created timestamp of the most recent customer which has
628
+ * been queued for synchronisation
629
+ * @return datetime
630
+ */
631
+ public function getCustomerProgressStatus()
632
+ {
633
+ return $this->_getConfig('customer_progress_status');
634
+ }
635
+
636
+ /**
637
+ * Set the progress status for customers
638
+ * This is the created timestamp of the most recent customer which has
639
+ * been queued for synchronisation
640
+ * @param datetime
641
+ */
642
+ public function setCustomerProgressStatus($value)
643
+ {
644
+ $this->_setConfig('customer_progress_status', $value);
645
+ return $this;
646
+ }
647
+
648
+ /**
649
+ * Get the progress status for orders
650
+ * This is the created timestamp of the most recent order which has
651
+ * been queued for synchronisation
652
+ * @return datetime
653
+ */
654
+ public function getOrderProgressStatus()
655
+ {
656
+ return $this->_getConfig('order_progress_status');
657
+ }
658
+
659
+ /**
660
+ * Set the progress status for orders
661
+ * This is the created timestamp of the most recent order which has
662
+ * been queued for synchronisation
663
+ * @param datetime
664
+ */
665
+ public function setOrderProgressStatus($value)
666
+ {
667
+ $this->_setConfig('order_progress_status', $value);
668
+ return $this;
669
+ }
670
+
671
+ /**
672
+ * Get the progress status for subscriptions
673
+ * This is the created timestamp of the most recent subscription which has
674
+ * been queued for synchronisation
675
+ * @return datetime
676
+ */
677
+ public function getSubscriptionProgressStatus()
678
+ {
679
+ return $this->_getConfig('subscription_progress_status');
680
+ }
681
+
682
+ /**
683
+ * Set the progress status for subscriptions
684
+ * This is the created timestamp of the most recent subscription which has
685
+ * been queued for synchronisation
686
+ * @param datetime
687
+ */
688
+ public function setSubscriptionProgressStatus($value)
689
+ {
690
+ $this->_setConfig('subscription_progress_status', $value);
691
+ return $this;
692
+ }
693
+
694
+ /**
695
+ * Get the last start time of the cronjob.
696
+ * @return datetime
697
+ */
698
+ public function getLastStartTimeCronjob()
699
+ {
700
+ return $this->_getConfig('cronjob_starttime');
701
+ }
702
+
703
+ /**
704
+ * Set the last start time of the cronjob.
705
+ * @param datetime
706
+ */
707
+ public function setLastStartTimeCronjob($value)
708
+ {
709
+ $this->_setConfig('cronjob_starttime', $value);
710
+ return $this;
711
+ }
712
+
713
+ /**
714
+ * Get the last end time of the cronjob.
715
+ * @return datetime
716
+ */
717
+ public function getLastEndTimeCronjob()
718
+ {
719
+ return $this->_getConfig('cronjob_endtime');
720
+ }
721
+
722
+ /**
723
+ * Set the last end time of the cronjob.
724
+ * @param datetime
725
+ */
726
+ public function setLastEndTimeCronjob($value)
727
+ {
728
+ $this->_setConfig('cronjob_endtime', $value, true);
729
+ return $this;
730
+ }
731
+
732
+ /**
733
+ * Get the number of processed records of the last cronjob run.
734
+ * @return integer
735
+ */
736
+ public function getLastCronjobProcessedTasks()
737
+ {
738
+ return (int)$this->_getConfig('cronjob_processedtasks');
739
+ }
740
+
741
+ /**
742
+ * Set the last end time of the cronjob.
743
+ * @param integer
744
+ */
745
+ public function setLastCronjobProcessedTasks($value)
746
+ {
747
+ $this->_setConfig('cronjob_processedtasks', $value);
748
+ return $this;
749
+ }
750
  }
app/code/community/Copernica/MarketingSoftware/Helper/Data.php CHANGED
@@ -1,4 +1,29 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  /** The CopernicaError is required **/
3
  require_once(dirname(__FILE__).'/../Model/Error.php');
4
 
1
  <?php
2
+ /**
3
+ * Copernica Marketing Software
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0).
8
+ * It is available through the world-wide-web at this URL:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to obtain a copy of the license through the
11
+ * world-wide-web, please send an email to copernica@support.cream.nl
12
+ * so we can send you a copy immediately.
13
+ *
14
+ * DISCLAIMER
15
+ *
16
+ * Do not edit or add to this file if you wish to upgrade this software
17
+ * to newer versions in the future. If you wish to customize this module
18
+ * for your needs please refer to http://www.magento.com/ for more
19
+ * information.
20
+ *
21
+ * @category Copernica
22
+ * @package Copernica_MarketingSoftware
23
+ * @copyright Copyright (c) 2011-2012 Copernica & Cream. (http://docs.cream.nl/)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
  /** The CopernicaError is required **/
28
  require_once(dirname(__FILE__).'/../Model/Error.php');
29
 
app/code/community/Copernica/MarketingSoftware/Model/Abstraction/Address.php CHANGED
@@ -1,4 +1,29 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  /**
3
  * A wrapper object around an Address
4
  */
@@ -8,24 +33,24 @@ class Copernica_MarketingSoftware_Model_Abstraction_Address implements Serializa
8
  * The original object
9
  * @param Mage_Sales_Model_Order_Address|Mage_Sales_Model_Quote_Address|Mage_Customer_Model_Address
10
  */
11
- private $original;
12
 
13
  /**
14
  * Predefine the internal fields
15
  */
16
- private $id;
17
- private $type;
18
- private $name;
19
- private $email;
20
- private $street;
21
- private $city;
22
- private $zipcode;
23
- private $state;
24
- private $countryCode;
25
- private $telephone;
26
- private $fax;
27
- private $company;
28
- private $customerId;
29
 
30
  /**
31
  * Sets the original model
1
  <?php
2
+ /**
3
+ * Copernica Marketing Software
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0).
8
+ * It is available through the world-wide-web at this URL:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to obtain a copy of the license through the
11
+ * world-wide-web, please send an email to copernica@support.cream.nl
12
+ * so we can send you a copy immediately.
13
+ *
14
+ * DISCLAIMER
15
+ *
16
+ * Do not edit or add to this file if you wish to upgrade this software
17
+ * to newer versions in the future. If you wish to customize this module
18
+ * for your needs please refer to http://www.magento.com/ for more
19
+ * information.
20
+ *
21
+ * @category Copernica
22
+ * @package Copernica_MarketingSoftware
23
+ * @copyright Copyright (c) 2011-2012 Copernica & Cream. (http://docs.cream.nl/)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
  /**
28
  * A wrapper object around an Address
29
  */
33
  * The original object
34
  * @param Mage_Sales_Model_Order_Address|Mage_Sales_Model_Quote_Address|Mage_Customer_Model_Address
35
  */
36
+ protected $original;
37
 
38
  /**
39
  * Predefine the internal fields
40
  */
41
+ protected $id;
42
+ protected $type;
43
+ protected $name;
44
+ protected $email;
45
+ protected $street;
46
+ protected $city;
47
+ protected $zipcode;
48
+ protected $state;
49
+ protected $countryCode;
50
+ protected $telephone;
51
+ protected $fax;
52
+ protected $company;
53
+ protected $customerId;
54
 
55
  /**
56
  * Sets the original model
app/code/community/Copernica/MarketingSoftware/Model/Abstraction/Attributes.php CHANGED
@@ -1,4 +1,29 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  /**
3
  * A wrapper object around attributes
4
  */
@@ -8,13 +33,13 @@ class Copernica_MarketingSoftware_Model_Abstraction_Attributes implements Serial
8
  * The original object
9
  * @param Mage_Catalog_Model_Product
10
  */
11
- private $original;
12
 
13
  /**
14
  * Predefine the internal fields
15
  */
16
- private $name;
17
- private $attributes;
18
 
19
  /**
20
  * Sets the original model
1
  <?php
2
+ /**
3
+ * Copernica Marketing Software
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0).
8
+ * It is available through the world-wide-web at this URL:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to obtain a copy of the license through the
11
+ * world-wide-web, please send an email to copernica@support.cream.nl
12
+ * so we can send you a copy immediately.
13
+ *
14
+ * DISCLAIMER
15
+ *
16
+ * Do not edit or add to this file if you wish to upgrade this software
17
+ * to newer versions in the future. If you wish to customize this module
18
+ * for your needs please refer to http://www.magento.com/ for more
19
+ * information.
20
+ *
21
+ * @category Copernica
22
+ * @package Copernica_MarketingSoftware
23
+ * @copyright Copyright (c) 2011-2012 Copernica & Cream. (http://docs.cream.nl/)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
  /**
28
  * A wrapper object around attributes
29
  */
33
  * The original object
34
  * @param Mage_Catalog_Model_Product
35
  */
36
+ protected $original;
37
 
38
  /**
39
  * Predefine the internal fields
40
  */
41
+ protected $name;
42
+ protected $attributes;
43
 
44
  /**
45
  * Sets the original model
app/code/community/Copernica/MarketingSoftware/Model/Abstraction/Customer.php CHANGED
@@ -1,4 +1,29 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  /**
3
  * A wrapper object around a magento Customer
4
  */
@@ -8,19 +33,20 @@ class Copernica_MarketingSoftware_Model_Abstraction_Customer implements Serializ
8
  * The original object
9
  * @param Mage_Customer_Model_Customer
10
  */
11
- private $original;
12
 
13
  /**
14
  * Predefine the internal fields
15
  */
16
- private $id;
17
- private $name;
18
- private $email;
19
- private $subscription;
20
- private $group;
21
- private $addresses;
22
- private $gender;
23
- private $storeview;
 
24
 
25
 
26
  /**
@@ -106,6 +132,26 @@ class Copernica_MarketingSoftware_Model_Abstraction_Customer implements Serializ
106
  }
107
  else return $this->email;
108
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
109
 
110
  /**
111
  * Returns the gender
@@ -242,6 +288,7 @@ class Copernica_MarketingSoftware_Model_Abstraction_Customer implements Serializ
242
  $this->id(),
243
  $this->name(),
244
  $this->email(),
 
245
  $this->subscription(),
246
  $this->group(),
247
  $this->addresses(),
@@ -265,6 +312,7 @@ class Copernica_MarketingSoftware_Model_Abstraction_Customer implements Serializ
265
  $this->id,
266
  $this->name,
267
  $this->email,
 
268
  $this->subscription,
269
  $this->group,
270
  $this->addresses,
@@ -272,7 +320,7 @@ class Copernica_MarketingSoftware_Model_Abstraction_Customer implements Serializ
272
  ) = $data;
273
 
274
  // do we have a storeview available?
275
- if (isset($data[7])) $this->storeview = $data[7];
276
 
277
  return $this;
278
  }
1
  <?php
2
+ /**
3
+ * Copernica Marketing Software
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0).
8
+ * It is available through the world-wide-web at this URL:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to obtain a copy of the license through the
11
+ * world-wide-web, please send an email to copernica@support.cream.nl
12
+ * so we can send you a copy immediately.
13
+ *
14
+ * DISCLAIMER
15
+ *
16
+ * Do not edit or add to this file if you wish to upgrade this software
17
+ * to newer versions in the future. If you wish to customize this module
18
+ * for your needs please refer to http://www.magento.com/ for more
19
+ * information.
20
+ *
21
+ * @category Copernica
22
+ * @package Copernica_MarketingSoftware
23
+ * @copyright Copyright (c) 2011-2012 Copernica & Cream. (http://docs.cream.nl/)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
  /**
28
  * A wrapper object around a magento Customer
29
  */
33
  * The original object
34
  * @param Mage_Customer_Model_Customer
35
  */
36
+ protected $original;
37
 
38
  /**
39
  * Predefine the internal fields
40
  */
41
+ protected $id;
42
+ protected $name;
43
+ protected $email;
44
+ protected $oldemail;
45
+ protected $subscription;
46
+ protected $group;
47
+ protected $addresses;
48
+ protected $gender;
49
+ protected $storeview;
50
 
51
 
52
  /**
132
  }
133
  else return $this->email;
134
  }
135
+
136
+ /**
137
+ * Method to retrieve the previous email if possible
138
+ * Falls back on self::email()
139
+ *
140
+ * @return string
141
+ */
142
+ public function oldEmail()
143
+ {
144
+ if (is_object($this->original))
145
+ {
146
+ return $this->original->getOrigData('email');
147
+ }
148
+ elseif (isset($this->oldemail))
149
+ {
150
+ return $this->oldemail;
151
+ }
152
+
153
+ return $this->email();
154
+ }
155
 
156
  /**
157
  * Returns the gender
288
  $this->id(),
289
  $this->name(),
290
  $this->email(),
291
+ $this->oldEmail(),
292
  $this->subscription(),
293
  $this->group(),
294
  $this->addresses(),
312
  $this->id,
313
  $this->name,
314
  $this->email,
315
+ $this->oldemail,
316
  $this->subscription,
317
  $this->group,
318
  $this->addresses,
320
  ) = $data;
321
 
322
  // do we have a storeview available?
323
+ if (isset($data[8])) $this->storeview = $data[8];
324
 
325
  return $this;
326
  }
app/code/community/Copernica/MarketingSoftware/Model/Abstraction/Name.php CHANGED
@@ -1,4 +1,29 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  /**
3
  * A wrapper object around a name, note this is not an Magento object
4
  */
@@ -8,15 +33,15 @@ class Copernica_MarketingSoftware_Model_Abstraction_Name implements Serializable
8
  * The original object
9
  * @param Mage_Customer_Model_Customer|Mage_Sales_Model_Order_Address|Mage_Sales_Model_Quote_Address|Mage_Customer_Model_Address
10
  */
11
- private $original;
12
 
13
  /**
14
  * Predefine the internal fields
15
  */
16
- private $firstname;
17
- private $prefix;
18
- private $middlename;
19
- private $lastname;
20
 
21
  /**
22
  * Sets the original model
1
  <?php
2
+ /**
3
+ * Copernica Marketing Software
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0).
8
+ * It is available through the world-wide-web at this URL:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to obtain a copy of the license through the
11
+ * world-wide-web, please send an email to copernica@support.cream.nl
12
+ * so we can send you a copy immediately.
13
+ *
14
+ * DISCLAIMER
15
+ *
16
+ * Do not edit or add to this file if you wish to upgrade this software
17
+ * to newer versions in the future. If you wish to customize this module
18
+ * for your needs please refer to http://www.magento.com/ for more
19
+ * information.
20
+ *
21
+ * @category Copernica
22
+ * @package Copernica_MarketingSoftware
23
+ * @copyright Copyright (c) 2011-2012 Copernica & Cream. (http://docs.cream.nl/)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
  /**
28
  * A wrapper object around a name, note this is not an Magento object
29
  */
33
  * The original object
34
  * @param Mage_Customer_Model_Customer|Mage_Sales_Model_Order_Address|Mage_Sales_Model_Quote_Address|Mage_Customer_Model_Address
35
  */
36
+ protected $original;
37
 
38
  /**
39
  * Predefine the internal fields
40
  */
41
+ protected $firstname;
42
+ protected $prefix;
43
+ protected $middlename;
44
+ protected $lastname;
45
 
46
  /**
47
  * Sets the original model
app/code/community/Copernica/MarketingSoftware/Model/Abstraction/Order.php CHANGED
@@ -1,4 +1,29 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  /**
3
  * A wrapper object around an Order
4
  */
@@ -8,28 +33,28 @@ class Copernica_MarketingSoftware_Model_Abstraction_Order implements Serializabl
8
  * The original object
9
  * @param Mage_Sales_Model_Order
10
  */
11
- private $original;
12
 
13
  /**
14
  * Predefine the internal fields
15
  */
16
- private $id;
17
- private $incrementId;
18
- private $quoteId;
19
- private $quantity;
20
- private $currency;
21
- private $timestamp;
22
- private $customerIP;
23
- private $items;
24
- private $storeview;
25
- private $customerId;
26
- private $addresses;
27
- private $price;
28
- private $weight;
29
- private $state;
30
- private $status;
31
- private $shippingDescription;
32
- private $paymentDescription;
33
 
34
 
35
  /**
1
  <?php
2
+ /**
3
+ * Copernica Marketing Software
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0).
8
+ * It is available through the world-wide-web at this URL:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to obtain a copy of the license through the
11
+ * world-wide-web, please send an email to copernica@support.cream.nl
12
+ * so we can send you a copy immediately.
13
+ *
14
+ * DISCLAIMER
15
+ *
16
+ * Do not edit or add to this file if you wish to upgrade this software
17
+ * to newer versions in the future. If you wish to customize this module
18
+ * for your needs please refer to http://www.magento.com/ for more
19
+ * information.
20
+ *
21
+ * @category Copernica
22
+ * @package Copernica_MarketingSoftware
23
+ * @copyright Copyright (c) 2011-2012 Copernica & Cream. (http://docs.cream.nl/)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
  /**
28
  * A wrapper object around an Order
29
  */
33
  * The original object
34
  * @param Mage_Sales_Model_Order
35
  */
36
+ protected $original;
37
 
38
  /**
39
  * Predefine the internal fields
40
  */
41
+ protected $id;
42
+ protected $incrementId;
43
+ protected $quoteId;
44
+ protected $quantity;
45
+ protected $currency;
46
+ protected $timestamp;
47
+ protected $customerIP;
48
+ protected $items;
49
+ protected $storeview;
50
+ protected $customerId;
51
+ protected $addresses;
52
+ protected $price;
53
+ protected $weight;
54
+ protected $state;
55
+ protected $status;
56
+ protected $shippingDescription;
57
+ protected $paymentDescription;
58
 
59
 
60
  /**
app/code/community/Copernica/MarketingSoftware/Model/Abstraction/Order/Item.php CHANGED
@@ -1,4 +1,29 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  /**
3
  * A wrapper object around an Order Item
4
  */
@@ -8,19 +33,19 @@ class Copernica_MarketingSoftware_Model_Abstraction_Order_Item implements Serial
8
  * The original object
9
  * @param Mage_Sales_Model_Order_Item
10
  */
11
- private $original;
12
 
13
  /**
14
  * Predefine the internal fields
15
  */
16
- private $id;
17
- private $orderId;
18
- private $quantity;
19
- private $price;
20
- private $weight;
21
- private $timestamp;
22
- private $options;
23
- private $product;
24
 
25
  /**
26
  * Sets the original model
1
  <?php
2
+ /**
3
+ * Copernica Marketing Software
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0).
8
+ * It is available through the world-wide-web at this URL:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to obtain a copy of the license through the
11
+ * world-wide-web, please send an email to copernica@support.cream.nl
12
+ * so we can send you a copy immediately.
13
+ *
14
+ * DISCLAIMER
15
+ *
16
+ * Do not edit or add to this file if you wish to upgrade this software
17
+ * to newer versions in the future. If you wish to customize this module
18
+ * for your needs please refer to http://www.magento.com/ for more
19
+ * information.
20
+ *
21
+ * @category Copernica
22
+ * @package Copernica_MarketingSoftware
23
+ * @copyright Copyright (c) 2011-2012 Copernica & Cream. (http://docs.cream.nl/)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
  /**
28
  * A wrapper object around an Order Item
29
  */
33
  * The original object
34
  * @param Mage_Sales_Model_Order_Item
35
  */
36
+ protected $original;
37
 
38
  /**
39
  * Predefine the internal fields
40
  */
41
+ protected $id;
42
+ protected $orderId;
43
+ protected $quantity;
44
+ protected $price;
45
+ protected $weight;
46
+ protected $timestamp;
47
+ protected $options;
48
+ protected $product;
49
 
50
  /**
51
  * Sets the original model
app/code/community/Copernica/MarketingSoftware/Model/Abstraction/Order/Item/Options.php CHANGED
@@ -1,4 +1,29 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  /**
3
  * A wrapper object around order item options
4
  */
@@ -8,13 +33,13 @@ class Copernica_MarketingSoftware_Model_Abstraction_Order_Item_Options implement
8
  * The original object
9
  * @param Mage_Sales_Model_Order_Item
10
  */
11
- private $original;
12
 
13
  /**
14
  * Predefine the internal fields
15
  */
16
- private $name;
17
- private $attributes;
18
 
19
 
20
  /**
@@ -89,7 +114,7 @@ class Copernica_MarketingSoftware_Model_Abstraction_Order_Item_Options implement
89
  * @param array
90
  * @return String
91
  */
92
- private function arrayToString($value, $prefix = '')
93
  {
94
  $string = "";
95
  foreach ($value as $key => $value)
1
  <?php
2
+ /**
3
+ * Copernica Marketing Software
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0).
8
+ * It is available through the world-wide-web at this URL:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to obtain a copy of the license through the
11
+ * world-wide-web, please send an email to copernica@support.cream.nl
12
+ * so we can send you a copy immediately.
13
+ *
14
+ * DISCLAIMER
15
+ *
16
+ * Do not edit or add to this file if you wish to upgrade this software
17
+ * to newer versions in the future. If you wish to customize this module
18
+ * for your needs please refer to http://www.magento.com/ for more
19
+ * information.
20
+ *
21
+ * @category Copernica
22
+ * @package Copernica_MarketingSoftware
23
+ * @copyright Copyright (c) 2011-2012 Copernica & Cream. (http://docs.cream.nl/)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
  /**
28
  * A wrapper object around order item options
29
  */
33
  * The original object
34
  * @param Mage_Sales_Model_Order_Item
35
  */
36
+ protected $original;
37
 
38
  /**
39
  * Predefine the internal fields
40
  */
41
+ protected $name;
42
+ protected $attributes;
43
 
44
 
45
  /**
114
  * @param array
115
  * @return String
116
  */
117
+ protected function arrayToString($value, $prefix = '')
118
  {
119
  $string = "";
120
  foreach ($value as $key => $value)
app/code/community/Copernica/MarketingSoftware/Model/Abstraction/Price.php CHANGED
@@ -1,4 +1,29 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  /**
3
  * A wrapper object around a price
4
  * This is not representing a magento object
@@ -16,19 +41,19 @@ class Copernica_MarketingSoftware_Model_Abstraction_Price implements Serializabl
16
  * The original object
17
  * @param Mage_Sales_Model_Quote|Mage_Sales_Model_Order|Mage_Sales_Model_Quote_Item|Mage_Sales_Model_Order_Item
18
  */
19
- private $original;
20
 
21
  /**
22
  * Predefine the internal fields
23
  */
24
- private $total;
25
- private $costs;
26
- private $itemPrice;
27
- private $originalPrice;
28
- private $discount;
29
- private $tax;
30
- private $shipping;
31
- private $currency;
32
 
33
  /**
34
  * Sets the original model
1
  <?php
2
+ /**
3
+ * Copernica Marketing Software
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0).
8
+ * It is available through the world-wide-web at this URL:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to obtain a copy of the license through the
11
+ * world-wide-web, please send an email to copernica@support.cream.nl
12
+ * so we can send you a copy immediately.
13
+ *
14
+ * DISCLAIMER
15
+ *
16
+ * Do not edit or add to this file if you wish to upgrade this software
17
+ * to newer versions in the future. If you wish to customize this module
18
+ * for your needs please refer to http://www.magento.com/ for more
19
+ * information.
20
+ *
21
+ * @category Copernica
22
+ * @package Copernica_MarketingSoftware
23
+ * @copyright Copyright (c) 2011-2012 Copernica & Cream. (http://docs.cream.nl/)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
  /**
28
  * A wrapper object around a price
29
  * This is not representing a magento object
41
  * The original object
42
  * @param Mage_Sales_Model_Quote|Mage_Sales_Model_Order|Mage_Sales_Model_Quote_Item|Mage_Sales_Model_Order_Item
43
  */
44
+ protected $original;
45
 
46
  /**
47
  * Predefine the internal fields
48
  */
49
+ protected $total;
50
+ protected $costs;
51
+ protected $itemPrice;
52
+ protected $originalPrice;
53
+ protected $discount;
54
+ protected $tax;
55
+ protected $shipping;
56
+ protected $currency;
57
 
58
  /**
59
  * Sets the original model
app/code/community/Copernica/MarketingSoftware/Model/Abstraction/Product.php CHANGED
@@ -1,4 +1,29 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  /**
3
  * A wrapper object around a magento Product
4
  */
@@ -8,25 +33,26 @@ class Copernica_MarketingSoftware_Model_Abstraction_Product implements Serializa
8
  * The original object
9
  * @param Mage_Catalog_Model_Product
10
  */
11
- private $original;
12
 
13
  /**
14
  * Predefine the internal fields
15
  */
16
- private $id;
17
- private $sku;
18
- private $name;
19
- private $description;
20
- private $productUrl;
21
- private $imagePath;
22
- private $weight;
23
- private $categories = array();
24
- private $isNew;
25
- private $price;
26
- private $created;
27
- private $modified;
28
- private $attributes;
29
- private $attributeSet;
 
30
 
31
  /**
32
  * Sets the original model
@@ -34,7 +60,7 @@ class Copernica_MarketingSoftware_Model_Abstraction_Product implements Serializa
34
  * @return Copernica_MarketingSoftware_Model_Abstraction_Product
35
  */
36
  public function setOriginal($original)
37
- {
38
  if ($original instanceof Mage_Catalog_Model_Product) {
39
  //this is the original product
40
  $this->original = $original;
@@ -46,7 +72,7 @@ class Copernica_MarketingSoftware_Model_Abstraction_Product implements Serializa
46
  if ($product->getId()) {
47
  //the product exists
48
  $this->original = $product;
49
- } else {
50
  // unfortunately we do not have the product any more, but we have the information
51
  // so we can fill a lot of fields, so the functions still work
52
  $this->id = $original->getProductId();
@@ -158,6 +184,21 @@ class Copernica_MarketingSoftware_Model_Abstraction_Product implements Serializa
158
  }
159
  else return $this->price;
160
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
161
 
162
  /**
163
  * Return the creation date of this magento product
@@ -203,30 +244,14 @@ class Copernica_MarketingSoftware_Model_Abstraction_Product implements Serializa
203
  else
204
  {
205
  // Get the product
 
206
  $product = is_object($this->original) ? $this->original : Mage::getModel('catalog/product')->load($this->id);
207
-
208
  // Could not load the product, return an empty string
209
  if (!$product->getId()) return '';
210
-
211
- // Retrieve the requested store, null returns the default store
212
- $store = Mage::app()->getStore($storeId);
213
-
214
- // We have a valid product now
215
- $href = Mage::getModel('core/url_rewrite')->loadByIdPath('product/' . $product->getId())->getRequestPath();
216
- if ($href && is_object($store))
217
- {
218
- // Get the url from the store
219
- $url = $store->getUrl('', array('_direct' => $href));
220
-
221
- // Should we use the SEO rewrites
222
- if (Mage::getStoreConfig('web/seo/use_rewrites')) {
223
- return str_replace('index.php/', '', $url);
224
- } else {
225
- return $url;
226
- }
227
- }
228
- // or use the default if it doesn't exist
229
- else return $product->getProductUrl();
230
  }
231
  }
232
 
@@ -244,7 +269,7 @@ class Copernica_MarketingSoftware_Model_Abstraction_Product implements Serializa
244
  }
245
  else $path = $this->imagePath;
246
 
247
- // most likely store `false` is supplied to the function, if the path
248
  // is empty it is also not very usefull to prepend a string to it
249
  if ($storeId === false || empty($path)) return $path;
250
 
@@ -297,7 +322,7 @@ class Copernica_MarketingSoftware_Model_Abstraction_Product implements Serializa
297
  * @param Mage_Catalog_Model_Category $category
298
  * @return array
299
  */
300
- private function _getFullCategoryName(Mage_Catalog_Model_Category $category)
301
  {
302
  // is there a parent?
303
  if ($category->getParentId() > 1)
@@ -356,18 +381,18 @@ class Copernica_MarketingSoftware_Model_Abstraction_Product implements Serializa
356
  }
357
  else return $this->attributes;
358
  }
359
-
360
  public function attributeSet()
361
- {
362
  // Is this object still present?
363
  if (is_object($this->original)) {
364
  $attributeSetModel = Mage::getModel("eav/entity_attribute_set");
365
  $attributeSetModel->load($this->original->getAttributeSetId());
366
-
367
  return $attributeSetModel->getAttributeSetName();
368
- } else {
369
  return $this->attributeSet;
370
- }
371
  }
372
 
373
  /**
@@ -389,6 +414,7 @@ class Copernica_MarketingSoftware_Model_Abstraction_Product implements Serializa
389
  $this->categories(),
390
  $this->isNew(),
391
  $this->price(),
 
392
  $this->created(),
393
  $this->modified(),
394
  $this->attributes(),
@@ -414,6 +440,7 @@ class Copernica_MarketingSoftware_Model_Abstraction_Product implements Serializa
414
  $this->categories,
415
  $this->isNew,
416
  $this->price,
 
417
  $this->created,
418
  $this->modified,
419
  $this->attributes
1
  <?php
2
+ /**
3
+ * Copernica Marketing Software
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0).
8
+ * It is available through the world-wide-web at this URL:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to obtain a copy of the license through the
11
+ * world-wide-web, please send an email to copernica@support.cream.nl
12
+ * so we can send you a copy immediately.
13
+ *
14
+ * DISCLAIMER
15
+ *
16
+ * Do not edit or add to this file if you wish to upgrade this software
17
+ * to newer versions in the future. If you wish to customize this module
18
+ * for your needs please refer to http://www.magento.com/ for more
19
+ * information.
20
+ *
21
+ * @category Copernica
22
+ * @package Copernica_MarketingSoftware
23
+ * @copyright Copyright (c) 2011-2012 Copernica & Cream. (http://docs.cream.nl/)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
  /**
28
  * A wrapper object around a magento Product
29
  */
33
  * The original object
34
  * @param Mage_Catalog_Model_Product
35
  */
36
+ protected $original;
37
 
38
  /**
39
  * Predefine the internal fields
40
  */
41
+ protected $id;
42
+ protected $sku;
43
+ protected $name;
44
+ protected $description;
45
+ protected $productUrl;
46
+ protected $imagePath;
47
+ protected $weight;
48
+ protected $categories = array();
49
+ protected $isNew;
50
+ protected $price;
51
+ protected $specialPrice;
52
+ protected $created;
53
+ protected $modified;
54
+ protected $attributes;
55
+ protected $attributeSet;
56
 
57
  /**
58
  * Sets the original model
60
  * @return Copernica_MarketingSoftware_Model_Abstraction_Product
61
  */
62
  public function setOriginal($original)
63
+ {
64
  if ($original instanceof Mage_Catalog_Model_Product) {
65
  //this is the original product
66
  $this->original = $original;
72
  if ($product->getId()) {
73
  //the product exists
74
  $this->original = $product;
75
+ } else {
76
  // unfortunately we do not have the product any more, but we have the information
77
  // so we can fill a lot of fields, so the functions still work
78
  $this->id = $original->getProductId();
184
  }
185
  else return $this->price;
186
  }
187
+
188
+ /**
189
+ * Return the price of this magento product
190
+ * @return string
191
+ */
192
+ public function specialPrice()
193
+ {
194
+ // Is this object still present?
195
+ if (is_object($this->original))
196
+ {
197
+ return $this->original->getSpecialPrice();
198
+ }
199
+ else return $this->specialPrice;
200
+ }
201
+
202
 
203
  /**
204
  * Return the creation date of this magento product
244
  else
245
  {
246
  // Get the product
247
+ /* @var $product Mage_Catalog_Model_Product */
248
  $product = is_object($this->original) ? $this->original : Mage::getModel('catalog/product')->load($this->id);
249
+
250
  // Could not load the product, return an empty string
251
  if (!$product->getId()) return '';
252
+
253
+ // Just return the product URL as is
254
+ return $product->getProductUrl();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
255
  }
256
  }
257
 
269
  }
270
  else $path = $this->imagePath;
271
 
272
+ // most likely store `false` is supplied to the function, if the path
273
  // is empty it is also not very usefull to prepend a string to it
274
  if ($storeId === false || empty($path)) return $path;
275
 
322
  * @param Mage_Catalog_Model_Category $category
323
  * @return array
324
  */
325
+ protected function _getFullCategoryName(Mage_Catalog_Model_Category $category)
326
  {
327
  // is there a parent?
328
  if ($category->getParentId() > 1)
381
  }
382
  else return $this->attributes;
383
  }
384
+
385
  public function attributeSet()
386
+ {
387
  // Is this object still present?
388
  if (is_object($this->original)) {
389
  $attributeSetModel = Mage::getModel("eav/entity_attribute_set");
390
  $attributeSetModel->load($this->original->getAttributeSetId());
391
+
392
  return $attributeSetModel->getAttributeSetName();
393
+ } else {
394
  return $this->attributeSet;
395
+ }
396
  }
397
 
398
  /**
414
  $this->categories(),
415
  $this->isNew(),
416
  $this->price(),
417
+ $this->specialPrice(),
418
  $this->created(),
419
  $this->modified(),
420
  $this->attributes(),
440
  $this->categories,
441
  $this->isNew,
442
  $this->price,
443
+ $this->specialPrice,
444
  $this->created,
445
  $this->modified,
446
  $this->attributes
app/code/community/Copernica/MarketingSoftware/Model/Abstraction/Quote.php CHANGED
@@ -1,4 +1,29 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  /**
3
  * A wrapper object around a Quote
4
  */
@@ -8,25 +33,25 @@ class Copernica_MarketingSoftware_Model_Abstraction_Quote implements Serializabl
8
  * The original object
9
  * @param Mage_Sales_Model_Quote
10
  */
11
- private $original;
12
 
13
  /**
14
  * Predefine the internal fields
15
  */
16
- private $quoteId;
17
- private $quantity;
18
- private $currency;
19
- private $timestamp;
20
- private $customerIP;
21
- private $items;
22
- private $storeview;
23
- private $customerId;
24
- private $addresses;
25
- private $price;
26
- private $weight;
27
- private $active;
28
- private $shippingDescription;
29
- private $paymentDescription;
30
 
31
  /**
32
  * Sets the original model
1
  <?php
2
+ /**
3
+ * Copernica Marketing Software
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0).
8
+ * It is available through the world-wide-web at this URL:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to obtain a copy of the license through the
11
+ * world-wide-web, please send an email to copernica@support.cream.nl
12
+ * so we can send you a copy immediately.
13
+ *
14
+ * DISCLAIMER
15
+ *
16
+ * Do not edit or add to this file if you wish to upgrade this software
17
+ * to newer versions in the future. If you wish to customize this module
18
+ * for your needs please refer to http://www.magento.com/ for more
19
+ * information.
20
+ *
21
+ * @category Copernica
22
+ * @package Copernica_MarketingSoftware
23
+ * @copyright Copyright (c) 2011-2012 Copernica & Cream. (http://docs.cream.nl/)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
  /**
28
  * A wrapper object around a Quote
29
  */
33
  * The original object
34
  * @param Mage_Sales_Model_Quote
35
  */
36
+ protected $original;
37
 
38
  /**
39
  * Predefine the internal fields
40
  */
41
+ protected $quoteId;
42
+ protected $quantity;
43
+ protected $currency;
44
+ protected $timestamp;
45
+ protected $customerIP;
46
+ protected $items;
47
+ protected $storeview;
48
+ protected $customerId;
49
+ protected $addresses;
50
+ protected $price;
51
+ protected $weight;
52
+ protected $active;
53
+ protected $shippingDescription;
54
+ protected $paymentDescription;
55
 
56
  /**
57
  * Sets the original model
app/code/community/Copernica/MarketingSoftware/Model/Abstraction/Quote/Item.php CHANGED
@@ -1,4 +1,29 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  /**
3
  * A wrapper object around a Quote Item
4
  */
@@ -8,20 +33,20 @@ class Copernica_MarketingSoftware_Model_Abstraction_Quote_Item implements Serial
8
  * The original object
9
  * @param Mage_Sales_Model_Quote_Item
10
  */
11
- private $original;
12
 
13
  /**
14
  * Predefine the internal fields
15
  */
16
- private $id;
17
- private $quoteId;
18
- private $storeId;
19
- private $quantity;
20
- private $price;
21
- private $weight;
22
- private $timestamp;
23
- private $options;
24
- private $product;
25
 
26
  /**
27
  * Sets the original model
1
  <?php
2
+ /**
3
+ * Copernica Marketing Software
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0).
8
+ * It is available through the world-wide-web at this URL:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to obtain a copy of the license through the
11
+ * world-wide-web, please send an email to copernica@support.cream.nl
12
+ * so we can send you a copy immediately.
13
+ *
14
+ * DISCLAIMER
15
+ *
16
+ * Do not edit or add to this file if you wish to upgrade this software
17
+ * to newer versions in the future. If you wish to customize this module
18
+ * for your needs please refer to http://www.magento.com/ for more
19
+ * information.
20
+ *
21
+ * @category Copernica
22
+ * @package Copernica_MarketingSoftware
23
+ * @copyright Copyright (c) 2011-2012 Copernica & Cream. (http://docs.cream.nl/)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
  /**
28
  * A wrapper object around a Quote Item
29
  */
33
  * The original object
34
  * @param Mage_Sales_Model_Quote_Item
35
  */
36
+ protected $original;
37
 
38
  /**
39
  * Predefine the internal fields
40
  */
41
+ protected $id;
42
+ protected $quoteId;
43
+ protected $storeId;
44
+ protected $quantity;
45
+ protected $price;
46
+ protected $weight;
47
+ protected $timestamp;
48
+ protected $options;
49
+ protected $product;
50
 
51
  /**
52
  * Sets the original model
app/code/community/Copernica/MarketingSoftware/Model/Abstraction/Quote/Item/Options.php CHANGED
@@ -1,4 +1,29 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  /**
3
  * A wrapper object around quote item options
4
  */
@@ -8,13 +33,13 @@ class Copernica_MarketingSoftware_Model_Abstraction_Quote_Item_Options implement
8
  * The original object
9
  * @param Mage_Sales_Model_Quote_Item
10
  */
11
- private $original;
12
 
13
  /**
14
  * Predefine the internal fields
15
  */
16
- private $name;
17
- private $attributes;
18
 
19
 
20
  /**
@@ -94,7 +119,7 @@ class Copernica_MarketingSoftware_Model_Abstraction_Quote_Item_Options implement
94
  * @param array
95
  * @return String
96
  */
97
- private function arrayToString($value, $prefix = '')
98
  {
99
  $string = "";
100
  foreach ($value as $key => $value)
1
  <?php
2
+ /**
3
+ * Copernica Marketing Software
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0).
8
+ * It is available through the world-wide-web at this URL:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to obtain a copy of the license through the
11
+ * world-wide-web, please send an email to copernica@support.cream.nl
12
+ * so we can send you a copy immediately.
13
+ *
14
+ * DISCLAIMER
15
+ *
16
+ * Do not edit or add to this file if you wish to upgrade this software
17
+ * to newer versions in the future. If you wish to customize this module
18
+ * for your needs please refer to http://www.magento.com/ for more
19
+ * information.
20
+ *
21
+ * @category Copernica
22
+ * @package Copernica_MarketingSoftware
23
+ * @copyright Copyright (c) 2011-2012 Copernica & Cream. (http://docs.cream.nl/)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
  /**
28
  * A wrapper object around quote item options
29
  */
33
  * The original object
34
  * @param Mage_Sales_Model_Quote_Item
35
  */
36
+ protected $original;
37
 
38
  /**
39
  * Predefine the internal fields
40
  */
41
+ protected $name;
42
+ protected $attributes;
43
 
44
 
45
  /**
119
  * @param array
120
  * @return String
121
  */
122
+ protected function arrayToString($value, $prefix = '')
123
  {
124
  $string = "";
125
  foreach ($value as $key => $value)
app/code/community/Copernica/MarketingSoftware/Model/Abstraction/Storeview.php CHANGED
@@ -1,4 +1,29 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  /**
3
  * A wrapper object around a Store
4
  */
@@ -8,18 +33,18 @@ class Copernica_MarketingSoftware_Model_Abstraction_Storeview implements Seriali
8
  * The original object
9
  * @param Mage_Core_Model_Store
10
  */
11
- private $original;
12
 
13
  /**
14
  * Predefine the internal fields
15
  */
16
- private $id;
17
- private $websiteCode;
18
- private $websiteLabel;
19
- private $storeCode;
20
- private $storeLabel;
21
- private $viewCode;
22
- private $viewLabel;
23
 
24
 
25
  /**
1
  <?php
2
+ /**
3
+ * Copernica Marketing Software
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0).
8
+ * It is available through the world-wide-web at this URL:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to obtain a copy of the license through the
11
+ * world-wide-web, please send an email to copernica@support.cream.nl
12
+ * so we can send you a copy immediately.
13
+ *
14
+ * DISCLAIMER
15
+ *
16
+ * Do not edit or add to this file if you wish to upgrade this software
17
+ * to newer versions in the future. If you wish to customize this module
18
+ * for your needs please refer to http://www.magento.com/ for more
19
+ * information.
20
+ *
21
+ * @category Copernica
22
+ * @package Copernica_MarketingSoftware
23
+ * @copyright Copyright (c) 2011-2012 Copernica & Cream. (http://docs.cream.nl/)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
  /**
28
  * A wrapper object around a Store
29
  */
33
  * The original object
34
  * @param Mage_Core_Model_Store
35
  */
36
+ protected $original;
37
 
38
  /**
39
  * Predefine the internal fields
40
  */
41
+ protected $id;
42
+ protected $websiteCode;
43
+ protected $websiteLabel;
44
+ protected $storeCode;
45
+ protected $storeLabel;
46
+ protected $viewCode;
47
+ protected $viewLabel;
48
 
49
 
50
  /**
app/code/community/Copernica/MarketingSoftware/Model/Abstraction/Subscription.php CHANGED
@@ -1,4 +1,29 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  /**
3
  * A wrapper object around a Newsletter Subscription
4
  */
@@ -8,16 +33,16 @@ class Copernica_MarketingSoftware_Model_Abstraction_Subscription implements Seri
8
  * The original object
9
  * @param Mage_Newsletter_Model_Subscriber
10
  */
11
- private $original;
12
 
13
  /**
14
  * Predefine the internal fields
15
  */
16
- private $id;
17
- private $email;
18
- private $status;
19
- private $storeview;
20
- private $customerId;
21
 
22
  /**
23
  * Sets the original model
1
  <?php
2
+ /**
3
+ * Copernica Marketing Software
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0).
8
+ * It is available through the world-wide-web at this URL:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to obtain a copy of the license through the
11
+ * world-wide-web, please send an email to copernica@support.cream.nl
12
+ * so we can send you a copy immediately.
13
+ *
14
+ * DISCLAIMER
15
+ *
16
+ * Do not edit or add to this file if you wish to upgrade this software
17
+ * to newer versions in the future. If you wish to customize this module
18
+ * for your needs please refer to http://www.magento.com/ for more
19
+ * information.
20
+ *
21
+ * @category Copernica
22
+ * @package Copernica_MarketingSoftware
23
+ * @copyright Copyright (c) 2011-2012 Copernica & Cream. (http://docs.cream.nl/)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
  /**
28
  * A wrapper object around a Newsletter Subscription
29
  */
33
  * The original object
34
  * @param Mage_Newsletter_Model_Subscriber
35
  */
36
+ protected $original;
37
 
38
  /**
39
  * Predefine the internal fields
40
  */
41
+ protected $id;
42
+ protected $email;
43
+ protected $status;
44
+ protected $storeview;
45
+ protected $customerId;
46
 
47
  /**
48
  * Sets the original model
app/code/community/Copernica/MarketingSoftware/Model/AsyncPomSoapClient.php CHANGED
@@ -1,9 +1,34 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  /**
3
  * Asynchronous SOAP api client.
4
  * This is an extension to the normal soap client, because it can run multiple
5
  * calls at the same time. It differs from the normal PomSoapClient class because
6
- * the PxPomSoapClient::methodToCall() method does not return the result, but
7
  * a handle that can be queried to see if it has already returned data.
8
  *
9
  * Example use:
@@ -18,43 +43,50 @@
18
  */
19
  class Copernica_MarketingSoftware_Model_AsyncPomSoapClient extends Copernica_MarketingSoftware_Model_PomSoapClient
20
  {
 
 
 
 
 
 
 
21
  /**
22
  * The curl multi handle
23
  * @var resource
24
  */
25
- private $curl = false;
26
 
27
  /**
28
  * Set of pending requests ID's
29
  * This is an assoc array: request ID maps to a array with handle and request
30
  * @var array
31
  */
32
- private $pending = array();
33
 
34
  /**
35
  * Set of requests for which the answer has been received
36
  * This is an assoc array: request ID maps to the received answer
37
  * @var array
38
  */
39
- private $completed = array();
40
 
41
  /**
42
  * The last assigned request ID
43
  * @var integer
44
  */
45
- private $freeID = 0;
46
 
47
  /**
48
  * Name of the cookie file
49
  * @var string
50
  */
51
- private $cookies = false;
52
 
53
  /**
54
  * Is the object currently busy parsing an async answer?
55
  * @var resource CURL resource identifier of the request that is internally processed
56
  */
57
- private $internalRequest = false;
58
 
59
 
60
  /**
@@ -188,7 +220,7 @@ class Copernica_MarketingSoftware_Model_AsyncPomSoapClient extends Copernica_Mar
188
  * @param resource CURL resource
189
  * @return integer Request ID
190
  */
191
- private function resource2id($resource)
192
  {
193
  // loop through all pending requests
194
  foreach ($this->pending as $request => $data)
@@ -229,6 +261,7 @@ class Copernica_MarketingSoftware_Model_AsyncPomSoapClient extends Copernica_Mar
229
  CURLOPT_COOKIEFILE => $this->cookies,
230
  CURLOPT_COOKIEJAR => $this->cookies,
231
  CURLOPT_POSTFIELDS => $request,
 
232
  ));
233
 
234
  // find the method name
1
  <?php
2
+ /**
3
+ * Copernica Marketing Software
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0).
8
+ * It is available through the world-wide-web at this URL:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to obtain a copy of the license through the
11
+ * world-wide-web, please send an email to copernica@support.cream.nl
12
+ * so we can send you a copy immediately.
13
+ *
14
+ * DISCLAIMER
15
+ *
16
+ * Do not edit or add to this file if you wish to upgrade this software
17
+ * to newer versions in the future. If you wish to customize this module
18
+ * for your needs please refer to http://www.magento.com/ for more
19
+ * information.
20
+ *
21
+ * @category Copernica
22
+ * @package Copernica_MarketingSoftware
23
+ * @copyright Copyright (c) 2011-2012 Copernica & Cream. (http://docs.cream.nl/)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
  /**
28
  * Asynchronous SOAP api client.
29
  * This is an extension to the normal soap client, because it can run multiple
30
  * calls at the same time. It differs from the normal PomSoapClient class because
31
+ * the PomSoapClient::methodToCall() method does not return the result, but
32
  * a handle that can be queried to see if it has already returned data.
33
  *
34
  * Example use:
43
  */
44
  class Copernica_MarketingSoftware_Model_AsyncPomSoapClient extends Copernica_MarketingSoftware_Model_PomSoapClient
45
  {
46
+ /**
47
+ * The content type header to use for soap requests
48
+ *
49
+ * @var string
50
+ */
51
+ const HTTP_HEADER_SOAP = 'application/soap+xml;charset=UTF-8';
52
+
53
  /**
54
  * The curl multi handle
55
  * @var resource
56
  */
57
+ protected $curl = false;
58
 
59
  /**
60
  * Set of pending requests ID's
61
  * This is an assoc array: request ID maps to a array with handle and request
62
  * @var array
63
  */
64
+ protected $pending = array();
65
 
66
  /**
67
  * Set of requests for which the answer has been received
68
  * This is an assoc array: request ID maps to the received answer
69
  * @var array
70
  */
71
+ protected $completed = array();
72
 
73
  /**
74
  * The last assigned request ID
75
  * @var integer
76
  */
77
+ protected $freeID = 0;
78
 
79
  /**
80
  * Name of the cookie file
81
  * @var string
82
  */
83
+ protected $cookies = false;
84
 
85
  /**
86
  * Is the object currently busy parsing an async answer?
87
  * @var resource CURL resource identifier of the request that is internally processed
88
  */
89
+ protected $internalRequest = false;
90
 
91
 
92
  /**
220
  * @param resource CURL resource
221
  * @return integer Request ID
222
  */
223
+ protected function resource2id($resource)
224
  {
225
  // loop through all pending requests
226
  foreach ($this->pending as $request => $data)
261
  CURLOPT_COOKIEFILE => $this->cookies,
262
  CURLOPT_COOKIEJAR => $this->cookies,
263
  CURLOPT_POSTFIELDS => $request,
264
+ CURLOPT_HTTPHEADER => array('Content-Type: '.self::HTTP_HEADER_SOAP),
265
  ));
266
 
267
  // find the method name
app/code/community/Copernica/MarketingSoftware/Model/Config.php ADDED
@@ -0,0 +1,57 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Copernica Marketing Software
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0).
8
+ * It is available through the world-wide-web at this URL:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to obtain a copy of the license through the
11
+ * world-wide-web, please send an email to copernica@support.cream.nl
12
+ * so we can send you a copy immediately.
13
+ *
14
+ * DISCLAIMER
15
+ *
16
+ * Do not edit or add to this file if you wish to upgrade this software
17
+ * to newer versions in the future. If you wish to customize this module
18
+ * for your needs please refer to http://www.magento.com/ for more
19
+ * information.
20
+ *
21
+ * @category Copernica
22
+ * @package Copernica_MarketingSoftware
23
+ * @copyright Copyright (c) 2011-2012 Copernica & Cream. (http://docs.cream.nl/)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ /**
28
+ * With the config object the configuration options of the marketing
29
+ * software module are accessible.
30
+ *
31
+ * We do not use the Core_Config model, because everytime a config
32
+ * value is saved it will empty the config cache, which might throw
33
+ * errors on a high traffic website.
34
+ *
35
+ */
36
+ class Copernica_MarketingSoftware_Model_Config extends Mage_Core_Model_Abstract
37
+ {
38
+ /**
39
+ * Constructor
40
+ *
41
+ * @see Varien_Object::_construct()
42
+ */
43
+ protected function _construct()
44
+ {
45
+ $this->_init('marketingsoftware/config');
46
+ }
47
+
48
+ public function loadByKey($key)
49
+ {
50
+ $this->_beforeLoad($key, 'key_name');
51
+ $this->_getResource()->load($this, $key, 'key_name');
52
+ $this->_afterLoad();
53
+ $this->setOrigData();
54
+ $this->_hasDataChanges = false;
55
+ return $this;
56
+ }
57
+ }
app/code/community/Copernica/MarketingSoftware/Model/Copernica/Abstract.php CHANGED
@@ -1,4 +1,29 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  /**
3
  * An object to wrap the Copernica profile
4
  */
@@ -9,7 +34,6 @@ abstract class Copernica_MarketingSoftware_Model_Copernica_Abstract implements A
9
  */
10
  protected $direction = 'copernica';
11
 
12
-
13
  /**
14
  * Set the direction for this synchronisation
15
  * @param String
@@ -46,6 +70,7 @@ abstract class Copernica_MarketingSoftware_Model_Copernica_Abstract implements A
46
  abstract public function requiredFields();
47
 
48
  /**
 
49
  * @param mixed
50
  * @return boolean
51
  */
@@ -59,6 +84,7 @@ abstract class Copernica_MarketingSoftware_Model_Copernica_Abstract implements A
59
  }
60
 
61
  /**
 
62
  * @param mixed
63
  * @return mixed
64
  */
@@ -73,6 +99,8 @@ abstract class Copernica_MarketingSoftware_Model_Copernica_Abstract implements A
73
 
74
  /**
75
  * Convert the data to an array for usage in SOAP
 
 
76
  */
77
  public function toArray()
78
  {
@@ -103,6 +131,8 @@ abstract class Copernica_MarketingSoftware_Model_Copernica_Abstract implements A
103
  }
104
 
105
  /**
 
 
106
  * @param mixed
107
  * @param mixed
108
  */
@@ -112,6 +142,8 @@ abstract class Copernica_MarketingSoftware_Model_Copernica_Abstract implements A
112
  }
113
 
114
  /**
 
 
115
  * @param mixed
116
  */
117
  public function offsetUnset($offset)
1
  <?php
2
+ /**
3
+ * Copernica Marketing Software
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0).
8
+ * It is available through the world-wide-web at this URL:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to obtain a copy of the license through the
11
+ * world-wide-web, please send an email to copernica@support.cream.nl
12
+ * so we can send you a copy immediately.
13
+ *
14
+ * DISCLAIMER
15
+ *
16
+ * Do not edit or add to this file if you wish to upgrade this software
17
+ * to newer versions in the future. If you wish to customize this module
18
+ * for your needs please refer to http://www.magento.com/ for more
19
+ * information.
20
+ *
21
+ * @category Copernica
22
+ * @package Copernica_MarketingSoftware
23
+ * @copyright Copyright (c) 2011-2012 Copernica & Cream. (http://docs.cream.nl/)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
  /**
28
  * An object to wrap the Copernica profile
29
  */
34
  */
35
  protected $direction = 'copernica';
36
 
 
37
  /**
38
  * Set the direction for this synchronisation
39
  * @param String
70
  abstract public function requiredFields();
71
 
72
  /**
73
+ * Check if offset exists in array
74
  * @param mixed
75
  * @return boolean
76
  */
84
  }
85
 
86
  /**
87
+ * Get offset in array
88
  * @param mixed
89
  * @return mixed
90
  */
99
 
100
  /**
101
  * Convert the data to an array for usage in SOAP
102
+ *
103
+ * @return array
104
  */
105
  public function toArray()
106
  {
131
  }
132
 
133
  /**
134
+ * Set entry in offset of array
135
+ * @deprecated
136
  * @param mixed
137
  * @param mixed
138
  */
142
  }
143
 
144
  /**
145
+ * Remove entry by offset in array
146
+ * @deprecated
147
  * @param mixed
148
  */
149
  public function offsetUnset($offset)
app/code/community/Copernica/MarketingSoftware/Model/Copernica/Address/Subprofile.php CHANGED
@@ -1,4 +1,29 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  /**
3
  * An object to wrap the Copernica profile
4
  */
1
  <?php
2
+ /**
3
+ * Copernica Marketing Software
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0).
8
+ * It is available through the world-wide-web at this URL:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to obtain a copy of the license through the
11
+ * world-wide-web, please send an email to copernica@support.cream.nl
12
+ * so we can send you a copy immediately.
13
+ *
14
+ * DISCLAIMER
15
+ *
16
+ * Do not edit or add to this file if you wish to upgrade this software
17
+ * to newer versions in the future. If you wish to customize this module
18
+ * for your needs please refer to http://www.magento.com/ for more
19
+ * information.
20
+ *
21
+ * @category Copernica
22
+ * @package Copernica_MarketingSoftware
23
+ * @copyright Copyright (c) 2011-2012 Copernica & Cream. (http://docs.cream.nl/)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
  /**
28
  * An object to wrap the Copernica profile
29
  */
app/code/community/Copernica/MarketingSoftware/Model/Copernica/Cartitem/Subprofile.php CHANGED
@@ -1,4 +1,29 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  /**
3
  * An object to wrap the Copernica profile
4
  */
@@ -12,8 +37,7 @@ class Copernica_MarketingSoftware_Model_Copernica_Cartitem_Subprofile extends Co
12
  /**
13
  * @var string
14
  */
15
- private $status = 'basket';
16
-
17
 
18
  /**
19
  * Set the status of this cart item
@@ -38,6 +62,7 @@ class Copernica_MarketingSoftware_Model_Copernica_Cartitem_Subprofile extends Co
38
  /**
39
  * Try to store a quote item
40
  * @param Copernica_MarketingSoftware_Model_Abstraction_Quote_Item
 
41
  */
42
  public function setQuoteItem($item)
43
  {
@@ -79,11 +104,13 @@ class Copernica_MarketingSoftware_Model_Copernica_Cartitem_Subprofile extends Co
79
 
80
  // flatten the categories
81
  $categories = array();
82
- foreach ($product->categories() as $category) $categories[] = implode(' > ', $category);
 
 
83
 
84
  // Get the price object
85
  $price = $quoteItem->price();
86
-
87
  // construct an array of data
88
  return array(
89
  'item_id' => $quoteItem->id(),
1
  <?php
2
+ /**
3
+ * Copernica Marketing Software
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0).
8
+ * It is available through the world-wide-web at this URL:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to obtain a copy of the license through the
11
+ * world-wide-web, please send an email to copernica@support.cream.nl
12
+ * so we can send you a copy immediately.
13
+ *
14
+ * DISCLAIMER
15
+ *
16
+ * Do not edit or add to this file if you wish to upgrade this software
17
+ * to newer versions in the future. If you wish to customize this module
18
+ * for your needs please refer to http://www.magento.com/ for more
19
+ * information.
20
+ *
21
+ * @category Copernica
22
+ * @package Copernica_MarketingSoftware
23
+ * @copyright Copyright (c) 2011-2012 Copernica & Cream. (http://docs.cream.nl/)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
  /**
28
  * An object to wrap the Copernica profile
29
  */
37
  /**
38
  * @var string
39
  */
40
+ protected $status = 'basket';
 
41
 
42
  /**
43
  * Set the status of this cart item
62
  /**
63
  * Try to store a quote item
64
  * @param Copernica_MarketingSoftware_Model_Abstraction_Quote_Item
65
+ * @return Copernica_MarketingSoftware_Model_Copernica_Cartitem_Subprofile;
66
  */
67
  public function setQuoteItem($item)
68
  {
104
 
105
  // flatten the categories
106
  $categories = array();
107
+ if ($product->categories()) {
108
+ foreach ($product->categories() as $category) $categories[] = implode(' > ', $category);
109
+ }
110
 
111
  // Get the price object
112
  $price = $quoteItem->price();
113
+
114
  // construct an array of data
115
  return array(
116
  'item_id' => $quoteItem->id(),
app/code/community/Copernica/MarketingSoftware/Model/Copernica/Order/Subprofile.php CHANGED
@@ -1,4 +1,29 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  /**
3
  * An object to wrap the Copernica profile
4
  */
@@ -56,8 +81,7 @@ class Copernica_MarketingSoftware_Model_Copernica_Order_Subprofile extends Coper
56
  $billingAddress = $shippingAddress = false;
57
 
58
  // Get the addresses
59
- foreach ($this->order->addresses() as $address)
60
- {
61
  if (in_array('billing', $address->type())) $billingAddress = $address;
62
  if (in_array('shipping', $address->type())) $shippingAddress = $address;
63
  }
1
  <?php
2
+ /**
3
+ * Copernica Marketing Software
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0).
8
+ * It is available through the world-wide-web at this URL:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to obtain a copy of the license through the
11
+ * world-wide-web, please send an email to copernica@support.cream.nl
12
+ * so we can send you a copy immediately.
13
+ *
14
+ * DISCLAIMER
15
+ *
16
+ * Do not edit or add to this file if you wish to upgrade this software
17
+ * to newer versions in the future. If you wish to customize this module
18
+ * for your needs please refer to http://www.magento.com/ for more
19
+ * information.
20
+ *
21
+ * @category Copernica
22
+ * @package Copernica_MarketingSoftware
23
+ * @copyright Copyright (c) 2011-2012 Copernica & Cream. (http://docs.cream.nl/)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
  /**
28
  * An object to wrap the Copernica profile
29
  */
81
  $billingAddress = $shippingAddress = false;
82
 
83
  // Get the addresses
84
+ foreach ($this->order->addresses() as $address) {
 
85
  if (in_array('billing', $address->type())) $billingAddress = $address;
86
  if (in_array('shipping', $address->type())) $shippingAddress = $address;
87
  }
app/code/community/Copernica/MarketingSoftware/Model/Copernica/Orderitem/Subprofile.php CHANGED
@@ -1,4 +1,29 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  /**
3
  * An object to wrap the Copernica profile
4
  */
@@ -62,11 +87,13 @@ class Copernica_MarketingSoftware_Model_Copernica_Orderitem_Subprofile extends C
62
 
63
  // flatten the categories
64
  $categories = array();
65
- foreach ($product->categories() as $category) $categories[] = implode(' > ', $category);
 
 
66
 
67
  // Get the price
68
  $price = $orderItem->price();
69
-
70
  // construct an array of data
71
  return array(
72
  'item_id' => $orderItem->id(),
@@ -76,7 +103,7 @@ class Copernica_MarketingSoftware_Model_Copernica_Orderitem_Subprofile extends C
76
  'price' => is_object($price) ? $price->itemPrice() : null,
77
  'name' => $product->name(),
78
  'sku' => $product->sku(),
79
- 'attribute_set' => $product->attributeSet(),
80
  'weight' => $orderItem->weight(),
81
  'quantity' => $orderItem->quantity(),
82
  'timestamp' => $orderItem->timestamp(),
1
  <?php
2
+ /**
3
+ * Copernica Marketing Software
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0).
8
+ * It is available through the world-wide-web at this URL:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to obtain a copy of the license through the
11
+ * world-wide-web, please send an email to copernica@support.cream.nl
12
+ * so we can send you a copy immediately.
13
+ *
14
+ * DISCLAIMER
15
+ *
16
+ * Do not edit or add to this file if you wish to upgrade this software
17
+ * to newer versions in the future. If you wish to customize this module
18
+ * for your needs please refer to http://www.magento.com/ for more
19
+ * information.
20
+ *
21
+ * @category Copernica
22
+ * @package Copernica_MarketingSoftware
23
+ * @copyright Copyright (c) 2011-2012 Copernica & Cream. (http://docs.cream.nl/)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
  /**
28
  * An object to wrap the Copernica profile
29
  */
87
 
88
  // flatten the categories
89
  $categories = array();
90
+ if ($product->categories()) {
91
+ foreach ($product->categories() as $category) $categories[] = implode(' > ', $category);
92
+ }
93
 
94
  // Get the price
95
  $price = $orderItem->price();
96
+
97
  // construct an array of data
98
  return array(
99
  'item_id' => $orderItem->id(),
103
  'price' => is_object($price) ? $price->itemPrice() : null,
104
  'name' => $product->name(),
105
  'sku' => $product->sku(),
106
+ 'attribute_set' => $product->attributeSet(),
107
  'weight' => $orderItem->weight(),
108
  'quantity' => $orderItem->quantity(),
109
  'timestamp' => $orderItem->timestamp(),
app/code/community/Copernica/MarketingSoftware/Model/Copernica/Profile.php CHANGED
@@ -1,4 +1,29 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  /**
3
  * An object to wrap the Copernica profile
4
  */
1
  <?php
2
+ /**
3
+ * Copernica Marketing Software
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0).
8
+ * It is available through the world-wide-web at this URL:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to obtain a copy of the license through the
11
+ * world-wide-web, please send an email to copernica@support.cream.nl
12
+ * so we can send you a copy immediately.
13
+ *
14
+ * DISCLAIMER
15
+ *
16
+ * Do not edit or add to this file if you wish to upgrade this software
17
+ * to newer versions in the future. If you wish to customize this module
18
+ * for your needs please refer to http://www.magento.com/ for more
19
+ * information.
20
+ *
21
+ * @category Copernica
22
+ * @package Copernica_MarketingSoftware
23
+ * @copyright Copyright (c) 2011-2012 Copernica & Cream. (http://docs.cream.nl/)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
  /**
28
  * An object to wrap the Copernica profile
29
  */
app/code/community/Copernica/MarketingSoftware/Model/Copernica/Profilecustomer.php CHANGED
@@ -1,4 +1,29 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  /**
3
  * An object to wrap the Copernica profile
4
  */
@@ -7,7 +32,7 @@ class Copernica_MarketingSoftware_Model_Copernica_ProfileCustomer extends Copern
7
  /**
8
  * @var Copernica_MarketingSoftware_Model_Abstraction_Customer
9
  */
10
- private $customer = false;
11
 
12
  /**
13
  * Set the customer object to this object
@@ -19,6 +44,24 @@ class Copernica_MarketingSoftware_Model_Copernica_ProfileCustomer extends Copern
19
  $this->customer = $customer;
20
  return $this;
21
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
22
 
23
  /**
24
  * Retrieve the data for this object
@@ -32,8 +75,8 @@ class Copernica_MarketingSoftware_Model_Copernica_ProfileCustomer extends Copern
32
  // fetch the name object
33
  $name = $this->customer->name();
34
 
35
- $email = is_object($subscription) ? $subscription->email() : $this->customer->email();
36
-
37
  // return an array with customer data
38
  return array(
39
  'customer_id' => Mage::helper('marketingsoftware')->generateCustomerId($email, (string)$this->customer->storeview()),
1
  <?php
2
+ /**
3
+ * Copernica Marketing Software
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0).
8
+ * It is available through the world-wide-web at this URL:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to obtain a copy of the license through the
11
+ * world-wide-web, please send an email to copernica@support.cream.nl
12
+ * so we can send you a copy immediately.
13
+ *
14
+ * DISCLAIMER
15
+ *
16
+ * Do not edit or add to this file if you wish to upgrade this software
17
+ * to newer versions in the future. If you wish to customize this module
18
+ * for your needs please refer to http://www.magento.com/ for more
19
+ * information.
20
+ *
21
+ * @category Copernica
22
+ * @package Copernica_MarketingSoftware
23
+ * @copyright Copyright (c) 2011-2012 Copernica & Cream. (http://docs.cream.nl/)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
  /**
28
  * An object to wrap the Copernica profile
29
  */
32
  /**
33
  * @var Copernica_MarketingSoftware_Model_Abstraction_Customer
34
  */
35
+ protected $customer = false;
36
 
37
  /**
38
  * Set the customer object to this object
44
  $this->customer = $customer;
45
  return $this;
46
  }
47
+
48
+ /**
49
+ * Returns customer_id based on the original (previous) email, if possible.
50
+ * Falls back on the customer_id using the current email.
51
+ *
52
+ * @return string
53
+ */
54
+ public function originalId()
55
+ {
56
+ // If the email address has been changed return the old id
57
+ if ($this->customer->oldEmail() != $this->customer->email()) {
58
+ $email = $this->customer->oldEmail();
59
+ } else {
60
+ $email = $this->customer->email();
61
+ }
62
+
63
+ return Mage::helper('marketingsoftware')->generateCustomerId($email, (string) $this->customer->storeview());
64
+ }
65
 
66
  /**
67
  * Retrieve the data for this object
75
  // fetch the name object
76
  $name = $this->customer->name();
77
 
78
+ $email = $this->customer->email();
79
+
80
  // return an array with customer data
81
  return array(
82
  'customer_id' => Mage::helper('marketingsoftware')->generateCustomerId($email, (string)$this->customer->storeview()),
app/code/community/Copernica/MarketingSoftware/Model/Copernica/Profileorder.php CHANGED
@@ -1,4 +1,29 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  /**
3
  * An object to wrap the Copernica profile
4
  */
@@ -7,7 +32,7 @@ class Copernica_MarketingSoftware_Model_Copernica_ProfileOrder extends Copernica
7
  /**
8
  * @var Copernica_MarketingSoftware_Model_Abstraction_Customer
9
  */
10
- private $order = false;
11
 
12
  /**
13
  * Set the customer object to this object
@@ -20,6 +45,17 @@ class Copernica_MarketingSoftware_Model_Copernica_ProfileOrder extends Copernica
20
  return $this;
21
  }
22
 
 
 
 
 
 
 
 
 
 
 
 
23
  /**
24
  * Retrieve the data for this object
25
  * @return array
1
  <?php
2
+ /**
3
+ * Copernica Marketing Software
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0).
8
+ * It is available through the world-wide-web at this URL:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to obtain a copy of the license through the
11
+ * world-wide-web, please send an email to copernica@support.cream.nl
12
+ * so we can send you a copy immediately.
13
+ *
14
+ * DISCLAIMER
15
+ *
16
+ * Do not edit or add to this file if you wish to upgrade this software
17
+ * to newer versions in the future. If you wish to customize this module
18
+ * for your needs please refer to http://www.magento.com/ for more
19
+ * information.
20
+ *
21
+ * @category Copernica
22
+ * @package Copernica_MarketingSoftware
23
+ * @copyright Copyright (c) 2011-2012 Copernica & Cream. (http://docs.cream.nl/)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
  /**
28
  * An object to wrap the Copernica profile
29
  */
32
  /**
33
  * @var Copernica_MarketingSoftware_Model_Abstraction_Customer
34
  */
35
+ protected $order = false;
36
 
37
  /**
38
  * Set the customer object to this object
45
  return $this;
46
  }
47
 
48
+ /**
49
+ * Returns customer_id based on the original (previous) email, if possible.
50
+ * Falls back on the customer_id using the current email.
51
+ *
52
+ * @return string
53
+ */
54
+ public function originalId()
55
+ {
56
+ return $this->id();
57
+ }
58
+
59
  /**
60
  * Retrieve the data for this object
61
  * @return array
app/code/community/Copernica/MarketingSoftware/Model/Copernica/Profilequote.php CHANGED
@@ -1,4 +1,29 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  /**
3
  * An object to wrap the Copernica profile
4
  */
@@ -7,7 +32,7 @@ class Copernica_MarketingSoftware_Model_Copernica_ProfileQuote extends Copernica
7
  /**
8
  * @var Copernica_MarketingSoftware_Model_Abstraction_Customer
9
  */
10
- private $quote = false;
11
 
12
  /**
13
  * Set the customer object to this object
1
  <?php
2
+ /**
3
+ * Copernica Marketing Software
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0).
8
+ * It is available through the world-wide-web at this URL:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to obtain a copy of the license through the
11
+ * world-wide-web, please send an email to copernica@support.cream.nl
12
+ * so we can send you a copy immediately.
13
+ *
14
+ * DISCLAIMER
15
+ *
16
+ * Do not edit or add to this file if you wish to upgrade this software
17
+ * to newer versions in the future. If you wish to customize this module
18
+ * for your needs please refer to http://www.magento.com/ for more
19
+ * information.
20
+ *
21
+ * @category Copernica
22
+ * @package Copernica_MarketingSoftware
23
+ * @copyright Copyright (c) 2011-2012 Copernica & Cream. (http://docs.cream.nl/)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
  /**
28
  * An object to wrap the Copernica profile
29
  */
32
  /**
33
  * @var Copernica_MarketingSoftware_Model_Abstraction_Customer
34
  */
35
+ protected $quote = false;
36
 
37
  /**
38
  * Set the customer object to this object
app/code/community/Copernica/MarketingSoftware/Model/Copernica/Profilesubscription.php CHANGED
@@ -1,4 +1,29 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  /**
3
  * An object to wrap the Copernica profile
4
  */
@@ -7,12 +32,13 @@ class Copernica_MarketingSoftware_Model_Copernica_ProfileSubscription extends Co
7
  /**
8
  * @var Copernica_MarketingSoftware_Model_Abstraction_Customer
9
  */
10
- private $subscription = false;
11
 
12
  /**
13
- * Set the customer object to this object
14
- * @param Copernica_MarketingSoftware_Model_Abstraction_Subscription
15
- * @return Copernica_MarketingSoftware_Model_Copernica_ProfileCustomer
 
16
  */
17
  public function setSubscription($customer)
18
  {
@@ -20,9 +46,20 @@ class Copernica_MarketingSoftware_Model_Copernica_ProfileSubscription extends Co
20
  return $this;
21
  }
22
 
 
 
 
 
 
 
 
 
 
 
23
  /**
24
- * Retrieve the data for this object
25
- * @return array
 
26
  */
27
  protected function _data()
28
  {
1
  <?php
2
+ /**
3
+ * Copernica Marketing Software
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0).
8
+ * It is available through the world-wide-web at this URL:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to obtain a copy of the license through the
11
+ * world-wide-web, please send an email to copernica@support.cream.nl
12
+ * so we can send you a copy immediately.
13
+ *
14
+ * DISCLAIMER
15
+ *
16
+ * Do not edit or add to this file if you wish to upgrade this software
17
+ * to newer versions in the future. If you wish to customize this module
18
+ * for your needs please refer to http://www.magento.com/ for more
19
+ * information.
20
+ *
21
+ * @category Copernica
22
+ * @package Copernica_MarketingSoftware
23
+ * @copyright Copyright (c) 2011-2012 Copernica & Cream. (http://docs.cream.nl/)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
  /**
28
  * An object to wrap the Copernica profile
29
  */
32
  /**
33
  * @var Copernica_MarketingSoftware_Model_Abstraction_Customer
34
  */
35
+ protected $subscription = false;
36
 
37
  /**
38
+ * Set the customer object to this object.
39
+ *
40
+ * @param Copernica_MarketingSoftware_Model_Abstraction_Subscription
41
+ * @return Copernica_MarketingSoftware_Model_Copernica_ProfileCustomer
42
  */
43
  public function setSubscription($customer)
44
  {
46
  return $this;
47
  }
48
 
49
+ /**
50
+ * Return the original identifier for this profile
51
+ *
52
+ * @return string
53
+ */
54
+ public function originalId()
55
+ {
56
+ return $this->id();
57
+ }
58
+
59
  /**
60
+ * Retrieve the data for this object.
61
+ *
62
+ * @return array
63
  */
64
  protected function _data()
65
  {
app/code/community/Copernica/MarketingSoftware/Model/Error.php CHANGED
@@ -1,4 +1,29 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  /**
3
  * This file holds the implmentation of the Copernica_MarketingSoftware_Model_Error class.
4
  * Copernica Marketing Software v 1.2.0
1
  <?php
2
+ /**
3
+ * Copernica Marketing Software
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0).
8
+ * It is available through the world-wide-web at this URL:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to obtain a copy of the license through the
11
+ * world-wide-web, please send an email to copernica@support.cream.nl
12
+ * so we can send you a copy immediately.
13
+ *
14
+ * DISCLAIMER
15
+ *
16
+ * Do not edit or add to this file if you wish to upgrade this software
17
+ * to newer versions in the future. If you wish to customize this module
18
+ * for your needs please refer to http://www.magento.com/ for more
19
+ * information.
20
+ *
21
+ * @category Copernica
22
+ * @package Copernica_MarketingSoftware
23
+ * @copyright Copyright (c) 2011-2012 Copernica & Cream. (http://docs.cream.nl/)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
  /**
28
  * This file holds the implmentation of the Copernica_MarketingSoftware_Model_Error class.
29
  * Copernica Marketing Software v 1.2.0
app/code/community/Copernica/MarketingSoftware/Model/Marketingsoftware.php CHANGED
@@ -1,4 +1,29 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  class Copernica_MarketingSoftware_Model_MarketingSoftware extends Varien_Object
3
  {
4
  /**
1
  <?php
2
+ /**
3
+ * Copernica Marketing Software
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0).
8
+ * It is available through the world-wide-web at this URL:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to obtain a copy of the license through the
11
+ * world-wide-web, please send an email to copernica@support.cream.nl
12
+ * so we can send you a copy immediately.
13
+ *
14
+ * DISCLAIMER
15
+ *
16
+ * Do not edit or add to this file if you wish to upgrade this software
17
+ * to newer versions in the future. If you wish to customize this module
18
+ * for your needs please refer to http://www.magento.com/ for more
19
+ * information.
20
+ *
21
+ * @category Copernica
22
+ * @package Copernica_MarketingSoftware
23
+ * @copyright Copyright (c) 2011-2012 Copernica & Cream. (http://docs.cream.nl/)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
  class Copernica_MarketingSoftware_Model_MarketingSoftware extends Varien_Object
28
  {
29
  /**
app/code/community/Copernica/MarketingSoftware/Model/Mysql4/Config.php ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Copernica Marketing Software
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0).
8
+ * It is available through the world-wide-web at this URL:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to obtain a copy of the license through the
11
+ * world-wide-web, please send an email to copernica@support.cream.nl
12
+ * so we can send you a copy immediately.
13
+ *
14
+ * DISCLAIMER
15
+ *
16
+ * Do not edit or add to this file if you wish to upgrade this software
17
+ * to newer versions in the future. If you wish to customize this module
18
+ * for your needs please refer to http://www.magento.com/ for more
19
+ * information.
20
+ *
21
+ * @category Copernica
22
+ * @package Copernica_MarketingSoftware
23
+ * @copyright Copyright (c) 2011-2012 Copernica & Cream. (http://docs.cream.nl/)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ class Copernica_MarketingSoftware_Model_Mysql4_Config extends Mage_Core_Model_Mysql4_Abstract
28
+ {
29
+ protected function _construct()
30
+ {
31
+ $this->_init('marketingsoftware/config_data', 'config_id');
32
+ }
33
+ }
app/code/community/Copernica/MarketingSoftware/Model/Mysql4/Config/Collection.php ADDED
@@ -0,0 +1,33 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Copernica Marketing Software
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0).
8
+ * It is available through the world-wide-web at this URL:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to obtain a copy of the license through the
11
+ * world-wide-web, please send an email to copernica@support.cream.nl
12
+ * so we can send you a copy immediately.
13
+ *
14
+ * DISCLAIMER
15
+ *
16
+ * Do not edit or add to this file if you wish to upgrade this software
17
+ * to newer versions in the future. If you wish to customize this module
18
+ * for your needs please refer to http://www.magento.com/ for more
19
+ * information.
20
+ *
21
+ * @category Copernica
22
+ * @package Copernica_MarketingSoftware
23
+ * @copyright Copyright (c) 2011-2012 Copernica & Cream. (http://docs.cream.nl/)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ class Copernica_MarketingSoftware_Model_Mysql4_Config_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
28
+ {
29
+ protected function _construct()
30
+ {
31
+ $this->_init('marketingsoftware/config');
32
+ }
33
+ }
app/code/community/Copernica/MarketingSoftware/Model/Mysql4/Queue.php CHANGED
@@ -1,4 +1,29 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  class Copernica_MarketingSoftware_Model_Mysql4_Queue extends Mage_Core_Model_Mysql4_Abstract
3
  {
4
  /**
1
  <?php
2
+ /**
3
+ * Copernica Marketing Software
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0).
8
+ * It is available through the world-wide-web at this URL:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to obtain a copy of the license through the
11
+ * world-wide-web, please send an email to copernica@support.cream.nl
12
+ * so we can send you a copy immediately.
13
+ *
14
+ * DISCLAIMER
15
+ *
16
+ * Do not edit or add to this file if you wish to upgrade this software
17
+ * to newer versions in the future. If you wish to customize this module
18
+ * for your needs please refer to http://www.magento.com/ for more
19
+ * information.
20
+ *
21
+ * @category Copernica
22
+ * @package Copernica_MarketingSoftware
23
+ * @copyright Copyright (c) 2011-2012 Copernica & Cream. (http://docs.cream.nl/)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
  class Copernica_MarketingSoftware_Model_Mysql4_Queue extends Mage_Core_Model_Mysql4_Abstract
28
  {
29
  /**
app/code/community/Copernica/MarketingSoftware/Model/Mysql4/Queue/Collection.php CHANGED
@@ -1,4 +1,29 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  class Copernica_MarketingSoftware_Model_Mysql4_Queue_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
3
  {
4
  protected function _construct()
1
  <?php
2
+ /**
3
+ * Copernica Marketing Software
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0).
8
+ * It is available through the world-wide-web at this URL:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to obtain a copy of the license through the
11
+ * world-wide-web, please send an email to copernica@support.cream.nl
12
+ * so we can send you a copy immediately.
13
+ *
14
+ * DISCLAIMER
15
+ *
16
+ * Do not edit or add to this file if you wish to upgrade this software
17
+ * to newer versions in the future. If you wish to customize this module
18
+ * for your needs please refer to http://www.magento.com/ for more
19
+ * information.
20
+ *
21
+ * @category Copernica
22
+ * @package Copernica_MarketingSoftware
23
+ * @copyright Copyright (c) 2011-2012 Copernica & Cream. (http://docs.cream.nl/)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
  class Copernica_MarketingSoftware_Model_Mysql4_Queue_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
28
  {
29
  protected function _construct()
app/code/community/Copernica/MarketingSoftware/Model/Observer.php CHANGED
@@ -1,13 +1,42 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  class Copernica_MarketingSoftware_Model_Observer
3
  {
4
  /**
5
- * Method for the following events:
6
- * 'checkout_controller_onepage_save_shipping_method'
7
- * 'checkout_controller_multishipping_shipping_post'
8
- * This method is fired during checkout process, after the customer has entered billing address
9
- * and saved the shipping method
10
- * @param $observer Varien_Event_Observer
11
  */
12
  public function checkoutSaveStep(Varien_Event_Observer $observer)
13
  {
@@ -28,8 +57,8 @@ class Copernica_MarketingSoftware_Model_Observer
28
  }
29
 
30
  /**
31
- * Method for event 'sales_quote_item_delete_before'.
32
- * An item is removed from a quote
33
  */
34
  public function quoteItemRemoved(Varien_Event_Observer $observer)
35
  {
@@ -61,8 +90,8 @@ class Copernica_MarketingSoftware_Model_Observer
61
  }
62
 
63
  /**
64
- * Method for event 'sales_quote_item_save_after'.
65
- * An item is added or modified
66
  */
67
  public function quoteItemModified(Varien_Event_Observer $observer)
68
  {
@@ -102,8 +131,8 @@ class Copernica_MarketingSoftware_Model_Observer
102
  }
103
 
104
  /**
105
- * Method for event 'sales_order_save_after'.
106
- * An order is added or modified
107
  */
108
  public function orderModified(Varien_Event_Observer $observer)
109
  {
@@ -130,8 +159,8 @@ class Copernica_MarketingSoftware_Model_Observer
130
  }
131
 
132
  /**
133
- * Method for event 'newsletter_subscriber_delete_before'.
134
- * The newsletter subscription is deleted, do something with it,
135
  */
136
  public function newsletterSubscriptionRemoved(Varien_Event_Observer $observer)
137
  {
@@ -153,8 +182,8 @@ class Copernica_MarketingSoftware_Model_Observer
153
  }
154
 
155
  /**
156
- * Method for event 'newsletter_subscriber_save_after'.
157
- * The newsletter subscription is added or modified
158
  */
159
  public function newsletterSubscriptionModified(Varien_Event_Observer $observer)
160
  {
@@ -183,8 +212,8 @@ class Copernica_MarketingSoftware_Model_Observer
183
  }
184
 
185
  /**
186
- * Method for event 'customer_delete_before'.
187
- * The customer is deleted, do something with it,
188
  */
189
  public function customerRemoved(Varien_Event_Observer $observer)
190
  {
@@ -206,8 +235,8 @@ class Copernica_MarketingSoftware_Model_Observer
206
  }
207
 
208
  /**
209
- * Method for event 'customer_save_after'.
210
- * The customer is added or modified, do something with it,
211
  */
212
  public function customerModified(Varien_Event_Observer $observer)
213
  {
@@ -229,18 +258,21 @@ class Copernica_MarketingSoftware_Model_Observer
229
  }
230
 
231
  /**
232
- * Is the Copernica module enabled?
233
- * @return boolean
 
234
  */
235
- private function enabled()
236
  {
237
  // get the result from the helper
238
  return Mage::helper('marketingsoftware')->enabled();
239
  }
240
 
241
  /**
242
- * Process the queue
243
- * Note that this function might run for a longer time
 
 
244
  */
245
  public function processQueue()
246
  {
@@ -268,21 +300,16 @@ class Copernica_MarketingSoftware_Model_Observer
268
  return true;
269
  }
270
 
271
- try
272
- {
273
  // Perform some basic checks first
274
  Mage::getSingleton('marketingsoftware/marketingsoftware')->api()->check(true);
275
- }
276
- catch (CopernicaError $e)
277
- {
278
  // log the message
279
  Mage::log("Copernica/marketingSoftware: ".(string)$e);
280
 
281
  // Do not process any records
282
  return;
283
- }
284
- catch(Exception $e)
285
- {
286
  Mage::logException($e);
287
  return;
288
  }
1
  <?php
2
+ /**
3
+ * Copernica Marketing Software
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0).
8
+ * It is available through the world-wide-web at this URL:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to obtain a copy of the license through the
11
+ * world-wide-web, please send an email to copernica@support.cream.nl
12
+ * so we can send you a copy immediately.
13
+ *
14
+ * DISCLAIMER
15
+ *
16
+ * Do not edit or add to this file if you wish to upgrade this software
17
+ * to newer versions in the future. If you wish to customize this module
18
+ * for your needs please refer to http://www.magento.com/ for more
19
+ * information.
20
+ *
21
+ * @category Copernica
22
+ * @package Copernica_MarketingSoftware
23
+ * @copyright Copyright (c) 2011-2012 Copernica & Cream. (http://docs.cream.nl/)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ /**
28
+ * Observer object.
29
+ *
30
+ */
31
  class Copernica_MarketingSoftware_Model_Observer
32
  {
33
  /**
34
+ * Method for the following events:
35
+ * 'checkout_controller_onepage_save_shipping_method'
36
+ * 'checkout_controller_multishipping_shipping_post'
37
+ * This method is fired during checkout process, after the customer has entered billing address
38
+ * and saved the shipping method
39
+ * @param $observer Varien_Event_Observer
40
  */
41
  public function checkoutSaveStep(Varien_Event_Observer $observer)
42
  {
57
  }
58
 
59
  /**
60
+ * Method for event 'sales_quote_item_delete_before'.
61
+ * An item is removed from a quote
62
  */
63
  public function quoteItemRemoved(Varien_Event_Observer $observer)
64
  {
90
  }
91
 
92
  /**
93
+ * Method for event 'sales_quote_item_save_after'.
94
+ * An item is added or modified
95
  */
96
  public function quoteItemModified(Varien_Event_Observer $observer)
97
  {
131
  }
132
 
133
  /**
134
+ * Method for event 'sales_order_save_after'.
135
+ * An order is added or modified
136
  */
137
  public function orderModified(Varien_Event_Observer $observer)
138
  {
159
  }
160
 
161
  /**
162
+ * Method for event 'newsletter_subscriber_delete_before'.
163
+ * The newsletter subscription is deleted, do something with it,
164
  */
165
  public function newsletterSubscriptionRemoved(Varien_Event_Observer $observer)
166
  {
182
  }
183
 
184
  /**
185
+ * Method for event 'newsletter_subscriber_save_after'.
186
+ * The newsletter subscription is added or modified
187
  */
188
  public function newsletterSubscriptionModified(Varien_Event_Observer $observer)
189
  {
212
  }
213
 
214
  /**
215
+ * Method for event 'customer_delete_before'.
216
+ * The customer is deleted, do something with it,
217
  */
218
  public function customerRemoved(Varien_Event_Observer $observer)
219
  {
235
  }
236
 
237
  /**
238
+ * Method for event 'customer_save_after'.
239
+ * The customer is added or modified, do something with it,
240
  */
241
  public function customerModified(Varien_Event_Observer $observer)
242
  {
258
  }
259
 
260
  /**
261
+ * Is the Copernica module enabled?
262
+ *
263
+ * @return boolean
264
  */
265
+ protected function enabled()
266
  {
267
  // get the result from the helper
268
  return Mage::helper('marketingsoftware')->enabled();
269
  }
270
 
271
  /**
272
+ * Process the queue. This function will stop running after 180
273
+ * seconds. It will then start processing the rest of the queue
274
+ * the next time the cron event is fired.
275
+ *
276
  */
277
  public function processQueue()
278
  {
300
  return true;
301
  }
302
 
303
+ try {
 
304
  // Perform some basic checks first
305
  Mage::getSingleton('marketingsoftware/marketingsoftware')->api()->check(true);
306
+ } catch (CopernicaError $e) {
 
 
307
  // log the message
308
  Mage::log("Copernica/marketingSoftware: ".(string)$e);
309
 
310
  // Do not process any records
311
  return;
312
+ } catch(Exception $e) {
 
 
313
  Mage::logException($e);
314
  return;
315
  }
app/code/community/Copernica/MarketingSoftware/Model/PomSoapClient.php CHANGED
@@ -1,4 +1,29 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  /**
3
  * Copernica Soap Client
4
  * @version 1.1
@@ -27,6 +52,8 @@ class Copernica_MarketingSoftware_Model_PomSoapClient extends SoapClient
27
  // create connection
28
  parent::__construct($url, $params);
29
 
 
 
30
  // try to login
31
  // @todo check session time
32
  $result = $this->login(array(
@@ -34,6 +61,8 @@ class Copernica_MarketingSoftware_Model_PomSoapClient extends SoapClient
34
  'password' => $connectionSettings['password'],
35
  'account' => $connectionSettings['account'],
36
  ));
 
 
37
  }
38
 
39
  /**
@@ -79,7 +108,7 @@ class Copernica_MarketingSoftware_Model_PomSoapClient extends SoapClient
79
  * @param object with the result
80
  * @return mixed
81
  */
82
- private static function decodeResult($result)
83
  {
84
  // is this a regular, scalar, result?
85
  if (isset($result->value)) return $result->value;
@@ -152,7 +181,7 @@ class Copernica_MarketingSoftware_Model_PomSoapClient extends SoapClient
152
  * @param associative array
153
  * @return array
154
  */
155
- private static function encodeAssoc($array)
156
  {
157
  // we are going to construct an array of pairs
158
  $pairs = array();
@@ -180,7 +209,7 @@ class Copernica_MarketingSoftware_Model_PomSoapClient extends SoapClient
180
  * @param Normal array
181
  * @return array
182
  */
183
- private static function encodeArray($array)
184
  {
185
  // the result array
186
  $result = array();
@@ -203,7 +232,7 @@ class Copernica_MarketingSoftware_Model_PomSoapClient extends SoapClient
203
  * @param object
204
  * @return object
205
  */
206
- private static function encodeObject($object)
207
  {
208
  // result object
209
  $result = new stdClass();
@@ -231,7 +260,7 @@ class Copernica_MarketingSoftware_Model_PomSoapClient extends SoapClient
231
  * @param object
232
  * @return object
233
  */
234
- private static function decodeObject($object)
235
  {
236
  // result object
237
  $result = new stdClass();
1
  <?php
2
+ /**
3
+ * Copernica Marketing Software
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0).
8
+ * It is available through the world-wide-web at this URL:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to obtain a copy of the license through the
11
+ * world-wide-web, please send an email to copernica@support.cream.nl
12
+ * so we can send you a copy immediately.
13
+ *
14
+ * DISCLAIMER
15
+ *
16
+ * Do not edit or add to this file if you wish to upgrade this software
17
+ * to newer versions in the future. If you wish to customize this module
18
+ * for your needs please refer to http://www.magento.com/ for more
19
+ * information.
20
+ *
21
+ * @category Copernica
22
+ * @package Copernica_MarketingSoftware
23
+ * @copyright Copyright (c) 2011-2012 Copernica & Cream. (http://docs.cream.nl/)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
  /**
28
  * Copernica Soap Client
29
  * @version 1.1
52
  // create connection
53
  parent::__construct($url, $params);
54
 
55
+ Varien_Profiler::start('Copernica SOAP call: login');
56
+
57
  // try to login
58
  // @todo check session time
59
  $result = $this->login(array(
61
  'password' => $connectionSettings['password'],
62
  'account' => $connectionSettings['account'],
63
  ));
64
+
65
+ Varien_Profiler::stop('Copernica SOAP call: login');
66
  }
67
 
68
  /**
108
  * @param object with the result
109
  * @return mixed
110
  */
111
+ protected static function decodeResult($result)
112
  {
113
  // is this a regular, scalar, result?
114
  if (isset($result->value)) return $result->value;
181
  * @param associative array
182
  * @return array
183
  */
184
+ protected static function encodeAssoc($array)
185
  {
186
  // we are going to construct an array of pairs
187
  $pairs = array();
209
  * @param Normal array
210
  * @return array
211
  */
212
+ protected static function encodeArray($array)
213
  {
214
  // the result array
215
  $result = array();
232
  * @param object
233
  * @return object
234
  */
235
+ protected static function encodeObject($object)
236
  {
237
  // result object
238
  $result = new stdClass();
260
  * @param object
261
  * @return object
262
  */
263
+ protected static function decodeObject($object)
264
  {
265
  // result object
266
  $result = new stdClass();
app/code/community/Copernica/MarketingSoftware/Model/Queue.php CHANGED
@@ -1,4 +1,33 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  class Copernica_MarketingSoftware_Model_Queue extends Mage_Core_Model_Abstract
3
  {
4
  /**
@@ -11,6 +40,7 @@ class Copernica_MarketingSoftware_Model_Queue extends Mage_Core_Model_Abstract
11
 
12
  /**
13
  * Get the data from the model
 
14
  * @return mixed
15
  */
16
  public function getObject()
@@ -21,6 +51,7 @@ class Copernica_MarketingSoftware_Model_Queue extends Mage_Core_Model_Abstract
21
 
22
  /**
23
  * Set the data to the model
 
24
  * @return mixed
25
  */
26
  public function setObject($object)
@@ -30,13 +61,18 @@ class Copernica_MarketingSoftware_Model_Queue extends Mage_Core_Model_Abstract
30
  }
31
 
32
  /**
33
- * Process this item in the queue
34
- * @return boolean was the processing successfull
 
 
35
  */
36
  public function process()
37
  {
38
- // Wrap the event in a command object (pattern alarm!)
39
- $event = Copernica_MarketingSoftware_Model_QueueEvent_Abstract::get($this);
 
 
 
40
 
41
  // call the process function on the object
42
  return $event->process();
@@ -44,6 +80,8 @@ class Copernica_MarketingSoftware_Model_Queue extends Mage_Core_Model_Abstract
44
 
45
  /**
46
  * Function to save the correct queue time
 
 
47
  */
48
  public function save()
49
  {
1
  <?php
2
+ /**
3
+ * Copernica Marketing Software
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0).
8
+ * It is available through the world-wide-web at this URL:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to obtain a copy of the license through the
11
+ * world-wide-web, please send an email to copernica@support.cream.nl
12
+ * so we can send you a copy immediately.
13
+ *
14
+ * DISCLAIMER
15
+ *
16
+ * Do not edit or add to this file if you wish to upgrade this software
17
+ * to newer versions in the future. If you wish to customize this module
18
+ * for your needs please refer to http://www.magento.com/ for more
19
+ * information.
20
+ *
21
+ * @category Copernica
22
+ * @package Copernica_MarketingSoftware
23
+ * @copyright Copyright (c) 2011-2012 Copernica & Cream. (http://docs.cream.nl/)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ /**
28
+ * Queue object for accessing the events in the queue table.
29
+ *
30
+ */
31
  class Copernica_MarketingSoftware_Model_Queue extends Mage_Core_Model_Abstract
32
  {
33
  /**
40
 
41
  /**
42
  * Get the data from the model
43
+ *
44
  * @return mixed
45
  */
46
  public function getObject()
51
 
52
  /**
53
  * Set the data to the model
54
+ *
55
  * @return mixed
56
  */
57
  public function setObject($object)
61
  }
62
 
63
  /**
64
+ * Process this item in the queue. Returns true if the event was
65
+ * successfully processed, otherwise returns false.
66
+ *
67
+ * @return boolean
68
  */
69
  public function process()
70
  {
71
+ // Get QueueEvent classname
72
+ $factory = Mage::getSingleton('marketingsoftware/QueueEvent_Factory');
73
+
74
+ // Wrap the event in a command object (pattern alarm!)
75
+ $event = $factory->get($this);
76
 
77
  // call the process function on the object
78
  return $event->process();
80
 
81
  /**
82
  * Function to save the correct queue time
83
+ *
84
+ * @return Copernica_MarketingSoftware_Model_Queue
85
  */
86
  public function save()
87
  {
app/code/community/Copernica/MarketingSoftware/Model/QueueEvent/Abstract.php CHANGED
@@ -1,4 +1,29 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  require_once(dirname(__FILE__).'/../Error.php');
3
  /**
4
  * A wrapper object around an event
@@ -9,55 +34,14 @@ abstract class Copernica_MarketingSoftware_Model_QueueEvent_Abstract
9
  * What queue item was used to construct this item
10
  * @var Copernica_MarketingSoftware_Model_Queue
11
  */
12
- private $queueItem;
13
-
14
- /**
15
- * Get the right object
16
- */
17
- public static function get($queueItem)
18
- {
19
- // If we want to start a full synchronisation, we should return a start sync object
20
- if ($queueItem->getAction() == 'start_sync') return new Copernica_MarketingSoftware_Model_QueueEvent_StartSync($queueItem);
21
-
22
- // Prepare the action, to append it to the classname
23
- $action = ucfirst($queueItem->getAction());
24
-
25
- // What kind of class is given
26
- switch (get_class($queueItem->getObject()))
27
- {
28
- case "Copernica_MarketingSoftware_Model_Abstraction_Quote":
29
- $classname = "Copernica_MarketingSoftware_Model_QueueEvent_Quote".$action;
30
- break;
31
-
32
- case "Copernica_MarketingSoftware_Model_Abstraction_Quote_Item":
33
- $classname = "Copernica_MarketingSoftware_Model_QueueEvent_QuoteItem".$action;
34
- break;
35
-
36
- case "Copernica_MarketingSoftware_Model_Abstraction_Customer":
37
- $classname = "Copernica_MarketingSoftware_Model_QueueEvent_Customer".$action;
38
- break;
39
-
40
- case "Copernica_MarketingSoftware_Model_Abstraction_Order":
41
- $classname = "Copernica_MarketingSoftware_Model_QueueEvent_Order".$action;
42
- break;
43
-
44
- case "Copernica_MarketingSoftware_Model_Abstraction_Subscription":
45
- $classname = "Copernica_MarketingSoftware_Model_QueueEvent_Subscription".$action;
46
- break;
47
- }
48
-
49
- // No classname, throw an error
50
- if (!isset($classname)) throw(new CopernicaError(COPERNICAERROR_UNRECOGNIZEDEVENT));
51
-
52
- // construct the object
53
- return new $classname($queueItem);
54
- }
55
 
56
  /**
57
  * Construct the item given the queueitem
 
58
  * @param Copernica_MarketingSoftware_Model_Queue $queueItem
59
  */
60
- private function __construct($queueItem)
61
  {
62
  $this->queueItem = $queueItem;
63
  }
1
  <?php
2
+ /**
3
+ * Copernica Marketing Software
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0).
8
+ * It is available through the world-wide-web at this URL:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to obtain a copy of the license through the
11
+ * world-wide-web, please send an email to copernica@support.cream.nl
12
+ * so we can send you a copy immediately.
13
+ *
14
+ * DISCLAIMER
15
+ *
16
+ * Do not edit or add to this file if you wish to upgrade this software
17
+ * to newer versions in the future. If you wish to customize this module
18
+ * for your needs please refer to http://www.magento.com/ for more
19
+ * information.
20
+ *
21
+ * @category Copernica
22
+ * @package Copernica_MarketingSoftware
23
+ * @copyright Copyright (c) 2011-2012 Copernica & Cream. (http://docs.cream.nl/)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
  require_once(dirname(__FILE__).'/../Error.php');
28
  /**
29
  * A wrapper object around an event
34
  * What queue item was used to construct this item
35
  * @var Copernica_MarketingSoftware_Model_Queue
36
  */
37
+ protected $queueItem;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
38
 
39
  /**
40
  * Construct the item given the queueitem
41
+ *
42
  * @param Copernica_MarketingSoftware_Model_Queue $queueItem
43
  */
44
+ public function __construct($queueItem)
45
  {
46
  $this->queueItem = $queueItem;
47
  }
app/code/community/Copernica/MarketingSoftware/Model/QueueEvent/CustomerAdd.php CHANGED
@@ -1,4 +1,29 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  /**
3
  * A wrapper object around an event
4
  */
1
  <?php
2
+ /**
3
+ * Copernica Marketing Software
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0).
8
+ * It is available through the world-wide-web at this URL:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to obtain a copy of the license through the
11
+ * world-wide-web, please send an email to copernica@support.cream.nl
12
+ * so we can send you a copy immediately.
13
+ *
14
+ * DISCLAIMER
15
+ *
16
+ * Do not edit or add to this file if you wish to upgrade this software
17
+ * to newer versions in the future. If you wish to customize this module
18
+ * for your needs please refer to http://www.magento.com/ for more
19
+ * information.
20
+ *
21
+ * @category Copernica
22
+ * @package Copernica_MarketingSoftware
23
+ * @copyright Copyright (c) 2011-2012 Copernica & Cream. (http://docs.cream.nl/)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
  /**
28
  * A wrapper object around an event
29
  */
app/code/community/Copernica/MarketingSoftware/Model/QueueEvent/CustomerFull.php CHANGED
@@ -1,4 +1,29 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  /**
3
  * A wrapper object around an event
4
  */
1
  <?php
2
+ /**
3
+ * Copernica Marketing Software
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0).
8
+ * It is available through the world-wide-web at this URL:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to obtain a copy of the license through the
11
+ * world-wide-web, please send an email to copernica@support.cream.nl
12
+ * so we can send you a copy immediately.
13
+ *
14
+ * DISCLAIMER
15
+ *
16
+ * Do not edit or add to this file if you wish to upgrade this software
17
+ * to newer versions in the future. If you wish to customize this module
18
+ * for your needs please refer to http://www.magento.com/ for more
19
+ * information.
20
+ *
21
+ * @category Copernica
22
+ * @package Copernica_MarketingSoftware
23
+ * @copyright Copyright (c) 2011-2012 Copernica & Cream. (http://docs.cream.nl/)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
  /**
28
  * A wrapper object around an event
29
  */
app/code/community/Copernica/MarketingSoftware/Model/QueueEvent/CustomerModify.php CHANGED
@@ -1,4 +1,29 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  /**
3
  * A wrapper object around an event
4
  */
1
  <?php
2
+ /**
3
+ * Copernica Marketing Software
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0).
8
+ * It is available through the world-wide-web at this URL:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to obtain a copy of the license through the
11
+ * world-wide-web, please send an email to copernica@support.cream.nl
12
+ * so we can send you a copy immediately.
13
+ *
14
+ * DISCLAIMER
15
+ *
16
+ * Do not edit or add to this file if you wish to upgrade this software
17
+ * to newer versions in the future. If you wish to customize this module
18
+ * for your needs please refer to http://www.magento.com/ for more
19
+ * information.
20
+ *
21
+ * @category Copernica
22
+ * @package Copernica_MarketingSoftware
23
+ * @copyright Copyright (c) 2011-2012 Copernica & Cream. (http://docs.cream.nl/)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
  /**
28
  * A wrapper object around an event
29
  */
app/code/community/Copernica/MarketingSoftware/Model/QueueEvent/CustomerRemove.php CHANGED
@@ -1,27 +1,27 @@
1
  <?php
2
  /**
3
- * Copernica Marketing Software Plugin
4
  *
5
  * NOTICE OF LICENSE
6
  *
7
- * This source file is subject to the Open Software License (OSL 3.0)
8
- * that is bundled with this package in the file LICENSE.txt.
9
- * It is also available through the world-wide-web at this URL:
10
  * http://opensource.org/licenses/osl-3.0.php
11
- * If you did not receive a copy of the license and are unable to
12
- * obtain it through the world-wide-web, please send an email
13
- * to license@cream.nl so we can send you a copy immediately.
14
  *
15
  * DISCLAIMER
16
  *
17
- * Do not edit or add to this file if you wish to upgrade this plugin
18
- * to newer versions in the future. If you wish to customize it for
19
- * your needs please look at the documentation for more information.
 
20
  *
21
- * @category Copernica
22
- * @package Copernica_MarketingSoftware
23
- * @copyright Copyright (c) 2012 Cream (http://www.cream.nl)
24
- * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
26
 
27
  /**
1
  <?php
2
  /**
3
+ * Copernica Marketing Software
4
  *
5
  * NOTICE OF LICENSE
6
  *
7
+ * This source file is subject to the Open Software License (OSL 3.0).
8
+ * It is available through the world-wide-web at this URL:
 
9
  * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to obtain a copy of the license through the
11
+ * world-wide-web, please send an email to copernica@support.cream.nl
12
+ * so we can send you a copy immediately.
13
  *
14
  * DISCLAIMER
15
  *
16
+ * Do not edit or add to this file if you wish to upgrade this software
17
+ * to newer versions in the future. If you wish to customize this module
18
+ * for your needs please refer to http://www.magento.com/ for more
19
+ * information.
20
  *
21
+ * @category Copernica
22
+ * @package Copernica_MarketingSoftware
23
+ * @copyright Copyright (c) 2011-2012 Copernica & Cream. (http://docs.cream.nl/)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
  */
26
 
27
  /**
app/code/community/Copernica/MarketingSoftware/Model/QueueEvent/Factory.php ADDED
@@ -0,0 +1,84 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Copernica Marketing Software
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0).
8
+ * It is available through the world-wide-web at this URL:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to obtain a copy of the license through the
11
+ * world-wide-web, please send an email to copernica@support.cream.nl
12
+ * so we can send you a copy immediately.
13
+ *
14
+ * DISCLAIMER
15
+ *
16
+ * Do not edit or add to this file if you wish to upgrade this software
17
+ * to newer versions in the future. If you wish to customize this module
18
+ * for your needs please refer to http://www.magento.com/ for more
19
+ * information.
20
+ *
21
+ * @category Copernica
22
+ * @package Copernica_MarketingSoftware
23
+ * @copyright Copyright (c) 2011-2012 Copernica & Cream. (http://docs.cream.nl/)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ require_once(dirname(__FILE__).'/../Error.php');
28
+
29
+ /**
30
+ * Factory class for getting queue event objects
31
+ */
32
+ class Copernica_MarketingSoftware_Model_QueueEvent_Factory
33
+ {
34
+ /**
35
+ * Get the right object
36
+ *
37
+ * @return Copernica_MarketingSoftware_Model_QueueEvent_Abstract
38
+ */
39
+ public function get($queueItem)
40
+ {
41
+ // If we want to start a full synchronisation, we should return a start sync object
42
+ if ($queueItem->getAction() == 'start_sync') {
43
+ $classname = Mage::getConfig()->getModelClassName('marketingsoftware/QueueEvent_StartSync');
44
+ return new $classname($queueItem);
45
+ }
46
+
47
+ // Prepare the action, to append it to the classname
48
+ $action = ucfirst($queueItem->getAction());
49
+
50
+ // What kind of class is given
51
+ switch (get_class($queueItem->getObject()))
52
+ {
53
+ case "Copernica_MarketingSoftware_Model_Abstraction_Quote":
54
+ $classname = "marketingsoftware/QueueEvent_Quote".$action;
55
+ break;
56
+
57
+ case "Copernica_MarketingSoftware_Model_Abstraction_Quote_Item":
58
+ $classname = "marketingsoftware/QueueEvent_QuoteItem".$action;
59
+ break;
60
+
61
+ case "Copernica_MarketingSoftware_Model_Abstraction_Customer":
62
+ $classname = "marketingsoftware/QueueEvent_Customer".$action;
63
+ break;
64
+
65
+ case "Copernica_MarketingSoftware_Model_Abstraction_Order":
66
+ $classname = "marketingsoftware/QueueEvent_Order".$action;
67
+ break;
68
+
69
+ case "Copernica_MarketingSoftware_Model_Abstraction_Subscription":
70
+ $classname = "marketingsoftware/QueueEvent_Subscription".$action;
71
+ break;
72
+ }
73
+
74
+ // No classname, throw an error
75
+ if (!isset($classname)) throw new CopernicaError(COPERNICAERROR_UNRECOGNIZEDEVENT);
76
+
77
+ // Get correct classname
78
+ $classname = Mage::getConfig()->getModelClassName($classname);
79
+ if (!class_exists($classname)) throw new CopernicaError(COPERNICAERROR_UNRECOGNIZEDEVENT);
80
+
81
+ // construct the object
82
+ return new $classname($queueItem);
83
+ }
84
+ }
app/code/community/Copernica/MarketingSoftware/Model/QueueEvent/OrderAdd.php CHANGED
@@ -1,4 +1,29 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  /**
3
  * A wrapper object around an event
4
  */
1
  <?php
2
+ /**
3
+ * Copernica Marketing Software
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0).
8
+ * It is available through the world-wide-web at this URL:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to obtain a copy of the license through the
11
+ * world-wide-web, please send an email to copernica@support.cream.nl
12
+ * so we can send you a copy immediately.
13
+ *
14
+ * DISCLAIMER
15
+ *
16
+ * Do not edit or add to this file if you wish to upgrade this software
17
+ * to newer versions in the future. If you wish to customize this module
18
+ * for your needs please refer to http://www.magento.com/ for more
19
+ * information.
20
+ *
21
+ * @category Copernica
22
+ * @package Copernica_MarketingSoftware
23
+ * @copyright Copyright (c) 2011-2012 Copernica & Cream. (http://docs.cream.nl/)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
  /**
28
  * A wrapper object around an event
29
  */
app/code/community/Copernica/MarketingSoftware/Model/QueueEvent/OrderModify.php CHANGED
@@ -1,4 +1,29 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  /**
3
  * A wrapper object around an event
4
  */
1
  <?php
2
+ /**
3
+ * Copernica Marketing Software
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0).
8
+ * It is available through the world-wide-web at this URL:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to obtain a copy of the license through the
11
+ * world-wide-web, please send an email to copernica@support.cream.nl
12
+ * so we can send you a copy immediately.
13
+ *
14
+ * DISCLAIMER
15
+ *
16
+ * Do not edit or add to this file if you wish to upgrade this software
17
+ * to newer versions in the future. If you wish to customize this module
18
+ * for your needs please refer to http://www.magento.com/ for more
19
+ * information.
20
+ *
21
+ * @category Copernica
22
+ * @package Copernica_MarketingSoftware
23
+ * @copyright Copyright (c) 2011-2012 Copernica & Cream. (http://docs.cream.nl/)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
  /**
28
  * A wrapper object around an event
29
  */
app/code/community/Copernica/MarketingSoftware/Model/QueueEvent/QuoteItem.php CHANGED
@@ -1,4 +1,29 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  /**
3
  * A wrapper object around an event
4
  */
1
  <?php
2
+ /**
3
+ * Copernica Marketing Software
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0).
8
+ * It is available through the world-wide-web at this URL:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to obtain a copy of the license through the
11
+ * world-wide-web, please send an email to copernica@support.cream.nl
12
+ * so we can send you a copy immediately.
13
+ *
14
+ * DISCLAIMER
15
+ *
16
+ * Do not edit or add to this file if you wish to upgrade this software
17
+ * to newer versions in the future. If you wish to customize this module
18
+ * for your needs please refer to http://www.magento.com/ for more
19
+ * information.
20
+ *
21
+ * @category Copernica
22
+ * @package Copernica_MarketingSoftware
23
+ * @copyright Copyright (c) 2011-2012 Copernica & Cream. (http://docs.cream.nl/)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
  /**
28
  * A wrapper object around an event
29
  */
app/code/community/Copernica/MarketingSoftware/Model/QueueEvent/QuoteItemAdd.php CHANGED
@@ -1,4 +1,29 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  /**
3
  * A wrapper object around an event
4
  */
1
  <?php
2
+ /**
3
+ * Copernica Marketing Software
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0).
8
+ * It is available through the world-wide-web at this URL:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to obtain a copy of the license through the
11
+ * world-wide-web, please send an email to copernica@support.cream.nl
12
+ * so we can send you a copy immediately.
13
+ *
14
+ * DISCLAIMER
15
+ *
16
+ * Do not edit or add to this file if you wish to upgrade this software
17
+ * to newer versions in the future. If you wish to customize this module
18
+ * for your needs please refer to http://www.magento.com/ for more
19
+ * information.
20
+ *
21
+ * @category Copernica
22
+ * @package Copernica_MarketingSoftware
23
+ * @copyright Copyright (c) 2011-2012 Copernica & Cream. (http://docs.cream.nl/)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
  /**
28
  * A wrapper object around an event
29
  */
app/code/community/Copernica/MarketingSoftware/Model/QueueEvent/QuoteItemModify.php CHANGED
@@ -1,4 +1,29 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  /**
3
  * A wrapper object around an event
4
  */
1
  <?php
2
+ /**
3
+ * Copernica Marketing Software
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0).
8
+ * It is available through the world-wide-web at this URL:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to obtain a copy of the license through the
11
+ * world-wide-web, please send an email to copernica@support.cream.nl
12
+ * so we can send you a copy immediately.
13
+ *
14
+ * DISCLAIMER
15
+ *
16
+ * Do not edit or add to this file if you wish to upgrade this software
17
+ * to newer versions in the future. If you wish to customize this module
18
+ * for your needs please refer to http://www.magento.com/ for more
19
+ * information.
20
+ *
21
+ * @category Copernica
22
+ * @package Copernica_MarketingSoftware
23
+ * @copyright Copyright (c) 2011-2012 Copernica & Cream. (http://docs.cream.nl/)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
  /**
28
  * A wrapper object around an event
29
  */
app/code/community/Copernica/MarketingSoftware/Model/QueueEvent/QuoteItemRemove.php CHANGED
@@ -1,4 +1,29 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  /**
3
  * A wrapper object around an event
4
  */
1
  <?php
2
+ /**
3
+ * Copernica Marketing Software
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0).
8
+ * It is available through the world-wide-web at this URL:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to obtain a copy of the license through the
11
+ * world-wide-web, please send an email to copernica@support.cream.nl
12
+ * so we can send you a copy immediately.
13
+ *
14
+ * DISCLAIMER
15
+ *
16
+ * Do not edit or add to this file if you wish to upgrade this software
17
+ * to newer versions in the future. If you wish to customize this module
18
+ * for your needs please refer to http://www.magento.com/ for more
19
+ * information.
20
+ *
21
+ * @category Copernica
22
+ * @package Copernica_MarketingSoftware
23
+ * @copyright Copyright (c) 2011-2012 Copernica & Cream. (http://docs.cream.nl/)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
  /**
28
  * A wrapper object around an event
29
  */
app/code/community/Copernica/MarketingSoftware/Model/QueueEvent/QuoteModify.php CHANGED
@@ -1,4 +1,29 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  /**
3
  * A wrapper object around an event
4
  */
1
  <?php
2
+ /**
3
+ * Copernica Marketing Software
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0).
8
+ * It is available through the world-wide-web at this URL:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to obtain a copy of the license through the
11
+ * world-wide-web, please send an email to copernica@support.cream.nl
12
+ * so we can send you a copy immediately.
13
+ *
14
+ * DISCLAIMER
15
+ *
16
+ * Do not edit or add to this file if you wish to upgrade this software
17
+ * to newer versions in the future. If you wish to customize this module
18
+ * for your needs please refer to http://www.magento.com/ for more
19
+ * information.
20
+ *
21
+ * @category Copernica
22
+ * @package Copernica_MarketingSoftware
23
+ * @copyright Copyright (c) 2011-2012 Copernica & Cream. (http://docs.cream.nl/)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
  /**
28
  * A wrapper object around an event
29
  */
app/code/community/Copernica/MarketingSoftware/Model/QueueEvent/StartSync.php CHANGED
@@ -1,4 +1,29 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  /**
3
  * A wrapper object around an event
4
  */
@@ -7,12 +32,12 @@ class Copernica_MarketingSoftware_Model_QueueEvent_StartSync extends Copernica_M
7
  /**
8
  * @var integer store the start time
9
  */
10
- private $startTime;
11
 
12
  /**
13
  * @var integer store the time limit
14
  */
15
- private $timeLimit;
16
 
17
 
18
  /**
@@ -48,19 +73,19 @@ class Copernica_MarketingSoftware_Model_QueueEvent_StartSync extends Copernica_M
48
  * this piece of code has been improved by Cream (www.cream.nl)
49
  * @param integer page size
50
  */
51
- private function _addCustomersToQueue($pageSize)
52
  {
53
  // Get the config helper
54
  $config = Mage::helper('marketingsoftware/config');
55
 
56
- // get the customers,
57
  // this piece of code has been improved by Cream (www.cream.nl)
58
  $customers = Mage::getModel('customer/customer')
59
  ->getCollection()
60
  ->setPageSize($pageSize)
61
  ->addAttributeToSort('updated_at')
62
  ->addAttributeToFilter('store_id', array('notnull' => true))
63
- ->addAttributeToFilter('website_id', array('notnull' => true))
64
  ->addAttributeToFilter('updated_at', array(
65
  'from' => $config->getCustomerProgressStatus()
66
  ));
@@ -122,7 +147,7 @@ class Copernica_MarketingSoftware_Model_QueueEvent_StartSync extends Copernica_M
122
  * this piece of code has been improved by Cream (www.cream.nl)
123
  * @param integer page size
124
  */
125
- private function _addOrdersToQueue($pageSize)
126
  {
127
  // Get the config helper
128
  $config = Mage::helper('marketingsoftware/config');
@@ -206,7 +231,7 @@ class Copernica_MarketingSoftware_Model_QueueEvent_StartSync extends Copernica_M
206
  * Add all the subscriptions to the queue, which are placed by guest subscribers
207
  * @param integer page size
208
  */
209
- private function _addSubscriptionsToQueue($pageSize)
210
  {
211
  // Get the config helper
212
  $config = Mage::helper('marketingsoftware/config');
1
  <?php
2
+ /**
3
+ * Copernica Marketing Software
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0).
8
+ * It is available through the world-wide-web at this URL:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to obtain a copy of the license through the
11
+ * world-wide-web, please send an email to copernica@support.cream.nl
12
+ * so we can send you a copy immediately.
13
+ *
14
+ * DISCLAIMER
15
+ *
16
+ * Do not edit or add to this file if you wish to upgrade this software
17
+ * to newer versions in the future. If you wish to customize this module
18
+ * for your needs please refer to http://www.magento.com/ for more
19
+ * information.
20
+ *
21
+ * @category Copernica
22
+ * @package Copernica_MarketingSoftware
23
+ * @copyright Copyright (c) 2011-2012 Copernica & Cream. (http://docs.cream.nl/)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
  /**
28
  * A wrapper object around an event
29
  */
32
  /**
33
  * @var integer store the start time
34
  */
35
+ protected $startTime;
36
 
37
  /**
38
  * @var integer store the time limit
39
  */
40
+ protected $timeLimit;
41
 
42
 
43
  /**
73
  * this piece of code has been improved by Cream (www.cream.nl)
74
  * @param integer page size
75
  */
76
+ protected function _addCustomersToQueue($pageSize)
77
  {
78
  // Get the config helper
79
  $config = Mage::helper('marketingsoftware/config');
80
 
81
+ // get the customers,
82
  // this piece of code has been improved by Cream (www.cream.nl)
83
  $customers = Mage::getModel('customer/customer')
84
  ->getCollection()
85
  ->setPageSize($pageSize)
86
  ->addAttributeToSort('updated_at')
87
  ->addAttributeToFilter('store_id', array('notnull' => true))
88
+ ->addAttributeToFilter('website_id', array('notnull' => true))
89
  ->addAttributeToFilter('updated_at', array(
90
  'from' => $config->getCustomerProgressStatus()
91
  ));
147
  * this piece of code has been improved by Cream (www.cream.nl)
148
  * @param integer page size
149
  */
150
+ protected function _addOrdersToQueue($pageSize)
151
  {
152
  // Get the config helper
153
  $config = Mage::helper('marketingsoftware/config');
231
  * Add all the subscriptions to the queue, which are placed by guest subscribers
232
  * @param integer page size
233
  */
234
+ protected function _addSubscriptionsToQueue($pageSize)
235
  {
236
  // Get the config helper
237
  $config = Mage::helper('marketingsoftware/config');
app/code/community/Copernica/MarketingSoftware/Model/QueueEvent/SubscriptionAdd.php CHANGED
@@ -1,4 +1,29 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  /**
3
  * A wrapper object around an event
4
  */
1
  <?php
2
+ /**
3
+ * Copernica Marketing Software
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0).
8
+ * It is available through the world-wide-web at this URL:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to obtain a copy of the license through the
11
+ * world-wide-web, please send an email to copernica@support.cream.nl
12
+ * so we can send you a copy immediately.
13
+ *
14
+ * DISCLAIMER
15
+ *
16
+ * Do not edit or add to this file if you wish to upgrade this software
17
+ * to newer versions in the future. If you wish to customize this module
18
+ * for your needs please refer to http://www.magento.com/ for more
19
+ * information.
20
+ *
21
+ * @category Copernica
22
+ * @package Copernica_MarketingSoftware
23
+ * @copyright Copyright (c) 2011-2012 Copernica & Cream. (http://docs.cream.nl/)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
  /**
28
  * A wrapper object around an event
29
  */
app/code/community/Copernica/MarketingSoftware/Model/QueueEvent/SubscriptionModify.php CHANGED
@@ -1,4 +1,29 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  /**
3
  * A wrapper object around an event
4
  */
1
  <?php
2
+ /**
3
+ * Copernica Marketing Software
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0).
8
+ * It is available through the world-wide-web at this URL:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to obtain a copy of the license through the
11
+ * world-wide-web, please send an email to copernica@support.cream.nl
12
+ * so we can send you a copy immediately.
13
+ *
14
+ * DISCLAIMER
15
+ *
16
+ * Do not edit or add to this file if you wish to upgrade this software
17
+ * to newer versions in the future. If you wish to customize this module
18
+ * for your needs please refer to http://www.magento.com/ for more
19
+ * information.
20
+ *
21
+ * @category Copernica
22
+ * @package Copernica_MarketingSoftware
23
+ * @copyright Copyright (c) 2011-2012 Copernica & Cream. (http://docs.cream.nl/)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
  /**
28
  * A wrapper object around an event
29
  */
app/code/community/Copernica/MarketingSoftware/Model/QueueEvent/SubscriptionRemove.php CHANGED
@@ -1,4 +1,29 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  /**
3
  * A wrapper object around an event
4
  */
1
  <?php
2
+ /**
3
+ * Copernica Marketing Software
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0).
8
+ * It is available through the world-wide-web at this URL:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to obtain a copy of the license through the
11
+ * world-wide-web, please send an email to copernica@support.cream.nl
12
+ * so we can send you a copy immediately.
13
+ *
14
+ * DISCLAIMER
15
+ *
16
+ * Do not edit or add to this file if you wish to upgrade this software
17
+ * to newer versions in the future. If you wish to customize this module
18
+ * for your needs please refer to http://www.magento.com/ for more
19
+ * information.
20
+ *
21
+ * @category Copernica
22
+ * @package Copernica_MarketingSoftware
23
+ * @copyright Copyright (c) 2011-2012 Copernica & Cream. (http://docs.cream.nl/)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
  /**
28
  * A wrapper object around an event
29
  */
app/code/community/Copernica/MarketingSoftware/controllers/Adminhtml/Marketingsoftware/ExportController.php CHANGED
@@ -1,15 +1,39 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  /**
3
- * Export Controller, which takes care of the export data menu.
4
- * Copernica Marketing Software v 1.2.0
5
- * March 2011
6
- * http://www.copernica.com/
7
  */
8
  class Copernica_MarketingSoftware_Adminhtml_Marketingsoftware_ExportController extends Mage_Adminhtml_Controller_Action
9
  {
10
  /**
11
- * indexAction() takes care of displaying the form which
12
- * contains the details used for the SOAP connection
 
13
  */
14
  public function indexAction()
15
  {
@@ -34,8 +58,9 @@ class Copernica_MarketingSoftware_Adminhtml_Marketingsoftware_ExportController e
34
  /**
35
  * progressAction() takes care of placing a loader
36
  * during the background export action
37
- * @return string Returns a 'completed' or 'in progress' message, depending
38
  * on the state of the sync tool
 
39
  */
40
  public function progressAction()
41
  {
@@ -72,9 +97,10 @@ class Copernica_MarketingSoftware_Adminhtml_Marketingsoftware_ExportController e
72
  }
73
 
74
  /**
75
- * getAction() takes care of exporting customers account information
76
- * from Magento to Copernica
77
- * @return string Returns the current page reloaded, containing an information message
 
78
  */
79
  public function getAction()
80
  {
1
  <?php
2
+ /**
3
+ * Copernica Marketing Software
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0).
8
+ * It is available through the world-wide-web at this URL:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to obtain a copy of the license through the
11
+ * world-wide-web, please send an email to copernica@support.cream.nl
12
+ * so we can send you a copy immediately.
13
+ *
14
+ * DISCLAIMER
15
+ *
16
+ * Do not edit or add to this file if you wish to upgrade this software
17
+ * to newer versions in the future. If you wish to customize this module
18
+ * for your needs please refer to http://www.magento.com/ for more
19
+ * information.
20
+ *
21
+ * @category Copernica
22
+ * @package Copernica_MarketingSoftware
23
+ * @copyright Copyright (c) 2011-2012 Copernica & Cream. (http://docs.cream.nl/)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
  /**
28
+ * Export Controller takes care of the export data menu.
29
+ *
 
 
30
  */
31
  class Copernica_MarketingSoftware_Adminhtml_Marketingsoftware_ExportController extends Mage_Adminhtml_Controller_Action
32
  {
33
  /**
34
+ * Takes care of displaying the form which
35
+ * contains the details used for the SOAP connection.
36
+ *
37
  */
38
  public function indexAction()
39
  {
58
  /**
59
  * progressAction() takes care of placing a loader
60
  * during the background export action
61
+ * Returns a 'completed' or 'in progress' message, depending
62
  * on the state of the sync tool
63
+ * @return string
64
  */
65
  public function progressAction()
66
  {
97
  }
98
 
99
  /**
100
+ * getAction() takes care of exporting customers account information
101
+ * from Magento to Copernica.
102
+ *
103
+ * @return string Returns the current page reloaded, containing an information message
104
  */
105
  public function getAction()
106
  {
app/code/community/Copernica/MarketingSoftware/controllers/Adminhtml/Marketingsoftware/LinkController.php CHANGED
@@ -1,9 +1,32 @@
1
  <?php
2
  /**
3
- * Link Controller, which takes care of the link fields menu.
4
- * Copernica Marketing Software v 1.2.0
5
- * March 2011
6
- * http://www.copernica.com/
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
  */
8
  class Copernica_MarketingSoftware_Adminhtml_Marketingsoftware_LinkController extends Mage_Adminhtml_Controller_Action
9
  {
@@ -40,7 +63,8 @@ class Copernica_MarketingSoftware_Adminhtml_Marketingsoftware_LinkController ext
40
 
41
  /**
42
  * Check and process incoming ajax request
43
- * @return string The error description, or 'ok' if not error was detected
 
44
  */
45
  public function checkAjaxAction()
46
  {
1
  <?php
2
  /**
3
+ * Copernica Marketing Software
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0).
8
+ * It is available through the world-wide-web at this URL:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to obtain a copy of the license through the
11
+ * world-wide-web, please send an email to copernica@support.cream.nl
12
+ * so we can send you a copy immediately.
13
+ *
14
+ * DISCLAIMER
15
+ *
16
+ * Do not edit or add to this file if you wish to upgrade this software
17
+ * to newer versions in the future. If you wish to customize this module
18
+ * for your needs please refer to http://www.magento.com/ for more
19
+ * information.
20
+ *
21
+ * @category Copernica
22
+ * @package Copernica_MarketingSoftware
23
+ * @copyright Copyright (c) 2011-2012 Copernica & Cream. (http://docs.cream.nl/)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ /**
28
+ * Link Controller takes care of the link fields menu.
29
+ *
30
  */
31
  class Copernica_MarketingSoftware_Adminhtml_Marketingsoftware_LinkController extends Mage_Adminhtml_Controller_Action
32
  {
63
 
64
  /**
65
  * Check and process incoming ajax request
66
+ * The error description, or 'ok' if not error was detected
67
+ * @return string
68
  */
69
  public function checkAjaxAction()
70
  {
app/code/community/Copernica/MarketingSoftware/controllers/Adminhtml/Marketingsoftware/SettingsController.php CHANGED
@@ -1,9 +1,32 @@
1
  <?php
2
  /**
3
- * Settings Controller, which takes care of the settings menu.
4
- * Copernica Marketing Software v 1.2.0
5
- * March 2011
6
- * http://www.copernica.com/
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
7
  */
8
  class Copernica_MarketingSoftware_Adminhtml_Marketingsoftware_SettingsController extends Mage_Adminhtml_Controller_Action
9
  {
1
  <?php
2
  /**
3
+ * Copernica Marketing Software
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0).
8
+ * It is available through the world-wide-web at this URL:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to obtain a copy of the license through the
11
+ * world-wide-web, please send an email to copernica@support.cream.nl
12
+ * so we can send you a copy immediately.
13
+ *
14
+ * DISCLAIMER
15
+ *
16
+ * Do not edit or add to this file if you wish to upgrade this software
17
+ * to newer versions in the future. If you wish to customize this module
18
+ * for your needs please refer to http://www.magento.com/ for more
19
+ * information.
20
+ *
21
+ * @category Copernica
22
+ * @package Copernica_MarketingSoftware
23
+ * @copyright Copyright (c) 2011-2012 Copernica & Cream. (http://docs.cream.nl/)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ /**
28
+ * Settings Controller, which takes care of the settings menu.
29
+ *
30
  */
31
  class Copernica_MarketingSoftware_Adminhtml_Marketingsoftware_SettingsController extends Mage_Adminhtml_Controller_Action
32
  {
app/code/community/Copernica/MarketingSoftware/controllers/ProductController.php CHANGED
@@ -1,14 +1,51 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  class Copernica_MarketingSoftware_ProductController extends Mage_Core_Controller_Front_Action
3
  {
4
  /**
5
  * Handles a request to copernica/product/xml
 
6
  */
7
  public function xmlAction()
8
  {
9
  //TODO: some security
10
  $request = $this->getRequest();
11
- if ($product = $this->_getProduct($request->getParam('id'))) {
 
 
 
 
 
 
12
  $xml = $this->_buildProductXML(array($product));
13
  $this->_prepareResponse($xml);
14
  }
@@ -45,7 +82,7 @@ class Copernica_MarketingSoftware_ProductController extends Mage_Core_Controller
45
  * @param Mage_Catalog_Model_Product $product
46
  * @return SimpleXMLElement
47
  */
48
- private function _buildProductXML($collection)
49
  {
50
  $xml = new SimpleXMLElement('<products/>');
51
 
@@ -65,6 +102,7 @@ class Copernica_MarketingSoftware_ProductController extends Mage_Core_Controller
65
  'name',
66
  'description',
67
  'price',
 
68
  'modified',
69
  'created',
70
  'productUrl',
@@ -91,7 +129,7 @@ class Copernica_MarketingSoftware_ProductController extends Mage_Core_Controller
91
  }
92
  elseif (!is_array($value))
93
  {
94
- if ($name == 'price') {
95
  $value = Mage::helper('core')->currency($value, true, false);
96
  }
97
 
@@ -131,7 +169,7 @@ class Copernica_MarketingSoftware_ProductController extends Mage_Core_Controller
131
  *
132
  * @param SimpleXMLElement $xml
133
  */
134
- private function _prepareResponse(SimpleXMLElement $xml)
135
  {
136
  $response = $this->getResponse();
137
 
@@ -149,12 +187,12 @@ class Copernica_MarketingSoftware_ProductController extends Mage_Core_Controller
149
  }
150
 
151
  /**
152
- * Retrieves a product
153
  *
154
  * @param int $productId
155
  * @return Mage_Catalog_Model_Product
156
  */
157
- private function _getProduct($productId)
158
  {
159
  $product = Mage::getModel('catalog/product')
160
  ->load($productId);
@@ -162,4 +200,21 @@ class Copernica_MarketingSoftware_ProductController extends Mage_Core_Controller
162
  // only a product with an id exists
163
  return $product->getId() ? $product : null;
164
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
165
  }
1
  <?php
2
+ /**
3
+ * Copernica Marketing Software
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0).
8
+ * It is available through the world-wide-web at this URL:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to obtain a copy of the license through the
11
+ * world-wide-web, please send an email to copernica@support.cream.nl
12
+ * so we can send you a copy immediately.
13
+ *
14
+ * DISCLAIMER
15
+ *
16
+ * Do not edit or add to this file if you wish to upgrade this software
17
+ * to newer versions in the future. If you wish to customize this module
18
+ * for your needs please refer to http://www.magento.com/ for more
19
+ * information.
20
+ *
21
+ * @category Copernica
22
+ * @package Copernica_MarketingSoftware
23
+ * @copyright Copyright (c) 2011-2012 Copernica & Cream. (http://docs.cream.nl/)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ /**
28
+ * Controls the product actions.
29
+ *
30
+ *
31
+ */
32
  class Copernica_MarketingSoftware_ProductController extends Mage_Core_Controller_Front_Action
33
  {
34
  /**
35
  * Handles a request to copernica/product/xml
36
+ * Prints a XML with product information.
37
  */
38
  public function xmlAction()
39
  {
40
  //TODO: some security
41
  $request = $this->getRequest();
42
+ if($request->getParam('identifier') == "sku"){
43
+ $product = $this->_getProductBySku($request->getParam('id'));
44
+ } else {
45
+ $product = $this->_getProduct($request->getParam('id'));
46
+ }
47
+
48
+ if ($product != NULL) {
49
  $xml = $this->_buildProductXML(array($product));
50
  $this->_prepareResponse($xml);
51
  }
82
  * @param Mage_Catalog_Model_Product $product
83
  * @return SimpleXMLElement
84
  */
85
+ protected function _buildProductXML($collection)
86
  {
87
  $xml = new SimpleXMLElement('<products/>');
88
 
102
  'name',
103
  'description',
104
  'price',
105
+ 'specialPrice',
106
  'modified',
107
  'created',
108
  'productUrl',
129
  }
130
  elseif (!is_array($value))
131
  {
132
+ if ($name == 'price' || $name == 'specialPrice') {
133
  $value = Mage::helper('core')->currency($value, true, false);
134
  }
135
 
169
  *
170
  * @param SimpleXMLElement $xml
171
  */
172
+ protected function _prepareResponse(SimpleXMLElement $xml)
173
  {
174
  $response = $this->getResponse();
175
 
187
  }
188
 
189
  /**
190
+ * Retrieves a product by ID
191
  *
192
  * @param int $productId
193
  * @return Mage_Catalog_Model_Product
194
  */
195
+ protected function _getProduct($productId)
196
  {
197
  $product = Mage::getModel('catalog/product')
198
  ->load($productId);
200
  // only a product with an id exists
201
  return $product->getId() ? $product : null;
202
  }
203
+
204
+ /**
205
+ * Retrieves a product by SKU
206
+ *
207
+ * @param String $productSku
208
+ * @return Mage_Catalog_Model_Product
209
+ */
210
+ protected function _getProductBySku($productSku)
211
+ {
212
+ $product = Mage::getModel('catalog/product')
213
+ ->loadByAttribute('sku',$productSku);
214
+
215
+ // only a product with an id exists
216
+ return $product->getId() ? $product : null;
217
+ }
218
+
219
+
220
  }
app/code/community/Copernica/MarketingSoftware/controllers/UnsubscribeController.php CHANGED
@@ -1,8 +1,38 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  class Copernica_MarketingSoftware_UnsubscribeController extends Mage_Core_Controller_Front_Action
3
  {
4
  /**
5
  * Handles a request to copernica/unsubscribe/process
 
6
  */
7
  public function processAction()
8
  {
1
  <?php
2
+ /**
3
+ * Copernica Marketing Software
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0).
8
+ * It is available through the world-wide-web at this URL:
9
+ * http://opensource.org/licenses/osl-3.0.php
10
+ * If you are unable to obtain a copy of the license through the
11
+ * world-wide-web, please send an email to copernica@support.cream.nl
12
+ * so we can send you a copy immediately.
13
+ *
14
+ * DISCLAIMER
15
+ *
16
+ * Do not edit or add to this file if you wish to upgrade this software
17
+ * to newer versions in the future. If you wish to customize this module
18
+ * for your needs please refer to http://www.magento.com/ for more
19
+ * information.
20
+ *
21
+ * @category Copernica
22
+ * @package Copernica_MarketingSoftware
23
+ * @copyright Copyright (c) 2011-2012 Copernica & Cream. (http://docs.cream.nl/)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ /**
28
+ * Class to unsubscribe
29
+ *
30
+ */
31
  class Copernica_MarketingSoftware_UnsubscribeController extends Mage_Core_Controller_Front_Action
32
  {
33
  /**
34
  * Handles a request to copernica/unsubscribe/process
35
+ *
36
  */
37
  public function processAction()
38
  {
app/code/community/Copernica/MarketingSoftware/etc/adminhtml.xml CHANGED
@@ -9,15 +9,15 @@
9
  <children>
10
  <settings translate="title" module="marketingsoftware">
11
  <title>Account Settings</title>
12
- <action>*/marketingsoftware_settings</action>
13
  </settings>
14
  <links translate="title" module="marketingsoftware">
15
  <title>Link Fields</title>
16
- <action>*/marketingsoftware_link</action>
17
  </links>
18
  <export translate="title" module="marketingsoftware">
19
  <title>Synchronize Data</title>
20
- <action>*/marketingsoftware_export</action>
21
  </export>
22
  </children>
23
  </copernica>
9
  <children>
10
  <settings translate="title" module="marketingsoftware">
11
  <title>Account Settings</title>
12
+ <action>adminhtml/marketingsoftware_settings</action>
13
  </settings>
14
  <links translate="title" module="marketingsoftware">
15
  <title>Link Fields</title>
16
+ <action>adminhtml/marketingsoftware_link</action>
17
  </links>
18
  <export translate="title" module="marketingsoftware">
19
  <title>Synchronize Data</title>
20
+ <action>adminhtml/marketingsoftware_export</action>
21
  </export>
22
  </children>
23
  </copernica>
app/code/community/Copernica/MarketingSoftware/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <Copernica_MarketingSoftware>
5
- <version>2.0.1</version>
6
  </Copernica_MarketingSoftware>
7
  </modules>
8
  <global>
@@ -20,6 +20,9 @@
20
  <marketingsoftware>
21
  <table>copernica_marketingsoftware</table>
22
  </marketingsoftware>
 
 
 
23
  </entities>
24
  </marketingsoftware_mysql4>
25
  </models>
2
  <config>
3
  <modules>
4
  <Copernica_MarketingSoftware>
5
+ <version>2.1.0</version>
6
  </Copernica_MarketingSoftware>
7
  </modules>
8
  <global>
20
  <marketingsoftware>
21
  <table>copernica_marketingsoftware</table>
22
  </marketingsoftware>
23
+ <config_data>
24
+ <table>copernica_config_data</table>
25
+ </config_data>
26
  </entities>
27
  </marketingsoftware_mysql4>
28
  </models>
app/code/community/Copernica/MarketingSoftware/sql/marketingsoftware_setup/mysql4-install-1.2.0.php CHANGED
@@ -1,4 +1,28 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  $installer = $this;
3
  /* @var $installer Mage_Core_Model_Resource_Setup */
4
 
1
  <?php
2
+ /**
3
+ * Copernica Marketing Software
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to copernica@support.cream.nl so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Copernica Marketing Software to newer
18
+ * versions in the future. If you wish to customize this module for your
19
+ * needs please refer to http://www.copernica.com/ for more information.
20
+ *
21
+ * @category Copernica
22
+ * @package Copernica_MarketingSoftware
23
+ * @copyright Copyright (c) 2011-2012 Copernica & Cream. (http://docs.cream.nl/)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
  $installer = $this;
27
  /* @var $installer Mage_Core_Model_Resource_Setup */
28
 
app/code/community/Copernica/MarketingSoftware/sql/marketingsoftware_setup/mysql4-upgrade-1.1.5-1.1.6.php CHANGED
@@ -1,4 +1,28 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  /**
3
  * Upgrader from version 1.1.5 to 1.1.6
4
  * Copernica Marketing Software v 1.1.8
1
  <?php
2
+ /**
3
+ * Copernica Marketing Software
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to copernica@support.cream.nl so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Copernica Marketing Software to newer
18
+ * versions in the future. If you wish to customize this module for your
19
+ * needs please refer to http://www.copernica.com/ for more information.
20
+ *
21
+ * @category Copernica
22
+ * @package Copernica_MarketingSoftware
23
+ * @copyright Copyright (c) 2011-2012 Copernica & Cream. (http://docs.cream.nl/)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
  /**
27
  * Upgrader from version 1.1.5 to 1.1.6
28
  * Copernica Marketing Software v 1.1.8
app/code/community/Copernica/MarketingSoftware/sql/marketingsoftware_setup/mysql4-upgrade-1.1.6-1.1.7.php CHANGED
@@ -1,4 +1,28 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  /**
3
  * Upgrader from version 1.1.5 to 1.1.6
4
  * Copernica Marketing Software v 1.1.8
1
  <?php
2
+ /**
3
+ * Copernica Marketing Software
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to copernica@support.cream.nl so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Copernica Marketing Software to newer
18
+ * versions in the future. If you wish to customize this module for your
19
+ * needs please refer to http://www.copernica.com/ for more information.
20
+ *
21
+ * @category Copernica
22
+ * @package Copernica_MarketingSoftware
23
+ * @copyright Copyright (c) 2011-2012 Copernica & Cream. (http://docs.cream.nl/)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
  /**
27
  * Upgrader from version 1.1.5 to 1.1.6
28
  * Copernica Marketing Software v 1.1.8
app/code/community/Copernica/MarketingSoftware/sql/marketingsoftware_setup/mysql4-upgrade-1.1.7-1.1.8.php CHANGED
@@ -1,4 +1,28 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  /**
3
  * Upgrader from version 1.1.7 to 1.1.8
4
  * Copernica Marketing Software v 1.1.8
1
  <?php
2
+ /**
3
+ * Copernica Marketing Software
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to copernica@support.cream.nl so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Copernica Marketing Software to newer
18
+ * versions in the future. If you wish to customize this module for your
19
+ * needs please refer to http://www.copernica.com/ for more information.
20
+ *
21
+ * @category Copernica
22
+ * @package Copernica_MarketingSoftware
23
+ * @copyright Copyright (c) 2011-2012 Copernica & Cream. (http://docs.cream.nl/)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
  /**
27
  * Upgrader from version 1.1.7 to 1.1.8
28
  * Copernica Marketing Software v 1.1.8
app/code/community/Copernica/MarketingSoftware/sql/marketingsoftware_setup/mysql4-upgrade-1.1.8-1.2.0.php CHANGED
@@ -1,4 +1,28 @@
1
  <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
2
  /**
3
  * Upgrader from version 1.1.7 to 1.1.8
4
  * Copernica Marketing Software v 1.1.8
1
  <?php
2
+ /**
3
+ * Copernica Marketing Software
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to copernica@support.cream.nl so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Copernica Marketing Software to newer
18
+ * versions in the future. If you wish to customize this module for your
19
+ * needs please refer to http://www.copernica.com/ for more information.
20
+ *
21
+ * @category Copernica
22
+ * @package Copernica_MarketingSoftware
23
+ * @copyright Copyright (c) 2011-2012 Copernica & Cream. (http://docs.cream.nl/)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
  /**
27
  * Upgrader from version 1.1.7 to 1.1.8
28
  * Copernica Marketing Software v 1.1.8
app/code/community/Copernica/MarketingSoftware/sql/marketingsoftware_setup/mysql4-upgrade-2.0.1-2.0.2.php ADDED
@@ -0,0 +1,42 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Copernica Marketing Software
4
+ *
5
+ * NOTICE OF LICENSE
6
+ *
7
+ * This source file is subject to the Open Software License (OSL 3.0)
8
+ * that is bundled with this package in the file LICENSE.txt.
9
+ * It is also available through the world-wide-web at this URL:
10
+ * http://opensource.org/licenses/osl-3.0.php
11
+ * If you did not receive a copy of the license and are unable to
12
+ * obtain it through the world-wide-web, please send an email
13
+ * to copernica@support.cream.nl so we can send you a copy immediately.
14
+ *
15
+ * DISCLAIMER
16
+ *
17
+ * Do not edit or add to this file if you wish to upgrade Copernica Marketing Software to newer
18
+ * versions in the future. If you wish to customize this module for your
19
+ * needs please refer to http://www.copernica.com/ for more information.
20
+ *
21
+ * @category Copernica
22
+ * @package Copernica_MarketingSoftware
23
+ * @copyright Copyright (c) 2011-2012 Copernica & Cream. (http://docs.cream.nl/)
24
+ * @license http://opensource.org/licenses/osl-3.0.php Open Software License (OSL 3.0)
25
+ */
26
+
27
+ $installer = $this;
28
+ $installer->startSetup();
29
+
30
+ try {
31
+ $installer->run("
32
+ DROP TABLE IF EXISTS {$this->getTable('marketingsoftware/config_data')};
33
+ CREATE TABLE `{$this->getTable('marketingsoftware/config_data')}` (
34
+ `config_id` int(11) NOT NULL auto_increment,
35
+ `key_name` varchar( 128 ) NOT NULL,
36
+ `value` TEXT NOT NULL,
37
+ PRIMARY KEY (`config_id`),
38
+ UNIQUE config_data_key_name (`key_name`)
39
+ ) ENGINE = InnoDB DEFAULT CHARSET = utf8;");
40
+ } catch(Exception $e) {}
41
+
42
+ $installer->endSetup();
package.xml CHANGED
@@ -1,22 +1,26 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Copernica_MarketingSoftware</name>
4
- <version>2.0.1</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL 3.0)</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Plugin to exchange data from Magento with Copernica Marketing Software.</summary>
10
- <description>When you install the integration, all contact, order and shop cart data from Magento will be automatically synchronized and stored in Copernica. By synchronizing data between your Magento webshop and Copernica, you are able to set up targeted email campaigns. For example you can consider emailing customers with abandoned shopcarts automatically every week. Your contacts will only receive information relevant to them, which will make them come back to your shop time and again. The available integration is also compatible with the Magento Enterprise edition.</description>
 
 
11
  <notes>Improvements:&#xD;
12
- - Added the attribute set name to sync.&#xD;
13
- - Added field validation linking fields to Copernica.&#xD;
14
- - Changed download link to Magento Connect.&#xD;
15
- - Only sync guest orders by initial sync, other orders are synced via the customer. </notes>
 
 
16
  <authors><author><name>Cream</name><user>creaminternet</user><email>info@cream.nl</email></author></authors>
17
- <date>2012-09-11</date>
18
- <time>21:56:07</time>
19
- <contents><target name="magecommunity"><dir name="Copernica"><dir name="MarketingSoftware"><dir name="Block"><dir name="Adminhtml"><dir name="Marketingsoftware"><file name="Export.php" hash="a0c98a7b89f2757a7b27c599d8a2f8f8"/><file name="Link.php" hash="15e331131759fedf98c2e461ee97385f"/><file name="Settings.php" hash="f880b7232fdf18d1605885242e9632e8"/></dir></dir></dir><dir name="Helper"><file name="Api.php" hash="e69c0b82075c4204ea80a275675a4f56"/><file name="Config.php" hash="189b1d3b95c8ecaa01f0ce10a12c7cce"/><file name="Data.php" hash="48343bcddb1798c62533f3dd8b64d8a2"/></dir><dir name="Model"><dir name="Abstraction"><file name="Address.php" hash="75eacde3e77b6b76c85d32ba865a9192"/><file name="Attributes.php" hash="0e5699302fc6575733824acbfee0b445"/><file name="Customer.php" hash="a64f4ece16196385f1972643ba99f712"/><file name="Name.php" hash="519508275dcac2990532828bd8dbf0ee"/><dir name="Order"><dir name="Item"><file name="Options.php" hash="1c9d5d7c23a5a9f12ff3d777a01fa7d5"/></dir><file name="Item.php" hash="a119a36c52123a78f330ea532d7798d1"/></dir><file name="Order.php" hash="babfe3d247989ac179a83442b4af4100"/><file name="Price.php" hash="bf133886520769200060cf360e0941d6"/><file name="Product.php" hash="fd7601e3cec64b9b0475a875f2881239"/><dir name="Quote"><dir name="Item"><file name="Options.php" hash="7b7f3e826527fa29ceef8df0ad61c3d3"/></dir><file name="Item.php" hash="a8705d21b21229b521ecdd66f24b9570"/></dir><file name="Quote.php" hash="8e227f1bdcb0608ae5f86f0d6907a8ca"/><file name="Storeview.php" hash="b4bb284d5486ca14a877a3518dc68074"/><file name="Subscription.php" hash="f4a0bd6bb094b71d6b12b3404f22ea8f"/><file name="readme.txt" hash="d450b7fa3d88b6a5c2b5efa526d17077"/></dir><file name="AsyncPomSoapClient.php" hash="77cc23e1a61cfcc1ee36a33d6e7d6d3e"/><dir name="Copernica"><file name="Abstract.php" hash="b2d065859580ca9c55ac7e8c392db61e"/><dir name="Address"><file name="Subprofile.php" hash="b963f768c25d4790c47deb013de2c44a"/></dir><dir name="Cartitem"><file name="Subprofile.php" hash="6f3907f41c6e86158eb4495f61065f5e"/></dir><dir name="Order"><file name="Subprofile.php" hash="16b086ee846c9252fc27050684c5c336"/></dir><dir name="Orderitem"><file name="Subprofile.php" hash="88bcf93c7c0ed2e37f97a42dfe0a643e"/></dir><file name="Profile.php" hash="52f14d70ceaac0066ca35bc3791c906c"/><file name="Profilecustomer.php" hash="74d50c861f23387092c71e364653504b"/><file name="Profileorder.php" hash="64883534c013d7e9fc708e30870712df"/><file name="Profilequote.php" hash="95bbfb780af312389d0843d4623eb105"/><file name="Profilesubscription.php" hash="aecff6c7790a70dc63df54d42749eda8"/></dir><file name="Error.php" hash="0660881720c0210c65e25cb14b1011fe"/><file name="Marketingsoftware.php" hash="bd7290f645a46b98da8bf15072bffef5"/><dir name="Mysql4"><dir name="Queue"><file name="Collection.php" hash="64b29b94d61a809a14ff0036888f3596"/></dir><file name="Queue.php" hash="db3f8b50caf3697a61bc1f587259e1ef"/></dir><file name="Observer.php" hash="0dd703b10d7febc5aecce7af7bd51b6d"/><file name="PomSoapClient.php" hash="2dc657ed44acd003df8aef41986aeb88"/><file name="Queue.php" hash="5cad0c42996f2673924e33b5f047fe46"/><dir name="QueueEvent"><file name="Abstract.php" hash="897bb46d1437599b832f9d304eda6832"/><file name="CustomerAdd.php" hash="daef30d8daeb0819d605323f02cad779"/><file name="CustomerFull.php" hash="f66aaa9afa75c6658958b9ecf7b55cd7"/><file name="CustomerModify.php" hash="a9bd99258679e6ccfdc6011139e90fcc"/><file name="CustomerRemove.php" hash="a061c5646f9c776a38063325f0a39e1b"/><file name="OrderAdd.php" hash="d0b1edb9ed91def6840f29a5b2777901"/><file name="OrderModify.php" hash="a1cb1cdffbf8b8c1a5b4ddbbc5ae0a0b"/><file name="QuoteItem.php" hash="a064df99bbf8d8d3002b03335f5e844b"/><file name="QuoteItemAdd.php" hash="499c4c4d5e34d124918c12bffb72e28b"/><file name="QuoteItemModify.php" hash="f60c728a3b5d3c11451fd6332ecea912"/><file name="QuoteItemRemove.php" hash="a7e4fb9e227ddb538420d0c2b485bb36"/><file name="QuoteModify.php" hash="66bd14c78630895f14c4b48532b2d3a9"/><file name="StartSync.php" hash="b9835655e8dd783079ea21672f00091f"/><file name="SubscriptionAdd.php" hash="445455dd4fda2867b1ce9d67d7133aaa"/><file name="SubscriptionModify.php" hash="be0e469349469545ef9762b2a463a555"/><file name="SubscriptionRemove.php" hash="f3051c5f35e8a6c4bd727d895cad479f"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><dir name="Marketingsoftware"><file name="ExportController.php" hash="f22c80e7650e3a2d47f43d9ffab783e9"/><file name="LinkController.php" hash="7919feb55a96745df1b50faff83fc7d1"/><file name="SettingsController.php" hash="b62fa5f9c2d37152449530fb6a9a5988"/></dir></dir><file name="ProductController.php" hash="dff5479428f4d817c04ff12190a5878c"/><file name="UnsubscribeController.php" hash="691be73c944b1e4fb641803a4271c7a2"/></dir><dir name="etc"><file name="adminhtml.xml" hash="70433e755407e049a938075763e01e6d"/><file name="config.xml" hash="fee08503afdfe465e459219a70d93df5"/></dir><dir name="sql"><dir name="marketingsoftware_setup"><file name="mysql4-install-1.2.0.php" hash="624d62aad61c642dba4a9488a0b9508f"/><file name="mysql4-upgrade-1.1.5-1.1.6.php" hash="135144b872076048040f4bdae123a08f"/><file name="mysql4-upgrade-1.1.6-1.1.7.php" hash="e587cbbd9c0ddb77248abafef55df46e"/><file name="mysql4-upgrade-1.1.7-1.1.8.php" hash="e255e732e015f852796bde55bde07dd9"/><file name="mysql4-upgrade-1.1.8-1.2.0.php" hash="54fd03029d3a39b556d62ed95ed423f3"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Copernica_MarketingSoftware.xml" hash="04c9e69139dbff42d829bad22fa2ab85"/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="marketingsoftware"><file name="export.phtml" hash="4a3783aac318f5683060bc9119893989"/><file name="link.phtml" hash="390b6e5a5e0b2ac35b886eaa9f4e437e"/><file name="settings.phtml" hash="7497c7d74e93797f455d5b47a846bf82"/></dir></dir></dir></dir></dir></target><target name="mageweb"><dir name="js"><dir name="copernica"><dir name="marketingsoftware"><file name="collection.js" hash="260f06a4e891df402e145bec4d15bc51"/><file name="database.js" hash="4e51925d1fedd36a203c625050fb9b07"/><file name="field.js" hash="c4f98de6a9c210c626db36730485b853"/></dir></dir></dir></target></contents>
20
  <compatible/>
21
- <dependencies><required><php><min>5.2.0</min><max>6.0.0</max></php><extension><name>soap</name><min></min><max></max></extension></required></dependencies>
22
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Copernica_MarketingSoftware</name>
4
+ <version>2.1.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">Open Software License (OSL 3.0)</license>
7
  <channel>community</channel>
8
  <extends/>
9
  <summary>Plugin to exchange data from Magento with Copernica Marketing Software.</summary>
10
+ <description>When you install the integration, all contact, order and shop cart data from Magento will be automatically synchronized and stored in Copernica. By synchronizing data between your Magento webshop and Copernica, you are able to set up targeted email campaigns. For example you can consider emailing customers with abandoned shopcarts automatically every week. Your contacts will only receive information relevant to them, which will make them come back to your shop time and again. The available integration is also compatible with the Magento Enterprise edition.&#xD;
11
+ &#xD;
12
+ Please note that this extension does not work with PHP 5.4.X. and should be run with the Magento system requirements in mind.</description>
13
  <notes>Improvements:&#xD;
14
+ - The Connector does no longer save config values in the Magento Config. Since config values are saved everytime the cronjob started, it also changed the cached config. This is a performance improvement for Magento. &#xD;
15
+ - Added the special price in the product XML.&#xD;
16
+ - The product XML will return the product information from the specified storeview.&#xD;
17
+ - When a customer changes his/her e-mail address it will change the profile in Copernica and not create a new one. &#xD;
18
+ - When createing a database the storeview field in Copernica is automatically set to 100 characters&#xD;
19
+ - Added a header for SOAP requests.</notes>
20
  <authors><author><name>Cream</name><user>creaminternet</user><email>info@cream.nl</email></author></authors>
21
+ <date>2013-02-08</date>
22
+ <time>10:38:08</time>
23
+ <contents><target name="magecommunity"><dir name="Copernica"><dir name="MarketingSoftware"><dir name="Block"><dir name="Adminhtml"><dir name="Marketingsoftware"><file name="Export.php" hash="bdf5b3c9f54b61c297abacebb21bd9e4"/><file name="Link.php" hash="3d3116a9cc0e30bd7988bc01cd731dda"/><file name="Settings.php" hash="89e6626dce0b1cc218967a75a23b50c8"/></dir></dir></dir><dir name="Helper"><file name="Api.php" hash="c814c64cd137d64e6b7b25b403b2871e"/><file name="Config.php" hash="fa1284a6b72c63b295a1fb44e735cfea"/><file name="Data.php" hash="72d0a2c5e9549342e63507ec81365ff3"/></dir><dir name="Model"><dir name="Abstraction"><file name="Address.php" hash="0e6d94c15174bf177082f832bdd51f63"/><file name="Attributes.php" hash="196c089955b59b3eac85f127911d117a"/><file name="Customer.php" hash="d182b846cfc5975bf34e910c76af5fc6"/><file name="Name.php" hash="b291754d976ff55642bace1bf79780d8"/><dir name="Order"><dir name="Item"><file name="Options.php" hash="2cbba6a9575ba4cbcaef757e17c8040f"/></dir><file name="Item.php" hash="e6913df33122a058393836c8f89ded65"/></dir><file name="Order.php" hash="7f09861d1448fa7b43e0a207ed0c378f"/><file name="Price.php" hash="fcf88d59cb807d54a867894c63fb7464"/><file name="Product.php" hash="d8915988159bc62b187fe9cfbb276466"/><dir name="Quote"><dir name="Item"><file name="Options.php" hash="8e14fa0d99a871bac8f7486834c8f619"/></dir><file name="Item.php" hash="fde269ab77497786c6d9dcacb8a1df22"/></dir><file name="Quote.php" hash="cdc53d2a92394d80cc0f75c9ee15f687"/><file name="Storeview.php" hash="c2b18ed89b7d703435e49cbe78e9f7e1"/><file name="Subscription.php" hash="b6cd6526f2073019ab34f8cc4ec14abc"/><file name="readme.txt" hash="d450b7fa3d88b6a5c2b5efa526d17077"/></dir><file name="AsyncPomSoapClient.php" hash="6da9a420ed1c142e461f54a7ac0d375b"/><file name="Config.php" hash="88d2334013bb1c0f479fd615dbcb27e0"/><dir name="Copernica"><file name="Abstract.php" hash="59aaf8f767295d5c7e6424d6c9e19723"/><dir name="Address"><file name="Subprofile.php" hash="23367765c877ea7968c6b5d58cc21ea9"/></dir><dir name="Cartitem"><file name="Subprofile.php" hash="f1cbc895e80218538d9dd9aa3a610e3f"/></dir><dir name="Order"><file name="Subprofile.php" hash="ab7fff6418b7b0c75db39c2a88265c5f"/></dir><dir name="Orderitem"><file name="Subprofile.php" hash="6379471f6a420a0d1ea06724c4d860f9"/></dir><file name="Profile.php" hash="d50138b913e450037bdea557f3ce7124"/><file name="Profilecustomer.php" hash="bc693d552ebfd7f29c2a020e16cc03c6"/><file name="Profileorder.php" hash="0901259c1caba92417b7411a7fd6161f"/><file name="Profilequote.php" hash="68b3c54c13323fb8f4b4275a72e2ef01"/><file name="Profilesubscription.php" hash="5c03cb33b8793a2c38a0f9a5db589e32"/></dir><file name="Error.php" hash="f7b5a53518d72b081cb0ec50cde1056d"/><file name="Marketingsoftware.php" hash="b32e95ab2aaa34325d0f425100840830"/><dir name="Mysql4"><dir name="Config"><file name="Collection.php" hash="08cf25c2e554c123e97c1ad2f4622eb0"/></dir><file name="Config.php" hash="45beeedbd3f663c2a17157e1a096b131"/><dir name="Queue"><file name="Collection.php" hash="27f34b6af428741aca1040f96cdf7756"/></dir><file name="Queue.php" hash="6bc3ae61a6ba74a5ec926891bbc66099"/></dir><file name="Observer.php" hash="29c76f0eb8ce43eba393004e282f3eef"/><file name="PomSoapClient.php" hash="77c6e2490b381f207ad57c1d27de844a"/><file name="Queue.php" hash="6754f2df037380e6cded42e1642bb8de"/><dir name="QueueEvent"><file name="Abstract.php" hash="df759a3fdd38a31d7ac77c750b40e73f"/><file name="CustomerAdd.php" hash="fdebc7f4f368682af1e08b10421efbe7"/><file name="CustomerFull.php" hash="0f76283508b6f112fc1996d196525a33"/><file name="CustomerModify.php" hash="cc7764a5eb8d6674116cb466792aba5d"/><file name="CustomerRemove.php" hash="8127f5a21912c6b694d9ee1c679fe9f2"/><file name="Factory.php" hash="f8b00661dabb545f93e9e9d7823dbdb3"/><file name="OrderAdd.php" hash="504614d9808ea4473071324ae5221a72"/><file name="OrderModify.php" hash="f5bc8b25cf4bbc9d21d202657a119c01"/><file name="QuoteItem.php" hash="b2dec310c8964a7c1aecc5e81f01d0bd"/><file name="QuoteItemAdd.php" hash="ee09dfb74b1310a9df4f5e2c6d5b0104"/><file name="QuoteItemModify.php" hash="0df6ad182697b481196f9f0c46771f31"/><file name="QuoteItemRemove.php" hash="13096313ccbeff6d8ca1c098b8355cd4"/><file name="QuoteModify.php" hash="8e443feba3fa0693ea898fae36206920"/><file name="StartSync.php" hash="2692107edf6e9772bea60e36c50da7ac"/><file name="SubscriptionAdd.php" hash="e84030df0a7ba39d7ce967f96d0086b6"/><file name="SubscriptionModify.php" hash="acb0a3bcab9529386b2c45b2cd487ac4"/><file name="SubscriptionRemove.php" hash="7286d621debd6c1217e823e816fc0680"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><dir name="Marketingsoftware"><file name="ExportController.php" hash="292acb089445cff2c00b627942589059"/><file name="LinkController.php" hash="63423b5d92722367d846e3e6e3a92d71"/><file name="SettingsController.php" hash="c84d4f89b7557212ad9e283540db5157"/></dir></dir><file name="ProductController.php" hash="87e1046e82fae37daf7abecff6ec60c8"/><file name="UnsubscribeController.php" hash="c92556ae8dc002c132adff23e728c11a"/></dir><dir name="etc"><file name="adminhtml.xml" hash="d3d434a47e118dfdd69cd32b01b83f9f"/><file name="config.xml" hash="979683f4f5513dd0eb6aaf9511abfb1d"/></dir><dir name="sql"><dir name="marketingsoftware_setup"><file name="mysql4-install-1.2.0.php" hash="edaa8a4c29da5a0bb4f5c06e92c4a6e5"/><file name="mysql4-upgrade-1.1.5-1.1.6.php" hash="4902356c13309b6415e1a61c3fcc805c"/><file name="mysql4-upgrade-1.1.6-1.1.7.php" hash="1bfa357933494cbded4c32f4d1d0a45c"/><file name="mysql4-upgrade-1.1.7-1.1.8.php" hash="860e3ce11771bd8e6f7c755f2afa8805"/><file name="mysql4-upgrade-1.1.8-1.2.0.php" hash="42db3d71333deb7430cdbbafb56e80c1"/><file name="mysql4-upgrade-2.0.1-2.0.2.php" hash="5374760e8bee6edb033475cd0cf8fd0a"/></dir></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Copernica_MarketingSoftware.xml" hash="04c9e69139dbff42d829bad22fa2ab85"/></dir></target><target name="magedesign"><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="marketingsoftware"><file name="export.phtml" hash="4a3783aac318f5683060bc9119893989"/><file name="link.phtml" hash="390b6e5a5e0b2ac35b886eaa9f4e437e"/><file name="settings.phtml" hash="7497c7d74e93797f455d5b47a846bf82"/></dir></dir></dir></dir></dir></target><target name="mageweb"><dir name="js"><dir name="copernica"><dir name="marketingsoftware"><file name="collection.js" hash="260f06a4e891df402e145bec4d15bc51"/><file name="database.js" hash="4e51925d1fedd36a203c625050fb9b07"/><file name="field.js" hash="c4f98de6a9c210c626db36730485b853"/></dir></dir></dir></target></contents>
24
  <compatible/>
25
+ <dependencies><required><php><min>5.2.0</min><max>5.3.21</max></php><extension><name>soap</name><min></min><max></max></extension></required></dependencies>
26
  </package>