Bronto_Extension - Version 2.4.0

Version Notes

For installation and configuration instructions, as well as a full list of new features and known issues, please review the Implementation Guide.

Download this release

Release Info

Developer Chris Geiss
Extension Bronto_Extension
Version 2.4.0
Comparing to
See all releases


Code changes from version 2.3.0 to 2.4.0

Files changed (133) hide show
  1. app/code/community/Bronto/Common/Block/Adminhtml/System/Config/Form.php +40 -0
  2. app/code/community/Bronto/Common/Block/Adminhtml/System/Config/Form/Coupon.php +21 -0
  3. app/code/community/Bronto/Common/Helper/Api.php +11 -0
  4. app/code/community/Bronto/Common/Helper/Coupon.php +308 -0
  5. app/code/community/Bronto/Common/Helper/Data.php +7 -6
  6. app/code/community/Bronto/Common/Helper/Product.php +17 -0
  7. app/code/community/Bronto/Common/Helper/Support.php +15 -12
  8. app/code/community/Bronto/Common/Model/Coupon/Observer.php +55 -0
  9. app/code/community/Bronto/Common/Model/Email/Template.php +82 -18
  10. app/code/community/Bronto/Common/Model/Email/Template/Filter.php +81 -93
  11. app/code/community/Bronto/Common/Model/Keysentry.php +18 -0
  12. app/code/community/Bronto/Common/Model/List.php +9 -6
  13. app/code/community/Bronto/Common/Model/Observer.php +8 -7
  14. app/code/community/Bronto/Common/Model/Queue.php +20 -3
  15. app/code/community/Bronto/Common/Model/Resource/Abstract.php +2 -1
  16. app/code/community/Bronto/Common/Model/Resource/Setup.php +27 -0
  17. app/code/community/Bronto/Common/Model/System/Config/Backend/Cron.php +22 -5
  18. app/code/community/Bronto/Common/Model/System/Config/Backend/Token.php +1 -1
  19. app/code/community/Bronto/Common/Model/System/Config/Source/Coupon.php +17 -13
  20. app/code/community/Bronto/Common/Model/System/Config/Source/Limit.php +0 -3
  21. app/code/community/Bronto/Common/Model/System/Config/Source/List.php +17 -17
  22. app/code/community/Bronto/Common/Model/System/Config/Source/Message.php +33 -26
  23. app/code/community/Bronto/Common/Model/System/Config/Source/SendOptions.php +97 -0
  24. app/code/community/Bronto/Common/Model/System/Config/Source/Synclimit.php +1 -1
  25. app/code/community/Bronto/Common/controllers/CouponController.php +72 -0
  26. app/code/community/Bronto/Common/controllers/LogController.php +0 -115
  27. app/code/community/Bronto/Common/etc/config.xml +38 -4
  28. app/code/community/Bronto/Common/etc/system.xml +199 -20
  29. app/code/community/Bronto/Common/sql/bronto_common_setup/mysql4-install-2.3.1.php +13 -0
  30. app/code/community/Bronto/Common/sql/bronto_common_setup/mysql4-upgrade-2.2.2-2.3.0.php +1 -0
  31. app/code/community/Bronto/Common/sql/bronto_common_setup/mysql4-upgrade-2.3.0-2.4.0.php +7 -0
  32. app/code/community/Bronto/Customer/Block/Adminhtml/System/Config/Form/Fieldset/Attributes.php +1 -1
  33. app/code/community/Bronto/Customer/Helper/Data.php +83 -9
  34. app/code/community/Bronto/Customer/Model/Observer.php +179 -57
  35. app/code/community/Bronto/Customer/Model/System/Config/Backend/Brontofield.php +1 -0
  36. app/code/community/Bronto/Customer/controllers/Adminhtml/CustomerController.php +6 -1
  37. app/code/community/Bronto/Customer/etc/system.xml +311 -4
  38. app/code/community/Bronto/Email/Block/Adminhtml/System/Email/Import/Grid.php +1 -1
  39. app/code/community/Bronto/Email/Block/Adminhtml/System/Email/Template/Edit/Form.php +27 -14
  40. app/code/community/Bronto/Email/Block/Adminhtml/System/Email/Template/Grid.php +1 -1
  41. app/code/community/Bronto/Email/Helper/Data.php +16 -3
  42. app/code/community/Bronto/Email/Model/Mysql4/Template/Collection.php +1 -1
  43. app/code/community/Bronto/Email/Model/Resource/Setup.php +9 -2
  44. app/code/community/Bronto/Email/Model/System/Config/Source/Email/Template.php +1 -1
  45. app/code/community/Bronto/Email/controllers/Adminhtml/System/Email/TemplateController.php +5 -0
  46. app/code/community/Bronto/Email/etc/config.xml +1 -1
  47. app/code/community/Bronto/Email/etc/system.xml +25 -0
  48. app/code/community/Bronto/Email/sql/bronto_email_setup/mysql4-install-1.2.1.php +13 -0
  49. app/code/community/Bronto/Email/sql/bronto_email_setup/mysql4-upgrade-1.2.0-1.2.1.php +13 -0
  50. app/code/community/Bronto/Emailcapture/Block/Emailcapture.php +2 -2
  51. app/code/community/Bronto/Newsletter/Model/Observer.php +3 -1
  52. app/code/community/Bronto/Newsletter/controllers/Adminhtml/NewsletterController.php +6 -1
  53. app/code/community/Bronto/Newsletter/etc/system.xml +2 -2
  54. app/code/community/Bronto/Order/Block/Adminhtml/Widget/Button/Mark.php +1 -1
  55. app/code/community/Bronto/Order/Helper/Data.php +30 -0
  56. app/code/community/Bronto/Order/Model/Observer.php +232 -160
  57. app/code/community/Bronto/Order/Model/Queue.php +4 -5
  58. app/code/community/Bronto/Order/Model/System/Config/Source/Order/State.php +36 -0
  59. app/code/community/Bronto/Order/controllers/Adminhtml/OrderController.php +9 -6
  60. app/code/community/Bronto/Order/etc/config.xml +2 -8
  61. app/code/community/Bronto/Order/etc/system.xml +28 -0
  62. app/code/community/Bronto/Product/Block/Adminhtml/System/Recommendation/Edit/Form.php +26 -2
  63. app/code/community/Bronto/Product/Block/Adminhtml/System/Recommendation/Grid.php +1 -1
  64. app/code/community/Bronto/Product/Block/Adminhtml/System/Recommendation/Preview/Grid.php +2 -2
  65. app/code/community/Bronto/Product/Helper/Data.php +37 -21
  66. app/code/community/Bronto/Product/Model/Collect.php +39 -13
  67. app/code/community/Bronto/Product/Model/Collect/Abstract.php +31 -13
  68. app/code/community/Bronto/Product/Model/Collect/Bestseller.php +4 -1
  69. app/code/community/Bronto/Product/Model/Collect/Custom.php +4 -1
  70. app/code/community/Bronto/Product/Model/Collect/Mostviewed.php +1 -1
  71. app/code/community/Bronto/Product/Model/Collect/Upsell.php +1 -1
  72. app/code/community/Bronto/Product/Model/Recommendation.php +31 -1
  73. app/code/community/Bronto/Product/Model/Resource/Setup.php +15 -2
  74. app/code/community/Bronto/Product/controllers/Adminhtml/RecommendationsController.php +8 -17
  75. app/code/community/Bronto/Product/etc/config.xml +1 -1
  76. app/code/community/Bronto/Product/etc/system.xml +6 -2
  77. app/code/community/Bronto/Product/sql/bronto_product_setup/mysql4-install-1.0.1.php +14 -0
  78. app/code/community/Bronto/Product/sql/bronto_product_setup/mysql4-upgrade-1.0.0-1.0.1.php +13 -0
  79. app/code/community/Bronto/Reminder/Block/Adminhtml/Reminder/Edit/Tab/Bronto.php +14 -2
  80. app/code/community/Bronto/Reminder/Helper/Data.php +1 -1
  81. app/code/community/Bronto/Reminder/Model/Mysql4/Rule.php +5 -2
  82. app/code/community/Bronto/Reminder/Model/Resource/Setup.php +7 -0
  83. app/code/community/Bronto/Reminder/Model/Rule.php +4 -3
  84. app/code/community/Bronto/Reminder/controllers/LoadController.php +12 -4
  85. app/code/community/Bronto/Reminder/etc/config.xml +1 -1
  86. app/code/community/Bronto/Reminder/sql/bronto_reminder_setup/mysql4-install-1.4.18.php +13 -0
  87. app/code/community/Bronto/Reminder/sql/bronto_reminder_setup/mysql4-upgrade-1.4.17-1.4.18.php +13 -0
  88. app/code/community/Bronto/Reviews/Block/Adminhtml/Catalog/Product/Edit/Tab/Abstract.php +74 -0
  89. app/code/community/Bronto/Reviews/Block/Adminhtml/Catalog/Product/Edit/Tab/Caretip.php +15 -0
  90. app/code/community/Bronto/Reviews/Block/Adminhtml/Catalog/Product/Edit/Tab/Reorder.php +13 -0
  91. app/code/community/Bronto/Reviews/Block/Adminhtml/Reviews/Delivery.php +77 -0
  92. app/code/community/Bronto/Reviews/Block/Adminhtml/Reviews/Form/Abstract.php +256 -0
  93. app/code/community/Bronto/Reviews/Block/Adminhtml/Reviews/Form/Caretip.php +55 -0
  94. app/code/community/Bronto/Reviews/Block/Adminhtml/Reviews/Form/Reorder.php +46 -0
  95. app/code/community/Bronto/Reviews/Block/Adminhtml/Reviews/Grid.php +178 -0
  96. app/code/community/Bronto/Reviews/Block/Adminhtml/Reviews/Grid/Renderer/Action.php +29 -0
  97. app/code/community/Bronto/Reviews/Block/Adminhtml/Reviews/Grid/Renderer/Order.php +18 -0
  98. app/code/community/Bronto/Reviews/Block/Adminhtml/Reviews/Grid/Renderer/Product.php +19 -0
  99. app/code/community/Bronto/Reviews/Block/Adminhtml/Reviews/Typer.php +11 -0
  100. app/code/community/Bronto/Reviews/Block/Adminhtml/Sales/Order/View/Tab/Post/Purchase.php +105 -0
  101. app/code/community/Bronto/Reviews/Helper/Data.php +339 -2
  102. app/code/community/Bronto/Reviews/Model/Log.php +139 -0
  103. app/code/community/Bronto/Reviews/Model/Message.php +102 -31
  104. app/code/community/Bronto/Reviews/Model/Mysql4/Log.php +86 -0
  105. app/code/community/Bronto/Reviews/Model/Mysql4/Log/Collection.php +97 -0
  106. app/code/community/Bronto/Reviews/Model/Mysql4/Post/Purchase.php +36 -0
  107. app/code/community/Bronto/Reviews/Model/Mysql4/Post/Purchase/Collection.php +67 -0
  108. app/code/community/Bronto/Reviews/Model/Mysql4/Queue.php +38 -9
  109. app/code/community/Bronto/Reviews/Model/Mysql4/Queue/Collection.php +15 -1
  110. app/code/community/Bronto/Reviews/Model/Observer.php +369 -183
  111. app/code/community/Bronto/Reviews/Model/Post/Purchase.php +53 -0
  112. app/code/community/Bronto/Reviews/Model/Process/Context.php +70 -0
  113. app/code/community/Bronto/Reviews/Model/Queue.php +28 -7
  114. app/code/community/Bronto/Reviews/Model/Resource/Setup.php +95 -0
  115. app/code/community/Bronto/Reviews/Model/System/Config/Source/Hours.php +38 -0
  116. app/code/community/Bronto/Reviews/Model/System/Config/Source/Identity.php +25 -0
  117. app/code/community/Bronto/Reviews/Model/System/Config/Source/Orderstatus.php +6 -16
  118. app/code/community/Bronto/Reviews/controllers/Adminhtml/PostpurchaseController.php +158 -0
  119. app/code/community/Bronto/Reviews/etc/adminhtml.xml +19 -1
  120. app/code/community/Bronto/Reviews/etc/config.xml +94 -4
  121. app/code/community/Bronto/Reviews/etc/system.xml +500 -13
  122. app/code/community/Bronto/Reviews/sql/bronto_reviews_setup/mysql4-install-0.0.1.php +1 -1
  123. app/code/community/Bronto/Reviews/sql/bronto_reviews_setup/mysql4-install-0.0.2.php +13 -0
  124. app/code/community/Bronto/Reviews/sql/bronto_reviews_setup/mysql4-upgrade-0.0.1-0.0.2.php +15 -0
  125. app/code/community/Bronto/Verify/Block/Adminhtml/System/Config/Installs.php +4 -0
  126. app/code/community/Bronto/Verify/etc/adminhtml.xml +1 -1
  127. app/design/adminhtml/default/default/layout/bronto/reviews.xml +23 -0
  128. app/design/adminhtml/default/default/template/bronto/coupon/guide.phtml +230 -4
  129. app/design/adminhtml/default/default/template/bronto/product/recommendation/selected.js.phtml +1 -1
  130. app/design/adminhtml/default/default/template/bronto/reviews/guide.phtml +252 -174
  131. package.xml +4 -4
  132. shell/bronto/fix.php +2 -0
  133. shell/bronto/review_migrate.php +118 -0
app/code/community/Bronto/Common/Block/Adminhtml/System/Config/Form.php ADDED
@@ -0,0 +1,40 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Bronto_Common_Block_Adminhtml_System_Config_Form extends Mage_Adminhtml_Block_System_Config_Form
4
+ {
5
+ /**
6
+ * @see parent
7
+ */
8
+ public function setParentBlock(Mage_Core_Block_Abstract $block)
9
+ {
10
+ $block
11
+ ->getChild('save_button')
12
+ ->setOnClick("confirmAndSubmit();");
13
+ return parent::setParentBlock($block);
14
+ }
15
+
16
+ /**
17
+ * @see parent
18
+ */
19
+ public function _afterToHtml($html)
20
+ {
21
+ $html .= '
22
+ <script type="text/javascript">
23
+ function confirmAndSubmit() {
24
+ var canSubmit = true;
25
+ $$("#bronto_support_terms").each(function(elem) {
26
+ if (elem.value === "0") {
27
+ canSubmit = confirm("You must agree to Bronto\'s Terms of Service in the Registration section. You agree to the Terms by pressing \"OK\".");
28
+ if (canSubmit) {
29
+ elem.value = "1";
30
+ }
31
+ }
32
+ });
33
+ if (canSubmit) {
34
+ configForm.submit();
35
+ }
36
+ }
37
+ </script>';
38
+ return parent::_afterToHtml($html);
39
+ }
40
+ }
app/code/community/Bronto/Common/Block/Adminhtml/System/Config/Form/Coupon.php ADDED
@@ -0,0 +1,21 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Bronto_Common_Block_Adminhtml_System_Config_Form_Coupon extends Mage_Adminhtml_Block_System_Config_Form_Fieldset
4
+ {
5
+ /**
6
+ * @see parent
7
+ */
8
+ public function render(Varien_Data_Form_Element_Abstract $element)
9
+ {
10
+ $exampleCode = 'ABC123';
11
+ $store = Mage::app()->getStore();
12
+ $helper = Mage::helper('bronto_common/coupon');
13
+ $comment = $element->getComment();
14
+ $comment = str_replace('{baseUrl}', $store->getUrl('/'), $comment);
15
+ $comment = str_replace('{code}', $helper->getCouponParam(), $comment);
16
+ $comment = str_replace('{example}', $exampleCode, $comment);
17
+ $comment = str_replace('{error}', $helper->getErrorCodeParam(), $comment);
18
+ $element->setComment($comment);
19
+ return parent::render($element);
20
+ }
21
+ }
app/code/community/Bronto/Common/Helper/Api.php CHANGED
@@ -62,6 +62,17 @@ class Bronto_Common_Helper_Api extends Bronto_Common_Helper_Data
62
  return (bool) $this->getAdminScopedConfig(self::XML_PATH_ENABLED);
63
  }
64
 
 
 
 
 
 
 
 
 
 
 
 
65
  /**
66
  * Checked if the send queue is enabled
67
  *
62
  return (bool) $this->getAdminScopedConfig(self::XML_PATH_ENABLED);
63
  }
64
 
65
+ /**
66
+ * @see parent
67
+ */
68
+ public function disableModule($scope = 'default', $scopeId = 0, $deleteConfig = false)
69
+ {
70
+ return (
71
+ $this->_disableModule(self::XML_PATH_ENABLED, $scope, $scopeId, $deleteConfig) &&
72
+ $this->_disableModule(self::XML_PATH_QUEUE_ENABLED, $scope, $scopeId, $deleteConfig)
73
+ );
74
+ }
75
+
76
  /**
77
  * Checked if the send queue is enabled
78
  *
app/code/community/Bronto/Common/Helper/Coupon.php ADDED
@@ -0,0 +1,308 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Bronto_Common_Helper_Coupon extends Bronto_Common_Helper_Data
4
+ {
5
+
6
+ const XML_PATH_ENABLED = 'bronto_coupon/apply_coupon/enabled';
7
+ const XML_PATH_SUCCESS_MESSAGE = 'bronto_coupon/apply_coupon/success_message';
8
+ const XML_PATH_COUPON_PARAM = 'bronto_coupon/apply_coupon/coupon_code_param';
9
+ const XML_PATH_ERROR_PARAM = 'bronto_coupon/apply_coupon/error_message_param';
10
+ const XML_PATH_LINK_MESSAGE = 'bronto_coupon/apply_coupon/link';
11
+ const XML_PATH_USES_OBSERVER = 'bronto_coupon/apply_coupon/use_observer';
12
+
13
+ const INVALID_CODE = 'invalid';
14
+ const DEPLETED_CODE = 'depleted';
15
+ const EXPIRED_CODE = 'expired';
16
+ const CONFLICT_CODE = 'conflict';
17
+ const FORCE_PARAM = '___force_code';
18
+
19
+ protected $_validCodes = array(
20
+ self::INVALID_CODE => 'translateCode',
21
+ self::EXPIRED_CODE => 'translateCode',
22
+ self::DEPLETED_CODE => 'translateCode',
23
+ self::CONFLICT_CODE => 'translateConflict'
24
+ );
25
+
26
+ /**
27
+ * Gets the display name for the coupon module
28
+ *
29
+ * @return string
30
+ */
31
+ public function getName()
32
+ {
33
+ return $this->__('Bronto Coupon Management');
34
+ }
35
+
36
+ /**
37
+ * Is this module enabled
38
+ *
39
+ * @param string $scope
40
+ * @param int $scopeId
41
+ * @return boolean
42
+ */
43
+ public function isEnabled($scope = 'default', $scopeId = 0)
44
+ {
45
+ return (bool)$this->getAdminScopedConfig(self::XML_PATH_ENABLED, $scope, $scopeId);
46
+ }
47
+
48
+ /**
49
+ * Disable Module for Specified Scope
50
+ *
51
+ * @param string $scope
52
+ * @param int $scopeId
53
+ * @param bool $deleteConfig
54
+ *
55
+ * @return bool
56
+ */
57
+ public function disableModule($scope = 'default', $scopeId = 0, $deleteConfig = false)
58
+ {
59
+ return $this->_disableModule(self::XML_PATH_ENABLED, $scope, $scopeId, $deleteConfig);
60
+ }
61
+
62
+ /**
63
+ * Determines if the supplied code is a valid one
64
+ *
65
+ * @param string $code
66
+ * @return boolean
67
+ */
68
+ public function isValidErrorCode($code)
69
+ {
70
+ return array_key_exists($code, $this->_validCodes);
71
+ }
72
+
73
+ /**
74
+ * Gets the coupon code param used to parse out of the URL
75
+ *
76
+ * @param string $scope
77
+ * @param int $scopeId
78
+ * @return string
79
+ */
80
+ public function getCouponParam($scope = 'default', $scopeId = 0)
81
+ {
82
+ return $this->getAdminScopedConfig(self::XML_PATH_COUPON_PARAM, $scope, $scopeId);
83
+ }
84
+
85
+ /**
86
+ * Gets the error code param used to parse out of the URL
87
+ *
88
+ * @param string $scope
89
+ * @param int $scopeId
90
+ * @return string
91
+ */
92
+ public function getErrorCodeParam($scope = 'default', $scopeId = 0)
93
+ {
94
+ return $this->getAdminScopedConfig(self::XML_PATH_ERROR_PARAM, $scope, $scopeId);
95
+ }
96
+
97
+ /**
98
+ * Gets both params used in the settings
99
+ *
100
+ * @param string $scope
101
+ * @param int $scopeId
102
+ * @return array
103
+ */
104
+ public function getParams($scope = 'default', $scopeId = 0)
105
+ {
106
+ return array(
107
+ $this->getCouponParam($scope, $scopeId),
108
+ $this->getErrorCodeParam($scope, $scopeId)
109
+ );
110
+ }
111
+
112
+ /**
113
+ * Gets the error code message from the configuration scope
114
+ *
115
+ * @param string $errorCode
116
+ * @param string $couponCode
117
+ * @param string $scope
118
+ * @param int $scopeId
119
+ * @return string
120
+ */
121
+ public function getErrorMessage($errorCode, $couponCode, $scope = 'default', $scopeId = 0)
122
+ {
123
+ $baseMessage = $this->getAdminScopedConfig('bronto_coupon/apply_coupon/' . $errorCode, $scope, $scopeId);
124
+ $translateCallback = $this->_validCodes[$errorCode];
125
+ return $this->$translateCallback($baseMessage, empty($couponCode) ? 'code' : $couponCode);
126
+ }
127
+
128
+ /**
129
+ * Gets the the success message
130
+ *
131
+ * @param string $couponCode
132
+ * @param string $scope
133
+ * @param int $scopeId
134
+ * @return string
135
+ */
136
+ public function getSuccessMessage($couponCode, $scope = 'default', $scopeId = 0)
137
+ {
138
+ return $this->translateCode($this->getAdminScopedConfig(self::XML_PATH_SUCCESS_MESSAGE, $scope, $scopeId), $couponCode);
139
+ }
140
+
141
+ /**
142
+ * Gets the link message content
143
+ *
144
+ * @param string $scope
145
+ * @param int $scopeId
146
+ * @return string
147
+ */
148
+ public function getLinkContent($scope = 'default', $scopeId = 0)
149
+ {
150
+ return $this->getAdminScopedConfig(self::XML_PATH_LINK_MESSAGE, $scope, $scopeId);
151
+ }
152
+
153
+ /**
154
+ * Uses a controller observer
155
+ *
156
+ * @param string $scope
157
+ * @param int $scopeId
158
+ * @return boolean
159
+ */
160
+ public function isObservingController($scope = 'default', $scopeId = 0)
161
+ {
162
+ return (bool)$this->getAdminScopedConfig(self::XML_PATH_USES_OBSERVER, $scope, $scopeId);
163
+ }
164
+
165
+ /**
166
+ * Translate a message using the coupon code
167
+ *
168
+ * @param string $message
169
+ * @param string $couponCode
170
+ * @param string $key
171
+ * @return string
172
+ */
173
+ public function translateCode($message, $couponCode, $key = 'code')
174
+ {
175
+ return str_replace('{' . $key . '}', $couponCode, $message);
176
+ }
177
+
178
+ /**
179
+ * Translate the conflict message
180
+ *
181
+ * @param string $message
182
+ * @param string $couponCode
183
+ * @return string
184
+ */
185
+ public function translateConflict($message, $couponCode)
186
+ {
187
+ $couponParam = $this->getCouponParam();
188
+ $forceUrl = Mage::app()->getStore()->getUrl('*/*/*', array(
189
+ $couponParam => $couponCode,
190
+ self::FORCE_PARAM => 1,
191
+ ));
192
+ $quote = Mage::getSingleton('checkout/cart')->getQuote();
193
+ $linkContent = $this->getLinkContent();
194
+ $replacements = array(
195
+ 'link' => '<a href="' . $forceUrl . '">' . $linkContent . '</a>',
196
+ 'oldCode' => $quote->getCouponCode(),
197
+ 'newCode' => $couponCode,
198
+ );
199
+ foreach ($replacements as $key => $value) {
200
+ $message = str_replace('{' . $key . '}', $value, $message);
201
+ }
202
+ return $message;
203
+ }
204
+
205
+ /**
206
+ * Sets the coupon code either in the session or on the quote
207
+ *
208
+ * @param string $couponCode
209
+ */
210
+ public function applyCode($couponCode = null)
211
+ {
212
+ $session = Mage::getSingleton('core/session');
213
+ if (is_null($couponCode)) {
214
+ $couponCode = $session->getCouponCode();
215
+ } else {
216
+ $session->setCouponCode($couponCode);
217
+ }
218
+ $quote = Mage::getSingleton('checkout/cart')->getQuote();
219
+ if ($quote && $couponCode) {
220
+ $quote->setCouponCode($couponCode)->save();
221
+ $session->unsCouponCode($couponCode);
222
+ }
223
+ }
224
+
225
+ /**
226
+ * Validates the coupon code given certain high level constraints
227
+ *
228
+ * @param string $couponCode
229
+ * @param boolean $force
230
+ * @return Mage_Salesrule_Model_Coupon
231
+ */
232
+ protected function _validateCode($couponCode, $force = false)
233
+ {
234
+ $websiteId = Mage::app()->getWebsite()->getId();
235
+ $customerGroupId = Mage::getSingleton('customer/session')->getCustomerGroupId();
236
+ $rules = Mage::getModel('salesrule/rule')
237
+ ->getCollection()
238
+ ->setValidationFilter($websiteId, $customerGroupId, $couponCode)
239
+ ->addFieldToFilter('main_table.coupon_type', array('in' => array(Mage_SalesRule_Model_Rule::COUPON_TYPE_SPECIFIC, Mage_SalesRule_Model_Rule::COUPON_TYPE_AUTO)));
240
+ foreach ($rules as $rule) {
241
+ $coupon = Mage::getModel('salesrule/coupon')->loadByCode($couponCode);
242
+ if ($coupon->getUsageLimit() && $coupon->getTimesUsed() >= $coupon->getUsageLimit()) {
243
+ Mage::throwException('depleted');
244
+ }
245
+ $quote = Mage::getSingleton('checkout/cart')->getQuote();
246
+ if ($quote) {
247
+ if (!$force && $quote->getCouponCode() && $quote->getCouponCode() != $couponCode) {
248
+ Mage::throwException('conflict');
249
+ }
250
+ }
251
+ return $coupon;
252
+ }
253
+ Mage::throwException('invalid');
254
+ }
255
+
256
+ /**
257
+ * Takes in an HTTP request and applies the code
258
+ *
259
+ * @param Mage_Core_Controller_Request_Http $request
260
+ * @return boolean
261
+ */
262
+ public function applyCodeFromRequest($request)
263
+ {
264
+ list($couponParam, $errorParam) = $this->getParams();
265
+ $session = Mage::getSingleton('core/session');
266
+ $errorCode = $request->getParam($errorParam, null);
267
+ $couponCode = $request->getParam($couponParam, null);
268
+ if ($errorCode || $couponCode) {
269
+ if (!empty($couponCode)) {
270
+ $force = $request->has(self::FORCE_PARAM);
271
+ try {
272
+ $coupon = $this->_validateCode($couponCode, $force);
273
+ if (!$this->isCouponApplied($couponCode)) {
274
+ $this->applyCode($couponCode);
275
+ $session->addSuccess($this->getSuccessMessage($couponCode));
276
+ }
277
+ return true;
278
+ } catch (Exception $e) {
279
+ $errorCode = $e->getMessage();
280
+ }
281
+ }
282
+ if (!$this->isValidErrorCode($errorCode)) {
283
+ $errorCode = self::INVALID_CODE;
284
+ }
285
+ $session->addError($this->getErrorMessage($errorCode, $couponCode));
286
+ }
287
+ return false;
288
+ }
289
+
290
+ /**
291
+ * Has this coupon already been applied
292
+ *
293
+ * @param string $couponCode
294
+ * @return boolean
295
+ */
296
+ public function isCouponApplied($couponCode)
297
+ {
298
+ $session = Mage::getSingleton('core/session');
299
+ $quote = Mage::getSingleton('checkout/cart')->getQuote();
300
+ if ($session->getCouponCode() == $couponCode) {
301
+ return true;
302
+ }
303
+ if ($quote) {
304
+ return $quote->getCouponCode() && $quote->getCouponCode() == $couponCode;
305
+ }
306
+ return false;
307
+ }
308
+ }
app/code/community/Bronto/Common/Helper/Data.php CHANGED
@@ -7,6 +7,8 @@
7
  class Bronto_Common_Helper_Data
8
  extends Mage_Core_Helper_Abstract
9
  {
 
 
10
  /**
11
  * Common Settings
12
  */
@@ -315,7 +317,7 @@ class Bronto_Common_Helper_Data
315
  } else {
316
  $coreConfig->saveConfig($path, 0, $scope, $scopeId);
317
 
318
- if (!$this->isVersionMatch(Mage::getVersionInfo(), 1, array(4, 5, array('edition' => 'Enterprise', 'major' => 9), 10))) {
319
  list($module) = explode('/', $path);
320
 
321
  $coreConfigData->setScope($scope)
@@ -490,8 +492,7 @@ class Bronto_Common_Helper_Data
490
  $token = $this->getApiToken($scope, $scopeId);
491
  }
492
 
493
- // If token is not correct length, return false
494
- if (strlen($token) != 36) {
495
  return false;
496
  }
497
 
@@ -745,8 +746,8 @@ class Bronto_Common_Helper_Data
745
  if ($this->isNoticesEnabled()) {
746
  if (Mage::getSingleton('admin/session')->isLoggedIn()) {
747
  /* @var $message Mage_Core_Model_Message_Notice */
748
- $message = Mage::getSingleton('core/message')->notice("[Bronto] {$message}");
749
- Mage::getSingleton('adminhtml/session')->addMessage($message);
750
  } else {
751
  Mage::getSingleton('core/session')->addNotice("[Bronto] {$message}");
752
  }
@@ -1049,7 +1050,7 @@ class Bronto_Common_Helper_Data
1049
  $minor = $versionInfo['minor'];
1050
 
1051
  if (1 == $major) {
1052
- if ($minor < 9) {
1053
  return 'Community';
1054
  } else if ($minor >= 9 && $minor < 11) {
1055
  return 'Professional';
7
  class Bronto_Common_Helper_Data
8
  extends Mage_Core_Helper_Abstract
9
  {
10
+ const MAX_TOKEN_LENGTH = 36;
11
+
12
  /**
13
  * Common Settings
14
  */
317
  } else {
318
  $coreConfig->saveConfig($path, 0, $scope, $scopeId);
319
 
320
+ if (!$this->isVersionMatch(Mage::getVersionInfo(), 1, array(4, 5, array('edition' => 'Professional', 'major' => 9), 10))) {
321
  list($module) = explode('/', $path);
322
 
323
  $coreConfigData->setScope($scope)
492
  $token = $this->getApiToken($scope, $scopeId);
493
  }
494
 
495
+ if (strlen($token) < Bronto_Common_Helper_Data::MAX_TOKEN_LENGTH) {
 
496
  return false;
497
  }
498
 
746
  if ($this->isNoticesEnabled()) {
747
  if (Mage::getSingleton('admin/session')->isLoggedIn()) {
748
  /* @var $message Mage_Core_Model_Message_Notice */
749
+ $sessionMessage = Mage::getSingleton('core/message')->notice("[Bronto] {$message}");
750
+ Mage::getSingleton('adminhtml/session')->addMessage($sessionMessage);
751
  } else {
752
  Mage::getSingleton('core/session')->addNotice("[Bronto] {$message}");
753
  }
1050
  $minor = $versionInfo['minor'];
1051
 
1052
  if (1 == $major) {
1053
+ if ($minor < 9 || ($minor == 9 && method_exists('Mage', 'getEdition'))) {
1054
  return 'Community';
1055
  } else if ($minor >= 9 && $minor < 11) {
1056
  return 'Professional';
app/code/community/Bronto/Common/Helper/Product.php CHANGED
@@ -102,6 +102,23 @@ class Bronto_Common_Helper_Product extends Mage_Core_Helper_Abstract
102
  return $product;
103
  }
104
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
105
  /**
106
  * Get Attributes for Product
107
  *
102
  return $product;
103
  }
104
 
105
+ /**
106
+ * Gets the configurable product isf the product is a simple/configurable
107
+ *
108
+ * @param Mage_Catalog_Model_Product $product
109
+ * @return Mage_Catalog_Model_Product
110
+ */
111
+ public function getConfigurableProduct($product)
112
+ {
113
+ if ($product->getTypeId() == Mage_Catalog_Model_Product_Type::TYPE_SIMPLE) {
114
+ $parentIds = Mage::getModel('catalog/product_type_configurable')->getParentIdsByChild($product->getId());
115
+ if (isset($parentIds[0])) {
116
+ return $this->getProduct($parentIds[0], $product->getStoreId());
117
+ }
118
+ }
119
+ return $product;
120
+ }
121
+
122
  /**
123
  * Get Attributes for Product
124
  *
app/code/community/Bronto/Common/Helper/Support.php CHANGED
@@ -25,6 +25,7 @@ class Bronto_Common_Helper_Support extends Bronto_Common_Helper_Data
25
  'title',
26
  'using_solution_partner',
27
  'partner',
 
28
  'magento_version',
29
  'magento_edition',
30
  'extension_version',
@@ -184,7 +185,7 @@ class Bronto_Common_Helper_Support extends Bronto_Common_Helper_Data
184
  *
185
  * @return array
186
  */
187
- public function getDebugInformation()
188
  {
189
  $currentDate = Mage::getModel('core/date')->date('Y-m-d');
190
  $brontoModules = $this->getEnabledBrontoModules();
@@ -192,7 +193,7 @@ class Bronto_Common_Helper_Support extends Bronto_Common_Helper_Data
192
  $request = Mage::app()->getRequest();
193
 
194
  return array_merge(
195
- // Form submission
196
  $formData,
197
  // Current Websites / Stores; Enabled Bronto Modules
198
  array(
@@ -211,7 +212,7 @@ class Bronto_Common_Helper_Support extends Bronto_Common_Helper_Data
211
  ),
212
  array(
213
  'bronto_modules' => $brontoModules,
214
- 'bronto_config' => $this->getBrontoConfigs($brontoModules)
215
  )
216
  );
217
  }
@@ -233,14 +234,14 @@ class Bronto_Common_Helper_Support extends Bronto_Common_Helper_Data
233
  $formData['magento_edition'] = $this->getEdition();
234
 
235
  $yesNo = Mage::getModel('adminhtml/system_config_source_yesno');
236
- $selectedValue = $formData['using_solution_partner'];
237
- foreach ($yesNo->toOptionArray() as $option) {
238
- if ($option['value'] == $selectedValue) {
239
- $label = $option['label'];
240
- break;
 
241
  }
242
  }
243
- $formData['using_solution_partner'] = $label;
244
 
245
  return $this->_submitWebform(
246
  array_merge($this->getSupportInformation(), $formData)
@@ -277,10 +278,12 @@ class Bronto_Common_Helper_Support extends Bronto_Common_Helper_Data
277
  * Gets the Bronto configuration settings
278
  *
279
  * @param array $brontoModules
 
 
280
  *
281
  * @return array
282
  */
283
- public function getBrontoConfigs($brontoModules)
284
  {
285
  $configs = array();
286
  $processedConfigs = array();
@@ -300,7 +303,7 @@ class Bronto_Common_Helper_Support extends Bronto_Common_Helper_Data
300
  $settingNameParts = explode('/', $setting);
301
  $settingName = end($settingNameParts);
302
 
303
- $value = Mage::getStoreConfig($setting);
304
  if (empty($settingName)) {
305
  continue;
306
  }
@@ -310,7 +313,7 @@ class Bronto_Common_Helper_Support extends Bronto_Common_Helper_Data
310
  }
311
 
312
  if ($helper->hasCustomConfig()) {
313
- $moduleConfig = array_merge($moduleConfig, $helper->getCustomConfig());
314
  }
315
 
316
  if ($moduleConfig) {
25
  'title',
26
  'using_solution_partner',
27
  'partner',
28
+ 'terms',
29
  'magento_version',
30
  'magento_edition',
31
  'extension_version',
185
  *
186
  * @return array
187
  */
188
+ public function getDebugInformation($scope = 'default', $scope = 0)
189
  {
190
  $currentDate = Mage::getModel('core/date')->date('Y-m-d');
191
  $brontoModules = $this->getEnabledBrontoModules();
193
  $request = Mage::app()->getRequest();
194
 
195
  return array_merge(
196
+ // Form submission
197
  $formData,
198
  // Current Websites / Stores; Enabled Bronto Modules
199
  array(
212
  ),
213
  array(
214
  'bronto_modules' => $brontoModules,
215
+ 'bronto_config' => $this->getBrontoConfigs($brontoModules, $scope, $scopeId)
216
  )
217
  );
218
  }
234
  $formData['magento_edition'] = $this->getEdition();
235
 
236
  $yesNo = Mage::getModel('adminhtml/system_config_source_yesno');
237
+ foreach (array('using_solution_partner', 'terms') as $formKey) {
238
+ $selectedValue = $formData[$formKey];
239
+ foreach ($yesNo->toOptionArray() as $option) {
240
+ if ($option['value'] == $selectedValue) {
241
+ $formData[$formKey] = $option['label'];
242
+ }
243
  }
244
  }
 
245
 
246
  return $this->_submitWebform(
247
  array_merge($this->getSupportInformation(), $formData)
278
  * Gets the Bronto configuration settings
279
  *
280
  * @param array $brontoModules
281
+ * @param string $scope
282
+ * @param int $scopeId
283
  *
284
  * @return array
285
  */
286
+ public function getBrontoConfigs($brontoModules, $scope = 'default', $scopeId = 0)
287
  {
288
  $configs = array();
289
  $processedConfigs = array();
303
  $settingNameParts = explode('/', $setting);
304
  $settingName = end($settingNameParts);
305
 
306
+ $value = $this->getAdminScopedConfig($setting, $scope, $scopeId);
307
  if (empty($settingName)) {
308
  continue;
309
  }
313
  }
314
 
315
  if ($helper->hasCustomConfig()) {
316
+ $moduleConfig = array_merge($moduleConfig, $helper->getCustomConfig($scope, $scopeId));
317
  }
318
 
319
  if ($moduleConfig) {
app/code/community/Bronto/Common/Model/Coupon/Observer.php ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Bronto_Common_Model_Coupon_Observer
4
+ {
5
+ const TARGET_AREA = 'frontend';
6
+
7
+ protected $_helper;
8
+
9
+ /**
10
+ * Simple constructor override for helpers
11
+ */
12
+ public function __construct()
13
+ {
14
+ $this->_helper = Mage::helper('bronto_common/coupon');
15
+ }
16
+
17
+ /**
18
+ * Is the observer applicable in this case?
19
+ *
20
+ * @param Mage_Core_Controller_Front_Action $action
21
+ * @return boolean
22
+ */
23
+ protected function _isApplicable($action)
24
+ {
25
+ return (
26
+ $this->_helper->isEnabled() &&
27
+ $this->_helper->isObservingController() &&
28
+ $action->getLayout()->getArea() == self::TARGET_AREA
29
+ );
30
+ }
31
+
32
+ /**
33
+ * Sets the coupon code on the quote or on the session
34
+ *
35
+ * @param Varien_Event_Observer $observer
36
+ */
37
+ public function addCodeToSession($observer)
38
+ {
39
+ $action = $observer->getControllerAction();
40
+ if ($this->_isApplicable($action)) {
41
+ $this->_helper->applyCodeFromRequest($action->getRequest());
42
+ }
43
+ return false;
44
+ }
45
+
46
+ /**
47
+ * Sets the coupon code on the quote
48
+ *
49
+ * @param Varien_Event_Observer $observer
50
+ */
51
+ public function addCodeToQuote($observer)
52
+ {
53
+ $this->_helper->applyCode();
54
+ }
55
+ }
app/code/community/Bronto/Common/Model/Email/Template.php CHANGED
@@ -79,26 +79,20 @@ class Bronto_Common_Model_Email_Template extends Mage_Core_Model_Email_Template
79
  * Gets the the global recommendation or the one configured for the email
80
  *
81
  * @param int $storeId
82
- * @return Bronto_Product_Model_Recommendation
83
  */
84
- protected function _getRecommendation($storeId = null)
85
  {
86
- $recommendation = Mage::getModel('bronto_product/recommendation');
87
  $recommendationId = $this->getProductRecommendation();
88
  if ($recommendationId) {
89
- if ($recommendation->load($recommendationId)->hasEntityId()) {
90
- return $recommendation;
91
- }
92
  }
93
 
94
  if ($this->_helper == 'bronto_email') {
95
  $recommendationId = Mage::helper('bronto_email')->getDefaultRecommendation('store', $storeId);
96
- if ($recommendationId) {
97
- $recommendation->load($recommendationId);
98
- }
99
  }
100
 
101
- return $recommendation;
102
  }
103
 
104
  /**
@@ -129,6 +123,25 @@ class Bronto_Common_Model_Email_Template extends Mage_Core_Model_Email_Template
129
  return null;
130
  }
131
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
132
  /**
133
  * Process email template code
134
  *
@@ -149,7 +162,6 @@ class Bronto_Common_Model_Email_Template extends Mage_Core_Model_Email_Template
149
  $processor->setMessageId($this->getBrontoMessageId());
150
  }
151
 
152
- $processor->setRecommendation($this->_getRecommendation($variables['store']->getId()));
153
  $processor->setVariables($variables);
154
  $processor->setAvailable($this->getVariablesOptionArray());
155
 
@@ -172,6 +184,38 @@ class Bronto_Common_Model_Email_Template extends Mage_Core_Model_Email_Template
172
  return true;
173
  }
174
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
175
  /**
176
  * Sends a Bronto Delivery
177
  *
@@ -184,11 +228,12 @@ class Bronto_Common_Model_Email_Template extends Mage_Core_Model_Email_Template
184
  $message = $queue->getMessage();
185
  $contacts = $queue->getContacts();
186
 
187
- $this->setParams($queue->getAdditionalData());
188
  $this->setMessage($message);
189
  $this->setBrontoMessageId($message->id);
190
  $this->setBrontoMessageName($message->name);
191
  $this->setBrontoMessageApproved(1);
 
192
 
193
  foreach ($contacts as $contact) {
194
  $this->_beforeSend($contact, $message);
@@ -207,7 +252,10 @@ class Bronto_Common_Model_Email_Template extends Mage_Core_Model_Email_Template
207
  'deliveryType' => 'selected'
208
  ),
209
  );
210
- $list = Mage::getModel('bronto_common/list', $this->_helper);
 
 
 
211
  $excludes = $list->addAdditionalRecipients($queue->getStoreId());
212
  foreach ($excludes as $exclude) {
213
  $recipients[] = $exclude;
@@ -265,6 +313,9 @@ class Bronto_Common_Model_Email_Template extends Mage_Core_Model_Email_Template
265
  /* @var $message Bronto_Api_Message_Row */
266
  $messageId = $this->getBrontoMessageId();
267
  $sendType = $this->getTemplateSendType();
 
 
 
268
 
269
  // If messageId is empty, send through Magento
270
  if (empty($messageId)) {
@@ -295,18 +346,31 @@ class Bronto_Common_Model_Email_Template extends Mage_Core_Model_Email_Template
295
  $delivery = $api->getDeliveryObject()->createRow();
296
  $delivery = $this->getProcessedDelivery($delivery, $variables);
297
  $this->_additionalFields($delivery, $variables);
 
 
 
 
 
 
 
 
 
298
 
299
  $data = array(
300
  'emails' => $emails,
301
  'params' => $this->_additionalData(),
 
 
 
 
 
302
  'delivery' => array(
303
- 'messageId' => $this->getBrontoMessageId(),
304
  'type' => $sendType ? $sendType : 'transactional',
305
  'fromEmail' => $this->getSenderEmail(),
306
  'fromName' => $this->getSenderName(),
307
  'replyEmail' => $this->getSenderEmail(),
308
- 'fields' => $delivery->getFields(),
309
- )
310
  );
311
 
312
  $queue = Mage::getModel('bronto_common/queue')
@@ -419,7 +483,7 @@ class Bronto_Common_Model_Email_Template extends Mage_Core_Model_Email_Template
419
  $vars['coupon'] = $coupon;
420
  }
421
  } catch (Exception $e) {
422
- Mage::helper($this->_helper)->writeDebug(' Failed loading Sales Rule with ID: ' . $rule->getId());
423
  }
424
  }
425
 
@@ -472,7 +536,7 @@ class Bronto_Common_Model_Email_Template extends Mage_Core_Model_Email_Template
472
  $this->_beforeSend($contact, $message);
473
  $this->_afterSend(true, null, $delivery);
474
  } catch (Exception $e) {
475
- Mage::helper('bronto_common')->writeError('Failed to trigger email send: ' . $e->getMessage());
476
  }
477
  }
478
 
79
  * Gets the the global recommendation or the one configured for the email
80
  *
81
  * @param int $storeId
82
+ * @return int
83
  */
84
+ protected function _getRecommendationId($storeId = null)
85
  {
 
86
  $recommendationId = $this->getProductRecommendation();
87
  if ($recommendationId) {
88
+ return $recommendationId;
 
 
89
  }
90
 
91
  if ($this->_helper == 'bronto_email') {
92
  $recommendationId = Mage::helper('bronto_email')->getDefaultRecommendation('store', $storeId);
 
 
 
93
  }
94
 
95
+ return $recommendationId;
96
  }
97
 
98
  /**
123
  return null;
124
  }
125
 
126
+ /**
127
+ * Gets the delivery flags for this message
128
+ *
129
+ * @param int $storeId
130
+ * @return int
131
+ */
132
+ protected function _getSendFlags($storeId = null)
133
+ {
134
+ $sendFlags = $this->getSendFlags();
135
+ if ($sendFlags) {
136
+ return $sendFlags;
137
+ }
138
+
139
+ if ($this->_helper == 'bronto_email') {
140
+ $sendFlags = Mage::helper('bronto_email')->getDefaultSendFlags('store', $storeId);
141
+ }
142
+ return $sendFlags;
143
+ }
144
+
145
  /**
146
  * Process email template code
147
  *
162
  $processor->setMessageId($this->getBrontoMessageId());
163
  }
164
 
 
165
  $processor->setVariables($variables);
166
  $processor->setAvailable($this->getVariablesOptionArray());
167
 
184
  return true;
185
  }
186
 
187
+ /**
188
+ * TODO: move this into an event handler of some kind
189
+ * Gets any related fields for a delivery
190
+ *
191
+ * @param Bronto_Common_Model_Queue $queue
192
+ */
193
+ protected function _setRelatedFields($queue)
194
+ {
195
+ $helper = Mage::helper('bronto_product');
196
+ $info = $queue->getRecommendationInfo();
197
+ if ($info->getId() && $helper->isEnabled('store', $queue->getStoreId())) {
198
+ $recommendation = Mage::getModel('bronto_product/recommendation')
199
+ ->load($info->getId());
200
+ if ($recommendation->hasEntityId()) {
201
+ $data = $queue->getUnserializedEmailData()->getData();
202
+ if ($info->getCustomer()) {
203
+ $customer = Mage::getModel('customer/customer')->setId($info->getCustomer());
204
+ $recommendation->setCustomer($customer);
205
+ }
206
+ $hash = $helper->collectRecommendations(
207
+ $recommendation,
208
+ $queue->getStoreId(),
209
+ $info->getProductIds());
210
+ $fields = $helper->relatedFields($hash, $queue->getStoreId());
211
+ foreach ($fields as $relatedFields) {
212
+ $data['delivery']['fields'] = array_merge($data['delivery']['fields'], $relatedFields);
213
+ }
214
+ $queue->setUnserializedEmailData($data);
215
+ }
216
+ }
217
+ }
218
+
219
  /**
220
  * Sends a Bronto Delivery
221
  *
228
  $message = $queue->getMessage();
229
  $contacts = $queue->getContacts();
230
 
231
+ $this->setSendQueue($queue);
232
  $this->setMessage($message);
233
  $this->setBrontoMessageId($message->id);
234
  $this->setBrontoMessageName($message->name);
235
  $this->setBrontoMessageApproved(1);
236
+ $this->_setRelatedFields($queue);
237
 
238
  foreach ($contacts as $contact) {
239
  $this->_beforeSend($contact, $message);
252
  'deliveryType' => 'selected'
253
  ),
254
  );
255
+ $list = Mage::getModel('bronto_common/list', array(
256
+ $this->_helper,
257
+ $queue->getAdditionalData()->getExclusionList()
258
+ ));
259
  $excludes = $list->addAdditionalRecipients($queue->getStoreId());
260
  foreach ($excludes as $exclude) {
261
  $recipients[] = $exclude;
313
  /* @var $message Bronto_Api_Message_Row */
314
  $messageId = $this->getBrontoMessageId();
315
  $sendType = $this->getTemplateSendType();
316
+ if ($sendType == 'marketing') {
317
+ $sendType = 'triggered';
318
+ }
319
 
320
  // If messageId is empty, send through Magento
321
  if (empty($messageId)) {
346
  $delivery = $api->getDeliveryObject()->createRow();
347
  $delivery = $this->getProcessedDelivery($delivery, $variables);
348
  $this->_additionalFields($delivery, $variables);
349
+ $productContext = Mage::helper('bronto_product')
350
+ ->itemsToProductHash($this->getTemplateFilter()
351
+ ->getProductContext(), $variables['store']->getId());
352
+ $sendOptions = Mage::getModel('bronto_common/system_config_source_sendOptions');
353
+ $sendOption = $this->_getSendFlags($variables['store']->getId());
354
+ if ($sendOptions->setDeliveryFlags($delivery, $sendOption)) {
355
+ $optionLabels = $sendOptions->toArray();
356
+ Mage::helper($this->_helper)->writeDebug("Setting send flags for messageId {$this->getBrontoMessageId()}: {$optionLabels[$sendOption]}");
357
+ }
358
 
359
  $data = array(
360
  'emails' => $emails,
361
  'params' => $this->_additionalData(),
362
+ 'recommendation' => array(
363
+ 'product_ids' => array_keys($productContext),
364
+ 'customer' => $this->getTemplateFilter()->getCustomerId(),
365
+ 'id' => $this->_getRecommendationId($variables['store']->getId()),
366
+ ),
367
  'delivery' => array(
368
+ 'messageId' => $messageId,
369
  'type' => $sendType ? $sendType : 'transactional',
370
  'fromEmail' => $this->getSenderEmail(),
371
  'fromName' => $this->getSenderName(),
372
  'replyEmail' => $this->getSenderEmail(),
373
+ ) + $delivery->getData()
 
374
  );
375
 
376
  $queue = Mage::getModel('bronto_common/queue')
483
  $vars['coupon'] = $coupon;
484
  }
485
  } catch (Exception $e) {
486
+ Mage::helper($this->_helper)->writeError(' Failed loading Sales Rule with ID: ' . $rule->getId());
487
  }
488
  }
489
 
536
  $this->_beforeSend($contact, $message);
537
  $this->_afterSend(true, null, $delivery);
538
  } catch (Exception $e) {
539
+ Mage::helper($this->_helper)->writeError('Failed to trigger email send: ' . $e->getMessage());
540
  }
541
  }
542
 
app/code/community/Bronto/Common/Model/Email/Template/Filter.php CHANGED
@@ -41,15 +41,7 @@ class Bronto_Common_Model_Email_Template_Filter extends Mage_Core_Model_Email_Te
41
  */
42
  protected $_customer;
43
 
44
- /**
45
- * @var Bronto_Product_Model_Recommendation
46
- */
47
- protected $_recommendation;
48
-
49
- /**
50
- * @var Bronto_Product_Model_Collect
51
- */
52
- protected $_collector;
53
 
54
  /**
55
  * Assigned template variables
@@ -93,32 +85,33 @@ class Bronto_Common_Model_Email_Template_Filter extends Mage_Core_Model_Email_Te
93
  /**
94
  * @return Mage_Customer_Model_Customer
95
  */
96
- protected function _getCustomer()
97
  {
98
- return $this->_customer;
 
 
 
99
  }
100
 
101
  /**
102
- * @return bool|Bronto_Product_Model_Recommendation
 
 
103
  */
104
- protected function _getRecommendation()
105
  {
106
- return $this->_recommendation;
107
  }
108
 
109
  /**
110
- * @param mixed $items
111
- * @return Bronto_Product_Model_Collect
 
112
  */
113
- protected function _getRecommendationCollector($items)
114
  {
115
- if (is_null($this->_collector)) {
116
- $this->_collector = Mage::helper('bronto_product')->collector(
117
- $this->_getRecommendation(),
118
- $this->getStoreId(),
119
- $items);
120
- }
121
- return $this->_collector;
122
  }
123
 
124
  /**
@@ -361,8 +354,6 @@ class Bronto_Common_Model_Email_Template_Filter extends Mage_Core_Model_Email_Te
361
  }
362
  }
363
 
364
- // Back fill anything if necessary
365
- $this->_populateRelatedContent();
366
  return $this->_delivery;
367
  }
368
 
@@ -443,7 +434,7 @@ class Bronto_Common_Model_Email_Template_Filter extends Mage_Core_Model_Email_Te
443
  $this->setField('adminName', $user->getUsername());
444
  $this->setField('adminPassword', $user->getPlainPassword());
445
  $this->setField('adminLoginURL', Mage::helper('adminhtml')->getUrl('adminhtml/system_account/'));
446
- if (version_compare(Mage::getVersion(), '1.6.1.0', '>=')) {
447
  $this->setField('adminPasswordResetLink', Mage::helper('adminhtml')->getUrl('adminhtml/index/resetpassword', array('_query' => array('id' => $user->getId(), 'token' => $user->getRpToken()))));
448
  }
449
 
@@ -461,7 +452,7 @@ class Bronto_Common_Model_Email_Template_Filter extends Mage_Core_Model_Email_Te
461
  protected function _filterSubscriber(Mage_Newsletter_Model_Subscriber $subscriber)
462
  {
463
  if (!in_array('subscriber', $this->_filteredObjects)) {
464
- $this->_filterCustomer($this->_getCustomer());
465
  $this->_filteredObjects[] = 'subscriber';
466
  }
467
 
@@ -490,12 +481,12 @@ class Bronto_Common_Model_Email_Template_Filter extends Mage_Core_Model_Email_Te
490
  $this->setField('customerPassword', $customer->getPassword());
491
  if ($store = $customer->getStore()) {
492
  $this->setField('confirmationLink', $store->getUrl('customer/account/confirm', array('_query' => array('id' => $customer->getId(), 'key' => $customer->getConfirmation()))));
493
- if (version_compare(Mage::getVersion(), '1.6.1.0', '>=')) {
494
  $this->setField('passwordResetLink', $store->getUrl('customer/account/resetpassword', array('_query' => array('id' => $customer->getId(), 'token' => $customer->getRpToken()))));
495
  }
496
  } else {
497
  $this->setField('confirmationLink', Mage::getUrl('customer/account/confirm', array('_query' => array('id' => $customer->getId(), 'key' => $customer->getConfirmation()))));
498
- if (version_compare(Mage::getVersion(), '1.6.1.0', '>=')) {
499
  $this->setField('passwordResetLink', Mage::getUrl('customer/account/resetpassword', array('_query' => array('id' => $customer->getId(), 'token' => $customer->getRpToken()))));
500
  }
501
  }
@@ -526,7 +517,7 @@ class Bronto_Common_Model_Email_Template_Filter extends Mage_Core_Model_Email_Te
526
  }
527
 
528
  // Add Related Content
529
- $this->_populateRelatedContent($order->getAllItems());
530
 
531
  // Order may not be a shippable order
532
  $shipAddress = 'N/A';
@@ -592,7 +583,7 @@ class Bronto_Common_Model_Email_Template_Filter extends Mage_Core_Model_Email_Te
592
  }
593
 
594
  // Add Related Content
595
- $this->_populateRelatedContent($invoice->getAllItems());
596
 
597
  $this->setField('invoiceIncrementId', $invoice->getIncrementId());
598
  $this->setField('invoiceItems', $this->_filterInvoiceItems($invoice));
@@ -628,7 +619,7 @@ class Bronto_Common_Model_Email_Template_Filter extends Mage_Core_Model_Email_Te
628
  }
629
 
630
  // Add Related Content
631
- $this->_populateRelatedContent($shipment->getAllItems());
632
 
633
  $this->setField('shipmentIncrementId', $shipment->getIncrementId());
634
  $this->setField('shipmentCreatedAt', Mage::helper('core')->formatDate($createdAt, 'long', true)); // TODO: needed?
@@ -665,7 +656,7 @@ class Bronto_Common_Model_Email_Template_Filter extends Mage_Core_Model_Email_Te
665
  }
666
 
667
  // Add Related Content
668
- $this->_populateRelatedContent($creditmemo->getAllItems());
669
 
670
  $this->setField('creditmemoIncrementId', $creditmemo->getIncrementId());
671
  $this->setField('creditmemoCreatedAt', Mage::helper('core')->formatDate($createdAt, 'long', true)); // TODO: needed?
@@ -706,7 +697,7 @@ class Bronto_Common_Model_Email_Template_Filter extends Mage_Core_Model_Email_Te
706
  }
707
 
708
  // Add Related Content
709
- $this->_populateRelatedContent($quote->getAllItems());
710
 
711
  $queryParams = $this->getQueryParams();
712
  $queryParams['id'] = urlencode(base64_encode(Mage::helper('core')->encrypt($quote->getId())));
@@ -757,7 +748,7 @@ class Bronto_Common_Model_Email_Template_Filter extends Mage_Core_Model_Email_Te
757
  $this->setField("productTotal_{$index}", $this->formatPrice($checkout->getSubtotalInclTax($item)));
758
  } else {
759
  $this->setField("productPrice_{$index}", $this->formatPrice($item->getPrice()));
760
- $this->setField("productTotal_{$index}", $this->formatPrice($item->calcRowTotal()->getRowTotal()));
761
  }
762
 
763
  $this->setField("productName_{$index}", $item->getName());
@@ -768,7 +759,8 @@ class Bronto_Common_Model_Email_Template_Filter extends Mage_Core_Model_Email_Te
768
  /* @var $product Mage_Catalog_Model_Product */
769
  $product = $item->getProduct();
770
  if (!$product) {
771
- $product = Mage::getModel('catalog/product')->load($item->getProductId());
 
772
  }
773
  $this->_filterProduct($product, $index);
774
 
@@ -792,7 +784,7 @@ class Bronto_Common_Model_Email_Template_Filter extends Mage_Core_Model_Email_Te
792
  }
793
 
794
  // Add Related Content
795
- $this->_populateRelatedContent($wishlist->getItemCollection());
796
 
797
  $queryParams = $this->getQueryParams();
798
  $queryParams['wishlist_id'] = urlencode(base64_encode(Mage::helper('core')->encrypt($wishlist->getId())));
@@ -846,7 +838,8 @@ class Bronto_Common_Model_Email_Template_Filter extends Mage_Core_Model_Email_Te
846
  /* @var $product Mage_Catalog_Model_Product */
847
  $product = $item->getProduct();
848
  if (!$product) {
849
- $product = Mage::getModel('catalog/product')->load($item->getProductId());
 
850
  }
851
  $this->setField("productSku_{$index}", $product->getSku());
852
 
@@ -935,7 +928,8 @@ class Bronto_Common_Model_Email_Template_Filter extends Mage_Core_Model_Email_Te
935
  /* @var $product Mage_Catalog_Model_Product */
936
  $product = $item->getProduct();
937
  if (!$product) {
938
- $product = Mage::getModel('catalog/product')->load($item->getProductId());
 
939
  }
940
  $this->_filterProduct($product, $index);
941
 
@@ -1024,7 +1018,8 @@ class Bronto_Common_Model_Email_Template_Filter extends Mage_Core_Model_Email_Te
1024
  /* @var $product Mage_Catalog_Model_Product */
1025
  $product = $item->getProduct();
1026
  if (!$product) {
1027
- $product = Mage::getModel('catalog/product')->load($item->getProductId());
 
1028
  }
1029
  $this->_filterProduct($product, $index);
1030
 
@@ -1148,7 +1143,7 @@ class Bronto_Common_Model_Email_Template_Filter extends Mage_Core_Model_Email_Te
1148
  return $totals;
1149
  }
1150
 
1151
- /**
1152
  * @param Mage_Catalog_Model_Product $product
1153
  * @param int $index
1154
  *
@@ -1157,19 +1152,14 @@ class Bronto_Common_Model_Email_Template_Filter extends Mage_Core_Model_Email_Te
1157
  protected function _filterProduct(Mage_Catalog_Model_Product $product, $index = null)
1158
  {
1159
  // Load full product
1160
- $product = Mage::getModel('catalog/product')
1161
- ->setStoreId($product->getStoreId())
1162
- ->load($product->getId());
1163
 
1164
  if ($index !== null) {
1165
  try {
1166
- // Fix for SCP
1167
- if ($product->getTypeId() == Mage_Catalog_Model_Product_Type::TYPE_SIMPLE) {
1168
- $parentIds = Mage::getModel('catalog/product_type_configurable')->getParentIdsByChild($product->getId());
1169
- if (isset($parentIds[0])) {
1170
- $product = Mage::getModel('catalog/product')->setStoreId($product->getStoreId())->load($parentIds[0]);
1171
- }
1172
- }
1173
  $imageUrl = Mage::helper('bronto_common')->getProductImageUrl($product);
1174
  $this->setField("productImgUrl_{$index}", $imageUrl);
1175
  $this->setField("productDescription_{$index}", $product->getDescription());
@@ -1177,13 +1167,45 @@ class Bronto_Common_Model_Email_Template_Filter extends Mage_Core_Model_Email_Te
1177
  Mage::log('Error loading image: ' . $e);
1178
  }
1179
  } else {
 
1180
  $this->setField('productUrl', $product->getUrl());
1181
  $this->setField('productName', $product->getName());
 
 
 
 
 
 
 
1182
  }
1183
 
1184
  return $this;
1185
  }
1186
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1187
  /**
1188
  * @param Mage_Sales_Model_Quote_Item $item
1189
  *
@@ -1194,18 +1216,7 @@ class Bronto_Common_Model_Email_Template_Filter extends Mage_Core_Model_Email_Te
1194
  if ($item->getRedirectUrl()) {
1195
  return $item->getRedirectUrl();
1196
  }
1197
-
1198
- // Fix for SCP
1199
- $product = $item->getProduct();
1200
- if ($product->getTypeId() == Mage_Catalog_Model_Product_Type::TYPE_SIMPLE) {
1201
- $parentIds = Mage::getModel('catalog/product_type_configurable')->getParentIdsByChild($product->getId());
1202
- if (isset($parentIds[0])) {
1203
- $parentProduct = Mage::getModel('catalog/product')->setStoreId($item->getStoreId())->load($parentIds[0]);
1204
- return $parentProduct->getProductUrl();
1205
- }
1206
- }
1207
-
1208
- return $item->getProduct()->getProductUrl();
1209
  }
1210
 
1211
  /**
@@ -1218,8 +1229,7 @@ class Bronto_Common_Model_Email_Template_Filter extends Mage_Core_Model_Email_Te
1218
  if ($item->getRedirectUrl()) {
1219
  return $item->getRedirectUrl();
1220
  }
1221
-
1222
- return $item->getProduct()->getProductUrl();
1223
  }
1224
 
1225
  /**
@@ -1234,15 +1244,14 @@ class Bronto_Common_Model_Email_Template_Filter extends Mage_Core_Model_Email_Te
1234
  }
1235
 
1236
  if ($item->getProduct()) {
1237
- return $item->getProduct()->getProductUrl();
1238
  }
1239
 
1240
- $product = Mage::getModel('catalog/product')
1241
- ->setStoreId($this->getStoreId())
1242
- ->load($item->getProductId());
1243
 
1244
  if ($product->getId()) {
1245
- return $product->getProductUrl();
1246
  }
1247
 
1248
  return '';
@@ -1453,7 +1462,7 @@ class Bronto_Common_Model_Email_Template_Filter extends Mage_Core_Model_Email_Te
1453
  *
1454
  * @return string
1455
  */
1456
- protected function formatPrice($price, $currencyCode = null)
1457
  {
1458
  $options = array(
1459
  'precision' => 2,
@@ -1471,25 +1480,4 @@ class Bronto_Common_Model_Email_Template_Filter extends Mage_Core_Model_Email_Te
1471
 
1472
  return $this->_currency->formatTxt($price, $options);
1473
  }
1474
-
1475
- /**
1476
- * Populates the recommendation content
1477
- *
1478
- * @param array $products (Optional)
1479
- */
1480
- protected function _populateRelatedContent($items = array())
1481
- {
1482
- $helper = Mage::helper('bronto_product');
1483
- $recommendation = $this->_getRecommendation();
1484
- if ($recommendation && $helper->isEnabled('store', $this->getStoreId())) {
1485
- $collect = $this->_getRecommendationCollector($items);
1486
- if ($collect->getRemainingCount() == $recommendation->getNumberOfItems()) {
1487
- $collect->setRecommendation($recommendation->setCustomer($this->_getCustomer()));
1488
- $helper->setRelatedFields(
1489
- $this->_delivery,
1490
- $collect->collect(),
1491
- $this->getStoreId());
1492
- }
1493
- }
1494
- }
1495
  }
41
  */
42
  protected $_customer;
43
 
44
+ protected $_items = array();
 
 
 
 
 
 
 
 
45
 
46
  /**
47
  * Assigned template variables
85
  /**
86
  * @return Mage_Customer_Model_Customer
87
  */
88
+ public function getCustomerId()
89
  {
90
+ if ($this->_customer) {
91
+ return $this->_customer->getId();
92
+ }
93
+ return null;
94
  }
95
 
96
  /**
97
+ * Returns the item context
98
+ *
99
+ * @return mixed
100
  */
101
+ public function getProductContext()
102
  {
103
+ return $this->_items;
104
  }
105
 
106
  /**
107
+ * Adds an item to the item context
108
+ *
109
+ * @return mixed
110
  */
111
+ public function addItemToContext($item)
112
  {
113
+ $this->_items[] = $item;
114
+ return $this;
 
 
 
 
 
115
  }
116
 
117
  /**
354
  }
355
  }
356
 
 
 
357
  return $this->_delivery;
358
  }
359
 
434
  $this->setField('adminName', $user->getUsername());
435
  $this->setField('adminPassword', $user->getPlainPassword());
436
  $this->setField('adminLoginURL', Mage::helper('adminhtml')->getUrl('adminhtml/system_account/'));
437
+ if (Mage::helper('bronto_common')->isVersionMatch(Mage::getVersionInfo(), 1, array(array('>=', '6')))) {
438
  $this->setField('adminPasswordResetLink', Mage::helper('adminhtml')->getUrl('adminhtml/index/resetpassword', array('_query' => array('id' => $user->getId(), 'token' => $user->getRpToken()))));
439
  }
440
 
452
  protected function _filterSubscriber(Mage_Newsletter_Model_Subscriber $subscriber)
453
  {
454
  if (!in_array('subscriber', $this->_filteredObjects)) {
455
+ $this->_filterCustomer($this->_customer);
456
  $this->_filteredObjects[] = 'subscriber';
457
  }
458
 
481
  $this->setField('customerPassword', $customer->getPassword());
482
  if ($store = $customer->getStore()) {
483
  $this->setField('confirmationLink', $store->getUrl('customer/account/confirm', array('_query' => array('id' => $customer->getId(), 'key' => $customer->getConfirmation()))));
484
+ if (Mage::helper('bronto_common')->isVersionMatch(Mage::getVersionInfo(), 1, array(array('>=', '6')))) {
485
  $this->setField('passwordResetLink', $store->getUrl('customer/account/resetpassword', array('_query' => array('id' => $customer->getId(), 'token' => $customer->getRpToken()))));
486
  }
487
  } else {
488
  $this->setField('confirmationLink', Mage::getUrl('customer/account/confirm', array('_query' => array('id' => $customer->getId(), 'key' => $customer->getConfirmation()))));
489
+ if (Mage::helper('bronto_common')->isVersionMatch(Mage::getVersionInfo(), 1, array(array('>=', '6')))) {
490
  $this->setField('passwordResetLink', Mage::getUrl('customer/account/resetpassword', array('_query' => array('id' => $customer->getId(), 'token' => $customer->getRpToken()))));
491
  }
492
  }
517
  }
518
 
519
  // Add Related Content
520
+ $this->_items = $order->getAllItems();
521
 
522
  // Order may not be a shippable order
523
  $shipAddress = 'N/A';
583
  }
584
 
585
  // Add Related Content
586
+ $this->_items = $invoice->getAllItems();
587
 
588
  $this->setField('invoiceIncrementId', $invoice->getIncrementId());
589
  $this->setField('invoiceItems', $this->_filterInvoiceItems($invoice));
619
  }
620
 
621
  // Add Related Content
622
+ $this->_items = $shipment->getAllItems();
623
 
624
  $this->setField('shipmentIncrementId', $shipment->getIncrementId());
625
  $this->setField('shipmentCreatedAt', Mage::helper('core')->formatDate($createdAt, 'long', true)); // TODO: needed?
656
  }
657
 
658
  // Add Related Content
659
+ $this->_items = $creditmemo->getAllItems();
660
 
661
  $this->setField('creditmemoIncrementId', $creditmemo->getIncrementId());
662
  $this->setField('creditmemoCreatedAt', Mage::helper('core')->formatDate($createdAt, 'long', true)); // TODO: needed?
697
  }
698
 
699
  // Add Related Content
700
+ $this->_items = $quote->getAllItems();
701
 
702
  $queryParams = $this->getQueryParams();
703
  $queryParams['id'] = urlencode(base64_encode(Mage::helper('core')->encrypt($quote->getId())));
748
  $this->setField("productTotal_{$index}", $this->formatPrice($checkout->getSubtotalInclTax($item)));
749
  } else {
750
  $this->setField("productPrice_{$index}", $this->formatPrice($item->getPrice()));
751
+ $this->setField("productTotal_{$index}", $this->formatPrice($item->getRowTotal()));
752
  }
753
 
754
  $this->setField("productName_{$index}", $item->getName());
759
  /* @var $product Mage_Catalog_Model_Product */
760
  $product = $item->getProduct();
761
  if (!$product) {
762
+ $product = Mage::helper('bronto_common/product')
763
+ ->getProduct($item->getProductId(), $this->getStoreId());
764
  }
765
  $this->_filterProduct($product, $index);
766
 
784
  }
785
 
786
  // Add Related Content
787
+ $this->_items = $wishlist->getItemCollection();
788
 
789
  $queryParams = $this->getQueryParams();
790
  $queryParams['wishlist_id'] = urlencode(base64_encode(Mage::helper('core')->encrypt($wishlist->getId())));
838
  /* @var $product Mage_Catalog_Model_Product */
839
  $product = $item->getProduct();
840
  if (!$product) {
841
+ $product = Mage::helper('bronto_common/product')
842
+ ->getProduct($item->getProductId(), $this->getStoreId() ? $this->getStoreId() : false);
843
  }
844
  $this->setField("productSku_{$index}", $product->getSku());
845
 
928
  /* @var $product Mage_Catalog_Model_Product */
929
  $product = $item->getProduct();
930
  if (!$product) {
931
+ $product = Mage::helper('bronto_common/product')
932
+ ->getProduct($item->getProductId(), $this->getStoreId());
933
  }
934
  $this->_filterProduct($product, $index);
935
 
1018
  /* @var $product Mage_Catalog_Model_Product */
1019
  $product = $item->getProduct();
1020
  if (!$product) {
1021
+ $product = Mage::getModel('bronto_common/product')
1022
+ ->getProduct($item->getProductId(), $this->getStoreId());
1023
  }
1024
  $this->_filterProduct($product, $index);
1025
 
1143
  return $totals;
1144
  }
1145
 
1146
+ /**
1147
  * @param Mage_Catalog_Model_Product $product
1148
  * @param int $index
1149
  *
1152
  protected function _filterProduct(Mage_Catalog_Model_Product $product, $index = null)
1153
  {
1154
  // Load full product
1155
+ $product = Mage::helper('bronto_common/product')
1156
+ ->getProduct($product->getId(), $product->getStoreId());
 
1157
 
1158
  if ($index !== null) {
1159
  try {
1160
+ // Sets original product ID before pulling in parent
1161
+ $this->setField("productId_{$index}", $product->getId());
1162
+ $product = $this->_getSimpleProduct($product);
 
 
 
 
1163
  $imageUrl = Mage::helper('bronto_common')->getProductImageUrl($product);
1164
  $this->setField("productImgUrl_{$index}", $imageUrl);
1165
  $this->setField("productDescription_{$index}", $product->getDescription());
1167
  Mage::log('Error loading image: ' . $e);
1168
  }
1169
  } else {
1170
+ $this->setField('productId', $product->getId());
1171
  $this->setField('productUrl', $product->getUrl());
1172
  $this->setField('productName', $product->getName());
1173
+ try {
1174
+ $product = $this->_getSimpleProduct($product);
1175
+ $this->setField('productImgUrl', Mage::helper('bronto_common')->getProductImageUrl($product));
1176
+ $this->setField('productDescription', $product->getDescription());
1177
+ } catch (Exception $e) {
1178
+ Mage::log('Error loading image: ' . $e);
1179
+ }
1180
  }
1181
 
1182
  return $this;
1183
  }
1184
 
1185
+ /**
1186
+ * Gets the visible configurable product for a simple product
1187
+ * This is a fix for SCP
1188
+ *
1189
+ * @param Mage_Catalog_Model_Product $product
1190
+ * @return Mage_Catalog_Model_Product
1191
+ */
1192
+ protected function _getSimpleProduct($product)
1193
+ {
1194
+ return Mage::helper('bronto_common/product')
1195
+ ->getConfigurableProduct($product);
1196
+ }
1197
+
1198
+ /**
1199
+ * Gets the url for a Configurable product for this simple product
1200
+ *
1201
+ * @param Mage_Catalog_Model_Product $product
1202
+ * @return string
1203
+ */
1204
+ protected function _getProductUrl($product)
1205
+ {
1206
+ return $this->_getSimpleProduct($product)->getProductUrl();
1207
+ }
1208
+
1209
  /**
1210
  * @param Mage_Sales_Model_Quote_Item $item
1211
  *
1216
  if ($item->getRedirectUrl()) {
1217
  return $item->getRedirectUrl();
1218
  }
1219
+ return $this->_getProductUrl($item->getProduct());
 
 
 
 
 
 
 
 
 
 
 
1220
  }
1221
 
1222
  /**
1229
  if ($item->getRedirectUrl()) {
1230
  return $item->getRedirectUrl();
1231
  }
1232
+ return $this->_getProductUrl($item->getProduct());
 
1233
  }
1234
 
1235
  /**
1244
  }
1245
 
1246
  if ($item->getProduct()) {
1247
+ return $this->_getProductUrl($item->getProduct());
1248
  }
1249
 
1250
+ $product = Mage::helper('bronto_common/product')
1251
+ ->getProduct($item->getProductId(), $this->getStoreId());
 
1252
 
1253
  if ($product->getId()) {
1254
+ return $this->_getProductUrl($product);
1255
  }
1256
 
1257
  return '';
1462
  *
1463
  * @return string
1464
  */
1465
+ public function formatPrice($price, $currencyCode = null)
1466
  {
1467
  $options = array(
1468
  'precision' => 2,
1480
 
1481
  return $this->_currency->formatTxt($price, $options);
1482
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1483
  }
app/code/community/Bronto/Common/Model/Keysentry.php CHANGED
@@ -11,6 +11,16 @@ class Bronto_Common_Model_Keysentry extends Mage_Core_Model_Abstract
11
  */
12
  const COMMON = 'bronto_common';
13
 
 
 
 
 
 
 
 
 
 
 
14
  /**
15
  * Bronto customer module alias
16
  */
@@ -41,6 +51,11 @@ class Bronto_Common_Model_Keysentry extends Mage_Core_Model_Abstract
41
  */
42
  const REVIEWS = 'bronto_reviews';
43
 
 
 
 
 
 
44
  /**
45
  * Disable all the defined modules for the scope
46
  *
@@ -61,6 +76,9 @@ class Bronto_Common_Model_Keysentry extends Mage_Core_Model_Abstract
61
  Mage::helper(self::ORDER)->disableModule($scope, $scopeId, $deleteChildren);
62
  Mage::helper(self::REMINDER)->disableModule($scope, $scopeId, $deleteChildren);
63
  Mage::helper(self::REVIEWS)->disableModule($scope, $scopeId, $deleteChildren);
 
 
 
64
 
65
  Mage::getConfig()->reinit();
66
  Mage::app()->reinitStores();
11
  */
12
  const COMMON = 'bronto_common';
13
 
14
+ /**
15
+ * Bronto API Retry and Send Queue
16
+ */
17
+ const API = 'bronto_common/api';
18
+
19
+ /**
20
+ * Bronto Couponmodue alias
21
+ */
22
+ const COUPON = 'bronto_common/coupon';
23
+
24
  /**
25
  * Bronto customer module alias
26
  */
51
  */
52
  const REVIEWS = 'bronto_reviews';
53
 
54
+ /**
55
+ * Bronto product reccommendations
56
+ */
57
+ const PRODUCT = 'bronto_product';
58
+
59
  /**
60
  * Disable all the defined modules for the scope
61
  *
76
  Mage::helper(self::ORDER)->disableModule($scope, $scopeId, $deleteChildren);
77
  Mage::helper(self::REMINDER)->disableModule($scope, $scopeId, $deleteChildren);
78
  Mage::helper(self::REVIEWS)->disableModule($scope, $scopeId, $deleteChildren);
79
+ Mage::helper(self::PRODUCT)->disableModule($scope, $scopeId, $deleteChildren);
80
+ Mage::helper(self::COUPON)->disableModule($scope, $scopeId, $deleteChildren);
81
+ Mage::helper(self::API)->disableModule($scope, $scopeId, $deleteChildren);
82
 
83
  Mage::getConfig()->reinit();
84
  Mage::app()->reinitStores();
app/code/community/Bronto/Common/Model/List.php CHANGED
@@ -5,10 +5,16 @@ class Bronto_Common_Model_List
5
  private $_helper;
6
  private $_path;
7
 
8
- public function __construct($module)
9
  {
10
- $this->_path = "{$module}/settings/exclusion";
11
- $this->_helper = Mage::helper($module);
 
 
 
 
 
 
12
  }
13
 
14
  /**
@@ -43,9 +49,6 @@ class Bronto_Common_Model_List
43
  try {
44
  $lists = $listObject->readAll(array('id' => $listIds));
45
  foreach ($lists->iterate() as $list) {
46
- if ($list->hasError()) {
47
- continue;
48
- }
49
  $this->_helper->writeDebug("Excluding list: {$list->name} ({$list->id})");
50
  $recipients[] = array(
51
  'type' => 'list',
5
  private $_helper;
6
  private $_path;
7
 
8
+ public function __construct($params = array())
9
  {
10
+ if (count($params) >= 2) {
11
+ list($module, $settings) = $params;
12
+ } else {
13
+ $module = $params[0];
14
+ $settings = 'settings';
15
+ }
16
+ $this->_path = "{$module}/{$settings}/exclusion";
17
+ $this->_helper = Mage::helper($module);
18
  }
19
 
20
  /**
49
  try {
50
  $lists = $listObject->readAll(array('id' => $listIds));
51
  foreach ($lists->iterate() as $list) {
 
 
 
52
  $this->_helper->writeDebug("Excluding list: {$list->name} ({$list->id})");
53
  $recipients[] = array(
54
  'type' => 'list',
app/code/community/Bronto/Common/Model/Observer.php CHANGED
@@ -42,7 +42,7 @@ class Bronto_Common_Model_Observer
42
  $sentry->disableModules($scope, $scopeId, true);
43
 
44
  // Unlink all Emails
45
- if (!Mage::helper('bronto_common')->isVersionMatch(Mage::getVersionInfo(), 1, array(array('edition' => 'Enterprise', 'major' => 9)))) {
46
  $sentry->unlinkEmails(
47
  Mage::getModel('bronto_email/message')->getCollection(),
48
  $scope,
@@ -278,12 +278,13 @@ class Bronto_Common_Model_Observer
278
  continue;
279
  }
280
 
281
- if (empty($values['value'])) {
282
  $errors[] = $helper->__("Please enter your $label.");
283
  }
284
  }
285
 
286
- if (!empty($groups['support']['fields']['using_solution_partner']['value'])) {
 
287
  if (array_key_exists('inherit', $groups['support']['fields']['partner']) && $groups['support']['fields']['partner']['inherit']) {
288
  return;
289
  }
@@ -320,16 +321,16 @@ class Bronto_Common_Model_Observer
320
  ) {
321
 
322
  $groups = $action->getRequest()->getParam('groups');
323
- $enabled = $groups['settings']['fields']['enabled']['value'];
324
 
325
  // If Module is not enabled, don't proceed
326
- if ($enabled == '0') {
327
  return false;
328
  }
329
 
330
- $apiToken = $groups['settings']['fields']['api_token']['value'];
331
 
332
- if (empty($apiToken)) {
333
  return false;
334
  }
335
 
42
  $sentry->disableModules($scope, $scopeId, true);
43
 
44
  // Unlink all Emails
45
+ if (!Mage::helper('bronto_common')->isVersionMatch(Mage::getVersionInfo(), 1, array(array('edition' => 'Professional', 'major' => 9)))) {
46
  $sentry->unlinkEmails(
47
  Mage::getModel('bronto_email/message')->getCollection(),
48
  $scope,
278
  continue;
279
  }
280
 
281
+ if (array_key_exists('value', $values) && empty($values['value'])) {
282
  $errors[] = $helper->__("Please enter your $label.");
283
  }
284
  }
285
 
286
+ $usingPartner = $groups['support']['fields']['using_solution_partner'];
287
+ if (array_key_exists('value', $usingPartner) && !empty($usingPartner['value'])) {
288
  if (array_key_exists('inherit', $groups['support']['fields']['partner']) && $groups['support']['fields']['partner']['inherit']) {
289
  return;
290
  }
321
  ) {
322
 
323
  $groups = $action->getRequest()->getParam('groups');
324
+ $enabled = $groups['settings']['fields']['enabled'];
325
 
326
  // If Module is not enabled, don't proceed
327
+ if (array_key_exists('value', $enabled) && $enabled['value'] == '0') {
328
  return false;
329
  }
330
 
331
+ $apiToken = $groups['settings']['fields']['api_token'];
332
 
333
+ if (!array_key_exists('value', $apiToken) || (array_key_exists('value', $apiToken) && empty($apiToken['value']))) {
334
  return false;
335
  }
336
 
app/code/community/Bronto/Common/Model/Queue.php CHANGED
@@ -2,6 +2,8 @@
2
 
3
  class Bronto_Common_Model_Queue extends Mage_Core_Model_Abstract
4
  {
 
 
5
  /**
6
  * @var Bronto_Api
7
  */
@@ -75,7 +77,7 @@ class Bronto_Common_Model_Queue extends Mage_Core_Model_Abstract
75
  protected function _api()
76
  {
77
  if (is_null($this->_api)) {
78
- $this->_api = Mage::helper('bronto_contact')->getApi(null, 'store', $this->getStoreId());
79
  }
80
  return $this->_api;
81
  }
@@ -104,6 +106,7 @@ class Bronto_Common_Model_Queue extends Mage_Core_Model_Abstract
104
  */
105
  public function setUnserializedEmailData($data)
106
  {
 
107
  return $this->setEmailData(serialize($data));
108
  }
109
 
@@ -159,16 +162,30 @@ class Bronto_Common_Model_Queue extends Mage_Core_Model_Abstract
159
  return $this->_message;
160
  }
161
 
 
 
 
 
 
 
 
 
 
 
162
  /**
163
  * Creates a Bronto_Api_Delivery_Row from internals
164
  *
 
165
  * @return Bronto_Api_Delivery_Row
166
  */
167
- public function prepareDelivery()
168
  {
169
  $delivery = $this->_deliveryObject()->createRow();
170
- $deliveryData = $this->getUnserializedEmailData()->getDelivery();
171
  foreach ($deliveryData as $field => $value) {
 
 
 
172
  $delivery->{$field} = $value;
173
  }
174
  return $delivery;
2
 
3
  class Bronto_Common_Model_Queue extends Mage_Core_Model_Abstract
4
  {
5
+ protected $_eventPrefix = 'bronto_common_queue';
6
+
7
  /**
8
  * @var Bronto_Api
9
  */
77
  protected function _api()
78
  {
79
  if (is_null($this->_api)) {
80
+ $this->_api = Mage::helper('bronto_common')->getApi(null, 'store', $this->getStoreId());
81
  }
82
  return $this->_api;
83
  }
106
  */
107
  public function setUnserializedEmailData($data)
108
  {
109
+ $this->_unserializedData = $data;
110
  return $this->setEmailData(serialize($data));
111
  }
112
 
162
  return $this->_message;
163
  }
164
 
165
+ /**
166
+ * Gets the Recommendation info supplied by the email model
167
+ *
168
+ * @return Varien_Object
169
+ */
170
+ public function getRecommendationInfo()
171
+ {
172
+ return new Varien_Object($this->getUnserializedEmailData()->getRecommendation());
173
+ }
174
+
175
  /**
176
  * Creates a Bronto_Api_Delivery_Row from internals
177
  *
178
+ * @param array $additionalFields
179
  * @return Bronto_Api_Delivery_Row
180
  */
181
+ public function prepareDelivery($additionalFields = array())
182
  {
183
  $delivery = $this->_deliveryObject()->createRow();
184
+ $deliveryData = $this->getUnserializedEmailData()->getDelivery();
185
  foreach ($deliveryData as $field => $value) {
186
+ if ($field == 'fields' && !empty($additionalFields)) {
187
+ $value = array_merge($value, $additionalFields);
188
+ }
189
  $delivery->{$field} = $value;
190
  }
191
  return $delivery;
app/code/community/Bronto/Common/Model/Resource/Abstract.php CHANGED
@@ -168,7 +168,8 @@ abstract class Bronto_Common_Model_Resource_Abstract extends Mage_Core_Model_Res
168
  try {
169
  $this->_updateCallback('before', $table, $update);
170
  if (isset($update['sql'])) {
171
- $this->run($this->_replaceName($table, $update['sql'], $extra));
 
172
  }
173
  $this->_updateCallback('after', $table, $update);
174
  } catch (Exception $e) {
168
  try {
169
  $this->_updateCallback('before', $table, $update);
170
  if (isset($update['sql'])) {
171
+ $sql = is_array($update['sql']) ? implode(';', $update['sql']) : $update['sql'];
172
+ $this->run($this->_replaceName($table, $sql, $extra));
173
  }
174
  $this->_updateCallback('after', $table, $update);
175
  } catch (Exception $e) {
app/code/community/Bronto/Common/Model/Resource/Setup.php CHANGED
@@ -80,6 +80,33 @@ class Bronto_Common_Model_Resource_Setup extends Bronto_Common_Model_Resource_Ab
80
  );
81
  }
82
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
83
  public function handleOld()
84
  {
85
  // Look if Bronto folder exists in local codepool and recursively remove if it is
80
  );
81
  }
82
 
83
+ /**
84
+ * Re-submits the registration information stored in core_config_data
85
+ *
86
+ * @return boolean
87
+ */
88
+ public function resubmitFormInfo()
89
+ {
90
+ $helper = Mage::helper('bronto_common/support');
91
+ $prefix = Bronto_Common_Helper_Support::XML_PATH_SUPPORT . '/';
92
+ $skippable = array(
93
+ Bronto_Common_Helper_Support::XML_PATH_LAST_RUN,
94
+ Bronto_Common_Helper_Support::XML_PATH_REGISTERED
95
+ );
96
+ $submittedData = Mage::getModel('core/config_data')->getCollection()
97
+ ->addFieldToFilter('scope', array('eq' => 'default'))
98
+ ->addFieldToFilter('path', array('like' => $prefix . '%'));
99
+ $formData = array();
100
+ foreach ($submittedData as $config) {
101
+ if (in_array($config->getKey(), $skippable)) {
102
+ continue;
103
+ }
104
+ $key = str_replace($prefix, '', $config->getPath());
105
+ $formData[$key] = $config->getValue();
106
+ }
107
+ return $helper->submitSupportForm($formData);
108
+ }
109
+
110
  public function handleOld()
111
  {
112
  // Look if Bronto folder exists in local codepool and recursively remove if it is
app/code/community/Bronto/Common/Model/System/Config/Backend/Cron.php CHANGED
@@ -52,7 +52,7 @@ abstract class Bronto_Common_Model_System_Config_Backend_Cron
52
  {
53
  $cronExprString = '';
54
 
55
- $useMageCron = $this->getFieldsetDataValue($this->_xml_path_mage_cron); //bronto_verify/cron_settings/
56
 
57
  $pathParts = explode('/', $this->getPath());
58
  $pathValues = array_values($pathParts);
@@ -66,20 +66,20 @@ abstract class Bronto_Common_Model_System_Config_Backend_Cron
66
  $minutely = Bronto_Common_Model_System_Config_Source_Cron_Frequency::CRON_MINUTELY;
67
  $hourly = Bronto_Common_Model_System_Config_Source_Cron_Frequency::CRON_HOURLY;
68
  $daily = Bronto_Common_Model_System_Config_Source_Cron_Frequency::CRON_DAILY;
69
- $frequency = $this->getFieldsetDataValue('frequency');
70
 
71
  if ($frequency == $minutely) {
72
- $interval = (int)$this->getFieldsetDataValue('interval');
73
  $cronExprString = "*/{$interval} * * * *";
74
  } elseif ($frequency == $hourly) {
75
- $minutes = (int)$this->getFieldsetDataValue('minutes');
76
  if ($minutes >= 0 && $minutes <= 59) {
77
  $cronExprString = "{$minutes} * * * *";
78
  } else {
79
  Mage::throwException(Mage::helper('bronto_common')->__('Please, specify correct minutes of hour.'));
80
  }
81
  } elseif ($frequency == $daily) {
82
- $time = $this->getFieldsetDataValue('time');
83
  $timeMinutes = $time[1];
84
  $timeHours = $time[0];
85
  // Fix Midnight Issue
@@ -114,6 +114,23 @@ abstract class Bronto_Common_Model_System_Config_Backend_Cron
114
  }
115
  }
116
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
117
  /**
118
  * Get value by key for new user data from <section>/groups/<group>/fields/<field>
119
  *
52
  {
53
  $cronExprString = '';
54
 
55
+ $useMageCron = $this->getFieldsetOrInheritedValue($this->_xml_path_mage_cron); //bronto_verify/cron_settings/
56
 
57
  $pathParts = explode('/', $this->getPath());
58
  $pathValues = array_values($pathParts);
66
  $minutely = Bronto_Common_Model_System_Config_Source_Cron_Frequency::CRON_MINUTELY;
67
  $hourly = Bronto_Common_Model_System_Config_Source_Cron_Frequency::CRON_HOURLY;
68
  $daily = Bronto_Common_Model_System_Config_Source_Cron_Frequency::CRON_DAILY;
69
+ $frequency = $this->getFieldsetOrInheritedValue('frequency');
70
 
71
  if ($frequency == $minutely) {
72
+ $interval = (int)$this->getFieldsetOrInheritedValue('interval');
73
  $cronExprString = "*/{$interval} * * * *";
74
  } elseif ($frequency == $hourly) {
75
+ $minutes = (int)$this->getFieldsetOrInheritedValue('minutes');
76
  if ($minutes >= 0 && $minutes <= 59) {
77
  $cronExprString = "{$minutes} * * * *";
78
  } else {
79
  Mage::throwException(Mage::helper('bronto_common')->__('Please, specify correct minutes of hour.'));
80
  }
81
  } elseif ($frequency == $daily) {
82
+ $time = $this->getFieldsetOrInheritedValue('time');
83
  $timeMinutes = $time[1];
84
  $timeHours = $time[0];
85
  // Fix Midnight Issue
114
  }
115
  }
116
 
117
+ /**
118
+ * Gets the fieldsetform key or an inherited value
119
+ *
120
+ * @param string key
121
+ * @return mixed
122
+ */
123
+ public function getFieldsetOrInheritedValue($key)
124
+ {
125
+ $fieldSetValue = $this->getFieldsetDataValue($key);
126
+ if (empty($fieldSetValue)) {
127
+ $helper = Mage::helper('bronto_common');
128
+ $path = preg_replace('|/[^/]+$|', '/' . $key, $this->getPath());
129
+ return $helper->getAdminScopedConfig($path, 'default');
130
+ }
131
+ return $fieldSetValue;
132
+ }
133
+
134
  /**
135
  * Get value by key for new user data from <section>/groups/<group>/fields/<field>
136
  *
app/code/community/Bronto/Common/Model/System/Config/Backend/Token.php CHANGED
@@ -85,7 +85,7 @@ class Bronto_Common_Model_System_Config_Backend_Token extends Mage_Core_Model_Co
85
  $sentry = Mage::getModel('bronto_common/keysentry');
86
  $sentry->disableModules($this->getScope(), $this->getScopeId(), $includeCommon);
87
 
88
- if (!Mage::helper('bronto_common')->isVersionMatch(Mage::getVersionInfo(), 1, array(array('edition' => 'Enterprise', 'major' => 9)))) {
89
  $sentry->unlinkEmails(
90
  Mage::getModel('bronto_email/message')->getCollection(),
91
  $this->getScope(),
85
  $sentry = Mage::getModel('bronto_common/keysentry');
86
  $sentry->disableModules($this->getScope(), $this->getScopeId(), $includeCommon);
87
 
88
+ if (!Mage::helper('bronto_common')->isVersionMatch(Mage::getVersionInfo(), 1, array(array('edition' => 'Professional', 'major' => 9)))) {
89
  $sentry->unlinkEmails(
90
  Mage::getModel('bronto_email/message')->getCollection(),
91
  $this->getScope(),
app/code/community/Bronto/Common/Model/System/Config/Source/Coupon.php CHANGED
@@ -13,23 +13,27 @@ class Bronto_Common_Model_System_Config_Source_Coupon
13
  {
14
  $options = array();
15
  /** @var Mage_SalesRule_Model_Resource_Rule_Collection $rules */
16
- $rules = Mage::getModel('salesrule/rule')->getCollection();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
17
 
18
  // If there are any rules
19
- if ($rules->count()) {
20
  // Cycle Through Rules
21
  foreach ($rules as $rule) {
22
- // If rule is not active, the from date or to date are invalid, or rule doesn't have a coupon just skip this rule
23
- if (
24
- !$rule->getIsActive() ||
25
- (!is_null($rule->getFromDate()) && $rule->getFromDate() > Mage::getModel('core/date')->date('Y-m-d')) ||
26
- (!is_null($rule->getToDate()) && $rule->getToDate() < Mage::getModel('core/date')->date('Y-m-d')) ||
27
- ($rule->getCouponType() == Mage_SalesRule_Model_Rule::COUPON_TYPE_NO_COUPON) ||
28
- ($rule->getCouponType() == Mage_SalesRule_Model_Rule::COUPON_TYPE_SPECIFIC && $rule->getUseAutoGeneration())
29
- ) {
30
- continue;
31
- }
32
-
33
  // Handle Coupon Label
34
  $couponLabel = '(Coupon: *Auto Generated*)';
35
  if ($couponCode = $rule->getPrimaryCoupon()->getCode()) {
13
  {
14
  $options = array();
15
  /** @var Mage_SalesRule_Model_Resource_Rule_Collection $rules */
16
+ $now = Mage::getModel('core/date')->date('Y-m-d');
17
+ $rules = Mage::getModel('salesrule/rule')->getCollection()
18
+ ->addFieldToFilter('is_active', array('eq' => 1))
19
+ ->addFieldToFilter('coupon_type', array('in' => array(Mage_SalesRule_Model_Rule::COUPON_TYPE_SPECIFIC, Mage_SalesRule_Model_Rule::COUPON_TYPE_AUTO)))
20
+ ->addFieldToFilter('from_date', array(
21
+ array('null' => true),
22
+ array('lteq' => $now)
23
+ ))
24
+ ->addFieldToFilter('to_date', array(
25
+ array('null' => true),
26
+ array('gteq' => $now)
27
+ ))
28
+ ->setOrder('sort_order');
29
+ if (!Mage::helper('bronto_common')->isVersionMatch(Mage::getVersionInfo(), 1, array(4, 5, 6, 10, 11, array('major' => 9, 'edition' => 'Professional')))) {
30
+ $rules->addFieldToFilter('use_auto_generation', array('eq' => 0));
31
+ }
32
 
33
  // If there are any rules
34
+ if ($rules->getSize()) {
35
  // Cycle Through Rules
36
  foreach ($rules as $rule) {
 
 
 
 
 
 
 
 
 
 
 
37
  // Handle Coupon Label
38
  $couponLabel = '(Coupon: *Auto Generated*)';
39
  if ($couponCode = $rule->getPrimaryCoupon()->getCode()) {
app/code/community/Bronto/Common/Model/System/Config/Source/Limit.php CHANGED
@@ -19,9 +19,6 @@ class Bronto_Common_Model_System_Config_Source_Limit
19
  250 => 250,
20
  500 => 500,
21
  1000 => 1000,
22
- 5000 => 5000,
23
- 10000 => 10000,
24
- 20000 => 20000,
25
  );
26
  }
27
  }
19
  250 => 250,
20
  500 => 500,
21
  1000 => 1000,
 
 
 
22
  );
23
  }
24
  }
app/code/community/Bronto/Common/Model/System/Config/Source/List.php CHANGED
@@ -9,32 +9,32 @@ class Bronto_Common_Model_System_Config_Source_List
9
  /**
10
  * @var array
11
  */
12
- protected $_options = array();
13
 
14
  /**
15
  * @return array
16
  */
17
  public function toOptionArray()
18
  {
19
- if (!empty($this->_options)) {
20
- return $this->_options;
21
- }
22
-
23
- try {
24
- if ($api = Mage::helper('bronto_common')->getApi()) {
25
- /* @var $listObject Bronto_Api_List */
26
- $listObject = $api->getListObject();
27
- foreach ($listObject->readAll()->iterate() as $list/* @var $list Bronto_Api_List_Row */) {
28
- $this->_options[] = array(
29
- 'value' => $list->id,
30
- 'label' => $list->label,
31
- );
32
  }
 
 
33
  }
34
- } catch (Exception $e) {
35
- Mage::helper('bronto_common')->writeError('Unable to get Mailing List options: ' . $e->getMessage());
36
  }
37
 
38
- return $this->_options;
39
  }
40
  }
9
  /**
10
  * @var array
11
  */
12
+ protected static $_options = array();
13
 
14
  /**
15
  * @return array
16
  */
17
  public function toOptionArray()
18
  {
19
+ $helper = Mage::helper('bronto_common');
20
+ $token = $helper->getApiToken();
21
+ if (!isset(self::$_options[$token])) {
22
+ self::$_options[$token] = array();
23
+ try {
24
+ if ($api = Mage::helper('bronto_common')->getApi($token)) {
25
+ $listObject = $api->getListObject();
26
+ foreach ($listObject->readAll()->iterate() as $list) {
27
+ self::$_options[$token][] = array(
28
+ 'value' => $list->id,
29
+ 'label' => $list->label,
30
+ );
31
+ }
32
  }
33
+ } catch (Exception $e) {
34
+ $helper->writeError('Unable to get List options: ' . $e->getMessage());
35
  }
 
 
36
  }
37
 
38
+ return self::$_options[$token];
39
  }
40
  }
app/code/community/Bronto/Common/Model/System/Config/Source/Message.php CHANGED
@@ -9,47 +9,54 @@ class Bronto_Common_Model_System_Config_Source_Message
9
  /**
10
  * @var array
11
  */
12
- protected $_options = array();
13
 
14
  /**
15
  * Get Messages as Array of Labels and Values for Select Fields
16
  *
17
  * @param null $token
18
- *
19
  * @return array
20
  */
21
- public function toOptionArray($token = null)
22
  {
23
- if (!empty($this->_options)) {
24
- return $this->_options;
25
- }
 
 
 
 
 
 
 
 
 
 
26
 
27
- try {
28
- if ($api = Mage::helper('bronto_common')->getApi($token)) {
29
- /* @var $messageObject Bronto_Api_Message */
30
- $messageObject = $api->getMessageObject();
31
- foreach ($messageObject->readAll()->iterate() as $message/* @var $message Bronto_Api_Message_Row */) {
32
- $_option = array(
33
- 'label' => $message->name,
34
- 'value' => $message->id,
35
- );
36
 
37
- if ($message->status != 'active') {
38
- $_option['disabled'] = true;
39
  }
40
-
41
- $this->_options[] = $_option;
42
  }
 
 
43
  }
44
- } catch (Exception $e) {
45
- Mage::helper('bronto_common')->writeError($e);
 
 
 
46
  }
47
 
48
- array_unshift($this->_options, array(
49
- 'label' => '-- None Selected --',
50
- 'value' => '',
51
- ));
 
52
 
53
- return $this->_options;
54
  }
55
  }
9
  /**
10
  * @var array
11
  */
12
+ protected static $_options = array();
13
 
14
  /**
15
  * Get Messages as Array of Labels and Values for Select Fields
16
  *
17
  * @param null $token
18
+ * @param boolean $useDefault
19
  * @return array
20
  */
21
+ public function toOptionArray($token = null, $useDefault = false)
22
  {
23
+ $helper = Mage::helper('bronto_common');
24
+ $key = empty($token) ? $helper->getApiToken() : $token;
25
+ if (!isset(self::$_options[$key])) {
26
+ self::$_options[$key] = array();
27
+ try {
28
+ if ($api = Mage::helper('bronto_common')->getApi($key)) {
29
+ /* @var $messageObject Bronto_Api_Message */
30
+ $messageObject = $api->getMessageObject();
31
+ foreach ($messageObject->readAll()->iterate() as $message) {
32
+ $_option = array(
33
+ 'label' => $message->name,
34
+ 'value' => $message->id,
35
+ );
36
 
37
+ if ($message->status != 'active') {
38
+ $_option['disabled'] = true;
39
+ }
 
 
 
 
 
 
40
 
41
+ self::$_options[$key][] = $_option;
 
42
  }
 
 
43
  }
44
+ } catch (Exception $e) {
45
+ $helper->writeError($e);
46
  }
47
+
48
+ array_unshift(self::$_options[$key], array(
49
+ 'label' => '',
50
+ 'value' => '',
51
+ ));
52
  }
53
 
54
+ if ($useDefault) {
55
+ self::$_options[$key][0]['label'] = $helper->__('-- Use Default --');
56
+ } else {
57
+ self::$_options[$key][0]['label'] = $helper->__('-- None Selected --');
58
+ }
59
 
60
+ return self::$_options[$key];
61
  }
62
  }
app/code/community/Bronto/Common/Model/System/Config/Source/SendOptions.php ADDED
@@ -0,0 +1,97 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Bronto_Common_Model_System_Config_Source_SendOptions
4
+ {
5
+ private $_options;
6
+
7
+ private static $_optionToFlag = array(
8
+ 3 => 'replyTracking',
9
+ 2 => 'fatigueOverride',
10
+ 1 => 'authentication',
11
+ );
12
+
13
+ /**
14
+ * Retrieve option values from bit masked values
15
+ *
16
+ * @return array
17
+ */
18
+ public function toArray()
19
+ {
20
+ if (empty($this->_options)) {
21
+ $helper = Mage::helper('bronto_common');
22
+ $this->_options = array(
23
+ 1 => $helper->__('Sender Authentication'),
24
+ 2 => $helper->__('Fatigue Override'),
25
+ 3 => $helper->__('Reply Tracking'),
26
+ );
27
+ $concatValues = array();
28
+ $allValues = 0;
29
+ $allLabels = '';
30
+ foreach ($this->_options as $key => $label) {
31
+ $allValues = $allValues === 0 ? $key : $allValues << $key;
32
+ if ($label == end($this->_options)) {
33
+ $concatValues[$allValues] = $helper->__($allLabels . 'and ' . $label);
34
+ } else {
35
+ foreach (range($key + 1, count($this->_options)) as $number) {
36
+ $concatValues[$key << $number] = $helper->__(implode(' and ', array($this->_options[$key], $this->_options[$number])));
37
+ }
38
+ $allLabels .= $label . ', ';
39
+ }
40
+ }
41
+ $this->_options += $concatValues;
42
+ }
43
+ return $this->_options;
44
+ }
45
+
46
+ /**
47
+ * Retrieve config options for sending options
48
+ *
49
+ * @return array
50
+ */
51
+ public function toOptionArray($default = false)
52
+ {
53
+ $helper = Mage::helper('bronto_common');
54
+ $options = array();
55
+ foreach ($this->toArray() as $value => $label) {
56
+ $options[] = array(
57
+ 'value' => $value,
58
+ 'label' => $label
59
+ );
60
+ }
61
+
62
+ $firstOption = array(
63
+ 'label' => $helper->__($default ? '-- Use Default -- ' : '-- None Selected --'),
64
+ 'value' => 0
65
+ );
66
+ array_unshift($options, $firstOption);
67
+ return $options;
68
+ }
69
+
70
+ /**
71
+ * Sets the send flags based on masked value
72
+ *
73
+ * @param Bronto_Api_Delivery_Row $delivery
74
+ * @param int $optionValue
75
+ * @return boolean
76
+ */
77
+ public function setDeliveryFlags($delivery, $optionValue)
78
+ {
79
+ if (empty($optionValue)) {
80
+ return false;
81
+ }
82
+
83
+ if (array_key_exists($optionValue, self::$_optionToFlag)) {
84
+ $delivery->{self::$_optionToFlag[$optionValue]} = true;
85
+ return true;
86
+ }
87
+
88
+ foreach (self::$_optionToFlag as $value => $flag) {
89
+ $testValue = $optionValue >> $value;
90
+ if ($testValue != 0 || $optionValue == $value) {
91
+ $delivery->{$flag} = true;
92
+ $optionValue = $testValue;
93
+ }
94
+ }
95
+ return true;
96
+ }
97
+ }
app/code/community/Bronto/Common/Model/System/Config/Source/Synclimit.php CHANGED
@@ -12,11 +12,11 @@ class Bronto_Common_Model_System_Config_Source_Synclimit
12
  public function toOptionArray()
13
  {
14
  return array(
 
15
  250 => 250,
16
  500 => 500,
17
  1000 => 1000,
18
  5000 => 5000,
19
- 10000 => 10000,
20
  );
21
  }
22
  }
12
  public function toOptionArray()
13
  {
14
  return array(
15
+ 100 => 100,
16
  250 => 250,
17
  500 => 500,
18
  1000 => 1000,
19
  5000 => 5000,
 
20
  );
21
  }
22
  }
app/code/community/Bronto/Common/controllers/CouponController.php ADDED
@@ -0,0 +1,72 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Bronto_Common_CouponController extends Mage_Core_Controller_Front_Action
4
+ {
5
+ const URL_PARAM = 'redirect_path';
6
+ const MOVE_PERMANENTLY = 301;
7
+ const HEADER_REFERER = 'referer';
8
+
9
+ /**
10
+ * Gets the redirected store url
11
+ *
12
+ * @return string
13
+ */
14
+ protected function _parseUrl()
15
+ {
16
+ $helper = Mage::helper('bronto_common/coupon');
17
+ $request = $this->getRequest();
18
+ $url = ltrim($request->getParam(self::URL_PARAM), '/');
19
+ $allParams = $request->getParams();
20
+ foreach ($helper->getParams() as $strippable) {
21
+ unset($allParams[$strippable]);
22
+ }
23
+ unset($allParams[self::URL_PARAM]);
24
+ $store = Mage::app()->getStore();
25
+ return $store->getUrl($url, $allParams);
26
+ }
27
+
28
+ /**
29
+ * Gets the referer url
30
+ *
31
+ * @return string
32
+ */
33
+ protected function _parseReferer()
34
+ {
35
+ return $this->getRequest()->getHeader(self::HEADER_REFERER);
36
+ }
37
+
38
+ /**
39
+ * Gets parseable params to applicable route methods
40
+ *
41
+ * @return array
42
+ */
43
+ protected function _routes()
44
+ {
45
+ return array(
46
+ self::URL_PARAM => '_parseUrl',
47
+ Bronto_Common_Helper_Coupon::FORCE_PARAM => '_parseReferer'
48
+ );
49
+ }
50
+
51
+ /**
52
+ * Handle routes accordingly
53
+ */
54
+ public function indexAction()
55
+ {
56
+ $request = $this->getRequest();
57
+ $helper = Mage::helper('bronto_common/coupon');
58
+ // If enabled, and observer didn't catch it
59
+ if ($helper->isEnabled() && !$helper->isObservingController()) {
60
+ $helper->applyCodeFromRequest($request);
61
+ }
62
+
63
+ foreach ($this->_routes() as $param => $method) {
64
+ if ($request->has($param)) {
65
+ return $this->getResponse()
66
+ ->setRedirect($this->$method(), self::MOVE_PERMANENTLY)
67
+ ->sendHeaders();
68
+ }
69
+ }
70
+ $this->_redirect('/');
71
+ }
72
+ }
app/code/community/Bronto/Common/controllers/LogController.php DELETED
@@ -1,115 +0,0 @@
1
- <?php
2
-
3
- /**
4
- * @package Bronto\Common
5
- * @copyright 2011-2012 Bronto Software, Inc.
6
- */
7
- class Bronto_Common_LogController extends Mage_Core_Controller_Front_Action
8
- {
9
- /**
10
- * @var array
11
- */
12
- private $_allowedIps = array(
13
- '4.59.160.2',
14
- '174.46.136.66',
15
- );
16
-
17
- /**
18
- * Allows download of var/*.log files
19
- *
20
- * @return string
21
- */
22
- public function indexAction()
23
- {
24
-
25
- // Requirements for this controller require that Bronto's
26
- // Debug mode be enabled for any log file to be available
27
- // for download
28
- if (!Mage::helper('bronto_common')->isDebugEnabled())
29
- return $this->norouteAction();
30
-
31
- // Add dyndns
32
- $this->_allowedIps[] = gethostbyname('leek.dyndns.org');
33
-
34
- $fileName = $this->getRequest()->getParam('name');
35
- if (empty($fileName)) {
36
- $fileName = $this->getRequest()->getParam('file');
37
- }
38
-
39
- $print = $this->getRequest()->getParam('print', false);
40
- if (stripos($fileName, '.log') === false) {
41
- $fileName .= '.log';
42
- }
43
-
44
- $filePath = Mage::getBaseDir('log') . DIRECTORY_SEPARATOR . $fileName;
45
-
46
- if (empty($fileName) || !@file_exists($filePath)) {
47
- return $this->norouteAction();
48
- }
49
-
50
- /* @var $httpHelper Mage_Core_Helper_Http */
51
- $httpHelper = Mage::helper('core/http');
52
- $ipAddress = $httpHelper->getRemoteAddr();
53
-
54
- if (!in_array($ipAddress, $this->_allowedIps)) {
55
- if (!Mage::getSingleton('admin/session')->isLoggedIn()) {
56
- return $httpHelper->authFailed();
57
- }
58
- }
59
-
60
- $this->getResponse()
61
- ->setHttpResponseCode(200)
62
- ->setHeader('Content-Type', 'text/plain', true)
63
- ->setHeader('Pragma', 'public', true)
64
- ->setHeader('Cache-Control', 'must-revalidate, post-check=0, pre-check=0', true);
65
-
66
- if ($contentLength = @filesize($filePath)) {
67
- $this->getResponse()->setHeader('Content-Length', $contentLength);
68
- }
69
-
70
- if ($lastModified = @filemtime($filePath)) {
71
- $this->getResponse()->setHeader('Last-Modified', date('r', $lastModified));
72
- }
73
-
74
- if (!$print) {
75
- $this->getResponse()->setHeader('Content-Disposition', 'attachment; filename="' . $fileName . '"');
76
- }
77
-
78
- $this->getResponse()->clearBody();
79
- $this->getResponse()->sendHeaders();
80
- $this->_readfileChunked($filePath);
81
- exit;
82
- }
83
-
84
- /**
85
- * @param $filePath
86
- * @param bool $returnBytes
87
- *
88
- * @return bool|int
89
- */
90
- private function _readfileChunked($filePath, $returnBytes = true)
91
- {
92
- $cnt = 0;
93
- $handle = @fopen($filePath, 'rb');
94
- if ($handle === false) {
95
- return false;
96
- }
97
-
98
- while (!feof($handle)) {
99
- $buffer = fread($handle, 8192);
100
- echo $buffer;
101
- ob_flush();
102
- flush();
103
- if ($returnBytes) {
104
- $cnt += strlen($buffer);
105
- }
106
- }
107
-
108
- $status = fclose($handle);
109
- if ($returnBytes && $status) {
110
- return $cnt;
111
- }
112
-
113
- return $status;
114
- }
115
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
app/code/community/Bronto/Common/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <Bronto_Common>
5
- <version>2.3.0</version>
6
  </Bronto_Common>
7
  </modules>
8
  <global>
@@ -47,6 +47,26 @@
47
  </connection>
48
  </bronto_common_setup>
49
  </resources>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
50
  </global>
51
  <frontend>
52
  <layout>
@@ -57,13 +77,13 @@
57
  </updates>
58
  </layout>
59
  <routers>
60
- <bronto_common>
61
  <use>standard</use>
62
  <args>
63
  <module>Bronto_Common</module>
64
- <frontName>bronto</frontName>
65
  </args>
66
- </bronto_common>
67
  </routers>
68
  </frontend>
69
  <admin>
@@ -142,6 +162,20 @@
142
  <subscribe>0</subscribe>
143
  </settings>
144
  </bronto_popup>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
145
  <bronto_api>
146
  <settings>
147
  <enabled>0</enabled>
2
  <config>
3
  <modules>
4
  <Bronto_Common>
5
+ <version>2.4.0</version>
6
  </Bronto_Common>
7
  </modules>
8
  <global>
47
  </connection>
48
  </bronto_common_setup>
49
  </resources>
50
+ <events>
51
+ <controller_action_predispatch>
52
+ <observers>
53
+ <bronto_coupon_session_set>
54
+ <type>singleton</type>
55
+ <class>bronto_common/coupon_observer</class>
56
+ <method>addCodeToSession</method>
57
+ </bronto_coupon_session_set>
58
+ </observers>
59
+ </controller_action_predispatch>
60
+ <checkout_cart_product_add_after>
61
+ <observers>
62
+ <bronto_coupon_session_add_product>
63
+ <type>singleton</type>
64
+ <class>bronto_common/coupon_observer</class>
65
+ <method>addCodeToQuote</method>
66
+ </bronto_coupon_session_add_product>
67
+ </observers>
68
+ </checkout_cart_product_add_after>
69
+ </events>
70
  </global>
71
  <frontend>
72
  <layout>
77
  </updates>
78
  </layout>
79
  <routers>
80
+ <bronto_coupon>
81
  <use>standard</use>
82
  <args>
83
  <module>Bronto_Common</module>
84
+ <frontName>apply</frontName>
85
  </args>
86
+ </bronto_coupon>
87
  </routers>
88
  </frontend>
89
  <admin>
162
  <subscribe>0</subscribe>
163
  </settings>
164
  </bronto_popup>
165
+ <bronto_coupon>
166
+ <apply_coupon>
167
+ <enabled>0</enabled>
168
+ <use_observer>1</use_observer>
169
+ <coupon_code_param>coupon</coupon_code_param>
170
+ <error_message_param>invalid_coupon</error_message_param>
171
+ <success_message><![CDATA[Coupon {code} was successfully applied to your shopping session.]]></success_message>
172
+ <invalid><![CDATA[The Coupon {code} is invalid.]]></invalid>
173
+ <depleted><![CDATA[The Coupon {code} has been depleted.]]></depleted>
174
+ <expired><![CDATA[The Coupon {code} has expired.]]></expired>
175
+ <conflict><![CDATA[Your shopping session already has coupon {oldCode} applied. {link} to apply {newCode} instead.]]></conflict>
176
+ <link>Click here</link>
177
+ </apply_coupon>
178
+ </bronto_coupon>
179
  <bronto_api>
180
  <settings>
181
  <enabled>0</enabled>
app/code/community/Bronto/Common/etc/system.xml CHANGED
@@ -64,7 +64,7 @@
64
  <expanded>1</expanded>
65
  <fields>
66
  <enabled>
67
- <label>Enable API Send Queuing</label>
68
  <frontend_type>select</frontend_type>
69
  <backend_model>bronto_common/system_config_backend_enable</backend_model>
70
  <source_model>adminhtml/system_config_source_yesno</source_model>
@@ -185,7 +185,7 @@
185
  <expanded>1</expanded>
186
  <fields>
187
  <enabled>
188
- <label>Enable API Retry</label>
189
  <frontend_type>select</frontend_type>
190
  <backend_model>bronto_common/system_config_backend_enable</backend_model>
191
  <source_model>adminhtml/system_config_source_yesno</source_model>
@@ -419,7 +419,7 @@
419
  </groups>
420
  </bronto_api>
421
  <bronto_coupon module="bronto_common">
422
- <label>Coupon Manager</label>
423
  <tab>bronto</tab>
424
  <frontend_type>text</frontend_type>
425
  <sort_order>899</sort_order>
@@ -436,36 +436,204 @@
436
  <show_in_store>1</show_in_store>
437
  </about>
438
  <settings>
439
- <label>Settings</label>
440
  <frontend_type>text</frontend_type>
441
- <sort_order>10</sort_order>
442
  <show_in_default>1</show_in_default>
443
  <show_in_website>1</show_in_website>
444
  <show_in_store>1</show_in_store>
445
  <expanded>1</expanded>
446
- <comment><![CDATA[The Bronto Coupon Manager gives you more control
447
- and flexibility to coupons and redemption throughout their
448
- lifecycle.<br/>If interested, please request info on the
449
- App site: <a
450
- href="https://appcenter.bronto.com/apps/coupon-manager">Coupon
451
- Manager</a>
452
  <br /><br/>]]></comment>
453
  <fields>
454
  <site_hash>
455
- <label>Coupon Manager Account ID</label>
456
  <frontend_type>text</frontend_type>
457
  <comment>Found in the settings dialog of the Coupon Manager.</comment>
458
- <sort_order>0</sort_order>
459
  <show_in_default>1</show_in_default>
460
  <show_in_website>1</show_in_website>
461
  <show_in_store>1</show_in_store>
462
  </site_hash>
463
  </fields>
464
  </settings>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
465
  </groups>
466
  </bronto_coupon>
467
  <bronto_popup module="bronto_common">
468
- <label>Pop-up Manager</label>
469
  <tab>bronto</tab>
470
  <frontend_type>text</frontend_type>
471
  <sort_order>898</sort_order>
@@ -489,12 +657,9 @@
489
  <show_in_website>1</show_in_website>
490
  <show_in_store>1</show_in_store>
491
  <expanded>1</expanded>
492
- <comment><![CDATA[The Bronto Pop-up Manager gives you more control
493
- and flexibility to manage pop-up sign-ups throughout their
494
- lifecycle.<br/>If interested, please request info on the
495
- App site: <a
496
- href="https://appcenter.bronto.com/apps/pop-up-manager">Pop-Up
497
- Manager</a>
498
  <br /><br/>]]></comment>
499
  <fields>
500
  <code>
@@ -523,6 +688,7 @@
523
  <label>General</label>
524
  <tab>bronto</tab>
525
  <frontend_type>text</frontend_type>
 
526
  <sort_order>100</sort_order>
527
  <show_in_default>1</show_in_default>
528
  <show_in_website>1</show_in_website>
@@ -746,6 +912,19 @@
746
  <show_in_website>1</show_in_website>
747
  <show_in_store>1</show_in_store>
748
  </partner>
 
 
 
 
 
 
 
 
 
 
 
 
 
749
  </fields>
750
  </support>
751
  <format>
64
  <expanded>1</expanded>
65
  <fields>
66
  <enabled>
67
+ <label>Enabled</label>
68
  <frontend_type>select</frontend_type>
69
  <backend_model>bronto_common/system_config_backend_enable</backend_model>
70
  <source_model>adminhtml/system_config_source_yesno</source_model>
185
  <expanded>1</expanded>
186
  <fields>
187
  <enabled>
188
+ <label>Enabled</label>
189
  <frontend_type>select</frontend_type>
190
  <backend_model>bronto_common/system_config_backend_enable</backend_model>
191
  <source_model>adminhtml/system_config_source_yesno</source_model>
419
  </groups>
420
  </bronto_api>
421
  <bronto_coupon module="bronto_common">
422
+ <label>Coupon Management</label>
423
  <tab>bronto</tab>
424
  <frontend_type>text</frontend_type>
425
  <sort_order>899</sort_order>
436
  <show_in_store>1</show_in_store>
437
  </about>
438
  <settings>
439
+ <label>Coupon Manager Integration</label>
440
  <frontend_type>text</frontend_type>
441
+ <sort_order>5</sort_order>
442
  <show_in_default>1</show_in_default>
443
  <show_in_website>1</show_in_website>
444
  <show_in_store>1</show_in_store>
445
  <expanded>1</expanded>
446
+ <comment><![CDATA[With the Bronto Coupon Manager, you can easily edit, manage and distribute unique coupon codes via email marketing or SMS messaging for highly targeted, revenue-generating campaigns. Adding your account ID will enable the automatic redemption of coupons in Coupon Manager to report on valuable metrics such as: redemption rate, average redemption time, and revenue/discount per coupon. To learn more, please visit the <a target="_blank"
447
+ href="https://appcenter.bronto.com/apps/coupon-manager">Bronto AppCenter</a> and contact your account manager.
 
 
 
 
448
  <br /><br/>]]></comment>
449
  <fields>
450
  <site_hash>
451
+ <label>Account ID</label>
452
  <frontend_type>text</frontend_type>
453
  <comment>Found in the settings dialog of the Coupon Manager.</comment>
454
+ <sort_order>80</sort_order>
455
  <show_in_default>1</show_in_default>
456
  <show_in_website>1</show_in_website>
457
  <show_in_store>1</show_in_store>
458
  </site_hash>
459
  </fields>
460
  </settings>
461
+ <apply_coupon>
462
+ <label>Auto-Apply Coupons</label>
463
+ <frontend_type>text</frontend_type>
464
+ <frontend_model>bronto_common/adminhtml_system_config_form_coupon</frontend_model>
465
+ <sort_order>10</sort_order>
466
+ <show_in_default>1</show_in_default>
467
+ <show_in_website>1</show_in_website>
468
+ <show_in_store>1</show_in_store>
469
+ <expanded>1</expanded>
470
+ <comment><![CDATA[When enabled, coupon codes can be applied
471
+ to a customer's shopping session with one of two methods. There is
472
+ a controller that listens to the store front route
473
+ <strong>/apply/coupon/</strong>. You can pass the coupon
474
+ code in the designated <em>Coupon Code Query
475
+ Parameter</em>, and a redirect URL. For example:
476
+ the URL <strong>{baseUrl}apply/coupon/?{code}={example}&redirect_path=%2Fcheckout%2Fcart</strong>
477
+ will apply coupon <strong>{example}</strong> to the customer's
478
+ shopping session, and redirect them to
479
+ <strong>{baseUrl}checkout/cart/</strong>. The second method applies a
480
+ coupon code by using an observer with <em>Use Event Observer</em> that
481
+ will scan any store front URL for the
482
+ <em>Coupon Code Query Parameter</em>. This method is optional, as
483
+ it can be disabled. If the module is disabled, the controller will
484
+ still perform redirects, but it will no longer apply coupons.<br/><br/>]]></comment>
485
+ <fields>
486
+ <enabled>
487
+ <label>Enabled</label>
488
+ <frontend_type>select</frontend_type>
489
+ <frontend_model>bronto_common/adminhtml_system_config_form_field</frontend_model>
490
+ <backend_model>bronto_common/system_config_backend_enable</backend_model>
491
+ <source_model>adminhtml/system_config_source_yesno</source_model>
492
+ <sort_order>0</sort_order>
493
+ <show_in_default>1</show_in_default>
494
+ <show_in_website>1</show_in_website>
495
+ <show_in_store>1</show_in_store>
496
+ </enabled>
497
+ <use_observer>
498
+ <label>Use Event Observer</label>
499
+ <depends><enabled>1</enabled></depends>
500
+ <frontend_type>select</frontend_type>
501
+ <source_model>adminhtml/system_config_source_yesno</source_model>
502
+ <sort_order>5</sort_order>
503
+ <show_in_default>1</show_in_default>
504
+ <show_in_website>1</show_in_website>
505
+ <show_in_store>1</show_in_store>
506
+ </use_observer>
507
+ <coupon_code_param>
508
+ <label>Coupon Code Query Parameter</label>
509
+ <depends><enabled>1</enabled></depends>
510
+ <frontend_type>text</frontend_type>
511
+ <sort_order>10</sort_order>
512
+ <show_in_default>1</show_in_default>
513
+ <show_in_website>1</show_in_website>
514
+ <show_in_store>1</show_in_store>
515
+ <comment>The value associated with this key will be
516
+ the coupon code to be appiled to the shopping
517
+ cart.
518
+ </comment>
519
+ </coupon_code_param>
520
+ <error_message_param>
521
+ <label>Invalid Coupon Query Parameter</label>
522
+ <depends><enabled>1</enabled></depends>
523
+ <frontend_type>text</frontend_type>
524
+ <sort_order>20</sort_order>
525
+ <show_in_default>1</show_in_default>
526
+ <show_in_website>1</show_in_website>
527
+ <show_in_store>1</show_in_store>
528
+ <comment><![CDATA[The value associated with this key
529
+ will cause the corresponding message to be
530
+ displayed.<br/>Valid values are:<br/>
531
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>invalid</strong>: The Invalid Message
532
+ will be used.<br/>
533
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>depleted</strong>: The Depleted Message
534
+ will be used.<br/>
535
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>expired</strong>: The Expired Message
536
+ will be used.]]></comment>
537
+ </error_message_param>
538
+ <success_message>
539
+ <label>Success Message</label>
540
+ <depends><enabled>1</enabled></depends>
541
+ <frontend_type>textarea</frontend_type>
542
+ <sort_order>30</sort_order>
543
+ <show_in_default>1</show_in_default>
544
+ <show_in_website>1</show_in_website>
545
+ <show_in_store>1</show_in_store>
546
+ <comment><![CDATA[Displayed when the coupon code in the URL was
547
+ successfully applied to the session. The coupon code can be
548
+ replaced in the message dynamically by using the
549
+ <em>{code}</em> tag.]]></comment>
550
+ </success_message>
551
+ <invalid>
552
+ <label>Invalid Message</label>
553
+ <depends><enabled>1</enabled></depends>
554
+ <frontend_type>textarea</frontend_type>
555
+ <sort_order>40</sort_order>
556
+ <show_in_default>1</show_in_default>
557
+ <show_in_website>1</show_in_website>
558
+ <show_in_store>1</show_in_store>
559
+ <comment><![CDATA[Displayed when the coupon code is
560
+ not applicable to the customer, does not exist, or
561
+ if the <strong>invalid</strong> value is
562
+ used. The coupon code can be replaced in the message
563
+ dynamically by using the <em>{code}</em> tag.]]></comment>
564
+ </invalid>
565
+ <depleted>
566
+ <label>Depleted Message</label>
567
+ <depends><enabled>1</enabled></depends>
568
+ <frontend_type>textarea</frontend_type>
569
+ <sort_order>45</sort_order>
570
+ <show_in_default>1</show_in_default>
571
+ <show_in_website>1</show_in_website>
572
+ <show_in_store>1</show_in_store>
573
+ <comment><![CDATA[Displayed when there are no
574
+ more uses for this coupon code or if the
575
+ <strong>depleted</strong> value is used. The
576
+ coupon code can be replaced in the message by using the
577
+ <em>{code}</em> tag.]]></comment>
578
+ </depleted>
579
+ <expired>
580
+ <label>Expired Message</label>
581
+ <depends><enabled>1</enabled></depends>
582
+ <frontend_type>textarea</frontend_type>
583
+ <sort_order>50</sort_order>
584
+ <show_in_default>1</show_in_default>
585
+ <show_in_website>1</show_in_website>
586
+ <show_in_store>1</show_in_store>
587
+ <comment><![CDATA[Displayed when the coupon code has
588
+ expired or if the <strong>expired</strong>
589
+ value is used. The coupon code can be replaced in the
590
+ message by using the <em>{code}</em>
591
+ tag.]]></comment>
592
+ </expired>
593
+ <conflict>
594
+ <label>Conflict Message</label>
595
+ <depends><enabled>1</enabled></depends>
596
+ <frontend_type>textarea</frontend_type>
597
+ <sort_order>55</sort_order>
598
+ <show_in_default>1</show_in_default>
599
+ <show_in_website>1</show_in_website>
600
+ <show_in_store>1</show_in_store>
601
+ <comment><![CDATA[Displayed when a coupon code is
602
+ currently applied in the session and it does not
603
+ match the coupon code to be applied. There are
604
+ three tags that can be replaced in the message
605
+ dynamically:
606
+ <br/>
607
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>{oldCode}</strong>: Coupon
608
+ currently in the session.
609
+ <br/>
610
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>{newCode}</strong>: Coupon to
611
+ be applied to the session.
612
+ <br/>
613
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>{link}</strong>: The link to apply the new coupon code.]]></comment>
614
+ </conflict>
615
+ <link>
616
+ <label>Link Text</label>
617
+ <depends><enabled>1</enabled></depends>
618
+ <frontend_type>text</frontend_type>
619
+ <sort_order>60</sort_order>
620
+ <show_in_default>1</show_in_default>
621
+ <show_in_website>1</show_in_website>
622
+ <show_in_store>1</show_in_store>
623
+ <comment><![CDATA[The link to apply the new coupon
624
+ code instead, which can only be used by the
625
+ <em>Conflict Message</em>. Two tags are
626
+ available for dynamic replacement:<br/>
627
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>{oldCode}</strong>: Coupon currently in
628
+ the session.<br/>
629
+ &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>{newCode}</strong>: Coupon to be applied to the session.]]></comment>
630
+ </link>
631
+ </fields>
632
+ </apply_coupon>
633
  </groups>
634
  </bronto_coupon>
635
  <bronto_popup module="bronto_common">
636
+ <label>Pop-up Manager Integration</label>
637
  <tab>bronto</tab>
638
  <frontend_type>text</frontend_type>
639
  <sort_order>898</sort_order>
657
  <show_in_website>1</show_in_website>
658
  <show_in_store>1</show_in_store>
659
  <expanded>1</expanded>
660
+ <comment><![CDATA[With Pop-Up Manager, you can create, test and manage pop-up sign-ups with minimal involvement from Bronto or your developer, and watch your email marketing list skyrocket! To learn more, visit the
661
+ <a target="_blank"
662
+ href="https://appcenter.bronto.com/apps/pop-up-manager">Bronto AppCenter</a> and contact your account manager.
 
 
 
663
  <br /><br/>]]></comment>
664
  <fields>
665
  <code>
688
  <label>General</label>
689
  <tab>bronto</tab>
690
  <frontend_type>text</frontend_type>
691
+ <frontend_model>bronto_common/adminhtml_system_config_form</frontend_model>
692
  <sort_order>100</sort_order>
693
  <show_in_default>1</show_in_default>
694
  <show_in_website>1</show_in_website>
912
  <show_in_website>1</show_in_website>
913
  <show_in_store>1</show_in_store>
914
  </partner>
915
+ <terms>
916
+ <label><![CDATA[Agree to Terms of Service?]]></label>
917
+ <source_model>adminhtml/system_config_source_yesno</source_model>
918
+ <frontend_model>bronto_common/adminhtml_system_config_form_field_support</frontend_model>
919
+ <frontend_type>select</frontend_type>
920
+ <sort_order>9</sort_order>
921
+ <show_in_default>1</show_in_default>
922
+ <show_in_website>1</show_in_website>
923
+ <show_in_store>1</show_in_store>
924
+ <comment>
925
+ <![CDATA[If <em>Yes</em>, you certify the contacts you will be importing as active subscribers via the Newsletter Opt-In Module of this extension have been collected in compliance with the <a href="http://hosting-source.bm23.com/30245/public/Bronto_PMPolicy.html" target="_blank">Bronto Permission Marketing Policy</a>; specifically, the contacts have provided explicit and deliberate permission to receive email from you and have been emailed within the last 24 months. For more information, please contact Bronto Support.]]>
926
+ </comment>
927
+ </terms>
928
  </fields>
929
  </support>
930
  <format>
app/code/community/Bronto/Common/sql/bronto_common_setup/mysql4-install-2.3.1.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $installer = $this;
4
+
5
+ $installer->startSetup();
6
+
7
+ try {
8
+ $installer->createTables();
9
+ } catch (Exception $e) {
10
+ Mage::helper('bronto_common')->writeError($e->getMessage());
11
+ }
12
+
13
+ $installer->endSetup();
app/code/community/Bronto/Common/sql/bronto_common_setup/mysql4-upgrade-2.2.2-2.3.0.php CHANGED
@@ -4,4 +4,5 @@ $installer = $this;
4
 
5
  $installer->startSetup();
6
  $installer->updateTables('2.3.0');
 
7
  $installer->endSetup();
4
 
5
  $installer->startSetup();
6
  $installer->updateTables('2.3.0');
7
+ $installer->resubmitFormInfo();
8
  $installer->endSetup();
app/code/community/Bronto/Common/sql/bronto_common_setup/mysql4-upgrade-2.3.0-2.4.0.php ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $installer = $this;
4
+
5
+ $installer->startSetup();
6
+ $installer->resubmitFormInfo();
7
+ $installer->endSetup();
app/code/community/Bronto/Customer/Block/Adminhtml/System/Config/Form/Fieldset/Attributes.php CHANGED
@@ -27,7 +27,7 @@ abstract class Bronto_Customer_Block_Adminhtml_System_Config_Form_Fieldset_Attri
27
  // Render Existing elements
28
  foreach ($element->getSortedElements() as $field) {
29
  if ('select' == $field->getType()) {
30
- $values[$field->getHtmlId() . '_new'] = $field->getLabel();
31
  } else {
32
  if (array_key_exists($field->getHtmlId(), $values)) {
33
  $field->setValue($values[$field->getHtmlId()]);
27
  // Render Existing elements
28
  foreach ($element->getSortedElements() as $field) {
29
  if ('select' == $field->getType()) {
30
+ $values[$field->getHtmlId() . '_new'] = trim($field->getLabel());
31
  } else {
32
  if (array_key_exists($field->getHtmlId(), $values)) {
33
  $field->setValue($values[$field->getHtmlId()]);
app/code/community/Bronto/Customer/Helper/Data.php CHANGED
@@ -15,15 +15,31 @@ class Bronto_Customer_Helper_Data extends Bronto_Common_Helper_Data implements B
15
 
16
  const XML_PREFIX_CUSTOMER_ATTR = 'bronto_customer/attributes/';
17
  const XML_PREFIX_ADDRESS_ATTR = 'bronto_customer/address_attributes/';
 
18
 
19
  const XML_PATH_CRON_STRING = 'crontab/jobs/bronto_customer_import/schedule/cron_expr';
20
  const XML_PATH_CRON_MODEL = 'crontab/jobs/bronto_customer_import/run/model';
21
 
 
 
 
 
 
22
  /**
23
  * Module Human Readable Name
24
  */
25
  protected $_name = 'Bronto Contact Import';
26
 
 
 
 
 
 
 
 
 
 
 
27
  /**
28
  * Get Human Readable Name
29
  *
@@ -170,10 +186,36 @@ class Bronto_Customer_Helper_Data extends Bronto_Common_Helper_Data implements B
170
  'new_city',
171
  'region',
172
  'new_region',
 
 
173
  'postcode',
174
  'new_postcode',
175
  'country_id',
176
  'new_country_id',
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
177
  'company',
178
  'new_company',
179
  'telephone',
@@ -198,6 +240,22 @@ class Bronto_Customer_Helper_Data extends Bronto_Common_Helper_Data implements B
198
  return $this->getAdminScopedConfig(self::XML_PREFIX_CUSTOMER_ATTR . $attribute, $scope, $scopeId);
199
  }
200
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
201
  /**
202
  * Get Address Attribute Field for scope
203
  *
@@ -209,7 +267,21 @@ class Bronto_Customer_Helper_Data extends Bronto_Common_Helper_Data implements B
209
  */
210
  public function getAddressAttributeField($attribute, $scope = 'default', $scopeId = 0)
211
  {
212
- return $this->getAdminScopedConfig(self::XML_PREFIX_ADDRESS_ATTR . $attribute, $scope, $scopeId);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
213
  }
214
 
215
  /**
@@ -286,7 +358,7 @@ class Bronto_Customer_Helper_Data extends Bronto_Common_Helper_Data implements B
286
  *
287
  * @return array
288
  */
289
- public function getCustomConfig($store = null)
290
  {
291
  $customerAttributes = Mage::getModel('customer/entity_attribute_collection');
292
  $addressAttributes = Mage::getModel('customer/entity_address_attribute_collection');
@@ -294,21 +366,23 @@ class Bronto_Customer_Helper_Data extends Bronto_Common_Helper_Data implements B
294
  $attributes = array();
295
  $data = array();
296
  foreach ($customerAttributes as $attribute) {
297
- $config = $this->getCustomerAttributeField($attribute->getAttributeCode(), $store);
298
  if ($config && $attribute->getFrontendLabel()) {
299
  $data[$attribute->getAttributeCode()] = $config;
300
  }
301
  }
302
  $attributes['customer_attributes'] = $data;
303
 
304
- $data = array();
305
- foreach ($addressAttributes as $attribute) {
306
- $config = $this->getAddressAttributeField($attribute->getAttributeCode(), $store);
307
- if ($config && $attribute->getFrontendLabel()) {
308
- $data[$attribute->getAttributeCode()] = $config;
 
 
309
  }
 
310
  }
311
- $attributes['address_attributes'] = $data;
312
 
313
  return $attributes;
314
  }
15
 
16
  const XML_PREFIX_CUSTOMER_ATTR = 'bronto_customer/attributes/';
17
  const XML_PREFIX_ADDRESS_ATTR = 'bronto_customer/address_attributes/';
18
+ const XML_PREFIX_BILLING_ATTR = 'bronto_customer/billing_address_attributes/';
19
 
20
  const XML_PATH_CRON_STRING = 'crontab/jobs/bronto_customer_import/schedule/cron_expr';
21
  const XML_PATH_CRON_MODEL = 'crontab/jobs/bronto_customer_import/run/model';
22
 
23
+ private $_addressTypes = array(
24
+ 'address' => 'getPrimaryShippingAddress',
25
+ 'billing_address' => 'getPrimaryBillingAddress'
26
+ );
27
+
28
  /**
29
  * Module Human Readable Name
30
  */
31
  protected $_name = 'Bronto Contact Import';
32
 
33
+ /**
34
+ * Gets the address types to customer method to obtain them
35
+ *
36
+ * @return array
37
+ */
38
+ public function getAddressTypes()
39
+ {
40
+ return $this->_addressTypes;
41
+ }
42
+
43
  /**
44
  * Get Human Readable Name
45
  *
186
  'new_city',
187
  'region',
188
  'new_region',
189
+ 'region_code_id',
190
+ 'new_region_code_id',
191
  'postcode',
192
  'new_postcode',
193
  'country_id',
194
  'new_country_id',
195
+ 'country_code_id',
196
+ 'new_country_code_id',
197
+ 'company',
198
+ 'new_company',
199
+ 'telephone',
200
+ 'new_telephone',
201
+ 'fax',
202
+ 'new_fax',
203
+ ),
204
+ 'billing_address_attributes' => array(
205
+ 'street',
206
+ 'new_street',
207
+ 'city',
208
+ 'new_city',
209
+ 'region',
210
+ 'new_region',
211
+ 'region_code_id',
212
+ 'new_region_code_id',
213
+ 'postcode',
214
+ 'new_postcode',
215
+ 'country_id',
216
+ 'new_country_id',
217
+ 'country_code_id',
218
+ 'new_country_code_id',
219
  'company',
220
  'new_company',
221
  'telephone',
240
  return $this->getAdminScopedConfig(self::XML_PREFIX_CUSTOMER_ATTR . $attribute, $scope, $scopeId);
241
  }
242
 
243
+ /**
244
+ * Gets Customer attributes that may or may not be prefixed
245
+ *
246
+ * @param string $attribute
247
+ * @param string $prefix
248
+ * @param string $scope
249
+ * @param int $scopeId
250
+ *
251
+ * @return mixed
252
+ */
253
+ public function getPrefixedAttributeField($attribute, $prefix = '', $scope = 'default', $scopeId = 0)
254
+ {
255
+ $prefix = !empty($prefix) ? $prefix . '_' : '';
256
+ return $this->getAdminScopedConfig("bronto_customer/{$prefix}attributes/" . $attribute, $scope, $scopeId);
257
+ }
258
+
259
  /**
260
  * Get Address Attribute Field for scope
261
  *
267
  */
268
  public function getAddressAttributeField($attribute, $scope = 'default', $scopeId = 0)
269
  {
270
+ return $this->getPrefixedAttributeField($attribute, 'address', $scope, $scopeId);
271
+ }
272
+
273
+ /**
274
+ * Get the billing address attribute field for scope
275
+ *
276
+ * @param string $attribute
277
+ * @param string $scope
278
+ * @param int $scopeId
279
+ *
280
+ * @return mixed
281
+ */
282
+ public function getBillingAddressAttributeField($attribute, $scope = 'default', $scopeId = 0)
283
+ {
284
+ return $this->getPrefixedAttributeField($attribute, 'billing_address', $scope, $scopeId);
285
  }
286
 
287
  /**
358
  *
359
  * @return array
360
  */
361
+ public function getCustomConfig($scope = 'default', $scopeId = 0)
362
  {
363
  $customerAttributes = Mage::getModel('customer/entity_attribute_collection');
364
  $addressAttributes = Mage::getModel('customer/entity_address_attribute_collection');
366
  $attributes = array();
367
  $data = array();
368
  foreach ($customerAttributes as $attribute) {
369
+ $config = $this->getCustomerAttributeField($attribute->getAttributeCode(), $scope, $scopeId);
370
  if ($config && $attribute->getFrontendLabel()) {
371
  $data[$attribute->getAttributeCode()] = $config;
372
  }
373
  }
374
  $attributes['customer_attributes'] = $data;
375
 
376
+ foreach ($this->_addressTypes as $prefix => $methodName) {
377
+ $addressData = array();
378
+ foreach ($addressAttributes as $attribute) {
379
+ $config = $this->getPrefixedAttributeField($attribute->getAttributeCode(), $prefix, $scope, $scopeId);
380
+ if ($config && $attribute->getFrontendLabel()) {
381
+ $addressData[$attribute->getAttributeCode()] = $config;
382
+ }
383
  }
384
+ $attributes["{$prefix}_attributes"] = $addressData;
385
  }
 
386
 
387
  return $attributes;
388
  }
app/code/community/Bronto/Customer/Model/Observer.php CHANGED
@@ -7,6 +7,15 @@
7
  class Bronto_Customer_Model_Observer extends Mage_Core_Model_Abstract
8
  {
9
  private $_fieldMap = array();
 
 
 
 
 
 
 
 
 
10
 
11
  /**
12
  * Observes module becoming enabled and displays message warning user to configure settings
@@ -74,6 +83,7 @@ class Bronto_Customer_Model_Observer extends Mage_Core_Model_Abstract
74
  $customerAttributes = Mage::getModel('customer/entity_attribute_collection');
75
  /** @var Mage_Customer_Model_Entity_Address_Attribute_Collection $addressAttributes */
76
  $addressAttributes = Mage::getModel('customer/entity_address_attribute_collection')->addVisibleFilter();
 
77
  $customerCache = array();
78
 
79
  // For each Customer...
@@ -92,11 +102,11 @@ class Bronto_Customer_Model_Observer extends Mage_Core_Model_Abstract
92
  $brontoContact = $this->_processAttributes($brontoContact, $customer, $customerAttributes, $store, 'customer');
93
  $brontoContact = $this->_processRewardPoints($brontoContact, $customer, $store);
94
  $brontoContact = $this->_processStoreCredit($brontoContact, $customer, $store);
95
-
96
- /* Process Address Attributes */
97
- $primaryAddress = $customer->getPrimaryShippingAddress();
98
- if (!empty($primaryAddress)) {
99
- $brontoContact = $this->_processAttributes($brontoContact, $primaryAddress, $addressAttributes, $store, 'address');
100
  }
101
 
102
  $brontoContact->persist();
@@ -135,6 +145,136 @@ class Bronto_Customer_Model_Observer extends Mage_Core_Model_Abstract
135
  return $result;
136
  }
137
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
138
  /**
139
  * @param Bronto_Api_Contact_Row $brontoContact
140
  * @param Mage_Customer_Model_Customer $customer
@@ -146,29 +286,19 @@ class Bronto_Customer_Model_Observer extends Mage_Core_Model_Abstract
146
  {
147
  // If Reward Points is installed
148
  if (Mage::helper('bronto_common')->isModuleInstalled('Enterprise_Reward')) {
149
- $_fieldName = Mage::helper('bronto_customer')->getCustomerAttributeField('reward_points', 'store', $store->getId());
150
-
151
  /** @var Enterprise_Reward_Model_Reward $reward */
152
  $reward = Mage::getModel('enterprise_reward/reward')->setCustomerId($customer->getId())->setWebsiteId($store->getWebsiteId())->loadByCustomer();
153
- $_attributeValue = $reward->getPointsBalance();
154
-
155
- // Skip un-mapped or empty attributes
156
- if (empty($_fieldName) || '_none_' == $_fieldName || !$_attributeValue || '' == $_attributeValue) {
157
- return $brontoContact;
158
- }
159
-
160
- // Add Formatted Currency Amount to value
161
- if ($reward->getCurrencyAmount() > 0) {
162
- $formattedValue = $reward->getFormatedCurrencyAmount();
163
- $_attributeValue .= " ({$formattedValue})";
164
- }
165
 
166
- // Store Bronto Key => Magento field label for errors
167
- if (!array_key_exists($_fieldName, $this->_fieldMap)) {
168
- $this->_fieldMap[$_fieldName] = 'Reward Points';
169
  }
170
-
171
- $brontoContact->setField($_fieldName, $_attributeValue);
172
  }
173
 
174
  return $brontoContact;
@@ -193,15 +323,10 @@ class Bronto_Customer_Model_Observer extends Mage_Core_Model_Abstract
193
  ->toCurrency($balance->getAmount());
194
 
195
  // Skip un-mapped or empty attributes
196
- if (empty($_fieldName) || '_none_' == $_fieldName || !$_attributeValue || '' == $_attributeValue) {
197
  return $brontoContact;
198
  }
199
 
200
- // Store Bronto Key => Magento field label for errors
201
- if (!array_key_exists($_fieldName, $this->_fieldMap)) {
202
- $this->_fieldMap[$_fieldName] = 'Store Credit';
203
- }
204
-
205
  $brontoContact->setField($_fieldName, $_attributeValue);
206
  }
207
 
@@ -221,6 +346,7 @@ class Bronto_Customer_Model_Observer extends Mage_Core_Model_Abstract
221
  */
222
  protected function _processAttributes(Bronto_Api_Contact_Row $brontoContact, $source, $attributes, Mage_Core_Model_Store $store, $type = 'customer')
223
  {
 
224
  // For each Customer attribute
225
  foreach ($attributes as $attribute) {
226
  if ('' == $attribute->getFrontendLabel()) {
@@ -230,8 +356,18 @@ class Bronto_Customer_Model_Observer extends Mage_Core_Model_Abstract
230
 
231
  // Get Attribute Field
232
  switch ($type) {
 
233
  case 'address':
234
- $_fieldName = Mage::helper('bronto_customer')->getAddressAttributeField($_attributeCode, 'store', $store->getId());
 
 
 
 
 
 
 
 
 
235
  break;
236
  default:
237
  $_fieldName = Mage::helper('bronto_customer')->getCustomerAttributeField($_attributeCode, 'store', $store->getId());
@@ -242,15 +378,10 @@ class Bronto_Customer_Model_Observer extends Mage_Core_Model_Abstract
242
  $_attributeValue = $this->_getReadableValue($attribute, $source->getData($_attributeCode));
243
 
244
  // Skip un-mapped or empty attributes
245
- if (empty($_fieldName) || '_none_' == $_fieldName || !$_attributeValue || '' == $_attributeValue) {
246
  continue;
247
  }
248
 
249
- // Store Bronto Key => Magento field label for errors
250
- if (!array_key_exists($_fieldName, $this->_fieldMap)) {
251
- $this->_fieldMap[$_fieldName] = $attribute->getFrontendLabel();
252
- }
253
-
254
  $brontoContact->setField($_fieldName, $_attributeValue);
255
  }
256
 
@@ -308,9 +439,10 @@ class Bronto_Customer_Model_Observer extends Mage_Core_Model_Abstract
308
  // Format Attribute Values
309
  switch ($_attributeType) {
310
  case 'select':
311
- case 'boolean':
312
  return strtolower(Mage::helper('bronto_customer')->getAttributeAdminLabel($attribute, $value));
313
  break;
 
 
314
  case 'multiselect':
315
  $values = array();
316
  if (!is_array($value)) {
@@ -396,19 +528,6 @@ class Bronto_Customer_Model_Observer extends Mage_Core_Model_Abstract
396
  }
397
 
398
  if ($hasError) {
399
- // Catch Error and Replace Field ID with Field Name
400
- if (preg_match_all("/([a-zA-Z0-9\-]){36}/", $errorMessage, $matches)) { // Grab field id if exists
401
- foreach ($matches[0] as $match) {
402
- $fieldObject = $fieldModel->getFieldObjectById($match);
403
- if ($fieldObject) {
404
- $errorMessage = str_replace($match, $fieldObject->name, $errorMessage);
405
- } elseif (array_key_exists($match, $this->_fieldMap)) {
406
- $mageLabel = $this->_fieldMap[$match];
407
- $errorMessage = "Bronto field mapped for {$mageLabel} no longer exists in your bronto account";
408
- }
409
- }
410
- }
411
-
412
  // If Error Code In specified Array, suppress contact
413
  if (in_array($errorCode, array(302, 303, 314, 315, 317))) {
414
  $customerRow->setBrontoSuppressed($errorMessage);
@@ -526,10 +645,13 @@ class Bronto_Customer_Model_Observer extends Mage_Core_Model_Abstract
526
  $groups['attributes']['fields'] = $attrFieldsCustomer;
527
  }
528
 
529
- // Process Dynamic Address Attribute Fields
530
- if (array_key_exists('address_attributes', $groups)) {
531
- $attrFieldsAddress = $this->_processDynamicAttributes($groups['address_attributes']['fields'], $section, 'address_attributes');
532
- $groups['address_attributes']['fields'] = $attrFieldsAddress;
 
 
 
533
  }
534
 
535
  // Return Updated Groups Data
@@ -605,7 +727,7 @@ class Bronto_Customer_Model_Observer extends Mage_Core_Model_Abstract
605
  Mage::helper('bronto_customer')->writeError("Unable to save new field: {$value}");
606
  }
607
  } // Save Dynamic Fields
608
- elseif (!in_array($fieldId, $ignore[$group])) {
609
  $scope = $scopeParams['scope'];
610
  if ($scope != 'default') {
611
  $scope .= 's';
@@ -614,7 +736,7 @@ class Bronto_Customer_Model_Observer extends Mage_Core_Model_Abstract
614
  // Save Field To Config
615
  $config->saveConfig(
616
  $section . '/' . $group . '/' . $fieldId,
617
- $field['value'],
618
  $scope,
619
  $scopeParams[$scopeParams['scope'] . '_id']
620
  );
7
  class Bronto_Customer_Model_Observer extends Mage_Core_Model_Abstract
8
  {
9
  private $_fieldMap = array();
10
+ private $_blackList = array();
11
+ private $_rewardsInfo = array(
12
+ 'reward_points' => array('Reward Points', 'getPointsBalance'),
13
+ 'reward_points_dollars' => array('Reward Curreny Amount', 'getFormatedCurrencyAmount')
14
+ );
15
+ private $_expandedfields = array(
16
+ 'country_id' => array('getCountryId', 'Country Code', 'country_code_id'),
17
+ 'region' => array('getRegionCode', 'Region Code', 'region_code_id')
18
+ );
19
 
20
  /**
21
  * Observes module becoming enabled and displays message warning user to configure settings
83
  $customerAttributes = Mage::getModel('customer/entity_attribute_collection');
84
  /** @var Mage_Customer_Model_Entity_Address_Attribute_Collection $addressAttributes */
85
  $addressAttributes = Mage::getModel('customer/entity_address_attribute_collection')->addVisibleFilter();
86
+ $this->_buildValidFieldMapForStore($store, $customerAttributes, $addressAttributes);
87
  $customerCache = array();
88
 
89
  // For each Customer...
102
  $brontoContact = $this->_processAttributes($brontoContact, $customer, $customerAttributes, $store, 'customer');
103
  $brontoContact = $this->_processRewardPoints($brontoContact, $customer, $store);
104
  $brontoContact = $this->_processStoreCredit($brontoContact, $customer, $store);
105
+ foreach (Mage::helper('bronto_customer')->getAddressTypes() as $prefix => $methodName) {
106
+ $address = $customer->$methodName();
107
+ if (!empty($address)) {
108
+ $brontoContact = $this->_processAttributes($brontoContact, $address, $addressAttributes, $store, $prefix);
109
+ }
110
  }
111
 
112
  $brontoContact->persist();
145
  return $result;
146
  }
147
 
148
+ /**
149
+ * Convenience method for checking availability
150
+ *
151
+ * @param string $token
152
+ * @param string $fieldId
153
+ * @return boolean
154
+ */
155
+ protected function _skippableAttribute($token, $fieldId)
156
+ {
157
+ if (empty($fieldId) || '_none_' == $fieldId) {
158
+ return true;
159
+ }
160
+ if (isset($this->_blackList[$fieldId])) {
161
+ return true;
162
+ }
163
+ if (!empty($token)) {
164
+ if (isset($this->_fieldMap[$token][$fieldId])) {
165
+ return true;
166
+ }
167
+ }
168
+ return false;
169
+ }
170
+
171
+ /**
172
+ * Convenience method for checking value availabiility
173
+ *
174
+ * @param string $fieldId
175
+ * @param string $value
176
+ * @return boolean
177
+ */
178
+ protected function _skippableProcessValue($fieldId, $value)
179
+ {
180
+ if ($this->_skippableAttribute('', $fieldId)) {
181
+ return true;
182
+ }
183
+ if ('' === $value || is_null($value)) {
184
+ return true;
185
+ }
186
+ return false;
187
+ }
188
+
189
+ /**
190
+ * Build internal field mapping for a token for a given store
191
+ *
192
+ * @param Mage_Core_Model_Store $store
193
+ * @param Iterable $attributes
194
+ * @param Iterable $addressAttrs
195
+ * @return void
196
+ */
197
+ protected function _buildValidFieldMapForStore($store, $attributes, $addressAttrs)
198
+ {
199
+ $helper = Mage::helper('bronto_customer');
200
+ $token = $helper->getApiToken('store', $store->getId());
201
+ if (!isset($this->_fieldMap[$token])) {
202
+ $this->_fieldMap[$token] = array();
203
+ }
204
+ $fieldsToCheck = array();
205
+ // Dynamic attrs
206
+ $pathPrefix = Bronto_Customer_Helper_Data::XML_PREFIX_CUSTOMER_ATTR;
207
+ foreach ($attributes as $attribute) {
208
+ if ('' == $attribute->getFrontendLabel()) {
209
+ continue;
210
+ }
211
+ $fieldId = $helper->getCustomerAttributeField($attribute->getAttributeCode(), 'store', $store->getId());
212
+ if ($this->_skippableAttribute($token, $fieldId)) {
213
+ continue;
214
+ }
215
+ $xmlPath = "{$pathPrefix}{$attribute->getAttributeCode()}";
216
+ $fieldsToCheck[$fieldId] = array($xmlPath, $attribute->getFrontendLabel());
217
+ }
218
+ // Reward Points / Store Credit
219
+ foreach ($this->_rewardsInfo + array('store_credit' => array('Store Credit', '_')) as $key => $labelMethodTuple) {
220
+ list($label, $method) = $labelMethodTuple;
221
+ $fieldId = $helper->getCustomerAttributeField($key, 'store', $store->getId());
222
+ if ($this->_skippableAttribute($token, $fieldId)) {
223
+ continue;
224
+ }
225
+ $xmlPath = "{$pathPrefix}{$key}";
226
+ $fieldsToCheck[$fieldId] = array($xmlPath, $helper->__($label));
227
+ }
228
+ // Address related
229
+ foreach ($helper->getAddressTypes() as $prefix => $methodName) {
230
+ $pathPrefix = "bronto_customer/{$prefix}_attributes/";
231
+ foreach ($addressAttrs as $attribute) {
232
+ if ('' == $attribute->getFrontendLabel()) {
233
+ continue;
234
+ }
235
+ $code = $attribute->getAttributeCode();
236
+ if (isset($this->_expandedfields[$code])) {
237
+ list($method, $label, $field) = $this->_expandedfields[$code];
238
+ $fieldId = $helper->getPrefixedAttributeField($field, $prefix, 'store', $store->getId());
239
+ if (!$this->_skippableAttribute($token, $fieldId)) {
240
+ $fieldsToCheck[$fieldId] = array("{$pathPrefix}{$field}", $helper->__($label));
241
+ }
242
+ }
243
+ $fieldId = $helper->getPrefixedAttributeField($code, $prefix, 'store', $store->getId());
244
+ if ($this->_skippableAttribute($token, $fieldId)) {
245
+ continue;
246
+ }
247
+ $xmlPath = "{$pathPrefix}{$attribute->getAttributeCode()}";
248
+ $fieldsToCheck[$fieldId] = array($xmlPath, $attribute->getFrontendLabel());
249
+ }
250
+ }
251
+ // Do a read call, diff and warn
252
+ if (!empty($fieldsToCheck)) {
253
+ $configData = Mage::getModel('core/config_data');
254
+ $fieldIds = array_keys($fieldsToCheck);
255
+ $api = $helper->getApi($token, 'store', $store->getId());
256
+ $fieldObject = $api->getFieldObject();
257
+ $filter = array('id' => $fieldIds, 'type' => 'OR');
258
+ foreach ($fieldObject->readAll($filter)->iterate() as $field) {
259
+ $this->_fieldMap[$token][$field->id] = $field->label;
260
+ unset($fieldsToCheck[$field->id]);
261
+ }
262
+ // These contain fieldIds that no longer exist in this account
263
+ foreach ($fieldsToCheck as $fieldId => $codeLabelTuple) {
264
+ list($xmlPath, $label) = $codeLabelTuple;
265
+ $helper->writeError("Field mapping for store {$store->getId()} no longer exists: {$fieldId}: {$label}");
266
+ $collection = $configData->getCollection()
267
+ ->addFieldToFilter('scope_id', array('eq' => $store->getId()))
268
+ ->addFieldToFilter('path', array('eq' => $xmlPath));
269
+ // Remove from config data
270
+ foreach ($collection as $config) {
271
+ $config->delete();
272
+ $this->_blackList[$fieldId] = $store->getId();
273
+ }
274
+ }
275
+ }
276
+ }
277
+
278
  /**
279
  * @param Bronto_Api_Contact_Row $brontoContact
280
  * @param Mage_Customer_Model_Customer $customer
286
  {
287
  // If Reward Points is installed
288
  if (Mage::helper('bronto_common')->isModuleInstalled('Enterprise_Reward')) {
 
 
289
  /** @var Enterprise_Reward_Model_Reward $reward */
290
  $reward = Mage::getModel('enterprise_reward/reward')->setCustomerId($customer->getId())->setWebsiteId($store->getWebsiteId())->loadByCustomer();
291
+ foreach ($this->_rewardsInfo as $key => $labelMethodTuple) {
292
+ list($label, $methodName) = $labelMethodTuple;
293
+ $_fieldName = Mage::helper('bronto_customer')->getCustomerAttributeField($key, 'store', $store->getId());
294
+ $_attributeValue = $reward->$methodName();
295
+ // Skip un-mapped or empty attributes
296
+ if ($this->_skippableProcessValue($_fieldName, $_attributeValue)) {
297
+ continue;
298
+ }
 
 
 
 
299
 
300
+ $brontoContact->setField($_fieldName, $_attributeValue);
 
 
301
  }
 
 
302
  }
303
 
304
  return $brontoContact;
323
  ->toCurrency($balance->getAmount());
324
 
325
  // Skip un-mapped or empty attributes
326
+ if ($this->_skippableProcessValue($_fieldName, $_attributeValue)) {
327
  return $brontoContact;
328
  }
329
 
 
 
 
 
 
330
  $brontoContact->setField($_fieldName, $_attributeValue);
331
  }
332
 
346
  */
347
  protected function _processAttributes(Bronto_Api_Contact_Row $brontoContact, $source, $attributes, Mage_Core_Model_Store $store, $type = 'customer')
348
  {
349
+ $helper = Mage::helper('bronto_customer');
350
  // For each Customer attribute
351
  foreach ($attributes as $attribute) {
352
  if ('' == $attribute->getFrontendLabel()) {
356
 
357
  // Get Attribute Field
358
  switch ($type) {
359
+ case 'billing_address':
360
  case 'address':
361
+ $_fieldName = $helper->getPrefixedAttributeField($_attributeCode, $type, 'store', $store->getId());
362
+ // Backward compatibility for country name and codes
363
+ if (array_key_exists($_attributeCode, $this->_expandedfields)) {
364
+ list($method, $label, $field) = $this->_expandedfields[$_attributeCode];
365
+ $_attributeValue = strtolower($source->$method());
366
+ $_brontoField = $helper->getPrefixedAttributeField($field, $type, 'store', $store->getId());
367
+ if (!$this->_skippableProcessValue($_brontoField, $_attributeValue)) {
368
+ $brontoContact->setField($_brontoField, $_attributeValue);
369
+ }
370
+ }
371
  break;
372
  default:
373
  $_fieldName = Mage::helper('bronto_customer')->getCustomerAttributeField($_attributeCode, 'store', $store->getId());
378
  $_attributeValue = $this->_getReadableValue($attribute, $source->getData($_attributeCode));
379
 
380
  // Skip un-mapped or empty attributes
381
+ if ($this->_skippableProcessValue($_fieldName, $_attributeValue)) {
382
  continue;
383
  }
384
 
 
 
 
 
 
385
  $brontoContact->setField($_fieldName, $_attributeValue);
386
  }
387
 
439
  // Format Attribute Values
440
  switch ($_attributeType) {
441
  case 'select':
 
442
  return strtolower(Mage::helper('bronto_customer')->getAttributeAdminLabel($attribute, $value));
443
  break;
444
+ case 'boolean':
445
+ return $value == 1 ? 'true' : 'false';
446
  case 'multiselect':
447
  $values = array();
448
  if (!is_array($value)) {
528
  }
529
 
530
  if ($hasError) {
 
 
 
 
 
 
 
 
 
 
 
 
 
531
  // If Error Code In specified Array, suppress contact
532
  if (in_array($errorCode, array(302, 303, 314, 315, 317))) {
533
  $customerRow->setBrontoSuppressed($errorMessage);
645
  $groups['attributes']['fields'] = $attrFieldsCustomer;
646
  }
647
 
648
+ foreach (Mage::helper('bronto_customer')->getAddressTypes() as $prefix => $methodName) {
649
+ $key = "{$prefix}_attributes";
650
+ // Process Dynamic Address Attribute Fields
651
+ if (array_key_exists($key, $groups)) {
652
+ $attrFieldsAddress = $this->_processDynamicAttributes($groups[$key]['fields'], $section, $key);
653
+ $groups[$key]['fields'] = $attrFieldsAddress;
654
+ }
655
  }
656
 
657
  // Return Updated Groups Data
727
  Mage::helper('bronto_customer')->writeError("Unable to save new field: {$value}");
728
  }
729
  } // Save Dynamic Fields
730
+ elseif (array_key_exists('value', $field) && !in_array($fieldId, $ignore[$group])) {
731
  $scope = $scopeParams['scope'];
732
  if ($scope != 'default') {
733
  $scope .= 's';
736
  // Save Field To Config
737
  $config->saveConfig(
738
  $section . '/' . $group . '/' . $fieldId,
739
+ array_key_exists('value', $field) ? $field['value'] : '',
740
  $scope,
741
  $scopeParams[$scopeParams['scope'] . '_id']
742
  );
app/code/community/Bronto/Customer/Model/System/Config/Backend/Brontofield.php CHANGED
@@ -22,6 +22,7 @@ class Bronto_Customer_Model_System_Config_Backend_Brontofield extends Mage_Core_
22
  $fieldObject = Mage::getModel('bronto_common/system_config_source_field')->getFieldObjectById($this->getValue());
23
 
24
  if ($fieldObject) {
 
25
  if ('attributes' == $this->group_id) {
26
  $attributes = Mage::getModel('customer/entity_attribute_collection');
27
  } elseif ('address_attributes' == $this->group_id) {
22
  $fieldObject = Mage::getModel('bronto_common/system_config_source_field')->getFieldObjectById($this->getValue());
23
 
24
  if ($fieldObject) {
25
+ $attributes = null;
26
  if ('attributes' == $this->group_id) {
27
  $attributes = Mage::getModel('customer/entity_attribute_collection');
28
  } elseif ('address_attributes' == $this->group_id) {
app/code/community/Bronto/Customer/controllers/Adminhtml/CustomerController.php CHANGED
@@ -69,6 +69,7 @@ class Bronto_Customer_Adminhtml_CustomerController extends Mage_Adminhtml_Contro
69
  'bronto_imported IS NULL' => '',
70
  'bronto_suppressed IS NULL' => ''
71
  ));
 
72
  } catch (Exception $e) {
73
  $helper->writeError($e);
74
  $this->_getSession()->addError('Mark All failed: ' . $e->getMessage());
@@ -152,7 +153,11 @@ class Bronto_Customer_Adminhtml_CustomerController extends Mage_Adminhtml_Contro
152
  $this->_getSession()->addError('Sync failed: ' . $e->getMessage());
153
  }
154
 
155
- $this->_getSession()->addSuccess(sprintf("%d of %d Customers were added to the Queue", $imported, $waiting));
 
 
 
 
156
  $returnParams = array('section' => 'bronto_customer');
157
  $returnParams = array_merge($returnParams, $helper->getScopeParams());
158
  $this->_redirect('*/system_config/edit', $returnParams);
69
  'bronto_imported IS NULL' => '',
70
  'bronto_suppressed IS NULL' => ''
71
  ));
72
+ $helper->writeInfo("Mark All Customers was explicitly pressed.");
73
  } catch (Exception $e) {
74
  $helper->writeError($e);
75
  $this->_getSession()->addError('Mark All failed: ' . $e->getMessage());
153
  $this->_getSession()->addError('Sync failed: ' . $e->getMessage());
154
  }
155
 
156
+ if ($imported == $waiting && $waiting == 0) {
157
+ $this->_getSession()->addSuccess($helper->__('All Customers are synced to the queue.'));
158
+ } else {
159
+ $this->_getSession()->addSuccess(sprintf("%d of %d Customers were added to the Queue", $imported, $waiting));
160
+ }
161
  $returnParams = array('section' => 'bronto_customer');
162
  $returnParams = array_merge($returnParams, $helper->getScopeParams());
163
  $this->_redirect('*/system_config/edit', $returnParams);
app/code/community/Bronto/Customer/etc/system.xml CHANGED
@@ -475,7 +475,7 @@
475
  </store_credit_new>
476
  <reward_points>
477
  <sort_order>65</sort_order>
478
- <label>Reward Points</label>
479
  <frontend_type>select</frontend_type>
480
  <frontend_model>bronto_customer/adminhtml_system_config_form_field_rewardpoints
481
  </frontend_model>
@@ -496,10 +496,33 @@
496
  <reward_points>_new_</reward_points>
497
  </depends>
498
  </reward_points_new>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
499
  </fields>
500
  </attributes>
501
  <address_attributes>
502
- <label>Address Attributes</label>
503
  <frontend_type>text</frontend_type>
504
  <frontend_model>bronto_customer/adminhtml_system_config_form_fieldset_attributes_address
505
  </frontend_model>
@@ -557,7 +580,7 @@
557
  <!-- region -->
558
  <region>
559
  <sort_order>10</sort_order>
560
- <label>State/Province</label>
561
  <frontend_type>select</frontend_type>
562
  <frontend_model>bronto_common/adminhtml_system_config_form_field</frontend_model>
563
  <backend_model>bronto_customer/system_config_backend_brontofield</backend_model>
@@ -577,6 +600,28 @@
577
  <region>_new_</region>
578
  </depends>
579
  </region_new>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
580
  <!-- postcode -->
581
  <postcode>
582
  <sort_order>15</sort_order>
@@ -603,7 +648,7 @@
603
  <!-- country_id -->
604
  <country_id>
605
  <sort_order>20</sort_order>
606
- <label>Country</label>
607
  <frontend_type>select</frontend_type>
608
  <frontend_model>bronto_common/adminhtml_system_config_form_field</frontend_model>
609
  <backend_model>bronto_customer/system_config_backend_brontofield</backend_model>
@@ -623,6 +668,28 @@
623
  <country_id>_new_</country_id>
624
  </depends>
625
  </country_id_new>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
626
  <!-- company -->
627
  <company>
628
  <sort_order>25</sort_order>
@@ -694,6 +761,246 @@
694
  </fax_new>
695
  </fields>
696
  </address_attributes>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
697
  </groups>
698
  </bronto_customer>
699
  </sections>
475
  </store_credit_new>
476
  <reward_points>
477
  <sort_order>65</sort_order>
478
+ <label>Reward Points Balance</label>
479
  <frontend_type>select</frontend_type>
480
  <frontend_model>bronto_customer/adminhtml_system_config_form_field_rewardpoints
481
  </frontend_model>
496
  <reward_points>_new_</reward_points>
497
  </depends>
498
  </reward_points_new>
499
+ <reward_points_dollars>
500
+ <sort_order>70</sort_order>
501
+ <label>Reward Points Currency Amount</label>
502
+ <frontend_type>select</frontend_type>
503
+ <frontend_model>bronto_customer/adminhtml_system_config_form_field_rewardpoints
504
+ </frontend_model>
505
+ <backend_model>bronto_customer/system_config_backend_brontofield</backend_model>
506
+ <source_model>bronto_common/system_config_source_field</source_model>
507
+ <show_in_default>1</show_in_default>
508
+ <show_in_website>1</show_in_website>
509
+ <show_in_store>1</show_in_store>
510
+ </reward_points_dollars>
511
+ <reward_points_dollars_new>
512
+ <sort_order>71</sort_order>
513
+ <frontend_type>text</frontend_type>
514
+ <backend_model>bronto_customer/system_config_backend_newfield</backend_model>
515
+ <show_in_default>1</show_in_default>
516
+ <show_in_website>1</show_in_website>
517
+ <show_in_store>1</show_in_store>
518
+ <depends>
519
+ <reward_points_dollars>_new_</reward_points_dollars>
520
+ </depends>
521
+ </reward_points_dollars_new>
522
  </fields>
523
  </attributes>
524
  <address_attributes>
525
+ <label>Default Shipping Address</label>
526
  <frontend_type>text</frontend_type>
527
  <frontend_model>bronto_customer/adminhtml_system_config_form_fieldset_attributes_address
528
  </frontend_model>
580
  <!-- region -->
581
  <region>
582
  <sort_order>10</sort_order>
583
+ <label>State/Province Name</label>
584
  <frontend_type>select</frontend_type>
585
  <frontend_model>bronto_common/adminhtml_system_config_form_field</frontend_model>
586
  <backend_model>bronto_customer/system_config_backend_brontofield</backend_model>
600
  <region>_new_</region>
601
  </depends>
602
  </region_new>
603
+ <region_code_id>
604
+ <sort_order>12</sort_order>
605
+ <label>State/Province Code</label>
606
+ <frontend_type>select</frontend_type>
607
+ <frontend_model>bronto_common/adminhtml_system_config_form_field</frontend_model>
608
+ <backend_model>bronto_customer/system_config_backend_brontofield</backend_model>
609
+ <source_model>bronto_common/system_config_source_field</source_model>
610
+ <show_in_default>1</show_in_default>
611
+ <show_in_website>1</show_in_website>
612
+ <show_in_store>1</show_in_store>
613
+ </region_code_id>
614
+ <region_code_id_new>
615
+ <sort_order>13</sort_order>
616
+ <frontend_type>text</frontend_type>
617
+ <backend_model>bronto_customer/system_config_backend_newfield</backend_model>
618
+ <show_in_default>1</show_in_default>
619
+ <show_in_website>1</show_in_website>
620
+ <show_in_store>1</show_in_store>
621
+ <depends>
622
+ <region_code_id>_new_</region_code_id>
623
+ </depends>
624
+ </region_code_id_new>
625
  <!-- postcode -->
626
  <postcode>
627
  <sort_order>15</sort_order>
648
  <!-- country_id -->
649
  <country_id>
650
  <sort_order>20</sort_order>
651
+ <label>Country Name</label>
652
  <frontend_type>select</frontend_type>
653
  <frontend_model>bronto_common/adminhtml_system_config_form_field</frontend_model>
654
  <backend_model>bronto_customer/system_config_backend_brontofield</backend_model>
668
  <country_id>_new_</country_id>
669
  </depends>
670
  </country_id_new>
671
+ <country_code_id>
672
+ <sort_order>22</sort_order>
673
+ <label>Country Code</label>
674
+ <frontend_type>select</frontend_type>
675
+ <frontend_model>bronto_common/adminhtml_system_config_form_field</frontend_model>
676
+ <backend_model>bronto_customer/system_config_backend_brontofield</backend_model>
677
+ <source_model>bronto_common/system_config_source_field</source_model>
678
+ <show_in_default>1</show_in_default>
679
+ <show_in_website>1</show_in_website>
680
+ <show_in_store>1</show_in_store>
681
+ </country_code_id>
682
+ <country_code_id_new>
683
+ <sort_order>23</sort_order>
684
+ <frontend_type>text</frontend_type>
685
+ <backend_model>bronto_customer/system_config_backend_newfield</backend_model>
686
+ <show_in_default>1</show_in_default>
687
+ <show_in_website>1</show_in_website>
688
+ <show_in_store>1</show_in_store>
689
+ <depends>
690
+ <country_code_id>_new_</country_code_id>
691
+ </depends>
692
+ </country_code_id_new>
693
  <!-- company -->
694
  <company>
695
  <sort_order>25</sort_order>
761
  </fax_new>
762
  </fields>
763
  </address_attributes>
764
+ <billing_address_attributes>
765
+ <label>Default Billing Address</label>
766
+ <frontend_type>text</frontend_type>
767
+ <frontend_model>bronto_customer/adminhtml_system_config_form_fieldset_attributes_address
768
+ </frontend_model>
769
+ <sort_order>20</sort_order>
770
+ <show_in_default>1</show_in_default>
771
+ <show_in_website>1</show_in_website>
772
+ <show_in_store>1</show_in_store>
773
+ <fields>
774
+ <!-- street -->
775
+ <street>
776
+ <sort_order>1</sort_order>
777
+ <label>Street Address</label>
778
+ <frontend_type>select</frontend_type>
779
+ <frontend_model>bronto_common/adminhtml_system_config_form_field</frontend_model>
780
+ <backend_model>bronto_customer/system_config_backend_brontofield</backend_model>
781
+ <source_model>bronto_common/system_config_source_field</source_model>
782
+ <show_in_default>1</show_in_default>
783
+ <show_in_website>1</show_in_website>
784
+ <show_in_store>1</show_in_store>
785
+ </street>
786
+ <street_new>
787
+ <sort_order>2</sort_order>
788
+ <frontend_type>text</frontend_type>
789
+ <backend_model>bronto_customer/system_config_backend_newfield</backend_model>
790
+ <show_in_default>1</show_in_default>
791
+ <show_in_website>1</show_in_website>
792
+ <show_in_store>1</show_in_store>
793
+ <depends>
794
+ <street>_new_</street>
795
+ </depends>
796
+ </street_new>
797
+ <!-- city -->
798
+ <city>
799
+ <sort_order>5</sort_order>
800
+ <label>City</label>
801
+ <frontend_type>select</frontend_type>
802
+ <frontend_model>bronto_common/adminhtml_system_config_form_field</frontend_model>
803
+ <backend_model>bronto_customer/system_config_backend_brontofield</backend_model>
804
+ <source_model>bronto_common/system_config_source_field</source_model>
805
+ <show_in_default>1</show_in_default>
806
+ <show_in_website>1</show_in_website>
807
+ <show_in_store>1</show_in_store>
808
+ </city>
809
+ <city_new>
810
+ <sort_order>6</sort_order>
811
+ <frontend_type>text</frontend_type>
812
+ <backend_model>bronto_customer/system_config_backend_newfield</backend_model>
813
+ <show_in_default>1</show_in_default>
814
+ <show_in_website>1</show_in_website>
815
+ <show_in_store>1</show_in_store>
816
+ <depends>
817
+ <city>_new_</city>
818
+ </depends>
819
+ </city_new>
820
+ <!-- region -->
821
+ <region>
822
+ <sort_order>10</sort_order>
823
+ <label>State/Province Name</label>
824
+ <frontend_type>select</frontend_type>
825
+ <frontend_model>bronto_common/adminhtml_system_config_form_field</frontend_model>
826
+ <backend_model>bronto_customer/system_config_backend_brontofield</backend_model>
827
+ <source_model>bronto_common/system_config_source_field</source_model>
828
+ <show_in_default>1</show_in_default>
829
+ <show_in_website>1</show_in_website>
830
+ <show_in_store>1</show_in_store>
831
+ </region>
832
+ <region_new>
833
+ <sort_order>11</sort_order>
834
+ <frontend_type>text</frontend_type>
835
+ <backend_model>bronto_customer/system_config_backend_newfield</backend_model>
836
+ <show_in_default>1</show_in_default>
837
+ <show_in_website>1</show_in_website>
838
+ <show_in_store>1</show_in_store>
839
+ <depends>
840
+ <region>_new_</region>
841
+ </depends>
842
+ </region_new>
843
+ <region_code_id>
844
+ <sort_order>12</sort_order>
845
+ <label>State/Province Code</label>
846
+ <frontend_type>select</frontend_type>
847
+ <frontend_model>bronto_common/adminhtml_system_config_form_field</frontend_model>
848
+ <backend_model>bronto_customer/system_config_backend_brontofield</backend_model>
849
+ <source_model>bronto_common/system_config_source_field</source_model>
850
+ <show_in_default>1</show_in_default>
851
+ <show_in_website>1</show_in_website>
852
+ <show_in_store>1</show_in_store>
853
+ </region_code_id>
854
+ <region_code_id_new>
855
+ <sort_order>13</sort_order>
856
+ <frontend_type>text</frontend_type>
857
+ <backend_model>bronto_customer/system_config_backend_newfield</backend_model>
858
+ <show_in_default>1</show_in_default>
859
+ <show_in_website>1</show_in_website>
860
+ <show_in_store>1</show_in_store>
861
+ <depends>
862
+ <region_code_id>_new_</region_code_id>
863
+ </depends>
864
+ </region_code_id_new>
865
+ <!-- postcode -->
866
+ <postcode>
867
+ <sort_order>15</sort_order>
868
+ <label>Zip/Postal Code</label>
869
+ <frontend_type>select</frontend_type>
870
+ <frontend_model>bronto_common/adminhtml_system_config_form_field</frontend_model>
871
+ <backend_model>bronto_customer/system_config_backend_brontofield</backend_model>
872
+ <source_model>bronto_common/system_config_source_field</source_model>
873
+ <show_in_default>1</show_in_default>
874
+ <show_in_website>1</show_in_website>
875
+ <show_in_store>1</show_in_store>
876
+ </postcode>
877
+ <postcode_new>
878
+ <sort_order>16</sort_order>
879
+ <frontend_type>text</frontend_type>
880
+ <backend_model>bronto_customer/system_config_backend_newfield</backend_model>
881
+ <show_in_default>1</show_in_default>
882
+ <show_in_website>1</show_in_website>
883
+ <show_in_store>1</show_in_store>
884
+ <depends>
885
+ <postcode>_new_</postcode>
886
+ </depends>
887
+ </postcode_new>
888
+ <!-- country_id -->
889
+ <country_id>
890
+ <sort_order>20</sort_order>
891
+ <label>Country Name</label>
892
+ <frontend_type>select</frontend_type>
893
+ <frontend_model>bronto_common/adminhtml_system_config_form_field</frontend_model>
894
+ <backend_model>bronto_customer/system_config_backend_brontofield</backend_model>
895
+ <source_model>bronto_common/system_config_source_field</source_model>
896
+ <show_in_default>1</show_in_default>
897
+ <show_in_website>1</show_in_website>
898
+ <show_in_store>1</show_in_store>
899
+ </country_id>
900
+ <country_id_new>
901
+ <sort_order>21</sort_order>
902
+ <frontend_type>text</frontend_type>
903
+ <backend_model>bronto_customer/system_config_backend_newfield</backend_model>
904
+ <show_in_default>1</show_in_default>
905
+ <show_in_website>1</show_in_website>
906
+ <show_in_store>1</show_in_store>
907
+ <depends>
908
+ <country_id>_new_</country_id>
909
+ </depends>
910
+ </country_id_new>
911
+ <country_code_id>
912
+ <sort_order>22</sort_order>
913
+ <label>Country Code</label>
914
+ <frontend_type>select</frontend_type>
915
+ <frontend_model>bronto_common/adminhtml_system_config_form_field</frontend_model>
916
+ <backend_model>bronto_customer/system_config_backend_brontofield</backend_model>
917
+ <source_model>bronto_common/system_config_source_field</source_model>
918
+ <show_in_default>1</show_in_default>
919
+ <show_in_website>1</show_in_website>
920
+ <show_in_store>1</show_in_store>
921
+ </country_code_id>
922
+ <country_code_id_new>
923
+ <sort_order>23</sort_order>
924
+ <frontend_type>text</frontend_type>
925
+ <backend_model>bronto_customer/system_config_backend_newfield</backend_model>
926
+ <show_in_default>1</show_in_default>
927
+ <show_in_website>1</show_in_website>
928
+ <show_in_store>1</show_in_store>
929
+ <depends>
930
+ <country_code_id>_new_</country_code_id>
931
+ </depends>
932
+ </country_code_id_new>
933
+ <!-- company -->
934
+ <company>
935
+ <sort_order>25</sort_order>
936
+ <label>Company</label>
937
+ <frontend_type>select</frontend_type>
938
+ <frontend_model>bronto_common/adminhtml_system_config_form_field</frontend_model>
939
+ <backend_model>bronto_customer/system_config_backend_brontofield</backend_model>
940
+ <source_model>bronto_common/system_config_source_field</source_model>
941
+ <show_in_default>1</show_in_default>
942
+ <show_in_website>1</show_in_website>
943
+ <show_in_store>1</show_in_store>
944
+ </company>
945
+ <company_new>
946
+ <sort_order>26</sort_order>
947
+ <frontend_type>text</frontend_type>
948
+ <backend_model>bronto_customer/system_config_backend_newfield</backend_model>
949
+ <show_in_default>1</show_in_default>
950
+ <show_in_website>1</show_in_website>
951
+ <show_in_store>1</show_in_store>
952
+ <depends>
953
+ <company>_new_</company>
954
+ </depends>
955
+ </company_new>
956
+ <!-- telephone -->
957
+ <telephone>
958
+ <sort_order>30</sort_order>
959
+ <label>Telephone</label>
960
+ <frontend_type>select</frontend_type>
961
+ <frontend_model>bronto_common/adminhtml_system_config_form_field</frontend_model>
962
+ <backend_model>bronto_customer/system_config_backend_brontofield</backend_model>
963
+ <source_model>bronto_common/system_config_source_field</source_model>
964
+ <show_in_default>1</show_in_default>
965
+ <show_in_website>1</show_in_website>
966
+ <show_in_store>1</show_in_store>
967
+ </telephone>
968
+ <telephone_new>
969
+ <sort_order>31</sort_order>
970
+ <frontend_type>text</frontend_type>
971
+ <backend_model>bronto_customer/system_config_backend_newfield</backend_model>
972
+ <show_in_default>1</show_in_default>
973
+ <show_in_website>1</show_in_website>
974
+ <show_in_store>1</show_in_store>
975
+ <depends>
976
+ <telephone>_new_</telephone>
977
+ </depends>
978
+ </telephone_new>
979
+ <!-- fax -->
980
+ <fax>
981
+ <sort_order>35</sort_order>
982
+ <label>Fax</label>
983
+ <frontend_type>select</frontend_type>
984
+ <frontend_model>bronto_common/adminhtml_system_config_form_field</frontend_model>
985
+ <backend_model>bronto_customer/system_config_backend_brontofield</backend_model>
986
+ <source_model>bronto_common/system_config_source_field</source_model>
987
+ <show_in_default>1</show_in_default>
988
+ <show_in_website>1</show_in_website>
989
+ <show_in_store>1</show_in_store>
990
+ </fax>
991
+ <fax_new>
992
+ <sort_order>36</sort_order>
993
+ <frontend_type>text</frontend_type>
994
+ <backend_model>bronto_customer/system_config_backend_newfield</backend_model>
995
+ <show_in_default>1</show_in_default>
996
+ <show_in_website>1</show_in_website>
997
+ <show_in_store>1</show_in_store>
998
+ <depends>
999
+ <fax>_new_</fax>
1000
+ </depends>
1001
+ </fax_new>
1002
+ </fields>
1003
+ </billing_address_attributes>
1004
  </groups>
1005
  </bronto_customer>
1006
  </sections>
app/code/community/Bronto/Email/Block/Adminhtml/System/Email/Import/Grid.php CHANGED
@@ -26,7 +26,7 @@ class Bronto_Email_Block_Adminhtml_System_Email_Import_Grid extends Mage_Adminht
26
  $brontoTable = Mage::getSingleton('core/resource')->getTableName('bronto_email/message');
27
 
28
  // Apply conditional logic to handle 1.9 overriding collection _construct
29
- if (Mage::helper('bronto_common')->isVersionMatch(Mage::getVersionInfo(), 1, array(4, 5, array('edition' => 'Enterprise', 'major' => 9), 10))) {
30
  $collection->getSelect()->joinLeft(
31
  $brontoTable,
32
  "`{$templateTable}`.`template_id` = `{$brontoTable}`.`core_template_id`"
26
  $brontoTable = Mage::getSingleton('core/resource')->getTableName('bronto_email/message');
27
 
28
  // Apply conditional logic to handle 1.9 overriding collection _construct
29
+ if (Mage::helper('bronto_common')->isVersionMatch(Mage::getVersionInfo(), 1, array(4, 5, array('edition' => 'Professional', 'major' => 9), 10))) {
30
  $collection->getSelect()->joinLeft(
31
  $brontoTable,
32
  "`{$templateTable}`.`template_id` = `{$brontoTable}`.`core_template_id`"
app/code/community/Bronto/Email/Block/Adminhtml/System/Email/Template/Edit/Form.php CHANGED
@@ -120,26 +120,28 @@ class Bronto_Email_Block_Adminhtml_System_Email_Template_Edit_Form extends Mage_
120
  Event.observe(window, 'load', function() {
121
  triggerSendType($('template_send_type').value);
122
  });
123
-
124
  function triggerSendType(sendType) {
125
  if (sendType == 'magento') {
126
  // Disable Some
127
  $('bronto_message_id').disable();
 
128
  $('sales_rule').disable();
129
- $('product_recommendation').disable();
 
130
  $('orig_template_text').disable();
131
  $('container_bronto_message_id').hide();
 
132
  $('container_sales_rule').hide();
133
- $('container_product_recommendation').hide();
134
  $('container_orig_template_text').hide();
135
-
136
  // Enable Others
137
  $('template_subject').enable();
138
  $('template_text').enable();
139
  $('container_template_subject').show();
140
  $('container_template_text').show();
141
  $('insert_variable').show();
142
-
143
  if ($('field_template_styles') != undefined) {
144
  $('field_template_styles').show();
145
  $('template_styles').enable();
@@ -147,35 +149,37 @@ class Bronto_Email_Block_Adminhtml_System_Email_Template_Edit_Form extends Mage_
147
  } else {
148
  // Enable Some
149
  $('bronto_message_id').enable();
 
150
  $('sales_rule').enable();
151
- $('product_recommendation').enable();
 
152
  $('orig_template_text').enable();
153
  $('container_bronto_message_id').show();
 
154
  $('container_sales_rule').show();
155
- $('container_product_recommendation').show();
156
  $('container_orig_template_text').show();
157
-
158
  // Disable Others
159
  $('template_subject').disable();
160
  $('template_text').disable();
161
  $('container_template_subject').hide();
162
  $('container_template_text').hide();
163
  $('insert_variable').hide();
164
-
165
  if ($('field_template_styles') != undefined) {
166
  $('template_styles').disable();
167
  $('field_template_styles').hide();
168
  }
169
  }
170
  }
171
-
172
  function updateMessages(){
173
  var storeId = $('store_id').value;
174
  var sendType = $('template_send_type').value;
175
  var template = '{$templateId}';
176
-
177
  triggerSendType(sendType);
178
-
179
  if (sendType != 'magento') {
180
  var reloadurl = '" . $this->getUrl('adminhtml/system_email_template/ajaxlist') . "template_id/'+template+'/id/'+storeId+'/type/'+sendType;
181
  new Ajax.Request(reloadurl, {
@@ -189,10 +193,10 @@ class Bronto_Email_Block_Adminhtml_System_Email_Template_Edit_Form extends Mage_
189
  });
190
  }
191
  }
192
-
193
  function syncHiddenValue(element) {
194
  var fieldValue = element.value;
195
-
196
  if ($(element.id + '_hidden') != undefined) {
197
  $(element.id + '_hidden').value = fieldValue;
198
  }
@@ -233,6 +237,15 @@ class Bronto_Email_Block_Adminhtml_System_Email_Template_Edit_Form extends Mage_
233
  'required' => true,
234
  ));
235
 
 
 
 
 
 
 
 
 
 
236
  // Create field to allow selecting a sales rule to pull a coupon code from
237
  $fieldset->addField('sales_rule', 'select', array(
238
  'name' => 'sales_rule',
120
  Event.observe(window, 'load', function() {
121
  triggerSendType($('template_send_type').value);
122
  });
123
+
124
  function triggerSendType(sendType) {
125
  if (sendType == 'magento') {
126
  // Disable Some
127
  $('bronto_message_id').disable();
128
+ $('send_flags').disable();
129
  $('sales_rule').disable();
130
+ $$('#product_recommendation').each(function(elem) { elem.disable() });
131
+ $$('#container_product_recommendation').each(function(elem) { elem.hide() } );
132
  $('orig_template_text').disable();
133
  $('container_bronto_message_id').hide();
134
+ $('container_send_flags').hide();
135
  $('container_sales_rule').hide();
 
136
  $('container_orig_template_text').hide();
137
+
138
  // Enable Others
139
  $('template_subject').enable();
140
  $('template_text').enable();
141
  $('container_template_subject').show();
142
  $('container_template_text').show();
143
  $('insert_variable').show();
144
+
145
  if ($('field_template_styles') != undefined) {
146
  $('field_template_styles').show();
147
  $('template_styles').enable();
149
  } else {
150
  // Enable Some
151
  $('bronto_message_id').enable();
152
+ $('send_flags').enable();
153
  $('sales_rule').enable();
154
+ $$('#product_recommendation').each(function(elem) { elem.enable() } );
155
+ $$('#container_product_recommendation').each(function(elem) { elem.show() });
156
  $('orig_template_text').enable();
157
  $('container_bronto_message_id').show();
158
+ $('container_send_flags').show();
159
  $('container_sales_rule').show();
 
160
  $('container_orig_template_text').show();
161
+
162
  // Disable Others
163
  $('template_subject').disable();
164
  $('template_text').disable();
165
  $('container_template_subject').hide();
166
  $('container_template_text').hide();
167
  $('insert_variable').hide();
168
+
169
  if ($('field_template_styles') != undefined) {
170
  $('template_styles').disable();
171
  $('field_template_styles').hide();
172
  }
173
  }
174
  }
175
+
176
  function updateMessages(){
177
  var storeId = $('store_id').value;
178
  var sendType = $('template_send_type').value;
179
  var template = '{$templateId}';
180
+
181
  triggerSendType(sendType);
182
+
183
  if (sendType != 'magento') {
184
  var reloadurl = '" . $this->getUrl('adminhtml/system_email_template/ajaxlist') . "template_id/'+template+'/id/'+storeId+'/type/'+sendType;
185
  new Ajax.Request(reloadurl, {
193
  });
194
  }
195
  }
196
+
197
  function syncHiddenValue(element) {
198
  var fieldValue = element.value;
199
+
200
  if ($(element.id + '_hidden') != undefined) {
201
  $(element.id + '_hidden').value = fieldValue;
202
  }
237
  'required' => true,
238
  ));
239
 
240
+ $fieldset->addField('send_flags', 'select', array(
241
+ 'name' => 'send_flags',
242
+ 'label' => Mage::helper('adminhtml')->__('Send Flags'),
243
+ 'title' => Mage::helper('adminhtml')->__('Send Flags'),
244
+ 'container_id' => 'container_send_flags',
245
+ 'values' => Mage::getModel('bronto_common/system_config_source_sendOptions')->toOptionArray(true),
246
+ 'note' => $this->__("Send flags for this message. The options are: <br/> - <strong>Sender Authentication</strong>: Will sign your message with DomainKeys/DKIM, optimizing your message delivery to Hotmail, MSN, and Yahoo! email addresses. <br/> - <strong>Fatigue Override</strong>: The delivery can be sent even if it exceeds the frequency cap settings for a customer. <br/> - <strong>Reply Tracking</strong>: Will store a copy of all replies to your messages on the Replies page within the Bronto platform.")
247
+ ));
248
+
249
  // Create field to allow selecting a sales rule to pull a coupon code from
250
  $fieldset->addField('sales_rule', 'select', array(
251
  'name' => 'sales_rule',
app/code/community/Bronto/Email/Block/Adminhtml/System/Email/Template/Grid.php CHANGED
@@ -22,7 +22,7 @@ class Bronto_Email_Block_Adminhtml_System_Email_Template_Grid extends Mage_Admin
22
  $brontoTable = Mage::getSingleton('core/resource')->getTableName('bronto_email/message');
23
 
24
  // Apply conditional logic to handle 1.9 overriding collection _construct
25
- if (Mage::helper('bronto_common')->isVersionMatch(Mage::getVersionInfo(), 1, array(4, 5, array('edition' => 'Enterprise', 'major' => 9), 10))) {
26
  $collection->getSelect()->joinLeft(
27
  $brontoTable,
28
  "`{$templateTable}`.`template_id` = `{$brontoTable}`.`core_template_id`"
22
  $brontoTable = Mage::getSingleton('core/resource')->getTableName('bronto_email/message');
23
 
24
  // Apply conditional logic to handle 1.9 overriding collection _construct
25
+ if (Mage::helper('bronto_common')->isVersionMatch(Mage::getVersionInfo(), 1, array(4, 5, array('edition' => 'Professional', 'major' => 9), 10))) {
26
  $collection->getSelect()->joinLeft(
27
  $brontoTable,
28
  "`{$templateTable}`.`template_id` = `{$brontoTable}`.`core_template_id`"
app/code/community/Bronto/Email/Helper/Data.php CHANGED
@@ -14,6 +14,7 @@ class Bronto_Email_Helper_Data
14
  const XML_PATH_LOG_FIELDS_ENABLED = 'bronto_email/settings/log_fields_enabled';
15
  const XML_PATH_DEFAULT_COUPON = 'bronto_email/settings/default_coupon';
16
  const XML_PATH_DEFAULT_REC = 'bronto_email/settings/default_recommendation';
 
17
 
18
  /**
19
  * Xml path to email template nodes
@@ -136,6 +137,18 @@ class Bronto_Email_Helper_Data
136
  return $this->getAdminScopedConfig(self::XML_PATH_DEFAULT_REC, $scope, $scopeId);
137
  }
138
 
 
 
 
 
 
 
 
 
 
 
 
 
139
  /**
140
  * Get Config setting for sending through bronto
141
  *
@@ -222,12 +235,12 @@ class Bronto_Email_Helper_Data
222
  *
223
  * @return array
224
  */
225
- public function getCustomConfig()
226
  {
227
  $emails = array();
228
  $templates = Mage::getModel('bronto_email/template')->getCollection();
229
 
230
- if ($this->isVersionMatch(Mage::getVersionInfo(), 1, array(4, 5, array('edition' => 'Enterprise', 'major' => 9), 10))) {
231
  $templateTable = Mage::getSingleton('core/resource')->getTableName('bronto_email/template');
232
  $brontoTable = Mage::getSingleton('core/resource')->getTableName('bronto_email/message');
233
  $templates->getSelect()->joinLeft(
@@ -250,7 +263,7 @@ class Bronto_Email_Helper_Data
250
 
251
  $settings = array();
252
  foreach ($this->getTemplatePaths() as $configPath) {
253
- $data = Mage::getStoreConfig($configPath);
254
  if (str_replace('/', '_', $configPath) == $data) {
255
  $data = 'Default';
256
  }
14
  const XML_PATH_LOG_FIELDS_ENABLED = 'bronto_email/settings/log_fields_enabled';
15
  const XML_PATH_DEFAULT_COUPON = 'bronto_email/settings/default_coupon';
16
  const XML_PATH_DEFAULT_REC = 'bronto_email/settings/default_recommendation';
17
+ const XML_PATH_DEFAULT_SEND_FLAG = 'bronto_email/settings/default_send_flags';
18
 
19
  /**
20
  * Xml path to email template nodes
137
  return $this->getAdminScopedConfig(self::XML_PATH_DEFAULT_REC, $scope, $scopeId);
138
  }
139
 
140
+ /**
141
+ * Gets the default send flags
142
+ *
143
+ * @param string $scope
144
+ * @param int $scopeId
145
+ * @return int
146
+ */
147
+ public function getDefaultSendFlags($scope = 'default', $scopeId = 0)
148
+ {
149
+ return $this->getAdminScopedConfig(self::XML_PATH_DEFAULT_SEND_FLAG, $scope, $scopeId);
150
+ }
151
+
152
  /**
153
  * Get Config setting for sending through bronto
154
  *
235
  *
236
  * @return array
237
  */
238
+ public function getCustomConfig($scope = 'default', $scopeId = 0)
239
  {
240
  $emails = array();
241
  $templates = Mage::getModel('bronto_email/template')->getCollection();
242
 
243
+ if ($this->isVersionMatch(Mage::getVersionInfo(), 1, array(4, 5, array('edition' => 'Professional', 'major' => 9), 10))) {
244
  $templateTable = Mage::getSingleton('core/resource')->getTableName('bronto_email/template');
245
  $brontoTable = Mage::getSingleton('core/resource')->getTableName('bronto_email/message');
246
  $templates->getSelect()->joinLeft(
263
 
264
  $settings = array();
265
  foreach ($this->getTemplatePaths() as $configPath) {
266
+ $data = $this->getAdminScopedConfig($configPath, $scope, $scopeId);
267
  if (str_replace('/', '_', $configPath) == $data) {
268
  $data = 'Default';
269
  }
app/code/community/Bronto/Email/Model/Mysql4/Template/Collection.php CHANGED
@@ -13,7 +13,7 @@ class Bronto_Email_Model_Mysql4_Template_Collection extends Mage_Core_Model_Mysq
13
  parent::_construct();
14
  $this->_templateTable = $this->getResource()->getTable('bronto_email/template');
15
  $this->_brontoTable = $this->getResource()->getTable('bronto_email/message');
16
- if (Mage::helper('bronto_common')->isVersionMatch(Mage::getVersionInfo(), 1, array(4, array('edition' => 'Enterprise', 'major' => 9)))) {
17
  $this->_select->joinLeft(
18
  array($this->_brontoTable),
19
  "`{$this->_templateTable}`.`template_id` = `{$this->_brontoTable}`.`core_template_id`"
13
  parent::_construct();
14
  $this->_templateTable = $this->getResource()->getTable('bronto_email/template');
15
  $this->_brontoTable = $this->getResource()->getTable('bronto_email/message');
16
+ if (Mage::helper('bronto_common')->isVersionMatch(Mage::getVersionInfo(), 1, array(4, array('edition' => 'Professional', 'major' => 9)))) {
17
  $this->_select->joinLeft(
18
  array($this->_brontoTable),
19
  "`{$this->_templateTable}`.`template_id` = `{$this->_brontoTable}`.`core_template_id`"
app/code/community/Bronto/Email/Model/Resource/Setup.php CHANGED
@@ -28,6 +28,7 @@ class Bronto_Email_Model_Resource_Setup extends Bronto_Common_Model_Resource_Abs
28
  `store_id` int(11) NOT NULL DEFAULT '1' COMMENT 'Store ID for Template',
29
  `sales_rule` int(10) NULL COMMENT 'Sales Rule for Coupon Codes',
30
  `product_recommendation` int(11) unsigned DEFAULT NULL COMMENT 'Product Recommendations',
 
31
  PRIMARY KEY (`core_template_id`),
32
  KEY `IDX_BRONTO_STORE_ID` (`store_id`),
33
  CONSTRAINT `FK_BRONTO_EMAIL_TEMPLATE_ID_CORE_EMAIL_TEMPLATE_ID` FOREIGN KEY (`core_template_id`)
@@ -62,8 +63,14 @@ class Bronto_Email_Model_Resource_Setup extends Bronto_Common_Model_Resource_Abs
62
  return array(
63
  '1.2.0' => array(
64
  'message' => array(
65
- 'sql' =>
66
- "ALTER TABLE {table} ADD COLUMN `product_recommendation` int(11) unsigned DEFAULT NULL AFTER `sales_rule`;"
 
 
 
 
 
 
67
  )
68
  )
69
  );
28
  `store_id` int(11) NOT NULL DEFAULT '1' COMMENT 'Store ID for Template',
29
  `sales_rule` int(10) NULL COMMENT 'Sales Rule for Coupon Codes',
30
  `product_recommendation` int(11) unsigned DEFAULT NULL COMMENT 'Product Recommendations',
31
+ `send_flags` int(3) unsigned DEFAULT NULL COMMENT 'Delivery Flags',
32
  PRIMARY KEY (`core_template_id`),
33
  KEY `IDX_BRONTO_STORE_ID` (`store_id`),
34
  CONSTRAINT `FK_BRONTO_EMAIL_TEMPLATE_ID_CORE_EMAIL_TEMPLATE_ID` FOREIGN KEY (`core_template_id`)
63
  return array(
64
  '1.2.0' => array(
65
  'message' => array(
66
+ 'sql' =>
67
+ "ALTER TABLE {table} ADD COLUMN `product_recommendation` int(11) unsigned DEFAULT NULL AFTER `sales_rule`;"
68
+ )
69
+ ),
70
+ '1.2.1' => array(
71
+ 'message' => array(
72
+ 'sql' =>
73
+ "ALTER TABLE {table} ADD COLUMN `send_flags` int(3) unsigned DEFAULT NULL AFTER `product_recommendation`;"
74
  )
75
  )
76
  );
app/code/community/Bronto/Email/Model/System/Config/Source/Email/Template.php CHANGED
@@ -20,7 +20,7 @@ class Bronto_Email_Model_System_Config_Source_Email_Template extends Mage_Adminh
20
  $collection = Mage::getModel('bronto_email/template')->getCollection();
21
 
22
  // Apply conditional logic to handle 1.9 overriding collection _construct
23
- if (Mage::helper('bronto_common')->isVersionMatch(Mage::getVersionInfo(), 1, array(4, 5, array('edition' => 'Enterprise', 'major' => 9), 10))) {
24
  $collection->getSelect()->joinLeft(
25
  $brontoTable,
26
  "`{$templateTable}`.`template_id` = `{$brontoTable}`.`core_template_id`"
20
  $collection = Mage::getModel('bronto_email/template')->getCollection();
21
 
22
  // Apply conditional logic to handle 1.9 overriding collection _construct
23
+ if (Mage::helper('bronto_common')->isVersionMatch(Mage::getVersionInfo(), 1, array(4, 5, array('edition' => 'Professional', 'major' => 9), 10))) {
24
  $collection->getSelect()->joinLeft(
25
  $brontoTable,
26
  "`{$templateTable}`.`template_id` = `{$brontoTable}`.`core_template_id`"
app/code/community/Bronto/Email/controllers/Adminhtml/System/Email/TemplateController.php CHANGED
@@ -257,6 +257,11 @@ class Bronto_Email_Adminhtml_System_Email_TemplateController extends Mage_Adminh
257
  $brontoTemplate->setProductRecommendation($rec);
258
  }
259
 
 
 
 
 
 
260
  $salesRule = $request->getParam('sales_rule', null);
261
  $brontoTemplate->setSalesRule($salesRule);
262
  $brontoTemplate->setTemplateSendType($sendType);
257
  $brontoTemplate->setProductRecommendation($rec);
258
  }
259
 
260
+ if ($request->has('send_flags')) {
261
+ $sendFlags = $request->getParam('send_flags', null);
262
+ $brontoTemplate->setSendFlags($sendFlags);
263
+ }
264
+
265
  $salesRule = $request->getParam('sales_rule', null);
266
  $brontoTemplate->setSalesRule($salesRule);
267
  $brontoTemplate->setTemplateSendType($sendType);
app/code/community/Bronto/Email/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <Bronto_Email>
5
- <version>1.2.0</version>
6
  </Bronto_Email>
7
  </modules>
8
  <global>
2
  <config>
3
  <modules>
4
  <Bronto_Email>
5
+ <version>1.2.1</version>
6
  </Bronto_Email>
7
  </modules>
8
  <global>
app/code/community/Bronto/Email/etc/system.xml CHANGED
@@ -102,6 +102,31 @@
102
  <show_in_store>1</show_in_store>
103
  <comment><![CDATA[Inject related product content in the message. Recommendations are created in <strong>Promotions</strong> &raquo; <strong>Bronto Product Recommendations]]></comment>
104
  </default_recommendation>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
105
  </fields>
106
  </settings>
107
  <templates translate="label">
102
  <show_in_store>1</show_in_store>
103
  <comment><![CDATA[Inject related product content in the message. Recommendations are created in <strong>Promotions</strong> &raquo; <strong>Bronto Product Recommendations]]></comment>
104
  </default_recommendation>
105
+ <default_send_flags>
106
+ <label>Default Send Flags</label>
107
+ <depends>
108
+ <enabled>1</enabled>
109
+ </depends>
110
+ <frontend_type>select</frontend_type>
111
+ <source_model>bronto_common/system_config_source_sendOptions</source_model>
112
+ <sort_order>14</sort_order>
113
+ <show_in_default>1</show_in_default>
114
+ <show_in_website>1</show_in_website>
115
+ <show_in_store>1</show_in_store>
116
+ <comment><![CDATA[Specify the default send flags for
117
+ all transactional emails. The options are:
118
+ <br/> - <strong>Sender Authentication</strong>: Will
119
+ sign your message with DomainKeys/DKIM,
120
+ optimizing your message delivery to Hotmail,
121
+ MSN, and Yahoo! email addresses.
122
+ <br/> - <strong>Fatigue Override</strong>: The
123
+ delivery can be sent even if it exceeds the
124
+ frequency cap settings for a customer.
125
+ <br/> - <strong>Reply Tracking</strong>: Will store
126
+ a copy of all replies to your messages on the
127
+ Replies page within the Bronto platform.
128
+ ]]></comment>
129
+ </default_send_flags>
130
  </fields>
131
  </settings>
132
  <templates translate="label">
app/code/community/Bronto/Email/sql/bronto_email_setup/mysql4-install-1.2.1.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $installer = $this;
4
+
5
+ $installer->startSetup();
6
+
7
+ try {
8
+ $installer->createTables();
9
+ } catch (Exception $e) {
10
+ Mage::helper('bronto_email')->writeError($e->getMessage());
11
+ }
12
+
13
+ $installer->endSetup();
app/code/community/Bronto/Email/sql/bronto_email_setup/mysql4-upgrade-1.2.0-1.2.1.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $installer = $this;
4
+
5
+ $installer->startSetup();
6
+
7
+ try {
8
+ $installer->updateTables('1.2.1');
9
+ } catch (Exception $e) {
10
+ Mage::helper('bronto_email')->writeError('Failed to upgrade email to 1.2.1: ' . $e->getMessage());
11
+ }
12
+
13
+ $installer->endSetup();
app/code/community/Bronto/Emailcapture/Block/Emailcapture.php CHANGED
@@ -13,8 +13,8 @@ class Bronto_Emailcapture_Block_Emailcapture extends Mage_Core_Block_Template
13
  */
14
  public function getTargetUrl()
15
  {
16
- $store = Mage::app()->getStore();
17
- return Mage::getUrl('emailcapture/index/capture', array('_secure' => $store->isCurrentlySecure()));
18
  }
19
 
20
  /**
13
  */
14
  public function getTargetUrl()
15
  {
16
+ $secure = Mage::app()->getFrontController()->getRequest()->isSecure();
17
+ return Mage::getUrl('emailcapture/index/capture', array('_secure' => $secure));
18
  }
19
 
20
  /**
app/code/community/Bronto/Newsletter/Model/Observer.php CHANGED
@@ -121,7 +121,9 @@ class Bronto_Newsletter_Model_Observer
121
  switch ($isSubscribed) {
122
  case Bronto_Api_Contact::STATUS_ACTIVE:
123
  case Bronto_Api_Contact::STATUS_ONBOARDING:
124
- return $subscriber->subscribe($email);
 
 
125
  break;
126
  case Bronto_Api_Contact::STATUS_UNSUBSCRIBED:
127
  return $subscriber->unsubscribe();
121
  switch ($isSubscribed) {
122
  case Bronto_Api_Contact::STATUS_ACTIVE:
123
  case Bronto_Api_Contact::STATUS_ONBOARDING:
124
+ if ($subscriber->getStatus() != Mage_Newsletter_Model_Subscriber::STATUS_SUBSCRIBED) {
125
+ $subscriber->subscribe($email);
126
+ }
127
  break;
128
  case Bronto_Api_Contact::STATUS_UNSUBSCRIBED:
129
  return $subscriber->unsubscribe();
app/code/community/Bronto/Newsletter/controllers/Adminhtml/NewsletterController.php CHANGED
@@ -105,6 +105,7 @@ class Bronto_Newsletter_Adminhtml_NewsletterController extends Mage_Adminhtml_Co
105
  $resource->getTable('bronto_newsletter/queue'),
106
  array('imported' => 1),
107
  array('bronto_suppressed IS NULL' => ''));
 
108
  } catch (Exception $e) {
109
  $helper->writeError($e);
110
  $this->_getSession()->addError('Mark All failed: ' . $e->getMessage());
@@ -170,7 +171,11 @@ class Bronto_Newsletter_Adminhtml_NewsletterController extends Mage_Adminhtml_Co
170
  $this->_getSession()->addError('Sync failed: ' . $e->getMessage());
171
  }
172
 
173
- $this->_getSession()->addSuccess(sprintf("%d of %d Subscribers were added to the Queue", $imported, $waiting));
 
 
 
 
174
 
175
  $returnParams = array('section' => 'bronto_newsletter');
176
  $returnParams = array_merge($returnParams, $helper->getScopeParams());
105
  $resource->getTable('bronto_newsletter/queue'),
106
  array('imported' => 1),
107
  array('bronto_suppressed IS NULL' => ''));
108
+ $helper->writeInfo("Mark All Subscribers was explicitly pressed.");
109
  } catch (Exception $e) {
110
  $helper->writeError($e);
111
  $this->_getSession()->addError('Mark All failed: ' . $e->getMessage());
171
  $this->_getSession()->addError('Sync failed: ' . $e->getMessage());
172
  }
173
 
174
+ if ($imported == $waiting && $waiting == 0) {
175
+ $this->_getSession()->addSuccess($helper->__('All Subscribers are synced to the queue.'));
176
+ } else {
177
+ $this->_getSession()->addSuccess(sprintf("%d of %d Subscribers were added to the Queue", $imported, $waiting));
178
+ }
179
 
180
  $returnParams = array('section' => 'bronto_newsletter');
181
  $returnParams = array_merge($returnParams, $helper->getScopeParams());
app/code/community/Bronto/Newsletter/etc/system.xml CHANGED
@@ -217,7 +217,7 @@
217
  <show_in_website>1</show_in_website>
218
  <show_in_store>1</show_in_store>
219
  <comment><![CDATA[Dynamic styling for the newly
220
- checkbox.<br/>Default: <pre>.col1-layout .billing_is_subscribed_box {
221
  margin-left: 240px !important;
222
  float:left;
223
  width:auto;
@@ -281,7 +281,7 @@
281
  <frontend_model>bronto_newsletter/adminhtml_system_config_cron</frontend_model>
282
  <sort_order>4</sort_order>
283
  <show_in_default>1</show_in_default>
284
- <show_in_website>0</show_in_website>
285
  <show_in_store>1</show_in_store>
286
  </cron_list>
287
  <suppressed>
217
  <show_in_website>1</show_in_website>
218
  <show_in_store>1</show_in_store>
219
  <comment><![CDATA[Dynamic styling for the newly
220
+ created checkbox.<br/>Default: <pre>.col1-layout .billing_is_subscribed_box {
221
  margin-left: 240px !important;
222
  float:left;
223
  width:auto;
281
  <frontend_model>bronto_newsletter/adminhtml_system_config_cron</frontend_model>
282
  <sort_order>4</sort_order>
283
  <show_in_default>1</show_in_default>
284
+ <show_in_website>1</show_in_website>
285
  <show_in_store>1</show_in_store>
286
  </cron_list>
287
  <suppressed>
app/code/community/Bronto/Order/Block/Adminhtml/Widget/Button/Mark.php CHANGED
@@ -11,7 +11,7 @@ class Bronto_Order_Block_Adminhtml_Widget_Button_Mark extends Mage_Adminhtml_Blo
11
  $this->setOnClick("deleteConfirm('This will mark all orders as imported and will not send the information to Bronto.\\n\\nAre you sure you want to do this?', '" . Mage::helper('bronto_customer')->getScopeUrl('*/order/mark') . "'); return false;");
12
  $this->setClass('bronto-cron-mark');
13
 
14
- if (!Mage::helper('bronto_newsletter')->isModuleActive() || (!Mage::helper('bronto_common')->isDebugEnabled())) {
15
  $this->setDisabled(true)->setClass('disabled');
16
  }
17
  }
11
  $this->setOnClick("deleteConfirm('This will mark all orders as imported and will not send the information to Bronto.\\n\\nAre you sure you want to do this?', '" . Mage::helper('bronto_customer')->getScopeUrl('*/order/mark') . "'); return false;");
12
  $this->setClass('bronto-cron-mark');
13
 
14
+ if (!Mage::helper('bronto_order')->isModuleActive() || (!Mage::helper('bronto_common')->isDebugEnabled())) {
15
  $this->setDisabled(true)->setClass('disabled');
16
  }
17
  }
app/code/community/Bronto/Order/Helper/Data.php CHANGED
@@ -13,6 +13,8 @@ class Bronto_Order_Helper_Data extends Bronto_Common_Helper_Data implements Bron
13
  const XML_PATH_INSTALL_DATE = 'bronto_order/settings/install_date';
14
  const XML_PATH_UPGRADE_DATE = 'bronto_order/settings/upgrade_date';
15
  const XML_PATH_BULK_LIMIT = 'bronto_order/settings/bulk_limit';
 
 
16
 
17
  const XML_PATH_PRICE = 'bronto_order/import/price';
18
  const XML_PATH_DESCRIPTION = 'bronto_order/import/description';
@@ -95,6 +97,34 @@ class Bronto_Order_Helper_Data extends Bronto_Common_Helper_Data implements Bron
95
  return (bool)$this->getAdminScopedConfig(self::XML_PATH_MAGE_CRON, 'default', 0);
96
  }
97
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
98
  /**
99
  * @return string
100
  */
13
  const XML_PATH_INSTALL_DATE = 'bronto_order/settings/install_date';
14
  const XML_PATH_UPGRADE_DATE = 'bronto_order/settings/upgrade_date';
15
  const XML_PATH_BULK_LIMIT = 'bronto_order/settings/bulk_limit';
16
+ const XML_PATH_IMPORT_STATES = 'bronto_order/settings/import_states';
17
+ const XML_PATH_DELETE_STATES = 'bronto_order/settings/delete_states';
18
 
19
  const XML_PATH_PRICE = 'bronto_order/import/price';
20
  const XML_PATH_DESCRIPTION = 'bronto_order/import/description';
97
  return (bool)$this->getAdminScopedConfig(self::XML_PATH_MAGE_CRON, 'default', 0);
98
  }
99
 
100
+ /**
101
+ * Gets the valid import states
102
+ *
103
+ * @return array
104
+ */
105
+ public function getImportStates($scope = 'default', $scopeId = 0)
106
+ {
107
+ $states = $this->getAdminScopedConfig(self::XML_PATH_IMPORT_STATES, $scope, $scopeId);
108
+ if (is_string($states)) {
109
+ $states = explode(',', $states);
110
+ }
111
+ return $states;
112
+ }
113
+
114
+ /**
115
+ * Gets the valid delete states
116
+ *
117
+ * @return array
118
+ */
119
+ public function getDeleteStates($scope = 'default', $scopeId = 0)
120
+ {
121
+ $states = $this->getAdminScopedConfig(self::XML_PATH_DELETE_STATES, $scope, $scopeId);
122
+ if (is_string($states)) {
123
+ $states = explode(',', $states);
124
+ }
125
+ return $states;
126
+ }
127
+
128
  /**
129
  * @return string
130
  */
app/code/community/Bronto/Order/Model/Observer.php CHANGED
@@ -42,6 +42,204 @@ class Bronto_Order_Model_Observer
42
  }
43
  }
44
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
45
  /**
46
  * Process specified number of items for specified store
47
  *
@@ -113,6 +311,11 @@ class Bronto_Order_Model_Observer
113
  $inclDiscounts = $this->_helper->isDiscountIncluded('store', $store->getId());
114
  $uploadMax = $this->_helper->getBulkLimit('store', $store->getId());
115
  $orderCache = array();
 
 
 
 
 
116
 
117
  // Cycle through each order queue row
118
  foreach ($orderRows as $orderRow/* @var $orderRow Bronto_Order_Model_Queue */) {
@@ -120,10 +323,10 @@ class Bronto_Order_Model_Observer
120
  $quoteId = $orderRow->getQuoteId();
121
 
122
  // Check if the order id is still attached to an order in magento
123
- if ($order = Mage::getModel('sales/order')->load($orderId)/* @var $order Mage_Sales_Model_Order */) {
 
124
  // Log that we are processing the current order
125
- $this->_helper->writeDebug(" Processing Order ID: {$orderId}");
126
- $orderCache[] = array('orderId' => $orderId, 'quoteId' => $quoteId, 'storeId' => $storeId);
127
 
128
  /* @var $brontoOrder Bronto_Api_Order_Row */
129
  $brontoOrder = $orderObject->createRow();
@@ -135,170 +338,36 @@ class Bronto_Order_Model_Observer
135
  if ($tid = $orderRow->getBrontoTid()) {
136
  $brontoOrder->tid = $tid;
137
  }
138
- $brontoOrderItems = array();
139
-
140
- // If the order has been cancelled, placed on hold, or closed we delete the row
141
- switch ($order->getState()) {
142
- case Mage_Sales_Model_Order::STATE_CANCELED:
143
- case Mage_Sales_Model_Order::STATE_HOLDED:
144
- case Mage_Sales_Model_Order::STATE_CLOSED:
145
- $brontoOrder->delete();
146
- $orderRow
147
- ->setBrontoImported(Mage::getSingleton('core/date')->gmtDate())
148
- ->save();
149
- break;
150
-
151
- default:
152
- // Get visible items from order
153
- $items = $order->getAllVisibleItems();
154
-
155
- // Keep product order by using a new array
156
- $fullItems = array();
157
-
158
- // loop through the items. if it's a bundled item,
159
- // replace the parent item with the child items.
160
- foreach ($items as $item) {
161
- $itemProduct = Mage::getModel('catalog/product')->load($item->getProductId());
162
-
163
- // Handle product based on product type
164
- switch ($itemProduct->getTypeId()) {
165
-
166
- // Bundled products need child items
167
- case Mage_Catalog_Model_Product_Type::TYPE_BUNDLE:
168
- if (count($item->getChildrenItems()) > 0) {
169
- foreach ($item->getChildrenItems() as $childItem) {
170
- if ($childItem->getPrice() != 0) {
171
- $item->setPrice(0);
172
- }
173
- $fullItems[] = $childItem;
174
- }
175
- }
176
- $fullItems[] = $item;
177
-
178
- break;
179
-
180
- // Configurable products just need simple config item
181
- case Mage_Catalog_Model_Product_Type::TYPE_CONFIGURABLE:
182
- $childItems = $item->getChildrenItems();
183
- if (1 === count($childItems)) {
184
- $childItem = $childItems[0];
185
-
186
- // Collect options applicable to the configurable product
187
- $productAttributeOptions = $itemProduct->getTypeInstance(true)->getConfigurableAttributesAsArray($itemProduct);
188
-
189
- // Build Selected Options Name
190
- $nameWithOptions = array();
191
- foreach ($productAttributeOptions as $productAttribute) {
192
- $itemValue = $productHelper->getProductAttribute($childItem->getProductId(), $productAttribute['attribute_code'], $storeId);
193
- $nameWithOptions[] = $productAttribute['label'] . ': ' . $itemValue;
194
- }
195
-
196
- // Set parent product name to include selected options
197
- $parentName = $item->getName() . ' [' . implode(', ', $nameWithOptions) . ']';
198
- $item->setName($parentName);
199
- }
200
-
201
- $fullItems[] = $item;
202
- break;
203
-
204
- // Grouped products need parent and child items
205
- case Mage_Catalog_Model_Product_Type::TYPE_GROUPED:
206
- // This condition probably never gets hit, parent grouped items don't show in order
207
- $fullItems[] = $item;
208
- foreach ($item->getChildrenItems() as $child_item) {
209
- $fullItems[] = $child_item;
210
- }
211
- break;
212
-
213
- // Anything else (namely simples) just get added to array
214
- default:
215
- $fullItems[] = $item;
216
- break;
217
- }
218
- }
219
-
220
- // Cycle through newly created array of products
221
- foreach ($fullItems as $item/* @var $item Mage_Sales_Model_Order_Item */) {
222
- // If product has a parent, get that parent product
223
- $parent = false;
224
- if ($item->getParentItem()) {
225
- $parent = Mage::getModel('catalog/product')->setStoreId($storeId)->load($item->getParentItem()->getProductId());
226
- }
227
-
228
- /* @var $product Mage_Catalog_Model_Product */
229
- $product = Mage::getModel('catalog/product')->setStoreId($storeId)->load($item->getProductId());
230
 
231
- // If there is a parent product, use that to get category ids
232
- if ($parent) {
233
- $categoryIds = $parent->getCategoryIds();
234
- } else {
235
- $categoryIds = $product->getCategoryIds();
236
- }
237
-
238
- // If the product type is simple and the description
239
- // is empty, then attempt to find a parent product
240
- // to backfill the description.
241
- if ($product->getTypeId() == Mage_Catalog_Model_Product_Type::TYPE_SIMPLE && !$product->getData($descriptionAttr)) {
242
- $parentIds = Mage::getModel('catalog/product_type_configurable')->getParentIdsByChild($product->getId());
243
- if (isset($parentIds[0])) {
244
- $parentProduct = Mage::getModel('catalog/product')->setStoreId($storeId)->load($parentIds[0]);
245
- $product->setData($descriptionAttr, $parentProduct->getData($descriptionAttr));
246
- }
247
- }
248
-
249
- if (empty($categoryIds)) {
250
- if (empty($parentProduct)) {
251
- $parentIds = Mage::getModel('catalog/product_type_configurable')->getParentIdsByChild($product->getId());
252
- if (isset($parentIds[0])) {
253
- $parentProduct = Mage::getModel('catalog/product')->setStoreId($storeId)->load($parentIds[0]);
254
- }
255
- }
256
- if ($parentProduct) {
257
- $categoryIds = $parentProduct->getCategoryIds();
258
- }
259
- }
260
-
261
- // Cycle through category ids to pull category details
262
- $categories = array();
263
- foreach ($categoryIds as $categoryId) {
264
- /* @var $category Mage_Catalog_Model_Category */
265
- $category = Mage::getModel('catalog/category')->load($categoryId);
266
- $parent = $category->getParentCategory();
267
- $categories[] = $parent->getUrlKey() ? $parent->getUrlKey() : $parent->formatUrlKey($parent->getName());
268
- $categories[] = $category->getUrlKey() ? $category->getUrlKey() : $category->formatUrlKey($category->getName());
269
- }
270
-
271
- // Check to ensure there are no duplicate categories
272
- $categories = array_unique($categories);
273
-
274
- // Write orderItem
275
- $brontoOrderItems[] = array(
276
- 'id' => $item->getId(),
277
- 'sku' => $item->getSku(),
278
- 'name' => $item->getName(),
279
- 'description' => $product->getData($descriptionAttr),
280
- 'category' => implode(' ', $categories),
281
- 'image' => $this->_helper->getItemImg($item, $product, $storeId),
282
- 'url' => $this->_helper->getItemUrl($item, $product, $storeId),
283
- 'quantity' => (int)$item->getQtyOrdered(),
284
- 'price' => $this->_helper->getItemPrice($item, $basePrefix, $inclTaxes, $inclDiscounts)
285
- );
286
- }
287
- $brontoOrder->products = $brontoOrderItems;
288
- $brontoOrder->persist();
289
- break;
290
  }
291
 
292
  // increment total number of items processed
293
  $result['total']++;
294
 
295
  try {
296
- // Mark order as imported
297
- // $orderRow->setBrontoImported(Mage::getSingleton('core/date')->gmtDate());
298
- // $orderRow->save();
299
-
300
- // Flush every 10 orders
301
- if ($result['total'] % $uploadMax === 0) {
302
  $result = $this->_flushOrders($orderObject, $orderCache, $result);
303
  $orderCache = array();
304
  }
@@ -312,6 +381,9 @@ class Bronto_Order_Model_Observer
312
  // increment number of errors
313
  $result['error']++;
314
  }
 
 
 
315
  }
316
  }
317
 
42
  }
43
  }
44
 
45
+ /**
46
+ * Creates a lookup table for states used in the import proccess
47
+ *
48
+ * @param array $allStates
49
+ * @param array $iterativeStates
50
+ * @return array
51
+ */
52
+ protected function _createStateMap($allStates, $iterativeStates)
53
+ {
54
+ $stateMap = array();
55
+ foreach ($iterativeStates as $stateName) {
56
+ if (array_key_exists($stateName, $allStates)) {
57
+ $stateMap[$stateName] = $allStates[$stateName];
58
+ }
59
+ }
60
+ return $stateMap;
61
+ }
62
+
63
+ /**
64
+ * Function to delete orders in Bronto
65
+ *
66
+ * @param Mage_Sales_Model_Order $order
67
+ * @param Bronto_Api_Order $brontoOrder
68
+ * @param Bronto_Order_Model_Queue $orderRow
69
+ * @return boolean;
70
+ */
71
+ protected function _deleteOrder($order, $brontoOrder, $orderRow)
72
+ {
73
+ try {
74
+ $deleteDate = Mage::getSingleton('core/date')->gmtDate();
75
+ $brontoOrder->delete();
76
+ $orderRow->setBrontoImported($deleteDate)->save();
77
+ $this->_helper->writeDebug(" Successfully deleted order...");
78
+ return true;
79
+ } catch (Exception $e) {
80
+ $this->_helper->writeError(" Failed to delete order: {$e->getMessage()}");
81
+ $orderRow
82
+ ->setBrontoImported(null)
83
+ ->setBrontoSuppressed($e->getMessage())
84
+ ->save();
85
+ }
86
+ return false;
87
+ }
88
+
89
+ /**
90
+ * Function to persist orders to be flushed to Bronto
91
+ *
92
+ * @param Mage_Sales_Model_Order $order
93
+ * @param Bronto_Api_Order $brontoOrder
94
+ * @param Bronto_Order_Model_Queue $orderRow
95
+ * @param array $context
96
+ */
97
+ protected function _persistOrder($order, $brontoOrder, $orderRow, $context)
98
+ {
99
+ extract($context);
100
+ // Get visible items from order
101
+ $items = $order->getAllVisibleItems();
102
+
103
+ // Keep product order by using a new array
104
+ $fullItems = array();
105
+ $brontoOrderItems = array();
106
+
107
+ // loop through the items. if it's a bundled item,
108
+ // replace the parent item with the child items.
109
+ foreach ($items as $item) {
110
+ $itemProduct = Mage::getModel('catalog/product')->load($item->getProductId());
111
+
112
+ // Handle product based on product type
113
+ switch ($itemProduct->getTypeId()) {
114
+
115
+ // Bundled products need child items
116
+ case Mage_Catalog_Model_Product_Type::TYPE_BUNDLE:
117
+ if (count($item->getChildrenItems()) > 0) {
118
+ foreach ($item->getChildrenItems() as $childItem) {
119
+ if ($childItem->getPrice() != 0) {
120
+ $item->setPrice(0);
121
+ }
122
+ $fullItems[] = $childItem;
123
+ }
124
+ }
125
+ $fullItems[] = $item;
126
+
127
+ break;
128
+
129
+ // Configurable products just need simple config item
130
+ case Mage_Catalog_Model_Product_Type::TYPE_CONFIGURABLE:
131
+ $childItems = $item->getChildrenItems();
132
+ if (1 === count($childItems)) {
133
+ $childItem = $childItems[0];
134
+
135
+ // Collect options applicable to the configurable product
136
+ $productAttributeOptions = $itemProduct->getTypeInstance(true)->getConfigurableAttributesAsArray($itemProduct);
137
+
138
+ // Build Selected Options Name
139
+ $nameWithOptions = array();
140
+ foreach ($productAttributeOptions as $productAttribute) {
141
+ $itemValue = $productHelper->getProductAttribute($childItem->getProductId(), $productAttribute['attribute_code'], $storeId);
142
+ $nameWithOptions[] = $productAttribute['label'] . ': ' . $itemValue;
143
+ }
144
+
145
+ // Set parent product name to include selected options
146
+ $parentName = $item->getName() . ' [' . implode(', ', $nameWithOptions) . ']';
147
+ $item->setName($parentName);
148
+ }
149
+
150
+ $fullItems[] = $item;
151
+ break;
152
+
153
+ // Grouped products need parent and child items
154
+ case Mage_Catalog_Model_Product_Type::TYPE_GROUPED:
155
+ // This condition probably never gets hit, parent grouped items don't show in order
156
+ $fullItems[] = $item;
157
+ foreach ($item->getChildrenItems() as $child_item) {
158
+ $fullItems[] = $child_item;
159
+ }
160
+ break;
161
+
162
+ // Anything else (namely simples) just get added to array
163
+ default:
164
+ $fullItems[] = $item;
165
+ break;
166
+ }
167
+ }
168
+
169
+ // Cycle through newly created array of products
170
+ foreach ($fullItems as $item/* @var $item Mage_Sales_Model_Order_Item */) {
171
+ // If product has a parent, get that parent product
172
+ $parent = false;
173
+ if ($item->getParentItem()) {
174
+ $parent = Mage::getModel('catalog/product')->setStoreId($storeId)->load($item->getParentItem()->getProductId());
175
+ }
176
+
177
+ /* @var $product Mage_Catalog_Model_Product */
178
+ $product = Mage::getModel('catalog/product')->setStoreId($storeId)->load($item->getProductId());
179
+
180
+ // If there is a parent product, use that to get category ids
181
+ if ($parent) {
182
+ $categoryIds = $parent->getCategoryIds();
183
+ } else {
184
+ $categoryIds = $product->getCategoryIds();
185
+ }
186
+
187
+ // If the product type is simple and the description
188
+ // is empty, then attempt to find a parent product
189
+ // to backfill the description.
190
+ $parentProduct = $productHelper->getConfigurableProduct($product);
191
+ if (!$product->getData($descriptionAttr)) {
192
+ $product->setData($descriptionAttr, $parentProduct->getData($descriptionAttr));
193
+ }
194
+
195
+ if (empty($categoryIds)) {
196
+ $categoryIds = $parentProduct->getCategoryIds();
197
+ }
198
+
199
+ // Cycle through category ids to pull category details
200
+ $categories = array();
201
+ foreach ($categoryIds as $categoryId) {
202
+ /* @var $category Mage_Catalog_Model_Category */
203
+ $category = Mage::getModel('catalog/category')->load($categoryId);
204
+ $parent = $category->getParentCategory();
205
+ $categories[] = $parent->getUrlKey() ? $parent->getUrlKey() : $parent->formatUrlKey($parent->getName());
206
+ $categories[] = $category->getUrlKey() ? $category->getUrlKey() : $category->formatUrlKey($category->getName());
207
+ }
208
+
209
+ // Check to ensure there are no duplicate categories
210
+ $categories = array_unique($categories);
211
+
212
+ // Write orderItem
213
+ $brontoOrderItems[] = array(
214
+ 'id' => $item->getId(),
215
+ 'sku' => $item->getSku(),
216
+ 'name' => $item->getName(),
217
+ 'description' => $product->getData($descriptionAttr),
218
+ 'category' => implode(' ', $categories),
219
+ 'image' => $this->_helper->getItemImg($item, $product, $storeId),
220
+ 'url' => $this->_helper->getItemUrl($item, $product, $storeId),
221
+ 'quantity' => (int)$item->getQtyOrdered(),
222
+ 'price' => $this->_helper->getItemPrice($item, $basePrefix, $inclTaxes, $inclDiscounts)
223
+ );
224
+ }
225
+ $brontoOrder->products = $brontoOrderItems;
226
+ $brontoOrder->persist();
227
+ }
228
+
229
+ /**
230
+ * Skips the order because it's in one invalid state or another
231
+ *
232
+ * @param Mage_Sales_Model_Order $order
233
+ * @param Bronto_Order_Model_Queue $orderRow
234
+ * @param string $reason
235
+ */
236
+ protected function _skipOrder($order, $orderRow, $reason)
237
+ {
238
+ $importDate = Mage::getSingleton('core/date')->gmtDate();
239
+ $orderRow->setBrontoImported($importDate)->save();
240
+ $this->_helper->writeInfo(" Skipping order id {$order->getId()} #{$order->getIncrementId()}: {$reason}");
241
+ }
242
+
243
  /**
244
  * Process specified number of items for specified store
245
  *
311
  $inclDiscounts = $this->_helper->isDiscountIncluded('store', $store->getId());
312
  $uploadMax = $this->_helper->getBulkLimit('store', $store->getId());
313
  $orderCache = array();
314
+ $allStates = Mage::getModel('bronto_order/system_config_source_order_state')->toArray();
315
+ $importStateMap = $this->_createStateMap($allStates, $this->_helper->getImportStates('store', $store->getId()));
316
+ $deleteStateMap = $this->_createStateMap($allStates, $this->_helper->getDeleteStates('store', $store->getId()));
317
+ $this->_helper->writeDebug(" Importing: " . implode(', ', $importStateMap));
318
+ $this->_helper->writeDebug(" Deleting: " . implode(', ', $deleteStateMap));
319
 
320
  // Cycle through each order queue row
321
  foreach ($orderRows as $orderRow/* @var $orderRow Bronto_Order_Model_Queue */) {
323
  $quoteId = $orderRow->getQuoteId();
324
 
325
  // Check if the order id is still attached to an order in magento
326
+ $order = Mage::getModel('sales/order')->load($orderId);
327
+ if ($order->getId()) {
328
  // Log that we are processing the current order
329
+ $this->_helper->writeDebug(" Processing Order ID: {$orderId} \t #{$order->getIncrementId()}");
 
330
 
331
  /* @var $brontoOrder Bronto_Api_Order_Row */
332
  $brontoOrder = $orderObject->createRow();
338
  if ($tid = $orderRow->getBrontoTid()) {
339
  $brontoOrder->tid = $tid;
340
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
341
 
342
+ if (empty($brontoOrder->id)) {
343
+ $this->_skipOrder($order, $orderRow, "Invalid increment ID");
344
+ $result['success']++;
345
+ } else if (array_key_exists($order->getState(), $importStateMap)) {
346
+ $this->_persistOrder($order, $brontoOrder, $orderRow, array(
347
+ 'productHelper' => $productHelper,
348
+ 'descriptionAttr' => $descriptionAttr,
349
+ 'basePrefix' => $basePrefix,
350
+ 'inclTaxes' => $inclTaxes,
351
+ 'inclDiscounts' => $inclDiscounts,
352
+ 'storeId' => $storeId,
353
+ ));
354
+ $orderCache[] = array('orderId' => $orderId, 'quoteId' => $quoteId, 'storeId' => $storeId);
355
+ } else if (array_key_exists($order->getState(), $deleteStateMap)) {
356
+ if ($this->_deleteOrder($order, $brontoOrder, $orderRow)) {
357
+ $result['success']++;
358
+ } else {
359
+ $result['error']++;
360
+ }
361
+ } else {
362
+ $this->_skipOrder($order, $orderRow, "Invalid state {$allStates[$order->getState()]}");
363
+ $result['success']++;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
364
  }
365
 
366
  // increment total number of items processed
367
  $result['total']++;
368
 
369
  try {
370
+ if (count($orderCache) == $uploadMax) {
 
 
 
 
 
371
  $result = $this->_flushOrders($orderObject, $orderCache, $result);
372
  $orderCache = array();
373
  }
381
  // increment number of errors
382
  $result['error']++;
383
  }
384
+ } else {
385
+ $this->_skipOrder($order, $orderRow, "Invalid order");
386
+ $result['success']++;
387
  }
388
  }
389
 
app/code/community/Bronto/Order/Model/Queue.php CHANGED
@@ -96,7 +96,7 @@ class Bronto_Order_Model_Queue extends Mage_Core_Model_Abstract
96
  $select->from(
97
  array('order' => $resource->getTable('sales/order')), array(new Zend_Db_Expr('COUNT(entity_id) as count'))
98
  )
99
- ->where('NOT EXISTS (?)', $this->_getSubselect($resource, $adapter));
100
 
101
  // Get Results
102
  $result = $adapter->query($select)->fetch();
@@ -121,9 +121,8 @@ class Bronto_Order_Model_Queue extends Mage_Core_Model_Abstract
121
  // Build Sub-Select Statement
122
  $subselect = $adapter->select()
123
  ->from(
124
- array('queue' => $resource->getTable('bronto_order/queue')), array(new Zend_Db_Expr(1))
125
- )
126
- ->where('queue.order_id = order.entity_id');
127
 
128
  return $subselect;
129
  }
@@ -147,7 +146,7 @@ class Bronto_Order_Model_Queue extends Mage_Core_Model_Abstract
147
  ->from(
148
  array('order' => $resource->getTable('sales/order')), array('entity_id', 'store_id', 'quote_id', 'created_at')
149
  )
150
- ->where('NOT EXISTS (?)', $this->_getSubselect($resource, $adapter))
151
  ->limit($count);
152
 
153
  // Get Results
96
  $select->from(
97
  array('order' => $resource->getTable('sales/order')), array(new Zend_Db_Expr('COUNT(entity_id) as count'))
98
  )
99
+ ->where('`order`.`entity_id` NOT IN (?)', $this->_getSubselect($resource, $adapter));
100
 
101
  // Get Results
102
  $result = $adapter->query($select)->fetch();
121
  // Build Sub-Select Statement
122
  $subselect = $adapter->select()
123
  ->from(
124
+ array('queue' => $resource->getTable('bronto_order/queue')), array('order_id')
125
+ );
 
126
 
127
  return $subselect;
128
  }
146
  ->from(
147
  array('order' => $resource->getTable('sales/order')), array('entity_id', 'store_id', 'quote_id', 'created_at')
148
  )
149
+ ->where('`order`.`entity_id` NOT IN (?)', $this->_getSubselect($resource, $adapter))
150
  ->limit($count);
151
 
152
  // Get Results
app/code/community/Bronto/Order/Model/System/Config/Source/Order/State.php ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Bronto_Order_Model_System_Config_Source_Order_State
4
+ {
5
+ private $_states = array();
6
+
7
+ /**
8
+ * @return array
9
+ */
10
+ public function toOptionArray()
11
+ {
12
+ $array = array();
13
+ foreach ($this->toArray() as $value => $label) {
14
+ $array[] = array(
15
+ 'value' => $value,
16
+ 'label' => $label,
17
+ );
18
+ }
19
+ return $array;
20
+ }
21
+
22
+ /**
23
+ * @return array
24
+ */
25
+ public function toArray()
26
+ {
27
+ if (!empty($this->_states)) {
28
+ return $this->_states;
29
+ }
30
+ $states = Mage::getModel('sales/order_config')->getNode('states');
31
+ foreach ($states->children() as $state) {
32
+ $this->_states[$state->getName()] = (string) $state->label;
33
+ }
34
+ return $this->_states;
35
+ }
36
+ }
app/code/community/Bronto/Order/controllers/Adminhtml/OrderController.php CHANGED
@@ -116,6 +116,7 @@ class Bronto_Order_Adminhtml_OrderController extends Mage_Adminhtml_Controller_A
116
  array('bronto_imported' => $date),
117
  $where
118
  );
 
119
  } catch (Exception $e) {
120
  $helper->writeError($e);
121
  $this->_getSession()->addError('Mark failed: ' . $e->getMessage());
@@ -135,11 +136,9 @@ class Bronto_Order_Adminhtml_OrderController extends Mage_Adminhtml_Controller_A
135
  $imported = 0;
136
 
137
  try {
138
- $orders = $helper->getMissingOrders();
139
- $waiting = count($orders);
140
-
141
- if ($waiting > 0) {
142
- foreach ($orders as $order) {
143
  Mage::getModel('bronto_order/queue')->getOrderRow($order['entity_id'], null, $order['store_id'])
144
  ->setQuoteId($order['quote_id'])
145
  ->setCreatedAt($order['created_at'])
@@ -155,7 +154,11 @@ class Bronto_Order_Adminhtml_OrderController extends Mage_Adminhtml_Controller_A
155
  $this->_getSession()->addError('Sync failed: ' . $e->getMessage());
156
  }
157
 
158
- $this->_getSession()->addSuccess(sprintf("%d of %d Orders were added to the Queue", $imported, $waiting));
 
 
 
 
159
 
160
  $returnParams = array('section' => 'bronto_order');
161
  $returnParams = array_merge($returnParams, $helper->getScopeParams());
116
  array('bronto_imported' => $date),
117
  $where
118
  );
119
+ $helper->writeInfo("Mark All Orders was explicitly pressed.");
120
  } catch (Exception $e) {
121
  $helper->writeError($e);
122
  $this->_getSession()->addError('Mark failed: ' . $e->getMessage());
136
  $imported = 0;
137
 
138
  try {
139
+ $waiting = $helper->getMissingOrdersCount();
140
+ if ($waiting) {
141
+ foreach ($helper->getMissingOrders() as $order) {
 
 
142
  Mage::getModel('bronto_order/queue')->getOrderRow($order['entity_id'], null, $order['store_id'])
143
  ->setQuoteId($order['quote_id'])
144
  ->setCreatedAt($order['created_at'])
154
  $this->_getSession()->addError('Sync failed: ' . $e->getMessage());
155
  }
156
 
157
+ if ($imported == $waiting && $waiting == 0) {
158
+ $this->_getSession()->addSuccess($helper->__('All Orders are synced to the queue.'));
159
+ } else {
160
+ $this->_getSession()->addSuccess(sprintf("%d of %d Orders were added to the Queue", $imported, $waiting));
161
+ }
162
 
163
  $returnParams = array('section' => 'bronto_order');
164
  $returnParams = array_merge($returnParams, $helper->getScopeParams());
app/code/community/Bronto/Order/etc/config.xml CHANGED
@@ -102,14 +102,6 @@
102
  </events>
103
  </frontend>
104
  <admin>
105
- <blocks>
106
- <adminhtml>
107
- <rewrite>
108
- <sales_order_view_tab_info>bronto_order/adminhtml_sales_order_view_tab_info
109
- </sales_order_view_tab_info>
110
- </rewrite>
111
- </adminhtml>
112
- </blocks>
113
  <routers>
114
  <adminhtml>
115
  <args>
@@ -131,6 +123,8 @@
131
  <limit>250</limit>
132
  <sync_limit>1000</sync_limit>
133
  <bulk_limit>100</bulk_limit>
 
 
134
  </settings>
135
  <import>
136
  <description>short_description</description>
102
  </events>
103
  </frontend>
104
  <admin>
 
 
 
 
 
 
 
 
105
  <routers>
106
  <adminhtml>
107
  <args>
123
  <limit>250</limit>
124
  <sync_limit>1000</sync_limit>
125
  <bulk_limit>100</bulk_limit>
126
+ <import_states>new,pending_payment,processing,complete,payment_review</import_states>
127
+ <delete_states>closed,canceled,holded</delete_states>
128
  </settings>
129
  <import>
130
  <description>short_description</description>
app/code/community/Bronto/Order/etc/system.xml CHANGED
@@ -145,6 +145,34 @@
145
  <show_in_store>1</show_in_store>
146
  <comment>Number of orders to send to Bronto at a time.</comment>
147
  </bulk_limit>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
148
  </fields>
149
  </settings>
150
  <import>
145
  <show_in_store>1</show_in_store>
146
  <comment>Number of orders to send to Bronto at a time.</comment>
147
  </bulk_limit>
148
+ <import_states>
149
+ <label>Order Import State</label>
150
+ <depends>
151
+ <enabled>1</enabled>
152
+ </depends>
153
+ <frontend_type>multiselect</frontend_type>
154
+ <source_model>bronto_order/system_config_source_order_state</source_model>
155
+ <sort_order>75</sort_order>
156
+ <show_in_default>1</show_in_default>
157
+ <show_in_website>1</show_in_website>
158
+ <show_in_store>1</show_in_store>
159
+ <comment><![CDATA[Import orders that transition to these states.<br/>
160
+ <strong>Default</strong>: New, Pending Payment,
161
+ Processing, Complete, Payment Review]]></comment>
162
+ </import_states>
163
+ <delete_states>
164
+ <label>Order Delete State</label>
165
+ <depends>
166
+ <enabled>1</enabled>
167
+ </depends>
168
+ <frontend_type>multiselect</frontend_type>
169
+ <source_model>bronto_order/system_config_source_order_state</source_model>
170
+ <sort_order>80</sort_order>
171
+ <show_in_default>1</show_in_default>
172
+ <show_in_website>1</show_in_website>
173
+ <show_in_store>1</show_in_store>
174
+ <comment><![CDATA[Delete orders that transition to these states.<br/><strong>Default</strong>: Closed, Canceled, On Hold]]></comment>
175
+ </delete_states>
176
  </fields>
177
  </settings>
178
  <import>
app/code/community/Bronto/Product/Block/Adminhtml/System/Recommendation/Edit/Form.php CHANGED
@@ -8,13 +8,14 @@ class Bronto_Product_Block_Adminhtml_System_Recommendation_Edit_Form extends Mag
8
  * Creates a select button used for choosing products manually
9
  *
10
  * @param string $field
 
11
  * @return Mage_Adminhtml_Block_Widget_Button
12
  */
13
- protected function _selectButton($field)
14
  {
15
  return $this->getLayout()->createBlock('adminhtml/widget_button')
16
  ->setData(array(
17
- 'label' => $this->__('Select Products'),
18
  'onclick' => "selectProducts('{$field}', true);",
19
  'class' => 'go'
20
  ));
@@ -53,6 +54,7 @@ class Bronto_Product_Block_Adminhtml_System_Recommendation_Edit_Form extends Mag
53
  $model->setTagContent($this->getLayout()->createBlock('bronto_product/adminhtml_system_recommendation_default')->toHtml());
54
  }
55
  }
 
56
 
57
  $form = new Varien_Data_Form(array(
58
  'id' => 'edit_form',
@@ -160,6 +162,24 @@ class Bronto_Product_Block_Adminhtml_System_Recommendation_Edit_Form extends Mag
160
  'name' => 'fallback_source_hidden'
161
  ));
162
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
163
  if ($model->isContentTag()) {
164
  $this->_prepareContentTagBasedForm($fieldset);
165
  }
@@ -215,6 +235,10 @@ class Bronto_Product_Block_Adminhtml_System_Recommendation_Edit_Form extends Mag
215
  </tr>
216
  </thead>
217
  <tbody>
 
 
 
 
218
  <tr>
219
  <td>Related Product\'s name</td>
220
  <td>relatedName_#</td>
8
  * Creates a select button used for choosing products manually
9
  *
10
  * @param string $field
11
+ * @param string $label
12
  * @return Mage_Adminhtml_Block_Widget_Button
13
  */
14
+ protected function _selectButton($field, $label = 'Select Products')
15
  {
16
  return $this->getLayout()->createBlock('adminhtml/widget_button')
17
  ->setData(array(
18
+ 'label' => $this->__($label),
19
  'onclick' => "selectProducts('{$field}', true);",
20
  'class' => 'go'
21
  ));
54
  $model->setTagContent($this->getLayout()->createBlock('bronto_product/adminhtml_system_recommendation_default')->toHtml());
55
  }
56
  }
57
+ $model->setExclusionSource(Bronto_Product_Model_Recommendation::SOURCE_CUSTOM);
58
 
59
  $form = new Varien_Data_Form(array(
60
  'id' => 'edit_form',
162
  'name' => 'fallback_source_hidden'
163
  ));
164
 
165
+ $exclusionSource = $fieldset->addField('exclusion_source', 'hidden', array(
166
+ 'name' => 'exclusion_source',
167
+ 'value' => 'custom',
168
+ 'title' => $this->__('Excluded Source')
169
+ ));
170
+
171
+ $manualExl = $fieldset->addField('manual_exclusion_source', 'text', array(
172
+ 'name' => 'manual_exclusion_source',
173
+ 'label' => $this->_selectButton('manual_exclusion_source', 'Exclude Products')->toHtml(),
174
+ 'title' => $this->__('Custom Products'),
175
+ 'note' => $this->__('Selected Products will be excluded.'),
176
+ ));
177
+ $manualExl->setRenderer($this->_getButtonRenderer());
178
+
179
+ $manualExlHide = $fieldset->addField('exclusion_source_hidden', 'hidden', array(
180
+ 'name' => 'exclusion_source_hidden',
181
+ ));
182
+
183
  if ($model->isContentTag()) {
184
  $this->_prepareContentTagBasedForm($fieldset);
185
  }
235
  </tr>
236
  </thead>
237
  <tbody>
238
+ <tr>
239
+ <td>Related Product\'s ID</td>
240
+ <td>relatedId_#</td>
241
+ </tr>
242
  <tr>
243
  <td>Related Product\'s name</td>
244
  <td>relatedName_#</td>
app/code/community/Bronto/Product/Block/Adminhtml/System/Recommendation/Grid.php CHANGED
@@ -3,7 +3,7 @@
3
  class Bronto_Product_Block_Adminhtml_System_Recommendation_Grid extends Mage_Adminhtml_Block_Widget_Grid
4
  {
5
  /**
6
- * Override paretn constructor for some grid specific things
7
  *
8
  * @param array $attributes (Optional)
9
  * @see parent
3
  class Bronto_Product_Block_Adminhtml_System_Recommendation_Grid extends Mage_Adminhtml_Block_Widget_Grid
4
  {
5
  /**
6
+ * Override parent constructor for some grid specific things
7
  *
8
  * @param array $attributes (Optional)
9
  * @see parent
app/code/community/Bronto/Product/Block/Adminhtml/System/Recommendation/Preview/Grid.php CHANGED
@@ -131,10 +131,10 @@ class Bronto_Product_Block_Adminhtml_System_Recommendation_Preview_Grid extends
131
  */
132
  public function getRelatedProductIds()
133
  {
134
- return Mage::helper('bronto_product')->collectRecommendations(
135
  $this->getSelectedRecommendation(),
136
  $this->_getStore()->getId(),
137
- $this->getOptionalProducts());
138
  }
139
 
140
  /**
131
  */
132
  public function getRelatedProductIds()
133
  {
134
+ return array_keys(Mage::helper('bronto_product')->collectRecommendations(
135
  $this->getSelectedRecommendation(),
136
  $this->_getStore()->getId(),
137
+ $this->getOptionalProducts()));
138
  }
139
 
140
  /**
app/code/community/Bronto/Product/Helper/Data.php CHANGED
@@ -31,6 +31,14 @@ class Bronto_Product_Helper_Data extends Bronto_Common_Helper_Data
31
  return (bool)$this->getAdminScopedConfig(self::XML_PATH_MAGE_CRON, $scope, $scopeId);
32
  }
33
 
 
 
 
 
 
 
 
 
34
  /**
35
  * Gets the character truncation limit for the description attr
36
  *
@@ -80,7 +88,7 @@ class Bronto_Product_Helper_Data extends Bronto_Common_Helper_Data
80
  */
81
  public function getName()
82
  {
83
- return 'Bronto Product Recommendations';
84
  }
85
 
86
  /**
@@ -113,7 +121,7 @@ class Bronto_Product_Helper_Data extends Bronto_Common_Helper_Data
113
  {
114
  return Mage::getModel('bronto_product/collect')
115
  ->setRecommendation($recommendation)
116
- ->setOriginalHash($this->itemsToProductHash($originalItems))
117
  ->setStoreId($storeId);
118
  }
119
 
@@ -123,12 +131,13 @@ class Bronto_Product_Helper_Data extends Bronto_Common_Helper_Data
123
  * @param mixed $items
124
  * @return array
125
  */
126
- public function itemsToProductHash($items)
127
  {
128
  $hash = array();
 
129
  foreach ($items as $item) {
130
  if (is_numeric($item)) {
131
- $item = Mage::getModel('catalog/product')->load($item);
132
  }
133
  if ($item->getParentItem()) {
134
  continue;
@@ -139,11 +148,12 @@ class Bronto_Product_Helper_Data extends Bronto_Common_Helper_Data
139
  }
140
  $product = $item->getProduct();
141
  if (!$product) {
142
- $product = Mage::getModel('catalog/product')->load($item->getProductId());
143
  }
144
  } else {
145
  $product = $item;
146
  }
 
147
  $hash[$product->getId()] = $product;
148
  }
149
  return $hash;
@@ -219,24 +229,19 @@ class Bronto_Product_Helper_Data extends Bronto_Common_Helper_Data
219
  /**
220
  * Creates the fields to process by products and store
221
  *
222
- * @param array $productIds
223
  * @param int $storeId (Optional)
224
  * @return array
225
  */
226
- public function relatedFields($productIds, $storeId = null)
227
  {
228
  $fieldsByIndex = array();
229
  list($base, $currency, $options) = $this->currencyAndOptions($storeId);
230
  $attr = $this->getDescriptionAttr('store', $storeId);
231
  $limit = $this->getCharLimit('store', $storeId);
232
- foreach ($productIds as $key => $productId) {
233
- $index = $key + 1;
234
-
235
- /** @var Mage_Catalog_Model_Product $relatedProduct */
236
- $relatedProduct = Mage::getModel('catalog/product')
237
- ->setStore($storeId)
238
- ->load($productId);
239
-
240
  $price = $relatedProduct->getPrice();
241
  // Only convert the price if the current price is different from the display
242
  if ($base != $currency) {
@@ -244,6 +249,11 @@ class Bronto_Product_Helper_Data extends Bronto_Common_Helper_Data
244
  }
245
  $imageUrl = $this->getProductImageUrl($relatedProduct);
246
  $fields = array(
 
 
 
 
 
247
  array(
248
  "name" => "relatedName_{$index}",
249
  "content" => $relatedProduct->getName(),
@@ -275,7 +285,13 @@ class Bronto_Product_Helper_Data extends Bronto_Common_Helper_Data
275
  'type' => 'html'
276
  )
277
  );
278
- $fieldsByIndex[] = $fields;
 
 
 
 
 
 
279
  }
280
  return $fieldsByIndex;
281
  }
@@ -285,17 +301,17 @@ class Bronto_Product_Helper_Data extends Bronto_Common_Helper_Data
285
  * in a delivery as relatedXxx_# API fields
286
  *
287
  * @param Bronto_Api_Delivery_Row $delivery
288
- * @param array $productIds
289
  * @param int $storeId
290
  * @return void
291
  */
292
- public function setRelatedFields($delivery, $productIds, $storeId = null)
293
  {
294
  $currentData = $delivery->getData();
295
  if (empty($currentData['fields'])) {
296
  $currentData['fields'] = array();
297
  }
298
- foreach ($this->relatedFields($productIds, $storeId) as $fields) {
299
  $currentData['fields'] = array_merge($currentData['fields'], $fields);
300
  }
301
  // By passing the setField call on the API is far more efficient
@@ -311,8 +327,8 @@ class Bronto_Product_Helper_Data extends Bronto_Common_Helper_Data
311
  */
312
  public function processTagContent($rec, $storeId = null)
313
  {
314
- $productIds = $this->collectRecommendations($rec, $storeId);
315
- $fields = $this->relatedFields($productIds, $storeId);
316
  return $rec->processContent($fields);
317
  }
318
 
31
  return (bool)$this->getAdminScopedConfig(self::XML_PATH_MAGE_CRON, $scope, $scopeId);
32
  }
33
 
34
+ /**
35
+ * @see parent
36
+ */
37
+ public function disableModule($scope = 'default', $scopeId = 0, $deleteConfig = false)
38
+ {
39
+ return $this->_disableModule(self::XML_PATH_ENABLED, $scope, $scopeId, $deleteConfig);
40
+ }
41
+
42
  /**
43
  * Gets the character truncation limit for the description attr
44
  *
88
  */
89
  public function getName()
90
  {
91
+ return $this->__('Bronto Product Recommendations');
92
  }
93
 
94
  /**
121
  {
122
  return Mage::getModel('bronto_product/collect')
123
  ->setRecommendation($recommendation)
124
+ ->setOriginalHash($this->itemsToProductHash($originalItems, is_null($storeId) ? false : $storeId))
125
  ->setStoreId($storeId);
126
  }
127
 
131
  * @param mixed $items
132
  * @return array
133
  */
134
+ public function itemsToProductHash($items, $storeId = false)
135
  {
136
  $hash = array();
137
+ $helper = Mage::helper('bronto_common/product');
138
  foreach ($items as $item) {
139
  if (is_numeric($item)) {
140
+ $item = $helper->getProduct($item, $storeId);
141
  }
142
  if ($item->getParentItem()) {
143
  continue;
148
  }
149
  $product = $item->getProduct();
150
  if (!$product) {
151
+ $product = $helper->getProduct($item->getProductId(), $storeId);
152
  }
153
  } else {
154
  $product = $item;
155
  }
156
+ $product = $helper->getConfigurableProduct($product);
157
  $hash[$product->getId()] = $product;
158
  }
159
  return $hash;
229
  /**
230
  * Creates the fields to process by products and store
231
  *
232
+ * @param array $productHash
233
  * @param int $storeId (Optional)
234
  * @return array
235
  */
236
+ public function relatedFields($productHash, $storeId = null)
237
  {
238
  $fieldsByIndex = array();
239
  list($base, $currency, $options) = $this->currencyAndOptions($storeId);
240
  $attr = $this->getDescriptionAttr('store', $storeId);
241
  $limit = $this->getCharLimit('store', $storeId);
242
+ $index = 0;
243
+ foreach ($productHash as $productId => $relatedProduct) {
244
+ $index++;
 
 
 
 
 
245
  $price = $relatedProduct->getPrice();
246
  // Only convert the price if the current price is different from the display
247
  if ($base != $currency) {
249
  }
250
  $imageUrl = $this->getProductImageUrl($relatedProduct);
251
  $fields = array(
252
+ array(
253
+ "name" => "relatedId_{$index}",
254
+ "content" => $relatedProduct->getId(),
255
+ "type" => "html"
256
+ ),
257
  array(
258
  "name" => "relatedName_{$index}",
259
  "content" => $relatedProduct->getName(),
285
  'type' => 'html'
286
  )
287
  );
288
+ $context = new stdClass;
289
+ $context->fields = $fields;
290
+ $context->product = $relatedProduct;
291
+ Mage::dispatchEvent("bronto_product_related_fields", array(
292
+ 'context' => $context
293
+ ));
294
+ $fieldsByIndex[] = $context->fields;
295
  }
296
  return $fieldsByIndex;
297
  }
301
  * in a delivery as relatedXxx_# API fields
302
  *
303
  * @param Bronto_Api_Delivery_Row $delivery
304
+ * @param array $productHash
305
  * @param int $storeId
306
  * @return void
307
  */
308
+ public function setRelatedFields($delivery, $productHash, $storeId = null)
309
  {
310
  $currentData = $delivery->getData();
311
  if (empty($currentData['fields'])) {
312
  $currentData['fields'] = array();
313
  }
314
+ foreach ($this->relatedFields($productHash, $storeId) as $fields) {
315
  $currentData['fields'] = array_merge($currentData['fields'], $fields);
316
  }
317
  // By passing the setField call on the API is far more efficient
327
  */
328
  public function processTagContent($rec, $storeId = null)
329
  {
330
+ $productHash = $this->collectRecommendations($rec, $storeId);
331
+ $fields = $this->relatedFields($productHash, $storeId);
332
  return $rec->processContent($fields);
333
  }
334
 
app/code/community/Bronto/Product/Model/Collect.php CHANGED
@@ -26,19 +26,37 @@ class Bronto_Product_Model_Collect extends Bronto_Product_Model_Collect_Abstract
26
  protected function _invokeSource($target, $source, $product = null)
27
  {
28
  if (!empty($source)) {
 
29
  $method = $this->_method($source);
30
  if ($method) {
31
- Mage::helper('bronto_product')->writeDebug("Invoking {$source} on collection of {$this->_recommendation->getName()} on store {$this->getStoreId()}");
32
- $productIds = $method
33
- ->setStoreId($this->getStoreId())
34
- ->setRecommendation($this->_recommendation)
35
- ->setOriginalHash($this->_hash + $this->_products)
36
- ->setProduct($product)
37
- ->setSource($target)
38
- ->setRemainingCount($this->getRemainingCount())
39
- ->collect();
 
40
 
41
- $this->_fillProducts($productIds);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
42
  }
43
  }
44
  }
@@ -54,10 +72,14 @@ class Bronto_Product_Model_Collect extends Bronto_Product_Model_Collect_Abstract
54
  Mage::throwException('Product Recommendation is required for collecting recommended products');
55
  }
56
 
 
 
 
 
57
  foreach ($this->_recommendation->getSources() as $source => $method) {
58
  if ($this->_recommendation->isProductRelated($source)) {
59
- if (is_null($this->_hash)) {
60
- Mage::helper('bronto_product')->writeInfo('originalHash cannot be null for a product related source. Skipping');
61
  continue;
62
  }
63
  foreach ($this->_hash as $productId => $product) {
@@ -70,6 +92,10 @@ class Bronto_Product_Model_Collect extends Bronto_Product_Model_Collect_Abstract
70
  $this->_invokeSource($source, $method);
71
  }
72
  }
73
- return array_keys($this->_products);
 
 
 
 
74
  }
75
  }
26
  protected function _invokeSource($target, $source, $product = null)
27
  {
28
  if (!empty($source)) {
29
+ $helper = Mage::helper('bronto_product');
30
  $method = $this->_method($source);
31
  if ($method) {
32
+ $helper->writeDebug("Invoking {$source} on collection of {$this->_recommendation->getName()} on store {$this->getStoreId()}");
33
+ try {
34
+ $productHash = $method
35
+ ->setStoreId($this->getStoreId())
36
+ ->setRecommendation($this->_recommendation)
37
+ ->setExcluded($this->_excluded + $this->_hash)
38
+ ->setProduct($product)
39
+ ->setSource($target)
40
+ ->setRemainingCount($this->getRemainingCount())
41
+ ->collect();
42
 
43
+ $result = new stdClass;
44
+ $result->products = $productHash;
45
+ Mage::dispatchEvent("bronto_product_collect_{$source}_result", array(
46
+ 'result' => $result,
47
+ 'collect' => $this,
48
+ 'source' => $target,
49
+ 'recommendation' => $this->_recommendation,
50
+ ));
51
+
52
+ $this->_excluded += $result->products;
53
+ if ($target != Bronto_Product_Model_Recommendation::SOURCE_EXCLUSION) {
54
+ $this->_products += $result->products;
55
+ $this->_remainingCount -= count($result->products);
56
+ }
57
+ } catch (Exception $e) {
58
+ $helper->writeError("Failed to invoke {$source} on collection of {$this->_recommendation->getName()} on store {$this->getStoreId()}: {$e->getMessage()}");
59
+ }
60
  }
61
  }
62
  }
72
  Mage::throwException('Product Recommendation is required for collecting recommended products');
73
  }
74
 
75
+ Mage::dispatchEvent("bronto_product_before_collect", array(
76
+ 'collect' => $this,
77
+ 'recommendation' => $this->_recommendation
78
+ ));
79
  foreach ($this->_recommendation->getSources() as $source => $method) {
80
  if ($this->_recommendation->isProductRelated($source)) {
81
+ if (empty($this->_hash)) {
82
+ Mage::helper('bronto_product')->writeInfo('originalHash cannot be empty for a product related source. Skipping');
83
  continue;
84
  }
85
  foreach ($this->_hash as $productId => $product) {
92
  $this->_invokeSource($source, $method);
93
  }
94
  }
95
+ Mage::dispatchEvent("bronto_product_after_collect", array(
96
+ 'collect' => $this,
97
+ 'recommendation' => $this->_recommendation
98
+ ));
99
+ return $this->_products;
100
  }
101
  }
app/code/community/Bronto/Product/Model/Collect/Abstract.php CHANGED
@@ -2,7 +2,8 @@
2
 
3
  abstract class Bronto_Product_Model_Collect_Abstract {
4
  protected $_products = array();
5
- protected $_hash;
 
6
  protected $_storeId;
7
  protected $_recommendation;
8
  protected $_remainingCount;
@@ -12,6 +13,7 @@ abstract class Bronto_Product_Model_Collect_Abstract {
12
 
13
  /**
14
  * Implementors override this specialized collection method
 
15
  *
16
  * @return array
17
  */
@@ -47,7 +49,7 @@ abstract class Bronto_Product_Model_Collect_Abstract {
47
  if (!$this->isReachedMax()) {
48
  return $this->collect();
49
  }
50
- return array_keys($this->_products);
51
  }
52
 
53
  /**
@@ -73,7 +75,7 @@ abstract class Bronto_Product_Model_Collect_Abstract {
73
  }
74
 
75
  /**
76
- * Sets the original hash to be used to dedupe the collection
77
  *
78
  * @param array $originalHash
79
  * @return Bronto_Product_Model_Collect_Abstract
@@ -84,6 +86,18 @@ abstract class Bronto_Product_Model_Collect_Abstract {
84
  return $this;
85
  }
86
 
 
 
 
 
 
 
 
 
 
 
 
 
87
  /**
88
  * Sets the store Id for processing
89
  *
@@ -164,23 +178,27 @@ abstract class Bronto_Product_Model_Collect_Abstract {
164
  protected function _fillProducts($productsOrIds)
165
  {
166
  $products = array();
 
167
  foreach ($productsOrIds as $productOrId) {
168
- if ($this->isReachedMax()) {
169
  break;
170
  }
171
- if ($productOrId instanceof Mage_Catalog_Model_Product) {
172
- $productId = $productOrId->getId();
173
- } else if ($productOrId instanceof Mage_Reports_Model_Event) {
174
  $productId = $productOrId->getObjectId();
175
- } else {
176
  $productId = $productOrId;
 
 
 
 
 
 
177
  }
178
- if (!$this->_isValidProduct($productId)) {
 
179
  continue;
180
  }
181
- $this->_products[$productId] = 1;
182
- $this->_remainingCount--;
183
- $products[] = $productId;
184
  }
185
  return $products;
186
  }
@@ -193,7 +211,7 @@ abstract class Bronto_Product_Model_Collect_Abstract {
193
  */
194
  protected function _isValidProduct($productId)
195
  {
196
- if (array_key_exists($productId, $this->_hash)) {
197
  return false;
198
  }
199
  if (array_key_exists($productId, $this->_products)) {
2
 
3
  abstract class Bronto_Product_Model_Collect_Abstract {
4
  protected $_products = array();
5
+ protected $_hash = array();
6
+ protected $_excluded = array();
7
  protected $_storeId;
8
  protected $_recommendation;
9
  protected $_remainingCount;
13
 
14
  /**
15
  * Implementors override this specialized collection method
16
+ * Implementors should return a product hash table
17
  *
18
  * @return array
19
  */
49
  if (!$this->isReachedMax()) {
50
  return $this->collect();
51
  }
52
+ return $this->_products;
53
  }
54
 
55
  /**
75
  }
76
 
77
  /**
78
+ * Sets the original hash to be treated like shopping context
79
  *
80
  * @param array $originalHash
81
  * @return Bronto_Product_Model_Collect_Abstract
86
  return $this;
87
  }
88
 
89
+ /**
90
+ * Sets the excluded products hash to be used to dedupe the collection
91
+ *
92
+ * @param array $excluded
93
+ * return Bronto_Product_Model_Collect_Abstract
94
+ */
95
+ public function setExcluded($excluded)
96
+ {
97
+ $this->_excluded = $excluded;
98
+ return $this;
99
+ }
100
+
101
  /**
102
  * Sets the store Id for processing
103
  *
178
  protected function _fillProducts($productsOrIds)
179
  {
180
  $products = array();
181
+ $helper = Mage::helper('bronto_common/product');
182
  foreach ($productsOrIds as $productOrId) {
183
+ if ($this->_remainingCount - count($products) <= 0) {
184
  break;
185
  }
186
+ if ($productOrId instanceof Mage_Reports_Model_Event) {
 
 
187
  $productId = $productOrId->getObjectId();
188
+ } else if (is_numeric($productOrId)) {
189
  $productId = $productOrId;
190
+ } else {
191
+ $productId = $productOrId->getId();
192
+ }
193
+ $product = $helper->getProduct($productId, $this->getStoreId());
194
+ if (!$product->getId()) {
195
+ continue;
196
  }
197
+ $product = $helper->getConfigurableProduct($product);
198
+ if (!$this->_isValidProduct($product->getId())) {
199
  continue;
200
  }
201
+ $products[$product->getId()] = $product;
 
 
202
  }
203
  return $products;
204
  }
211
  */
212
  protected function _isValidProduct($productId)
213
  {
214
+ if (array_key_exists($productId, $this->_excluded)) {
215
  return false;
216
  }
217
  if (array_key_exists($productId, $this->_products)) {
app/code/community/Bronto/Product/Model/Collect/Bestseller.php CHANGED
@@ -12,9 +12,12 @@ class Bronto_Product_Model_Collect_Bestseller extends Bronto_Product_Model_Colle
12
  ->setStoreId($this->getStoreId())
13
  ->addStoreFilter($this->getStoreId())
14
  ->setOrder('ordered_qty', 'desc')
15
- ->addIdFilter(array_keys($this->_hash), true)
16
  ->setPageSize($this->getRemainingCount());
17
 
 
 
 
 
18
  Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($bestSellers);
19
  Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($bestSellers);
20
  Mage::getModel('cataloginventory/stock')->addInStockFilterToCollection($bestSellers);
12
  ->setStoreId($this->getStoreId())
13
  ->addStoreFilter($this->getStoreId())
14
  ->setOrder('ordered_qty', 'desc')
 
15
  ->setPageSize($this->getRemainingCount());
16
 
17
+ if (!empty($this->_excluded)) {
18
+ $bestSellers->addIdFilter(array_keys($this->_excluded), true);
19
+ }
20
+
21
  Mage::getSingleton('catalog/product_status')->addVisibleFilterToCollection($bestSellers);
22
  Mage::getSingleton('catalog/product_visibility')->addVisibleInCatalogFilterToCollection($bestSellers);
23
  Mage::getModel('cataloginventory/stock')->addInStockFilterToCollection($bestSellers);
app/code/community/Bronto/Product/Model/Collect/Custom.php CHANGED
@@ -11,8 +11,11 @@ class Bronto_Product_Model_Collect_Custom extends Bronto_Product_Model_Collect_A
11
  if (empty($productIds)) {
12
  return array();
13
  }
 
 
 
14
  $custom = Mage::getModel('catalog/product')->getCollection()
15
- ->addFieldToFilter('entity_id', array('id' => $productIds));
16
  Mage::getModel('cataloginventory/stock')->addInStockFilterToCollection($custom);
17
  return $this->_fillProducts($custom);
18
  }
11
  if (empty($productIds)) {
12
  return array();
13
  }
14
+ if ($this->_source == Bronto_Product_Model_Recommendation::SOURCE_EXCLUSION) {
15
+ $this->setRemainingCount(count($productIds));
16
+ }
17
  $custom = Mage::getModel('catalog/product')->getCollection()
18
+ ->addFieldToFilter('entity_id', array('in' => $productIds));
19
  Mage::getModel('cataloginventory/stock')->addInStockFilterToCollection($custom);
20
  return $this->_fillProducts($custom);
21
  }
app/code/community/Bronto/Product/Model/Collect/Mostviewed.php CHANGED
@@ -9,7 +9,7 @@ class Bronto_Product_Model_Collect_Mostviewed extends Bronto_Product_Model_Colle
9
  */
10
  public function collect()
11
  {
12
- $mostViewed = Mage::getResourceModel('reports/product_viewed_collection')
13
  ->addStoreFilter($this->getStoreId())
14
  ->setPageSize($this->getRemainingCount())
15
  ->addViewsCount(date('Y-m-d', strtotime('-' . self::DAYS_THRESHOLD . ' days')), date('Y-m-d'));
9
  */
10
  public function collect()
11
  {
12
+ $mostViewed = Mage::getResourceModel('reports/product_collection')
13
  ->addStoreFilter($this->getStoreId())
14
  ->setPageSize($this->getRemainingCount())
15
  ->addViewsCount(date('Y-m-d', strtotime('-' . self::DAYS_THRESHOLD . ' days')), date('Y-m-d'));
app/code/community/Bronto/Product/Model/Collect/Upsell.php CHANGED
@@ -16,7 +16,7 @@ class Bronto_Product_Model_Collect_Upsell extends Bronto_Product_Model_Collect_A
16
  public function collect()
17
  {
18
  $upsell = $this->_product->getUpSellProductCollection();
19
- Mage::getModel('cataloginventory/stock')->addInStockFilterToCollection($related);
20
  return $this->_fillProducts($upsell);
21
  }
22
  }
16
  public function collect()
17
  {
18
  $upsell = $this->_product->getUpSellProductCollection();
19
+ Mage::getModel('cataloginventory/stock')->addInStockFilterToCollection($upsell);
20
  return $this->_fillProducts($upsell);
21
  }
22
  }
app/code/community/Bronto/Product/Model/Recommendation.php CHANGED
@@ -14,6 +14,7 @@ class Bronto_Product_Model_Recommendation extends Mage_Core_Model_Abstract
14
  const SOURCE_PRIMARY = 'primary';
15
  const SOURCE_SECONDARY = 'secondary';
16
  const SOURCE_FALLBACK = 'fallback';
 
17
 
18
  const TYPE_API = 'api';
19
  const TYPE_CONTENT_TAG = 'content_tag';
@@ -26,6 +27,13 @@ class Bronto_Product_Model_Recommendation extends Mage_Core_Model_Abstract
26
  private $_sources;
27
  private $_customer;
28
 
 
 
 
 
 
 
 
29
  /**
30
  * @see parent
31
  */
@@ -149,7 +157,8 @@ class Bronto_Product_Model_Recommendation extends Mage_Core_Model_Abstract
149
  $productRelated = array(
150
  self::SOURCE_RELATED_PRODUCT,
151
  self::SOURCE_UPSELL_PRODUCT,
152
- self::SOURCE_CROSSSELL_PRODUCT);
 
153
  if ($source) {
154
  return in_array($this->getData("{$source}_source"), $productRelated);
155
  } else {
@@ -176,10 +185,31 @@ class Bronto_Product_Model_Recommendation extends Mage_Core_Model_Abstract
176
  $this->_sources[$matches[1]] = $value;
177
  }
178
  }
 
179
  }
180
  return $this->_sources;
181
  }
182
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
183
  /**
184
  * Performs a copy of the model without an id
185
  *
14
  const SOURCE_PRIMARY = 'primary';
15
  const SOURCE_SECONDARY = 'secondary';
16
  const SOURCE_FALLBACK = 'fallback';
17
+ const SOURCE_EXCLUSION = 'exclusion';
18
 
19
  const TYPE_API = 'api';
20
  const TYPE_CONTENT_TAG = 'content_tag';
27
  private $_sources;
28
  private $_customer;
29
 
30
+ private static $_sourceOrder = array(
31
+ self::SOURCE_EXCLUSION => 0,
32
+ self::SOURCE_PRIMARY => 10,
33
+ self::SOURCE_SECONDARY => 20,
34
+ self::SOURCE_FALLBACK => 30
35
+ );
36
+
37
  /**
38
  * @see parent
39
  */
157
  $productRelated = array(
158
  self::SOURCE_RELATED_PRODUCT,
159
  self::SOURCE_UPSELL_PRODUCT,
160
+ self::SOURCE_CROSSSELL_PRODUCT
161
+ );
162
  if ($source) {
163
  return in_array($this->getData("{$source}_source"), $productRelated);
164
  } else {
185
  $this->_sources[$matches[1]] = $value;
186
  }
187
  }
188
+ uksort($this->_sources, array($this, 'compareSources'));
189
  }
190
  return $this->_sources;
191
  }
192
 
193
+ /**
194
+ * Comparator callback for sources
195
+ *
196
+ * @param string $sourceA
197
+ * @param string $sourceB
198
+ * @return int
199
+ */
200
+ public function compareSources($sourceA, $sourceB)
201
+ {
202
+ $sortValueA = self::$_sourceOrder[$sourceA];
203
+ $sortValueB = self::$_sourceOrder[$sourceB];
204
+ if ($sortValueA == $sortValueB) {
205
+ return 0;
206
+ } else if ($sortValueA < $sortValueB) {
207
+ return -1;
208
+ } else {
209
+ return 1;
210
+ }
211
+ }
212
+
213
  /**
214
  * Performs a copy of the model without an id
215
  *
app/code/community/Bronto/Product/Model/Resource/Setup.php CHANGED
@@ -28,16 +28,19 @@ class Bronto_Product_Model_Resource_Setup extends Bronto_Common_Model_Resource_A
28
  `primary_source` varchar(20) NOT NULL DEFAULT 'related',
29
  `secondary_source` varchar(20) NOT NULL DEFAULT 'bestseller',
30
  `fallback_source` varchar(20) NOT NULL DEFAULT '',
 
31
  `manual_primary_source` varchar(255) NULL,
32
  `manual_secondary_source` varchar(255) NULL,
33
  `manual_fallback_source` varchar(255) NULL,
 
34
  PRIMARY KEY (`entity_id`),
35
  KEY `IDX_BRONTO_PRODUCT_NAME` (`name`),
36
  KEY `IDX_BRONTO_PRODUCT_STOREID` (`store_id`),
37
  KEY `IDX_BRONTO_PRODUCT_TYPE` (`content_type`),
38
  KEY `IDX_BRONTO_PRODUCT_PRIMARY` (`primary_source`),
39
  KEY `IDX_BRONTO_PRODUCT_SECONDARY` (`secondary_source`),
40
- KEY `IDX_BRONTO_PRODUCT_FALLBACK` (`fallback_source`)
 
41
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Bronto Product Recommentation table';"
42
  );
43
  }
@@ -47,6 +50,16 @@ class Bronto_Product_Model_Resource_Setup extends Bronto_Common_Model_Resource_A
47
  */
48
  protected function _updates()
49
  {
50
- return array();
 
 
 
 
 
 
 
 
 
 
51
  }
52
  }
28
  `primary_source` varchar(20) NOT NULL DEFAULT 'related',
29
  `secondary_source` varchar(20) NOT NULL DEFAULT 'bestseller',
30
  `fallback_source` varchar(20) NOT NULL DEFAULT '',
31
+ `exclusion_source` varchar(20) NOT NULL DEFAULT 'custom',
32
  `manual_primary_source` varchar(255) NULL,
33
  `manual_secondary_source` varchar(255) NULL,
34
  `manual_fallback_source` varchar(255) NULL,
35
+ `manual_exclusion_source` text NULL,
36
  PRIMARY KEY (`entity_id`),
37
  KEY `IDX_BRONTO_PRODUCT_NAME` (`name`),
38
  KEY `IDX_BRONTO_PRODUCT_STOREID` (`store_id`),
39
  KEY `IDX_BRONTO_PRODUCT_TYPE` (`content_type`),
40
  KEY `IDX_BRONTO_PRODUCT_PRIMARY` (`primary_source`),
41
  KEY `IDX_BRONTO_PRODUCT_SECONDARY` (`secondary_source`),
42
+ KEY `IDX_BRONTO_PRODUCT_FALLBACK` (`fallback_source`),
43
+ KEY `IDX_BRONTO_PRODUCT_EXCLUSION` (`exclusion_source`)
44
  ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Bronto Product Recommentation table';"
45
  );
46
  }
50
  */
51
  protected function _updates()
52
  {
53
+ return array(
54
+ '1.0.1' => array(
55
+ 'recommendation' => array(
56
+ 'sql' => array(
57
+ "ALTER TABLE {table} ADD COLUMN `exclusion_source` varchar(20) NOT NULL DEFAULT 'custom' AFTER `fallback_source`",
58
+ "ALTER TABLE {table} ADD COLUMN `manual_exclusion_source` text NULL AFTER `manual_fallback_source`",
59
+ "ALTER TABLE {table} ADD INDEX `IDX_BRONTO_PRODUCT_EXCLUSION` (`exclusion_source`)"
60
+ )
61
+ )
62
+ )
63
+ );
64
  }
65
  }
app/code/community/Bronto/Product/controllers/Adminhtml/RecommendationsController.php CHANGED
@@ -56,7 +56,7 @@ class Bronto_Product_Adminhtml_RecommendationsController extends Mage_Adminhtml_
56
  $head = $this->getLayout()->getBlock('head');
57
  $head->addItem('js_css', 'prototype/windows/themes/default.css');
58
  $enabled = Mage::getSingleton('cms/wysiwyg_config')->isEnabled();
59
- if (Mage::helper('bronto_common')->isVersionMatch(Mage::getVersionInfo(), '1', array('6', array('edition' => 'Enterprise', 'major' => '9'), '10', '11'))) {
60
  $head->addItem('js_css', 'prototype/windows/themes/magento.css');
61
  if ($enabled) {
62
  $head->addItem('js_css', 'mage/adminhtml/wysiwyg/tiny_mce/setup.js');
@@ -308,23 +308,14 @@ class Bronto_Product_Adminhtml_RecommendationsController extends Mage_Adminhtml_
308
  }
309
 
310
  try {
311
- $secondSource = $this->getRequest()->getParam('secondary_source');
312
- $fallbackSource = $this->getRequest()->getParam('fallback_source');
313
- $manualPri = $this->getRequest()->getParam('manual_primary_source');
314
- $manualSec = $this->getRequest()->getParam('manual_secondary_source');
315
- $manualFal = $this->getRequest()->getParam('manual_fallback_source');
316
-
317
- $this
318
- ->_validateRecommendation($recommendation)
319
- ->setSecondarySource($secondSource)
320
- ->setFallbackSource($fallbackSource)
321
- ->setManualPrimarySource($manualPri)
322
- ->setManualSecondarySource($manualSec)
323
- ->setManualFallbackSource($manualFal)
324
- ->save();
325
-
326
  $session->addSuccess($this->__('The Product Recommendation has been saved.'));
327
-
328
  if ($this->getRequest()->getParam('continue')) {
329
  return $this->_redirect('*/*/edit', array('id' => $recommendation->getId()));
330
  } else {
56
  $head = $this->getLayout()->getBlock('head');
57
  $head->addItem('js_css', 'prototype/windows/themes/default.css');
58
  $enabled = Mage::getSingleton('cms/wysiwyg_config')->isEnabled();
59
+ if (Mage::helper('bronto_common')->isVersionMatch(Mage::getVersionInfo(), '1', array('6', array('edition' => 'Professional', 'major' => '9'), '10', '11'))) {
60
  $head->addItem('js_css', 'prototype/windows/themes/magento.css');
61
  if ($enabled) {
62
  $head->addItem('js_css', 'mage/adminhtml/wysiwyg/tiny_mce/setup.js');
308
  }
309
 
310
  try {
311
+ $this->_validateRecommendation($recommendation);
312
+ foreach ($this->getRequest()->getParams() as $name => $value) {
313
+ if (preg_match('/source$/', $name)) {
314
+ $recommendation->setData($name, $value);
315
+ }
316
+ }
317
+ $recommendation->save();
 
 
 
 
 
 
 
 
318
  $session->addSuccess($this->__('The Product Recommendation has been saved.'));
 
319
  if ($this->getRequest()->getParam('continue')) {
320
  return $this->_redirect('*/*/edit', array('id' => $recommendation->getId()));
321
  } else {
app/code/community/Bronto/Product/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <Bronto_Product>
5
- <version>1.0.0</version>
6
  </Bronto_Product>
7
  </modules>
8
  <global>
2
  <config>
3
  <modules>
4
  <Bronto_Product>
5
+ <version>1.0.1</version>
6
  </Bronto_Product>
7
  </modules>
8
  <global>
app/code/community/Bronto/Product/etc/system.xml CHANGED
@@ -28,7 +28,7 @@
28
  <show_in_store>1</show_in_store>
29
  <expanded>1</expanded>
30
  <comment><![CDATA[Module configuration is located at:
31
- <strong>Promotions</strong> &rsaquo; <a
32
  href="{url}">Bronto Product
33
  Recommendations</a></strong><br/>
34
  <div class="bronto-with-help">
@@ -44,6 +44,10 @@
44
  </tr>
45
  </thead>
46
  <tbody>
 
 
 
 
47
  <tr>
48
  <td>Related Product's name</td>
49
  <td>relatedName_#</td>
@@ -76,7 +80,7 @@
76
  ]]></comment>
77
  <fields>
78
  <enabled>
79
- <label>Enable Recommendations</label>
80
  <frontend_type>select</frontend_type>
81
  <backend_model>bronto_common/system_config_backend_enable</backend_model>
82
  <source_model>adminhtml/system_config_source_yesno</source_model>
28
  <show_in_store>1</show_in_store>
29
  <expanded>1</expanded>
30
  <comment><![CDATA[Module configuration is located at:
31
+ <strong>Promotions &rsaquo; <a
32
  href="{url}">Bronto Product
33
  Recommendations</a></strong><br/>
34
  <div class="bronto-with-help">
44
  </tr>
45
  </thead>
46
  <tbody>
47
+ <tr>
48
+ <td>Related Product's ID</td>
49
+ <td>relatedId_#</td>
50
+ </tr>
51
  <tr>
52
  <td>Related Product's name</td>
53
  <td>relatedName_#</td>
80
  ]]></comment>
81
  <fields>
82
  <enabled>
83
+ <label>Enable Module</label>
84
  <frontend_type>select</frontend_type>
85
  <backend_model>bronto_common/system_config_backend_enable</backend_model>
86
  <source_model>adminhtml/system_config_source_yesno</source_model>
app/code/community/Bronto/Product/sql/bronto_product_setup/mysql4-install-1.0.1.php ADDED
@@ -0,0 +1,14 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $installer = $this;
4
+
5
+ $installer->startSetup();
6
+
7
+ try {
8
+ $installer->dropTable('recommendation');
9
+ $installer->createTable('recommendation');
10
+ } catch (Exception $e) {
11
+ Mage::helper('bronto_product')->writeError('Failed to create Product Recommentation table: ' . $e->getMessage());
12
+ }
13
+
14
+ $installer->endSetup();
app/code/community/Bronto/Product/sql/bronto_product_setup/mysql4-upgrade-1.0.0-1.0.1.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $installer = $this;
4
+
5
+ $installer->startSetup();
6
+
7
+ try {
8
+ $installer->updateTables('1.0.1');
9
+ } catch (Exception $e) {
10
+ Mage::helper('bronto_product')->writeError('Failed to update Product Recommentation table: ' . $e->getMessage());
11
+ }
12
+
13
+ $installer->endSetup();
app/code/community/Bronto/Reminder/Block/Adminhtml/Reminder/Edit/Tab/Bronto.php CHANGED
@@ -22,6 +22,8 @@ class Bronto_Reminder_Block_Adminhtml_Reminder_Edit_Tab_Bronto extends Mage_Admi
22
  'comment' => Mage::helper('bronto_reminder')->__('Messages will be sent only for specified store views.'),
23
  ));
24
 
 
 
25
  foreach (Mage::app()->getWebsites() as $website) {
26
  $groups = $website->getGroups();
27
 
@@ -45,6 +47,7 @@ class Bronto_Reminder_Block_Adminhtml_Reminder_Edit_Tab_Bronto extends Mage_Admi
45
  foreach ($stores as $key => $store) {
46
  if (Mage::helper('bronto_reminder')->isEnabled('store', $store->getId())) {
47
  $values = Mage::helper('bronto_reminder/message')->getMessagesOptionsArray($store->getId(), $website->getId());
 
48
 
49
  $fieldset->addField("store_message_{$store->getId()}", 'select', array(
50
  'name' => "store_messages[{$store->getId()}]",
@@ -52,7 +55,16 @@ class Bronto_Reminder_Block_Adminhtml_Reminder_Edit_Tab_Bronto extends Mage_Admi
52
  'label' => $store->getName(),
53
  'values' => $values,
54
  'fieldset_html_class' => 'store',
55
- 'disabled' => count($values) == 1 ? true : false,
 
 
 
 
 
 
 
 
 
56
  ));
57
 
58
  $fieldset->addField("store_message_sendtype_{$store->getId()}", 'radios', array(
@@ -65,7 +77,7 @@ class Bronto_Reminder_Block_Adminhtml_Reminder_Edit_Tab_Bronto extends Mage_Admi
65
  array('value' => 'marketing', 'label' => ' Send as Marketing'),
66
  ),
67
  'fieldset_html_class' => 'store',
68
- 'disabled' => count($values) == 1 ? true : false,
69
  ));
70
 
71
  // $fieldset->addField("store_message_salesrule_id_{$store->getId()}", 'select', array(
22
  'comment' => Mage::helper('bronto_reminder')->__('Messages will be sent only for specified store views.'),
23
  ));
24
 
25
+ $sendOptions = Mage::getModel('bronto_common/system_config_source_sendOptions');
26
+
27
  foreach (Mage::app()->getWebsites() as $website) {
28
  $groups = $website->getGroups();
29
 
47
  foreach ($stores as $key => $store) {
48
  if (Mage::helper('bronto_reminder')->isEnabled('store', $store->getId())) {
49
  $values = Mage::helper('bronto_reminder/message')->getMessagesOptionsArray($store->getId(), $website->getId());
50
+ $disabled = count($values) == 1;
51
 
52
  $fieldset->addField("store_message_{$store->getId()}", 'select', array(
53
  'name' => "store_messages[{$store->getId()}]",
55
  'label' => $store->getName(),
56
  'values' => $values,
57
  'fieldset_html_class' => 'store',
58
+ 'disabled' => $disabled,
59
+ ));
60
+
61
+ $fieldset->addField("store_message_sendflags_{$store->getId()}", 'select', array(
62
+ 'name' => "store_message_sendflags[{$store->getId()}]",
63
+ 'required' => false,
64
+ 'label' => "Send Flags",
65
+ 'fieldset_html_class' => 'store',
66
+ 'values' => $sendOptions->toOptionArray(),
67
+ 'disabled' => $disabled
68
  ));
69
 
70
  $fieldset->addField("store_message_sendtype_{$store->getId()}", 'radios', array(
77
  array('value' => 'marketing', 'label' => ' Send as Marketing'),
78
  ),
79
  'fieldset_html_class' => 'store',
80
+ 'disabled' => $disabled
81
  ));
82
 
83
  // $fieldset->addField("store_message_salesrule_id_{$store->getId()}", 'select', array(
app/code/community/Bronto/Reminder/Helper/Data.php CHANGED
@@ -301,7 +301,7 @@ class Bronto_Reminder_Helper_Data extends Bronto_Common_Helper_Data implements B
301
  *
302
  * @return array
303
  */
304
- public function getCustomConfig()
305
  {
306
  $ruleMeta = Mage::getModel('bronto_reminder/rule');
307
  $rules = $ruleMeta->getCollection()->getItems();
301
  *
302
  * @return array
303
  */
304
+ public function getCustomConfig($scope = 'default', $scopeId = 0)
305
  {
306
  $ruleMeta = Mage::getModel('bronto_reminder/rule');
307
  $rules = $ruleMeta->getCollection()->getItems();
app/code/community/Bronto/Reminder/Model/Mysql4/Rule.php CHANGED
@@ -153,6 +153,7 @@ class Bronto_Reminder_Model_Mysql4_Rule
153
  $labels = $rule->getStoreLabels();
154
  $descriptions = $rule->getStoreDescriptions();
155
  $sendTypes = $rule->getStoreMessageSendtypes();
 
156
  // $salesruleIds = $rule->getStoreSalesruleIds();
157
 
158
  foreach ($rule->getStoreMessages() as $storeId => $messageId) {
@@ -167,6 +168,7 @@ class Bronto_Reminder_Model_Mysql4_Rule
167
  'store_id' => $storeId,
168
  'message_id' => $messageId,
169
  'send_type' => $sendType,
 
170
  'label' => $labels[$storeId],
171
  'description' => $descriptions[$storeId],
172
  // 'salesrule_id' => $salesruleIds[$storeId],
@@ -188,7 +190,7 @@ class Bronto_Reminder_Model_Mysql4_Rule
188
  {
189
  $messageTable = $this->getTable('bronto_reminder/message');
190
  $select = $this->createSelect()
191
- ->from($messageTable, array('store_id', 'message_id', 'label', 'description', 'send_type'))
192
  ->where('rule_id = ?', $ruleId);
193
 
194
  return $this->_getReadAdapter()->fetchAll($select);
@@ -213,7 +215,8 @@ class Bronto_Reminder_Model_Mysql4_Rule
213
  'm.message_id,
214
  IF(m.label != \'\', m.label, r.default_label) as label,
215
  IF(m.description != \'\', m.description, r.default_description) as description,
216
- m.send_type'
 
217
  );
218
 
219
  $select->join(
153
  $labels = $rule->getStoreLabels();
154
  $descriptions = $rule->getStoreDescriptions();
155
  $sendTypes = $rule->getStoreMessageSendtypes();
156
+ $sendFlags = $rule->getStoreMessageSendflags();
157
  // $salesruleIds = $rule->getStoreSalesruleIds();
158
 
159
  foreach ($rule->getStoreMessages() as $storeId => $messageId) {
168
  'store_id' => $storeId,
169
  'message_id' => $messageId,
170
  'send_type' => $sendType,
171
+ 'send_flags' => $sendFlags[$storeId],
172
  'label' => $labels[$storeId],
173
  'description' => $descriptions[$storeId],
174
  // 'salesrule_id' => $salesruleIds[$storeId],
190
  {
191
  $messageTable = $this->getTable('bronto_reminder/message');
192
  $select = $this->createSelect()
193
+ ->from($messageTable, array('store_id', 'message_id', 'label', 'description', 'send_type', 'send_flags'))
194
  ->where('rule_id = ?', $ruleId);
195
 
196
  return $this->_getReadAdapter()->fetchAll($select);
215
  'm.message_id,
216
  IF(m.label != \'\', m.label, r.default_label) as label,
217
  IF(m.description != \'\', m.description, r.default_description) as description,
218
+ m.send_type,
219
+ m.send_flags'
220
  );
221
 
222
  $select->join(
app/code/community/Bronto/Reminder/Model/Resource/Setup.php CHANGED
@@ -53,6 +53,7 @@ class Bronto_Reminder_Model_Resource_Setup extends Bronto_Common_Model_Resource_
53
  `store_id` smallint(5) NOT NULL,
54
  `message_id` varchar(255) NOT NULL DEFAULT '',
55
  `send_type` varchar(20) NOT NULL DEFAULT 'transactional',
 
56
  `label` varchar(255) DEFAULT NULL,
57
  `description` text,
58
  PRIMARY KEY (`rule_id`,`store_id`),
@@ -127,6 +128,12 @@ class Bronto_Reminder_Model_Resource_Setup extends Bronto_Common_Model_Resource_
127
  'coupon' => array(
128
  'sql' => 'ALTER TABLE {table} ADD COLUMN `product_recommendation_id` int(11) unsigned DEFAULT NULL AFTER `coupon_id`;'
129
  )
 
 
 
 
 
 
130
  )
131
  );
132
  }
53
  `store_id` smallint(5) NOT NULL,
54
  `message_id` varchar(255) NOT NULL DEFAULT '',
55
  `send_type` varchar(20) NOT NULL DEFAULT 'transactional',
56
+ `send_flags` int(3) unsigned DEFAULT NULL,
57
  `label` varchar(255) DEFAULT NULL,
58
  `description` text,
59
  PRIMARY KEY (`rule_id`,`store_id`),
128
  'coupon' => array(
129
  'sql' => 'ALTER TABLE {table} ADD COLUMN `product_recommendation_id` int(11) unsigned DEFAULT NULL AFTER `coupon_id`;'
130
  )
131
+ ),
132
+ '1.4.18' => array(
133
+ 'message' => array(
134
+ 'sql' =>
135
+ "ALTER TABLE {table} ADD COLUMN `send_flags` int(3) unsigned DEFAULT NULL AFTER `send_type`;"
136
+ )
137
  )
138
  );
139
  }
app/code/community/Bronto/Reminder/Model/Rule.php CHANGED
@@ -34,8 +34,7 @@ class Bronto_Reminder_Model_Rule
34
  if (Mage::helper('bronto_verify')->isVersionMatch(
35
  Mage::getVersionInfo(),
36
  1,
37
- array(array('<=', 6), array('edition' => 'Enterprise', 'major' => 9), 10, 11)
38
- )
39
  ) {
40
  $conditionsArr = unserialize($this->getConditionsSerialized());
41
  if (!empty($conditionsArr) && is_array($conditionsArr)) {
@@ -49,7 +48,8 @@ class Bronto_Reminder_Model_Rule
49
  $message = (empty($data['message_id'])) ? null : $data['message_id'];
50
  $sendType = (empty($data['send_type'])) ? 'transactional' : $data['send_type'];
51
  $this->setData('store_message_' . $data['store_id'], $message)
52
- ->setData('store_message_sendtype_' . $data['store_id'], $sendType);
 
53
  }
54
 
55
  return $this;
@@ -272,6 +272,7 @@ class Bronto_Reminder_Model_Rule
272
  $store->getWebsiteId()
273
  );
274
  $mail->setTemplateSendType($messageData['send_type']);
 
275
  $mail->setSalesRule($recipient['coupon_id']);
276
  $mail->setProductRecommendation($recipient['product_recommendation_id']);
277
  $mail->sendTransactional(
34
  if (Mage::helper('bronto_verify')->isVersionMatch(
35
  Mage::getVersionInfo(),
36
  1,
37
+ array(array('<=', 6), array('edition' => 'Professional', 'major' => 9), 10, 11))
 
38
  ) {
39
  $conditionsArr = unserialize($this->getConditionsSerialized());
40
  if (!empty($conditionsArr) && is_array($conditionsArr)) {
48
  $message = (empty($data['message_id'])) ? null : $data['message_id'];
49
  $sendType = (empty($data['send_type'])) ? 'transactional' : $data['send_type'];
50
  $this->setData('store_message_' . $data['store_id'], $message)
51
+ ->setData('store_message_sendtype_' . $data['store_id'], $sendType)
52
+ ->setData('store_message_sendflags_' . $data['store_id'], $data['send_flags']);
53
  }
54
 
55
  return $this;
272
  $store->getWebsiteId()
273
  );
274
  $mail->setTemplateSendType($messageData['send_type']);
275
+ $mail->setSendFlags($messageData['send_flags']);
276
  $mail->setSalesRule($recipient['coupon_id']);
277
  $mail->setProductRecommendation($recipient['product_recommendation_id']);
278
  $mail->sendTransactional(
app/code/community/Bronto/Reminder/controllers/LoadController.php CHANGED
@@ -62,13 +62,21 @@ class Bronto_Reminder_LoadController extends Mage_Core_Controller_Front_Action
62
 
63
  // Check for persistent cookie
64
  $pCookie = Mage::getModel('core/cookie')->get('persistent_shopping_cart', false);
 
65
  $persist = (int)Mage::getStoreConfig('persistent/options/enabled');
66
  $loggedIn = Mage::getSingleton('customer/session')->isLoggedIn();
67
 
68
- // Handle persistent cart issues
69
- if ($customerId && $persist && !$loggedIn && !$pCookie) {
70
- Mage::getSingleton('customer/session')->setData('before_auth_url', $redirectUrl);
71
- $redirectUrl = Mage::app()->getStore()->getUrl('customer/account/login');
 
 
 
 
 
 
 
72
  }
73
 
74
  $this->_redirectUrl($redirectUrl);
62
 
63
  // Check for persistent cookie
64
  $pCookie = Mage::getModel('core/cookie')->get('persistent_shopping_cart', false);
65
+ $isClear = (int)Mage::getStoreConfig('persistent/options/logout/clear');
66
  $persist = (int)Mage::getStoreConfig('persistent/options/enabled');
67
  $loggedIn = Mage::getSingleton('customer/session')->isLoggedIn();
68
 
69
+ if ($customerId && $persist) {
70
+ $session = Mage::getSingleton('customer/session');
71
+ $forceLogin = false;
72
+ if ($loggedIn && $customerId != Mage::getSingleton('customer/session')->getCustomer()->getId()) {
73
+ $session->logout()->renewSession();
74
+ $forceLogin = true;
75
+ }
76
+ if ($forceLogin || (!$loggedIn && (!$pCookie || ($pCookie && !$isClear)))) {
77
+ $session->setBeforeAuthUrl($redirectUrl);
78
+ $redirectUrl = Mage::app()->getStore()->getUrl('customer/account/login');
79
+ }
80
  }
81
 
82
  $this->_redirectUrl($redirectUrl);
app/code/community/Bronto/Reminder/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <Bronto_Reminder>
5
- <version>1.4.17</version>
6
  </Bronto_Reminder>
7
  </modules>
8
  <global>
2
  <config>
3
  <modules>
4
  <Bronto_Reminder>
5
+ <version>1.4.18</version>
6
  </Bronto_Reminder>
7
  </modules>
8
  <global>
app/code/community/Bronto/Reminder/sql/bronto_reminder_setup/mysql4-install-1.4.18.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $installer = $this;
4
+
5
+ $installer->startSetup();
6
+
7
+ try {
8
+ $installer->createTables();
9
+ } catch (Exception $e) {
10
+ Mage::helper('bronto_reminder')->writeError('Failed to create reminder tables: ' . $e->getMessage());
11
+ }
12
+
13
+ $installer->endSetup();
app/code/community/Bronto/Reminder/sql/bronto_reminder_setup/mysql4-upgrade-1.4.17-1.4.18.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $installer = $this;
4
+
5
+ $installer->startSetup();
6
+
7
+ try {
8
+ $installer->updateTables('1.4.18');
9
+ } catch (Exception $e) {
10
+ Mage::helper('bronto_reminder')->writeError('Failed to upgrade reminder tables: ' . $e->getMessage());
11
+ }
12
+
13
+ $installer->endSetup();
app/code/community/Bronto/Reviews/Block/Adminhtml/Catalog/Product/Edit/Tab/Abstract.php ADDED
@@ -0,0 +1,74 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ abstract class Bronto_Reviews_Block_Adminhtml_Catalog_Product_Edit_Tab_Abstract
4
+ extends Mage_Adminhtml_Block_Abstract
5
+ implements Mage_Adminhtml_Block_Widget_Tab_Interface, Bronto_Reviews_Block_Adminhtml_Reviews_Typer
6
+ {
7
+ protected $_helper;
8
+
9
+ /**
10
+ * @see parent
11
+ */
12
+ protected function _construct()
13
+ {
14
+ parent::_construct();
15
+ $this->_helper = Mage::helper('bronto_reviews');
16
+ $this->setId("post_{$this->getPostType()}_tab");
17
+ }
18
+
19
+ /**
20
+ * Gets the form for a post purchase type
21
+ *
22
+ * @return string
23
+ */
24
+ public function getTabUrl()
25
+ {
26
+ $product = Mage::registry('product');
27
+ return $this->getUrl('*/postpurchase/form', array(
28
+ 'type' => $this->getPostType(),
29
+ 'product_id' => $product->getId(),
30
+ 'store' => $this->getRequest()->getParam('store', 0),
31
+ '_current' => true
32
+ ));
33
+ }
34
+
35
+ /**
36
+ * @see parent
37
+ */
38
+ public function getTabClass()
39
+ {
40
+ return 'ajax';
41
+ }
42
+
43
+ /**
44
+ * @see parent
45
+ */
46
+ public function getTabLabel()
47
+ {
48
+ return $this->_helper->getPostLabel($this->getPostType());
49
+ }
50
+
51
+ /**
52
+ * @see parent
53
+ */
54
+ public function getTabTitle()
55
+ {
56
+ return $this->getTabLabel();
57
+ }
58
+
59
+ /**
60
+ * @see parent
61
+ */
62
+ public function canShowTab()
63
+ {
64
+ return $this->_helper->isPostEnabled($this->getPostType());
65
+ }
66
+
67
+ /**
68
+ * @see parent
69
+ */
70
+ public function isHidden()
71
+ {
72
+ return false;
73
+ }
74
+ }
app/code/community/Bronto/Reviews/Block/Adminhtml/Catalog/Product/Edit/Tab/Caretip.php ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Bronto_Reviews_Block_Adminhtml_Catalog_Product_Edit_Tab_Caretip
4
+ extends Bronto_Reviews_Block_Adminhtml_Catalog_Product_Edit_Tab_Abstract
5
+ {
6
+ /**
7
+ * Gets the post purchase type
8
+ *
9
+ * @return string
10
+ */
11
+ public function getPostType()
12
+ {
13
+ return Bronto_Reviews_Model_Post_Purchase::TYPE_CARETIP;
14
+ }
15
+ }
app/code/community/Bronto/Reviews/Block/Adminhtml/Catalog/Product/Edit/Tab/Reorder.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Bronto_Reviews_Block_Adminhtml_Catalog_Product_Edit_Tab_Reorder
4
+ extends Bronto_Reviews_Block_Adminhtml_Catalog_Product_Edit_Tab_Abstract
5
+ {
6
+ /**
7
+ * @see parent
8
+ */
9
+ public function getPostType()
10
+ {
11
+ return Bronto_Reviews_Model_Post_Purchase::TYPE_REORDER;
12
+ }
13
+ }
app/code/community/Bronto/Reviews/Block/Adminhtml/Reviews/Delivery.php ADDED
@@ -0,0 +1,77 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Bronto_Reviews_Block_Adminhtml_Reviews_Delivery extends Mage_Adminhtml_Block_Widget_Grid_Container
4
+ {
5
+ protected $_helper;
6
+ protected $_blockGroup = 'bronto_reviews';
7
+ protected $_controller = 'adminhtml_reviews';
8
+ protected $_clearCancelledLabel = 'Clear Cancelled Logs';
9
+ protected $_clearOldLabel = 'Clear Old Logs';
10
+
11
+ /**
12
+ * @see parent
13
+ */
14
+ public function __construct()
15
+ {
16
+ $this->_helper = Mage::helper($this->_blockGroup);
17
+ $this->_headerText = $this->_helper->__('Bronto Post-Purchase Delivery Log');
18
+ parent::__construct();
19
+ $this->_addBackButton();
20
+ $this->_addButton('clear_cancelled', array(
21
+ 'label' => $this->getClearCancelledLabel(),
22
+ 'onclick' => 'setLocation(\'' . $this->getClearCancelledUrl() . '\')',
23
+ 'class' => 'delete'
24
+ ));
25
+ $this->_addButton('clear_old', array(
26
+ 'label' => $this->getClearOldLabel(),
27
+ 'onclick' => 'setLocation(\'' . $this->getClearOldUrl() . '\')',
28
+ 'class' => 'delete'
29
+ ));
30
+ $this->_removeButton('add');
31
+ }
32
+
33
+ /**
34
+ * @return string
35
+ */
36
+ public function getClearCancelledUrl()
37
+ {
38
+ return $this->getUrl('*/*/clear', array('type' => 'cancelled'));
39
+ }
40
+
41
+ /**
42
+ * @return string
43
+ */
44
+ public function getClearOldUrl()
45
+ {
46
+ return $this->getUrl('*/*/clear', array('type' => 'old'));
47
+ }
48
+
49
+ /**
50
+ * @return string
51
+ */
52
+ public function getClearCancelledLabel()
53
+ {
54
+ return $this->_helper->__($this->_clearCancelledLabel);
55
+ }
56
+
57
+ /**
58
+ * @return string
59
+ */
60
+ public function getClearOldLabel()
61
+ {
62
+ return $this->_helper->__($this->_clearOldLabel);
63
+ }
64
+
65
+ /**
66
+ * Goes back to the configuration url
67
+ *
68
+ * @return string
69
+ */
70
+ public function getBackUrl()
71
+ {
72
+ return $this->getUrl('*/system_config/edit', array(
73
+ 'section' => 'bronto_reviews',
74
+ '_current' => true
75
+ ));
76
+ }
77
+ }
app/code/community/Bronto/Reviews/Block/Adminhtml/Reviews/Form/Abstract.php ADDED
@@ -0,0 +1,256 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ abstract class Bronto_Reviews_Block_Adminhtml_Reviews_Form_Abstract
4
+ extends Mage_Adminhtml_Block_Widget_Form
5
+ implements Bronto_Reviews_Block_Adminhtml_Reviews_Typer
6
+ {
7
+ protected $_helper;
8
+ protected $_productHelper;
9
+ protected $_storeId;
10
+ protected $_dependence;
11
+ protected $_enabled;
12
+
13
+ /**
14
+ * @see parent
15
+ */
16
+ protected function _construct()
17
+ {
18
+ parent::_construct();
19
+ $this->_helper = Mage::helper('bronto_reviews');
20
+ $this->_productHelper = Mage::helper('bronto_common/product');
21
+ $this->_storeId = $this->getRequest()->getParam('store', 0);
22
+ }
23
+
24
+ /**
25
+ * Sets up form enablement provided certain conditions are met
26
+ *
27
+ * @param Mage_Catalog_Model_Product $product
28
+ * @return string
29
+ */
30
+ protected function _disabledReason($product)
31
+ {
32
+ $disabledTexts = array();
33
+ $post = Mage::getModel('bronto_reviews/post_purchase');
34
+ $parent = $this->_productHelper->getConfigurableProduct($product);
35
+ if ($product->getId() != $parent->getId() && $parent->getTypeId() == Mage_Catalog_Model_Product_TYPE::TYPE_CONFIGURABLE) {
36
+ $posts = $post->getCollection()
37
+ ->filterByActive(true)
38
+ ->filterByType($this->getPostType())
39
+ ->filterByProduct($parent->getId())
40
+ ->filterByStoreId($this->_storeId);
41
+ foreach ($posts as $postEntry) {
42
+ $store = Mage::app()->getStore($postEntry->getStoreId());
43
+ $storeName = $store->getId() ? $store->getName() : $this->_helper->__('Default');
44
+ $disabledTexts[] = $this->_helper->__("<a href='{$this->getProductUrl($parent, $postEntry->getStoreId())}'>{$parent->getName()} ({$storeName})<a/>");
45
+ }
46
+ } else if ($product->getTypeId() == Mage_Catalog_Model_Product_TYPE::TYPE_CONFIGURABLE) {
47
+ $configurable = Mage::getModel('catalog/product_type_configurable');
48
+ foreach ($configurable->getChildrenIds($product->getId()) as $group => $ids) {
49
+ $posts = $post->getCollection()
50
+ ->filterByActive(true)
51
+ ->filterByType($this->getPostType())
52
+ ->filterByProduct($ids)
53
+ ->filterByStoreId($this->_storeId);
54
+ foreach ($posts as $postEntry) {
55
+ $store = Mage::app()->getStore($postEntry->getStoreId());
56
+ $storeName = $store->getId() ? $store->getName() : $this->_helper->__('Default');
57
+ $child = $this->_productHelper->getProduct($postEntry->getProductId(), $postEntry->getStoreId());
58
+ $disabledTexts[] = $this->_helper->__("<a href='{$this->getProductUrl($child, $postEntry->getStoreId())}'>{$child->getName()} ({$storeName})</a>");
59
+ }
60
+ }
61
+ }
62
+ if (!empty($disabledTexts)) {
63
+ return implode('<br/>', $disabledTexts);
64
+ }
65
+ return null;
66
+ }
67
+
68
+ /**
69
+ * Gets a url to the product in question
70
+ *
71
+ * @param Mage_Catalog_Model_Product $product
72
+ * @return string
73
+ */
74
+ protected function getProductUrl($product, $store = null)
75
+ {
76
+ return $this->getUrl('*/catalog_product/edit', array(
77
+ 'store' => is_null($store) ? $this->_storeId : $store,
78
+ 'active_tab' => "post_{$this->getPostType()}",
79
+ 'id' => $product->getId()
80
+ ));
81
+ }
82
+
83
+ /**
84
+ * Configure special parts of the form
85
+ *
86
+ * @param Varien_Data_Form_Fieldset $fieldset
87
+ * @param Bronto_Reviews_Model_Post_Purchase $post
88
+ * @return void
89
+ */
90
+ protected abstract function _configureFieldset($fieldset, $post);
91
+
92
+ /**
93
+ * @see parent
94
+ */
95
+ protected function _prepareForm()
96
+ {
97
+ $product = Mage::registry('product');
98
+ $messages = Mage::getModel('bronto_common/system_config_source_message');
99
+ $post = Mage::getModel('bronto_reviews/post_purchase')
100
+ ->loadByProduct($product->getId(), $this->getPostType(), $this->_storeId);
101
+
102
+ if ($this->_storeId && !$post->getId()) {
103
+ $post->setUseDefault(true);
104
+ }
105
+
106
+ $form = new Varien_Data_Form(array(
107
+ 'id' => "post_{$this->getPostType()}_form"
108
+ ));
109
+
110
+ $fieldset = $form->addFieldset("post_{$this->getPostType()}", array(
111
+ 'legend' => $this->getTabLabel()
112
+ ));
113
+
114
+ if ($reason = $this->_disabledReason($product)) {
115
+ $fieldset->addField("{$this->getPostType()}_disabled", 'label', array(
116
+ 'label' => $this->_helper->__('Disabled Reason'),
117
+ 'value' => '',
118
+ 'after_element_html' => $reason
119
+ ));
120
+ } else {
121
+ $periodType = "{$this->getPostType()}_period_type";
122
+ $fieldset->addField($periodType, 'hidden', array(
123
+ 'name' => $periodType,
124
+ 'value' => Bronto_Reviews_Model_Post_Purchase::PERIOD_DAILY
125
+ ));
126
+
127
+ $this->_setUpEnablement($fieldset);
128
+ $this->_configureFieldset($fieldset, $post);
129
+
130
+ $messageType = "{$this->getPostType()}_message";
131
+ $message = $fieldset->addField($messageType, 'select', array(
132
+ 'label' => $this->_helper->__('Bronto Message'),
133
+ 'name' => $messageType,
134
+ 'values' => $messages->toOptionArray(null, true)
135
+ ));
136
+
137
+ $this->_dependsOnEnablement($message);
138
+ $form->setValues($this->_productFormData($post));
139
+ $this->setChild('form_after', $this->_dependence);
140
+ }
141
+
142
+ $this->setForm($form);
143
+ return parent::_prepareForm();
144
+ }
145
+
146
+ /**
147
+ * Sets up the enablement and dependence
148
+ *
149
+ * @param Varien_Data_Form_Fieldset $fieldset
150
+ * @return void
151
+ */
152
+ protected function _setUpEnablement($fieldset)
153
+ {
154
+ $this->_dependence = $this->getLayout()->createBlock('adminhtml/widget_form_element_dependence');
155
+
156
+ $useDefault = null;
157
+ if ($this->_storeId) {
158
+ $useDefaultType = "{$this->getPostType()}_use_default";
159
+ $useDefault = $fieldset->addField($useDefaultType, 'select', array(
160
+ 'label' => Mage::helper('adminhtml')->__('Use Default Value'),
161
+ 'name' => $useDefaultType,
162
+ 'values' => Mage::getModel('adminhtml/system_config_source_yesno')->toOptionArray()
163
+ ));
164
+ }
165
+
166
+ $enableType = "{$this->getPostType()}_active";
167
+ $this->_enabled = $fieldset->addField($enableType, 'select', array(
168
+ 'label' => Mage::helper('adminhtml')->__('Enabled'),
169
+ 'name' => $enableType,
170
+ 'values' => Mage::getModel('adminhtml/system_config_source_yesno')->toOptionArray()
171
+ ));
172
+
173
+ $this->_dependence
174
+ ->addFieldMap(
175
+ $this->_enabled->getHtmlId(),
176
+ $this->_enabled->getName());
177
+ if ($useDefault) {
178
+ $this->_dependence
179
+ ->addFieldMap($useDefault->getHtmlId(), $useDefault->getName())
180
+ ->addFieldDependence(
181
+ $this->_enabled->getName(),
182
+ $useDefault->getName(),
183
+ 0);
184
+ }
185
+ }
186
+
187
+ /**
188
+ * Helper method to add form elements to depend on enablement
189
+ *
190
+ * @param Varien_Data_Form_Element $element
191
+ * @return Bronto_Reviews_Block_Adminhtml_Catalog_Product_Edit_Tab_Abstract
192
+ */
193
+ protected function _dependsOnEnablement($element)
194
+ {
195
+ $this->_dependence
196
+ ->addFieldMap($element->getHtmlId(), $element->getName())
197
+ ->addFieldDependence(
198
+ $element->getName(),
199
+ $this->_enabled->getName(),
200
+ 1);
201
+ return $this;
202
+ }
203
+
204
+ /**
205
+ * Creates a default / custom select with to an element
206
+ *
207
+ * @param Varien_Data_Form_Fieldset $fieldset
208
+ * @param array $elementDef
209
+ * @return Varien_Data_Form_Element
210
+ */
211
+ protected function _defaultOverride($fieldset, $post, $elementDef)
212
+ {
213
+ $options = array(
214
+ array(
215
+ 'value' => 'default',
216
+ 'label' => $this->_helper->__('-- Use Default -- ')
217
+ ),
218
+ array(
219
+ 'value' => 'custom',
220
+ 'label' => $this->_helper->__('Custom Value')
221
+ ),
222
+ );
223
+ $originalKey = $elementDef['name'];
224
+ $elementDef['name'] = "{$this->getPostType()}_{$elementDef['name']}";
225
+ $overrideKey = "{$elementDef['name']}_override";
226
+ $override = $fieldset->addField($overrideKey, "select", array(
227
+ 'label' => $elementDef['label'],
228
+ 'name' => $overrideKey,
229
+ 'note' => $elementDef['note'],
230
+ 'values' => $options
231
+ ));
232
+ $post->setData("{$originalKey}_override", is_null($post->getData($originalKey)) ? 'default' : 'custom');
233
+ $elementDef['label'] .= ' Value';
234
+ unset($elementDef['note']);
235
+ $element = $fieldset->addField($elementDef['name'], 'text', $elementDef);
236
+ $this->_dependsOnEnablement($override)->_dependence
237
+ ->addFieldMap($element->getHtmlId(), $element->getName())
238
+ ->addFieldDependence($element->getName(), $override->getName(), 'custom');
239
+ return $element;
240
+ }
241
+
242
+ /**
243
+ * Gets form data values from object
244
+ *
245
+ * @param Bronto_Reviews_Model_Post_Purchase $post
246
+ * @return array
247
+ */
248
+ protected function _productFormData($post)
249
+ {
250
+ $data = array();
251
+ foreach ($post->getData() as $key => $value) {
252
+ $data["{$post->getPostType()}_{$key}"] = $value;
253
+ }
254
+ return $data;
255
+ }
256
+ }
app/code/community/Bronto/Reviews/Block/Adminhtml/Reviews/Form/Caretip.php ADDED
@@ -0,0 +1,55 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Bronto_Reviews_Block_Adminhtml_Reviews_Form_Caretip
4
+ extends Bronto_Reviews_Block_Adminhtml_Reviews_Form_Abstract
5
+ {
6
+ /**
7
+ * @see parent
8
+ */
9
+ public function getPostType()
10
+ {
11
+ return Bronto_Reviews_Model_Post_Purchase::TYPE_CARETIP;
12
+ }
13
+
14
+ /**
15
+ * @see parent
16
+ */
17
+ protected function _configureFieldset($fieldset, $post)
18
+ {
19
+ $defaultSend = $this->_helper->getPostPeriod($this->getPostType());
20
+ $send = $this->_defaultOverride($fieldset, $post, array(
21
+ 'label' => $this->_helper->__('Send Period'),
22
+ 'note' => $this->_helper->__('Schedule the email this many days after the order status trigger for each care notification. Must be greater than or equal to 0.<br/><strong>Default</strong>: ' . $defaultSend),
23
+ 'name' => "period",
24
+ 'required' => true
25
+ ));
26
+
27
+ $defaultAdjust = $this->_helper->getPostAdjustment($this->getPostType());
28
+ $adjustment = $this->_defaultOverride($fieldset, $post, array(
29
+ 'label' => $this->_helper->__('Adjustment Period'),
30
+ 'note' => $this->_helper->__('Adjust the send period by this many days.<br/><strong>Note</strong>: Negative numbers are allowed, and will <em>subtract</em> from the send period.<br/><strong>Default</strong>: '. $defaultAdjust),
31
+ 'name' => 'adjustment',
32
+ ));
33
+
34
+ $defaultSendLimit = $this->_helper->getPostSendLimit($this->getPostType());
35
+ $sendLimit = $this->_defaultOverride($fieldset, $post, array(
36
+ 'label' => $this->_helper->__('Send Limit'),
37
+ 'note' => $this->_helper->__('Number of times the care notification can be scheduled per customer.<br/><strong>Note</strong>: -1 will always schedule.<br/><strong>Default</strong>: ' . $defaultSendLimit),
38
+ 'name' => "send_limit",
39
+ ));
40
+
41
+ $contentType = "{$this->getPostType()}_content";
42
+ $content = $fieldset->addField($contentType, 'textarea', array(
43
+ 'label' => $this->_helper->__('Care Tip Content'),
44
+ 'name' => $contentType,
45
+ 'required' => true,
46
+ 'note' => $this->_helper->__('Care Tip Content should contain customer friendly information specific to this product. This information will be injected into the email via the <em>%%%%#extraContent%%%%</em> API tag and can contain HTML.')
47
+ ));
48
+
49
+ $this
50
+ ->_dependsOnEnablement($send)
51
+ ->_dependsOnEnablement($sendLimit)
52
+ ->_dependsOnEnablement($adjustment)
53
+ ->_dependsOnEnablement($content);
54
+ }
55
+ }
app/code/community/Bronto/Reviews/Block/Adminhtml/Reviews/Form/Reorder.php ADDED
@@ -0,0 +1,46 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Bronto_Reviews_Block_Adminhtml_Reviews_Form_Reorder
4
+ extends Bronto_Reviews_Block_Adminhtml_Reviews_Form_Abstract
5
+ {
6
+ /**
7
+ * @see parent
8
+ */
9
+ public function getPostType()
10
+ {
11
+ return Bronto_Reviews_Model_Post_Purchase::TYPE_REORDER;
12
+ }
13
+
14
+ /**
15
+ * @see parent
16
+ */
17
+ protected function _configureFieldset($fieldset, $post)
18
+ {
19
+ $defaultSend = $this->_helper->getPostPeriod($this->getPostType());
20
+ $send = $this->_defaultOverride($fieldset, $post, array(
21
+ 'label' => $this->_helper->__('Send Period'),
22
+ 'note' => $this->_helper->__('Schedule the email this many days, per unit, after the order status trigger for each reorder reminder. Must be greater than or equal to 0.<br/><strong>Default</strong>: ' . $defaultSend),
23
+ 'name' => 'period',
24
+ 'required' => true
25
+ ));
26
+
27
+ $defaultAdjust = $this->_helper->getPostAdjustment($this->getPostType());
28
+ $adjustment = $this->_defaultOverride($fieldset, $post, array(
29
+ 'label' => $this->_helper->__('Adjustment Period'),
30
+ 'note' => $this->_helper->__('Adjust the send period by this many days.<br/><strong>Note</strong>: Negative numbers are allowed, and will <em>substract</em> from the send period.<br/><strong>Default</strong>: '. $defaultAdjust),
31
+ 'name' => 'adjustment',
32
+ ));
33
+
34
+ $contentType = "{$this->getPostType()}_content";
35
+ $content = $fieldset->addField($contentType, 'textarea', array(
36
+ 'label' => $this->_helper->__('Extra Content'),
37
+ 'name' => $contentType,
38
+ 'note' => $this->_helper->__('Extra Content should contain anything extra specific to this reordered product. This value is optional, and will be injected into the scheduled email via <em>%%%%#extraContent%%%%</em> API tag and can contain HTML')
39
+ ));
40
+
41
+ $this
42
+ ->_dependsOnEnablement($send)
43
+ ->_dependsOnEnablement($adjustment)
44
+ ->_dependsOnEnablement($content);
45
+ }
46
+ }
app/code/community/Bronto/Reviews/Block/Adminhtml/Reviews/Grid.php ADDED
@@ -0,0 +1,178 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Bronto_Reviews_Block_Adminhtml_Reviews_Grid extends Mage_Adminhtml_Block_Widget_Grid
4
+ {
5
+ protected $_helper;
6
+
7
+ /**
8
+ * @see parent
9
+ */
10
+ protected function _construct()
11
+ {
12
+ parent::_construct();
13
+ $this->_helper = Mage::helper('bronto_reviews');
14
+ $this->setId('post_delivery_grid');
15
+ $this->setIdFieldName('log_id');
16
+ $this->setDefaultSort('delivery_date');
17
+ $this->setDefaultDir('DESC');
18
+ $this->setSaveParametersInSession(true);
19
+ }
20
+
21
+ /**
22
+ * Prepares the post purchase delivery grid
23
+ *
24
+ * @return Bronto_Reviews_Block_Adminhtml_Reviews_Grid
25
+ */
26
+ protected function _prepareCollection()
27
+ {
28
+ $this->_beforePrepareCollection();
29
+ return parent::_prepareCollection();
30
+ }
31
+
32
+ /**
33
+ * Allow convenient override for the collection
34
+ *
35
+ * @return Bronto_Reviews_Block_Adminhtml_Reviews_Grid
36
+ */
37
+ protected function _beforePrepareCollection()
38
+ {
39
+ $collection = Mage::getModel('bronto_reviews/log')->getCollection();
40
+ $this->setCollection($collection);
41
+ return $this;
42
+ }
43
+
44
+ /**
45
+ * Prepares the mass action block
46
+ *
47
+ * @return Bronto_Reviews_Block_Adminhtml_Reviews_Grid
48
+ */
49
+ protected function _prepareMassaction()
50
+ {
51
+ $this->setMassactionIdField('log_id');
52
+ $this->getMassactionBlock()->setFormFieldName('id');
53
+
54
+ $this->getMassactionBlock()->addItem('cancel', array(
55
+ 'label' => $this->_helper->__('Cancel'),
56
+ 'confirm' => $this->_helper->__('Are you sure?'),
57
+ 'url' => $this->getUrl('*/postpurchase/cancel')
58
+ ));
59
+ $this->getMassactionBlock()->addItem('delete', array(
60
+ 'label' => $this->_helper->__('Purge'),
61
+ 'confirm' => $this->_helper->__('Are you sure?'),
62
+ 'url' => $this->getUrl('*/postpurchase/delete')
63
+ ));
64
+ return $this;
65
+ }
66
+
67
+ /**
68
+ * Prepares the columns of the grid
69
+ *
70
+ * @see parent
71
+ */
72
+ protected function _prepareColumns()
73
+ {
74
+ $yesNoOptions = Mage::getModel('adminhtml/system_config_source_yesno');
75
+ $options = array();
76
+ foreach ($yesNoOptions->toOptionArray() as $option) {
77
+ $options[$option['value']] = $option['label'];
78
+ }
79
+
80
+ $this->addColumn('log_id', array(
81
+ 'header' => $this->_helper->__('ID'),
82
+ 'align' => 'left',
83
+ 'index' => 'log_id',
84
+ 'type' => 'number',
85
+ 'filter' => false
86
+ ));
87
+
88
+ $this->addColumn('message_name', array(
89
+ 'header' => $this->_helper->__('Message Name'),
90
+ 'align' => 'left',
91
+ 'index' => 'message_name',
92
+ 'type' => 'text',
93
+ 'sortable' => false,
94
+ 'filter' => false
95
+ ));
96
+
97
+ $this->addColumn('order_increment_id', array(
98
+ 'header' => $this->_helper->__('Order Increment ID'),
99
+ 'align' => 'left',
100
+ 'index' => 'order_increment_id',
101
+ 'renderer' => 'bronto_reviews/adminhtml_reviews_grid_renderer_order',
102
+ 'type' => 'text',
103
+ 'sortable' => false,
104
+ 'filter' => false,
105
+ ));
106
+
107
+ $this->addColumn('post_name', array(
108
+ 'header' => $this->_helper->__('Post Type'),
109
+ 'align' => 'left',
110
+ 'index' => 'post_name',
111
+ 'type' => 'text',
112
+ 'sortable' => false,
113
+ 'filter' => false
114
+ ));
115
+
116
+ $this->addColumn('product_name', array(
117
+ 'header' => $this->_helper->__('Product Name'),
118
+ 'align' => 'left',
119
+ 'index' => 'product_name',
120
+ 'renderer' => 'bronto_reviews/adminhtml_reviews_grid_renderer_product',
121
+ 'type' => 'text',
122
+ 'sortable' => false,
123
+ 'filter' => false
124
+ ));
125
+
126
+ $this->addColumn('delivery_date', array(
127
+ 'header' => $this->_helper->__('Delivery Date'),
128
+ 'align' => 'left',
129
+ 'index' => 'delivery_date',
130
+ 'type' => 'datetime'
131
+ ));
132
+
133
+ $this->addColumn('customer_email', array(
134
+ 'header' => Mage::helper('customer')->__('Email'),
135
+ 'index' => 'customer_email'
136
+ ));
137
+
138
+ if (!Mage::app()->isSingleStoreMode()) {
139
+ $this->addColumn('store_id', array(
140
+ 'header' => $this->_helper->__('Store View'),
141
+ 'type' => 'store',
142
+ 'skipAllStoresLabel' => true,
143
+ 'index' => 'store_id',
144
+ 'sortable' => false,
145
+ 'store_view' => true,
146
+ 'width' => '120px'
147
+ ));
148
+ }
149
+
150
+ $this->addColumn('cancelled', array(
151
+ 'header' => $this->_helper->__('Cancelled'),
152
+ 'index' => 'cancelled',
153
+ 'type' => 'options',
154
+ 'options' => $options,
155
+ 'align' => 'left',
156
+ 'sortable' => false,
157
+ ));
158
+
159
+ $this->addColumn('data', array(
160
+ 'header' => Mage::helper('bronto_email')->__('Fields'),
161
+ 'align' => 'left',
162
+ 'index' => 'fields',
163
+ 'renderer' => 'bronto_email/adminhtml_system_email_log_grid_renderer_fields',
164
+ 'sortable' => false,
165
+ 'filter' => false,
166
+ ));
167
+
168
+ $this->addColumn('action', array(
169
+ 'header' => $this->_helper->__('Action'),
170
+ 'index' => 'log_id',
171
+ 'sortable' => false,
172
+ 'filter' => false,
173
+ 'renderer' => 'bronto_reviews/adminhtml_reviews_grid_renderer_action',
174
+ ));
175
+
176
+ return parent::_prepareColumns();
177
+ }
178
+ }
app/code/community/Bronto/Reviews/Block/Adminhtml/Reviews/Grid/Renderer/Action.php ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Bronto_Reviews_Block_Adminhtml_Reviews_Grid_Renderer_Action extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Action
4
+ {
5
+ /**
6
+ * Override for immediate action on a delivery
7
+ *
8
+ * @param Varien_Object $row
9
+ * @return string
10
+ */
11
+ public function render(Varien_Object $row)
12
+ {
13
+ $actions = array();
14
+ if ($row->isCancelable()) {
15
+ $actions[] = array(
16
+ 'url' => $this->getUrl('*/postpurchase/cancel', array('id' => $row->getId())),
17
+ 'caption' => $this->__('Cancel'),
18
+ 'confirm' => $this->__('Are you sure you want to cancel the %s for order #%s?', $row->getPostName(), $row->getOrderIncrementId())
19
+ );
20
+ }
21
+ $actions[] = array(
22
+ 'url' => $this->getUrl('*/postpurchase/delete', array('id' => $row->getId())),
23
+ 'caption' => $this->__('Purge'),
24
+ 'confirm' => $this->__('Are you sure you want to purge the %s for order #%s?', $row->getPostName(), $row->getOrderIncrementId())
25
+ );
26
+ $this->getColumn()->setActions($actions);
27
+ return parent::render($row);
28
+ }
29
+ }
app/code/community/Bronto/Reviews/Block/Adminhtml/Reviews/Grid/Renderer/Order.php ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Bronto_Reviews_Block_Adminhtml_Reviews_Grid_Renderer_Order extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
4
+ {
5
+ /**
6
+ * Returns the url to the order view page
7
+ *
8
+ * @param Varien_Object $row
9
+ * @return string
10
+ */
11
+ public function render(Varien_Object $row)
12
+ {
13
+ $url = Mage::getModel('adminhtml/url')->getUrl('*/sales_order/view/', array(
14
+ 'order_id' => $row->getOrderId()
15
+ ));
16
+ return sprintf('<a href="%s">%s</a>', $url, $row->getOrderIncrementId());
17
+ }
18
+ }
app/code/community/Bronto/Reviews/Block/Adminhtml/Reviews/Grid/Renderer/Product.php ADDED
@@ -0,0 +1,19 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Bronto_Reviews_Block_Adminhtml_Reviews_Grid_Renderer_Product extends Mage_Adminhtml_Block_Widget_Grid_Column_Renderer_Abstract
4
+ {
5
+ /**
6
+ * Return the product named URL
7
+ *
8
+ * @param Varien_Object $row
9
+ * @return string
10
+ */
11
+ public function render(Varien_Object $row)
12
+ {
13
+ if ($row->getProductId()) {
14
+ $url = Mage::getModel('adminhtml/url')->getUrl('*/catalog_product/edit', array('id' => $row->getProductId()));
15
+ return sprintf('<a href="%s">%s</a>', $url, $row->getProductName());
16
+ }
17
+ return 'NA';
18
+ }
19
+ }
app/code/community/Bronto/Reviews/Block/Adminhtml/Reviews/Typer.php ADDED
@@ -0,0 +1,11 @@
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ interface Bronto_Reviews_Block_Adminhtml_Reviews_Typer
4
+ {
5
+ /**
6
+ * Gets the post type for various UI controls
7
+ *
8
+ * @retrn string
9
+ */
10
+ public function getPostType();
11
+ }
app/code/community/Bronto/Reviews/Block/Adminhtml/Sales/Order/View/Tab/Post/Purchase.php ADDED
@@ -0,0 +1,105 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Bronto_Reviews_Block_Adminhtml_Sales_Order_View_Tab_Post_Purchase
4
+ extends Bronto_Reviews_Block_Adminhtml_Reviews_Grid
5
+ implements Mage_Adminhtml_Block_Widget_Tab_Interface
6
+ {
7
+ protected $_singleton;
8
+
9
+ /**
10
+ * @see parent
11
+ */
12
+ protected function _construct()
13
+ {
14
+ parent::_construct();
15
+ $this->_singleton = Mage::getModel('bronto_reviews/post_purchase');
16
+ $this->setId('post_order_grid');
17
+ $this->setSaveParametersInSession(false);
18
+ $this->setUseAjax(true);
19
+ }
20
+
21
+ /**
22
+ * Override for order view
23
+ * @see parent
24
+ */
25
+ protected function _prepareColumns()
26
+ {
27
+ parent::_prepareColumns();
28
+ unset($this->_columns['order_increment_id']);
29
+ unset($this->_columns['customer_email']);
30
+ unset($this->_columns['store_id']);
31
+ return $this;
32
+ }
33
+
34
+ /**
35
+ * @see parent
36
+ */
37
+ protected function _beforePrepareCollection()
38
+ {
39
+ if ($this->getOrder() && $this->getOrder()->getId()) {
40
+ $collection = Mage::getModel('bronto_reviews/log')->getCollection();
41
+ $collection->addFieldToFilter('order_id', array('eq' => $this->getOrder()->getId()));
42
+ $this->setCollection($collection);
43
+ return $this;
44
+ }
45
+ return parent::_beforePrepareCollection();
46
+ }
47
+
48
+ /**
49
+ * @see parent
50
+ */
51
+ public function getGridUrl()
52
+ {
53
+ return $this->getUrl('*/postpurchase/order', array('_current' => true));
54
+ }
55
+
56
+ /**
57
+ * Gets the order model from the registry
58
+ *
59
+ * @return Mage_Sales_Model_Order
60
+ */
61
+ public function getOrder()
62
+ {
63
+ return Mage::registry('current_order');
64
+ }
65
+
66
+ /**
67
+ * @see parent
68
+ */
69
+ public function getTabLabel()
70
+ {
71
+ return $this->_helper->__('Post-Purchase Emails');
72
+ }
73
+
74
+ /**
75
+ * @see parent
76
+ */
77
+ public function getTabTitle()
78
+ {
79
+ return $this->getTabLabel();
80
+ }
81
+
82
+ /**
83
+ * @see parent
84
+ */
85
+ public function canShowTab()
86
+ {
87
+ if (!$this->getOrder() || !$this->getOrder()->getStoreId()) {
88
+ return false;
89
+ }
90
+ $storeId = $this->getOrder()->getStoreId();
91
+ $enabled = $this->_helper->isEnabled('store', $storeId);
92
+ foreach ($this->_singleton->getSupportedTypes() as $postType) {
93
+ $enabled = $enabled || $this->_helper->isPostEnabled($postType, 'store', $storeId);
94
+ }
95
+ return $enabled;
96
+ }
97
+
98
+ /**
99
+ * @see parent
100
+ */
101
+ public function isHidden()
102
+ {
103
+ return false;
104
+ }
105
+ }
app/code/community/Bronto/Reviews/Helper/Data.php CHANGED
@@ -8,17 +8,37 @@ class Bronto_Reviews_Helper_Data
8
  extends Bronto_Common_Helper_Data
9
  implements Bronto_Common_Helper_DataInterface
10
  {
 
 
 
 
11
  const XML_PATH_ENABLED = 'bronto_reviews/settings/enabled';
12
  const XML_PATH_STATUS = 'bronto_reviews/settings/status';
13
  const XML_PATH_CANCEL_STATUS = 'bronto_reviews/settings/cancel_status';
14
  const XML_PATH_URL_SUFFIX = 'bronto_reviews/settings/url_suffix';
15
  const XML_PATH_PERIOD = 'bronto_reviews/settings/period';
16
  const XML_PATH_MESSAGE = 'bronto_reviews/settings/message';
 
17
  const XML_PATH_SENDER_EMAIL = 'bronto_reviews/settings/sender_email';
18
  const XML_PATH_SENDER_NAME = 'bronto_reviews/settings/sender_name';
19
  const XML_PATH_REPLY_TO = 'bronto_reviews/settings/reply_to';
20
  const XML_PATH_DEFAULT_COUPON = 'bronto_reviews/settings/default_coupon';
21
  const XML_PATH_DEFAULT_REC = 'bronto_reviews/settings/default_recommendation';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
22
 
23
  /**
24
  * Gets the canonical name for the Bronto Review module
@@ -27,7 +47,7 @@ class Bronto_Reviews_Helper_Data
27
  */
28
  public function getName()
29
  {
30
- return 'Bronto Review Requests';
31
  }
32
 
33
  /**
@@ -44,6 +64,213 @@ class Bronto_Reviews_Helper_Data
44
  return (bool)$this->getAdminScopedConfig(self::XML_PATH_ENABLED, $scope, $scopeId);
45
  }
46
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
47
  /**
48
  * Disable Module for Specified Scope
49
  *
@@ -55,7 +282,12 @@ class Bronto_Reviews_Helper_Data
55
  */
56
  public function disableModule($scope = 'default', $scopeId = 0, $deleteConfig = false)
57
  {
58
- return $this->_disableModule(self::XML_PATH_ENABLED, $scope, $scopeId, $deleteConfig);
 
 
 
 
 
59
  }
60
 
61
  /**
@@ -95,6 +327,18 @@ class Bronto_Reviews_Helper_Data
95
  return $this->getAdminScopedConfig(self::XML_PATH_DEFAULT_REC, $scope, $scopeId);
96
  }
97
 
 
 
 
 
 
 
 
 
 
 
 
 
98
  /**
99
  * Get Order Status at which to cancel Review Request Emails
100
  *
@@ -188,6 +432,18 @@ class Bronto_Reviews_Helper_Data
188
  return $this->getAdminScopedConfig(self::XML_PATH_SENDER_EMAIL, $scope, $scopeId);
189
  }
190
 
 
 
 
 
 
 
 
 
 
 
 
 
191
  /**
192
  * Get Sender Name
193
  *
@@ -213,4 +469,85 @@ class Bronto_Reviews_Helper_Data
213
  {
214
  return $this->getAdminScopedConfig(self::XML_PATH_REPLY_TO, $scope, $scopeId);
215
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
216
  }
8
  extends Bronto_Common_Helper_Data
9
  implements Bronto_Common_Helper_DataInterface
10
  {
11
+
12
+ const XML_PATH_GENERAL_TIME_OF_DAY = 'bronto_reviews/general/time_of_day';
13
+ const XML_PATH_GENERAL_CONCURRENT = 'bronto_reviews/general/conncurrent_limit';
14
+
15
  const XML_PATH_ENABLED = 'bronto_reviews/settings/enabled';
16
  const XML_PATH_STATUS = 'bronto_reviews/settings/status';
17
  const XML_PATH_CANCEL_STATUS = 'bronto_reviews/settings/cancel_status';
18
  const XML_PATH_URL_SUFFIX = 'bronto_reviews/settings/url_suffix';
19
  const XML_PATH_PERIOD = 'bronto_reviews/settings/period';
20
  const XML_PATH_MESSAGE = 'bronto_reviews/settings/message';
21
+ const XML_PATH_EMAIL_IDENTITY = 'bronto_reviews/settings/identity';
22
  const XML_PATH_SENDER_EMAIL = 'bronto_reviews/settings/sender_email';
23
  const XML_PATH_SENDER_NAME = 'bronto_reviews/settings/sender_name';
24
  const XML_PATH_REPLY_TO = 'bronto_reviews/settings/reply_to';
25
  const XML_PATH_DEFAULT_COUPON = 'bronto_reviews/settings/default_coupon';
26
  const XML_PATH_DEFAULT_REC = 'bronto_reviews/settings/default_recommendation';
27
+ const XML_PATH_DEFAULT_SEND_FLAG = 'bronto_reviews/settings/default_send_flags';
28
+
29
+ const XML_PATH_POST_ENABLED = 'bronto_reviews/%s/enabled';
30
+ const XML_PATH_POST_PERIOD = 'bronto_reviews/%s/period';
31
+ const XML_PATH_POST_MESSAGE = 'bronto_reviews/%s/message';
32
+ const XML_PATH_POST_TRIGGER = 'bronto_reviews/%s/status';
33
+ const XML_PATH_POST_CANCEL = 'bronto_reviews/%s/cancel_status';
34
+ const XML_PATH_POST_COUPON = 'bronto_reviews/%s/default_coupon';
35
+ const XML_PATH_POST_RECOMEND = 'bronto_reviews/%s/default_recommendation';
36
+ const XML_PATH_POST_FLAGS = 'bronto_reviews/%s/default_send_flags';
37
+ const XML_PATH_POST_IDENTITY = 'bronto_reviews/%s/identity';
38
+ const XML_PATH_POST_ADJUSTMENT = 'bronto_reviews/%s/adjustment';
39
+ const XML_PATH_POST_SEND_LIMIT = 'bronto_reviews/%s/send_limit';
40
+ const XML_PATH_POST_SENDER_EMAIL = 'bronto_reviews/%s/sender_email';
41
+ const XML_PATH_POST_SENDER_NAME = 'bronto_reviews/%s/sender_name';
42
 
43
  /**
44
  * Gets the canonical name for the Bronto Review module
47
  */
48
  public function getName()
49
  {
50
+ return $this->__('Bronto Post-Purchase Emails');
51
  }
52
 
53
  /**
64
  return (bool)$this->getAdminScopedConfig(self::XML_PATH_ENABLED, $scope, $scopeId);
65
  }
66
 
67
+ /**
68
+ * @see parent
69
+ */
70
+ public function canSendBronto(Mage_Core_Model_Email_Template $template, $storeId = null)
71
+ {
72
+ return true;
73
+ }
74
+
75
+ /**
76
+ * Gets the active concurrent limit for a scope
77
+ *
78
+ * @param string $scope
79
+ * @param int $scopeId
80
+ * @return int
81
+ */
82
+ public function getConcurrentLimit($scope = 'default', $scopeId = 0)
83
+ {
84
+ return (int)$this->getAdminScopedConfig(self::XML_PATH_GENERAL_CONCURRENT, $scope, $scopeId);
85
+ }
86
+
87
+ /**
88
+ * Gets the desired time of day for scheduled emails
89
+ *
90
+ * @param string $scope
91
+ * @param int $scopeId
92
+ * @return int
93
+ */
94
+ public function getDesiredTimeOfDay($scope = 'default', $scopeId = 0)
95
+ {
96
+ return (int)$this->getAdminScopedConfig(self::XML_PATH_GENERAL_TIME_OF_DAY, $scope, $scopeId);
97
+ }
98
+
99
+ /**
100
+ * Check if the post type is enabled
101
+ *
102
+ * @param string $type
103
+ * @param string $scope
104
+ * @param int $scopeId
105
+ * @return boolean
106
+ */
107
+ public function isPostEnabled($type, $scope = 'default', $scopeId = 0)
108
+ {
109
+ return (bool)$this->getAdminScopedConfig(sprintf(self::XML_PATH_POST_ENABLED, $type), $scope, $scopeId);
110
+ }
111
+
112
+ /**
113
+ * Gets the send period for the post type
114
+ *
115
+ * @param string $type
116
+ * @param string $scope
117
+ * @param int $scopeId
118
+ * @return int
119
+ */
120
+ public function getPostPeriod($type, $scope = 'default', $scopeId = 0)
121
+ {
122
+ return (int)$this->getAdminScopedConfig(sprintf(self::XML_PATH_POST_PERIOD, $type), $scope, $scopeId);
123
+ }
124
+
125
+ /**
126
+ * Gets the bronto message id for the post type
127
+ *
128
+ * @param string $type
129
+ * @param string $scope
130
+ * @param int $scopeId
131
+ * @return string
132
+ */
133
+ public function getPostMessage($type, $scope = 'default', $scopeId = 0)
134
+ {
135
+ return $this->getAdminScopedConfig(sprintf(self::XML_PATH_POST_MESSAGE, $type), $scope, $scopeId);
136
+ }
137
+
138
+ /**
139
+ * Gets the trigger status for the post purchase message
140
+ *
141
+ * @param string $type
142
+ * @param string $scope
143
+ * @param int $scopeId
144
+ * @return string
145
+ */
146
+ public function getPostTrigger($type, $scope = 'default', $scopeId = 0)
147
+ {
148
+ return $this->getAdminScopedConfig(sprintf(self::XML_PATH_POST_TRIGGER, $type), $scope, $scopeId);
149
+ }
150
+
151
+ /**
152
+ * Gets the cancelling status for the post purchase message
153
+ *
154
+ * @param string $type
155
+ * @param string $scope
156
+ * @param int $scopeId
157
+ * @return array
158
+ */
159
+ public function getPostCancel($type, $scope = 'default', $scopeId = 0)
160
+ {
161
+ $statuses = $this->getAdminScopedConfig(sprintf(self::XML_PATH_POST_CANCEL, $type), $scope, $scopeId);
162
+ if (!empty($statuses)) {
163
+ $statuses = explode(',', $statuses);
164
+ } else {
165
+ $statuses = array();
166
+ }
167
+ return $statuses;
168
+ }
169
+
170
+ /**
171
+ * Gets the send flags for the post purchase message
172
+ *
173
+ * @param string $type
174
+ * @param string $scope
175
+ * @param int $scopeId
176
+ * @return int
177
+ */
178
+ public function getPostSendFlags($type, $scope = 'default', $scopeId = 0)
179
+ {
180
+ return (int)$this->getAdminScopedConfig(sprintf(self::XML_PATH_POST_FLAGS, $type), $scope, $scopeId);
181
+ }
182
+
183
+ /**
184
+ * Gets the coupon pool for the post purchase message
185
+ *
186
+ * @param string $type
187
+ * @param string $scope
188
+ * @param int $scopeId
189
+ * @return int
190
+ */
191
+ public function getPostRule($type, $scope = 'default', $scopeId = 0)
192
+ {
193
+ return $this->getAdminScopedConfig(sprintf(self::XML_PATH_POST_COUPON, $type), $scope, $scopeId);
194
+ }
195
+
196
+ /**
197
+ * Gets the recommendation for the post purchase message
198
+ *
199
+ * @param string $type
200
+ * @param string $scope
201
+ * @param int $scopeId
202
+ * @return int
203
+ */
204
+ public function getPostRecommendation($type, $scope = 'default', $scopeId = 0)
205
+ {
206
+ return $this->getAdminScopedConfig(sprintf(self::XML_PATH_POST_RECOMEND, $type), $scope, $scopeId);
207
+ }
208
+
209
+ /**
210
+ * Gets the email identity for the post purchase message
211
+ *
212
+ * @param string $type
213
+ * @param string $scope
214
+ * @param int $scopeId
215
+ * @return int
216
+ */
217
+ public function getPostEmailIdentity($type, $scope = 'default', $scopeId = 0)
218
+ {
219
+ return $this->getAdminScopedConfig(sprintf(self::XML_PATH_POST_IDENTITY, $type), $scope, $scopeId);
220
+ }
221
+
222
+ /**
223
+ * Gets the custom sender name for the post purchase message
224
+ *
225
+ * @param string $type
226
+ * @param string $scope
227
+ * @param int $scopeId
228
+ * @return int
229
+ */
230
+ public function getPostSenderName($type, $scope = 'default', $scopeId = 0)
231
+ {
232
+ return $this->getAdminScopedConfig(sprintf(self::XML_PATH_POST_SENDER_NAME, $type), $scope, $scopeId);
233
+ }
234
+
235
+ /**
236
+ * Gets the custom sender email for the post purchase message
237
+ *
238
+ * @param string $type
239
+ * @param string $scope
240
+ * @param int $scopeId
241
+ * @return int
242
+ */
243
+ public function getPostSenderEmail($type, $scope = 'default', $scopeId = 0)
244
+ {
245
+ return $this->getAdminScopedConfig(sprintf(self::XML_PATH_POST_SENDER_EMAIL, $type), $scope, $scopeId);
246
+ }
247
+
248
+ /**
249
+ * Gets the send limit for a post type
250
+ *
251
+ * @param string $type
252
+ * @param string $scope
253
+ * @param int $scopeId
254
+ * @return int
255
+ */
256
+ public function getPostSendLimit($type, $scope = 'default', $scopeId = 0)
257
+ {
258
+ return (int)$this->getAdminScopedConfig(sprintf(self::XML_PATH_POST_SEND_LIMIT, $type), $scope, $scopeId);
259
+ }
260
+
261
+ /**
262
+ * Gets the adjustment period for a post type
263
+ *
264
+ * @param string $type
265
+ * @param string $scope
266
+ * @param int $scopeId
267
+ * @return int
268
+ */
269
+ public function getPostAdjustment($type, $scope = 'default', $scopeId = 0)
270
+ {
271
+ return (int)$this->getAdminScopedConfig(sprintf(self::XML_PATH_POST_ADJUSTMENT, $type), $scope, $scopeId);
272
+ }
273
+
274
  /**
275
  * Disable Module for Specified Scope
276
  *
282
  */
283
  public function disableModule($scope = 'default', $scopeId = 0, $deleteConfig = false)
284
  {
285
+ $success = true;
286
+ foreach (array('settings', 'reorder', 'caretip') as $type) {
287
+ $xmlPath = sprintf(self::XML_PATH_POST_ENABLED, $type);
288
+ $success = $success && $this->_disableModule($xmlPath, $scope, $scopeId, $deleteConfig);
289
+ }
290
+ return $success;
291
  }
292
 
293
  /**
327
  return $this->getAdminScopedConfig(self::XML_PATH_DEFAULT_REC, $scope, $scopeId);
328
  }
329
 
330
+ /**
331
+ * Gets the send flags to be used for this review
332
+ *
333
+ * @param string $scope
334
+ * @param int $scopeId
335
+ * @return string
336
+ */
337
+ public function getDefaultSendFlags($scope = 'default', $scopeId)
338
+ {
339
+ return $this->getAdminScopedConfig(self::XML_PATH_DEFAULT_SEND_FLAG, $scope, $scopeId);
340
+ }
341
+
342
  /**
343
  * Get Order Status at which to cancel Review Request Emails
344
  *
432
  return $this->getAdminScopedConfig(self::XML_PATH_SENDER_EMAIL, $scope, $scopeId);
433
  }
434
 
435
+ /**
436
+ * Get email identity
437
+ *
438
+ * @param string $scope
439
+ * @param int $scopeId
440
+ * @return string
441
+ */
442
+ public function getEmailIdentity($scope = 'default', $scopeId = 0)
443
+ {
444
+ return $this->getAdminScopedConfig(self::XML_PATH_EMAIL_IDENTITY, $scope, $scopeId);
445
+ }
446
+
447
  /**
448
  * Get Sender Name
449
  *
469
  {
470
  return $this->getAdminScopedConfig(self::XML_PATH_REPLY_TO, $scope, $scopeId);
471
  }
472
+
473
+ /**
474
+ * Gets the label for a given post type
475
+ *
476
+ * @param string $postType
477
+ * @return string
478
+ */
479
+ public function getPostLabel($postType)
480
+ {
481
+ switch ($postType) {
482
+ case Bronto_Reviews_Model_Post_Purchase::TYPE_REORDER:
483
+ return $this->__('Reorder Reminder');
484
+ case Bronto_Reviews_Model_Post_Purchase::TYPE_CARETIP:
485
+ return $this->__('Care Tips Notification');
486
+ default:
487
+ return $this->__('Review Request');
488
+ }
489
+ }
490
+
491
+ /**
492
+ * Gets the default send period for post
493
+ *
494
+ * @param Bronto_Reviews_Model_Post_Purchase $post
495
+ * @param int $storeId
496
+ * @return int
497
+ */
498
+ public function getDefaultPostPeriod($post, $storeId = 0)
499
+ {
500
+ if (is_null($post->getPeriod())) {
501
+ return $this->getPostPeriod($post->getPostType(), 'store', $storeId);
502
+ }
503
+ return (int)$post->getPeriod();
504
+ }
505
+
506
+ /**
507
+ * Gets the default adjustment period for the post
508
+ *
509
+ * @param Bronto_Reviews_Model_Post_Purchase $post
510
+ * @param int $storeId
511
+ * @return int
512
+ */
513
+ public function getDefaultAdjustment($post, $storeId = 0)
514
+ {
515
+ if (is_null($post->getAdjustment())) {
516
+ return $this->getPostAdjustment($post->getPostType(), 'store', $storeId);
517
+ }
518
+ return (int)$post->getAdjustment();
519
+ }
520
+
521
+ /**
522
+ * Gets the default send limit for a post
523
+ *
524
+ * @param Bronto_Reviews_Model_Post_Purchase $post
525
+ * @param int $storeId
526
+ * @return int
527
+ */
528
+ public function getDefaultSendLimit($post, $storeId = 0)
529
+ {
530
+ if (is_null($post->getSendLimit())) {
531
+ return $this->getPostSendLimit($post->getPostType(), 'store', $storeId);
532
+ }
533
+ return (int)$post->getSendLimit();
534
+ }
535
+
536
+ /**
537
+ * Gets the default Bronto message for the post type
538
+ *
539
+ * @param Bronto_Reviews_Model_Post_Purchase $post
540
+ * @param int $storeId
541
+ * @return string
542
+ */
543
+ public function getDefaultMessage($post, $storeId = 0)
544
+ {
545
+ if (is_null($post)) {
546
+ return $this->getReviewSendMessage('store', $storeId);
547
+ } else if (is_null($post->getMessage())) {
548
+ return $this->getPostMessage($post->getPostType(), 'store', $storeId);
549
+ } else {
550
+ return $post->getMessage();
551
+ }
552
+ }
553
  }
app/code/community/Bronto/Reviews/Model/Log.php ADDED
@@ -0,0 +1,139 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Bronto_Reviews_Model_Log extends Mage_Core_Model_Abstract
4
+ {
5
+ // Thirty minutes to compensate the delivery prep time
6
+ const THIRTY_MINS = 1800;
7
+ const UPDATE_STEP = 50;
8
+
9
+ private static $_cancelableDeliveries = array();
10
+
11
+ /**
12
+ * @see parent
13
+ */
14
+ protected function _construct()
15
+ {
16
+ parent::_construct();
17
+ $this->_init('bronto_reviews/log');
18
+ }
19
+
20
+ /**
21
+ * Loads the log by the order and delivery id
22
+ *
23
+ * @param int $orderId
24
+ * @param mixed $deliveryId
25
+ * @return Bronto_Reviews_Model_Log
26
+ */
27
+ public function loadByOrderAndDeliveryId($orderId, $deliveryId = null)
28
+ {
29
+ $this->setOrderId($orderId);
30
+ $this->setDeliveryId($deliveryId);
31
+ $this->_getResource()->loadByOrderAndDeliveryId($this, $orderId, $deliveryId);
32
+ return $this;
33
+ }
34
+
35
+ /**
36
+ * Loads the log by the order and post purchase
37
+ *
38
+ * @param int $orderId
39
+ * @param int $postId
40
+ * @return Bronto_Reviews_Model_Log
41
+ */
42
+ public function loadByOrderAndPost($orderId, $postId = null)
43
+ {
44
+ $this->setOrderId($orderId);
45
+ $this->setPostId($postId);
46
+ $this->_getResource()->loadByOrderAndPost($this, $orderId, $postId);
47
+ return $this;
48
+ }
49
+
50
+ /**
51
+ * Determines if this delivery is cancelable
52
+ *
53
+ * @return boolean
54
+ */
55
+ public function isCancelable()
56
+ {
57
+ $deliveryDate = strtotime($this->getDeliveryDate()) - self::THIRTY_MINS;
58
+ return $this->getDeliveryId() && !$this->getCancelled() && $deliveryDate > time();
59
+ }
60
+
61
+ /**
62
+ * Is this delivery currently being queued
63
+ *
64
+ * @return boolean
65
+ */
66
+ public function isQueued()
67
+ {
68
+ return $this->getDeliveryId() && is_numeric($this->getDeliveryId());
69
+ }
70
+
71
+ /**
72
+ * Cancels this delivery one way or another
73
+ *
74
+ * @param int $storeId
75
+ */
76
+ public function cancel()
77
+ {
78
+ if ($this->isQueued() || $this->isCancelable()) {
79
+ if (is_numeric($this->getDeliveryId())) {
80
+ Mage::getModel('bronto_common/queue')
81
+ ->load($this->getDeliveryId())
82
+ ->delete();
83
+ } else {
84
+ if (!array_key_exists($this->getStoreId(), self::$_cancelableDeliveries)) {
85
+ self::$_cancelableDeliveries[$this->getStoreId()] = array();
86
+ }
87
+ self::$_cancelableDeliveries[$this->getStoreId()][] = array(
88
+ 'id' => $this->getDeliveryId(),
89
+ 'status' => 'skipped'
90
+ );
91
+ if (count(self::$_cancelableDeliveries[$this->getStoreId()]) == self::UPDATE_STEP) {
92
+ $this->_flushDeliveriesForStore($this->getStoreId());
93
+ }
94
+ }
95
+ $this->setCancelled(true)->save();
96
+ }
97
+ return $this;
98
+ }
99
+
100
+ /**
101
+ * Flushed the deliveries for a given store
102
+ *
103
+ * @param int $storeId
104
+ */
105
+ protected function _flushDeliveriesForStore($storeId)
106
+ {
107
+ if (array_key_exists($storeId, self::$_cancelableDeliveries)) {
108
+ $api = Mage::helper('bronto_common')->getApi(null, 'store', $storeId);
109
+ $deliveryObject = $api->getDeliveryObject();
110
+ $deliveryRows = self::$_cancelableDeliveries[$storeId];
111
+ try {
112
+ $result = $deliveryObject->update($deliveryRows);
113
+ if ($result->hasErrors()) {
114
+ $errors = array();
115
+ foreach ($result->getErrors() as $soapFault) {
116
+ $errors[] = $soapFault['code'] . ": " . $soapFault['message'];
117
+ }
118
+ $error = implode('<br />', $errors);
119
+ Mage::throwException($error);
120
+ }
121
+ } catch (Exception $e) {
122
+ Mage::helper('bronto_reviews')->writeError('Failed Cancelling Deliveries: ' . $e->getMessage());
123
+ }
124
+ unset(self::$_cancelableDeliveries[$storeId]);
125
+ }
126
+ }
127
+
128
+ /**
129
+ * Updates all deliveries to be cancelled... in bulk
130
+ */
131
+ public function flushCancelableDeliveries()
132
+ {
133
+ if (!empty(self::$_cancelableDeliveries)) {
134
+ foreach (self::$_cancelableDeliveries as $storeId => $deliveryRows) {
135
+ $this->_flushDeliveriesForStore($storeId);
136
+ }
137
+ }
138
+ }
139
+ }
app/code/community/Bronto/Reviews/Model/Message.php CHANGED
@@ -3,9 +3,11 @@
3
  class Bronto_Reviews_Model_Message extends Bronto_Common_Model_Email_Template
4
  {
5
  protected $_helper = 'bronto_reviews';
6
-
7
  protected $_apiLogFile = 'bronto_reviews_api.log';
8
 
 
 
 
9
  /**
10
  * @see parent
11
  */
@@ -15,41 +17,93 @@ class Bronto_Reviews_Model_Message extends Bronto_Common_Model_Email_Template
15
  }
16
 
17
  /**
18
- * @see parent
 
 
 
19
  */
20
- protected function _startTime($storeId)
21
  {
22
- $helper = Mage::helper($this->_helper);
23
- $sendPeriod = $helper->getReviewSendPeriod('store', $storeId);
24
- return date('c', strtotime('+' . abs($sendPeriod) . ' days'));
25
  }
26
 
27
  /**
28
- * @see parent
 
 
 
29
  */
30
- protected function _additionalFields($delivery, $variables)
 
 
 
 
 
 
 
 
 
 
 
 
31
  {
32
- $order = $variables['order'];
33
- $storeId = $order->getStoreId();
34
- $helper = Mage::helper('bronto_common/product');
35
- $reviewHelper = Mage::helper('bronto_reviews');
36
- $urlSuffix = ltrim($reviewHelper->getProductUrlSuffix('store', $storeId), '/');
37
 
38
- $index = 1;
39
- foreach ($order->getAllItems() as $item) {
40
- if (!$item->getParentItem()) {
41
- $product = Mage::getModel('catalog/product')
42
- ->setStoreId($storeId)
43
- ->load($item->getProductId());
 
 
 
44
 
45
- $productUrl = $helper->getProductAttribute($product, 'url', $storeId) . $urlSuffix;
46
- $reviewUrl = $reviewHelper->getReviewsUrl($product, $storeId) . $urlSuffix;
 
 
 
 
 
 
 
 
 
 
47
 
48
- $delivery->setField('reviewUrl_' . $index, $reviewUrl, 'html');
49
- $delivery->setField('productUrl_' . $index, $productUrl, 'html');
50
- $index++;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
51
  }
52
  }
 
 
 
 
 
 
 
 
 
 
 
53
  }
54
 
55
  /**
@@ -57,7 +111,17 @@ class Bronto_Reviews_Model_Message extends Bronto_Common_Model_Email_Template
57
  */
58
  protected function _additionalData()
59
  {
60
- return array('order_id' => $this->getOrderId());
 
 
 
 
 
 
 
 
 
 
61
  }
62
 
63
  /**
@@ -68,12 +132,19 @@ class Bronto_Reviews_Model_Message extends Bronto_Common_Model_Email_Template
68
  $helper = Mage::helper($this->_helper);
69
  if (!is_null($delivery)) {
70
  if ($success) {
71
- $review = Mage::getModel('bronto_reviews/queue')
72
- ->load($this->getParams()->getOrderId())
73
- ->setDeliveryId($delivery->id);
74
- if (!is_null($review->getDeliveryId())) {
75
- $review->save();
76
- }
 
 
 
 
 
 
 
77
  }
78
  $status = $success ? 'Successful' : 'Failed';
79
 
3
  class Bronto_Reviews_Model_Message extends Bronto_Common_Model_Email_Template
4
  {
5
  protected $_helper = 'bronto_reviews';
 
6
  protected $_apiLogFile = 'bronto_reviews_api.log';
7
 
8
+ protected $_additionalFields = array();
9
+ protected $_additionalData = array();
10
+
11
  /**
12
  * @see parent
13
  */
17
  }
18
 
19
  /**
20
+ * Set the send period for this message
21
+ *
22
+ * @param int $sendPeriod
23
+ * @return Bronto_Reviews_Model_Message
24
  */
25
+ public function setSendTime($sendPeriod)
26
  {
27
+ return $this->addParam('sendPeriod', max($sendPeriod, 0));
 
 
28
  }
29
 
30
  /**
31
+ * Set the time of day for this message
32
+ *
33
+ * @param int $timeOfDay
34
+ * @return Bronto_Reviews_Model_Message
35
  */
36
+ public function setTimeOfDay($timeOfDay)
37
+ {
38
+ return $this->addParam('timeOfDay', $timeOfDay);
39
+ }
40
+
41
+ /**
42
+ * Sets some arbitrary param value to be serialized
43
+ *
44
+ * @param string $key
45
+ * @param mixed $value
46
+ * @return Bronto_Reviews_Model_Message
47
+ */
48
+ public function addParam($key, $value)
49
  {
50
+ $this->_additionalData[$key] = $value;
51
+ return $this;
52
+ }
 
 
53
 
54
+ /**
55
+ * Gets all of the serialized values
56
+ *
57
+ * @return array
58
+ */
59
+ public function getAdditionalData()
60
+ {
61
+ return $this->_additionalData;
62
+ }
63
 
64
+ /**
65
+ * Sets some arbitrary delivery fields to be sent
66
+ *
67
+ * @param string $key
68
+ * @param mixed $value
69
+ * @return Bronto_Reviews_Model_Message
70
+ */
71
+ public function addDeliveryField($key, $value)
72
+ {
73
+ $this->_additionalFields[$key] = $value;
74
+ return $this;
75
+ }
76
 
77
+ /**
78
+ * @see parent
79
+ */
80
+ protected function _startTime($storeId)
81
+ {
82
+ $now = time();
83
+ $sendPeriod = $this->_additionalData['sendPeriod'];
84
+ $timeOfDay = $this->_additionalData['timeOfDay'];
85
+ $currentDays = strtotime('+' . abs($sendPeriod) . ' days', $now);
86
+ if ($timeOfDay > -1) {
87
+ $currentHour = (int)date('H', $now);
88
+ // Target time is in the future: add the diff
89
+ if ($currentHour < $timeOfDay) {
90
+ $currentDays += (($timeOfDay - $currentHour) * 60 * 60);
91
+ // Target time is earlier in the day: add one day, and sub diff
92
+ } else if ($timeOfDay < $currentHour) {
93
+ $currentDays += (24 * 60 * 60) - (($currentHour - $timeOfDay) * 60 * 60);
94
  }
95
  }
96
+ return date('c', $currentDays);
97
+ }
98
+
99
+ /**
100
+ * @see parent
101
+ */
102
+ protected function _additionalFields($delivery, $variables)
103
+ {
104
+ foreach ($this->_additionalFields as $key => $value) {
105
+ $delivery->setField($key, $value, 'html');
106
+ }
107
  }
108
 
109
  /**
111
  */
112
  protected function _additionalData()
113
  {
114
+ return $this->_additionalData;
115
+ }
116
+
117
+ /**
118
+ * @see parent
119
+ */
120
+ protected function setSendQueue($queue)
121
+ {
122
+ $this->_additionalData = $queue->getAdditionalData()->getData();
123
+ $this->setData('send_queue', $queue);
124
+ return $this;
125
  }
126
 
127
  /**
132
  $helper = Mage::helper($this->_helper);
133
  if (!is_null($delivery)) {
134
  if ($success) {
135
+ $queue = $this->getSendQueue();
136
+ $orderId = $queue->getAdditionalData()->getOrderId();
137
+ $log = Mage::getModel('bronto_reviews/log')
138
+ ->loadByOrderAndDeliveryId($orderId, $queue->getId());
139
+ $logId = $log->getId();
140
+ $log->setData($queue->getAdditionalData()->getData());
141
+ $log->setId($logId)
142
+ ->setDeliveryId($delivery->id)
143
+ ->setMessageId($delivery->messageId)
144
+ ->setMessageName($this->getBrontoMessageName())
145
+ ->setFields(serialize($delivery->getFields()))
146
+ ->setDeliveryDate(date('Y-m-d H:i:s', strtotime($delivery->start)));
147
+ $log->save();
148
  }
149
  $status = $success ? 'Successful' : 'Failed';
150
 
app/code/community/Bronto/Reviews/Model/Mysql4/Log.php ADDED
@@ -0,0 +1,86 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Bronto_Reviews_Model_Mysql4_Log extends Mage_Core_Model_Mysql4_Abstract
4
+ {
5
+ /**
6
+ * @see parent
7
+ */
8
+ protected function _construct()
9
+ {
10
+ $this->_init('bronto_reviews/log', 'log_id');
11
+ }
12
+
13
+ /**
14
+ * Getst he log with an order and delivery
15
+ *
16
+ * @param Bronto_Reviews_Model_Log $object
17
+ * @param int $orderId
18
+ * @param mixed $deliveryId
19
+ * @return void
20
+ */
21
+ public function loadByOrderAndDeliveryId($object, $orderId, $deliveryId)
22
+ {
23
+ $this->_loadSelectWithNull($object, $orderId, 'delivery_id', $deliveryId);
24
+ }
25
+
26
+ /**
27
+ * Gets the log with an order id and postId
28
+ *
29
+ * @param Bronto_Reviews_Model_Log $object
30
+ * @param int $orderId
31
+ * @param mixed $postId
32
+ * @return void
33
+ */
34
+ public function loadByOrderAndPost($object, $orderId, $postId)
35
+ {
36
+ $this->_loadSelectWithNull($object, $orderId, 'post_id', $postId);
37
+ }
38
+
39
+ /**
40
+ * Clears logs that are old or cancelled
41
+ *
42
+ * @param mixed $time
43
+ */
44
+ public function clearOld($time = null)
45
+ {
46
+ $date = date('Y-m-d H:i:s', empty($time) ? time() : $time);
47
+ $write = $this->_getWriteAdapter();
48
+ $write->delete($this->getMainTable(), $write->quoteInto('delivery_date <= ?', $date));
49
+ }
50
+
51
+ /**
52
+ * Clears logs that have been cancelled
53
+ */
54
+ public function clearCancelled()
55
+ {
56
+ $write = $this->_getWriteAdapter();
57
+ $write->delete($this->getMainTable(), $write->quoteInto('cancelled = ?', 1));
58
+ }
59
+
60
+ /**
61
+ * Creates a query that builds a select for a single log and order
62
+ *
63
+ * @param Bronto_Reviews_Model_Log $object
64
+ * @param int $orderId
65
+ * @param string $fieldName
66
+ * @param mixed $fieldValue
67
+ * @return void
68
+ */
69
+ protected function _loadSelectWithNull($object, $orderId, $fieldName, $fieldValue)
70
+ {
71
+ $read = $this->_getReadAdapter();
72
+ $select = $this->_getLoadSelect('order_id', $orderId, $object);
73
+ $field = $read->quoteIdentifier(sprintf("%s.%s", $this->getMainTable(), $fieldName));
74
+ $cancelled = $read->quoteIdentifier(sprintf("%s.%s", $this->getMainTable(), 'cancelled'));
75
+ if (is_null($fieldValue)) {
76
+ $select->where("{$field} IS NULL");
77
+ } else {
78
+ $select->where("{$field} = ?", $fieldValue);
79
+ }
80
+ $select->where("{$cancelled} = ?", 0);
81
+ $data = $read->fetchRow($select);
82
+ if ($data) {
83
+ $object->setData($data);
84
+ }
85
+ }
86
+ }
app/code/community/Bronto/Reviews/Model/Mysql4/Log/Collection.php ADDED
@@ -0,0 +1,97 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Bronto_Reviews_Model_Mysql4_Log_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
4
+ {
5
+ /**
6
+ * @see parent
7
+ */
8
+ protected function _construct()
9
+ {
10
+ parent::_construct();
11
+ $this->_init('bronto_reviews/log');
12
+ }
13
+
14
+ /**
15
+ * Filters by cancelled entries
16
+ *
17
+ * @return Bronto_Reviews_Model_Mysql4_Log_Collection
18
+ */
19
+ public function filterCancelled($cancelled = true)
20
+ {
21
+ return $this->addFieldToFilter('cancelled', array('eq' => (int)$cancelled));
22
+ }
23
+
24
+ /**
25
+ * Filters the log by some time in some operation
26
+ *
27
+ * @param string $operator
28
+ * @param int $time
29
+ * @return Bronto_Reviews_Model_Mysql4_Log_Collection
30
+ */
31
+ public function filterTime($operator, $time = null)
32
+ {
33
+ $date = date('Y-m-d H:i:s', empty($time) ? time() : $time);
34
+ return $this->addFieldToFilter('delivery_date', array($operator => $date));
35
+ }
36
+
37
+ /**
38
+ * Gets all logs which are old
39
+ *
40
+ * @param int $time
41
+ * @return Bronto_Reviews_Model_Mysql4_Log_Collection
42
+ */
43
+ public function filterOld($time = null)
44
+ {
45
+ return $this->filterTime('lteq', $time);
46
+ }
47
+
48
+ /**
49
+ * Gets all logs scheduled in the future
50
+ *
51
+ * @param int $time
52
+ * @return Bronto_Reviews_Model_Mysql4_Log_Collection
53
+ */
54
+ public function filterFuture($time = null)
55
+ {
56
+ return $this->filterTime('gteq', $time);
57
+ }
58
+
59
+ /**
60
+ * Filters by a given store view
61
+ *
62
+ * @param int $storeId
63
+ * @return Bronto_Reviews_Model_Mysql4_Log_Collection
64
+ */
65
+ public function filterByStoreId($storeId)
66
+ {
67
+ return $this->addFieldToFilter('store_id', array('eq' => $storeId));
68
+ }
69
+
70
+ /**
71
+ * Filters by a given post id
72
+ *
73
+ * @param int $postId
74
+ * @return Bronto_Reviews_Model_Mysql4_Log_Collection
75
+ */
76
+ public function filterByPost($postId)
77
+ {
78
+ return $this->addFieldToFilter('post_id', array('eq' => $postId));
79
+ }
80
+
81
+ /**
82
+ * Filters logs made by a certain email
83
+ *
84
+ * @param string $email
85
+ * @param int $postId
86
+ * @return Bronto_Reviews_Model_Mysql4_Log_Collection
87
+ */
88
+ public function filterByEmail($email, $postId = null)
89
+ {
90
+ if (is_null($postId)) {
91
+ $this->addFieldToFilter('post_id', array('null' => true));
92
+ } else {
93
+ $this->addFieldToFilter('post_id', array('eq' => $postId));
94
+ }
95
+ return $this->addFieldToFilter('customer_email', array('eq' => $email));
96
+ }
97
+ }
app/code/community/Bronto/Reviews/Model/Mysql4/Post/Purchase.php ADDED
@@ -0,0 +1,36 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Bronto_Reviews_Model_Mysql4_Post_Purchase extends Mage_Core_Model_Mysql4_Abstract
4
+ {
5
+ /**
6
+ * @see parent
7
+ */
8
+ protected function _construct()
9
+ {
10
+ $this->_init('bronto_reviews/post_purchase', 'entity_id');
11
+ }
12
+
13
+ /**
14
+ * Retrieves the post purchase config from the DB
15
+ *
16
+ * @param Bronto_Reviews_Model_PostPurchase $object
17
+ * @param int $productId
18
+ * @param string $type
19
+ * @param int $storeId
20
+ * @return void
21
+ */
22
+ public function loadByProduct($object, $productId, $type, $storeId = 0)
23
+ {
24
+ $read = $this->_getReadAdapter();
25
+ $select = $this->_getLoadSelect('product_id', $productId, $object);
26
+ $fieldNameToValue = array('post_type' => $type, 'store_id' => $storeId);
27
+ foreach ($fieldNameToValue as $fieldName => $fieldValue) {
28
+ $fieldType = $read->quoteIdentifier(sprintf("%s.%s", $this->getMainTable(), $fieldName));
29
+ $select->where("{$fieldType} = ?", $fieldValue);
30
+ }
31
+ $data = $read->fetchRow($select);
32
+ if ($data) {
33
+ $object->setData($data);
34
+ }
35
+ }
36
+ }
app/code/community/Bronto/Reviews/Model/Mysql4/Post/Purchase/Collection.php ADDED
@@ -0,0 +1,67 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Bronto_Reviews_Model_Mysql4_Post_Purchase_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
4
+ {
5
+ /**
6
+ * @see parent
7
+ */
8
+ protected function _construct()
9
+ {
10
+ parent::_construct();
11
+ $this->_init('bronto_reviews/post_purchase');
12
+ }
13
+
14
+ /**
15
+ * Adds the post purchase type to the mix
16
+ *
17
+ * @param string $type
18
+ * @return Bronto_Reviews_Model_Mysql4_Post_Purchase_Collection
19
+ */
20
+ public function filterByType($type)
21
+ {
22
+ return $this->addFieldToFilter('post_type', array('eq' => $type));
23
+ }
24
+
25
+ /**
26
+ * Gets the post purchase by a specific store
27
+ *
28
+ * @param int $storeId
29
+ * @param boolean $strict search
30
+ * @return Bronto_Reviews_Model_Mysql4_Post_Purchase_Collection
31
+ */
32
+ public function filterByStoreId($storeId = 0, $strict = false)
33
+ {
34
+ if (empty($storeId) || $strict) {
35
+ $this->addFieldToFilter('store_id', array('eq' => $storeId));
36
+ } else {
37
+ $this->addFieldToFilter('store_id', array('in' => array(0, $storeId)));
38
+ $this->setOrder('store_id', 'DESC');
39
+ }
40
+ return $this;
41
+ }
42
+
43
+ /**
44
+ * Gets all post purchase related emails by products
45
+ *
46
+ * @param mixed $productId
47
+ * @return Bronto_Reviews_Model_Mysql4_Post_Purchase_Collection
48
+ */
49
+ public function filterByProduct($productId, $storeId = 0, $strict = false)
50
+ {
51
+ $productParams = is_array($productId) ?
52
+ array('in' => $productId) :
53
+ array('eq' => $productId);
54
+ return $this->addFieldToFilter('product_id', $productParams);
55
+ }
56
+
57
+ /**
58
+ * Gets all enabledpost purchase related emails
59
+ *
60
+ * @param boolean $active (Optional)
61
+ * @return Bronto_Reviews_Model_Mysql4_PostPurchase_Collection
62
+ */
63
+ public function filterByActive($active = true)
64
+ {
65
+ return $this->addFieldToFilter('active', array('eq' => (int)$active));
66
+ }
67
+ }
app/code/community/Bronto/Reviews/Model/Mysql4/Queue.php CHANGED
@@ -7,13 +7,6 @@
7
  */
8
  class Bronto_Reviews_Model_Mysql4_Queue extends Mage_Core_Model_Mysql4_Abstract
9
  {
10
- /**
11
- * Primery key auto increment flag
12
- *
13
- * @var bool
14
- */
15
- protected $_isPkAutoIncrement = false;
16
-
17
  /**
18
  * Initialize Model
19
  *
@@ -22,6 +15,42 @@ class Bronto_Reviews_Model_Mysql4_Queue extends Mage_Core_Model_Mysql4_Abstract
22
  */
23
  public function _construct()
24
  {
25
- $this->_init('bronto_reviews/queue', 'order_id');
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
26
  }
27
- }
7
  */
8
  class Bronto_Reviews_Model_Mysql4_Queue extends Mage_Core_Model_Mysql4_Abstract
9
  {
 
 
 
 
 
 
 
10
  /**
11
  * Initialize Model
12
  *
15
  */
16
  public function _construct()
17
  {
18
+ $this->_init('bronto_reviews/queue', 'entity_id');
19
+ }
20
+
21
+ /**
22
+ * Loads the delivery entry by order ID
23
+ *
24
+ * @param Bronto_Reviews_Model_Queue $object
25
+ * @param int $orderId
26
+ * @param mixed $deliveryId
27
+ */
28
+ public function loadByOrderAndDeliveryId($object, $orderId, $deliveryId = null)
29
+ {
30
+ $read = $this->_getReadAdapter();
31
+ $select = $this->_getLoadSelect('order_id', $orderId, $object);
32
+ $deliveryField = $read->quoteIdentifier(sprintf("%s.%s", $this->getMainTable(), 'delivery_id'));
33
+ if (is_null($deliveryId)) {
34
+ $select->where("{$deliveryField} IS NULL");
35
+ } else {
36
+ $select->where("{$deliveryField} = ?", $deliveryId);
37
+ }
38
+ $data = $read->fetchRow($select);
39
+ if ($data) {
40
+ $object->setData($data);
41
+ }
42
+ }
43
+
44
+ /**
45
+ * Removes old deliveries from the table
46
+ *
47
+ * @param datetime $date
48
+ */
49
+ public function flushDeliveries($date)
50
+ {
51
+ $this->_getWriteAdapter()->delete(
52
+ $this->getMainTable(),
53
+ '(' . $this->_getWriteAdapter()->quoteInto('delivery_date <= ?', $date) . ' AND delivery_date IS NOT NULL)'
54
+ );
55
  }
56
+ }
app/code/community/Bronto/Reviews/Model/Mysql4/Queue/Collection.php CHANGED
@@ -7,9 +7,23 @@
7
  */
8
  class Bronto_Reviews_Model_Mysql4_Queue_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
9
  {
 
 
 
10
  protected function _construct()
11
  {
12
  parent::_construct();
13
  $this->_init('bronto_reviews/queue');
14
  }
15
- }
 
 
 
 
 
 
 
 
 
 
 
7
  */
8
  class Bronto_Reviews_Model_Mysql4_Queue_Collection extends Mage_Core_Model_Mysql4_Collection_Abstract
9
  {
10
+ /**
11
+ * @see parent
12
+ */
13
  protected function _construct()
14
  {
15
  parent::_construct();
16
  $this->_init('bronto_reviews/queue');
17
  }
18
+
19
+ /**
20
+ * Returns all of the delivery entries for an order
21
+ *
22
+ * @param int $orderId
23
+ * @return Bronto_Reviews_Model_Mysql4_Queue_Collection
24
+ */
25
+ public function filterByOrderId($orderId)
26
+ {
27
+ return $this->addFieldToFilter('order_id', array('eq' => $orderId));
28
+ }
29
+ }
app/code/community/Bronto/Reviews/Model/Observer.php CHANGED
@@ -10,280 +10,466 @@ class Bronto_Reviews_Model_Observer
10
 
11
  // Helper
12
  protected $_helper;
13
-
14
- // Data Members
15
- protected $_contact;
16
- protected $_order;
17
- protected $_deliveryObject;
18
- protected $_deliveryRow;
19
- protected $_deliveryId;
20
 
21
  public function __construct()
22
  {
23
  /* @var Bronto_Reviews_Helper_Data $_helper */
24
  $this->_helper = Mage::helper(self::NOTICE_IDENTIFER);
 
25
  }
26
 
27
  /**
28
- * Set Contact Row Object to use
29
- *
30
- * @param Bronto_Api_Contact_Row $contact
31
  *
32
- * @return Bronto_Reviews_Model_Observer
 
33
  */
34
- public function setContact(Bronto_Api_Contact_Row $contact)
35
  {
36
- $this->_contact = $contact;
37
-
38
- return $this;
 
 
 
 
39
  }
40
 
41
  /**
42
- * Set Order to use
43
  *
44
  * @param Mage_Sales_Model_Order $order
45
- *
46
- * @return Bronto_Reviews_Model_Observer
47
  */
48
- public function setOrder(Mage_Sales_Model_Order $order)
49
  {
50
- $this->_order = $order;
 
 
 
 
 
 
 
 
 
51
 
52
- return $this;
53
- }
 
 
 
 
54
 
55
- /**
56
- * Get Order to use
57
- *
58
- * @return Mage_Sales_Model_Order
59
- */
60
- public function getOrder()
61
- {
62
- return $this->_order;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
63
  }
64
 
65
  /**
66
- * Set Delivery Object to use
67
  *
68
- * @param Bronto_Api_Delivery $deliveryObject
69
- *
70
- * @return Bronto_Reviews_Model_Observer
71
  */
72
- public function setDeliveryObject(Bronto_Api_Delivery $deliveryObject)
73
  {
74
- $this->_deliveryObject = $deliveryObject;
75
-
76
- return $this;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
77
  }
78
 
79
  /**
80
- * Get Delivery Object to use
 
81
  *
82
- * @return boolean|Bronto_Api_Delivery
 
 
83
  */
84
- public function getDeliveryObject()
85
  {
86
- if (!$this->_deliveryObject) {
87
- try {
88
- // Retrieve Store's configured API Token
89
- $token = $this->_helper->getApiToken('store', $this->getOrder()->getStoreId());
90
-
91
- /* @var Bronto_Common_Model_Api $api */
92
- $api = $this->_helper->getApi($token, 'store', $this->getOrder()->getStoreId());
93
-
94
- /* @var Bronto_Api_Delivery $deliveryObject */
95
- $this->_deliveryObject = $api->getDeliveryObject();
96
- } catch (Exception $e) {
97
- $this->_helper->writeError('Bronto Failed creating apiObject:' . $e->getMessage());
98
-
99
- return false;
100
  }
 
 
 
 
101
  }
102
-
103
- return $this->_deliveryObject;
104
  }
105
 
106
  /**
107
- * Set Delivery Row Object to use
108
- *
109
- * @param Bronto_Api_Delivery_Row $deliveryRow
110
  *
111
- * @return Bronto_Reviews_Model_Observer
 
112
  */
113
- public function setDeliveryRow(Bronto_Api_Delivery_Row $deliveryRow)
114
  {
115
- $this->_deliveryRow = $deliveryRow;
116
-
117
- return $this;
 
 
 
 
 
 
118
  }
119
 
120
  /**
121
- * Get Delivery Row if exists, create if doesn't
122
  *
 
123
  * @return boolean
124
  */
125
- public function getDeliveryRow()
126
  {
127
- if (!$this->_deliveryRow) {
128
- try {
129
- $this->_deliveryRow = $this->getDeliveryObject()->createRow(array());
130
- } catch (Exception $e) {
131
- $this->_helper->writeError('Bronto Failed creating apiObject:' . $e->getMessage());
132
-
133
- return false;
134
- }
135
  }
136
-
137
- return $this->_deliveryRow;
 
 
 
 
 
 
 
 
 
 
 
138
  }
139
 
140
  /**
141
- * Set Delivery ID
142
- *
143
- * @param string $deliveryId
144
  *
145
- * @return Bronto_Reviews_Model_Observer
 
146
  */
147
- public function setDeliveryId($deliveryId)
148
  {
149
- $this->_deliveryId = $deliveryId;
150
-
151
- return $this;
 
 
 
 
152
  }
153
 
154
  /**
155
- * Get Delivery ID
156
  *
157
- * @return string
 
 
158
  */
159
- public function getDeliveryId()
160
  {
161
- return $this->_deliveryId;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
162
  }
163
 
164
  /**
165
- * Observe saving of Order and determine if a Review Request should be sent
166
- * and then send
167
- *
168
- * @param Varien_Event_Observer $observer
169
  *
170
- * @return Varien_Event_Observer
 
171
  */
172
- public function markOrderForReview(Varien_Event_Observer $observer)
173
  {
174
- if (!$this->_helper->isEnabled('store', Mage::app()->getStore()->getId())) {
175
- return $observer;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
176
  }
177
-
178
- $this->setOrder($observer->getOrder())->process();
179
-
180
- return $observer;
181
  }
182
 
183
  /**
184
- * Process Order for Review Request
 
 
185
  */
186
- public function process()
187
  {
188
- /* @var $order Mage_Sales_Model_Order */
189
- $order = $this->getOrder();
190
-
191
- // Get Statuses
192
- $reviewStatus = $this->_helper->getReviewSendStatus('store', $order->getStoreId());
193
- $cancelStatus = $this->_helper->getReviewCancelStatus('store', $order->getStoreId());
194
-
195
- // If Original Increment ID is Null, proceed
196
- if (is_null($order->getOriginalIncrementId())) {
197
- // If current order status matches review send status, proceed
198
- if ($order->getStatus() == $reviewStatus) {
199
- $reviewQueue = Mage::getModel('bronto_reviews/queue')
200
- ->load($order->getId());
201
-
202
- // If Queue Doesn't have Delivery ID, proceed
203
- if (is_null($reviewQueue->getDeliveryId())) {
204
- $this->_makeDelivery();
205
-
206
- // If Delivery Row sent correctly, save the ID
207
- if ($this->getDeliveryId()) {
208
- $reviewQueue->setDeliveryId($this->getDeliveryId())->save();
209
- }
210
- }
211
- } elseif (in_array($order->getStatus(), $cancelStatus)) {
212
- $reviewQueue = Mage::getModel('bronto_reviews/queue')
213
- ->load($order->getId());
214
-
215
- // If Queue has Delivery ID, cancel Delivery
216
- if (!is_null($reviewQueue->getDeliveryId())) {
217
- $this->_cancelDelivery($reviewQueue->getDeliveryId());
218
- }
219
  }
220
  }
221
  }
222
 
223
  /**
224
- * Deletes the Delivery that was previously created
225
  *
226
- * @param $deliveryId
 
227
  */
228
- protected function _cancelDelivery($deliveryId)
229
  {
230
- try {
231
- $delivery = $this->getDeliveryObject();
232
- $result = $delivery->update(array('id' => $deliveryId, 'status' => 'skipped'));
233
- if ($result->hasErrors()) {
234
- $errors = array();
235
- foreach ($result->getErrors() as $soapFault) {
236
- $errors[] = $soapFault['code'] . ": " . $soapFault['message'];
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
237
  }
238
- $error = implode('<br />', $errors);
239
-
240
- Mage::throwException($error);
 
 
 
 
 
 
 
 
 
 
 
 
 
 
241
  }
242
- } catch (Exception $e) {
243
- $this->_helper->writeError('Failed Cancelling Delivery: ' . $e->getMessage());
244
  }
 
245
  }
246
 
247
  /**
248
- * Create Delivery With Order Details
 
 
 
249
  */
250
- protected function _makeDelivery()
251
  {
252
- $helper = $this->_helper;
 
 
 
 
253
  try {
254
-
255
- $order = $this->getOrder();
256
- $storeId = $order->getStoreId();
257
- $sender = array(
258
- 'name' => $helper->getReviewSenderName('store', $storeId),
259
- 'email' => $helper->getReviewSenderEmail('store', $storeId)
260
- );
261
-
262
- $message = new Bronto_Api_Message_Row();
263
- $message->id = $helper->getReviewSendMessage('store', $storeId);
264
-
265
- $helper->writeDebug(' Creating review delivery...');
266
- $message = Mage::getModel('bronto_reviews/message')
267
- ->setDesignConfig(array('area' => 'frontend', 'store' => $storeId))
268
- ->setSalesRule($helper->getDefaultRule('store', $storeId))
269
- ->setProductRecommendation($helper->getDefaultRecommendation('store', $storeId))
270
- ->setTemplateSendType('marketing')
271
- ->setOrderId($order->getId())
272
- ->sendTransactional(
273
- $message,
274
- $sender,
275
- array($order->getCustomerEmail()),
276
- array($order->getCustomerName()),
277
- array('order' => $order),
278
- $storeId
279
- );
280
- if ($message->getSentSuccess()) {
281
- $helper->writeDebug(' Successfully created delivery.');
282
- } else {
283
- $helper->writeError(' Failed to sent the message.');
284
  }
 
285
  } catch (Exception $e) {
286
- $helper->writeError('Bronto Failed creating apiObject:' . $e->getMessage());
287
  }
 
288
  }
289
  }
10
 
11
  // Helper
12
  protected $_helper;
13
+ protected $_singleton;
 
 
 
 
 
 
14
 
15
  public function __construct()
16
  {
17
  /* @var Bronto_Reviews_Helper_Data $_helper */
18
  $this->_helper = Mage::helper(self::NOTICE_IDENTIFER);
19
+ $this->_singleton = Mage::getModel('bronto_reviews/post_purchase');
20
  }
21
 
22
  /**
23
+ * Scans order for product based post purchases
 
 
24
  *
25
+ * @param Varien_Event_Observer $observer
26
+ * @return boolean
27
  */
28
+ public function processPostOrders($observer)
29
  {
30
+ if ($observer->getOrder()) {
31
+ try {
32
+ $this->_processOrder($observer->getOrder());
33
+ } catch (Exception $e) {
34
+ $this->_helper->writeError("Failed to examine order: {$e->getMessage()}");
35
+ }
36
+ }
37
  }
38
 
39
  /**
40
+ * Scans order for product based post purchases
41
  *
42
  * @param Mage_Sales_Model_Order $order
43
+ * @return boolean
 
44
  */
45
+ public function _processOrder($order)
46
  {
47
+ $processTypes = array();
48
+ $storeId = $order->getStoreId();
49
+ $productHelper = Mage::helper('bronto_common/product');
50
+ $reviewEnabled = $this->_helper->isEnabled('store', $storeId);
51
+ $urlSuffix = ltrim($this->_helper->getProductUrlSuffix('store', $storeId), '/');
52
+ foreach ($this->_singleton->getSupportedTypes() as $postType) {
53
+ if ($this->_helper->isPostEnabled($postType, 'store', $storeId)) {
54
+ $processTypes[$postType] = 1;
55
+ }
56
+ }
57
 
58
+ if (
59
+ !is_null($order->getOriginalIncrementId()) ||
60
+ (!$reviewEnabled && empty($processTypes))
61
+ ) {
62
+ return false;
63
+ }
64
 
65
+ $concurrentLimit = $this->_helper->getConcurrentLimit('store', $storeId);
66
+ $logSingleton = Mage::getModel('bronto_reviews/log');
67
+ $context = Mage::getModel('bronto_reviews/process_context')
68
+ ->setOrder($order)
69
+ ->setConcurrentLimit($concurrentLimit);
70
+ if ($concurrentLimit >= 0) {
71
+ $currentScheduled = $logSingleton
72
+ ->getCollection()
73
+ ->filterByStoreId($storeId)
74
+ ->filterCancelled(false)
75
+ ->filterFuture(time())
76
+ ->addFieldToFilter('customer_email', array('eq' => $order->getCustomerEmail()));
77
+ $context->setCurrentlyScheduled($currentScheduled->getSize());
78
+ }
79
+
80
+ $index = 1;
81
+ $timeOfDay = $this->_helper->getDesiredTimeOfDay('store', $storeId);
82
+ $reviewMessage = Mage::getModel('bronto_reviews/message');
83
+ foreach ($order->getAllItems() as $item) {
84
+ $product = $productHelper->getProduct($item->getProductId(), $storeId);
85
+ if (!empty($processTypes)) {
86
+ // Memory map, as to avoid stupid subqueries
87
+ $processed = array();
88
+ $posts = $this->_singleton->getCollection()
89
+ ->filterByProduct($product->getId())
90
+ ->filterByStoreId($storeId)
91
+ ->filterByActive();
92
+ foreach ($posts as $post) {
93
+ if (array_key_exists($post->getPostType(), $processed)) {
94
+ continue;
95
+ }
96
+ $postContext = $context->hardCopy()->setPost($post);
97
+ if (isset($processTypes[$post->getPostType()])) {
98
+ $processed[$post->getPostType()] = true;
99
+ $days = $this->_helper->getDefaultPostPeriod($post, $storeId);
100
+ if ($post->getPostType() == Bronto_Reviews_Model_Post_Purchase::TYPE_REORDER) {
101
+ $days *= ($item->getQtyOrdered() * 1);
102
+ }
103
+ $days += $this->_helper->getDefaultAdjustment($post, $storeId);
104
+ $productMessage = Mage::getModel('bronto_reviews/message')
105
+ ->addParam('product_id', $post->getProductId())
106
+ ->addParam('product_name', $product->getName())
107
+ ->addParam('post_id', $post->getId())
108
+ ->setTimeOfDay($timeOfDay)
109
+ ->setSendTime($days);
110
+ $context->incrementSchedule($this->_processMessage(
111
+ $postContext->setExtra(array(
112
+ 'post_purchase' => $post,
113
+ 'order_item' => $item
114
+ )),
115
+ $productMessage));
116
+ }
117
+ }
118
+ }
119
+ if (!$item->getParentItem()) {
120
+ $product = $productHelper->getConfigurableProduct($product);
121
+ if ($reviewEnabled) {
122
+ $productUrl = $productHelper->getProductAttribute($product, 'url', $storeId) . $urlSuffix;
123
+ $reviewUrl = $this->_helper->getReviewsUrl($product, $storeId) . $urlSuffix;
124
+ $reviewMessage->addDeliveryField("reviewUrl_{$index}", $reviewUrl);
125
+ $reviewMessage->addDeliveryField("productUrl_{$index}", $reviewUrl);
126
+ }
127
+ $index++;
128
+ }
129
+ }
130
+ if ($reviewEnabled) {
131
+ $days = $this->_helper->getPostPeriod('settings', 'store', $storeId);
132
+ $days += $this->_helper->getPostAdjustment('settings', 'store', $storeId);
133
+ $reviewMessage->setSendTime($days);
134
+ $this->_processMessage($context, $reviewMessage->setTimeOfDay($timeOfDay));
135
+ }
136
+ $logSingleton->flushCancelableDeliveries();
137
+ return true;
138
  }
139
 
140
  /**
141
+ * Filters a post purchased object
142
  *
143
+ * @param Varien_Event_Observer $observer
 
 
144
  */
145
+ public function filterPostPurchase($observer)
146
  {
147
+ $filter = $observer->getFilter();
148
+ $object = $observer->getUnknown();
149
+ if ($object instanceof Bronto_Reviews_Model_Post_Purchase) {
150
+ if ($object->getContent()) {
151
+ $filter->setField('extraContent', $object->getContent());
152
+ }
153
+ } else if ($object instanceof Mage_Sales_Model_Order_Item) {
154
+ $prefix = "postProduct";
155
+ $productHelper = Mage::helper('bronto_common/product');
156
+ $object = $object->getParentItem() ? $object->getParentItem() : $object;
157
+ $product = $productHelper->getProduct($object->getProductId(), $filter->getStoreId());
158
+ $filter->addItemToContext($object);
159
+ $filter->setField("{$prefix}Id", $object->getProductId());
160
+ $filter->setField("{$prefix}Sku", $product->getSku());
161
+ $filter->setField("{$prefix}Price", $filter->formatPrice($object->getPrice()));
162
+ $filter->setField("{$prefix}Total", $filter->formatPrice($object->getRowTotal()));
163
+ $filter->setField("{$prefix}Qty", $object->getQtyOrdered() * 1);
164
+ $filter->setField("{$prefix}Name", $product->getName());
165
+ $filter->setField("{$prefix}Description", $product->getDescription());
166
+ $filter->setField("{$prefix}Url", $product->getProductUrl());
167
+ try {
168
+ $common = Mage::helper('bronto_common');
169
+ $filter->setField("{$prefix}ImgUrl", $common->getProductImageUrl($product));
170
+ } catch (Exception $e) {
171
+ $this->_helper->writeError("Failed to pull post product img: {$e->getMessage()}");
172
+ }
173
+ }
174
  }
175
 
176
  /**
177
+ * Completes the post purchase message processing by either sending or
178
+ * cancelling a delivery.
179
  *
180
+ * @param Bronto_Reviews_Model_Process_Context $context
181
+ * @param Bronto_Reviews_Model_Message $postMessage
182
+ * @return int
183
  */
184
+ protected function _processMessage($context, $postMessage)
185
  {
186
+ if ($this->_shouldSend($context)) {
187
+ $this->_sendMessage($context, $postMessage);
188
+ return 1;
189
+ } else if ($this->_shouldCancel($context)) {
190
+ $log = Mage::getModel('bronto_reviews/log')
191
+ ->loadByOrderAndPost(
192
+ $context->getOrder()->getId(),
193
+ $context->hasPost() ? $context->getPost()->getId() : null)
194
+ ->cancel();
195
+ if ($log->isQueued()) {
196
+ $log->delete();
 
 
 
197
  }
198
+ return -1;
199
+ } else {
200
+ $this->_helper->writeDebug("Nothing to process... Skipping.");
201
+ return 0;
202
  }
 
 
203
  }
204
 
205
  /**
206
+ * If it's acceptable to send a message for this type
 
 
207
  *
208
+ * @param Bronto_Reviews_Model_Process_Context $context
209
+ * @return boolean
210
  */
211
+ protected function _shouldSend($context)
212
  {
213
+ $storeId = $context->getOrder()->getStoreId();
214
+ $postType = $context->getPostType();
215
+ $status = $context->getOrder()->getStatus();
216
+ return (
217
+ $this->_helper->isPostEnabled($postType, 'store', $storeId) &&
218
+ $this->_helper->getPostTrigger($postType, 'store', $storeId) == $status &&
219
+ $context->isSendingUnlocked() &&
220
+ $this->_passSendLimitCheck($context)
221
+ );
222
  }
223
 
224
  /**
225
+ * Makes a check for the send limit
226
  *
227
+ * @param $context
228
  * @return boolean
229
  */
230
+ protected function _passSendLimitCheck($context)
231
  {
232
+ if ($context->getPostType() != Bronto_Reviews_Model_Post_Purchase::TYPE_CARETIP) {
233
+ return true;
 
 
 
 
 
 
234
  }
235
+ $storeId = $context->getOrder()->getStoreId();
236
+ $sendLimit = $this->_helper->getDefaultSendLimit($context->getPost(), $storeId);
237
+ if (is_null($sendLimit) || $sendLimit < 0) {
238
+ return true;
239
+ }
240
+ $logs = Mage::getModel('bronto_reviews/log')
241
+ ->getCollection()
242
+ ->filterByStoreId($storeId)
243
+ ->filterCancelled(false)
244
+ ->filterByEmail(
245
+ $context->getOrder()->getCustomerEmail(),
246
+ $context->getPost()->getId());
247
+ return $logs->getSize() < $sendLimit;
248
  }
249
 
250
  /**
251
+ * If it's acceptable to cancel the delivery for this type
 
 
252
  *
253
+ * @param Bronto_Reviews_Model_Process_Context $context
254
+ * @return boolean
255
  */
256
+ protected function _shouldCancel($context)
257
  {
258
+ $storeId = $context->getOrder()->getStoreId();
259
+ $status = $context->getOrder()->getStatus();
260
+ $postType = $context->getPostType();
261
+ return (
262
+ $this->_helper->isPostEnabled($postType, 'store', $storeId) &&
263
+ in_array($status, $this->_helper->getPostCancel($postType, 'store', $storeId))
264
+ );
265
  }
266
 
267
  /**
268
+ * Sends the desired message transactionally
269
  *
270
+ * @param Bronto_Reviews_Model_Process_Context $context
271
+ * @param Bronto_Reviews_Model_Message $postMessage
272
+ * @param mixed
273
  */
274
+ protected function _sendMessage($context, $postMessage)
275
  {
276
+ $order = $context->getOrder();
277
+ $postType = $context->getPostType();
278
+ $storeId = $order->getStoreId();
279
+ $sender = $this->_helper->getPostEmailIdentity($postType, 'store', $storeId);
280
+ if ($sender == 'custom') {
281
+ $sender = array(
282
+ 'name' => $this->_helper->getPostSenderName($postType, 'store', $storeId),
283
+ 'email' => $this->_helper->getPostSenderEmail($postType, 'store', $storeId)
284
+ );
285
+ }
286
+
287
+ $message = new Bronto_Api_Message_Row();
288
+ $message->id = $this->_helper->getDefaultMessage($context->getPost(), $storeId);
289
+ $filterData = array('order' => $order) + $context->getExtra();
290
+ if ($context->hasPost()) {
291
+ unset($filterData['order']);
292
+ $filterData['orderIncrementId'] = $order->getIncrementId();
293
+ $filterData['orderCreatedAt'] = $order->getCreatedAtFormated('long');
294
+ $filterData['orderStatusLabel'] = $order->getStatusLabel();
295
+ $filterData['orderCustomerName'] = $order->getCustomerIsGuest() ?
296
+ $order->getBillingAddress()->getName() :
297
+ $order->getCustomerName();
298
+ }
299
+ $this->_cancelReorderDelivery($context);
300
+ $postMessage
301
+ ->addParam('store_id', $order->getStoreId())
302
+ ->addParam('order_id', $order->getId())
303
+ ->addParam('order_increment_id', $order->getIncrementId())
304
+ ->addParam('customer_email', $order->getCustomerEmail())
305
+ ->addParam('exclusion_list', $postType)
306
+ ->addParam('post_name', $this->_helper->getPostLabel($postType))
307
+ ->setDesignConfig(array('area' => 'frontend', 'store' => $storeId))
308
+ ->setSalesRule($this->_helper->getPostRule($postType, 'store', $storeId))
309
+ ->setProductRecommendation($this->_helper->getPostRecommendation($postType, 'store', $storeId))
310
+ ->setTemplateSendType('triggered')
311
+ ->setSendFlags($this->_helper->getPostSendFlags($postType, 'store', $storeId))
312
+ ->sendTransactional(
313
+ $message,
314
+ $sender,
315
+ array($order->getCustomerEmail()),
316
+ array($order->getCustomerName()),
317
+ $filterData,
318
+ $storeId
319
+ );
320
+ if ($postMessage->getSentSuccess()) {
321
+ $this->_helper->writeDebug(' Successfully created delivery.');
322
+ } else {
323
+ $this->_helper->writeDebug(' Failed to send the message.');
324
+ }
325
  }
326
 
327
  /**
328
+ * Updates a reorder with a new date
 
 
 
329
  *
330
+ * @param $context
331
+ * @return boolean
332
  */
333
+ protected function _cancelReorderDelivery($context)
334
  {
335
+ if ($context->getPostType() == Bronto_Reviews_Model_Post_Purchase::TYPE_REORDER) {
336
+ $logs = Mage::getModel('bronto_reviews/log')
337
+ ->getCollection()
338
+ ->filterByStoreId($context->getOrder()->getStoreId())
339
+ ->filterCancelled(false)
340
+ ->filterFuture(time())
341
+ ->filterByEmail(
342
+ $context->getOrder()->getCustomerEmail(),
343
+ $context->getPost()->getId());
344
+ if ($logs->count()) {
345
+ foreach ($logs as $log) {
346
+ $log->cancel();
347
+ $context->getParent()->incrementSchedule(-1);
348
+ }
349
+ return true;
350
+ }
351
  }
352
+ return false;
 
 
 
353
  }
354
 
355
  /**
356
+ * Creates a log entry based on the API queue entry
357
+ *
358
+ * @param Varien_Event_Observer $observer
359
  */
360
+ public function afterQueueSave($observer)
361
  {
362
+ $queue = $observer->getObject();
363
+ if ($queue->getEmailClass() == 'bronto_reviews/message') {
364
+ $unData = $queue->getUnserializedEmailData();
365
+ try {
366
+ $log = Mage::getModel('bronto_reviews/log')
367
+ ->loadByOrderAndDeliveryId(
368
+ $unData['params']['order_id'],
369
+ $queue->getId());
370
+ $logId = $log->getId();
371
+ $log->setData($unData['params']);
372
+ $log->setId($logId)
373
+ ->setMessageId($unData['delivery']['messageId'])
374
+ ->setDeliveryId($queue->getId())
375
+ ->setDeliveryDate(Mage::getModel('core/date')->gmtDate())
376
+ ->setFields(serialize($unData['delivery']['fields']));
377
+ $log->save();
378
+ } catch (Exception $e) {
379
+ $this->_helper->writeError("Failed to save log entry for queue save: {$e->getMessage()}");
 
 
 
 
 
 
 
 
 
 
 
 
 
380
  }
381
  }
382
  }
383
 
384
  /**
385
+ * Saves the form data added to the product catalog
386
  *
387
+ * @param Varien_Event_Observer $observer
388
+ * @return boolean
389
  */
390
+ public function productPrepareSave($observer)
391
  {
392
+ $request = $observer->getRequest();
393
+ $product = $observer->getProduct();
394
+ if (!$product->getId()) {
395
+ return false;
396
+ }
397
+ $storeId = $request->getParam('store', 0);
398
+ $formData = array(
399
+ 'active',
400
+ 'period',
401
+ 'content',
402
+ 'message',
403
+ 'period_type',
404
+ 'send_limit'
405
+ );
406
+ foreach ($this->_singleton->getSupportedTypes() as $type) {
407
+ if (!$this->_helper->isPostEnabled($type)) {
408
+ continue;
409
+ }
410
+ try {
411
+ $post = Mage::getModel('bronto_reviews/post_purchase')
412
+ ->loadByProduct($product->getId(), $type, $storeId);
413
+ // Is set and true, delete if applicable
414
+ if ($request->getParam("{$type}_use_default", false)) {
415
+ if ($post->getId()) {
416
+ $post->delete();
417
+ }
418
+ continue;
419
  }
420
+ foreach ($formData as $field) {
421
+ $requestKey = "{$type}_{$field}";
422
+ $requestOverride = "{$type}_{$field}_override";
423
+ if ($request->has($requestKey)) {
424
+ $post->setData($field, $request->getParam($requestKey));
425
+ }
426
+ if ($request->getParam($requestOverride) == 'default') {
427
+ $post->setData($field, null);
428
+ }
429
+ }
430
+ // This means the form wasn't loaded
431
+ if (is_null($post->getActive())) {
432
+ continue;
433
+ }
434
+ $post->save();
435
+ } catch (Exception $e) {
436
+ $this->_helper->writeError("Failed to save post-purchase info: {$e->getMessage()}");
437
  }
 
 
438
  }
439
+ return true;
440
  }
441
 
442
  /**
443
+ * Deletes the post purchase information if the product is removed
444
+ *
445
+ * @param Varien_Event_Observer $observer
446
+ * @return boolean
447
  */
448
+ public function deletePostPurchaseInfo($observer)
449
  {
450
+ $product = $observer->getProduct();
451
+ if (empty($product) || ($product && !$product->getId())) {
452
+ return false;
453
+ }
454
+ $productId = $product->getId();
455
  try {
456
+ $logSingleton = Mage::getModel('bronto_reviews/log');
457
+ $posts = $this->_singleton->getCollection()->filterByProduct($productId);
458
+ foreach ($posts as $post) {
459
+ $logs = $logSingleton
460
+ ->getCollection()
461
+ ->filterFuture(time())
462
+ ->filterCancelled(false)
463
+ ->filterByPost($post->getId());
464
+ foreach ($logs as $log) {
465
+ $log->cancel();
466
+ }
467
+ $post->delete();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
468
  }
469
+ $logSingleton->flushCancelableDeliveries();
470
  } catch (Exception $e) {
471
+ $this->_helper->writeError("Failed to handle a product delete: {$e->getMessage()}");
472
  }
473
+ return true;
474
  }
475
  }
app/code/community/Bronto/Reviews/Model/Post/Purchase.php ADDED
@@ -0,0 +1,53 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Bronto_Reviews_Model_Post_Purchase extends Mage_Core_Model_Abstract
4
+ {
5
+ const PERIOD_DAILY = 'daily';
6
+ const PERIOD_WEEKLY = 'weekly';
7
+ const PERIOS_MONTHLY = 'monthly';
8
+
9
+ const TYPE_CARETIP = 'caretip';
10
+ const TYPE_REORDER = 'reorder';
11
+
12
+ private static $_supportedTypes = array(
13
+ self::TYPE_REORDER,
14
+ self::TYPE_CARETIP
15
+ );
16
+
17
+ /**
18
+ * @see parent
19
+ */
20
+ protected function _construct()
21
+ {
22
+ parent::_construct();
23
+ $this->_init('bronto_reviews/post_purchase');
24
+ }
25
+
26
+ /**
27
+ * Loads a single reorder config by ID and type
28
+ *
29
+ * @param int $productId
30
+ * @param string $type
31
+ * @param int $storeId
32
+ * @return Bronto_Reviews_Model_PostPurchase
33
+ */
34
+ public function loadByProduct($productId, $type, $storeId = 0)
35
+ {
36
+ $this
37
+ ->setProductId($productId)
38
+ ->setPostType($type)
39
+ ->setStoreId($storeId);
40
+ $this->getResource()->loadByProduct($this, $productId, $type, $storeId);
41
+ return $this;
42
+ }
43
+
44
+ /**
45
+ * Returns the supported types
46
+ *
47
+ * @return array
48
+ */
49
+ public function getSupportedTypes()
50
+ {
51
+ return self::$_supportedTypes;
52
+ }
53
+ }
app/code/community/Bronto/Reviews/Model/Process/Context.php ADDED
@@ -0,0 +1,70 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Bronto_Reviews_Model_Process_Context extends Varien_Object
4
+ {
5
+ /**
6
+ * Copies the contents of this context into a new context
7
+ *
8
+ * @return Bronto_Reviews_Model_Process_Context
9
+ */
10
+ public function hardCopy()
11
+ {
12
+ return Mage::getModel('bronto_reviews/process_context', $this->getData() + array(
13
+ 'parent' => $this
14
+ ));
15
+ }
16
+
17
+ /**
18
+ * Is the sending pipeline unlocked for this context
19
+ *
20
+ * @return boolean
21
+ */
22
+ public function isSendingUnlocked()
23
+ {
24
+ if (!$this->hasConcurrentLimit() || $this->getConcurrentLimit() < 0) {
25
+ return true;
26
+ }
27
+ return $this->getCurrentlyScheduled() < $this->getConcurrentLimit();
28
+ }
29
+
30
+ /**
31
+ * Gets a child post type or review request setting
32
+ *
33
+ * @return string
34
+ */
35
+ public function getPostType()
36
+ {
37
+ if ($this->hasPost()) {
38
+ return $this->getPost()->getPostType();
39
+ }
40
+ return 'settings';
41
+ }
42
+
43
+ /**
44
+ * Modifies currentScheduled number for future reference
45
+ *
46
+ * @param int $amount
47
+ * @return Bronto_Reviews_Model_Process_Context
48
+ */
49
+ public function incrementSchedule($amount = 1)
50
+ {
51
+ if ($this->hasCurrentlyScheduled()) {
52
+ $this->setCurrentlyScheduled($this->getCurrentlyScheduled() + $amount);
53
+ } else {
54
+ $this->setCurrentlyScheduled($amount);
55
+ }
56
+ return $this;
57
+ }
58
+
59
+ /**
60
+ * Always return an array
61
+ * @return array
62
+ */
63
+ public function getExtra()
64
+ {
65
+ if ($this->hasExtra()) {
66
+ return $this->getData('extra');
67
+ }
68
+ return array();
69
+ }
70
+ }
app/code/community/Bronto/Reviews/Model/Queue.php CHANGED
@@ -7,19 +7,40 @@
7
  */
8
  class Bronto_Reviews_Model_Queue extends Mage_Core_Model_Abstract
9
  {
10
- public function _construct()
 
 
 
11
  {
12
  parent::_construct();
13
  $this->_init('bronto_reviews/queue');
14
  }
15
 
16
- public function load($id, $column = null)
 
 
 
 
 
 
 
17
  {
18
- parent::load($id, 'order_id');
19
- if (!$this->getId()) {
20
- $this->setId($id);
21
- }
22
-
23
  return $this;
24
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
25
  }
7
  */
8
  class Bronto_Reviews_Model_Queue extends Mage_Core_Model_Abstract
9
  {
10
+ /**
11
+ * @see parent
12
+ */
13
+ protected function _construct()
14
  {
15
  parent::_construct();
16
  $this->_init('bronto_reviews/queue');
17
  }
18
 
19
+ /**
20
+ * Loads the delivery entry by order and delivery ID
21
+ *
22
+ * @param int $orderId
23
+ * @param mixed $deliveryId
24
+ * @return Bronto_Reviews_Model_Queue
25
+ */
26
+ public function loadByOrderAndDeliveryId($orderId, $deliveryId = null)
27
  {
28
+ $this->setOrderId($orderId);
29
+ $this->setDeliveryId($deliveryId);
30
+ $this->_getResource()->loadByOrderAndDeliveryId($this, $orderId, $deliveryId);
 
 
31
  return $this;
32
  }
33
+
34
+ /**
35
+ * Removes old deliveries from the table
36
+ *
37
+ * @param datetime $date
38
+ */
39
+ public function flushDeliveries($date = null)
40
+ {
41
+ if (is_null($date)) {
42
+ $date = date('Y-m-d H:i:s');
43
+ }
44
+ $this->_getResource()->flushDeliveries($date);
45
+ }
46
  }
app/code/community/Bronto/Reviews/Model/Resource/Setup.php ADDED
@@ -0,0 +1,95 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Bronto_Reviews_Model_Resource_Setup extends Bronto_Common_Model_Resource_Abstract
4
+ {
5
+ /**
6
+ * @see parent
7
+ */
8
+ protected function _module()
9
+ {
10
+ return 'bronto_reviews';
11
+ }
12
+
13
+ /**
14
+ * @see parent
15
+ */
16
+ protected function _tables()
17
+ {
18
+ return array(
19
+ 'log' => "
20
+ CREATE TABLE `{table}` (
21
+ `log_id` int(10) unsigned NOT NULL AUTO_INCREMENT,
22
+ `order_id` int(10) unsigned NOT NULL,
23
+ `order_increment_id` varchar(255) NOT NULL,
24
+ `post_id` int(10) unsigned DEFAULT NULL,
25
+ `post_name` varchar(50) NOT NULL,
26
+ `product_id` int(10) unsigned DEFAULT NULL,
27
+ `product_name` varchar(255) DEFAULT NULL,
28
+ `store_id` int(10) unsigned NOT NULL,
29
+ `delivery_id` varchar(36) DEFAULT NULL,
30
+ `customer_email` varchar(255) NOT NULL,
31
+ `message_id` varchar(36) DEFAULT NULL,
32
+ `message_name` varchar(64) DEFAULT NULL,
33
+ `delivery_date` datetime DEFAULT NULL,
34
+ `cancelled` smallint(1) DEFAULT '0',
35
+ `fields` text DEFAULT NULL,
36
+ PRIMARY KEY (`log_id`),
37
+ KEY `IDX_BRONTO_POSTPURCHASE_STORECANEMAIL` (`store_id`, `customer_email`, `cancelled`),
38
+ KEY `IDX_BRONTO_POSTPURCHASE_ORDERDELIVERY` (`order_id`, `delivery_id`),
39
+ KEY `IDX_BRONTO_POSTPURCHASE_POSTCAN` (`post_id`, `cancelled`),
40
+ KEY `IDX_BRONTO_POSTPURCHASE_ORDERPOST` (`order_id`, `post_id`),
41
+ KEY `IDX_BRONTO_POSTPURCHASE_STOREID` (`store_id`),
42
+ KEY `IDX_BRONTO_POSTPURCHASE_CANCELED` (`cancelled`),
43
+ KEY `IDX_BRONTO_POSTPURCHASE_EMAIL` (`customer_email`),
44
+ KEY `IDX_BRONTO_POSTPURCHASE_DATE` (`delivery_date`)
45
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8",
46
+ 'post_purchase' => "
47
+ CREATE TABLE `{table}` (
48
+ `entity_id` int(10) unsigned NOT NULL AUTO_INCREMENT COMMENT 'Re-Order ID',
49
+ `active` smallint(1) unsigned NOT NULL DEFAULT '0',
50
+ `product_id` int(10) unsigned NOT NULL COMMENT 'Magento Product ID',
51
+ `post_type` varchar(30) NOT NULL DEFAULT 'reorder' COMMENT 'The type of reorder',
52
+ `store_id` int(10) unsigned NOT NULL DEFAULT '0',
53
+ `message` varchar(36) DEFAULT NULL,
54
+ `send_limit` int(2) DEFAULT NULL,
55
+ `adjustment` int(10) DEFAULT NULL,
56
+ `content` text DEFAULT '',
57
+ `period` int(10) unsigned DEFAULT NULL COMMENT 'Number of time periods',
58
+ `period_type` varchar(20) DEFAULT 'daily' COMMENT 'The type of periods',
59
+ PRIMARY KEY (`entity_id`),
60
+ KEY `IDX_BRONTO_MAGENTO_ALLPRODUCTS` (`product_id`),
61
+ KEY `IDX_BRONTO_MAGENTO_ACTIVEPRODUCTS` (`product_id`, `store_id`, `active`),
62
+ KEY `IDX_BRONTO_MAGENTO_SCOPEDPRODUCTS` (`product_id`, `store_id`, `post_type`)
63
+ ) ENGINE=InnoDB DEFAULT CHARSET=utf8 COMMENT='Bronto Product Reorder Info'
64
+ ");
65
+ }
66
+
67
+ /**
68
+ * @see parent
69
+ */
70
+ protected function _updates()
71
+ {
72
+ return array();
73
+ }
74
+
75
+ /**
76
+ * Sets the the email sender the cutom email
77
+ */
78
+ public function setCustomEmail()
79
+ {
80
+ $path = Bronto_Reviews_Helper_Data::XML_PATH_SENDER_EMAIL;
81
+ $configData = Mage::getModel('core/config_data')
82
+ ->getCollection()
83
+ ->addFieldToFilter('path', array('eq' => $path));
84
+ foreach ($configData as $config) {
85
+ if (!is_null($config->getValue())) {
86
+ Mage::getModel('core/config_data')
87
+ ->setPath(Bronto_Reviews_Helper_Data::XML_PATH_EMAIL_IDENTITY)
88
+ ->setScope($config->getScope())
89
+ ->setScopeId($config->getScopeId())
90
+ ->setValue('custom')
91
+ ->save();
92
+ }
93
+ }
94
+ }
95
+ }
app/code/community/Bronto/Reviews/Model/System/Config/Source/Hours.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Bronto_Reviews_Model_System_Config_Source_Hours
4
+ {
5
+ private static $_options = array();
6
+
7
+ /**
8
+ * Gets the list of hours and labels
9
+ *
10
+ * @return array
11
+ */
12
+ public function toOptionArray()
13
+ {
14
+ if (empty(self::$_options)) {
15
+ foreach (range(0, 23) as $hour) {
16
+ $meridan = 'AM';
17
+ $number = $hour;
18
+ if ($hour == 0) {
19
+ $number = 12;
20
+ } else if ($hour > 12) {
21
+ $number = $hour - 12;
22
+ $meridan = 'PM';
23
+ } else if ($hour == 12) {
24
+ $meridan = 'PM';
25
+ }
26
+ self::$_options[] = array(
27
+ 'label' => $number . $meridan,
28
+ 'value' => $hour
29
+ );
30
+ }
31
+ array_unshift(self::$_options, array(
32
+ 'label' => Mage::helper('bronto_reviews')->__('-- No Adjustment --'),
33
+ 'value' => -1
34
+ ));
35
+ }
36
+ return self::$_options;
37
+ }
38
+ }
app/code/community/Bronto/Reviews/Model/System/Config/Source/Identity.php ADDED
@@ -0,0 +1,25 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Bronto_Reviews_Model_System_Config_Source_Identity
4
+ {
5
+ protected $_options;
6
+
7
+ /**
8
+ * Options for the Bronto Review email selector
9
+ *
10
+ * @return array
11
+ */
12
+ public function toOptionArray()
13
+ {
14
+ if (!empty($this->_options)) {
15
+ return $this->_options;
16
+ }
17
+ $ident = Mage::getModel('adminhtml/system_config_source_email_identity')->toOptionArray();
18
+ array_unshift($ident, array(
19
+ 'value' => 'custom',
20
+ 'label' => Mage::helper('bronto_reviews')->__('-- Configure Email --')
21
+ ));
22
+ $this->_options = $ident;
23
+ return $this->_options;
24
+ }
25
+ }
app/code/community/Bronto/Reviews/Model/System/Config/Source/Orderstatus.php CHANGED
@@ -12,22 +12,12 @@ class Bronto_Reviews_Model_System_Config_Source_Orderstatus
12
  public function toOptionArray()
13
  {
14
  $statArray = array();
15
- if (Mage::helper('bronto_common')->isVersionMatch(Mage::getVersionInfo(), 1, array(array('edition' => 'Enterprise', 'major' => 9)))) {
16
- $status = Mage::getModel('sales/order_config')->getStatuses();
17
- foreach ($status as $value => $label) {
18
- $statArray[] = array(
19
- 'value' => $value,
20
- 'label' => $label
21
- );
22
- }
23
- } else {
24
- $status = Mage::getModel('sales/order_status')->getCollection();
25
- foreach ($status as $stat) {
26
- $statArray[] = array(
27
- 'value' => $stat->getStatus(),
28
- 'label' => $stat->getLabel()
29
- );
30
- }
31
  }
32
  return $statArray;
33
 
12
  public function toOptionArray()
13
  {
14
  $statArray = array();
15
+ $status = Mage::getModel('sales/order_config')->getStatuses();
16
+ foreach ($status as $value => $label) {
17
+ $statArray[] = array(
18
+ 'value' => $value,
19
+ 'label' => $label
20
+ );
 
 
 
 
 
 
 
 
 
 
21
  }
22
  return $statArray;
23
 
app/code/community/Bronto/Reviews/controllers/Adminhtml/PostpurchaseController.php ADDED
@@ -0,0 +1,158 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ class Bronto_Reviews_Adminhtml_PostpurchaseController extends Mage_Adminhtml_Controller_Action
4
+ {
5
+ protected $_header = 'Post Purchase';
6
+ protected $_module = 'bronto_reviews';
7
+
8
+ /**
9
+ * Gets the block for the grid for certain things
10
+ *
11
+ * @return Mage_Adminhtml_Block_Abstract
12
+ */
13
+ public function getBlock($key)
14
+ {
15
+ return $this->getLayout()
16
+ ->createBlock("{$this->_module}/adminhtml_reviews_{$key}", $key);
17
+ }
18
+
19
+ /**
20
+ * Grid for all of the deliveries for post purchase products
21
+ */
22
+ public function deliveriesAction()
23
+ {
24
+ $this->_title($this->__('Bronto Deliveries'))->_title($this->__('Logs'));
25
+ $this->loadLayout()->_setActiveMenu('system/email');
26
+ $this->_addContent($this->getBlock("delivery"))->renderLayout();
27
+ return $this;
28
+ }
29
+
30
+ /**
31
+ * Ajax call for grid on order tab
32
+ */
33
+ public function orderAction()
34
+ {
35
+ $orderId = intval($this->getRequest()->getParam('order_id'));
36
+ $order = Mage::getModel('sales/order')->load($orderId);
37
+ Mage::register('current_order', $order);
38
+ $this->getResponse()->setBody(
39
+ $this
40
+ ->getLayout()
41
+ ->createBlock('bronto_reviews/adminhtml_sales_order_view_tab_post_purchase')
42
+ ->toHtml()
43
+ );
44
+ }
45
+
46
+ /**
47
+ * Clear cancelled or old deliveries
48
+ */
49
+ public function clearAction()
50
+ {
51
+ $type = $this->getRequest()->getParam('type', 'old');
52
+ $logSingleton = Mage::getModel('bronto_reviews/log');
53
+ $session = Mage::getSingleton('adminhtml/session');
54
+ try {
55
+ if ($type == 'old') {
56
+ $now = time();
57
+ $count = $logSingleton->getCollection()->filterOld($now)->getSize();
58
+ $logSingleton->getResource()->clearOld($now);
59
+ } else {
60
+ $count = $logSingleton->getCollection()->filterCancelled()->getSize();
61
+ $logSingleton->getResource()->clearCancelled();
62
+ }
63
+ $session->addSuccess($this->__('Cleared %d %s post-purchase delivery logs.', $count, $type));
64
+ } catch (Exception $e) {
65
+ $session->addError($this->__('Failed to clear logs: %s', $e->getMessage()));
66
+ }
67
+ $this->_redirect('*/*/deliveries');
68
+ }
69
+
70
+ /**
71
+ * Gets the post purchase form for the post purchase type
72
+ */
73
+ public function formAction()
74
+ {
75
+ $postType = $this->getRequest()->getParam('type', Bronto_Reviews_Model_Post_Purchase::TYPE_REORDER);
76
+ $productId = $this->getRequest()->getParam('product_id', 0);
77
+ Mage::register('product', Mage::getModel('catalog/product')->load($productId));
78
+ $this->getResponse()->setBody($this->getBlock("form_{$postType}")->toHtml());
79
+ }
80
+
81
+ /**
82
+ * Cancels the delivery from being sent
83
+ */
84
+ public function cancelAction()
85
+ {
86
+ $logIds = $this->getRequest()->getParam('id', array());
87
+ $cancelled = 0;
88
+ if (is_numeric($logIds)) {
89
+ $logIds = array($logIds);
90
+ }
91
+
92
+ $session = Mage::getSingleton('adminhtml/session');
93
+ if (count($logIds) > 0) {
94
+ foreach ($logIds as $logId) {
95
+ $log = Mage::getModel('bronto_reviews/log')->load($logId);
96
+ if ($log->hasLogId()) {
97
+ try {
98
+ $log->cancel();
99
+ $cancelled++;
100
+ } catch (Exception $e) {
101
+ $session->addError($e->getMessage());
102
+ }
103
+ }
104
+ }
105
+ Mage::getModel('bronto_reviews/log')->flushCancelableDeliveries();
106
+ $session->addSuccess($this->__('Total of %d post-purchase email(s) have been successfully cancelled.', $cancelled));
107
+ } else {
108
+ $session->addError($this->__('Please select post-purchase email(s).'));
109
+ }
110
+ $this->_redirectToReferrer('*/*/deliveries');
111
+ }
112
+
113
+ /**
114
+ * Purges any deliveries
115
+ */
116
+ public function deleteAction()
117
+ {
118
+ $logIds = $this->getRequest()->getParam('id', array());
119
+ $deleted = 0;
120
+ if (is_numeric($logIds)) {
121
+ $logIds = array($logIds);
122
+ }
123
+
124
+ $session = Mage::getSingleton('adminhtml/session');
125
+ if (count($logIds) > 0) {
126
+ foreach ($logIds as $logId) {
127
+ $log = Mage::getModel('bronto_reviews/log')->load($logId);
128
+ if ($log->hasLogId()) {
129
+ try {
130
+ $log->cancel()->delete();
131
+ $deleted++;
132
+ } catch (Exception $e) {
133
+ $session->addError($e->getMessage());
134
+ }
135
+ }
136
+ }
137
+ Mage::getModel('bronto_reviews/log')->flushCancelableDeliveries();
138
+ $session->addSuccess($this->__('Total of %d post-purchase email(s) have been purged.', $deleted));
139
+ } else {
140
+ $session->addError($this->__('Please select post purchase email(s).'));
141
+ }
142
+ $this->_redirectToReferrer('*/*/deliveries');
143
+ }
144
+
145
+ /**
146
+ * Returns to the referrer or a default URL
147
+ *
148
+ * @param string $defaultUrl
149
+ */
150
+ protected function _redirectToReferrer($defaultUrl)
151
+ {
152
+ $refererUrl = $this->getRequest()->getServer('HTTP_REFERER');
153
+ if (!empty($refererUrl)) {
154
+ return $this->getResponse()->setRedirect($refererUrl);
155
+ }
156
+ return $this->_redirect($defaultUrl);
157
+ }
158
+ }
app/code/community/Bronto/Reviews/etc/adminhtml.xml CHANGED
@@ -6,10 +6,14 @@
6
  <children>
7
  <system>
8
  <children>
 
 
 
 
9
  <config>
10
  <children>
11
  <bronto_reviews module="bronto_reviews">
12
- <title>Bronto Review Request Section</title>
13
  <sort_order>9999</sort_order>
14
  </bronto_reviews>
15
  </children>
@@ -20,4 +24,18 @@
20
  </admin>
21
  </resources>
22
  </acl>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
23
  </config>
6
  <children>
7
  <system>
8
  <children>
9
+ <bronto_reviews translate="title" module="bronto_reviews">
10
+ <title>Post-Purchase Deliveries</title>
11
+ <sort_order>60</sort_order>
12
+ </bronto_reviews>
13
  <config>
14
  <children>
15
  <bronto_reviews module="bronto_reviews">
16
+ <title>Bronto Post-Purchase Emails Section</title>
17
  <sort_order>9999</sort_order>
18
  </bronto_reviews>
19
  </children>
24
  </admin>
25
  </resources>
26
  </acl>
27
+ <menu>
28
+ <system>
29
+ <children>
30
+ <bronto_reviews translate="title" module="bronto_reviews">
31
+ <title>Post-Purchase Deliveries</title>
32
+ <action>adminhtml/postpurchase/deliveries</action>
33
+ <sort_order>60</sort_order>
34
+ <depends>
35
+ <module>Bronto_Reviews</module>
36
+ </depends>
37
+ </bronto_reviews>
38
+ </children>
39
+ </system>
40
+ </menu>
41
  </config>
app/code/community/Bronto/Reviews/etc/config.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <modules>
4
  <Bronto_Reviews>
5
- <version>0.0.1</version>
6
  </Bronto_Reviews>
7
  </modules>
8
  <global>
@@ -27,6 +27,12 @@
27
  <queue>
28
  <table>bronto_reviews_queue</table>
29
  </queue>
 
 
 
 
 
 
30
  </entities>
31
  </bronto_reviews_mysql4>
32
  </models>
@@ -34,6 +40,7 @@
34
  <bronto_reviews_setup>
35
  <setup>
36
  <module>Bronto_Reviews</module>
 
37
  </setup>
38
  <connection>
39
  <use>core_setup</use>
@@ -56,28 +63,111 @@
56
  <bronto_reviews_sales_order_save_after>
57
  <type>singleton</type>
58
  <class>bronto_reviews/observer</class>
59
- <method>markOrderForReview</method>
60
  </bronto_reviews_sales_order_save_after>
61
  </observers>
62
  </sales_order_save_after>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
63
  </events>
 
 
 
64
  </global>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
65
  <default>
66
  <bronto_reviews>
 
 
 
 
67
  <settings>
68
  <enabled>0</enabled>
69
  <status>complete</status>
70
  <cancel_status>closed</cancel_status>
71
  <url_suffix>#review-form</url_suffix>
72
  <period>14</period>
 
73
  <message></message>
 
74
  <sender_email></sender_email>
75
  <sender_name></sender_name>
76
  <reply_to></reply_to>
77
  </settings>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
78
  </bronto_reviews>
79
  </default>
80
-
81
  <phpunit>
82
  <suite>
83
  <modules>
@@ -85,4 +175,4 @@
85
  </modules>
86
  </suite>
87
  </phpunit>
88
- </config>
2
  <config>
3
  <modules>
4
  <Bronto_Reviews>
5
+ <version>0.0.2</version>
6
  </Bronto_Reviews>
7
  </modules>
8
  <global>
27
  <queue>
28
  <table>bronto_reviews_queue</table>
29
  </queue>
30
+ <post_purchase>
31
+ <table>bronto_reviews_post_purchase</table>
32
+ </post_purchase>
33
+ <log>
34
+ <table>bronto_reviews_log</table>
35
+ </log>
36
  </entities>
37
  </bronto_reviews_mysql4>
38
  </models>
40
  <bronto_reviews_setup>
41
  <setup>
42
  <module>Bronto_Reviews</module>
43
+ <class>Bronto_Reviews_Model_Resource_Setup</class>
44
  </setup>
45
  <connection>
46
  <use>core_setup</use>
63
  <bronto_reviews_sales_order_save_after>
64
  <type>singleton</type>
65
  <class>bronto_reviews/observer</class>
66
+ <method>processPostOrders</method>
67
  </bronto_reviews_sales_order_save_after>
68
  </observers>
69
  </sales_order_save_after>
70
+ <catalog_product_delete_before>
71
+ <observers>
72
+ <bronto_reviews_catalog_product_delete_after>
73
+ <type>singleton</type>
74
+ <class>bronto_reviews/observer</class>
75
+ <method>deletePostPurchaseInfo</method>
76
+ </bronto_reviews_catalog_product_delete_after>
77
+ </observers>
78
+ </catalog_product_delete_before>
79
+ <bronto_common_email_filter_unknown>
80
+ <observers>
81
+ <bronto_reviews_post_product_tags>
82
+ <type>singleton</type>
83
+ <class>bronto_reviews/observer</class>
84
+ <method>filterPostPurchase</method>
85
+ </bronto_reviews_post_product_tags>
86
+ </observers>
87
+ </bronto_common_email_filter_unknown>
88
+ <bronto_common_queue_save_after>
89
+ <observers>
90
+ <bronto_reviews_log_creation>
91
+ <type>singleton</type>
92
+ <class>bronto_reviews/observer</class>
93
+ <method>afterQueueSave</method>
94
+ </bronto_reviews_log_creation>
95
+ </observers>
96
+ </bronto_common_queue_save_after>
97
  </events>
98
+ <blocks>
99
+ <bronto_reviews>Bronto_Reviews_Block</bronto_reviews>
100
+ </blocks>
101
  </global>
102
+ <admin>
103
+ <routers>
104
+ <adminhtml>
105
+ <args>
106
+ <modules>
107
+ <bronto_reviews before="Mage_Adminhtml">Bronto_Reviews_Adminhtml</bronto_reviews>
108
+ </modules>
109
+ </args>
110
+ </adminhtml>
111
+ </routers>
112
+ </admin>
113
+ <adminhtml>
114
+ <layout>
115
+ <updates>
116
+ <bronto_reviews>
117
+ <file>bronto/reviews.xml</file>
118
+ </bronto_reviews>
119
+ </updates>
120
+ </layout>
121
+ <events>
122
+ <catalog_product_prepare_save>
123
+ <observers>
124
+ <bronto_post_purchase_save>
125
+ <type>singleton</type>
126
+ <class>bronto_reviews/observer</class>
127
+ <method>productPrepareSave</method>
128
+ </bronto_post_purchase_save>
129
+ </observers>
130
+ </catalog_product_prepare_save>
131
+ </events>
132
+ </adminhtml>
133
  <default>
134
  <bronto_reviews>
135
+ <general>
136
+ <time_of_day>-1</time_of_day>
137
+ <conncurrent_limit>-1</conncurrent_limit>
138
+ </general>
139
  <settings>
140
  <enabled>0</enabled>
141
  <status>complete</status>
142
  <cancel_status>closed</cancel_status>
143
  <url_suffix>#review-form</url_suffix>
144
  <period>14</period>
145
+ <adjustment>0</adjustment>
146
  <message></message>
147
+ <identity>general</identity>
148
  <sender_email></sender_email>
149
  <sender_name></sender_name>
150
  <reply_to></reply_to>
151
  </settings>
152
+ <reorder>
153
+ <enabled>0</enabled>
154
+ <status>complete</status>
155
+ <cancel_status>closed</cancel_status>
156
+ <period>30</period>
157
+ <adjustment>0</adjustment>
158
+ <identity>general</identity>
159
+ </reorder>
160
+ <caretip>
161
+ <enabled>0</enabled>
162
+ <status>complete</status>
163
+ <cancel_status>closed</cancel_status>
164
+ <period>7</period>
165
+ <adjustment>0</adjustment>
166
+ <send_limit>-1</send_limit>
167
+ <identity>general</identity>
168
+ </caretip>
169
  </bronto_reviews>
170
  </default>
 
171
  <phpunit>
172
  <suite>
173
  <modules>
175
  </modules>
176
  </suite>
177
  </phpunit>
178
+ </config>
app/code/community/Bronto/Reviews/etc/system.xml CHANGED
@@ -2,7 +2,7 @@
2
  <config>
3
  <sections>
4
  <bronto_reviews module="bronto_reviews">
5
- <label>Review Requests</label>
6
  <tab>bronto</tab>
7
  <frontend_type>text</frontend_type>
8
  <sort_order>895</sort_order>
@@ -18,17 +18,67 @@
18
  <show_in_website>1</show_in_website>
19
  <show_in_store>1</show_in_store>
20
  </about>
21
- <settings>
22
  <label>Settings</label>
23
  <frontend_type>text</frontend_type>
 
 
 
 
 
 
 
 
 
 
24
  <sort_order>1</sort_order>
25
  <show_in_default>1</show_in_default>
26
  <show_in_website>1</show_in_website>
27
  <show_in_store>1</show_in_store>
28
  <expanded>1</expanded>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
29
  <fields>
30
  <enabled>
31
- <label>Enable Module</label>
32
  <frontend_type>select</frontend_type>
33
  <frontend_model>bronto_common/adminhtml_system_config_form_field</frontend_model>
34
  <backend_model>bronto_common/system_config_backend_enable</backend_model>
@@ -44,7 +94,7 @@
44
  <frontend_type>select</frontend_type>
45
  <frontend_model>bronto_common/adminhtml_system_config_form_field</frontend_model>
46
  <source_model>bronto_reviews/system_config_source_orderstatus</source_model>
47
- <comment>The order status which will trigger a scheduled
48
  delivery for the Review Request.</comment>
49
  <sort_order>10</sort_order>
50
  <show_in_default>1</show_in_default>
@@ -68,15 +118,15 @@
68
  <label>Send Period</label>
69
  <depends><enabled>1</enabled></depends>
70
  <frontend_type>text</frontend_type>
71
- <comment>Schedule the email this many days after the order status trigger. Must be between 0 and 365.</comment>
72
  <sort_order>20</sort_order>
73
  <show_in_default>1</show_in_default>
74
  <show_in_website>1</show_in_website>
75
  <show_in_store>1</show_in_store>
76
- <validate>required-entry validate-number-range number-range-0-365</validate>
77
  </period>
78
  <message>
79
- <label>Review Request Message</label>
80
  <depends><enabled>1</enabled></depends>
81
  <frontend_type>select</frontend_type>
82
  <source_model>bronto_reviews/system_config_source_message</source_model>
@@ -123,9 +173,51 @@
123
  <show_in_website>1</show_in_website>
124
  <show_in_store>1</show_in_store>
125
  </url_suffix>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
126
  <sender_name>
127
  <label>Sender Name</label>
128
- <depends><enabled>1</enabled></depends>
 
 
 
129
  <frontend_type>text</frontend_type>
130
  <sort_order>40</sort_order>
131
  <show_in_default>1</show_in_default>
@@ -135,24 +227,419 @@
135
  </sender_name>
136
  <sender_email>
137
  <label>Sender Email</label>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
138
  <depends><enabled>1</enabled></depends>
139
  <frontend_type>text</frontend_type>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
140
  <sort_order>50</sort_order>
141
  <show_in_default>1</show_in_default>
142
  <show_in_website>1</show_in_website>
143
  <show_in_store>1</show_in_store>
144
  <validate>required-entry validate-email</validate>
145
  </sender_email>
146
- <reply_to>
147
- <label>Sender Reply-To</label>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
148
  <depends><enabled>1</enabled></depends>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
149
  <frontend_type>text</frontend_type>
150
- <sort_order>60</sort_order>
 
 
 
 
 
 
 
 
 
 
 
 
 
151
  <show_in_default>1</show_in_default>
152
  <show_in_website>1</show_in_website>
153
  <show_in_store>1</show_in_store>
154
  <validate>required-entry validate-email</validate>
155
- </reply_to>
156
  <exclusion>
157
  <label>Exclusion List(s)</label>
158
  <depends>
@@ -170,7 +657,7 @@
170
  selected list(s).</comment>
171
  </exclusion>
172
  </fields>
173
- </settings>
174
  </groups>
175
  </bronto_reviews>
176
  </sections>
2
  <config>
3
  <sections>
4
  <bronto_reviews module="bronto_reviews">
5
+ <label>Post-Purchase Emails</label>
6
  <tab>bronto</tab>
7
  <frontend_type>text</frontend_type>
8
  <sort_order>895</sort_order>
18
  <show_in_website>1</show_in_website>
19
  <show_in_store>1</show_in_store>
20
  </about>
21
+ <general>
22
  <label>Settings</label>
23
  <frontend_type>text</frontend_type>
24
+ <comment><![CDATA[Post-Purchase Emails are triggered when a
25
+ placed order reaches the desired status. There are three
26
+ types of post-purchase emails: Review Requests, Reorder
27
+ Reminders, and Care Tip Notifications. The emails are
28
+ scheduled in advance and can be cancelled manually or
29
+ when an order reaches a certain status. You can view
30
+ pending deliveries in Bronto's <a
31
+ href="https://app.bronto.com/mail/message_browser/outgoing_messages/email"
32
+ target="_blank">Outgoing Deliveries</a> and under
33
+ <strong>System &raquo; Post-Purchase Deliveries</strong>.<br/><br/>]]></comment>
34
  <sort_order>1</sort_order>
35
  <show_in_default>1</show_in_default>
36
  <show_in_website>1</show_in_website>
37
  <show_in_store>1</show_in_store>
38
  <expanded>1</expanded>
39
+ <fields>
40
+ <time_of_day>
41
+ <label>Target Time for Scheduled Email</label>
42
+ <frontend_type>select</frontend_type>
43
+ <frontend_model>bronto_common/adminhtml_system_config_form_field</frontend_model>
44
+ <source_model>bronto_reviews/system_config_source_hours</source_model>
45
+ <sort_order>5</sort_order>
46
+ <show_in_default>1</show_in_default>
47
+ <show_in_website>1</show_in_website>
48
+ <show_in_store>1</show_in_store>
49
+ <comment><![CDATA[Post-purchase emails will attempt to
50
+ schedule for this time of day, using the server's time zone.]]></comment>
51
+ </time_of_day>
52
+ <conncurrent_limit>
53
+ <label>Max Scheduled Emails</label>
54
+ <frontend_type>text</frontend_type>
55
+ <sort_order>10</sort_order>
56
+ <show_in_default>1</show_in_default>
57
+ <show_in_website>1</show_in_website>
58
+ <show_in_store>1</show_in_store>
59
+ <comment><![CDATA[Max number of scheduled, not yet sent post-purchase
60
+ emails for a given customer at any given time for the
61
+ current scope.
62
+ Limiting the number of scheduled emails will likely
63
+ lower customer fatigue.<br/><strong>Note</strong>: -1
64
+ means no concurrent limit.]]></comment>
65
+ </conncurrent_limit>
66
+ </fields>
67
+ </general>
68
+ <settings>
69
+ <label>Review Request</label>
70
+ <frontend_type>text</frontend_type>
71
+ <sort_order>2</sort_order>
72
+ <show_in_default>1</show_in_default>
73
+ <show_in_website>1</show_in_website>
74
+ <show_in_store>1</show_in_store>
75
+ <expanded>1</expanded>
76
+ <comment><![CDATA[Review Request is an order-based
77
+ post-purchase email, containing all of the products for a
78
+ particular order.<br/><br/>]]></comment>
79
  <fields>
80
  <enabled>
81
+ <label>Enabled</label>
82
  <frontend_type>select</frontend_type>
83
  <frontend_model>bronto_common/adminhtml_system_config_form_field</frontend_model>
84
  <backend_model>bronto_common/system_config_backend_enable</backend_model>
94
  <frontend_type>select</frontend_type>
95
  <frontend_model>bronto_common/adminhtml_system_config_form_field</frontend_model>
96
  <source_model>bronto_reviews/system_config_source_orderstatus</source_model>
97
+ <comment>The order status that will trigger a scheduled
98
  delivery for the Review Request.</comment>
99
  <sort_order>10</sort_order>
100
  <show_in_default>1</show_in_default>
118
  <label>Send Period</label>
119
  <depends><enabled>1</enabled></depends>
120
  <frontend_type>text</frontend_type>
121
+ <comment>Schedule the email this many days after the order status trigger. Must be greater than or equal to 0.</comment>
122
  <sort_order>20</sort_order>
123
  <show_in_default>1</show_in_default>
124
  <show_in_website>1</show_in_website>
125
  <show_in_store>1</show_in_store>
126
+ <validate>required-entry validate-number</validate>
127
  </period>
128
  <message>
129
+ <label>Bronto Message</label>
130
  <depends><enabled>1</enabled></depends>
131
  <frontend_type>select</frontend_type>
132
  <source_model>bronto_reviews/system_config_source_message</source_model>
173
  <show_in_website>1</show_in_website>
174
  <show_in_store>1</show_in_store>
175
  </url_suffix>
176
+ <default_send_flags>
177
+ <label>Delivery Flags</label>
178
+ <depends>
179
+ <enabled>1</enabled>
180
+ </depends>
181
+ <frontend_type>select</frontend_type>
182
+ <source_model>bronto_common/system_config_source_sendOptions</source_model>
183
+ <sort_order>34</sort_order>
184
+ <show_in_default>1</show_in_default>
185
+ <show_in_website>1</show_in_website>
186
+ <show_in_store>1</show_in_store>
187
+ <comment><![CDATA[Specify the default send flags for
188
+ review requests. The options are:
189
+ <br/> - <strong>Sender Authentication</strong>: Will
190
+ sign your message with DomainKeys/DKIM,
191
+ optimizing your message delivery to Hotmail,
192
+ MSN, and Yahoo! email addresses.
193
+ <br/> - <strong>Fatigue Override</strong>: The
194
+ delivery can be sent even if it exceeds the
195
+ frequency cap settings for a customer.
196
+ <br/> - <strong>Reply Tracking</strong>: Will store
197
+ a copy of all replies to your messages on the
198
+ Replies page within the Bronto platform.
199
+ ]]></comment>
200
+ </default_send_flags>
201
+ <identity>
202
+ <label>Email Sender</label>
203
+ <depends>
204
+ <enabled>1</enabled>
205
+ </depends>
206
+ <frontend_type>select</frontend_type>
207
+ <source_model>bronto_reviews/system_config_source_identity</source_model>
208
+ <sort_order>36</sort_order>
209
+ <show_in_default>1</show_in_default>
210
+ <show_in_website>1</show_in_website>
211
+ <show_in_store>1</show_in_store>
212
+ <comment>Select a preset email or configure a
213
+ separate one.</comment>
214
+ </identity>
215
  <sender_name>
216
  <label>Sender Name</label>
217
+ <depends>
218
+ <enabled>1</enabled>
219
+ <identity>custom</identity>
220
+ </depends>
221
  <frontend_type>text</frontend_type>
222
  <sort_order>40</sort_order>
223
  <show_in_default>1</show_in_default>
227
  </sender_name>
228
  <sender_email>
229
  <label>Sender Email</label>
230
+ <depends>
231
+ <enabled>1</enabled>
232
+ <identity>custom</identity>
233
+ </depends>
234
+ <frontend_type>text</frontend_type>
235
+ <sort_order>50</sort_order>
236
+ <show_in_default>1</show_in_default>
237
+ <show_in_website>1</show_in_website>
238
+ <show_in_store>1</show_in_store>
239
+ <validate>required-entry validate-email</validate>
240
+ </sender_email>
241
+ <exclusion>
242
+ <label>Exclusion List(s)</label>
243
+ <depends>
244
+ <enabled>1</enabled>
245
+ </depends>
246
+ <frontend_type>multiselect</frontend_type>
247
+ <frontend_model>bronto_common/adminhtml_system_config_form_field_list</frontend_model>
248
+ <source_model>bronto_common/system_config_source_list</source_model>
249
+ <sort_order>70</sort_order>
250
+ <show_in_default>0</show_in_default>
251
+ <show_in_website>1</show_in_website>
252
+ <show_in_store>1</show_in_store>
253
+ <can_be_empty>1</can_be_empty>
254
+ <comment>Exclude sending for customers on the
255
+ selected list(s).</comment>
256
+ </exclusion>
257
+ </fields>
258
+ </settings>
259
+ <reorder>
260
+ <label>Reorder Reminder</label>
261
+ <frontend_type>text</frontend_type>
262
+ <sort_order>5</sort_order>
263
+ <show_in_default>1</show_in_default>
264
+ <show_in_website>1</show_in_website>
265
+ <show_in_store>1</show_in_store>
266
+ <expanded>1</expanded>
267
+ <comment><![CDATA[Reorder Reminder is a product-based
268
+ post-purchase email, containing a singular product. An order with multiple products can potentially generate multiple reorder reminders. Reorder frequency can be configured
269
+ in the product catalog, once enabled.<br/><br/>]]></comment>
270
+ <fields>
271
+ <enabled>
272
+ <label>Enabled</label>
273
+ <frontend_type>select</frontend_type>
274
+ <frontend_model>bronto_common/adminhtml_system_config_form_field</frontend_model>
275
+ <backend_model>bronto_common/system_config_backend_enable</backend_model>
276
+ <source_model>adminhtml/system_config_source_yesno</source_model>
277
+ <sort_order>0</sort_order>
278
+ <show_in_default>1</show_in_default>
279
+ <show_in_website>1</show_in_website>
280
+ <show_in_store>1</show_in_store>
281
+ </enabled>
282
+ <status>
283
+ <label>Order Status</label>
284
+ <depends><enabled>1</enabled></depends>
285
+ <frontend_type>select</frontend_type>
286
+ <frontend_model>bronto_common/adminhtml_system_config_form_field</frontend_model>
287
+ <source_model>bronto_reviews/system_config_source_orderstatus</source_model>
288
+ <comment>The order status that will trigger a scheduled
289
+ delivery for the Reorder Reminder.</comment>
290
+ <sort_order>10</sort_order>
291
+ <show_in_default>1</show_in_default>
292
+ <show_in_website>1</show_in_website>
293
+ <show_in_store>1</show_in_store>
294
+ <validate>validate-select</validate>
295
+ </status>
296
+ <cancel_status>
297
+ <label>Cancel Delivery Status</label>
298
+ <depends><enabled>1</enabled></depends>
299
+ <frontend_type>multiselect</frontend_type>
300
+ <frontend_model>bronto_common/adminhtml_system_config_form_field</frontend_model>
301
+ <source_model>bronto_reviews/system_config_source_orderstatus</source_model>
302
+ <comment>Select the order status(es) that will cause the email delivery to be cancelled.</comment>
303
+ <sort_order>15</sort_order>
304
+ <show_in_default>1</show_in_default>
305
+ <show_in_website>1</show_in_website>
306
+ <show_in_store>1</show_in_store>
307
+ </cancel_status>
308
+ <period>
309
+ <label>Default Send Period</label>
310
  <depends><enabled>1</enabled></depends>
311
  <frontend_type>text</frontend_type>
312
+ <comment>Schedule the email this many days, per unit, after the order status trigger for each reorder reminder. Must be greater than or equal to 0.</comment>
313
+ <sort_order>20</sort_order>
314
+ <show_in_default>1</show_in_default>
315
+ <show_in_website>1</show_in_website>
316
+ <show_in_store>1</show_in_store>
317
+ <validate>required-entry validate-number</validate>
318
+ </period>
319
+ <adjustment>
320
+ <label>Default Adjustment Period</label>
321
+ <depends><enabled>1</enabled></depends>
322
+ <frontend_type>text</frontend_type>
323
+ <comment><![CDATA[Adjust the send period by this many
324
+ days.<br/><strong>Note</strong>: Negative
325
+ numbers are allowed, and will <em>subtract</em>
326
+ from the send period.]]></comment>
327
+ <sort_order>25</sort_order>
328
+ <show_in_default>1</show_in_default>
329
+ <show_in_website>1</show_in_website>
330
+ <show_in_store>1</show_in_store>
331
+ </adjustment>
332
+ <message>
333
+ <label>Default Bronto Message</label>
334
+ <depends><enabled>1</enabled></depends>
335
+ <frontend_type>select</frontend_type>
336
+ <source_model>bronto_reviews/system_config_source_message</source_model>
337
+ <comment>The Bronto Message to be used for each configured reorderable product.</comment>
338
+ <sort_order>30</sort_order>
339
+ <show_in_default>1</show_in_default>
340
+ <show_in_website>1</show_in_website>
341
+ <show_in_store>1</show_in_store>
342
+ <validate>validate-select required-entry</validate>
343
+ </message>
344
+ <default_coupon>
345
+ <label>Shopping Cart Price Rule</label>
346
+ <depends>
347
+ <enabled>1</enabled>
348
+ </depends>
349
+ <frontend_type>select</frontend_type>
350
+ <source_model>bronto_common/system_config_source_coupon</source_model>
351
+ <sort_order>31</sort_order>
352
+ <show_in_default>1</show_in_default>
353
+ <show_in_website>1</show_in_website>
354
+ <show_in_store>1</show_in_store>
355
+ <comment><![CDATA[Use API tag <em>%%%%#couponCode%%%%</em> within your message in Bronto. You are responsible for ensuring the Shopping Cart Price Rule is active and valid, or else it may appear blank.]]></comment>
356
+ </default_coupon>
357
+ <default_recommendation>
358
+ <label>Product Recommendation</label>
359
+ <depends>
360
+ <enabled>1</enabled>
361
+ </depends>
362
+ <frontend_type>select</frontend_type>
363
+ <source_model>bronto_product/recommendation</source_model>
364
+ <sort_order>32</sort_order>
365
+ <show_in_default>1</show_in_default>
366
+ <show_in_website>1</show_in_website>
367
+ <show_in_store>1</show_in_store>
368
+ <comment><![CDATA[Inject related product content in the message. Recommendations are created in <strong>Promotions</strong> &raquo; <strong>Bronto Product Recommendations]]></comment>
369
+ </default_recommendation>
370
+ <default_send_flags>
371
+ <label>Delivery Flags</label>
372
+ <depends>
373
+ <enabled>1</enabled>
374
+ </depends>
375
+ <frontend_type>select</frontend_type>
376
+ <source_model>bronto_common/system_config_source_sendOptions</source_model>
377
+ <sort_order>34</sort_order>
378
+ <show_in_default>1</show_in_default>
379
+ <show_in_website>1</show_in_website>
380
+ <show_in_store>1</show_in_store>
381
+ <comment><![CDATA[Specify the default send flags for
382
+ review requests. The options are:
383
+ <br/> - <strong>Sender Authentication</strong>: Will
384
+ sign your message with DomainKeys/DKIM,
385
+ optimizing your message delivery to Hotmail,
386
+ MSN, and Yahoo! email addresses.
387
+ <br/> - <strong>Fatigue Override</strong>: The
388
+ delivery can be sent even if it exceeds the
389
+ frequency cap settings for a customer.
390
+ <br/> - <strong>Reply Tracking</strong>: Will store
391
+ a copy of all replies to your messages on the
392
+ Replies page within the Bronto platform.
393
+ ]]></comment>
394
+ </default_send_flags>
395
+ <identity>
396
+ <label>Email Sender</label>
397
+ <depends>
398
+ <enabled>1</enabled>
399
+ </depends>
400
+ <frontend_type>select</frontend_type>
401
+ <source_model>bronto_reviews/system_config_source_identity</source_model>
402
+ <sort_order>36</sort_order>
403
+ <show_in_default>1</show_in_default>
404
+ <show_in_website>1</show_in_website>
405
+ <show_in_store>1</show_in_store>
406
+ <comment>Select a preset email or configure a
407
+ separate one.</comment>
408
+ </identity>
409
+ <sender_name>
410
+ <label>Sender Name</label>
411
+ <depends>
412
+ <enabled>1</enabled>
413
+ <identity>custom</identity>
414
+ </depends>
415
+ <frontend_type>text</frontend_type>
416
+ <sort_order>40</sort_order>
417
+ <show_in_default>1</show_in_default>
418
+ <show_in_website>1</show_in_website>
419
+ <show_in_store>1</show_in_store>
420
+ <validate>required-entry</validate>
421
+ </sender_name>
422
+ <sender_email>
423
+ <label>Sender Email</label>
424
+ <depends>
425
+ <enabled>1</enabled>
426
+ <identity>custom</identity>
427
+ </depends>
428
+ <frontend_type>text</frontend_type>
429
  <sort_order>50</sort_order>
430
  <show_in_default>1</show_in_default>
431
  <show_in_website>1</show_in_website>
432
  <show_in_store>1</show_in_store>
433
  <validate>required-entry validate-email</validate>
434
  </sender_email>
435
+ <exclusion>
436
+ <label>Exclusion List(s)</label>
437
+ <depends>
438
+ <enabled>1</enabled>
439
+ </depends>
440
+ <frontend_type>multiselect</frontend_type>
441
+ <frontend_model>bronto_common/adminhtml_system_config_form_field_list</frontend_model>
442
+ <source_model>bronto_common/system_config_source_list</source_model>
443
+ <sort_order>70</sort_order>
444
+ <show_in_default>0</show_in_default>
445
+ <show_in_website>1</show_in_website>
446
+ <show_in_store>1</show_in_store>
447
+ <can_be_empty>1</can_be_empty>
448
+ <comment>Exclude sending for customers on the
449
+ selected list(s).</comment>
450
+ </exclusion>
451
+ </fields>
452
+ </reorder>
453
+ <caretip>
454
+ <label>Care Tips Notification</label>
455
+ <frontend_type>text</frontend_type>
456
+ <sort_order>10</sort_order>
457
+ <show_in_default>1</show_in_default>
458
+ <show_in_website>1</show_in_website>
459
+ <show_in_store>1</show_in_store>
460
+ <expanded>1</expanded>
461
+ <comment><![CDATA[Care Tips Notification is a product-based
462
+ post-purchase email, containing a singular product. An order with multiple products can potentially generate multiple care notifications. Care tip
463
+ content can be configured in the product catalog, once
464
+ enabled.]]></comment>
465
+ <fields>
466
+ <enabled>
467
+ <label>Enabled</label>
468
+ <frontend_type>select</frontend_type>
469
+ <frontend_model>bronto_common/adminhtml_system_config_form_field</frontend_model>
470
+ <backend_model>bronto_common/system_config_backend_enable</backend_model>
471
+ <source_model>adminhtml/system_config_source_yesno</source_model>
472
+ <sort_order>0</sort_order>
473
+ <show_in_default>1</show_in_default>
474
+ <show_in_website>1</show_in_website>
475
+ <show_in_store>1</show_in_store>
476
+ </enabled>
477
+ <status>
478
+ <label>Order Status</label>
479
+ <depends><enabled>1</enabled></depends>
480
+ <frontend_type>select</frontend_type>
481
+ <frontend_model>bronto_common/adminhtml_system_config_form_field</frontend_model>
482
+ <source_model>bronto_reviews/system_config_source_orderstatus</source_model>
483
+ <comment>The order status that will trigger a scheduled
484
+ delivery for the Care Tips Notification.</comment>
485
+ <sort_order>10</sort_order>
486
+ <show_in_default>1</show_in_default>
487
+ <show_in_website>1</show_in_website>
488
+ <show_in_store>1</show_in_store>
489
+ <validate>validate-select</validate>
490
+ </status>
491
+ <cancel_status>
492
+ <label>Cancel Delivery Status</label>
493
+ <depends><enabled>1</enabled></depends>
494
+ <frontend_type>multiselect</frontend_type>
495
+ <frontend_model>bronto_common/adminhtml_system_config_form_field</frontend_model>
496
+ <source_model>bronto_reviews/system_config_source_orderstatus</source_model>
497
+ <comment>Select the order status(es) that will cause the email delivery to be cancelled.</comment>
498
+ <sort_order>15</sort_order>
499
+ <show_in_default>1</show_in_default>
500
+ <show_in_website>1</show_in_website>
501
+ <show_in_store>1</show_in_store>
502
+ </cancel_status>
503
+ <period>
504
+ <label>Default Send Period</label>
505
+ <depends><enabled>1</enabled></depends>
506
+ <frontend_type>text</frontend_type>
507
+ <comment>Schedule the email this many days after the order status trigger for each care notification. Must be greater than or equal to 0.</comment>
508
+ <sort_order>20</sort_order>
509
+ <show_in_default>1</show_in_default>
510
+ <show_in_website>1</show_in_website>
511
+ <show_in_store>1</show_in_store>
512
+ <validate>required-entry validate-number</validate>
513
+ </period>
514
+ <adjustment>
515
+ <label>Default Adjustment Period</label>
516
+ <depends><enabled>1</enabled></depends>
517
+ <frontend_type>text</frontend_type>
518
+ <comment><![CDATA[Adjust the send period by this many
519
+ days.<br/><strong>Note</strong>: Negative
520
+ numbers are allowed, and will <em>subtract</em>
521
+ from the send period.]]></comment>
522
+ <sort_order>24</sort_order>
523
+ <show_in_default>1</show_in_default>
524
+ <show_in_website>1</show_in_website>
525
+ <show_in_store>1</show_in_store>
526
+ </adjustment>
527
+ <send_limit>
528
+ <label>Default Send Limit</label>
529
+ <depends><enabled>1</enabled></depends>
530
+ <frontend_type>text</frontend_type>
531
+ <comment><![CDATA[Number of times a care notification can be scheduled
532
+ for a configured product per
533
+ customer.<br/><strong>Note</strong>: -1 will
534
+ always schedule.]]></comment>
535
+ <sort_order>25</sort_order>
536
+ <show_in_default>1</show_in_default>
537
+ <show_in_website>1</show_in_website>
538
+ <show_in_store>1</show_in_store>
539
+ </send_limit>
540
+ <message>
541
+ <label>Default Bronto Message</label>
542
  <depends><enabled>1</enabled></depends>
543
+ <frontend_type>select</frontend_type>
544
+ <source_model>bronto_reviews/system_config_source_message</source_model>
545
+ <comment>The Bronto Message to be used for all care notifications.</comment>
546
+ <sort_order>30</sort_order>
547
+ <show_in_default>1</show_in_default>
548
+ <show_in_website>1</show_in_website>
549
+ <show_in_store>1</show_in_store>
550
+ <validate>validate-select required-entry</validate>
551
+ </message>
552
+ <default_coupon>
553
+ <label>Shopping Cart Price Rule</label>
554
+ <depends>
555
+ <enabled>1</enabled>
556
+ </depends>
557
+ <frontend_type>select</frontend_type>
558
+ <source_model>bronto_common/system_config_source_coupon</source_model>
559
+ <sort_order>31</sort_order>
560
+ <show_in_default>1</show_in_default>
561
+ <show_in_website>1</show_in_website>
562
+ <show_in_store>1</show_in_store>
563
+ <comment><![CDATA[Use API tag <em>%%%%#couponCode%%%%</em> within your message in Bronto. You are responsible for ensuring the Shopping Cart Price Rule is active and valid, or else it may appear blank.]]></comment>
564
+ </default_coupon>
565
+ <default_recommendation>
566
+ <label>Product Recommendation</label>
567
+ <depends>
568
+ <enabled>1</enabled>
569
+ </depends>
570
+ <frontend_type>select</frontend_type>
571
+ <source_model>bronto_product/recommendation</source_model>
572
+ <sort_order>32</sort_order>
573
+ <show_in_default>1</show_in_default>
574
+ <show_in_website>1</show_in_website>
575
+ <show_in_store>1</show_in_store>
576
+ <comment><![CDATA[Inject related product content in the message. Recommendations are created in <strong>Promotions</strong> &raquo; <strong>Bronto Product Recommendations]]></comment>
577
+ </default_recommendation>
578
+ <default_send_flags>
579
+ <label>Delivery Flags</label>
580
+ <depends>
581
+ <enabled>1</enabled>
582
+ </depends>
583
+ <frontend_type>select</frontend_type>
584
+ <source_model>bronto_common/system_config_source_sendOptions</source_model>
585
+ <sort_order>34</sort_order>
586
+ <show_in_default>1</show_in_default>
587
+ <show_in_website>1</show_in_website>
588
+ <show_in_store>1</show_in_store>
589
+ <comment><![CDATA[Specify the default send flags for
590
+ review requests. The options are:
591
+ <br/> - <strong>Sender Authentication</strong>: Will
592
+ sign your message with DomainKeys/DKIM,
593
+ optimizing your message delivery to Hotmail,
594
+ MSN, and Yahoo! email addresses.
595
+ <br/> - <strong>Fatigue Override</strong>: The
596
+ delivery can be sent even if it exceeds the
597
+ frequency cap settings for a customer.
598
+ <br/> - <strong>Reply Tracking</strong>: Will store
599
+ a copy of all replies to your messages on the
600
+ Replies page within the Bronto platform.
601
+ ]]></comment>
602
+ </default_send_flags>
603
+ <identity>
604
+ <label>Email Sender</label>
605
+ <depends>
606
+ <enabled>1</enabled>
607
+ </depends>
608
+ <frontend_type>select</frontend_type>
609
+ <source_model>bronto_reviews/system_config_source_identity</source_model>
610
+ <sort_order>36</sort_order>
611
+ <show_in_default>1</show_in_default>
612
+ <show_in_website>1</show_in_website>
613
+ <show_in_store>1</show_in_store>
614
+ <comment>Select a preset email or configure a new
615
+ one.</comment>
616
+ </identity>
617
+ <sender_name>
618
+ <label>Sender Name</label>
619
+ <depends>
620
+ <enabled>1</enabled>
621
+ <identity>custom</identity>
622
+ </depends>
623
  <frontend_type>text</frontend_type>
624
+ <sort_order>40</sort_order>
625
+ <show_in_default>1</show_in_default>
626
+ <show_in_website>1</show_in_website>
627
+ <show_in_store>1</show_in_store>
628
+ <validate>required-entry</validate>
629
+ </sender_name>
630
+ <sender_email>
631
+ <label>Sender Email</label>
632
+ <depends>
633
+ <enabled>1</enabled>
634
+ <identity>custom</identity>
635
+ </depends>
636
+ <frontend_type>text</frontend_type>
637
+ <sort_order>50</sort_order>
638
  <show_in_default>1</show_in_default>
639
  <show_in_website>1</show_in_website>
640
  <show_in_store>1</show_in_store>
641
  <validate>required-entry validate-email</validate>
642
+ </sender_email>
643
  <exclusion>
644
  <label>Exclusion List(s)</label>
645
  <depends>
657
  selected list(s).</comment>
658
  </exclusion>
659
  </fields>
660
+ </caretip>
661
  </groups>
662
  </bronto_reviews>
663
  </sections>
app/code/community/Bronto/Reviews/sql/bronto_reviews_setup/mysql4-install-0.0.1.php CHANGED
@@ -21,4 +21,4 @@ try {
21
  Mage::helper('bronto_reviews')->writeError($e->getMessage());
22
  }
23
 
24
- $installer->endSetup();
21
  Mage::helper('bronto_reviews')->writeError($e->getMessage());
22
  }
23
 
24
+ $installer->endSetup();
app/code/community/Bronto/Reviews/sql/bronto_reviews_setup/mysql4-install-0.0.2.php ADDED
@@ -0,0 +1,13 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $installer = $this;
4
+
5
+ $installer->startSetup();
6
+
7
+ try {
8
+ $installer->createTables();
9
+ } catch (Exception $e) {
10
+ Mage::helper('bronto_reviews')->writeError('Failed to create post purchase table: ' . $e->getMessage());
11
+ }
12
+
13
+ $installer->endSetup();
app/code/community/Bronto/Reviews/sql/bronto_reviews_setup/mysql4-upgrade-0.0.1-0.0.2.php ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ $installer = $this;
4
+
5
+ $installer->startSetup();
6
+
7
+ try {
8
+ $installer->setCustomEmail();
9
+ $installer->createTable('log');
10
+ $installer->createTable('post_purchase');
11
+ } catch (Exception $e) {
12
+ Mage::helper('bronto_reviews')->writeError('Failed to update post purchase to 0.0.2:' . $e->getMessage());
13
+ }
14
+
15
+ $installer->endSetup();
app/code/community/Bronto/Verify/Block/Adminhtml/System/Config/Installs.php CHANGED
@@ -32,9 +32,11 @@ class Bronto_Verify_Block_Adminhtml_System_Config_Installs
32
  'bronto_newsletter',
33
  'bronto_customer',
34
  'bronto_order',
 
35
  'bronto_reviews',
36
  'bronto_reminder',
37
  'bronto_email',
 
38
  'bronto_api',
39
  );
40
 
@@ -305,6 +307,8 @@ class Bronto_Verify_Block_Adminhtml_System_Config_Installs
305
  $section = $module;
306
  if ($module == 'bronto_api') {
307
  $module = 'bronto_common/api';
 
 
308
  } else {
309
  if (!in_array($module, $modules)) {
310
  continue;
32
  'bronto_newsletter',
33
  'bronto_customer',
34
  'bronto_order',
35
+ 'bronto_product',
36
  'bronto_reviews',
37
  'bronto_reminder',
38
  'bronto_email',
39
+ 'bronto_coupon',
40
  'bronto_api',
41
  );
42
 
307
  $section = $module;
308
  if ($module == 'bronto_api') {
309
  $module = 'bronto_common/api';
310
+ } else if ($module == 'bronto_coupon') {
311
+ $module = 'bronto_common/coupon';
312
  } else {
313
  if (!in_array($module, $modules)) {
314
  continue;
app/code/community/Bronto/Verify/etc/adminhtml.xml CHANGED
@@ -18,7 +18,7 @@
18
  <config>
19
  <children>
20
  <bronto_verify translate="title" module="bronto_verify">
21
- <title>Bronto Verify Installation Section</title>
22
  <sort_order>9999</sort_order>
23
  </bronto_verify>
24
  </children>
18
  <config>
19
  <children>
20
  <bronto_verify translate="title" module="bronto_verify">
21
+ <title>Bronto Admin Tools Section</title>
22
  <sort_order>9999</sort_order>
23
  </bronto_verify>
24
  </children>
app/design/adminhtml/default/default/layout/bronto/reviews.xml ADDED
@@ -0,0 +1,23 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?xml version="1.0"?>
2
+ <layout>
3
+ <adminhtml_catalog_product_edit>
4
+ <reference name="product_tabs">
5
+ <action method="addTab">
6
+ <name>post_reorder</name>
7
+ <block>bronto_reviews/adminhtml_catalog_product_edit_tab_reorder</block>
8
+ </action>
9
+ <action method="addTab">
10
+ <name>post_caretip</name>
11
+ <block>bronto_reviews/adminhtml_catalog_product_edit_tab_caretip</block>
12
+ </action>
13
+ </reference>
14
+ </adminhtml_catalog_product_edit>
15
+ <adminhtml_sales_order_view>
16
+ <reference name="sales_order_tabs">
17
+ <action method="addTab">
18
+ <name>order_post_purchase</name>
19
+ <block>bronto_reviews/adminhtml_sales_order_view_tab_post_purchase</block>
20
+ </action>
21
+ </reference>
22
+ </adminhtml_sales_order_view>
23
+ </layout>
app/design/adminhtml/default/default/template/bronto/coupon/guide.phtml CHANGED
@@ -9,11 +9,11 @@
9
  {name: "<?php echo $this->__("No Thanks") ?>", onclick: guiders.hideAll}
10
  ],
11
  buttonCustomHTML: dontShowButtonHtml,
12
- description: "<?php echo $this->__('This module provides you quick access to add your Bronto Coupon Manager Account ID.') ?>",
13
  id: "start",
14
  next: "bronto_coupon-site_hash",
15
  overlay: true, closeOnEscape: true,
16
- title: "Bronto Extension - <?php echo $this->__('Coupon Manager') ?>",
17
  width: 600
18
  });
19
 
@@ -38,12 +38,238 @@
38
  overlay: true, closeOnEscape: true,
39
  description: "<?php echo $this->__('Once you have your Coupon Manager Account ID, you can simply paste it here.') ?>",
40
  id: "bronto_coupon-site_hash",
41
- next: "bronto_coupon-save_config_first",
42
  position: 1,
43
  title: "<?php echo $this->__('Pasting your Account ID') ?>",
44
  width: 250
45
  });
46
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
47
  /**
48
  * Save Configuration
49
  */
@@ -59,7 +285,7 @@
59
  autoFocus: true,
60
  highlight: 'button.save',
61
  overlay: true, closeOnEscape: true,
62
- description: "<?php echo $this->__("Now that you have added your site hash, you need to save it. Click `Save Config` now.") ?>",
63
  id: "bronto_coupon-save_config_first",
64
  next: "scope",
65
  position: 5,
9
  {name: "<?php echo $this->__("No Thanks") ?>", onclick: guiders.hideAll}
10
  ],
11
  buttonCustomHTML: dontShowButtonHtml,
12
+ description: "<?php echo $this->__('This module allows you to apply a coupon on a customer\'s shopping session from the URL, and provides quick access to you Coupon Manager Account ID.') ?>",
13
  id: "start",
14
  next: "bronto_coupon-site_hash",
15
  overlay: true, closeOnEscape: true,
16
+ title: "Bronto Extension - <?php echo $this->__('Coupon Management') ?>",
17
  width: 600
18
  });
19
 
38
  overlay: true, closeOnEscape: true,
39
  description: "<?php echo $this->__('Once you have your Coupon Manager Account ID, you can simply paste it here.') ?>",
40
  id: "bronto_coupon-site_hash",
41
+ next: "bronto_coupon-enabled",
42
  position: 1,
43
  title: "<?php echo $this->__('Pasting your Account ID') ?>",
44
  width: 250
45
  });
46
 
47
+ /**
48
+ * Enable the Module
49
+ */
50
+ guiders.createGuider({
51
+ attachTo: '#bronto_coupon_apply_coupon_enabled',
52
+ buttons: [
53
+ {name: "<?php echo $this->__('Back') ?>"},
54
+ {name: "<?php echo $this->__('Next') ?>", onclick: function() {
55
+ if (jQuery('#bronto_coupon_apply_coupon_enabled').val() == '1') {
56
+ guiders.next();
57
+ } else {
58
+ alert("<?php echo $this->__("Don't forget to enable the module.") ?>");
59
+ }
60
+ }},
61
+ {name: "<?php echo $this->__('Close') ?>"}
62
+ ],
63
+ autoFocus: true,
64
+ closeOnEscape: true,
65
+ highlight: '#bronto_coupon_apply_coupon_enabled',
66
+ description: "<?php echo $this->__("Let's enable the module and expose some more options. Just set `Enabled` to Yes.") ?>",
67
+ id: "bronto_coupon-enabled",
68
+ next: "bronto_coupon-use_observer",
69
+ position: 11,
70
+ overlay: true,
71
+ title: "<?php echo $this->__('Enable the Module') ?>",
72
+ width: 200
73
+ });
74
+
75
+ /**
76
+ * Explain the Event Observer
77
+ */
78
+ guiders.createGuider({
79
+ attachTo: '#bronto_coupon_apply_coupon_use_observer',
80
+ buttons: [
81
+ {name: "<?php echo $this->__('Back') ?>"},
82
+ {name: "<?php echo $this->__('Next') ?>"},
83
+ {name: "<?php echo $this->__('Close') ?>"}
84
+ ],
85
+ autoFocus: true,
86
+ closeOnEscape: true,
87
+ highlight: '#bronto_coupon_apply_coupon_use_observer',
88
+ description: "<?php echo $this->__("The `Use Event Observer` switch will scan all front end URL's for the parameters in question instead of use a specific controller URL.") ?>",
89
+ id: "bronto_coupon-use_observer",
90
+ next: "bronto_coupon-code_param",
91
+ position: 9,
92
+ overlay: true,
93
+ title: "<?php echo $this->__('Use Event Observer') ?>",
94
+ width: 200
95
+ });
96
+
97
+ /**
98
+ * Explain the Coupon Code Query Parameter
99
+ */
100
+ guiders.createGuider({
101
+ attachTo: '#bronto_coupon_apply_coupon_coupon_code_param',
102
+ buttons: [
103
+ {name: "<?php echo $this->__('Back') ?>"},
104
+ {name: "<?php echo $this->__('Next') ?>"},
105
+ {name: "<?php echo $this->__('Close') ?>"}
106
+ ],
107
+ autoFocus: true,
108
+ closeOnEscape: true,
109
+ highlight: '#bronto_coupon_apply_coupon_coupon_code_param',
110
+ description: "<?php echo $this->__("The `Coupon Code Query Parameter` allows you to define the query parameter representing the coupon code to apply to the customer shopping session.") ?>",
111
+ id: "bronto_coupon-code_param",
112
+ next: "bronto_coupon-error_message_param",
113
+ position: 9,
114
+ overlay: true,
115
+ title: "<?php echo $this->__('Coupon Code Query Parameter') ?>",
116
+ width: 200
117
+ });
118
+
119
+ /**
120
+ * Explain the Invalid Coupon Query Parameter
121
+ */
122
+ guiders.createGuider({
123
+ attachTo: '#bronto_coupon_apply_coupon_error_message_param',
124
+ buttons: [
125
+ {name: "<?php echo $this->__('Back') ?>"},
126
+ {name: "<?php echo $this->__('Next') ?>"},
127
+ {name: "<?php echo $this->__('Close') ?>"}
128
+ ],
129
+ autoFocus: true,
130
+ closeOnEscape: true,
131
+ highlight: '#bronto_coupon_apply_coupon_error_message_param',
132
+ description: "<?php echo $this->__("The `Invalid Coupon Query Parameter` allows you to define the query parameter representing the error code for an invalid message to display to the customer.") ?>",
133
+ id: "bronto_coupon-error_message_param",
134
+ next: "bronto_coupon-success_message",
135
+ position: 9,
136
+ overlay: true,
137
+ title: "<?php echo $this->__('Invalid Coupon Query Parameter') ?>",
138
+ width: 200
139
+ });
140
+
141
+ /**
142
+ * Explain the Success Message
143
+ */
144
+ guiders.createGuider({
145
+ attachTo: '#bronto_coupon_apply_coupon_success_message',
146
+ buttons: [
147
+ {name: "<?php echo $this->__('Back') ?>"},
148
+ {name: "<?php echo $this->__('Next') ?>"},
149
+ {name: "<?php echo $this->__('Close') ?>"}
150
+ ],
151
+ autoFocus: true,
152
+ closeOnEscape: true,
153
+ highlight: '#bronto_coupon_apply_coupon_success_message',
154
+ description: "<?php echo $this->__("The `Success Message` allows you to define the message to be displayed to the customer if the coupon code was successfully applied.") ?>",
155
+ id: "bronto_coupon-success_message",
156
+ next: "bronto_coupon-invalid",
157
+ position: 9,
158
+ overlay: true,
159
+ title: "<?php echo $this->__('Success Message') ?>",
160
+ width: 200
161
+ });
162
+
163
+ /**
164
+ * Explain the Invalid Message
165
+ */
166
+ guiders.createGuider({
167
+ attachTo: '#bronto_coupon_apply_coupon_invalid',
168
+ buttons: [
169
+ {name: "<?php echo $this->__('Back') ?>"},
170
+ {name: "<?php echo $this->__('Next') ?>"},
171
+ {name: "<?php echo $this->__('Close') ?>"}
172
+ ],
173
+ autoFocus: true,
174
+ closeOnEscape: true,
175
+ highlight: '#bronto_coupon_apply_coupon_invalid',
176
+ description: "<?php echo $this->__("The `Invalid Message` allows you to define the message to be displayed to the customer if the coupon code invalid or if some other error occurred.") ?>",
177
+ id: "bronto_coupon-invalid",
178
+ next: "bronto_coupon-depleted",
179
+ position: 9,
180
+ overlay: true,
181
+ title: "<?php echo $this->__('Invalid Message') ?>",
182
+ width: 200
183
+ });
184
+
185
+ /**
186
+ * Explain the Depleted Message
187
+ */
188
+ guiders.createGuider({
189
+ attachTo: '#bronto_coupon_apply_coupon_depleted',
190
+ buttons: [
191
+ {name: "<?php echo $this->__('Back') ?>"},
192
+ {name: "<?php echo $this->__('Next') ?>"},
193
+ {name: "<?php echo $this->__('Close') ?>"}
194
+ ],
195
+ autoFocus: true,
196
+ closeOnEscape: true,
197
+ highlight: '#bronto_coupon_apply_coupon_depleted',
198
+ description: "<?php echo $this->__("The `Depleted Message` allows you to define the message to be displayed to the customer if the coupon code is depleted.") ?>",
199
+ id: "bronto_coupon-depleted",
200
+ next: "bronto_coupon-expired",
201
+ position: 9,
202
+ overlay: true,
203
+ title: "<?php echo $this->__('Invalid Message') ?>",
204
+ width: 200
205
+ });
206
+
207
+ /**
208
+ * Explain the Expired Message
209
+ */
210
+ guiders.createGuider({
211
+ attachTo: '#bronto_coupon_apply_coupon_expired',
212
+ buttons: [
213
+ {name: "<?php echo $this->__('Back') ?>"},
214
+ {name: "<?php echo $this->__('Next') ?>"},
215
+ {name: "<?php echo $this->__('Close') ?>"}
216
+ ],
217
+ autoFocus: true,
218
+ closeOnEscape: true,
219
+ highlight: '#bronto_coupon_apply_coupon_expired',
220
+ description: "<?php echo $this->__("The `Expired Message` allows you to define the message to be displayed to the customer if the coupon code is expired.") ?>",
221
+ id: "bronto_coupon-expired",
222
+ next: "bronto_coupon-conflict",
223
+ position: 9,
224
+ overlay: true,
225
+ title: "<?php echo $this->__('Expired Message') ?>",
226
+ width: 200
227
+ });
228
+
229
+ /**
230
+ * Explain the Conflict Message
231
+ */
232
+ guiders.createGuider({
233
+ attachTo: '#bronto_coupon_apply_coupon_conflict',
234
+ buttons: [
235
+ {name: "<?php echo $this->__('Back') ?>"},
236
+ {name: "<?php echo $this->__('Next') ?>"},
237
+ {name: "<?php echo $this->__('Close') ?>"}
238
+ ],
239
+ autoFocus: true,
240
+ closeOnEscape: true,
241
+ highlight: '#bronto_coupon_apply_coupon_conflict',
242
+ description: "<?php echo $this->__("The `Conflict Message` allows you to define the message to be displayed to the customer if the coupon code is going to replace the coupon code already applied on their cart.") ?>",
243
+ id: "bronto_coupon-conflict",
244
+ next: "bronto_coupon-link",
245
+ position: 9,
246
+ overlay: true,
247
+ title: "<?php echo $this->__('Conflict Message') ?>",
248
+ width: 200
249
+ });
250
+
251
+ /**
252
+ * Explain the Link Content
253
+ */
254
+ guiders.createGuider({
255
+ attachTo: '#bronto_coupon_apply_coupon_link',
256
+ buttons: [
257
+ {name: "<?php echo $this->__('Back') ?>"},
258
+ {name: "<?php echo $this->__('Next') ?>"},
259
+ {name: "<?php echo $this->__('Close') ?>"}
260
+ ],
261
+ autoFocus: true,
262
+ closeOnEscape: true,
263
+ highlight: '#bronto_coupon_apply_coupon_link',
264
+ description: "<?php echo $this->__("The `Link Content` allows you to define the contents of the force application link used in the `Conflict Message`.") ?>",
265
+ id: "bronto_coupon-link",
266
+ next: "bronto_coupon-save_config_first",
267
+ position: 9,
268
+ overlay: true,
269
+ title: "<?php echo $this->__('Link Content') ?>",
270
+ width: 200
271
+ });
272
+
273
  /**
274
  * Save Configuration
275
  */
285
  autoFocus: true,
286
  highlight: 'button.save',
287
  overlay: true, closeOnEscape: true,
288
+ description: "<?php echo $this->__("Now that you have added your site hash, and configured your coupon handling, you need to save your settings. Click `Save Config` now.") ?>",
289
  id: "bronto_coupon-save_config_first",
290
  next: "scope",
291
  position: 5,
app/design/adminhtml/default/default/template/bronto/product/recommendation/selected.js.phtml CHANGED
@@ -3,7 +3,7 @@ function selectProducts(fieldId, matchesField) {
3
  if (matchesField) {
4
  var source = fieldId.split('_')[1];
5
  var original = source + "_source";
6
- var title = $$('label[for=' + original + ']').first().innerText.replace("*", '');
7
  } else {
8
  var source = 'none';
9
  var title = 'Optional Products';
3
  if (matchesField) {
4
  var source = fieldId.split('_')[1];
5
  var original = source + "_source";
6
+ var title = $(original).getAttribute('title');
7
  } else {
8
  var source = 'none';
9
  var title = 'Optional Products';
app/design/adminhtml/default/default/template/bronto/reviews/guide.phtml CHANGED
@@ -19,192 +19,270 @@
19
  '</div>'
20
  ) ?>",
21
  id: "start",
22
- next: "bronto_reviews-enable",
23
  overlay: true, closeOnEscape: true,
24
- title: "Bronto Extension - <?php echo $this->__('Review Requests Module') ?>",
25
  width: 600
26
  });
27
 
28
- /**
29
- * Enable the Module
30
- */
31
- guiders.createGuider({
32
- attachTo: '#bronto_reviews_settings_enabled',
33
- buttons: [
34
- {name: "<?php echo $this->__('Back') ?>"},
35
- {name: "<?php echo $this->__('Next') ?>", onclick: function() {
36
- if (jQuery('#bronto_reviews_settings_enabled').val() == '1') {
37
- guiders.next();
38
- } else {
39
- alert("<?php echo $this->__("Don't forget to enable the module.") ?>");
40
- }
41
- }},
42
- {name: "<?php echo $this->__('Close') ?>"}
43
- ],
44
- shouldSkip: function() {
45
- return <?php echo ($this->isDefaultScope()) ? 'false' : 'true'; ?>
46
  },
47
- autoFocus: true,
48
- highlight: '#bronto_reviews_settings_enabled',
49
- description: "<?php echo $this->__("Let's enable the module and expose some more options. Just set `Enable Module` to Yes.") ?>",
50
- id: "bronto_reviews-enable",
51
- next: "bronto_reviews-order_status",
52
- position: 11,
53
- overlay: true, closeOnEscape: true,
54
- title: "<?php echo $this->__('Enable the Module') ?>",
55
- width: 200
56
- });
57
-
58
- /**
59
- * Save Configuration
60
- */
61
- guiders.createGuider({
62
- attachTo: 'button.save',
63
- buttons: [
64
- {name: "<?php echo $this->__('Back') ?>"},
65
- {name: "<?php echo $this->__('Save Config') ?>", onclick: function() {
66
- configForm.submit()
67
- }},
68
- {name: "<?php echo $this->__('Next') ?>"},
69
- {name: "<?php echo $this->__('Close') ?>"}
70
- ],
71
- shouldSkip: function() {
72
- return <?php echo ($this->isDefaultScope()) ? 'false' : 'true'; ?>
73
  },
74
- autoFocus: true,
75
- highlight: 'button.save',
76
- overlay: true, closeOnEscape: true,
77
- description: "<?php echo $this->__('Now that the initial settings have been configured, you should save them. Click `Save Config` now.') ?>",
78
- id: "bronto_reviews-save_config_first",
79
- next: "bronto_reviews-order_status",
80
- position: 5,
81
- title: "<?php echo $this->__('Save Config') ?>"
82
- });
83
 
84
- /**
85
- * Explain the Order Status option
86
- */
87
- guiders.createGuider({
88
- attachTo: '#bronto_reviews_settings_status',
89
- buttons: [
90
- {name: "<?php echo $this->__('Back') ?>"},
91
- {name: "<?php echo $this->__('Next') ?>"},
92
- {name: "<?php echo $this->__('Close') ?>"}
93
- ],
94
- autoFocus: true,
95
- highlight: '#bronto_reviews_settings_status',
96
- description: "<?php echo $this->__("This setting allows you to specify the order status at which to trigger the delivery. When an order reaches this status the system will send a delivery schedule request to Bronto to schedule an email to be sent after a specified number of days.") ?>",
97
- id: "bronto_reviews-order_status",
98
- next: "bronto_reviews-cancel_status",
99
- position: 11,
100
- overlay: true, closeOnEscape: true,
101
- title: "<?php echo $this->__('Order Status') ?>",
102
- width: 200
103
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
104
 
105
- /**
106
- * Explain the Cancel Status Option
107
- */
108
- guiders.createGuider({
109
- attachTo: '#bronto_reviews_settings_cancel_status',
110
- buttons: [
111
- {name: "<?php echo $this->__('Back') ?>"},
112
- {name: "<?php echo $this->__('Next') ?>"},
113
- {name: "<?php echo $this->__('Close') ?>"}
114
- ],
115
- autoFocus: true,
116
- highlight: "#bronto_reviews_settings_cancel_status",
117
- description: "<?php echo $this->__('This setting allows you to specify the order status(s) which should cancel the scheduled delivery. You will need to select a status that can be reached after a delivery has been placed, such as if your Order Status is set to `Complete`, your Cancel Delivery Status should be `Closed` as once an order is complete it can only be removed by refunding the order.') ?>",
118
- id: "bronto_reviews-cancel_status",
119
- next: "bronto_reviews-period",
120
- position: 10,
121
- overlay: true, closeOnEscape: true,
122
- title: "<?php echo $this->__('Cancel Order Status') ?>",
123
- width: 200
124
- });
 
 
 
 
 
125
 
126
- /**
127
- * Explain the Send Period Setting
128
- */
129
- guiders.createGuider({
130
- attachTo: '#bronto_reviews_settings_period',
131
- buttons: [
132
- {name: "<?php echo $this->__('Back') ?>"},
133
- {name: "<?php echo $this->__('Next') ?>"},
134
- {name: "<?php echo $this->__('Close') ?>"}
135
- ],
136
- autoFocus: true,
137
- highlight: "#bronto_reviews_settings_period",
138
- description: "<?php echo $this->__('The Send Period is the number of days to wait before sending the Review Request email.') ?>",
139
- id: "bronto_reviews-period",
140
- next: "bronto_reviews-message",
141
- position: 9,
142
- overlay: true, closeOnEscape: true,
143
- title: "<?php echo $this->__('Send Period') ?>",
144
- width: 200
145
- });
146
 
147
- /**
148
- * Explain the Review Request Message
149
- */
150
- guiders.createGuider({
151
- attachTo: '#bronto_reviews_settings_message',
152
- buttons: [
153
- {name: "<?php echo $this->__('Back') ?>"},
154
- {name: "<?php echo $this->__('Next') ?>"},
155
- {name: "<?php echo $this->__('Close') ?>"}
156
- ],
157
- autoFocus: true,
158
- highlight: "#bronto_reviews_settings_message",
159
- description: "<?php echo $this->__('Select the Bronto Message you want to use to send the Review Request email.') ?>",
160
- id: "bronto_reviews-message",
161
- next: "bronto_reviews-url_suffix",
162
- position: 9,
163
- overlay: true, closeOnEscape: true,
164
- title: "<?php echo $this->__('Review Request Message') ?>",
165
- width: 200
166
- });
167
 
168
- /**
169
- * Explain the Product Url Suffix
170
- */
171
- guiders.createGuider({
172
- attachTo: '#bronto_reviews_settings_url_suffix',
173
- buttons: [
174
- {name: "<?php echo $this->__('Back') ?>"},
175
- {name: "<?php echo $this->__('Next') ?>"},
176
- {name: "<?php echo $this->__('Close') ?>"}
177
- ],
178
- autoFocus: true,
179
- highlight: "#bronto_reviews_settings_url_suffix",
180
- description: "<?php echo $this->__('The Product URL Suffix allows you to append strings to the end of the product url. This is useful if you want to add a hyperlink reference to a specific portion of the product page.') ?>",
181
- id: "bronto_reviews-url_suffix",
182
- next: "bronto_reviews-sender_email",
183
- position: 9,
184
- overlay: true, closeOnEscape: true,
185
- title: "<?php echo $this->__('Product URL Suffix') ?>",
186
- width: 200
187
- });
188
 
189
- /**
190
- * Explain the Sender Details
191
- */
192
- guiders.createGuider({
193
- attachTo: '#bronto_reviews_settings_sender_email',
194
- buttons: [
195
- {name: "<?php echo $this->__('Back') ?>"},
196
- {name: "<?php echo $this->__('Next') ?>"},
197
- {name: "<?php echo $this->__('Close') ?>"}
198
- ],
199
- autoFocus: true,
200
- closeOnEscape: true,
201
- description: "<?php echo $this->__('The Sender Email, Sender Name, and Reply To settings are what will be used for sending the Review Request emails.') ?>",
202
- id: "bronto_reviews-sender_email",
203
- next: "scope",
204
- position: 10,
205
- title: "<?php echo $this->__('Sender Details') ?>",
206
- width: 200
207
- });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
208
 
209
  <?php if ($this->canShowGuide()): ?>
210
  guiders.show('start');
19
  '</div>'
20
  ) ?>",
21
  id: "start",
22
+ next: "bronto_reviews-settings-enable",
23
  overlay: true, closeOnEscape: true,
24
+ title: "Bronto Extension - <?php echo $this->__('Post-Purchase Emails Module') ?>",
25
  width: 600
26
  });
27
 
28
+ var postPurchaseSettings = {
29
+ settings: {
30
+ label: '<?php echo Mage::helper('bronto_reviews')->getPostLabel('settings'); ?>',
31
+ next: 'bronto_reviews-reorder-enable',
 
 
 
 
 
 
 
 
 
 
 
 
 
 
32
  },
33
+ reorder: {
34
+ label: '<?php echo Mage::helper('bronto_reviews')->getPostLabel('reorder'); ?>',
35
+ next: 'bronto_reviews-caretip-enable'
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
36
  },
37
+ caretip: {
38
+ label: '<?php echo Mage::helper('bronto_reviews')->getPostLabel('caretip'); ?>',
39
+ next: 'scope'
40
+ }
41
+ };
 
 
 
 
42
 
43
+ for (var settingName in postPurchaseSettings) {
44
+ var jsObject= postPurchaseSettings[settingName],
45
+ replaceName = function($name) {
46
+ return $name.replace('Setting Label', jsObject.label);
47
+ },
48
+ replaceId = function($name) {
49
+ return $name.replace('settings', settingName);
50
+ };
51
+ /**
52
+ * Enable the Module
53
+ */
54
+ guiders.createGuider({
55
+ attachTo: replaceId('#bronto_reviews_settings_enabled'),
56
+ buttons: [
57
+ {name: "<?php echo $this->__('Back') ?>"},
58
+ {name: "<?php echo $this->__('Next') ?>", onclick: function() {
59
+ if (jQuery(replaceId('#bronto_reviews_settings_enabled')).val() == '1') {
60
+ guiders.next();
61
+ } else {
62
+ alert("<?php echo $this->__("Don't forget to enable the module.") ?>");
63
+ }
64
+ }},
65
+ {name: "<?php echo $this->__('Close') ?>"}
66
+ ],
67
+ shouldSkip: function() {
68
+ return <?php echo ($this->isDefaultScope()) ? 'false' : 'true'; ?>
69
+ },
70
+ autoFocus: true,
71
+ highlight: replaceId('#bronto_reviews_settings_enabled'),
72
+ description: "<?php echo $this->__("Let's enable the module and expose some more options. Just set `Enable Module` to Yes.") ?>",
73
+ id: replaceId("bronto_reviews-settings-enable"),
74
+ next: replaceId("bronto_reviews-settings-order_status"),
75
+ position: 11,
76
+ overlay: true, closeOnEscape: true,
77
+ title: "<?php echo $this->__('Enable the Module') ?>",
78
+ width: 200
79
+ });
80
 
81
+ /**
82
+ * Save Configuration
83
+ */
84
+ guiders.createGuider({
85
+ attachTo: 'button.save',
86
+ buttons: [
87
+ {name: "<?php echo $this->__('Back') ?>"},
88
+ {name: "<?php echo $this->__('Save Config') ?>", onclick: function() {
89
+ configForm.submit()
90
+ }},
91
+ {name: "<?php echo $this->__('Next') ?>"},
92
+ {name: "<?php echo $this->__('Close') ?>"}
93
+ ],
94
+ shouldSkip: function() {
95
+ return <?php echo ($this->isDefaultScope()) ? 'false' : 'true'; ?>
96
+ },
97
+ autoFocus: true,
98
+ highlight: 'button.save',
99
+ overlay: true, closeOnEscape: true,
100
+ description: "<?php echo $this->__('Now that the initial settings have been configured, you should save them. Click `Save Config` now.') ?>",
101
+ id: replaceId("bronto_reviews-settings-save_config_first"),
102
+ next: replaceId("bronto_reviews-settings-order_status"),
103
+ position: 5,
104
+ title: "<?php echo $this->__('Save Config') ?>"
105
+ });
106
 
107
+ /**
108
+ * Explain the Order Status option
109
+ */
110
+ guiders.createGuider({
111
+ attachTo: replaceId('#bronto_reviews_settings_status'),
112
+ buttons: [
113
+ {name: "<?php echo $this->__('Back') ?>"},
114
+ {name: "<?php echo $this->__('Next') ?>"},
115
+ {name: "<?php echo $this->__('Close') ?>"}
116
+ ],
117
+ autoFocus: true,
118
+ highlight: replaceId('#bronto_reviews_settings_status'),
119
+ description: "<?php echo $this->__("This setting allows you to specify the order status at which to trigger the delivery. When an order reaches this status the system will send a delivery schedule request to Bronto to schedule an email to be sent after a specified number of days.") ?>",
120
+ id: replaceId("bronto_reviews-settings-order_status"),
121
+ next: replaceId("bronto_reviews-settings-cancel_status"),
122
+ position: 11,
123
+ overlay: true, closeOnEscape: true,
124
+ title: "<?php echo $this->__('Order Status') ?>",
125
+ width: 200
126
+ });
127
 
128
+ /**
129
+ * Explain the Cancel Status Option
130
+ */
131
+ guiders.createGuider({
132
+ attachTo: replaceId('#bronto_reviews_settings_cancel_status'),
133
+ buttons: [
134
+ {name: "<?php echo $this->__('Back') ?>"},
135
+ {name: "<?php echo $this->__('Next') ?>"},
136
+ {name: "<?php echo $this->__('Close') ?>"}
137
+ ],
138
+ autoFocus: true,
139
+ highlight: replaceId("#bronto_reviews_settings_cancel_status"),
140
+ description: "<?php echo $this->__('This setting allows you to specify the order status(s) which should cancel the scheduled delivery. You will need to select a status that can be reached after a delivery has been placed, such as if your Order Status is set to `Complete`, your Cancel Delivery Status should be `Closed` as once an order is complete it can only be removed by refunding the order.') ?>",
141
+ id: replaceId("bronto_reviews-settings-cancel_status"),
142
+ next: replaceId("bronto_reviews-settings-period"),
143
+ position: 10,
144
+ overlay: true, closeOnEscape: true,
145
+ title: "<?php echo $this->__('Cancel Order Status') ?>",
146
+ width: 200
147
+ });
148
 
149
+ /**
150
+ * Explain the Send Period Setting
151
+ */
152
+ guiders.createGuider({
153
+ attachTo: replaceId('#bronto_reviews_settings_period'),
154
+ buttons: [
155
+ {name: "<?php echo $this->__('Back') ?>"},
156
+ {name: "<?php echo $this->__('Next') ?>"},
157
+ {name: "<?php echo $this->__('Close') ?>"}
158
+ ],
159
+ autoFocus: true,
160
+ highlight: replaceId("#bronto_reviews_settings_period"),
161
+ description: replaceName("<?php echo $this->__('The Send Period is the number of days to wait before sending the Setting Label email.') ?>"),
162
+ id: replaceId("bronto_reviews-settings-period"),
163
+ next: replaceId("bronto_reviews-settings-adjustment"),
164
+ position: 9,
165
+ overlay: true, closeOnEscape: true,
166
+ title: "<?php echo $this->__('Send Period') ?>",
167
+ width: 200
168
+ });
169
 
170
+ guiders.createGuider({
171
+ attachTo: replaceId('#bronto_reviews_settings_adjustment'),
172
+ buttons: [
173
+ {name: "<?php echo $this->__('Back') ?>"},
174
+ {name: "<?php echo $this->__('Next') ?>"},
175
+ {name: "<?php echo $this->__('Close') ?>"}
176
+ ],
177
+ autoFocus: true,
178
+ highlight: replaceId("#bronto_reviews_settings_adjustment"),
179
+ title: "<?php echo $this->__('Adjustment Period') ?>",
180
+ description: replaceName("<?php echo $this->__('The Adjustment Period is the number of days to adjust the sending period for the Setting Label email.') ?>"),
181
+ id: replaceId('bronto_reviews-settings-adjustment'),
182
+ position: 9,
183
+ next: replaceId("bronto_reviews-settings-message"),
184
+ overlay: true, closeOnEscape: true,
185
+ width: 200
186
+ });
187
+
188
+ /**
189
+ * Explain the Review Request Message
190
+ */
191
+ guiders.createGuider({
192
+ attachTo: replaceId('#bronto_reviews_settings_message'),
193
+ buttons: [
194
+ {name: "<?php echo $this->__('Back') ?>"},
195
+ {name: "<?php echo $this->__('Next') ?>"},
196
+ {name: "<?php echo $this->__('Close') ?>"}
197
+ ],
198
+ autoFocus: true,
199
+ highlight: replaceId("#bronto_reviews_settings_message"),
200
+ description: replaceName("<?php echo $this->__('Select the Bronto Message you want to use to send the Setting Label email.') ?>"),
201
+ id: replaceId("bronto_reviews-settings-message"),
202
+ next: replaceId("bronto_reviews-settings-default_coupon"),
203
+ position: 9,
204
+ overlay: true, closeOnEscape: true,
205
+ title: "<?php echo $this->__('Bronto Message') ?>",
206
+ width: 200
207
+ });
208
+
209
+ guiders.createGuider({
210
+ attachTo: replaceId('#bronto_reviews_settings_default_coupon'),
211
+ buttons: [
212
+ {name: "<?php echo $this->__('Back') ?>"},
213
+ {name: "<?php echo $this->__('Next') ?>"},
214
+ {name: "<?php echo $this->__('Close') ?>"}
215
+ ],
216
+ autoFocus: true,
217
+ highlight: replaceId('#bronto_reviews_settings_default_coupon'),
218
+ title: "<?php echo $this->__('Shopping Cart Price Rule') ?>",
219
+ description: replaceName("<? echo $this->__('The Shopping Cart Price Rule can be placed with the Setting Label message that gets scheduled.') ?>"),
220
+ id: replaceId('bronto_reviews-settings-default_coupon'),
221
+ next: replaceId("bronto_reviews-settings-default_recommendation"),
222
+ position: 9,
223
+ overlay: true, closeOnEscape: true,
224
+ width: 200
225
+ });
226
+
227
+ guiders.createGuider({
228
+ attachTo: replaceId('#bronto_reviews_settings_default_recommendation'),
229
+ buttons: [
230
+ {name: "<?php echo $this->__('Back') ?>"},
231
+ {name: "<?php echo $this->__('Next') ?>"},
232
+ {name: "<?php echo $this->__('Close') ?>"}
233
+ ],
234
+ autoFocus: true,
235
+ highlight: replaceId('#bronto_reviews_settings_default_recommendation'),
236
+ title: "<?php echo $this->__('Product Recommendation') ?>",
237
+ description: replaceName("<? echo $this->__('The Product Recommendation can be placed with the Setting Label message that gets scheduled.') ?>"),
238
+ id: replaceId('bronto_reviews-settings-default_recommendation'),
239
+ next: replaceId("bronto_reviews-settings-default_send_flags"),
240
+ position: 9,
241
+ overlay: true, closeOnEscape: true,
242
+ width: 200
243
+ });
244
+
245
+ /**
246
+ * Explain the Delivery Flags
247
+ */
248
+ guiders.createGuider({
249
+ attachTo: replaceId('#bronto_reviews_settings_default_send_flags'),
250
+ buttons: [
251
+ {name: "<?php echo $this->__('Back') ?>"},
252
+ {name: "<?php echo $this->__('Next') ?>"},
253
+ {name: "<?php echo $this->__('Close') ?>"}
254
+ ],
255
+ autoFocus: true,
256
+ highlight: replaceId("#bronto_reviews_settings_default_send_flags"),
257
+ description: "<?php echo $this->__('The Delivery Flags allows you to add options to the delivery that is scheduled to go out. The options are explained in the comment section.') ?>",
258
+ id: replaceId("bronto_reviews-settings-default_send_flags"),
259
+ next: replaceId("bronto_reviews-settings-sender_email"),
260
+ position: 9,
261
+ overlay: true, closeOnEscape: true,
262
+ title: "<?php echo $this->__('Delivery Flags') ?>",
263
+ width: 200
264
+ });
265
+
266
+ /**
267
+ * Explain the Sender Details
268
+ */
269
+ guiders.createGuider({
270
+ attachTo: replaceId('#bronto_reviews_settings_identity'),
271
+ buttons: [
272
+ {name: "<?php echo $this->__('Back') ?>"},
273
+ {name: "<?php echo $this->__('Next') ?>"},
274
+ {name: "<?php echo $this->__('Close') ?>"}
275
+ ],
276
+ autoFocus: true,
277
+ closeOnEscape: true,
278
+ description: replaceName("<?php echo $this->__('The Sender Email, Sender Name, and Reply To settings are what will be used for sending the Setting Label emails. You can choose from one of the preconfigured store emails.') ?>"),
279
+ id: replaceId("bronto_reviews-settings-sender_email"),
280
+ next: jsObject.next,
281
+ position: 10,
282
+ title: "<?php echo $this->__('Sender Details') ?>",
283
+ width: 200
284
+ });
285
+ }
286
 
287
  <?php if ($this->canShowGuide()): ?>
288
  guiders.show('start');
package.xml CHANGED
@@ -1,7 +1,7 @@
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Bronto_Extension</name>
4
- <version>2.3.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">OSL</license>
7
  <channel>community</channel>
@@ -55,9 +55,9 @@
55
  &lt;p /&gt;Bronto Software provides a cloud-based marketing platform for retailers to drive revenue through their email, mobile and social campaigns. The platform is used by over 1000 organizations worldwide, including Party City, Armani Exchange, Timex, Samsonite and Gander Mountain. Bronto is a Gold Magento Industry Partner and the leading self-service email marketing provider to the Internet Retailer Top 1000. Bronto is headquartered in Durham, NC with an office in London, UK. For more information, visit &lt;a href="http://bronto.com"&gt;bronto.com&lt;/a&gt;.&lt;/p&gt;</description>
56
  <notes>&lt;p /&gt;For installation and configuration instructions, as well as a full list of new features and known issues, please review the &lt;a href="http://a.bron.to/magento"&gt;Implementation Guide&lt;/a&gt;.</notes>
57
  <authors><author><name>Chris Geiss</name><user>BrontoSoftware</user><email>chris.geiss@bronto.com</email></author></authors>
58
- <date>2014-05-16</date>
59
- <time>18:38:36</time>
60
- <contents><target name="magecommunity"><dir name="Bronto"><dir name="Common"><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><file name="About.php" hash="ceee3ef00dcfde90f82ce80a5119ed56"/><dir name="Cron"><file name="Error.php" hash="ccaf02afd320c2a60b271bcf728c723a"/><file name="Queue.php" hash="07a829044a251dbfdcc39fcdd0d643b9"/></dir><file name="Cron.php" hash="ff26632f20d0474d45ae0549634b4f7c"/><dir name="Form"><dir name="Field"><file name="Apitoken.php" hash="48fe102c7d74b7646de1e256f87cfe87"/><file name="Debug.php" hash="6b3e65c774d25184e88c43e7364d68b4"/><file name="Download.php" hash="6521c641550b7c747632fe25dd5982ed"/><file name="Hidden.php" hash="c514ae120d4dced7b92ea30a13f0e4ea"/><file name="Image.php" hash="9de445fac8d262bb023f123d1e4df9e5"/><file name="List.php" hash="907853b5009661b6b63a3a2947fc9c59"/><dir name="Support"><file name="Site.php" hash="9e0b6acae1053a90a7513a3791ee258c"/></dir><file name="Support.php" hash="f680904d05213ec4d43726b714cf2b69"/></dir><file name="Field.php" hash="932af08da6e8dc20e74e97894b1a2518"/><file name="Fieldset.php" hash="a3d41e7bfc09bd81942c6f32bc1d1782"/></dir><file name="Guide.php" hash="2f283c5082306106c6793a53846ce403"/><file name="Support.php" hash="be33bc95f1f713205dd11fb59598e166"/><dir name="Suppressed"><file name="Reset.php" hash="50dfcb14e043c3128ac9c33dc14c2951"/></dir><file name="Suppressed.php" hash="064ad003588f58f65d6b827109ea2d94"/></dir></dir><dir name="Widget"><dir name="Button"><file name="Abstract.php" hash="8c082611a7e4131c897ae9f2ed1d6dcf"/><file name="Debug.php" hash="e841017705d9b45a33e8475144ff0587"/><file name="Download.php" hash="78de702f642111af6feb725b4dd0bf08"/></dir><dir name="Queue"><dir name="Button"><file name="Run.php" hash="d05c28fcd3f1ee0fb031ebb9d4fcfe39"/></dir></dir></dir></dir><file name="Popup.php" hash="37f63a3196ff4e533069753569b83ff6"/></dir><dir name="Helper"><file name="Api.php" hash="aa11d557111359c4310006c41764a4a3"/><file name="Contact.php" hash="261a6f75641e8b523f9732642244e8ce"/><file name="Data.php" hash="1ef11fbb9bf92965d4406b57e3b515cb"/><file name="DataInterface.php" hash="d1691f590c315abd3178e769cf51fe2a"/><file name="Field.php" hash="7c208abd6c77057e1e400f6699be77df"/><file name="Message.php" hash="5484ec49ce8ab8fda12d9dc6c4c29c65"/><file name="Product.php" hash="11775a052258f97fc8456d4fef981c76"/><file name="Salesrule.php" hash="6b7fcccb7b96f27b02ff864e7d9640dd"/><file name="Support.php" hash="c20c3e73c23a70cdaebb61815e2ce33e"/></dir><dir name="Model"><file name="Api.php" hash="72817e825da18d2c88800385cd3c6eca"/><file name="Archive.php" hash="b613e811bb673c72e6cec6770ed48fa5"/><file name="Delivery.php" hash="1c43e226d7c174f655533299bbf15359"/><dir name="Email"><dir name="Template"><file name="Filter.php" hash="243b2d9c62c643d518222f4a8b1f87d5"/><file name="Templatefilter.php" hash="c3acf3b4be3dcce490b1e07c0ab68e38"/></dir><file name="Template.php" hash="3624e7a3cdf1a469af6b5bd8d7e7e41e"/></dir><file name="Error.php" hash="8270252828229cad2c3b35f22e898b4d"/><file name="Keysentry.php" hash="ed1603a0954baaf716219d717e65f5b5"/><file name="List.php" hash="2c8dfbafde292aaff1df9edf83764768"/><dir name="Mysql4"><dir name="Api"><file name="Collection.php" hash="9b589f17c2efee2866369d6fd0c73279"/></dir><file name="Api.php" hash="79e25f0be61ef7ce5066c676545ab19d"/><dir name="Error"><file name="Collection.php" hash="cdd8617db0383a5dd23787850c26bfe3"/></dir><file name="Error.php" hash="2959715e0def582a6a0ecdf6f6442701"/><dir name="Queue"><file name="Collection.php" hash="f01c3c398021de80f48482067aa00f83"/></dir><file name="Queue.php" hash="3cdfeee0097797c9fc5955f4e777b2b5"/></dir><file name="Observer.php" hash="cc2332796caeed955bae5cd57aaf6ada"/><file name="Queue.php" hash="4ba90f26cb73865f2a421cbae77e7b5f"/><dir name="Resource"><file name="Abstract.php" hash="94c055df340089d679a7537318bcae2c"/><file name="Setup.php" hash="ecf628dc377923417762fc5f46374dec"/></dir><file name="SoapClient.php" hash="38ea95b32c1271d3ac329979c4f5d7a0"/><dir name="System"><dir name="Config"><dir name="Backend"><dir name="Cron"><file name="Error.php" hash="38bbbcde58aa89e3f7be043a773feb26"/><file name="Queue.php" hash="4c869a3fcddd597d217f3c3d721ee272"/></dir><file name="Cron.php" hash="1aa481a63198c64fafc90abe93166116"/><file name="Enable.php" hash="2b641958cfa59bd18992a8b92af99301"/><file name="Token.php" hash="b553ffa7c97b9d82c0e2bd389cc64d4f"/></dir><dir name="Source"><dir name="Contact"><file name="Status.php" hash="811a360bffa20b92d4a7bdea66a73168"/></dir><file name="Coupon.php" hash="b567df5b6e6f58681267855ec1399c59"/><dir name="Cron"><file name="Frequency.php" hash="3ef5bda79548019f9a7cb2007c6792f5"/><file name="Minutes.php" hash="136df1bc4c4723efdbe144ed7a08806e"/></dir><file name="Field.php" hash="7a4660fbc812dca134b69b3cef76ea57"/><file name="Image.php" hash="acb902acd1f8573887ed9d5a00410467"/><file name="Limit.php" hash="650092f63a83e7cb3c63d089c52820cd"/><file name="List.php" hash="c9fd7581386bc33c09e0e6edfdead420"/><file name="Message.php" hash="01c7e9d489c1ed7f07f011d5c044805a"/><file name="Related.php" hash="abcdf472699f5857d7755f0423bd27dd"/><file name="Role.php" hash="5a55bad277b8723130035d79d6e5b98b"/><file name="Synclimit.php" hash="40a063f7d2ac5e1ad6a9bfa773b22863"/></dir></dir></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="DebugController.php" hash="475d0fe8b46eb8a85c25d4f511a25196"/><file name="GuidersController.php" hash="8eae4825b247191bd166224ac79ea655"/></dir><file name="LogController.php" hash="c7e65dec2943bb1b0575396290629fdc"/></dir><dir name="etc"><file name="adminhtml.xml" hash="607b20af88d8bcb436ede8cfdbaeca73"/><file name="config.xml" hash="4f9ae15c9696bc76cb9d4826b2597601"/><file name="system.xml" hash="9c317f93497f702f12e07df80f0b1529"/></dir><dir name="sql"><dir name="bronto_common_setup"><file name="mysql4-install-1.7.0.php" hash="c8459d26fdfea2fb9430e8829b3257e1"/><file name="mysql4-install-2.2.1.php" hash="f2a33e687c2a2ee784c63ca9ba58ad5f"/><file name="mysql4-install-2.3.0.php" hash="f0f0313161b5b70ccd9f05d59f8f5e2b"/><file name="mysql4-upgrade-1.7.0-2.2.1.php" hash="f2a33e687c2a2ee784c63ca9ba58ad5f"/><file name="mysql4-upgrade-2.0.4-2.2.1.php" hash="f2a33e687c2a2ee784c63ca9ba58ad5f"/><file name="mysql4-upgrade-2.0.4.2-2.2.1.php" hash="f2a33e687c2a2ee784c63ca9ba58ad5f"/><file name="mysql4-upgrade-2.1.0-2.2.1.php" hash="f2a33e687c2a2ee784c63ca9ba58ad5f"/><file name="mysql4-upgrade-2.2.0-2.2.1.php" hash="f2a33e687c2a2ee784c63ca9ba58ad5f"/><file name="mysql4-upgrade-2.2.2-2.3.0.php" hash="f0b61c65157c4e1a71c775d3eecddca2"/></dir></dir></dir><dir name="Customer"><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><file name="About.php" hash="bc63c93b5ff46fe2e6cb84a8c3249d12"/><file name="Cron.php" hash="418068c27078a2a4e56cdc36469f660b"/><dir name="Form"><dir name="Field"><file name="Rewardpoints.php" hash="c1918f7478737dcfba6b543fa006a4bc"/><file name="Storecredit.php" hash="489625264fff9d5a37621f1b80203099"/></dir><dir name="Fieldset"><dir name="Attributes"><file name="Address.php" hash="7871298d7b7410d5202b436a1f536d7c"/><file name="Customer.php" hash="b0060f6c8c71ec321387aa8071a5c483"/></dir><file name="Attributes.php" hash="0a93bc89eea36b70908ef805a4627d93"/></dir></dir><file name="Suppressed.php" hash="490d859076b067d91edc13eee7b91de8"/></dir></dir><dir name="Widget"><dir name="Button"><file name="Mark.php" hash="0c84d1f0e6ce3867e76d19ac7c451218"/><file name="Reset.php" hash="6dd540765670c2955160365319b9af22"/><file name="Run.php" hash="2b6332568132b633a1ee208e8b555b5a"/><file name="Sync.php" hash="be611c057f18b5da9e31927fc1788365"/></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="528d9a17f2e7dc654eecb5c9b3a92fbc"/></dir><dir name="Model"><dir name="Mysql4"><dir name="Queue"><file name="Collection.php" hash="5564536b725040d0652cba23e13e546e"/></dir><file name="Queue.php" hash="5aff6d99b2f3bf24cd2db7d0586f96ab"/><file name="Setup.php" hash="cb74c44bd42f407925a800fe3996d7a3"/></dir><file name="Observer.php" hash="9add6d23791f0b3ecb09c29def4038d7"/><file name="Queue.php" hash="7851ed2790e205473cf848c63a4f13a8"/><dir name="Resource"><file name="Customer.php" hash="86f081e728c9d9f22e28018406d9f601"/></dir><dir name="System"><dir name="Config"><dir name="Backend"><file name="Brontofield.php" hash="54432d8d5b2aec5395d21d21b9262162"/><file name="Cron.php" hash="44d12cea40d1342ad065bd4aad936193"/><file name="Newfield.php" hash="118d2622277e919e1f316f0713f5a2b7"/></dir></dir></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="CustomerController.php" hash="2d1104ca64e92a3e2afc475fc3792149"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="bb58fa0df1e07c2d88527fed1920ffc2"/><file name="config.xml" hash="e1a4673cdc939b1177c5ee2e8af678f6"/><file name="system.xml" hash="f88edd1bb6e03c332c4e15182d352c3a"/></dir><dir name="sql"><dir name="bronto_customer_setup"><file name="mysql4-install-1.0.0.php" hash="871c225318588b2804a05751bce45e1f"/><file name="mysql4-install-1.0.3.php" hash="79785fb104491dcc4713e55495f24ba0"/><file name="mysql4-upgrade-1.0.0-1.0.1.php" hash="1c00e987c9a1b1da70ad035ccdef194b"/><file name="mysql4-upgrade-1.0.1-1.0.2.php" hash="144999a033695bd72601f1f0e10de5e3"/><file name="mysql4-upgrade-1.0.2-1.0.3.php" hash="6e3c57a1c9272aa4b2d7d051a24ed87f"/></dir></dir></dir><dir name="Email"><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><file name="About.php" hash="ab71e0649d5af1fe64f665ada8895be9"/><file name="Settings.php" hash="59f952e7baeff59ef013a9f39572370e"/><dir name="Templates"><file name="Field.php" hash="0b4d17701e352b6c28cd5262d3cd8e0e"/><file name="Fieldset.php" hash="01fa6905eec117df32519c7e461e05f8"/><file name="Label.php" hash="fed0e19a1dde5592ba2efcc3aa6a2bba"/><file name="Sendtype.php" hash="d93029708ba002781e365cb0215022ce"/></dir><file name="Templates.php" hash="5811fe4b83f7dd5d6f0c7c78314cd31c"/></dir><dir name="Email"><dir name="Import"><file name="Edit.php" hash="32d4219613247ff59a59b5031284159c"/><dir name="Grid"><dir name="Renderer"><file name="Action.php" hash="4227539615a40aa44810dc58f98b0ee8"/></dir></dir><file name="Grid.php" hash="8b4bc3d73c71763ef49f0ebd9ec6899a"/></dir><file name="Import.php" hash="a2f378383faebc5c0fabcd46feb4d7e3"/><dir name="Log"><dir name="Grid"><dir name="Renderer"><file name="Customer.php" hash="ee83b754d1a91920a79918991aa76ca6"/><file name="Fields.php" hash="dc0d7cbd5065382ccf51ff3f84054563"/></dir></dir><file name="Grid.php" hash="591f4aefd4fa2f7b5f53653f0d7780a7"/></dir><file name="Log.php" hash="755439eace3c8e1f5ee3c657562c476d"/><dir name="Template"><dir name="Edit"><file name="Form.php" hash="368b8f78e9f63ba8cf08b274fdad53b3"/></dir><file name="Edit.php" hash="e76c3c82fc3c180041eeeb6251fecbaa"/><dir name="Grid"><dir name="Renderer"><file name="Action.php" hash="543cf476631d073e4de5ec59f1faf5b5"/><file name="Storename.php" hash="c5111a20ed0b3aed0078cecb1ae3d739"/></dir></dir><file name="Grid.php" hash="1b459ceed577ff004f0c2725059da0d5"/></dir><file name="Template.php" hash="ea39c46962381b34377efa05ecbfa075"/></dir></dir></dir></dir><dir name="Helper"><file name="Contact.php" hash="60d8707e923f59ad7af130aa09557be0"/><file name="Data.php" hash="74ebeb479ac05c453d013387e449e306"/><file name="Field.php" hash="fc67415cbe73614fe0bbc29df7f93148"/><file name="Message.php" hash="7f5a80ce2a9a75324f8e5df9b3a318f4"/></dir><dir name="Model"><file name="Log.php" hash="1c9b060a801312c0b929806708a9ac1a"/><file name="Message.php" hash="02bf1f9bef1f4ce1909cc3d5c6331969"/><dir name="Mysql4"><dir name="Log"><file name="Collection.php" hash="0cc3245eea5df5ca8607fc4ca8aabf99"/></dir><file name="Log.php" hash="aef3718e6ea1de42152099aeb444782f"/><dir name="Message"><file name="Collection.php" hash="4ad21710a8a2c403e83dcf40ad6eda22"/></dir><file name="Message.php" hash="f225d9ac332aa3b0fea5ff094a336926"/><dir name="Template"><file name="Collection.php" hash="18afcaa13df2f01598598ad16d06d68a"/></dir><file name="Template.php" hash="496380271268f9f949afb2a2ce1bdbf9"/></dir><file name="Observer.php" hash="cd5b5e10dabdc615d77a99cb695d685c"/><dir name="Resource"><file name="Setup.php" hash="a5ffbf680ca31b236a6b8ce85766d064"/></dir><dir name="System"><dir name="Config"><dir name="Backend"><dir name="Templates"><file name="Field.php" hash="e6f28eb62a469792eb61ca1044aae764"/><file name="Sendtype.php" hash="18dadd39cdf47f6cdc95e168fe2012bc"/></dir><file name="Usebronto.php" hash="d9c1e9b77810c922b058d5f03f03b02e"/></dir><dir name="Source"><dir name="Email"><file name="Template.php" hash="81682056f6ab2a1deac481daea05ec46"/></dir><file name="Sendtype.php" hash="4cc496295bd5b4c2bf71eae9fd87f803"/></dir></dir></dir><dir name="Template"><file name="Import.php" hash="54b58a617a783f66493793a041abef2f"/><file name="Mailer.php" hash="4792fa983cec3d29aca946c393232b3b"/></dir><file name="Template.php" hash="f74e29c0fcc7528488e19f6aa89c57d7"/></dir><dir name="controllers"><dir name="Adminhtml"><dir name="System"><dir name="Email"><file name="LogController.php" hash="471e58f342857be6f023527c0a1d2981"/><file name="TemplateController.php" hash="7c5a78f80098c2b3a26690f72074fe91"/></dir></dir></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="2343ec1b1ac91db90d522cd64e797aa6"/><file name="config.xml" hash="47889f74fb4d8958f5d33b17a930dfd2"/><file name="system.xml" hash="6d44e576659600c2eee39ff95d9987de"/></dir><dir name="sql"><dir name="bronto_email_setup"><file name="mysql4-install-1.0.0.php" hash="516265312ede986c1a35a19b9e5bbfea"/><file name="mysql4-install-1.0.2.php" hash="327ac219e947d608fbf9d3209dd03bab"/><file name="mysql4-install-1.0.5.php" hash="327ac219e947d608fbf9d3209dd03bab"/><file name="mysql4-install-1.0.8.php" hash="b572625c1380dfffe3b089275ac1dc7e"/><file name="mysql4-install-1.1.2.php" hash="2824a3ef8b9308e577c792398598e08c"/><file name="mysql4-install-1.1.7.php" hash="f49bc2913b1c2375499f21f2ac9727cd"/><file name="mysql4-install-1.1.8.php" hash="afa3c83fbfe45fc193a7eda4af6afacb"/><file name="mysql4-install-1.1.9.php" hash="4509540dda05675ee192e0330effddd3"/><file name="mysql4-install-1.2.0.php" hash="153fc8a27833bda06046231eb0293230"/><file name="mysql4-upgrade-1.0.0-1.0.2.php" hash="1f797c3f909d72219ef5d00017b10554"/><file name="mysql4-upgrade-1.0.2-1.0.5.php" hash="f2c83b65500d9df0fd10c2e6721f2bfe"/><file name="mysql4-upgrade-1.0.5-1.0.8.php" hash="cdbda7aa084e51b9b222c56e548462a6"/><file name="mysql4-upgrade-1.0.8-1.1.1.php" hash="f2c83b65500d9df0fd10c2e6721f2bfe"/><file name="mysql4-upgrade-1.1.1-1.1.2.php" hash="53cf783db35699cdc1fee692752fe8de"/><file name="mysql4-upgrade-1.1.2-1.1.7.php" hash="105868a6253471d3eeeea46c7af18aa9"/><file name="mysql4-upgrade-1.1.7-1.1.8.php" hash="0a4abaf8c787bf656e3163489eb5d29e"/><file name="mysql4-upgrade-1.1.8-1.1.9.php" hash="65b7c540763c1817fef6e4eb1ca6cb9b"/><file name="mysql4-upgrade-1.1.9-1.2.0.php" hash="41aa0b0e87d7f3d97388d5d2733defbd"/></dir></dir></dir><dir name="Emailcapture"><dir name="Block"><file name="Emailcapture.php" hash="ee643896bf37e123fdb046f2c3aafd00"/></dir><dir name="Helper"><file name="Data.php" hash="4968f32e599a6fefe7b6876c486264ba"/></dir><dir name="Model"><dir name="Mysql4"><dir name="Queue"><file name="Collection.php" hash="104fe48ab81aa32769c95aae1b4e4988"/></dir><file name="Queue.php" hash="97ad38464595ed8a25aee9148d703e51"/></dir><file name="Observer.php" hash="041d29358d884b6a4444200d3a6e6b00"/><file name="Queue.php" hash="f95570e6972a31e17c9b4eb1d99aad07"/></dir><dir name="controllers"><file name="IndexController.php" hash="2162c4ce867cba627a66ba4c1b549e55"/></dir><dir name="etc"><file name="config.xml" hash="953a38982ad1ad62107558218b78d121"/><file name="system.xml" hash="7f748cfe607ca50519e51f8a9739feef"/></dir><dir name="sql"><dir name="bronto_emailcapture_setup"><file name="mysql4-install-1.0.0.php" hash="ff0cda179382b958d6a566963faae637"/></dir></dir></dir><dir name="News"><dir name="Block"><dir name="Adminhtml"><file name="ItemRender.php" hash="147c1b256abc1a3f0ffc9018d8af713d"/><file name="Redirect.php" hash="0b6928d1529e41c4e2ccc3a415e53bb8"/><dir name="System"><dir name="Config"><file name="About.php" hash="757f06422ff513218a9dfad2ff91cd0d"/><file name="Form.php" hash="853d55a3d7d5e73e87ae09f87f4764b9"/><file name="General.php" hash="8a19eee62442466ff28f23aa782e68c5"/><file name="News.php" hash="4fdda30cd100f4d1b57a74cb38a9b371"/><file name="Releases.php" hash="30f7b23081c69219473326620e6ccd06"/></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="79dd892352cda62c69ede789dcade61a"/></dir><dir name="Model"><file name="Item.php" hash="e3ce20de8f0422dcf00f389f5491e788"/><dir name="Mysql4"><dir name="Item"><file name="Collection.php" hash="6a79699559ffe750643c3f6da90d0280"/></dir><file name="Item.php" hash="bf9fae7b7e2241259dbdbe83623c3e6e"/></dir><file name="Observer.php" hash="236e8cec018d29f50c4aeff1f23f4880"/><dir name="Resource"><file name="Setup.php" hash="cb9d37d047d535b4928b279623283f30"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="AnnouncementController.php" hash="ca98e801e5503b04f4f60286e19edb2e"/></dir><file name="RouteController.php" hash="4819b7cab294e952238e2edb43a73c52"/></dir><dir name="etc"><file name="adminhtml.xml" hash="079a3f745967cc14906151cfcdc2c816"/><file name="config.xml" hash="590d56fb32cdb7460cbff22ab1bffa69"/><file name="system.xml" hash="ecd3a0edd0de407c85bb537a78c2380a"/></dir><dir name="sql"><dir name="bronto_news_setup"><file name="mysql4-install-1.0.0.php" hash="f574c4b2432334d0202d75ef71cb0006"/></dir></dir></dir><dir name="Newsletter"><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><file name="About.php" hash="b5d17d62df37034cd48ea3022e546724"/><file name="Cron.php" hash="4085792ad95b00e5c49a6d9226c6f1c2"/><file name="Suppressed.php" hash="981094eef35a29b7ee10d9ccf395d975"/></dir></dir><dir name="Widget"><dir name="Button"><file name="Mark.php" hash="fc5b7ca0c406b2677b8af8d19539ffa2"/><file name="Reset.php" hash="a2827fc3f6af2b94e1ed3bcc5989b015"/><file name="Run.php" hash="21e4d1c9eb2c882b967c5de6def6a97b"/><file name="Sync.php" hash="89112c7b858e9031050bcba50527b4d7"/></dir></dir></dir><dir name="Checkout"><dir name="Onepage"><file name="Newsletter.php" hash="cc98f4590cf2dfb4cbb584a47e440906"/></dir></dir></dir><dir name="Helper"><file name="Contact.php" hash="bc7ec83130b8614881cf9476b4884bbf"/><file name="Data.php" hash="b34622a3ed7fd6df8277b4079e763697"/></dir><dir name="Model"><dir name="Mysql4"><dir name="Queue"><file name="Collection.php" hash="b9c6858b2045ad66b7c331afba125d19"/></dir><file name="Queue.php" hash="4cf426f02c1e2889b77be9b6a105c91b"/></dir><file name="Observer.php" hash="e39582657491ed6d63d7fb534d6c9e03"/><file name="Queue.php" hash="a9ef5813d95abcd1ee89a0372a0cfeb8"/><dir name="Resource"><file name="Setup.php" hash="1f72a1f56aca455ea0d0289450e9edf5"/></dir><dir name="System"><dir name="Config"><dir name="Backend"><file name="Cron.php" hash="282c40a155af7ea22f646e931fdb6732"/></dir></dir></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="NewsletterController.php" hash="c025c586987c04b029c97cf584296b21"/></dir><file name="IndexController.php" hash="1a0abafaaa208e0d7600e340d0f829ce"/></dir><dir name="etc"><file name="adminhtml.xml" hash="b685d64860bf37a09330bd9f89f5bc3d"/><file name="config.xml" hash="4f33f6124fb207fab0f5b37d97bbfd25"/><file name="system.xml" hash="0df493aaf21c3fce1bfb7a05a18094ec"/></dir><dir name="sql"><dir name="bronto_newsletter_setup"><file name="mysql4-install-1.0.0.php" hash="0f21d5315bbc4c27d0d38f9cf8c99bf3"/><file name="mysql4-install-1.4.0.php" hash="4a779a923947af258688d01143a16362"/><file name="mysql4-install-1.4.4.php" hash="089b40f9419c2fd21af62df207327a20"/><file name="mysql4-install-1.4.5.php" hash="8e97902e5e83992e678ba6144ed130b5"/><file name="mysql4-install-1.4.6.php" hash="74d29bc9655aeafa381ba5dc5f53df69"/><file name="mysql4-install-1.4.7.php" hash="74d29bc9655aeafa381ba5dc5f53df69"/><file name="mysql4-upgrade-1.4.0-1.4.1.php" hash="7eeba27e7b5480c8b502c3805554e2de"/><file name="mysql4-upgrade-1.4.1-1.4.2.php" hash="32f724b99d88e037ade72c8a9f1e0da7"/><file name="mysql4-upgrade-1.4.2-1.4.3.php" hash="63c728bb0cd7fa83bb5536d4500548f4"/><file name="mysql4-upgrade-1.4.3-1.4.4.php" hash="4f08a427c7706ea0988bcdcca6072218"/><file name="mysql4-upgrade-1.4.4-1.4.5.php" hash="c49018730275134d72f0802e1bc4da47"/><file name="mysql4-upgrade-1.4.5-1.4.6.php" hash="7de96310cf9bfe375e3026ed5c934ce2"/><file name="mysql4-upgrade-1.4.6-1.4.7.php" hash="6e40d94220fc0f2305546f7a8d5e754a"/></dir></dir></dir><dir name="Order"><dir name="Block"><dir name="Adminhtml"><dir name="Sales"><dir name="Order"><dir name="View"><dir name="Tab"><file name="Info.php" hash="4caacae5f31c84f898be5798cc85b7b7"/></dir></dir></dir></dir><dir name="System"><dir name="Config"><file name="About.php" hash="332c01d15a8b75f9add5988f35519135"/><file name="Cron.php" hash="62d625df775ca2b81503b1c97c4f7e79"/><file name="Suppressed.php" hash="fd39306031d9b20dc050a69afbd32cd0"/></dir></dir><dir name="Widget"><dir name="Button"><file name="Mark.php" hash="c2364f2b1bf5dd4247562443b6f5744d"/><file name="Reset.php" hash="4d64995d0f43ff3f3829287f8b8780f9"/><file name="Run.php" hash="700e3f9645a9e25e56ae1deb6764bf44"/><file name="Sync.php" hash="2ff1bf077cc56b3620fe87a494d7f770"/></dir></dir></dir><file name="Bta.php" hash="2ec920ce5a6ea57aff16c8d9cf89f7e9"/><file name="Redemption.php" hash="cb6bfc3d06e4f7287c8314f539fce0c5"/></dir><dir name="Helper"><file name="Data.php" hash="2d955b65273e50f9f4e8cb803f56baf1"/></dir><dir name="Model"><dir name="Mysql4"><dir name="Queue"><file name="Collection.php" hash="d041d29b798d10821e041c5b89fb5889"/></dir><file name="Queue.php" hash="2b0ba0993a43cc6856647684ac30add9"/><file name="Setup.php" hash="05b0a2d4806e712410479a3e7c709fd8"/></dir><file name="Observer.php" hash="21a9705ab5d8ac8608cd2d091446a115"/><dir name="Order"><file name="Observer.php" hash="5a05f37813b04968a2274098fdf8b1f7"/></dir><file name="Queue.php" hash="7cd8b2d37481d42e6450bd1f7baf491d"/><dir name="Quote"><file name="Observer.php" hash="1633b1031f19bdd36145b1040d9d6692"/></dir><dir name="System"><dir name="Config"><dir name="Backend"><file name="Cron.php" hash="9bc2a90d644af8334aa22b952132b08f"/></dir><dir name="Source"><file name="Bulk.php" hash="77b7aa28a1e7912c2a23b45155a46623"/><file name="Description.php" hash="7f497c17388c360f239e2aa90d943b9c"/><file name="Price.php" hash="283cc883ded57664870d89b22b547b19"/></dir></dir></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="OrderController.php" hash="ade912efc4d727f6648eed6b4e08af5f"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="784d322d920c63e63bed37c50e1c04d1"/><file name="config.xml" hash="278545fed031c2d6946ff4f539cbc607"/><file name="system.xml" hash="25c18e993bc8e35234a801dd7893e462"/></dir><dir name="sql"><dir name="bronto_order_setup"><file name="mysql4-install-1.0.0.php" hash="4988c452cc0d367f34e9c33df0d4256d"/><file name="mysql4-install-1.1.8.php" hash="afd415c7bb5a81b18c6705293f3978e6"/><file name="mysql4-upgrade-1.0.0-1.1.6.php" hash="0c42c6e3539b0f07c76b4f2c582d110f"/><file name="mysql4-upgrade-1.1.6-1.1.7.php" hash="7c4d2c1feed28b964ea82373e625a11f"/><file name="mysql4-upgrade-1.1.7-1.1.8.php" hash="ae58d4271deb9c60e61214020d46e755"/></dir></dir></dir><dir name="Product"><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><file name="About.php" hash="f3e3d3f6bca7f3b065e25f22b5578d2e"/><file name="Cron.php" hash="53c81d5081e3d4204694c468eff18c39"/><file name="Information.php" hash="cc968073e785221272c6f924e7105036"/></dir><dir name="Recommendation"><file name="Default.php" hash="907b566bfb4bbe4e1c46749182556d77"/><dir name="Edit"><file name="Button.php" hash="d6685785f649dde452fca3a18c78530d"/><file name="Form.php" hash="df406a3476a3e27a4f7a5467d653047c"/></dir><file name="Edit.php" hash="87c571a236297ce4d9b6e692a4ffa852"/><dir name="Grid"><dir name="Renderer"><file name="Action.php" hash="486077c93f6a3b2dd076bd3c9e7d529c"/><file name="Description.php" hash="2eeb64ad510ac9d4cdbb5edf99211b82"/><file name="Image.php" hash="122e3ae80a3a4c260d09374476174c84"/><file name="Price.php" hash="c4af2d40e24f895bba7681851ec8aec2"/><file name="Url.php" hash="b03b06cf5eea764706db123a4b55aefc"/></dir></dir><file name="Grid.php" hash="61938cdc68e52840cf387c512db5e8e2"/><dir name="Message"><file name="Form.php" hash="81f6f8f259e940a82f6626c2b74e89ca"/></dir><dir name="Preview"><file name="Form.php" hash="4c24d8207c53bca40dd7760c2402d9c6"/><file name="Grid.php" hash="677ea4391f5964aef2dbd83d06222540"/><file name="GridElement.php" hash="251201019431ab9596778b0290c71395"/></dir><file name="Preview.php" hash="abc472e9d896a6f417b2ffaa735ce373"/><dir name="Selected"><file name="Grid.php" hash="843022c5636af8e962503e53479f15c0"/><file name="Js.php" hash="dba81b98bd95dbebd22709efc1a3655c"/></dir></dir><file name="Recommendation.php" hash="121626c24b44ad88a918db07f97cfa66"/></dir><dir name="Widget"><dir name="Button"><file name="Run.php" hash="fe948d6a6a08f2876eeccd7db0c3a8b5"/></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="da0200909240213fc5bd3dda00550e49"/></dir><dir name="Model"><dir name="Collect"><file name="Abstract.php" hash="3d90b952ceff07557ad01cee2f916742"/><file name="Bestseller.php" hash="c043c64244b20b33408959d68518cde6"/><file name="Crosssell.php" hash="3479888fc18d4160ee7695ac5fd4face"/><file name="Custom.php" hash="56dec8c92a649396b8685183fdf1c1a6"/><file name="Mostviewed.php" hash="50d58b2678da7259a0bd47ad048afad7"/><file name="New.php" hash="da42c2190202e931a46f9730398b42fe"/><file name="Recentlyviewed.php" hash="2e5c66216ccd815a9a90e33994cc0f9a"/><file name="Related.php" hash="bed15693d124080b58efe577517f7815"/><file name="Upsell.php" hash="ccb8944985ce0b4adfed2bcdda4c8556"/></dir><file name="Collect.php" hash="57c270f1ccd7c7887639d9932a24ad8b"/><file name="Content.php" hash="da798d9df324c6919460983f8c2e378b"/><file name="Filter.php" hash="b52b98c7cd452bfdc779b70deb09eafa"/><dir name="Mysql4"><dir name="Recommendation"><file name="Collection.php" hash="92ae6f624c68d971439d16c79e3e1d08"/></dir><file name="Recommendation.php" hash="e99ebd40f8c942a33b743ad276db23c7"/></dir><file name="Observer.php" hash="de5635441fa96dc582b909fb96cee16e"/><file name="Recommendation.php" hash="6f2759720e14b5f161d1262982e3e22f"/><dir name="Resource"><file name="Setup.php" hash="bd46110dbb737e76364c9523660d093a"/></dir><dir name="System"><dir name="Config"><file name="Cron.php" hash="df7c9a3ff5318013f9afa0148d41fe84"/><dir name="Source"><file name="Recommendation.php" hash="479472b2ed049a745c12c6f499f13cc9"/></dir></dir></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="RecommendationsController.php" hash="8edc3dce0f442bb9e8819e003f5838fa"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="e8eeed8f3589872c7e6e374557cfc613"/><file name="config.xml" hash="2de8b3eed46840c36bac9340bb81b877"/><file name="system.xml" hash="eab93fdc971f74689d4f51a945db9ac8"/></dir><dir name="sql"><dir name="bronto_product_setup"><file name="mysql4-install-1.0.0.php" hash="d04672913acece60326290535f677514"/></dir></dir></dir><dir name="Reminder"><dir name="Block"><dir name="Adminhtml"><dir name="Delivery"><dir name="Grid"><dir name="Renderer"><file name="Customer.php" hash="be1537b58943a2cc27982deb03ec9e39"/><file name="Fields.php" hash="04f0dc7c4a24769cfc68f1508e0d338b"/></dir></dir><file name="Grid.php" hash="472fa8302dae712fbf9a6b6f5ea80dd0"/></dir><file name="Delivery.php" hash="b0bd1dcede57f8dad8ba4416b26d3986"/><dir name="Promo"><file name="Notice.php" hash="437ce674b25c14e33e17e09a0d471176"/></dir><dir name="Reminder"><dir name="Edit"><file name="Form.php" hash="2db520c0f438affbf477801ddde7f9cf"/><dir name="Tab"><file name="Bronto.php" hash="3b49a4f78038b8ac6de5390c2a73151d"/><file name="Conditions.php" hash="71d7c0a13352ec3d5b19b6bc059238bb"/><file name="Customers.php" hash="2ba680131f4b31175c7425c0648c6807"/><file name="General.php" hash="eb05a598a2eafd88d2a199c286b11836"/></dir><file name="Tabs.php" hash="106e44febc4b6a7a3928c5dec68d6123"/></dir><file name="Edit.php" hash="783ca6f21744c56da930fd44ddc6e3a5"/><file name="Grid.php" hash="c87a852ef998ea17af709c0221abd15d"/></dir><file name="Reminder.php" hash="a55e63b29f9cafd9053696f60ffe993f"/><dir name="System"><dir name="Config"><file name="About.php" hash="8380b5e750fe0f2b5b95407c99d2e195"/><file name="Cron.php" hash="84100d0bffc2e16d84bc24577ba9c6bf"/><file name="Settings.php" hash="5d0042b1b2ad5df43856c0a68d63b3b4"/></dir></dir><dir name="Widget"><dir name="Grid"><dir name="Column"><dir name="Renderer"><file name="Email.php" hash="bcc3abd5bbbb5e8f6e19454850d2e8dd"/><file name="Id.php" hash="c35c0feeac92dce912bb8e3ad2cc7e6e"/></dir></dir></dir></dir></dir></dir><dir name="Helper"><file name="Contact.php" hash="4b3e67cf3a0ce095ca454fe4513c6e89"/><file name="Data.php" hash="b0ffcbf133cfeb61b93218f1846d6c34"/><file name="Message.php" hash="b65f0a4095ab4671c57a26451b3cc524"/></dir><dir name="Model"><dir name="Condition"><file name="Abstract.php" hash="3e164c6f67c1ca26c0be533cd9fc1b0c"/><dir name="Combine"><file name="Abstract.php" hash="2a43ca00f8bc4ab36bc87654ad9c6191"/></dir></dir><file name="Delivery.php" hash="41c3912dc5b5cb28d828358c1e0f7bc4"/><dir name="Email"><file name="Message.php" hash="41a2e2068a8452d624df1b2e9343be2a"/></dir><dir name="Mysql4"><dir name="Customer"><file name="Collection.php" hash="577bd12e2df9940fe551fe41c96133cf"/></dir><dir name="Delivery"><file name="Collection.php" hash="1247c3f58061d41f66ee6b9483c200ca"/></dir><file name="Delivery.php" hash="3639d2739b29734ba8aa8950e67e9621"/><dir name="Rule"><file name="Collection.php" hash="a99264c81d15780f305b02cde1564461"/></dir><file name="Rule.php" hash="763fd5d432897ae6e8fbb26891fb2c22"/></dir><file name="Observer.php" hash="299bca8979d361a027fe4ac1598df2f4"/><dir name="Resource"><file name="Setup.php" hash="fa36f813f36534194c7ee1d75206d403"/></dir><dir name="Rule"><dir name="Condition"><dir name="Cart"><file name="Amount.php" hash="b1bd2bd9aabb863184461b0594dad9b0"/><file name="Attributes.php" hash="74cfde1032d8d75241f7522ddc12e11d"/><file name="Combine.php" hash="660f6842b8c1a5acff2c3b4f12fc73a9"/><file name="Couponcode.php" hash="84ef3ecb8bcd57412af80a0d137335bb"/><file name="Itemsquantity.php" hash="50eae47f28bf3660ee0684c9037f5bf8"/><file name="Sku.php" hash="12a7af32e16e21d2a2e4e157c469d1e5"/><file name="Storeview.php" hash="c2310efcb3060e91bf2aab73b0ac8ca9"/><file name="Subcombine.php" hash="c8ad5b2c46116793e2f2df17fe0862c0"/><file name="Subselection.php" hash="0142065f76b4e24ec75b6685eea82642"/><file name="Totalquantity.php" hash="8e492fb70a94549b8d6adbc50b2a4e50"/><file name="Virtual.php" hash="cd12a3218daf4a447b4fd49141101305"/></dir><file name="Cart.php" hash="4d534abf3f1cf1459fe6713788efe66e"/><dir name="Combine"><file name="Root.php" hash="eb4b22b6554b507b61f3e6be30048b07"/></dir><file name="Combine.php" hash="2f15f1241aa71fd76bb511415c6882a3"/><dir name="Wishlist"><file name="Attributes.php" hash="0ecf162a2fc4225ce37de714da9e6210"/><file name="Combine.php" hash="279af17bec3eeb6a97243a93eb4e3f85"/><file name="Quantity.php" hash="8de8793029340cb8c813e0cf034f372d"/><file name="Sharing.php" hash="ad302122deb2065aa28b68748cfae492"/><file name="Storeview.php" hash="83716681ba30c6d4c48dada3a0973971"/><file name="Subcombine.php" hash="4804ad602e3cc622dbfcab4030dff1c2"/><file name="Subselection.php" hash="68d96f6943becdc728f2aa436a8ac4c7"/></dir><file name="Wishlist.php" hash="f5c474dd7b126d69a3e0f7000abd3a95"/></dir></dir><file name="Rule.php" hash="653b47dcae586823c45815d62e97319c"/><dir name="System"><dir name="Config"><dir name="Backend"><file name="Allowsend.php" hash="61965e981ddd79976f0ee21b01e6a0ae"/><file name="Cron.php" hash="6e527885884985fca33236f40a7f3689"/></dir></dir></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="DeliveryController.php" hash="d4630eff20209e0d46b08a29b543979a"/><file name="RemindersController.php" hash="6cd60b0a9c33075640c5926d94a78405"/></dir><file name="LoadController.php" hash="dd5736d47443d0a241d97073dee3080f"/></dir><dir name="etc"><file name="adminhtml.xml" hash="baaae901f8ff9d2ab12b0158ed5a4ca7"/><file name="config.xml" hash="74b586ae283834ff1275f1c0cb6959f3"/><file name="system.xml" hash="794fa3826fa84526997e4f8c3ef2e4ef"/></dir><dir name="sql"><dir name="bronto_reminder_setup"><file name="mysql4-install-1.4.12.php" hash="eae3eb4a69de44df200c52001783a4f0"/><file name="mysql4-install-1.4.13.php" hash="12419b6117a9e0e10f565453feed8740"/><file name="mysql4-install-1.4.14.php" hash="be67c1c55e1781c652d0036984fd0866"/><file name="mysql4-install-1.4.15.php" hash="f2bc98906fc36bf0640b292851ab99e1"/><file name="mysql4-install-1.4.16.php" hash="e34c42b202a7435abe2fa46f01bde257"/><file name="mysql4-install-1.4.17.php" hash="26c94634150797a07af197a4a81f45f8"/><file name="mysql4-install-1.4.2.php" hash="07b5a7b8ef247def75617e92738f0950"/><file name="mysql4-upgrade-1.4.0-1.4.2.php" hash="fefa638ca0ed7c5bc80a1b67e27c8703"/><file name="mysql4-upgrade-1.4.10-1.4.11.php" hash="130a688eb03e4f476308d0d11c32141a"/><file name="mysql4-upgrade-1.4.11-1.4.12.php" hash="766c901369f06aaadc8ffde3befb4aaa"/><file name="mysql4-upgrade-1.4.12-1.4.13.php" hash="172b48942497efd2305eff260bc28d9c"/><file name="mysql4-upgrade-1.4.13-1.4.14.php" hash="3218dae864cac00ff74655160ad31663"/><file name="mysql4-upgrade-1.4.14-1.4.15.php" hash="2e842e4c18259590cdafd2139dd4eb7e"/><file name="mysql4-upgrade-1.4.15-1.4.16.php" hash="671f39e2f90faf1165d50b517be8e04f"/><file name="mysql4-upgrade-1.4.16-1.4.17.php" hash="d789e8fbb7e9dad163643b7b7d2f37b1"/><file name="mysql4-upgrade-1.4.2-1.4.9.php" hash="4692060e7c938aea129c53619f0b3c19"/><file name="mysql4-upgrade-1.4.9-1.4.10.php" hash="9698883135211d54a3c711fead02c187"/></dir><dir name="reference"><file name="saveMatchedCustomers.sql" hash="c4f32ee8be31f7a652369c148271a6c7"/></dir></dir></dir><dir name="Reviews"><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><file name="About.php" hash="b62835e11224c3e8cb7256715d145814"/></dir></dir></dir></dir><dir name="Helper"><file name="Contact.php" hash="a85da1e1cc10dd48ac88b84d91cb9a1d"/><file name="Data.php" hash="c015948fe8ed710617dc652edffa44f9"/><file name="Message.php" hash="df3015f886b4dd283d280cf26ee69cc7"/></dir><dir name="Model"><file name="Message.php" hash="79db458ac23eeb818df57eb828ed1cb5"/><dir name="Mysql4"><dir name="Queue"><file name="Collection.php" hash="c36aecae4ebb1de05835be6c02cd6875"/></dir><file name="Queue.php" hash="52ecc7632d642c9ee3fec1141aba9c30"/></dir><file name="Observer.php" hash="3e443daa54a2052aa7b961a4ce0a2e7a"/><file name="Queue.php" hash="68364c793035e9e6a97ce5969250c3fe"/><dir name="System"><dir name="Config"><dir name="Source"><file name="Message.php" hash="9a5e15326017cbebd7b59b5c80693685"/><file name="Orderstatus.php" hash="4c9719d14ceee3cb5261cbaca132270f"/></dir></dir></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="35bed0690cd9f58063c0c5e03e057469"/><file name="config.xml" hash="77fe8f2486ae74b11ac75f8101a8a554"/><file name="system.xml" hash="762839d4e2dd61b00619eb895147b976"/></dir><dir name="sql"><dir name="bronto_reviews_setup"><file name="mysql4-install-0.0.1.php" hash="7c405d3819f5c79ec405dc372ee38dc5"/></dir></dir></dir><dir name="Verify"><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><file name="About.php" hash="b50a08cd24985483cad82c76305da5ce"/><dir name="Advanced"><file name="Observersearch.php" hash="0351378eb6fbfa8e9b1cde55a9b589e5"/></dir><file name="Conflictchecker.php" hash="cf1736b689d1ef2b3f0b7d7d84b703ba"/><dir name="Form"><dir name="Field"><file name="Apitoken.php" hash="cb84fee5b4e18ca0092f385d6ede6711"/><file name="Button.php" hash="7041c0e923d9929796597160679bc94c"/><file name="Classpath.php" hash="c9c60b09c180960dd107d74f79b63edc"/><file name="Conflict.php" hash="3797f7f88329ecf4d5c9e3e48c9c89e5"/><file name="Events.php" hash="c88df55f9105d0aa5a1574bc37c5a8f8"/><file name="Index.php" hash="612cf825df2f10c0d4d00ac54f413aba"/><file name="Roundtrip.php" hash="4b84fb21a59f5939ab7361dcc816ce1d"/></dir><file name="Magecron.php" hash="109e8427d968973ec3d4b0e5de6e4064"/><file name="Permission.php" hash="e5185de6bc1976ee7497956cc9162a17"/></dir><file name="Installs.php" hash="961665a9ceea68e9165fece4150fdfdb"/><file name="Permissionchecker.php" hash="6f0be4f5594afe1f6924b839db582180"/></dir></dir><dir name="Widget"><dir name="Button"><file name="Classpath.php" hash="1687def566fccc786c263d94b4c9c9b5"/><file name="Conflict.php" hash="473cda5cc65b9302efb3618c3b5af973"/><file name="Events.php" hash="3da5bc0026613dfd921a25a942fb3d7c"/><file name="Permissions.php" hash="b89e87e9b6848cde87a4f6343b3feb1a"/><file name="Runroundtrip.php" hash="5a98f930b382a7a0c01f3b346def4955"/><file name="Runtoken.php" hash="63a721c0a25bdbd58be941ba7c5d21c8"/></dir></dir></dir><file name="Conflictprinter.php" hash="05a32eca413a0eda87bcdb7bd0661642"/><file name="Permissionprinter.php" hash="8925da12d1e8dc5f180327dd94d18310"/></dir><dir name="Helper"><file name="Apitoken.php" hash="bc1f30a551a958011fbba91310cab77d"/><file name="Conflictchecker.php" hash="55e0aacf4cd6e9d2b4d52ebe21fe7850"/><file name="Data.php" hash="6622f73bf7af3e1e68ad27551fb7d920"/><file name="Permissionchecker.php" hash="da5fc3a69e6477299084d210aaaad6b7"/><file name="Roundtrip.php" hash="b5566d978e4e24cf06bee83ab92772fc"/></dir><dir name="Model"><dir name="Config"><file name="Blocks.php" hash="0000df779f3e1fb60350b14b8a6185e3"/><file name="Checker.php" hash="a38555d682b302967410b73ebab04b4f"/><file name="ConfigAbstract.php" hash="79024697562751ff46c939d9d680fc86"/><file name="ConfigInterface.php" hash="45cecfde48e4ef0657a6418019f02e4a"/><file name="Datastore.php" hash="fb5ea494075ce81380d1447c07fa052c"/><file name="Helpers.php" hash="1dc143d542d3fd85ccff785f913556f1"/><file name="Models.php" hash="3062f1f3c4950d965054afe6b75b4b0f"/><file name="Printer.php" hash="dfd6bfdcc94a1afb83ae6c3599abb21c"/><file name="Resources.php" hash="24bbf7de88b25250a81a2d7380d5baa2"/></dir><dir name="Contact"><file name="Builder.php" hash="9d578480a7e4c8fde2a33e698a9efced"/></dir><dir name="Core"><dir name="Config"><file name="Base.php" hash="c11b6cbaf1802d3c6ab58853b468f5d7"/><file name="Element.php" hash="8a7c9221a95c1317a8ae166e692a4ee0"/></dir><file name="Config.php" hash="91877cb5fb11c545f4c0b2069e1407b0"/></dir><dir name="Lib"><dir name="Varien"><dir name="Simplexml"><file name="Config.php" hash="076958ed612323869d2437872744ed2a"/><file name="Element.php" hash="a8c28fd3b6b00ad689d4850e79441dec"/></dir></dir></dir><dir name="Mysql4"><dir name="Core"><file name="Config.php" hash="3b8fb36a66a675c4d12926bceadb4ea5"/></dir></dir><dir name="Path"><dir name="Locator"><file name="Array.php" hash="42fd6c7004b0f02f954956563edde9a0"/><file name="Factory.php" hash="46007808ba897fa6816fb7771a2b18dd"/><file name="IteratorAbstract.php" hash="1debe4adc34aa5d60a94328fd67032da"/><file name="LocatorInterface.php" hash="b775ce0d189ef276c9bbeade7da67b4f"/><file name="Stack.php" hash="328481c9d963f653a95f333fb440bea5"/></dir></dir><dir name="Resource"><dir name="Core"><file name="Config.php" hash="aa2fb8c4fb153e742c690ab8bc8b5a75"/></dir><dir name="Db"><file name="Abstract.php" hash="d668c24c90f80bc197c83eb0a3e10aa6"/></dir></dir><file name="Roundtrip.php" hash="f2166b39afed3e32de4e03cfa3416ff6"/><dir name="System"><dir name="Config"><dir name="Backend"><file name="Magecron.php" hash="ba8b8f5ef43bed77ed03dba3e98df1df"/></dir><dir name="Source"><file name="Classtypes.php" hash="772cab11a7470a2dd68ece3688c68d6a"/><file name="Wsdlcache.php" hash="b7d9c1c4d271c03a7486fc86eec3b6d9"/></dir></dir></dir><dir name="Validator"><file name="Checker.php" hash="35799249fcc93b31ff12da539cfb0d84"/><file name="Directory.php" hash="aa05ae40ad0b7aaffffaa6063bd8561e"/><file name="File.php" hash="c29c1cd2140186dc67c5e62064b79c0f"/><dir name="Filter"><file name="PatternIterator.php" hash="c129a6ee0fb4a45ff52644da2c0abfa1"/></dir><file name="Group.php" hash="59ad6dd4232ee113e1fe8161a82148ba"/><file name="Owner.php" hash="69e1c54dca88532208ce1f35f4491d99"/><file name="Printer.php" hash="23a00ec415b8665e5457ac09939e2ab2"/><file name="ValidatorAbstract.php" hash="d043c743309f5d64640698953269ece6"/><file name="ValidatorInterface.php" hash="02f543af08eda65263f4b005f3b3bdaf"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="AdvancedController.php" hash="0942ed5d83442e97af40d4572c3e21f8"/><file name="ApitokenController.php" hash="f804594b22260cb597cc0e5cfe633093"/><file name="ConflictcheckerController.php" hash="1d23621c640eecf2a813121cfc23850b"/><file name="PermissioncheckerController.php" hash="2e254bd755cd9d05d7eb6865a2ffb0e7"/><file name="RoundtripController.php" hash="efb601f3ceca89885d031f06218b2a4d"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="d7aa2c1c8fa26ad3ab910940abd9199e"/><file name="config.xml" hash="a4e251c636842385f7e9e9a1370ed8b5"/><file name="system.xml" hash="855eb0390cb0a198236cba9383749d54"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Bronto_All.xml" hash="5a9c06b6313882589765b9bcf0402bbb"/><file name="Bronto_Customer.xml" hash="a11c20f008ee2eae14baa3b549d5adee"/><file name="Bronto_Email.xml" hash="b7cdca4b15753edcefe8b9e0abb780bd"/><file name="Bronto_Newsletter.xml" hash="2115c5225e02ab5d4e56749cc5eff6ad"/><file name="Bronto_Order.xml" hash="63f1537add6088417945657bec98ffe9"/><file name="Bronto_Reminder.xml" hash="08503ab78994178b822ef9b0add243f9"/><file name="Bronto_Verify.xml" hash="ad72ea2ebfd99dbe2773b2735d0ec973"/><file name="Bronto_News.xml" hash="3496cd7578991889909fbd8daa170d2d"/><file name="Bronto_Reviews.xml" hash="23a398c055d062c4a5e19e72a0c2df95"/><file name="Bronto_Product.xml" hash="2805533fff08aef167af474799bd4faf"/><file name="Bronto_Emailcapture.xml" hash="98b59bbf388d6c715f345b8906bd2fa1"/></dir></target><target name="magelib"><dir name="Bronto"><dir name="Api"><dir name="Account"><file name="Exception.php" hash="1a851457b2a032fb6d149fe9ef111c57"/><file name="Row.php" hash="3ab1e97019ef87bcd464eeaabf652886"/></dir><file name="Account.php" hash="33b9ba8867fe69135391c26f98b5852a"/><dir name="Activity"><file name="Exception.php" hash="3ac1f2caea6465931cbf927f1033ec06"/><file name="Row.php" hash="de166130c57670bf486a783a4501e2d4"/></dir><file name="Activity.php" hash="f5f48488e40507bc108b35c599e4e5a2"/><dir name="ApiToken"><file name="Exception.php" hash="e06d0a4c9469da7333e6a596e9c37c5d"/><file name="Row.php" hash="f3742811cec1cbf0be583296b617dfbd"/></dir><file name="ApiToken.php" hash="65bbd18974bbbf620dc2df23bdeb4469"/><dir name="Contact"><file name="Exception.php" hash="809bdce6db3bb9c72a3173bb08c1b19e"/><file name="Row.php" hash="2e360d131c2abe19e154b5f3795a58f0"/></dir><file name="Contact.php" hash="55bab8398154e96db6b0ca3ed88718e0"/><dir name="ContentTag"><file name="Exception.php" hash="5a8bc58af480a574e8061c62ad5590b4"/><file name="Row.php" hash="e470d8bcd686d42a886e59d5184b5eed"/></dir><file name="ContentTag.php" hash="14f1cbefe1027338d28db301a1c2df3d"/><dir name="Conversion"><file name="Exception.php" hash="73dd991a663b99050428f54fc13fb433"/><file name="Row.php" hash="115d01ea0e0e6ade42fcab76dff71c35"/></dir><file name="Conversion.php" hash="60ec52dcfeda92294d1ab10bb29a486a"/><dir name="Delivery"><file name="Exception.php" hash="003dbb49ea3be65fe35dfa9b7ec743c5"/><file name="Recipient.php" hash="562bdc8d86b92ec293a338fdd7bf928a"/><file name="Row.php" hash="9c6149e74a305f62b9806df5a20e6a00"/></dir><file name="Delivery.php" hash="668dc6493cefe960c7dc8fe1fe87bf08"/><dir name="DeliveryGroup"><file name="Exception.php" hash="9291b2adb576a6781a0d624cc3288453"/><file name="Row.php" hash="29adb1f866cf1d24ef0abac19f95fbd0"/></dir><file name="DeliveryGroup.php" hash="7dd295b65f22e65dff3bf45c4336e985"/><file name="Exception.php" hash="bacb7c782ef7f612edaf3d39c20118ef"/><dir name="Field"><file name="Exception.php" hash="db651b9fa4b5161e3a32af49cc12cc64"/><file name="Predefined.php" hash="15fadb32175098d9ded60550d1748a4a"/><file name="Row.php" hash="6871d05f399a8a9dfa0742952eaa6481"/><file name="TypeGuesser.php" hash="1027ea97675a16cc964aa0d8ba63e642"/></dir><file name="Field.php" hash="32d5876335ec815acb50d3b4e7bf3ccd"/><dir name="List"><file name="Exception.php" hash="0f964fac998c89a0d4d515979bd81b98"/><file name="Row.php" hash="6516df43a1a94beee7b57fae71c27134"/></dir><file name="List.php" hash="ef240fe5e1422479a83291ad30b468ac"/><dir name="Login"><file name="ContactInformation.php" hash="bc1ce7f57c67fa21cd0881d0384a1cac"/><file name="Exception.php" hash="fff7546235b416b7008a9e4bd646fc19"/><file name="Row.php" hash="578553fcbf1941d0eb5890614c57ae91"/></dir><file name="Login.php" hash="a61cf5ac4c3ea76b03a71750e085df88"/><dir name="Message"><file name="Exception.php" hash="755f7f14cdb234931708968ac0bad4a4"/><file name="Row.php" hash="5732b5550c8c6444790f2f20e626ff08"/></dir><file name="Message.php" hash="cc3c9939757371ad7fd2d297df394621"/><dir name="MessageRule"><file name="Exception.php" hash="b0398ee96ed70c483f38b50f305e82a8"/><file name="Row.php" hash="8e7532184ee265a927a195ac36e5a518"/></dir><file name="MessageRule.php" hash="ae1b3f16683656066a83bcf9f2863710"/><file name="Object.php" hash="4ea2880431ac5761cbf7478d809577f6"/><dir name="Order"><file name="Exception.php" hash="8312e1a1ab46bcf88b72983bb11a6493"/><file name="Product.php" hash="3785f2f460fec6c18c6164176de52449"/><file name="Row.php" hash="1400de022188806bb94e98544c054ef6"/></dir><file name="Order.php" hash="ad690b37bc577879020d10e5ac70ef3d"/><dir name="Row"><file name="Exception.php" hash="4c1a45512e0912644f94a88d4298d3a9"/></dir><file name="Row.php" hash="259418b11987939378747a9c46fae1ae"/><dir name="Rowset"><file name="Exception.php" hash="b5202ed6f61bfe06b90f73c03ca28ffa"/><file name="Iterator.php" hash="9ea7a244b83e7b9318bfe8ed371a149f"/></dir><file name="Rowset.php" hash="3f40382933e2f392b6320fd79db720cd"/><dir name="Segment"><file name="Exception.php" hash="bd5c2302ef222ff55981cc38477a9310"/><file name="Row.php" hash="b840493b8b2c3cb6686de0e5bedfa2ba"/></dir><file name="Segment.php" hash="0cf99babff6169afa427f302c76023dd"/></dir><file name="Api.php" hash="17aace21dbebcab84a80091230ca03e9"/><file name="Observer.php" hash="21bc70d405fcd47b0473ac89fd3d4ae2"/><file name="SoapClient.php" hash="81dd0a8a8c15ac96280d2f1b6bb3311e"/><dir name="Util"><file name="Colors.php" hash="14313213b3a70c79a56c574523b9b90b"/><file name="CountryCodes.php" hash="4efb9c354d29a901368c46aab40f79d4"/><dir name="Retryer"><file name="FileRetryer.php" hash="bdc72ace54ace32081115442d28cb972"/><file name="RetryerException.php" hash="54b70d7abbc32b55649a193e8e70dcb5"/><file name="RetryerInterface.php" hash="cc57d5a02a55811a13a31ed9beff126f"/></dir><file name="Uuid.php" hash="ba62bdec6488ccb621e0bfd726c6107a"/></dir></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="base"><dir name="default"><dir name="bronto"><file name="bronto.css" hash="ebc2f1ade554e3cad4bf0b091ff674d1"/><file name="cron.css" hash="99b49b9ec245e75b81e62e78605f106f"/><dir name="images"><file name="BrontoGuide.png" hash="be2bb3605cc5f1899ad996fcd2ceae84"/><file name="InstallStatusDisabled.png" hash="5cf8d7dd8ed623f8b38e6ea3ed89861a"/><file name="InstallStatusEnabled.png" hash="11ea6d1f0ba319b62ed1728e9b747108"/><file name="InstallStatusError.png" hash="91fdd0af3ffd20d0b8a77645bb9cfcdc"/><file name="ajax-loader-tr.gif" hash="1ae32bc8232ff2527c627e5b38eb319a"/><file name="bg_notifications.gif" hash="df73b8aa7e48bb56e0a644245aa3683f"/><file name="bronto-mini-off.png" hash="af2c6a5434604db0bb3a2cc4a51b5c77"/><file name="bronto-mini.png" hash="7989c68c0e83b7b04af308780aa82259"/><file name="bronto_contact-mini.png" hash="e221b304ad42cba129a9dcf17ce5180e"/><file name="bronto_contact_import-mini.png" hash="a9e0904f7219be45fd1ed88c5b9a1650"/><file name="bronto_general-mini.png" hash="aca50d84fe324abbb36ff2853d9cad01"/><file name="bronto_help.png" hash="d0ed63d7c68e8b52583ce428b3846afc"/><file name="bronto_news-mini.png" hash="bb8b3beb16c10d8b38ddb11f3f4347e8"/><file name="bronto_newsletter-mini.png" hash="9c45a6dd689ad758cf927cb381621b35"/><file name="bronto_order_import-mini.png" hash="a2b13488fccfdd5b2194843800abadda"/><file name="bronto_reminders-mini.png" hash="c85bafdc82718769c8b801fd64e7bd72"/><file name="guide.png" hash="10c880d9e40f1283f99e02ce2d025a4f"/><file name="logo.png" hash="3b7c4cb9faf220091a5fbae3c7f87afa"/><file name="message_approved.gif" hash="465a056a3ba3d94367f51c3c0b751391"/><file name="message_not_approved.gif" hash="e4f28607f075a105e53fa3113d84bd26"/><file name="section_logo.png" hash="98f2570d14580cee2c6cf66cca540b39"/><file name="site_name.png" hash="fb2cc4e1e00cdc95a94c04fccfa5e1b3"/><file name="support.png" hash="0910e2eb718379d037ead6e0af9c4855"/></dir><dir name="js"><dir name="guider"><file name="README.html" hash="be17cdbc961dc921944cef4e7daa33c3"/><file name="README.md" hash="1c11ec7951035fe0611edded566901a0"/><file name="changelog.txt" hash="4c107fe228a620f6f3118b128e62c0b5"/><file name="clock.gif" hash="12aa3f72e722ac8e5eeb68823024278f"/><file name="component.json" hash="05fe7fcf63c00abd58efa072baa8248f"/><file name="guiders.css" hash="a6df4a6e2d4f3075e29841a6844ee30b"/><file name="guiders.jquery.json" hash="261d2b3a2d3a21e49a0153f0c8f2c3e9"/><file name="guiders.js" hash="42b1675f9d1a93b89d62e97f2db895bb"/><file name="guiders_arrows.png" hash="757812709656e9592d9d724a63624d0d"/><file name="guiders_x_button.jpg" hash="2af6c2b68534a8b2c48d0ddc14a5b801"/><file name="jquery.min.js" hash="0652da382b6fceb033dfe2b6c06d4d11"/><file name="promo_gmail.png" hash="4837435633204a9001b88c2d8ef451ed"/></dir><file name="jquery-1.10.2.js" hash="91515770ce8c55de23b306444d8ea998"/><file name="jquery-1.10.2.min.js" hash="628072e7212db1e8cdacb22b21752cda"/><file name="jquery-1.10.2.min.map" hash="6c3ccfc221d36777d383b6e04d0b8af9"/><file name="jquery-noconflict.js" hash="3179f2255b046d5f2e9a71e365287bef"/></dir><file name="news.css" hash="84d2866b08b706164c6e545767ff331a"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="bronto"><dir name="common"><file name="popup.phtml" hash="996c1d74465c319465bdfd1ee0b5845d"/></dir><dir name="emailcapture"><file name="js.phtml" hash="37b3d102efdd3685e09822615c72db3e"/></dir><dir name="newsletter"><file name="checkbox.phtml" hash="281d8b8a7a078965f6b8386c5a1c6136"/><file name="js.phtml" hash="c88851be407f642e13d0c563f537e3c2"/></dir><dir name="order"><file name="js.phtml" hash="e398cfbfe9df41feeadb251216422cd9"/><file name="redemption.phtml" hash="4a344720766b9ea957210fbb5059c605"/></dir></dir></dir><dir name="layout"><dir name="bronto"><file name="common.xml" hash="f1e7ee067163e84f2e3bfc5474b3647d"/><file name="emailcapture.xml" hash="b5d3b0efc5daffb5fa66561f690013d0"/><file name="newsletter.xml" hash="30e90ef74659bafca7f1cb7d36a63717"/><file name="order.xml" hash="2c74121ed741ca74dbb6958f59cb3d3b"/></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="bronto"><dir name="api"><file name="guide.phtml" hash="2bd6d0a65c67190e388c18aef0acfcc3"/></dir><dir name="common"><file name="about.phtml" hash="fa5886d9dba15226eec520916b7c4aa2"/><file name="cron.phtml" hash="80af8ca4a8e2c74449904748aeaf718b"/><file name="guide.phtml" hash="07bcf3ad2e6a9136888bbf4a8bf0b51d"/><file name="guiders.phtml" hash="790ac5e5f8df13753db5ac3e68d08d76"/><file name="suppressed.phtml" hash="3c724d43b2cef9b13532e6d2b8e05f06"/></dir><dir name="coupon"><file name="guide.phtml" hash="ad8749755efbc04c54318a1634507fc5"/></dir><dir name="customer"><file name="guide.phtml" hash="14e9b74f62bde430a6df96cf04ee94dc"/></dir><dir name="email"><file name="guide.phtml" hash="c8fe9f3cadf5e50d6f0e69979462c407"/><dir name="template"><file name="edit.phtml" hash="802ef394d1943f18d33d39d0b85dcc3d"/><file name="list.phtml" hash="e9eb7ffc48f9d17a21917d86ff18b0fc"/></dir></dir><dir name="news"><file name="guide.phtml" hash="19026e62d49476371edc4f9e7f68d2c1"/><file name="item.phtml" hash="7146fcc10eeb0bdc33a78ea8fe060f74"/></dir><dir name="newsletter"><file name="guide.phtml" hash="4d4ac3dc42265d9521ec75383da40a10"/></dir><dir name="order"><file name="guide.phtml" hash="831ff327cf49d198bec62ad968587593"/></dir><dir name="popup"><file name="guide.phtml" hash="6bd6240f1402a03dd0d5022b8c39b3ab"/></dir><dir name="product"><file name="guide.phtml" hash="db1f4d377f1026bd187270d6661f0d47"/><dir name="recommendation"><file name="button.phtml" hash="3583ae800ae50fcdee59cff78d2fe1d9"/><file name="default.phtml" hash="b90f72f90eb11e32c0a7c31cf04ee301"/><file name="edit.phtml" hash="74cfbb9a25506210ad1a446dbdaa8e89"/><file name="grid.phtml" hash="51e74eba64b3e2a898114c2ffb42f588"/><file name="preview.phtml" hash="0fbfb3c0834c2103a4e68e6d726c679b"/><file name="selected.js.phtml" hash="c200e113619846ba8a5e11273c60a6d4"/></dir></dir><dir name="reminder"><dir name="grid"><file name="container.phtml" hash="28518ad2522f1b213102eb52071ef247"/></dir><file name="guide.phtml" hash="db033c357b5e335b6d65a44fa78c7c7e"/></dir><dir name="reviews"><file name="guide.phtml" hash="caad8c25594859c554a1fa1e505c92f0"/></dir><dir name="verify"><dir name="advanced"><file name="observer.phtml" hash="775deb643169f76f72793873a258eac1"/></dir><file name="advanced.phtml" hash="8479f4762de8943de234407bbc80b679"/><dir name="conflictchecker"><file name="errors.phtml" hash="91adf7e31ce9ec1ae06c18adb489bf54"/></dir><file name="guide.phtml" hash="664368c479f04ef022e9f0f96b2b9eca"/><file name="installs.phtml" hash="34b6bd602043376f8c17ef7744a27537"/><dir name="permissionchecker"><file name="button.phtml" hash="0a98a58dcb6d28d768e83556e6e690bc"/><file name="errors.phtml" hash="6da7357831323392e3badcb1cc8268aa"/><file name="index.phtml" hash="628a80e9245642cb92cc75a6dd07d1d7"/></dir></dir></dir></dir><dir name="layout"><dir name="bronto"><file name="common.xml" hash="78716037b527736c77da53251c89e591"/><file name="email.xml" hash="be77c906770a0d818898a910b03cbe4f"/><file name="news.xml" hash="96d679b735d551a3e83fb71bfe2a7fca"/><file name="reminder.xml" hash="07186394676c6db016d00bdee53e8394"/><file name="verify.xml" hash="e5676df09f0a79bdedc314e2bfdb4b59"/></dir></dir></dir></dir></dir></target><target name="mage"><dir name="shell"><dir name="bronto"><file name="cron.php" hash="675049a8c5b735fcf35ea19e85b593ae"/><file name="fix.php" hash="2e567898588544863eb2eec2abd84562"/><file name="rewrite.php" hash="38f1c593dfc30e60d68f59381fd36d04"/></dir></dir></target></contents>
61
  <compatible/>
62
  <dependencies><required><php><min>5.2.13</min><max>6.0.0</max></php><extension><name>soap</name><min></min><max></max></extension><extension><name>openssl</name><min></min><max></max></extension></required></dependencies>
63
  </package>
1
  <?xml version="1.0"?>
2
  <package>
3
  <name>Bronto_Extension</name>
4
+ <version>2.4.0</version>
5
  <stability>stable</stability>
6
  <license uri="http://opensource.org/licenses/osl-3.0.php">OSL</license>
7
  <channel>community</channel>
55
  &lt;p /&gt;Bronto Software provides a cloud-based marketing platform for retailers to drive revenue through their email, mobile and social campaigns. The platform is used by over 1000 organizations worldwide, including Party City, Armani Exchange, Timex, Samsonite and Gander Mountain. Bronto is a Gold Magento Industry Partner and the leading self-service email marketing provider to the Internet Retailer Top 1000. Bronto is headquartered in Durham, NC with an office in London, UK. For more information, visit &lt;a href="http://bronto.com"&gt;bronto.com&lt;/a&gt;.&lt;/p&gt;</description>
56
  <notes>&lt;p /&gt;For installation and configuration instructions, as well as a full list of new features and known issues, please review the &lt;a href="http://a.bron.to/magento"&gt;Implementation Guide&lt;/a&gt;.</notes>
57
  <authors><author><name>Chris Geiss</name><user>BrontoSoftware</user><email>chris.geiss@bronto.com</email></author></authors>
58
+ <date>2014-09-26</date>
59
+ <time>20:21:26</time>
60
+ <contents><target name="magecommunity"><dir name="Bronto"><dir name="Common"><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><file name="About.php" hash="ceee3ef00dcfde90f82ce80a5119ed56"/><dir name="Cron"><file name="Error.php" hash="ccaf02afd320c2a60b271bcf728c723a"/><file name="Queue.php" hash="07a829044a251dbfdcc39fcdd0d643b9"/></dir><file name="Cron.php" hash="ff26632f20d0474d45ae0549634b4f7c"/><dir name="Form"><file name="Coupon.php" hash="aeb7bc95aa5404c25679a5dfe165f9fe"/><dir name="Field"><file name="Apitoken.php" hash="48fe102c7d74b7646de1e256f87cfe87"/><file name="Debug.php" hash="6b3e65c774d25184e88c43e7364d68b4"/><file name="Download.php" hash="6521c641550b7c747632fe25dd5982ed"/><file name="Hidden.php" hash="c514ae120d4dced7b92ea30a13f0e4ea"/><file name="Image.php" hash="9de445fac8d262bb023f123d1e4df9e5"/><file name="List.php" hash="907853b5009661b6b63a3a2947fc9c59"/><dir name="Support"><file name="Site.php" hash="9e0b6acae1053a90a7513a3791ee258c"/></dir><file name="Support.php" hash="f680904d05213ec4d43726b714cf2b69"/></dir><file name="Field.php" hash="932af08da6e8dc20e74e97894b1a2518"/><file name="Fieldset.php" hash="a3d41e7bfc09bd81942c6f32bc1d1782"/></dir><file name="Form.php" hash="557e5db7e358a42dd04fe737b6436393"/><file name="Guide.php" hash="2f283c5082306106c6793a53846ce403"/><file name="Support.php" hash="be33bc95f1f713205dd11fb59598e166"/><dir name="Suppressed"><file name="Reset.php" hash="50dfcb14e043c3128ac9c33dc14c2951"/></dir><file name="Suppressed.php" hash="064ad003588f58f65d6b827109ea2d94"/></dir></dir><dir name="Widget"><dir name="Button"><file name="Abstract.php" hash="8c082611a7e4131c897ae9f2ed1d6dcf"/><file name="Debug.php" hash="e841017705d9b45a33e8475144ff0587"/><file name="Download.php" hash="78de702f642111af6feb725b4dd0bf08"/></dir><dir name="Queue"><dir name="Button"><file name="Run.php" hash="d05c28fcd3f1ee0fb031ebb9d4fcfe39"/></dir></dir></dir></dir><file name="Popup.php" hash="37f63a3196ff4e533069753569b83ff6"/></dir><dir name="Helper"><file name="Api.php" hash="d384dce8135210e87a43505c95d4308f"/><file name="Contact.php" hash="261a6f75641e8b523f9732642244e8ce"/><file name="Coupon.php" hash="78ac7999b552137bcd703aac83a1c25a"/><file name="Data.php" hash="11f11a94b578d66331d6712a3ad4ffcf"/><file name="DataInterface.php" hash="d1691f590c315abd3178e769cf51fe2a"/><file name="Field.php" hash="7c208abd6c77057e1e400f6699be77df"/><file name="Message.php" hash="5484ec49ce8ab8fda12d9dc6c4c29c65"/><file name="Product.php" hash="26f4a3a9ff4f9f2b41b4934119a96dcf"/><file name="Salesrule.php" hash="6b7fcccb7b96f27b02ff864e7d9640dd"/><file name="Support.php" hash="8508894dcf753978b204a9748be64492"/></dir><dir name="Model"><file name="Api.php" hash="72817e825da18d2c88800385cd3c6eca"/><file name="Archive.php" hash="b613e811bb673c72e6cec6770ed48fa5"/><dir name="Coupon"><file name="Observer.php" hash="989b3f8674e4f16c0e419862046a7db5"/></dir><file name="Delivery.php" hash="1c43e226d7c174f655533299bbf15359"/><dir name="Email"><dir name="Template"><file name="Filter.php" hash="013c9a6ed0da521217c5b7190caaacec"/><file name="Templatefilter.php" hash="c3acf3b4be3dcce490b1e07c0ab68e38"/></dir><file name="Template.php" hash="b37d650d971388c8531d1384092c9dc5"/></dir><file name="Error.php" hash="8270252828229cad2c3b35f22e898b4d"/><file name="Keysentry.php" hash="706a60958eacbc7892757698a07eaf38"/><file name="List.php" hash="aed967bac320504ea48da9add2a45c9b"/><dir name="Mysql4"><dir name="Api"><file name="Collection.php" hash="9b589f17c2efee2866369d6fd0c73279"/></dir><file name="Api.php" hash="79e25f0be61ef7ce5066c676545ab19d"/><dir name="Error"><file name="Collection.php" hash="cdd8617db0383a5dd23787850c26bfe3"/></dir><file name="Error.php" hash="2959715e0def582a6a0ecdf6f6442701"/><dir name="Queue"><file name="Collection.php" hash="f01c3c398021de80f48482067aa00f83"/></dir><file name="Queue.php" hash="3cdfeee0097797c9fc5955f4e777b2b5"/></dir><file name="Observer.php" hash="65972074d1bedffeee30e6be05422566"/><file name="Queue.php" hash="ae1b3a518644d3b246b3e3c97332bb82"/><dir name="Resource"><file name="Abstract.php" hash="a490783520f05a9e6f20b29320941119"/><file name="Setup.php" hash="5b767cf65fc9a497fb6a407dde5c76f0"/></dir><file name="SoapClient.php" hash="38ea95b32c1271d3ac329979c4f5d7a0"/><dir name="System"><dir name="Config"><dir name="Backend"><dir name="Cron"><file name="Error.php" hash="38bbbcde58aa89e3f7be043a773feb26"/><file name="Queue.php" hash="4c869a3fcddd597d217f3c3d721ee272"/></dir><file name="Cron.php" hash="744f5d4fbfe19200fd07de86f9021c38"/><file name="Enable.php" hash="2b641958cfa59bd18992a8b92af99301"/><file name="Token.php" hash="fd46bd6b8654464753b8df647c7a38d9"/></dir><dir name="Source"><dir name="Contact"><file name="Status.php" hash="811a360bffa20b92d4a7bdea66a73168"/></dir><file name="Coupon.php" hash="acfb1c6c7c5d80170bda4a6852c4e140"/><dir name="Cron"><file name="Frequency.php" hash="3ef5bda79548019f9a7cb2007c6792f5"/><file name="Minutes.php" hash="136df1bc4c4723efdbe144ed7a08806e"/></dir><file name="Field.php" hash="7a4660fbc812dca134b69b3cef76ea57"/><file name="Image.php" hash="acb902acd1f8573887ed9d5a00410467"/><file name="Limit.php" hash="a84376a6e570e6929ed653ea2624b146"/><file name="List.php" hash="0f67a87fd2db14424d7981e647a0214b"/><file name="Message.php" hash="df1e893d9a4e065a729def494116306e"/><file name="Related.php" hash="abcdf472699f5857d7755f0423bd27dd"/><file name="Role.php" hash="5a55bad277b8723130035d79d6e5b98b"/><file name="SendOptions.php" hash="b30161eccdcb5fec0f25f41c4f6f3ed6"/><file name="Synclimit.php" hash="7a39c86388440f401437b23aeba2e740"/></dir></dir></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="DebugController.php" hash="475d0fe8b46eb8a85c25d4f511a25196"/><file name="GuidersController.php" hash="8eae4825b247191bd166224ac79ea655"/></dir><file name="CouponController.php" hash="621b110ec7f3a3ef9729ee769f8b875b"/></dir><dir name="etc"><file name="adminhtml.xml" hash="607b20af88d8bcb436ede8cfdbaeca73"/><file name="config.xml" hash="a14b3f25db5d58b62f0389f03fb54343"/><file name="system.xml" hash="d05e502a80bd1e8dc0b6ccd4801d9be2"/></dir><dir name="sql"><dir name="bronto_common_setup"><file name="mysql4-install-1.7.0.php" hash="c8459d26fdfea2fb9430e8829b3257e1"/><file name="mysql4-install-2.2.1.php" hash="f2a33e687c2a2ee784c63ca9ba58ad5f"/><file name="mysql4-install-2.3.0.php" hash="f0f0313161b5b70ccd9f05d59f8f5e2b"/><file name="mysql4-install-2.3.1.php" hash="f0f0313161b5b70ccd9f05d59f8f5e2b"/><file name="mysql4-upgrade-1.7.0-2.2.1.php" hash="f2a33e687c2a2ee784c63ca9ba58ad5f"/><file name="mysql4-upgrade-2.0.4-2.2.1.php" hash="f2a33e687c2a2ee784c63ca9ba58ad5f"/><file name="mysql4-upgrade-2.0.4.2-2.2.1.php" hash="f2a33e687c2a2ee784c63ca9ba58ad5f"/><file name="mysql4-upgrade-2.1.0-2.2.1.php" hash="f2a33e687c2a2ee784c63ca9ba58ad5f"/><file name="mysql4-upgrade-2.2.0-2.2.1.php" hash="f2a33e687c2a2ee784c63ca9ba58ad5f"/><file name="mysql4-upgrade-2.2.2-2.3.0.php" hash="a12992a210e88d94ee8a7a601b67e98a"/><file name="mysql4-upgrade-2.3.0-2.4.0.php" hash="ab9575fa7f6fef723f8fae321d34c982"/></dir></dir></dir><dir name="Customer"><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><file name="About.php" hash="bc63c93b5ff46fe2e6cb84a8c3249d12"/><file name="Cron.php" hash="418068c27078a2a4e56cdc36469f660b"/><dir name="Form"><dir name="Field"><file name="Rewardpoints.php" hash="c1918f7478737dcfba6b543fa006a4bc"/><file name="Storecredit.php" hash="489625264fff9d5a37621f1b80203099"/></dir><dir name="Fieldset"><dir name="Attributes"><file name="Address.php" hash="7871298d7b7410d5202b436a1f536d7c"/><file name="Customer.php" hash="b0060f6c8c71ec321387aa8071a5c483"/></dir><file name="Attributes.php" hash="ac2d13d9a181129592341a3fd022bcaf"/></dir></dir><file name="Suppressed.php" hash="490d859076b067d91edc13eee7b91de8"/></dir></dir><dir name="Widget"><dir name="Button"><file name="Mark.php" hash="0c84d1f0e6ce3867e76d19ac7c451218"/><file name="Reset.php" hash="6dd540765670c2955160365319b9af22"/><file name="Run.php" hash="2b6332568132b633a1ee208e8b555b5a"/><file name="Sync.php" hash="be611c057f18b5da9e31927fc1788365"/></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="9ab5f7d8f3b0c859291804fc30f68bd0"/></dir><dir name="Model"><dir name="Mysql4"><dir name="Queue"><file name="Collection.php" hash="5564536b725040d0652cba23e13e546e"/></dir><file name="Queue.php" hash="5aff6d99b2f3bf24cd2db7d0586f96ab"/><file name="Setup.php" hash="cb74c44bd42f407925a800fe3996d7a3"/></dir><file name="Observer.php" hash="062562816df0ce310c121c28bff6480b"/><file name="Queue.php" hash="7851ed2790e205473cf848c63a4f13a8"/><dir name="Resource"><file name="Customer.php" hash="86f081e728c9d9f22e28018406d9f601"/></dir><dir name="System"><dir name="Config"><dir name="Backend"><file name="Brontofield.php" hash="8f75a714e862b9ab1dfdabc6a3fce986"/><file name="Cron.php" hash="44d12cea40d1342ad065bd4aad936193"/><file name="Newfield.php" hash="118d2622277e919e1f316f0713f5a2b7"/></dir></dir></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="CustomerController.php" hash="7600760ed4af3e251efb533b3d3b8471"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="bb58fa0df1e07c2d88527fed1920ffc2"/><file name="config.xml" hash="e1a4673cdc939b1177c5ee2e8af678f6"/><file name="system.xml" hash="682080ce412a65f6bb7edf88504e5d45"/></dir><dir name="sql"><dir name="bronto_customer_setup"><file name="mysql4-install-1.0.0.php" hash="871c225318588b2804a05751bce45e1f"/><file name="mysql4-install-1.0.3.php" hash="79785fb104491dcc4713e55495f24ba0"/><file name="mysql4-upgrade-1.0.0-1.0.1.php" hash="1c00e987c9a1b1da70ad035ccdef194b"/><file name="mysql4-upgrade-1.0.1-1.0.2.php" hash="144999a033695bd72601f1f0e10de5e3"/><file name="mysql4-upgrade-1.0.2-1.0.3.php" hash="6e3c57a1c9272aa4b2d7d051a24ed87f"/></dir></dir></dir><dir name="Email"><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><file name="About.php" hash="ab71e0649d5af1fe64f665ada8895be9"/><file name="Settings.php" hash="59f952e7baeff59ef013a9f39572370e"/><dir name="Templates"><file name="Field.php" hash="0b4d17701e352b6c28cd5262d3cd8e0e"/><file name="Fieldset.php" hash="01fa6905eec117df32519c7e461e05f8"/><file name="Label.php" hash="fed0e19a1dde5592ba2efcc3aa6a2bba"/><file name="Sendtype.php" hash="d93029708ba002781e365cb0215022ce"/></dir><file name="Templates.php" hash="5811fe4b83f7dd5d6f0c7c78314cd31c"/></dir><dir name="Email"><dir name="Import"><file name="Edit.php" hash="32d4219613247ff59a59b5031284159c"/><dir name="Grid"><dir name="Renderer"><file name="Action.php" hash="4227539615a40aa44810dc58f98b0ee8"/></dir></dir><file name="Grid.php" hash="68e5bc81c99bc9cb5667384526743ee9"/></dir><file name="Import.php" hash="a2f378383faebc5c0fabcd46feb4d7e3"/><dir name="Log"><dir name="Grid"><dir name="Renderer"><file name="Customer.php" hash="ee83b754d1a91920a79918991aa76ca6"/><file name="Fields.php" hash="dc0d7cbd5065382ccf51ff3f84054563"/></dir></dir><file name="Grid.php" hash="591f4aefd4fa2f7b5f53653f0d7780a7"/></dir><file name="Log.php" hash="755439eace3c8e1f5ee3c657562c476d"/><dir name="Template"><dir name="Edit"><file name="Form.php" hash="c1b63c327ad420f175683b377c8574d4"/></dir><file name="Edit.php" hash="e76c3c82fc3c180041eeeb6251fecbaa"/><dir name="Grid"><dir name="Renderer"><file name="Action.php" hash="543cf476631d073e4de5ec59f1faf5b5"/><file name="Storename.php" hash="c5111a20ed0b3aed0078cecb1ae3d739"/></dir></dir><file name="Grid.php" hash="dd12032078cf00d0c65fc6d9d563492f"/></dir><file name="Template.php" hash="ea39c46962381b34377efa05ecbfa075"/></dir></dir></dir></dir><dir name="Helper"><file name="Contact.php" hash="60d8707e923f59ad7af130aa09557be0"/><file name="Data.php" hash="97923779bd8c367d572745d96b030cd5"/><file name="Field.php" hash="fc67415cbe73614fe0bbc29df7f93148"/><file name="Message.php" hash="7f5a80ce2a9a75324f8e5df9b3a318f4"/></dir><dir name="Model"><file name="Log.php" hash="1c9b060a801312c0b929806708a9ac1a"/><file name="Message.php" hash="02bf1f9bef1f4ce1909cc3d5c6331969"/><dir name="Mysql4"><dir name="Log"><file name="Collection.php" hash="0cc3245eea5df5ca8607fc4ca8aabf99"/></dir><file name="Log.php" hash="aef3718e6ea1de42152099aeb444782f"/><dir name="Message"><file name="Collection.php" hash="4ad21710a8a2c403e83dcf40ad6eda22"/></dir><file name="Message.php" hash="f225d9ac332aa3b0fea5ff094a336926"/><dir name="Template"><file name="Collection.php" hash="339fb475d2beb88a65051f043a1b73ff"/></dir><file name="Template.php" hash="496380271268f9f949afb2a2ce1bdbf9"/></dir><file name="Observer.php" hash="cd5b5e10dabdc615d77a99cb695d685c"/><dir name="Resource"><file name="Setup.php" hash="1379cb13744acc937302fb5c2c237b7f"/></dir><dir name="System"><dir name="Config"><dir name="Backend"><dir name="Templates"><file name="Field.php" hash="e6f28eb62a469792eb61ca1044aae764"/><file name="Sendtype.php" hash="18dadd39cdf47f6cdc95e168fe2012bc"/></dir><file name="Usebronto.php" hash="d9c1e9b77810c922b058d5f03f03b02e"/></dir><dir name="Source"><dir name="Email"><file name="Template.php" hash="a55d4003789eed3feebad2251c0484c1"/></dir><file name="Sendtype.php" hash="4cc496295bd5b4c2bf71eae9fd87f803"/></dir></dir></dir><dir name="Template"><file name="Import.php" hash="54b58a617a783f66493793a041abef2f"/><file name="Mailer.php" hash="4792fa983cec3d29aca946c393232b3b"/></dir><file name="Template.php" hash="f74e29c0fcc7528488e19f6aa89c57d7"/></dir><dir name="controllers"><dir name="Adminhtml"><dir name="System"><dir name="Email"><file name="LogController.php" hash="471e58f342857be6f023527c0a1d2981"/><file name="TemplateController.php" hash="22815e046154c7216adc85fa5411033d"/></dir></dir></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="2343ec1b1ac91db90d522cd64e797aa6"/><file name="config.xml" hash="d0c6a1e08711f87e72cedc0cf1abc5ff"/><file name="system.xml" hash="46419a7c31b60bd8a1e56a0ebaa2f184"/></dir><dir name="sql"><dir name="bronto_email_setup"><file name="mysql4-install-1.0.0.php" hash="516265312ede986c1a35a19b9e5bbfea"/><file name="mysql4-install-1.0.2.php" hash="327ac219e947d608fbf9d3209dd03bab"/><file name="mysql4-install-1.0.5.php" hash="327ac219e947d608fbf9d3209dd03bab"/><file name="mysql4-install-1.0.8.php" hash="b572625c1380dfffe3b089275ac1dc7e"/><file name="mysql4-install-1.1.2.php" hash="2824a3ef8b9308e577c792398598e08c"/><file name="mysql4-install-1.1.7.php" hash="f49bc2913b1c2375499f21f2ac9727cd"/><file name="mysql4-install-1.1.8.php" hash="afa3c83fbfe45fc193a7eda4af6afacb"/><file name="mysql4-install-1.1.9.php" hash="4509540dda05675ee192e0330effddd3"/><file name="mysql4-install-1.2.0.php" hash="153fc8a27833bda06046231eb0293230"/><file name="mysql4-install-1.2.1.php" hash="153fc8a27833bda06046231eb0293230"/><file name="mysql4-upgrade-1.0.0-1.0.2.php" hash="1f797c3f909d72219ef5d00017b10554"/><file name="mysql4-upgrade-1.0.2-1.0.5.php" hash="f2c83b65500d9df0fd10c2e6721f2bfe"/><file name="mysql4-upgrade-1.0.5-1.0.8.php" hash="cdbda7aa084e51b9b222c56e548462a6"/><file name="mysql4-upgrade-1.0.8-1.1.1.php" hash="f2c83b65500d9df0fd10c2e6721f2bfe"/><file name="mysql4-upgrade-1.1.1-1.1.2.php" hash="53cf783db35699cdc1fee692752fe8de"/><file name="mysql4-upgrade-1.1.2-1.1.7.php" hash="105868a6253471d3eeeea46c7af18aa9"/><file name="mysql4-upgrade-1.1.7-1.1.8.php" hash="0a4abaf8c787bf656e3163489eb5d29e"/><file name="mysql4-upgrade-1.1.8-1.1.9.php" hash="65b7c540763c1817fef6e4eb1ca6cb9b"/><file name="mysql4-upgrade-1.1.9-1.2.0.php" hash="41aa0b0e87d7f3d97388d5d2733defbd"/><file name="mysql4-upgrade-1.2.0-1.2.1.php" hash="4b67cf347973a21c234d04bd4d0aa904"/></dir></dir></dir><dir name="Emailcapture"><dir name="Block"><file name="Emailcapture.php" hash="9184205597ec0ff5b30732e39a8cb167"/></dir><dir name="Helper"><file name="Data.php" hash="4968f32e599a6fefe7b6876c486264ba"/></dir><dir name="Model"><dir name="Mysql4"><dir name="Queue"><file name="Collection.php" hash="104fe48ab81aa32769c95aae1b4e4988"/></dir><file name="Queue.php" hash="97ad38464595ed8a25aee9148d703e51"/></dir><file name="Observer.php" hash="041d29358d884b6a4444200d3a6e6b00"/><file name="Queue.php" hash="f95570e6972a31e17c9b4eb1d99aad07"/></dir><dir name="controllers"><file name="IndexController.php" hash="2162c4ce867cba627a66ba4c1b549e55"/></dir><dir name="etc"><file name="config.xml" hash="953a38982ad1ad62107558218b78d121"/><file name="system.xml" hash="7f748cfe607ca50519e51f8a9739feef"/></dir><dir name="sql"><dir name="bronto_emailcapture_setup"><file name="mysql4-install-1.0.0.php" hash="ff0cda179382b958d6a566963faae637"/></dir></dir></dir><dir name="News"><dir name="Block"><dir name="Adminhtml"><file name="ItemRender.php" hash="147c1b256abc1a3f0ffc9018d8af713d"/><file name="Redirect.php" hash="0b6928d1529e41c4e2ccc3a415e53bb8"/><dir name="System"><dir name="Config"><file name="About.php" hash="757f06422ff513218a9dfad2ff91cd0d"/><file name="Form.php" hash="853d55a3d7d5e73e87ae09f87f4764b9"/><file name="General.php" hash="8a19eee62442466ff28f23aa782e68c5"/><file name="News.php" hash="4fdda30cd100f4d1b57a74cb38a9b371"/><file name="Releases.php" hash="30f7b23081c69219473326620e6ccd06"/></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="79dd892352cda62c69ede789dcade61a"/></dir><dir name="Model"><file name="Item.php" hash="e3ce20de8f0422dcf00f389f5491e788"/><dir name="Mysql4"><dir name="Item"><file name="Collection.php" hash="6a79699559ffe750643c3f6da90d0280"/></dir><file name="Item.php" hash="bf9fae7b7e2241259dbdbe83623c3e6e"/></dir><file name="Observer.php" hash="236e8cec018d29f50c4aeff1f23f4880"/><dir name="Resource"><file name="Setup.php" hash="cb9d37d047d535b4928b279623283f30"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="AnnouncementController.php" hash="ca98e801e5503b04f4f60286e19edb2e"/></dir><file name="RouteController.php" hash="4819b7cab294e952238e2edb43a73c52"/></dir><dir name="etc"><file name="adminhtml.xml" hash="079a3f745967cc14906151cfcdc2c816"/><file name="config.xml" hash="590d56fb32cdb7460cbff22ab1bffa69"/><file name="system.xml" hash="ecd3a0edd0de407c85bb537a78c2380a"/></dir><dir name="sql"><dir name="bronto_news_setup"><file name="mysql4-install-1.0.0.php" hash="f574c4b2432334d0202d75ef71cb0006"/></dir></dir></dir><dir name="Newsletter"><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><file name="About.php" hash="b5d17d62df37034cd48ea3022e546724"/><file name="Cron.php" hash="4085792ad95b00e5c49a6d9226c6f1c2"/><file name="Suppressed.php" hash="981094eef35a29b7ee10d9ccf395d975"/></dir></dir><dir name="Widget"><dir name="Button"><file name="Mark.php" hash="fc5b7ca0c406b2677b8af8d19539ffa2"/><file name="Reset.php" hash="a2827fc3f6af2b94e1ed3bcc5989b015"/><file name="Run.php" hash="21e4d1c9eb2c882b967c5de6def6a97b"/><file name="Sync.php" hash="89112c7b858e9031050bcba50527b4d7"/></dir></dir></dir><dir name="Checkout"><dir name="Onepage"><file name="Newsletter.php" hash="cc98f4590cf2dfb4cbb584a47e440906"/></dir></dir></dir><dir name="Helper"><file name="Contact.php" hash="bc7ec83130b8614881cf9476b4884bbf"/><file name="Data.php" hash="b34622a3ed7fd6df8277b4079e763697"/></dir><dir name="Model"><dir name="Mysql4"><dir name="Queue"><file name="Collection.php" hash="b9c6858b2045ad66b7c331afba125d19"/></dir><file name="Queue.php" hash="4cf426f02c1e2889b77be9b6a105c91b"/></dir><file name="Observer.php" hash="f789fc60fc89b06094e178b4584a870b"/><file name="Queue.php" hash="a9ef5813d95abcd1ee89a0372a0cfeb8"/><dir name="Resource"><file name="Setup.php" hash="1f72a1f56aca455ea0d0289450e9edf5"/></dir><dir name="System"><dir name="Config"><dir name="Backend"><file name="Cron.php" hash="282c40a155af7ea22f646e931fdb6732"/></dir></dir></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="NewsletterController.php" hash="0a2ba62ab4c23e62111543769a4d8e1b"/></dir><file name="IndexController.php" hash="1a0abafaaa208e0d7600e340d0f829ce"/></dir><dir name="etc"><file name="adminhtml.xml" hash="b685d64860bf37a09330bd9f89f5bc3d"/><file name="config.xml" hash="4f33f6124fb207fab0f5b37d97bbfd25"/><file name="system.xml" hash="6d6b708cf242e608d93a141a5709a5d6"/></dir><dir name="sql"><dir name="bronto_newsletter_setup"><file name="mysql4-install-1.0.0.php" hash="0f21d5315bbc4c27d0d38f9cf8c99bf3"/><file name="mysql4-install-1.4.0.php" hash="4a779a923947af258688d01143a16362"/><file name="mysql4-install-1.4.4.php" hash="089b40f9419c2fd21af62df207327a20"/><file name="mysql4-install-1.4.5.php" hash="8e97902e5e83992e678ba6144ed130b5"/><file name="mysql4-install-1.4.6.php" hash="74d29bc9655aeafa381ba5dc5f53df69"/><file name="mysql4-install-1.4.7.php" hash="74d29bc9655aeafa381ba5dc5f53df69"/><file name="mysql4-upgrade-1.4.0-1.4.1.php" hash="7eeba27e7b5480c8b502c3805554e2de"/><file name="mysql4-upgrade-1.4.1-1.4.2.php" hash="32f724b99d88e037ade72c8a9f1e0da7"/><file name="mysql4-upgrade-1.4.2-1.4.3.php" hash="63c728bb0cd7fa83bb5536d4500548f4"/><file name="mysql4-upgrade-1.4.3-1.4.4.php" hash="4f08a427c7706ea0988bcdcca6072218"/><file name="mysql4-upgrade-1.4.4-1.4.5.php" hash="c49018730275134d72f0802e1bc4da47"/><file name="mysql4-upgrade-1.4.5-1.4.6.php" hash="7de96310cf9bfe375e3026ed5c934ce2"/><file name="mysql4-upgrade-1.4.6-1.4.7.php" hash="6e40d94220fc0f2305546f7a8d5e754a"/></dir></dir></dir><dir name="Order"><dir name="Block"><dir name="Adminhtml"><dir name="Sales"><dir name="Order"><dir name="View"><dir name="Tab"><file name="Info.php" hash="4caacae5f31c84f898be5798cc85b7b7"/></dir></dir></dir></dir><dir name="System"><dir name="Config"><file name="About.php" hash="332c01d15a8b75f9add5988f35519135"/><file name="Cron.php" hash="62d625df775ca2b81503b1c97c4f7e79"/><file name="Suppressed.php" hash="fd39306031d9b20dc050a69afbd32cd0"/></dir></dir><dir name="Widget"><dir name="Button"><file name="Mark.php" hash="beb088031b04ff6b168670efb129b229"/><file name="Reset.php" hash="4d64995d0f43ff3f3829287f8b8780f9"/><file name="Run.php" hash="700e3f9645a9e25e56ae1deb6764bf44"/><file name="Sync.php" hash="2ff1bf077cc56b3620fe87a494d7f770"/></dir></dir></dir><file name="Bta.php" hash="2ec920ce5a6ea57aff16c8d9cf89f7e9"/><file name="Redemption.php" hash="cb6bfc3d06e4f7287c8314f539fce0c5"/></dir><dir name="Helper"><file name="Data.php" hash="a6d53a06daacf81c8cca58d41ed9fbde"/></dir><dir name="Model"><dir name="Mysql4"><dir name="Queue"><file name="Collection.php" hash="d041d29b798d10821e041c5b89fb5889"/></dir><file name="Queue.php" hash="2b0ba0993a43cc6856647684ac30add9"/><file name="Setup.php" hash="05b0a2d4806e712410479a3e7c709fd8"/></dir><file name="Observer.php" hash="69dba178bd4c4348c5633d67b702c767"/><dir name="Order"><file name="Observer.php" hash="5a05f37813b04968a2274098fdf8b1f7"/></dir><file name="Queue.php" hash="a544dd6bc3525c82cdf98791c49da91a"/><dir name="Quote"><file name="Observer.php" hash="1633b1031f19bdd36145b1040d9d6692"/></dir><dir name="System"><dir name="Config"><dir name="Backend"><file name="Cron.php" hash="9bc2a90d644af8334aa22b952132b08f"/></dir><dir name="Source"><file name="Bulk.php" hash="77b7aa28a1e7912c2a23b45155a46623"/><file name="Description.php" hash="7f497c17388c360f239e2aa90d943b9c"/><dir name="Order"><file name="State.php" hash="8a570c595207a4ea2410372322717339"/></dir><file name="Price.php" hash="283cc883ded57664870d89b22b547b19"/></dir></dir></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="OrderController.php" hash="6b380e7c6d0905f29812e3a8bcaefc75"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="784d322d920c63e63bed37c50e1c04d1"/><file name="config.xml" hash="9fffc146d55066071d574cfd4160eba2"/><file name="system.xml" hash="4e300c446f1f090b7853507cbea59f07"/></dir><dir name="sql"><dir name="bronto_order_setup"><file name="mysql4-install-1.0.0.php" hash="4988c452cc0d367f34e9c33df0d4256d"/><file name="mysql4-install-1.1.8.php" hash="afd415c7bb5a81b18c6705293f3978e6"/><file name="mysql4-upgrade-1.0.0-1.1.6.php" hash="0c42c6e3539b0f07c76b4f2c582d110f"/><file name="mysql4-upgrade-1.1.6-1.1.7.php" hash="7c4d2c1feed28b964ea82373e625a11f"/><file name="mysql4-upgrade-1.1.7-1.1.8.php" hash="ae58d4271deb9c60e61214020d46e755"/></dir></dir></dir><dir name="Product"><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><file name="About.php" hash="f3e3d3f6bca7f3b065e25f22b5578d2e"/><file name="Cron.php" hash="53c81d5081e3d4204694c468eff18c39"/><file name="Information.php" hash="cc968073e785221272c6f924e7105036"/></dir><dir name="Recommendation"><file name="Default.php" hash="907b566bfb4bbe4e1c46749182556d77"/><dir name="Edit"><file name="Button.php" hash="d6685785f649dde452fca3a18c78530d"/><file name="Form.php" hash="e8f4faa97ff7dd334c1c5048c30e850d"/></dir><file name="Edit.php" hash="87c571a236297ce4d9b6e692a4ffa852"/><dir name="Grid"><dir name="Renderer"><file name="Action.php" hash="486077c93f6a3b2dd076bd3c9e7d529c"/><file name="Description.php" hash="2eeb64ad510ac9d4cdbb5edf99211b82"/><file name="Image.php" hash="122e3ae80a3a4c260d09374476174c84"/><file name="Price.php" hash="c4af2d40e24f895bba7681851ec8aec2"/><file name="Url.php" hash="b03b06cf5eea764706db123a4b55aefc"/></dir></dir><file name="Grid.php" hash="a8b024f5a89e2bffdd94db2220392fdb"/><dir name="Message"><file name="Form.php" hash="81f6f8f259e940a82f6626c2b74e89ca"/></dir><dir name="Preview"><file name="Form.php" hash="4c24d8207c53bca40dd7760c2402d9c6"/><file name="Grid.php" hash="e638266ee7e7c523b747bfb25fb834c2"/><file name="GridElement.php" hash="251201019431ab9596778b0290c71395"/></dir><file name="Preview.php" hash="abc472e9d896a6f417b2ffaa735ce373"/><dir name="Selected"><file name="Grid.php" hash="843022c5636af8e962503e53479f15c0"/><file name="Js.php" hash="dba81b98bd95dbebd22709efc1a3655c"/></dir></dir><file name="Recommendation.php" hash="121626c24b44ad88a918db07f97cfa66"/></dir><dir name="Widget"><dir name="Button"><file name="Run.php" hash="fe948d6a6a08f2876eeccd7db0c3a8b5"/></dir></dir></dir></dir><dir name="Helper"><file name="Data.php" hash="ffd05a5b97598c57462ef788aee89127"/></dir><dir name="Model"><dir name="Collect"><file name="Abstract.php" hash="71eadd31322d63c65626fb10a9b19a48"/><file name="Bestseller.php" hash="94195c2d3854a358bf777932243c4fed"/><file name="Crosssell.php" hash="3479888fc18d4160ee7695ac5fd4face"/><file name="Custom.php" hash="fdebb77a3ab630498c605bc028f370ac"/><file name="Mostviewed.php" hash="ee1e0ba6a74bf6af61c3b0a9806140dc"/><file name="New.php" hash="da42c2190202e931a46f9730398b42fe"/><file name="Recentlyviewed.php" hash="2e5c66216ccd815a9a90e33994cc0f9a"/><file name="Related.php" hash="bed15693d124080b58efe577517f7815"/><file name="Upsell.php" hash="d34c4852b4729fed13e34191f7e43671"/></dir><file name="Collect.php" hash="9e0fbec2533bd5f9b50f7dd5a8f0e67a"/><file name="Content.php" hash="da798d9df324c6919460983f8c2e378b"/><file name="Filter.php" hash="b52b98c7cd452bfdc779b70deb09eafa"/><dir name="Mysql4"><dir name="Recommendation"><file name="Collection.php" hash="92ae6f624c68d971439d16c79e3e1d08"/></dir><file name="Recommendation.php" hash="e99ebd40f8c942a33b743ad276db23c7"/></dir><file name="Observer.php" hash="de5635441fa96dc582b909fb96cee16e"/><file name="Recommendation.php" hash="50a473fd05c4871da36eb09b0a0f68e9"/><dir name="Resource"><file name="Setup.php" hash="336419abffb7d42a7a5c448c22242fdb"/></dir><dir name="System"><dir name="Config"><file name="Cron.php" hash="df7c9a3ff5318013f9afa0148d41fe84"/><dir name="Source"><file name="Recommendation.php" hash="479472b2ed049a745c12c6f499f13cc9"/></dir></dir></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="RecommendationsController.php" hash="a6bd974df2257971afc9188473f72a5f"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="e8eeed8f3589872c7e6e374557cfc613"/><file name="config.xml" hash="2e7dd871d1364b24106579513a341d2c"/><file name="system.xml" hash="8b2714eba1acaff27c046b082d9d97c8"/></dir><dir name="sql"><dir name="bronto_product_setup"><file name="mysql4-install-1.0.0.php" hash="d04672913acece60326290535f677514"/><file name="mysql4-install-1.0.1.php" hash="d04672913acece60326290535f677514"/><file name="mysql4-upgrade-1.0.0-1.0.1.php" hash="f7d62d97c57094418e943c62aebe9296"/></dir></dir></dir><dir name="Reminder"><dir name="Block"><dir name="Adminhtml"><dir name="Delivery"><dir name="Grid"><dir name="Renderer"><file name="Customer.php" hash="be1537b58943a2cc27982deb03ec9e39"/><file name="Fields.php" hash="04f0dc7c4a24769cfc68f1508e0d338b"/></dir></dir><file name="Grid.php" hash="472fa8302dae712fbf9a6b6f5ea80dd0"/></dir><file name="Delivery.php" hash="b0bd1dcede57f8dad8ba4416b26d3986"/><dir name="Promo"><file name="Notice.php" hash="437ce674b25c14e33e17e09a0d471176"/></dir><dir name="Reminder"><dir name="Edit"><file name="Form.php" hash="2db520c0f438affbf477801ddde7f9cf"/><dir name="Tab"><file name="Bronto.php" hash="70de5a5bf9647f67ce2f684e3f87c863"/><file name="Conditions.php" hash="71d7c0a13352ec3d5b19b6bc059238bb"/><file name="Customers.php" hash="2ba680131f4b31175c7425c0648c6807"/><file name="General.php" hash="eb05a598a2eafd88d2a199c286b11836"/></dir><file name="Tabs.php" hash="106e44febc4b6a7a3928c5dec68d6123"/></dir><file name="Edit.php" hash="783ca6f21744c56da930fd44ddc6e3a5"/><file name="Grid.php" hash="c87a852ef998ea17af709c0221abd15d"/></dir><file name="Reminder.php" hash="a55e63b29f9cafd9053696f60ffe993f"/><dir name="System"><dir name="Config"><file name="About.php" hash="8380b5e750fe0f2b5b95407c99d2e195"/><file name="Cron.php" hash="84100d0bffc2e16d84bc24577ba9c6bf"/><file name="Settings.php" hash="5d0042b1b2ad5df43856c0a68d63b3b4"/></dir></dir><dir name="Widget"><dir name="Grid"><dir name="Column"><dir name="Renderer"><file name="Email.php" hash="bcc3abd5bbbb5e8f6e19454850d2e8dd"/><file name="Id.php" hash="c35c0feeac92dce912bb8e3ad2cc7e6e"/></dir></dir></dir></dir></dir></dir><dir name="Helper"><file name="Contact.php" hash="4b3e67cf3a0ce095ca454fe4513c6e89"/><file name="Data.php" hash="240771ed9bd56278eb99731e29b9bfca"/><file name="Message.php" hash="b65f0a4095ab4671c57a26451b3cc524"/></dir><dir name="Model"><dir name="Condition"><file name="Abstract.php" hash="3e164c6f67c1ca26c0be533cd9fc1b0c"/><dir name="Combine"><file name="Abstract.php" hash="2a43ca00f8bc4ab36bc87654ad9c6191"/></dir></dir><file name="Delivery.php" hash="41c3912dc5b5cb28d828358c1e0f7bc4"/><dir name="Email"><file name="Message.php" hash="41a2e2068a8452d624df1b2e9343be2a"/></dir><dir name="Mysql4"><dir name="Customer"><file name="Collection.php" hash="577bd12e2df9940fe551fe41c96133cf"/></dir><dir name="Delivery"><file name="Collection.php" hash="1247c3f58061d41f66ee6b9483c200ca"/></dir><file name="Delivery.php" hash="3639d2739b29734ba8aa8950e67e9621"/><dir name="Rule"><file name="Collection.php" hash="a99264c81d15780f305b02cde1564461"/></dir><file name="Rule.php" hash="beee42ebadb7d20371dd06a23f5adae6"/></dir><file name="Observer.php" hash="299bca8979d361a027fe4ac1598df2f4"/><dir name="Resource"><file name="Setup.php" hash="71ad578ef666cd9810bad2ab8d854bed"/></dir><dir name="Rule"><dir name="Condition"><dir name="Cart"><file name="Amount.php" hash="b1bd2bd9aabb863184461b0594dad9b0"/><file name="Attributes.php" hash="74cfde1032d8d75241f7522ddc12e11d"/><file name="Combine.php" hash="660f6842b8c1a5acff2c3b4f12fc73a9"/><file name="Couponcode.php" hash="84ef3ecb8bcd57412af80a0d137335bb"/><file name="Itemsquantity.php" hash="50eae47f28bf3660ee0684c9037f5bf8"/><file name="Sku.php" hash="12a7af32e16e21d2a2e4e157c469d1e5"/><file name="Storeview.php" hash="c2310efcb3060e91bf2aab73b0ac8ca9"/><file name="Subcombine.php" hash="c8ad5b2c46116793e2f2df17fe0862c0"/><file name="Subselection.php" hash="0142065f76b4e24ec75b6685eea82642"/><file name="Totalquantity.php" hash="8e492fb70a94549b8d6adbc50b2a4e50"/><file name="Virtual.php" hash="cd12a3218daf4a447b4fd49141101305"/></dir><file name="Cart.php" hash="4d534abf3f1cf1459fe6713788efe66e"/><dir name="Combine"><file name="Root.php" hash="eb4b22b6554b507b61f3e6be30048b07"/></dir><file name="Combine.php" hash="2f15f1241aa71fd76bb511415c6882a3"/><dir name="Wishlist"><file name="Attributes.php" hash="0ecf162a2fc4225ce37de714da9e6210"/><file name="Combine.php" hash="279af17bec3eeb6a97243a93eb4e3f85"/><file name="Quantity.php" hash="8de8793029340cb8c813e0cf034f372d"/><file name="Sharing.php" hash="ad302122deb2065aa28b68748cfae492"/><file name="Storeview.php" hash="83716681ba30c6d4c48dada3a0973971"/><file name="Subcombine.php" hash="4804ad602e3cc622dbfcab4030dff1c2"/><file name="Subselection.php" hash="68d96f6943becdc728f2aa436a8ac4c7"/></dir><file name="Wishlist.php" hash="f5c474dd7b126d69a3e0f7000abd3a95"/></dir></dir><file name="Rule.php" hash="f4f2613bad459c90bc6ece46ea6684c3"/><dir name="System"><dir name="Config"><dir name="Backend"><file name="Allowsend.php" hash="61965e981ddd79976f0ee21b01e6a0ae"/><file name="Cron.php" hash="6e527885884985fca33236f40a7f3689"/></dir></dir></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="DeliveryController.php" hash="d4630eff20209e0d46b08a29b543979a"/><file name="RemindersController.php" hash="6cd60b0a9c33075640c5926d94a78405"/></dir><file name="LoadController.php" hash="0f94e459c7dc5858ffefb92f4238a663"/></dir><dir name="etc"><file name="adminhtml.xml" hash="baaae901f8ff9d2ab12b0158ed5a4ca7"/><file name="config.xml" hash="1803dc082d4ff31d2a653c8c5cf25e89"/><file name="system.xml" hash="794fa3826fa84526997e4f8c3ef2e4ef"/></dir><dir name="sql"><dir name="bronto_reminder_setup"><file name="mysql4-install-1.4.12.php" hash="eae3eb4a69de44df200c52001783a4f0"/><file name="mysql4-install-1.4.13.php" hash="12419b6117a9e0e10f565453feed8740"/><file name="mysql4-install-1.4.14.php" hash="be67c1c55e1781c652d0036984fd0866"/><file name="mysql4-install-1.4.15.php" hash="f2bc98906fc36bf0640b292851ab99e1"/><file name="mysql4-install-1.4.16.php" hash="e34c42b202a7435abe2fa46f01bde257"/><file name="mysql4-install-1.4.17.php" hash="26c94634150797a07af197a4a81f45f8"/><file name="mysql4-install-1.4.18.php" hash="00c690a98400102491ab8f998902960b"/><file name="mysql4-install-1.4.2.php" hash="07b5a7b8ef247def75617e92738f0950"/><file name="mysql4-upgrade-1.4.0-1.4.2.php" hash="fefa638ca0ed7c5bc80a1b67e27c8703"/><file name="mysql4-upgrade-1.4.10-1.4.11.php" hash="130a688eb03e4f476308d0d11c32141a"/><file name="mysql4-upgrade-1.4.11-1.4.12.php" hash="766c901369f06aaadc8ffde3befb4aaa"/><file name="mysql4-upgrade-1.4.12-1.4.13.php" hash="172b48942497efd2305eff260bc28d9c"/><file name="mysql4-upgrade-1.4.13-1.4.14.php" hash="3218dae864cac00ff74655160ad31663"/><file name="mysql4-upgrade-1.4.14-1.4.15.php" hash="2e842e4c18259590cdafd2139dd4eb7e"/><file name="mysql4-upgrade-1.4.15-1.4.16.php" hash="671f39e2f90faf1165d50b517be8e04f"/><file name="mysql4-upgrade-1.4.16-1.4.17.php" hash="d789e8fbb7e9dad163643b7b7d2f37b1"/><file name="mysql4-upgrade-1.4.17-1.4.18.php" hash="e80e8b4e0856af9bb2105c786eb99ee6"/><file name="mysql4-upgrade-1.4.2-1.4.9.php" hash="4692060e7c938aea129c53619f0b3c19"/><file name="mysql4-upgrade-1.4.9-1.4.10.php" hash="9698883135211d54a3c711fead02c187"/></dir><dir name="reference"><file name="saveMatchedCustomers.sql" hash="c4f32ee8be31f7a652369c148271a6c7"/></dir></dir></dir><dir name="Reviews"><dir name="Block"><dir name="Adminhtml"><dir name="Catalog"><dir name="Product"><dir name="Edit"><dir name="Tab"><file name="Abstract.php" hash="3bed66cfc7fa08358689299710826822"/><file name="Caretip.php" hash="3b18b5be0df73c006d6744ebf87fbfc5"/><file name="Reorder.php" hash="4fc01c619252f25c2f38607acd5bdaaa"/></dir></dir></dir></dir><dir name="Reviews"><file name="Delivery.php" hash="e5dde6fc2d949812bcbbe71ec74e8cca"/><dir name="Form"><file name="Abstract.php" hash="3e6827b6a373fccc10bc75e2ff3eeed7"/><file name="Caretip.php" hash="b8487305d93c4eebfbd4ae52eb4a5021"/><file name="Reorder.php" hash="ea03034d7ca60ca9253dcd64867d85e5"/></dir><dir name="Grid"><dir name="Renderer"><file name="Action.php" hash="9772c271c5fbb9e6d732ca96a90b602c"/><file name="Order.php" hash="c4c1549d9c8848207de6801866d2a790"/><file name="Product.php" hash="274e7ff5c86adccc850cc174df0a0f49"/></dir></dir><file name="Grid.php" hash="907429dc104e71ead6a53445d20173c7"/><file name="Typer.php" hash="9b9b9783a2f33ca31638c940fba83297"/></dir><dir name="Sales"><dir name="Order"><dir name="View"><dir name="Tab"><dir name="Post"><file name="Purchase.php" hash="31ac1dabea3ec76bf0ba0f2bd01f2ae1"/></dir></dir></dir></dir></dir><dir name="System"><dir name="Config"><file name="About.php" hash="b62835e11224c3e8cb7256715d145814"/></dir></dir></dir></dir><dir name="Helper"><file name="Contact.php" hash="a85da1e1cc10dd48ac88b84d91cb9a1d"/><file name="Data.php" hash="bec4ba161f7c49b7cc3d213405444a3b"/><file name="Message.php" hash="df3015f886b4dd283d280cf26ee69cc7"/></dir><dir name="Model"><file name="Log.php" hash="559f8faa8207e04b716c99efb39f3008"/><file name="Message.php" hash="ed6509dd6c71ff2ad62b5b129a949055"/><dir name="Mysql4"><dir name="Log"><file name="Collection.php" hash="4ffa6e9e2ce58805c19b3358062c68f0"/></dir><file name="Log.php" hash="b755cddb0b8827e5517402223b740815"/><dir name="Post"><dir name="Purchase"><file name="Collection.php" hash="58f2786d8436c66e453d50376b7bf969"/></dir><file name="Purchase.php" hash="2b6a01151a5d551dfe07442f3860ff86"/></dir><dir name="Queue"><file name="Collection.php" hash="76c646f42045cdc209e1a3487d69436a"/></dir><file name="Queue.php" hash="069d32dfa162f3ceca48aa85ceded03c"/></dir><file name="Observer.php" hash="89b9da1106c9e446ad7976e499e392a7"/><dir name="Post"><file name="Purchase.php" hash="afef25c85f0978430d8c3b1c5324a555"/></dir><dir name="Process"><file name="Context.php" hash="781abce4f8ada1a39808c7527f92e98f"/></dir><file name="Queue.php" hash="841ccaa124236a203c89bce120183537"/><dir name="Resource"><file name="Setup.php" hash="b1a587c6bc20cc5ca4957b125d7dd30d"/></dir><dir name="System"><dir name="Config"><dir name="Source"><file name="Hours.php" hash="4f249b60a8e753b6f052eb85349d4436"/><file name="Identity.php" hash="50db4cbe29f4d79f78e69fd961eaa7bc"/><file name="Message.php" hash="9a5e15326017cbebd7b59b5c80693685"/><file name="Orderstatus.php" hash="a6df006770b4e732ddb75e0d22bfa6fd"/></dir></dir></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="PostpurchaseController.php" hash="5bbd132ee44c0c56c06235b9c0f06dbf"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="751e6e96c1dc6287ac558dae15e94fd8"/><file name="config.xml" hash="d289ae94c996714e658ac78bc02dd5cf"/><file name="system.xml" hash="fe274e99bb9d64b37a236611397544c0"/></dir><dir name="sql"><dir name="bronto_reviews_setup"><file name="mysql4-install-0.0.1.php" hash="b3a6870f118426b57d1d71ebb55f2994"/><file name="mysql4-install-0.0.2.php" hash="692022168a3f54e94bf9520279842986"/><file name="mysql4-upgrade-0.0.1-0.0.2.php" hash="47646fea020e6b14feccb0407b3a94b8"/></dir></dir></dir><dir name="Verify"><dir name="Block"><dir name="Adminhtml"><dir name="System"><dir name="Config"><file name="About.php" hash="b50a08cd24985483cad82c76305da5ce"/><dir name="Advanced"><file name="Observersearch.php" hash="0351378eb6fbfa8e9b1cde55a9b589e5"/></dir><file name="Conflictchecker.php" hash="cf1736b689d1ef2b3f0b7d7d84b703ba"/><dir name="Form"><dir name="Field"><file name="Apitoken.php" hash="cb84fee5b4e18ca0092f385d6ede6711"/><file name="Button.php" hash="7041c0e923d9929796597160679bc94c"/><file name="Classpath.php" hash="c9c60b09c180960dd107d74f79b63edc"/><file name="Conflict.php" hash="3797f7f88329ecf4d5c9e3e48c9c89e5"/><file name="Events.php" hash="c88df55f9105d0aa5a1574bc37c5a8f8"/><file name="Index.php" hash="612cf825df2f10c0d4d00ac54f413aba"/><file name="Roundtrip.php" hash="4b84fb21a59f5939ab7361dcc816ce1d"/></dir><file name="Magecron.php" hash="109e8427d968973ec3d4b0e5de6e4064"/><file name="Permission.php" hash="e5185de6bc1976ee7497956cc9162a17"/></dir><file name="Installs.php" hash="522badf3dc895a2a914f5060daceb35f"/><file name="Permissionchecker.php" hash="6f0be4f5594afe1f6924b839db582180"/></dir></dir><dir name="Widget"><dir name="Button"><file name="Classpath.php" hash="1687def566fccc786c263d94b4c9c9b5"/><file name="Conflict.php" hash="473cda5cc65b9302efb3618c3b5af973"/><file name="Events.php" hash="3da5bc0026613dfd921a25a942fb3d7c"/><file name="Permissions.php" hash="b89e87e9b6848cde87a4f6343b3feb1a"/><file name="Runroundtrip.php" hash="5a98f930b382a7a0c01f3b346def4955"/><file name="Runtoken.php" hash="63a721c0a25bdbd58be941ba7c5d21c8"/></dir></dir></dir><file name="Conflictprinter.php" hash="05a32eca413a0eda87bcdb7bd0661642"/><file name="Permissionprinter.php" hash="8925da12d1e8dc5f180327dd94d18310"/></dir><dir name="Helper"><file name="Apitoken.php" hash="bc1f30a551a958011fbba91310cab77d"/><file name="Conflictchecker.php" hash="55e0aacf4cd6e9d2b4d52ebe21fe7850"/><file name="Data.php" hash="6622f73bf7af3e1e68ad27551fb7d920"/><file name="Permissionchecker.php" hash="da5fc3a69e6477299084d210aaaad6b7"/><file name="Roundtrip.php" hash="b5566d978e4e24cf06bee83ab92772fc"/></dir><dir name="Model"><dir name="Config"><file name="Blocks.php" hash="0000df779f3e1fb60350b14b8a6185e3"/><file name="Checker.php" hash="a38555d682b302967410b73ebab04b4f"/><file name="ConfigAbstract.php" hash="79024697562751ff46c939d9d680fc86"/><file name="ConfigInterface.php" hash="45cecfde48e4ef0657a6418019f02e4a"/><file name="Datastore.php" hash="fb5ea494075ce81380d1447c07fa052c"/><file name="Helpers.php" hash="1dc143d542d3fd85ccff785f913556f1"/><file name="Models.php" hash="3062f1f3c4950d965054afe6b75b4b0f"/><file name="Printer.php" hash="dfd6bfdcc94a1afb83ae6c3599abb21c"/><file name="Resources.php" hash="24bbf7de88b25250a81a2d7380d5baa2"/></dir><dir name="Contact"><file name="Builder.php" hash="9d578480a7e4c8fde2a33e698a9efced"/></dir><dir name="Core"><dir name="Config"><file name="Base.php" hash="c11b6cbaf1802d3c6ab58853b468f5d7"/><file name="Element.php" hash="8a7c9221a95c1317a8ae166e692a4ee0"/></dir><file name="Config.php" hash="91877cb5fb11c545f4c0b2069e1407b0"/></dir><dir name="Lib"><dir name="Varien"><dir name="Simplexml"><file name="Config.php" hash="076958ed612323869d2437872744ed2a"/><file name="Element.php" hash="a8c28fd3b6b00ad689d4850e79441dec"/></dir></dir></dir><dir name="Mysql4"><dir name="Core"><file name="Config.php" hash="3b8fb36a66a675c4d12926bceadb4ea5"/></dir></dir><dir name="Path"><dir name="Locator"><file name="Array.php" hash="42fd6c7004b0f02f954956563edde9a0"/><file name="Factory.php" hash="46007808ba897fa6816fb7771a2b18dd"/><file name="IteratorAbstract.php" hash="1debe4adc34aa5d60a94328fd67032da"/><file name="LocatorInterface.php" hash="b775ce0d189ef276c9bbeade7da67b4f"/><file name="Stack.php" hash="328481c9d963f653a95f333fb440bea5"/></dir></dir><dir name="Resource"><dir name="Core"><file name="Config.php" hash="aa2fb8c4fb153e742c690ab8bc8b5a75"/></dir><dir name="Db"><file name="Abstract.php" hash="d668c24c90f80bc197c83eb0a3e10aa6"/></dir></dir><file name="Roundtrip.php" hash="f2166b39afed3e32de4e03cfa3416ff6"/><dir name="System"><dir name="Config"><dir name="Backend"><file name="Magecron.php" hash="ba8b8f5ef43bed77ed03dba3e98df1df"/></dir><dir name="Source"><file name="Classtypes.php" hash="772cab11a7470a2dd68ece3688c68d6a"/><file name="Wsdlcache.php" hash="b7d9c1c4d271c03a7486fc86eec3b6d9"/></dir></dir></dir><dir name="Validator"><file name="Checker.php" hash="35799249fcc93b31ff12da539cfb0d84"/><file name="Directory.php" hash="aa05ae40ad0b7aaffffaa6063bd8561e"/><file name="File.php" hash="c29c1cd2140186dc67c5e62064b79c0f"/><dir name="Filter"><file name="PatternIterator.php" hash="c129a6ee0fb4a45ff52644da2c0abfa1"/></dir><file name="Group.php" hash="59ad6dd4232ee113e1fe8161a82148ba"/><file name="Owner.php" hash="69e1c54dca88532208ce1f35f4491d99"/><file name="Printer.php" hash="23a00ec415b8665e5457ac09939e2ab2"/><file name="ValidatorAbstract.php" hash="d043c743309f5d64640698953269ece6"/><file name="ValidatorInterface.php" hash="02f543af08eda65263f4b005f3b3bdaf"/></dir></dir><dir name="controllers"><dir name="Adminhtml"><file name="AdvancedController.php" hash="0942ed5d83442e97af40d4572c3e21f8"/><file name="ApitokenController.php" hash="f804594b22260cb597cc0e5cfe633093"/><file name="ConflictcheckerController.php" hash="1d23621c640eecf2a813121cfc23850b"/><file name="PermissioncheckerController.php" hash="2e254bd755cd9d05d7eb6865a2ffb0e7"/><file name="RoundtripController.php" hash="efb601f3ceca89885d031f06218b2a4d"/></dir></dir><dir name="etc"><file name="adminhtml.xml" hash="6daf92d1a6b994898af427448c6c1e44"/><file name="config.xml" hash="a4e251c636842385f7e9e9a1370ed8b5"/><file name="system.xml" hash="855eb0390cb0a198236cba9383749d54"/></dir></dir></dir></target><target name="mageetc"><dir name="modules"><file name="Bronto_All.xml" hash="5a9c06b6313882589765b9bcf0402bbb"/><file name="Bronto_Customer.xml" hash="a11c20f008ee2eae14baa3b549d5adee"/><file name="Bronto_Email.xml" hash="b7cdca4b15753edcefe8b9e0abb780bd"/><file name="Bronto_Newsletter.xml" hash="2115c5225e02ab5d4e56749cc5eff6ad"/><file name="Bronto_Order.xml" hash="63f1537add6088417945657bec98ffe9"/><file name="Bronto_Reminder.xml" hash="08503ab78994178b822ef9b0add243f9"/><file name="Bronto_Verify.xml" hash="ad72ea2ebfd99dbe2773b2735d0ec973"/><file name="Bronto_News.xml" hash="3496cd7578991889909fbd8daa170d2d"/><file name="Bronto_Reviews.xml" hash="23a398c055d062c4a5e19e72a0c2df95"/><file name="Bronto_Product.xml" hash="2805533fff08aef167af474799bd4faf"/><file name="Bronto_Emailcapture.xml" hash="98b59bbf388d6c715f345b8906bd2fa1"/></dir></target><target name="magelib"><dir name="Bronto"><dir name="Api"><dir name="Account"><file name="Exception.php" hash="1a851457b2a032fb6d149fe9ef111c57"/><file name="Row.php" hash="3ab1e97019ef87bcd464eeaabf652886"/></dir><file name="Account.php" hash="33b9ba8867fe69135391c26f98b5852a"/><dir name="Activity"><file name="Exception.php" hash="3ac1f2caea6465931cbf927f1033ec06"/><file name="Row.php" hash="de166130c57670bf486a783a4501e2d4"/></dir><file name="Activity.php" hash="f5f48488e40507bc108b35c599e4e5a2"/><dir name="ApiToken"><file name="Exception.php" hash="e06d0a4c9469da7333e6a596e9c37c5d"/><file name="Row.php" hash="f3742811cec1cbf0be583296b617dfbd"/></dir><file name="ApiToken.php" hash="65bbd18974bbbf620dc2df23bdeb4469"/><dir name="Contact"><file name="Exception.php" hash="809bdce6db3bb9c72a3173bb08c1b19e"/><file name="Row.php" hash="2e360d131c2abe19e154b5f3795a58f0"/></dir><file name="Contact.php" hash="55bab8398154e96db6b0ca3ed88718e0"/><dir name="ContentTag"><file name="Exception.php" hash="5a8bc58af480a574e8061c62ad5590b4"/><file name="Row.php" hash="e470d8bcd686d42a886e59d5184b5eed"/></dir><file name="ContentTag.php" hash="14f1cbefe1027338d28db301a1c2df3d"/><dir name="Conversion"><file name="Exception.php" hash="73dd991a663b99050428f54fc13fb433"/><file name="Row.php" hash="115d01ea0e0e6ade42fcab76dff71c35"/></dir><file name="Conversion.php" hash="60ec52dcfeda92294d1ab10bb29a486a"/><dir name="Delivery"><file name="Exception.php" hash="003dbb49ea3be65fe35dfa9b7ec743c5"/><file name="Recipient.php" hash="562bdc8d86b92ec293a338fdd7bf928a"/><file name="Row.php" hash="9c6149e74a305f62b9806df5a20e6a00"/></dir><file name="Delivery.php" hash="668dc6493cefe960c7dc8fe1fe87bf08"/><dir name="DeliveryGroup"><file name="Exception.php" hash="9291b2adb576a6781a0d624cc3288453"/><file name="Row.php" hash="29adb1f866cf1d24ef0abac19f95fbd0"/></dir><file name="DeliveryGroup.php" hash="7dd295b65f22e65dff3bf45c4336e985"/><file name="Exception.php" hash="bacb7c782ef7f612edaf3d39c20118ef"/><dir name="Field"><file name="Exception.php" hash="db651b9fa4b5161e3a32af49cc12cc64"/><file name="Predefined.php" hash="15fadb32175098d9ded60550d1748a4a"/><file name="Row.php" hash="6871d05f399a8a9dfa0742952eaa6481"/><file name="TypeGuesser.php" hash="1027ea97675a16cc964aa0d8ba63e642"/></dir><file name="Field.php" hash="32d5876335ec815acb50d3b4e7bf3ccd"/><dir name="List"><file name="Exception.php" hash="0f964fac998c89a0d4d515979bd81b98"/><file name="Row.php" hash="6516df43a1a94beee7b57fae71c27134"/></dir><file name="List.php" hash="ef240fe5e1422479a83291ad30b468ac"/><dir name="Login"><file name="ContactInformation.php" hash="bc1ce7f57c67fa21cd0881d0384a1cac"/><file name="Exception.php" hash="fff7546235b416b7008a9e4bd646fc19"/><file name="Row.php" hash="578553fcbf1941d0eb5890614c57ae91"/></dir><file name="Login.php" hash="a61cf5ac4c3ea76b03a71750e085df88"/><dir name="Message"><file name="Exception.php" hash="755f7f14cdb234931708968ac0bad4a4"/><file name="Row.php" hash="5732b5550c8c6444790f2f20e626ff08"/></dir><file name="Message.php" hash="cc3c9939757371ad7fd2d297df394621"/><dir name="MessageRule"><file name="Exception.php" hash="b0398ee96ed70c483f38b50f305e82a8"/><file name="Row.php" hash="8e7532184ee265a927a195ac36e5a518"/></dir><file name="MessageRule.php" hash="ae1b3f16683656066a83bcf9f2863710"/><file name="Object.php" hash="4ea2880431ac5761cbf7478d809577f6"/><dir name="Order"><file name="Exception.php" hash="8312e1a1ab46bcf88b72983bb11a6493"/><file name="Product.php" hash="3785f2f460fec6c18c6164176de52449"/><file name="Row.php" hash="1400de022188806bb94e98544c054ef6"/></dir><file name="Order.php" hash="ad690b37bc577879020d10e5ac70ef3d"/><dir name="Row"><file name="Exception.php" hash="4c1a45512e0912644f94a88d4298d3a9"/></dir><file name="Row.php" hash="259418b11987939378747a9c46fae1ae"/><dir name="Rowset"><file name="Exception.php" hash="b5202ed6f61bfe06b90f73c03ca28ffa"/><file name="Iterator.php" hash="9ea7a244b83e7b9318bfe8ed371a149f"/></dir><file name="Rowset.php" hash="3f40382933e2f392b6320fd79db720cd"/><dir name="Segment"><file name="Exception.php" hash="bd5c2302ef222ff55981cc38477a9310"/><file name="Row.php" hash="b840493b8b2c3cb6686de0e5bedfa2ba"/></dir><file name="Segment.php" hash="0cf99babff6169afa427f302c76023dd"/></dir><file name="Api.php" hash="17aace21dbebcab84a80091230ca03e9"/><file name="Observer.php" hash="21bc70d405fcd47b0473ac89fd3d4ae2"/><file name="SoapClient.php" hash="81dd0a8a8c15ac96280d2f1b6bb3311e"/><dir name="Util"><file name="Colors.php" hash="14313213b3a70c79a56c574523b9b90b"/><file name="CountryCodes.php" hash="4efb9c354d29a901368c46aab40f79d4"/><dir name="Retryer"><file name="FileRetryer.php" hash="bdc72ace54ace32081115442d28cb972"/><file name="RetryerException.php" hash="54b70d7abbc32b55649a193e8e70dcb5"/><file name="RetryerInterface.php" hash="cc57d5a02a55811a13a31ed9beff126f"/></dir><file name="Uuid.php" hash="ba62bdec6488ccb621e0bfd726c6107a"/></dir></dir></target><target name="mageskin"><dir name="adminhtml"><dir name="base"><dir name="default"><dir name="bronto"><file name="bronto.css" hash="ebc2f1ade554e3cad4bf0b091ff674d1"/><file name="cron.css" hash="99b49b9ec245e75b81e62e78605f106f"/><dir name="images"><file name="BrontoGuide.png" hash="be2bb3605cc5f1899ad996fcd2ceae84"/><file name="InstallStatusDisabled.png" hash="5cf8d7dd8ed623f8b38e6ea3ed89861a"/><file name="InstallStatusEnabled.png" hash="11ea6d1f0ba319b62ed1728e9b747108"/><file name="InstallStatusError.png" hash="91fdd0af3ffd20d0b8a77645bb9cfcdc"/><file name="ajax-loader-tr.gif" hash="1ae32bc8232ff2527c627e5b38eb319a"/><file name="bg_notifications.gif" hash="df73b8aa7e48bb56e0a644245aa3683f"/><file name="bronto-mini-off.png" hash="af2c6a5434604db0bb3a2cc4a51b5c77"/><file name="bronto-mini.png" hash="7989c68c0e83b7b04af308780aa82259"/><file name="bronto_contact-mini.png" hash="e221b304ad42cba129a9dcf17ce5180e"/><file name="bronto_contact_import-mini.png" hash="a9e0904f7219be45fd1ed88c5b9a1650"/><file name="bronto_general-mini.png" hash="aca50d84fe324abbb36ff2853d9cad01"/><file name="bronto_help.png" hash="d0ed63d7c68e8b52583ce428b3846afc"/><file name="bronto_news-mini.png" hash="bb8b3beb16c10d8b38ddb11f3f4347e8"/><file name="bronto_newsletter-mini.png" hash="9c45a6dd689ad758cf927cb381621b35"/><file name="bronto_order_import-mini.png" hash="a2b13488fccfdd5b2194843800abadda"/><file name="bronto_reminders-mini.png" hash="c85bafdc82718769c8b801fd64e7bd72"/><file name="guide.png" hash="10c880d9e40f1283f99e02ce2d025a4f"/><file name="logo.png" hash="3b7c4cb9faf220091a5fbae3c7f87afa"/><file name="message_approved.gif" hash="465a056a3ba3d94367f51c3c0b751391"/><file name="message_not_approved.gif" hash="e4f28607f075a105e53fa3113d84bd26"/><file name="section_logo.png" hash="98f2570d14580cee2c6cf66cca540b39"/><file name="site_name.png" hash="fb2cc4e1e00cdc95a94c04fccfa5e1b3"/><file name="support.png" hash="0910e2eb718379d037ead6e0af9c4855"/></dir><dir name="js"><dir name="guider"><file name="README.html" hash="be17cdbc961dc921944cef4e7daa33c3"/><file name="README.md" hash="1c11ec7951035fe0611edded566901a0"/><file name="changelog.txt" hash="4c107fe228a620f6f3118b128e62c0b5"/><file name="clock.gif" hash="12aa3f72e722ac8e5eeb68823024278f"/><file name="component.json" hash="05fe7fcf63c00abd58efa072baa8248f"/><file name="guiders.css" hash="a6df4a6e2d4f3075e29841a6844ee30b"/><file name="guiders.jquery.json" hash="261d2b3a2d3a21e49a0153f0c8f2c3e9"/><file name="guiders.js" hash="42b1675f9d1a93b89d62e97f2db895bb"/><file name="guiders_arrows.png" hash="757812709656e9592d9d724a63624d0d"/><file name="guiders_x_button.jpg" hash="2af6c2b68534a8b2c48d0ddc14a5b801"/><file name="jquery.min.js" hash="0652da382b6fceb033dfe2b6c06d4d11"/><file name="promo_gmail.png" hash="4837435633204a9001b88c2d8ef451ed"/></dir><file name="jquery-1.10.2.js" hash="91515770ce8c55de23b306444d8ea998"/><file name="jquery-1.10.2.min.js" hash="628072e7212db1e8cdacb22b21752cda"/><file name="jquery-1.10.2.min.map" hash="6c3ccfc221d36777d383b6e04d0b8af9"/><file name="jquery-noconflict.js" hash="3179f2255b046d5f2e9a71e365287bef"/></dir><file name="news.css" hash="84d2866b08b706164c6e545767ff331a"/></dir></dir></dir></dir></target><target name="magedesign"><dir name="frontend"><dir name="base"><dir name="default"><dir name="template"><dir name="bronto"><dir name="common"><file name="popup.phtml" hash="996c1d74465c319465bdfd1ee0b5845d"/></dir><dir name="emailcapture"><file name="js.phtml" hash="37b3d102efdd3685e09822615c72db3e"/></dir><dir name="newsletter"><file name="checkbox.phtml" hash="281d8b8a7a078965f6b8386c5a1c6136"/><file name="js.phtml" hash="c88851be407f642e13d0c563f537e3c2"/></dir><dir name="order"><file name="js.phtml" hash="e398cfbfe9df41feeadb251216422cd9"/><file name="redemption.phtml" hash="4a344720766b9ea957210fbb5059c605"/></dir></dir></dir><dir name="layout"><dir name="bronto"><file name="common.xml" hash="f1e7ee067163e84f2e3bfc5474b3647d"/><file name="emailcapture.xml" hash="b5d3b0efc5daffb5fa66561f690013d0"/><file name="newsletter.xml" hash="30e90ef74659bafca7f1cb7d36a63717"/><file name="order.xml" hash="2c74121ed741ca74dbb6958f59cb3d3b"/></dir></dir></dir></dir></dir><dir name="adminhtml"><dir name="default"><dir name="default"><dir name="template"><dir name="bronto"><dir name="api"><file name="guide.phtml" hash="2bd6d0a65c67190e388c18aef0acfcc3"/></dir><dir name="common"><file name="about.phtml" hash="fa5886d9dba15226eec520916b7c4aa2"/><file name="cron.phtml" hash="80af8ca4a8e2c74449904748aeaf718b"/><file name="guide.phtml" hash="07bcf3ad2e6a9136888bbf4a8bf0b51d"/><file name="guiders.phtml" hash="790ac5e5f8df13753db5ac3e68d08d76"/><file name="suppressed.phtml" hash="3c724d43b2cef9b13532e6d2b8e05f06"/></dir><dir name="coupon"><file name="guide.phtml" hash="3835858f4375e45d8e41b472c466b099"/></dir><dir name="customer"><file name="guide.phtml" hash="14e9b74f62bde430a6df96cf04ee94dc"/></dir><dir name="email"><file name="guide.phtml" hash="c8fe9f3cadf5e50d6f0e69979462c407"/><dir name="template"><file name="edit.phtml" hash="802ef394d1943f18d33d39d0b85dcc3d"/><file name="list.phtml" hash="e9eb7ffc48f9d17a21917d86ff18b0fc"/></dir></dir><dir name="news"><file name="guide.phtml" hash="19026e62d49476371edc4f9e7f68d2c1"/><file name="item.phtml" hash="7146fcc10eeb0bdc33a78ea8fe060f74"/></dir><dir name="newsletter"><file name="guide.phtml" hash="4d4ac3dc42265d9521ec75383da40a10"/></dir><dir name="order"><file name="guide.phtml" hash="831ff327cf49d198bec62ad968587593"/></dir><dir name="popup"><file name="guide.phtml" hash="6bd6240f1402a03dd0d5022b8c39b3ab"/></dir><dir name="product"><file name="guide.phtml" hash="db1f4d377f1026bd187270d6661f0d47"/><dir name="recommendation"><file name="button.phtml" hash="3583ae800ae50fcdee59cff78d2fe1d9"/><file name="default.phtml" hash="b90f72f90eb11e32c0a7c31cf04ee301"/><file name="edit.phtml" hash="74cfbb9a25506210ad1a446dbdaa8e89"/><file name="grid.phtml" hash="51e74eba64b3e2a898114c2ffb42f588"/><file name="preview.phtml" hash="0fbfb3c0834c2103a4e68e6d726c679b"/><file name="selected.js.phtml" hash="9a0e17f82f5745c531a58784c33a9ac9"/></dir></dir><dir name="reminder"><dir name="grid"><file name="container.phtml" hash="28518ad2522f1b213102eb52071ef247"/></dir><file name="guide.phtml" hash="db033c357b5e335b6d65a44fa78c7c7e"/></dir><dir name="reviews"><file name="guide.phtml" hash="d31d5473d270a1b473e50d28f8947d1f"/></dir><dir name="verify"><dir name="advanced"><file name="observer.phtml" hash="775deb643169f76f72793873a258eac1"/></dir><file name="advanced.phtml" hash="8479f4762de8943de234407bbc80b679"/><dir name="conflictchecker"><file name="errors.phtml" hash="91adf7e31ce9ec1ae06c18adb489bf54"/></dir><file name="guide.phtml" hash="664368c479f04ef022e9f0f96b2b9eca"/><file name="installs.phtml" hash="34b6bd602043376f8c17ef7744a27537"/><dir name="permissionchecker"><file name="button.phtml" hash="0a98a58dcb6d28d768e83556e6e690bc"/><file name="errors.phtml" hash="6da7357831323392e3badcb1cc8268aa"/><file name="index.phtml" hash="628a80e9245642cb92cc75a6dd07d1d7"/></dir></dir></dir></dir><dir name="layout"><dir name="bronto"><file name="common.xml" hash="78716037b527736c77da53251c89e591"/><file name="email.xml" hash="be77c906770a0d818898a910b03cbe4f"/><file name="news.xml" hash="96d679b735d551a3e83fb71bfe2a7fca"/><file name="reminder.xml" hash="07186394676c6db016d00bdee53e8394"/><file name="reviews.xml" hash="f0d9d6536228329145755af91cb8626a"/><file name="verify.xml" hash="e5676df09f0a79bdedc314e2bfdb4b59"/></dir></dir></dir></dir></dir></target><target name="mage"><dir name="shell"><dir name="bronto"><file name="cron.php" hash="675049a8c5b735fcf35ea19e85b593ae"/><file name="fix.php" hash="40b6636ea955d6ccacdd68432776a5f9"/><file name="review_migrate.php" hash="c4d7c4531bc2ac553535e8094da91b95"/><file name="rewrite.php" hash="38f1c593dfc30e60d68f59381fd36d04"/></dir></dir></target></contents>
61
  <compatible/>
62
  <dependencies><required><php><min>5.2.13</min><max>6.0.0</max></php><extension><name>soap</name><min></min><max></max></extension><extension><name>openssl</name><min></min><max></max></extension></required></dependencies>
63
  </package>
shell/bronto/fix.php CHANGED
@@ -17,6 +17,7 @@ class Bronto_Fix_Os_Script extends Mage_Shell_Abstract {
17
  * @var array
18
  */
19
  protected $_validTasks = array(
 
20
  'customer',
21
  'email',
22
  'emailcapture',
@@ -79,6 +80,7 @@ USAGE;
79
  Tasks:
80
 
81
  all All Bronto Extension Modules
 
82
  customer {$this->_getTaskName('customer')}
83
  email {$this->_getTaskName('email')}
84
  emailcapture {$this->_getTaskName('emailcapture')}
17
  * @var array
18
  */
19
  protected $_validTasks = array(
20
+ 'common',
21
  'customer',
22
  'email',
23
  'emailcapture',
80
  Tasks:
81
 
82
  all All Bronto Extension Modules
83
+ common {$this->_getTaskName('common')}
84
  customer {$this->_getTaskName('customer')}
85
  email {$this->_getTaskName('email')}
86
  emailcapture {$this->_getTaskName('emailcapture')}
shell/bronto/review_migrate.php ADDED
@@ -0,0 +1,118 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ // Can either be run from shell dir, modman, or cron
4
+ if (file_exists('abstract.php')) {
5
+ require_once 'abstract.php';
6
+ } else if (preg_match('/\.modman/', dirname(__FILE__))) {
7
+ require_once dirname(dirname(dirname(dirname(dirname(__FILE__))))) . '/shell/abstract.php';
8
+ } else {
9
+ require_once dirname(dirname(dirname(__FILE__))) . '/shell/abstract.php';
10
+ }
11
+
12
+ class Bronto_Reviews_Migration_Script extends Mage_Shell_Abstract
13
+ {
14
+ const MAX_STEP = 50;
15
+
16
+ private $_apis = array();
17
+ private $_staging = array();
18
+ private $_messages = array();
19
+ private $_realRun = false;
20
+
21
+ public function usageHelp()
22
+ {
23
+ return <<<USAGE
24
+ Usage: php -f bronto/review_migrate.php --run
25
+ USAGE;
26
+ }
27
+
28
+ protected function _prepareCollections()
29
+ {
30
+ foreach (Mage::app()->getStores() as $store) {
31
+ $this->_staging[$store->getId()] = array();
32
+ $this->_apis[$store->getId()] = Mage::helper('bronto_common')
33
+ ->getApi(null, 'store', $store->getId());
34
+ }
35
+ }
36
+
37
+ protected function _backfillLogs($storeId)
38
+ {
39
+ echo "Backfilling logs for store {$storeId}\n";
40
+ $api = $this->_apis[$storeId];
41
+ if ($api) {
42
+ $deliveryObject = $api->getDeliveryObject();
43
+ $messageObject = $api->getMessageObject();
44
+ $deliveryFilter = array('id' => array(), 'status' => 'unsent');
45
+ $lookupTable = array();
46
+ foreach ($this->_staging[$storeId] as $tuple) {
47
+ list($order, $entry) = $tuple;
48
+ $lookupTable[$entry->getDeliveryId()] = $order;
49
+ $deliveryFilter['id'][] = $entry->getDeliveryId();
50
+ if ($this->_realRun) {
51
+ $entry->delete();
52
+ }
53
+ }
54
+ if (!empty($lookupTable)) {
55
+ $actualNumbers = 0;
56
+ foreach ($deliveryObject->readAll($deliveryFilter, false, false)->iterate() as $row) {
57
+ if (array_key_exists($row->messageId, $this->_messages)) {
58
+ $message = $this->_messages[$row->messageId];
59
+ } else {
60
+ $message = $messageObject->createRow();
61
+ $message->id = $row->messageId;
62
+ $message->read();
63
+ }
64
+ $order = $lookupTable[$row->id];
65
+ $log = Mage::getModel('bronto_reviews/log')
66
+ ->setDeliveryDate($row->start)
67
+ ->setDeliveryId($row->id)
68
+ ->setMessageId($row->messageId)
69
+ ->setMessageName($message->name)
70
+ ->setCustomerEmail($order->getCustomerEmail())
71
+ ->setOrderId($order->getId())
72
+ ->setOrderIncrementId($order->getIncrementId())
73
+ ->setPostName(Mage::helper('bronto_reviews')->getPostLabel('settings'))
74
+ ->setStoreId($order->getStoreId())
75
+ ->setFields(serialize(array()));
76
+ if ($this->_realRun) {
77
+ $log->save();
78
+ }
79
+ $actualNumbers++;
80
+ }
81
+ echo " - Successfully filled {$actualNumbers} entries.\n";
82
+ }
83
+ }
84
+ unset($this->_staging[$storeId]);
85
+ $this->_staging[$storeId] = array();
86
+ }
87
+
88
+ public function run()
89
+ {
90
+ try {
91
+ $this->_realRun = $this->getArg('run') || $this->getArg('r');
92
+ if (!$this->_realRun) {
93
+ echo "Starting dry run...\n";
94
+ }
95
+ $this->_prepareCollections();
96
+ $entries = Mage::getModel('bronto_reviews/queue')->getCollection();
97
+ foreach ($entries as $entry) {
98
+ $order = Mage::getModel('sales/order')->load($entry->getOrderId());
99
+ if (!$order->getId()) {
100
+ continue;
101
+ }
102
+ $this->_staging[$order->getStoreId()][] = array($order, $entry);
103
+ if (count($this->_staging[$order->getStoreId()]) == self::MAX_STEP) {
104
+ $this->_backfillLogs($order->getStoreId());
105
+ }
106
+ }
107
+ foreach ($this->_staging as $storeId => $tuples) {
108
+ $this->_backfillLogs($storeId);
109
+ }
110
+ } catch (Exception $e) {
111
+ echo "No migration necessary...\n";
112
+ }
113
+ echo "Shutting down.\n";
114
+ }
115
+ }
116
+
117
+ $shell = new Bronto_Reviews_Migration_Script();
118
+ $shell->run();